userflow.js-self-hosted 0.1.1022169 → 0.1.1022200

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,2 +1,2 @@
1
- import{r as y,R as o}from"./vendor.react.js";import{i as _}from"./vendor.is-hotkey.js";import{o as de}from"./vendor.obj-str.js";import{r as W,e as ne,h as oe,o as fe,j as $,k as ae,l as pe,m as ge,p as re,a as we,q as C}from"./roots.js";import{m as U}from"./userflow.js";import{u as he}from"./client-context.js";import{u as ve}from"./use-window-resize.js";import{B as be}from"./BuilderBar.js";import"./vendor.core-js.js";import"./vendor.object-assign.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.i18next.js";import"./vendor.babel.runtime.js";import"./vendor.react-i18next.js";import"./Frame.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./stylesheets.js";import"./vendor.fortawesome.pro-regular-svg-icons.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./flow-condition-types.js";import"./vendor.date-fns.js";import"./iframe-reset.styl.js";import"./logomark.js";import"./vendor.fortawesome.pro-light-svg-icons.js";(function(){try{var p=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(p._sentryDebugIds=p._sentryDebugIds||{},p._sentryDebugIds[n]="f621213b-f030-4c92-be58-e7e0e67fe131",p._sentryDebugIdIdentifier="sentry-dbid-f621213b-f030-4c92-be58-e7e0e67fe131")}catch{}})();const ye=_("alt+s"),Ee=_("escape"),Re=_("u"),Ze=({state:p})=>{const{mode:n,elementType:m}=p,g=he(),S=y.useRef(null),[A,ie]=y.useState(!1),B=y.useRef(null),[V,le]=y.useState(null),[I,ce]=y.useState(()=>se()),M=y.useCallback(async(s,c)=>{if(s&&c){const l=S.current?.getFrame();l&&B.current&&(B.current.classList.add("userflowjs-element-selection-box--no-transition"),l.style.display="none",l.offsetWidth),re(),g.setSessionStorageState(d=>({...d,elementSelection:{...d.elementSelection,mode:"done"}}));const w=W(s),h=0,r=0,R=Math.round(ne()),T=Math.round(oe()),a=await g.getTargetEnv().captureScreenshot(h,r,R,T),E=d=>Math.round(d/$(1));c={...c,screenshotDataUrl:a,targetX1:E(w.left),targetY1:E(w.top-r),targetX2:E(w.right),targetY2:E(w.bottom-r),screenshotWidth:R,screenshotHeight:T}}g.setSessionStorageState(l=>({...l,activeApp:null,elementSelection:null})),g.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementResult",selectorData:c})},[g]),L=y.useCallback(s=>g.setSessionStorageState(c=>({...c,elementSelection:{...c.elementSelection,mode:s}})),[g]);return y.useEffect(()=>{if(!A||!S.current)return;const s=S.current.getFrame(),c=S.current.getRootEl();let l=c&&c.ownerDocument&&c.ownerDocument.defaultView;l===window&&(l=null);let w=null,h=null,r=null,R=null;const T=document.getElementById("userflow-ui"),a={capture:!0},E=()=>{window.cancelAnimationFrame(d);let e=null,t=null,v=null;if(h&&!T.contains(h)){let f=null,u=h;for(;u;){{const x=u.getBoundingClientRect();if(x.width===0&&x.height===0){u=O(u);continue}}if(f=we(u,{elementType:m}),f)break;u=O(u)}f?(t=f.el,e=f.selector):m===U.INPUT?v="No text input found here":v="Sorry, we can't select that element (yet!)"}r=t,w=e,le(v),q()};let d;const Y=()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(E)},q=()=>{window.cancelAnimationFrame(N);const e=B.current;if(!e)return;re();const t=$(ne()),v=$(oe());let f=v/2,u=t/2,x=v/2,H=t/2;const b=2;let J=b,Q=b,ee=b,te=b;if(r){const i=W(r),F=window.getComputedStyle(r);f=Math.max(0,i.top),u=Math.max(0,t-i.right),x=Math.max(0,v-i.bottom),H=Math.max(0,i.left),J=Math.max(b,C(F.borderTopLeftRadius)),Q=Math.max(b,C(F.borderTopRightRadius)),ee=Math.max(b,C(F.borderBottomLeftRadius)),te=Math.max(b,C(F.borderBottomRightRadius)),R=r}else if(R){const i=W(R);f=Math.max(0,i.top+i.height/2),u=Math.max(0,t-i.right+i.width/2),x=Math.max(0,v-i.bottom+i.height/2),H=Math.max(0,i.left+i.width/2)}e.style.top=`${f}px`,e.style.right=`${u}px`,e.style.bottom=`${x}px`,e.style.left=`${H}px`,e.style.borderTopLeftRadius=`${J}px`,e.style.borderTopRightRadius=`${Q}px`,e.style.borderBottomLeftRadius=`${ee}px`,e.style.borderBottomRightRadius=`${te}px`,r?document.body.classList.remove("userflowjs-body-with-element-selection--none"):document.body.classList.add("userflowjs-body-with-element-selection--none")};let N;const ue=()=>{window.cancelAnimationFrame(N),N=window.requestAnimationFrame(q)},z=()=>{ue()},k=e=>{if(ye(e)){e.preventDefault(),n==="select"?L("navigate"):n==="navigate"&&L("select");return}if(Ee(e)&&n==="select"){e.preventDefault(),M(null,null);return}if(Re(e)&&r){const t=O(r);if(t){e.preventDefault(),h=t,E();return}}},j=e=>{const t=e.composedPath()[0];!t||t===r||t.tagName==="BODY"||t.tagName==="HTML"||(h=t,Y())},D=()=>{h=null,Y()};s&&s.addEventListener("mouseenter",D);const P=e=>{e.preventDefault(),e.stopPropagation()},X=e=>{P(e)},Z=e=>{P(e)},G=e=>{if(P(e),I){const t=e.target;if(!r||!r.contains(t)){j(e);return}}w&&(M(r,w),K())};l&&l.addEventListener("keydown",k),n==="select"&&(document.body.addEventListener("mouseleave",D),document.body.classList.add("userflowjs-body-with-element-selection"));const me=fe(e=>{const t=e.ownerDocument.defaultView;t&&(t.addEventListener("keydown",k,a),n==="select"&&(t.addEventListener("scroll",z,a),e.addEventListener("mousemove",j,a),e.addEventListener("mousedown",X,a),e.addEventListener("focus",Z,a),e.addEventListener("click",G,a)))},e=>{const t=e.ownerDocument.defaultView;t&&(t.removeEventListener("keydown",k,a),n==="select"&&(t.removeEventListener("scroll",z,a),ae(e)||e.removeEventListener("mousemove",j,a),e.removeEventListener("mousedown",X,a),e.removeEventListener("focus",Z,a),e.removeEventListener("click",G,a)))}),K=()=>{window.cancelAnimationFrame(d),window.cancelAnimationFrame(N),document.body.removeEventListener("mouseleave",D),l&&l.removeEventListener("keydown",k),s&&s.removeEventListener("mouseenter",D),document.body.classList.remove("userflowjs-body-with-element-selection"),document.body.classList.remove("userflowjs-body-with-element-selection--none"),me()};return K},[I,g,n,A,m,M,L]),ve(()=>ce(se())),o.createElement(o.Fragment,null,o.createElement(be,{ref:S,onReadyChange:ie,buttons:o.createElement(o.Fragment,null,n==="navigate"?o.createElement("button",{key:"select",className:"btn btn--default",onMouseDown:s=>{s.preventDefault(),s.stopPropagation(),L("select")}},o.createElement("span",{className:"hidden-lg-up"},"Select here"),o.createElement("span",{className:"hidden-md-down"},"Select element here (Alt + S)")):n==="select"?o.createElement("button",{key:"navigate",className:"btn btn--default",onMouseDown:s=>{s.preventDefault(),s.stopPropagation(),L("navigate")}},o.createElement("span",{className:"hidden-lg-up"},"Navigate"),o.createElement("span",{className:"hidden-md-down"},"Navigate to another page (Alt + S)")):null,(n==="select"||n==="navigate")&&o.createElement("button",{className:"btn btn--secondary-on-dark",onClick:()=>M(null,null)},"Cancel"))},n==="navigate"?o.createElement("div",{className:"status"},"Navigate to the page the element appears on"):V?o.createElement("div",{className:"error"},V):o.createElement("div",{className:"status"},I?o.createElement(o.Fragment,null,"Tap"," ",m===U.INPUT?"a text input":"an element"," ","to focus. Tap again to select."):o.createElement(o.Fragment,null,"Click"," ",m===U.INPUT?"a text input":"an element"," ","to select it"))),A&&(n==="select"||n==="done")&&o.createElement("div",{className:de({"userflowjs-element-selection-box":!0}),ref:B}))};function O(p){const n=p.parentNode;if(!n)return null;if(ae(n))return n.host;if(!pe(n))return null;if(n.tagName==="BODY"){const m=ge(n);return m||null}return n}function se(){return window.navigator.userAgent.includes("Mobile")}export{Ze as ElementSelectionApp,Ze as default};
1
+ import{r as y,R as o}from"./vendor.react.js";import{i as _}from"./vendor.is-hotkey.js";import{o as de}from"./vendor.obj-str.js";import{r as W,e as ne,h as oe,p as fe,o as pe,j as $,k as ae,l as ge,m as we,q as re,a as he,s as C}from"./roots.js";import{m as U}from"./userflow.js";import{u as be}from"./client-context.js";import{u as ve}from"./use-window-resize.js";import{B as ye}from"./BuilderBar.js";import"./vendor.core-js.js";import"./vendor.object-assign.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.i18next.js";import"./vendor.babel.runtime.js";import"./vendor.react-i18next.js";import"./Frame.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./stylesheets.js";import"./vendor.fortawesome.pro-regular-svg-icons.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./flow-condition-types.js";import"./vendor.date-fns.js";import"./iframe-reset.styl.js";import"./logomark.js";import"./vendor.fortawesome.pro-light-svg-icons.js";(function(){try{var p=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(p._sentryDebugIds=p._sentryDebugIds||{},p._sentryDebugIds[n]="60024bb5-8df7-46e4-8567-6afcc4db813c",p._sentryDebugIdIdentifier="sentry-dbid-60024bb5-8df7-46e4-8567-6afcc4db813c")}catch{}})();const Ee=_("alt+s"),Re=_("escape"),xe=_("u"),Ge=({state:p})=>{const{mode:n,elementType:u}=p,g=be(),S=y.useRef(null),[A,ie]=y.useState(!1),T=y.useRef(null),[V,le]=y.useState(null),[I,ce]=y.useState(()=>se()),M=y.useCallback(async(s,c)=>{if(s&&c){const l=S.current?.getFrame();l&&T.current&&(T.current.classList.add("userflowjs-element-selection-box--no-transition"),l.style.display="none",l.offsetWidth),re(),g.setSessionStorageState(d=>({...d,elementSelection:{...d.elementSelection,mode:"done"}}));const w=W(s),h=0,r=0,R=Math.round(ne()),B=Math.round(oe()),a=await g.getTargetEnv().captureScreenshot(h,r,R,B),E=d=>Math.round(d/$(1));c={...c,screenshotDataUrl:a,targetX1:E(w.left),targetY1:E(w.top-r),targetX2:E(w.right),targetY2:E(w.bottom-r),screenshotWidth:R,screenshotHeight:B}}g.setSessionStorageState(l=>({...l,activeApp:null,elementSelection:null})),g.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementResult",selectorData:c})},[g]),L=y.useCallback(s=>g.setSessionStorageState(c=>({...c,elementSelection:{...c.elementSelection,mode:s}})),[g]);return y.useEffect(()=>{if(!A||!S.current)return;const s=S.current.getFrame(),c=S.current.getRootEl();let l=c&&c.ownerDocument&&c.ownerDocument.defaultView;l===window&&(l=null);let w=null,h=null,r=null,R=null;const B=document.getElementById("userflow-ui"),a={capture:!0};fe(B);const E=()=>{window.cancelAnimationFrame(d);let e=null,t=null,b=null;if(h&&!B.contains(h)){let f=null,m=h;for(;m;){{const x=m.getBoundingClientRect();if(x.width===0&&x.height===0){m=O(m);continue}}if(f=he(m,{elementType:u}),f)break;m=O(m)}f?(t=f.el,e=f.selector):u===U.INPUT?b="No text input found here":b="Sorry, we can't select that element (yet!)"}r=t,w=e,le(b),q()};let d;const Y=()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(E)},q=()=>{window.cancelAnimationFrame(N);const e=T.current;if(!e)return;re();const t=$(ne()),b=$(oe());let f=b/2,m=t/2,x=b/2,H=t/2;const v=2;let J=v,Q=v,ee=v,te=v;if(r){const i=W(r),F=window.getComputedStyle(r);f=Math.max(0,i.top),m=Math.max(0,t-i.right),x=Math.max(0,b-i.bottom),H=Math.max(0,i.left),J=Math.max(v,C(F.borderTopLeftRadius)),Q=Math.max(v,C(F.borderTopRightRadius)),ee=Math.max(v,C(F.borderBottomLeftRadius)),te=Math.max(v,C(F.borderBottomRightRadius)),R=r}else if(R){const i=W(R);f=Math.max(0,i.top+i.height/2),m=Math.max(0,t-i.right+i.width/2),x=Math.max(0,b-i.bottom+i.height/2),H=Math.max(0,i.left+i.width/2)}e.style.top=`${f}px`,e.style.right=`${m}px`,e.style.bottom=`${x}px`,e.style.left=`${H}px`,e.style.borderTopLeftRadius=`${J}px`,e.style.borderTopRightRadius=`${Q}px`,e.style.borderBottomLeftRadius=`${ee}px`,e.style.borderBottomRightRadius=`${te}px`,r?document.body.classList.remove("userflowjs-body-with-element-selection--none"):document.body.classList.add("userflowjs-body-with-element-selection--none")};let N;const me=()=>{window.cancelAnimationFrame(N),N=window.requestAnimationFrame(q)},z=()=>{me()},k=e=>{if(Ee(e)){e.preventDefault(),n==="select"?L("navigate"):n==="navigate"&&L("select");return}if(Re(e)&&n==="select"){e.preventDefault(),M(null,null);return}if(xe(e)&&r){const t=O(r);if(t){e.preventDefault(),h=t,E();return}}},j=e=>{const t=e.composedPath()[0];!t||t===r||t.tagName==="BODY"||t.tagName==="HTML"||(h=t,Y())},D=()=>{h=null,Y()};s&&s.addEventListener("mouseenter",D);const P=e=>{e.preventDefault(),e.stopPropagation()},X=e=>{P(e)},Z=e=>{P(e)},G=e=>{if(P(e),I){const t=e.target;if(!r||!r.contains(t)){j(e);return}}w&&(M(r,w),K())};l&&l.addEventListener("keydown",k),n==="select"&&(document.body.addEventListener("mouseleave",D),document.body.classList.add("userflowjs-body-with-element-selection"));const ue=pe(e=>{const t=e.ownerDocument.defaultView;t&&(t.addEventListener("keydown",k,a),n==="select"&&(t.addEventListener("scroll",z,a),e.addEventListener("mousemove",j,a),e.addEventListener("mousedown",X,a),e.addEventListener("focus",Z,a),e.addEventListener("click",G,a)))},e=>{const t=e.ownerDocument.defaultView;t&&(t.removeEventListener("keydown",k,a),n==="select"&&(t.removeEventListener("scroll",z,a),ae(e)||e.removeEventListener("mousemove",j,a),e.removeEventListener("mousedown",X,a),e.removeEventListener("focus",Z,a),e.removeEventListener("click",G,a)))}),K=()=>{window.cancelAnimationFrame(d),window.cancelAnimationFrame(N),document.body.removeEventListener("mouseleave",D),l&&l.removeEventListener("keydown",k),s&&s.removeEventListener("mouseenter",D),document.body.classList.remove("userflowjs-body-with-element-selection"),document.body.classList.remove("userflowjs-body-with-element-selection--none"),ue()};return K},[I,g,n,A,u,M,L]),ve(()=>ce(se())),o.createElement(o.Fragment,null,o.createElement(ye,{ref:S,onReadyChange:ie,buttons:o.createElement(o.Fragment,null,n==="navigate"?o.createElement("button",{key:"select",className:"btn btn--default",onMouseDown:s=>{s.preventDefault(),s.stopPropagation(),L("select")}},o.createElement("span",{className:"hidden-lg-up"},"Select here"),o.createElement("span",{className:"hidden-md-down"},"Select element here (Alt + S)")):n==="select"?o.createElement("button",{key:"navigate",className:"btn btn--default",onMouseDown:s=>{s.preventDefault(),s.stopPropagation(),L("navigate")}},o.createElement("span",{className:"hidden-lg-up"},"Navigate"),o.createElement("span",{className:"hidden-md-down"},"Navigate to another page (Alt + S)")):null,(n==="select"||n==="navigate")&&o.createElement("button",{className:"btn btn--secondary-on-dark",onClick:()=>M(null,null)},"Cancel"))},n==="navigate"?o.createElement("div",{className:"status"},"Navigate to the page the element appears on"):V?o.createElement("div",{className:"error"},V):o.createElement("div",{className:"status"},I?o.createElement(o.Fragment,null,"Tap"," ",u===U.INPUT?"a text input":"an element"," ","to focus. Tap again to select."):o.createElement(o.Fragment,null,"Click"," ",u===U.INPUT?"a text input":"an element"," ","to select it"))),A&&(n==="select"||n==="done")&&o.createElement("div",{className:de({"userflowjs-element-selection-box":!0}),ref:T}))};function O(p){const n=p.parentNode;if(!n)return null;if(ae(n))return n.host;if(!ge(n))return null;if(n.tagName==="BODY"){const u=we(n);return u||null}return n}function se(){return window.navigator.userAgent.includes("Mobile")}export{Ge as ElementSelectionApp,Ge as default};
2
2
  //# sourceMappingURL=ElementSelectionApp.js.map
package/FlowChrome.js CHANGED
@@ -1,3 +1,3 @@
1
- import{S as we,T as Te,N as Ee,D as ye}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{R as p,r as i}from"./vendor.react.js";import{D as Ht,u as ve,g as Be}from"./stylesheets.js";import"./vendor.core-js.js";import{u as ce}from"./vendor.react-i18next.js";import{F as re}from"./Frame.js";import{G,r as v,v as ut,F as Le,w as N,a4 as Me,a3 as f}from"./userflow.js";import{u as ke,f as Re}from"./flow-host.styl.js";import{u as je,b as Pe}from"./use-selector-element-monitoring.js";import{u as Ne}from"./use-window-resize.js";import{S as Oe}from"./logomark.js";import{o as zt}from"./vendor.obj-str.js";import{h as Gt,e as Ct,j as nt,t as Ie,l as ie,M as ne,q as Dt,u as xe,p as _e}from"./roots.js";import{u as He}from"./use-confetti.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7913c625-9d20-47ab-b23f-cce4fb2cf5b8",e._sentryDebugIdIdentifier="sentry-dbid-7913c625-9d20-47ab-b23f-cce4fb2cf5b8")}catch{}})();const so=({draftMode:e,muted:t,toggleMuted:o,close:w,minimize:E})=>{const{t:c}=ce();return p.createElement("div",{className:"userflowjs-bubble-toolbar"},e&&p.createElement("div",{className:"userflowjs-bubble-draft"},typeof e=="string"?e:"Preview"),o&&p.createElement("button",{className:"userflowjs-bubble-toolbar-button",onClick:o,"aria-label":t?"Unmute":"Mute"},t?p.createElement(Ht,{icon:we}):p.createElement(Ht,{icon:Te})),E&&p.createElement("button",{"data-testid":"minimize-button",className:"userflowjs-bubble-toolbar-button",onClick:E,"aria-label":"Minimize checklist"},p.createElement(Ht,{icon:Ee})),w&&p.createElement("button",{"data-testid":"close-button",className:"userflowjs-bubble-toolbar-button",onClick:w,"aria-label":c("menu.close")},p.createElement(Ht,{icon:ye})))},De=new URL("avatar-frame.css",import.meta.url).href;function Ce(e,t){const o=window.Intercom;i.useEffect(()=>{if(!(!t||!e.autoHideIntercom||typeof o!="function"||G.autoHide3pDisabled)){try{o("update",{hide_default_launcher:!0})}catch(a){console.warn("Userflow.js: Error when hiding Intercom launcher",a)}return()=>{if(!G.autoHide3pDisabled)try{o("update",{hide_default_launcher:!1})}catch(a){console.warn("Userflow.js: Error when unhiding Intercom launcher",a)}}}},[o,e.autoHideIntercom,t]);const w=window.$crisp;i.useEffect(()=>{if(!(!t||!e.autoHideCrisp||!w||G.autoHide3pDisabled)){try{w.push(["do","chat:hide"])}catch(a){console.warn("Userflow.js: Error when hiding Crisp Chat",a)}return()=>{if(!G.autoHide3pDisabled)try{w.push(["do","chat:show"])}catch(a){console.warn("Userflow.js: Error when unhiding Crisp Chat",a)}}}},[w,e.autoHideCrisp,t]);const E=window.HubSpotConversations;i.useEffect(()=>{if(!(!t||!e.autoHideHubspot||!E||G.autoHide3pDisabled)){try{E.widget.remove()}catch(a){console.warn("Userflow.js: Error when hiding HubSpot Chat",a)}return()=>{if(!G.autoHide3pDisabled)try{E.widget.load()}catch(a){console.warn("Userflow.js: Error when unhiding HubSpot Chat",a)}}}},[E,e.autoHideHubspot,t]);const c=window.drift;i.useEffect(()=>{if(!(!t||!e.autoHideDrift||!c||G.autoHide3pDisabled)){try{c.api.widget.hide()}catch(a){console.warn("Userflow.js: Error when hiding Drift Chat",a)}return()=>{if(!G.autoHide3pDisabled)try{c.api.widget.show()}catch(a){console.warn("Userflow.js: Error when unhiding Drift Chat",a)}}}},[c,e.autoHideDrift,t])}const $t=16,Rt=20,ro=({company:e,theme:t,position:o,absoluteWidth:w,absoluteHeight:E,stepKey:c,stepAppearance:a,width:m,backgroundImageUrl:T,tooltipSelector:d,allowMissingTooltipTarget:y,tooltipPlacement:R,backdrop:_,tooltipTargetBlocked:A,backdropPadding:Q,zIndex:O,onTooltipTargetClick:B,onTooltipTargetMissingChange:H,onModalBackdropClick:J,onVisibleChange:tt,speaking:D,noIframe:j,MadeWithUserflow:n,minimizeOnAvatarClick:C,autoHide3pEnabled:M,bubbleFrameRootRef:L,frameWrapperHtmlAttributes:P,rootChildren:I,children:l,isModalAnnouncement:u,confettiEnabled:et})=>{const V=o||"absolute",F=R||null,$=Q||"0",ot=n||Se,st=ke(),ct=V==="fixed"?O??st+1:1,K=ct-1,jt=ct-2,{i18n:Pt}=ce(),rt=Pt.dir(),ft=i.useRef(null),pt=i.useRef(null),at=i.useRef(null),[X,Nt]=i.useState(null),ht=i.useRef(null),gt=i.useRef(null),wt=i.useRef(null),Tt=i.useRef(null),Et=i.useRef(null),yt=i.useRef(null),vt=i.useRef(null),Bt=i.useRef(null),Lt=i.useRef(null);i.useLayoutEffect(()=>{const r=ft.current.style;r.animation="none",r.visibility="hidden",r.position="absolute",r.top="-99999px",r.left="-99999px"},[]);const{loaded:Ot}=ve(window,Re,t),[It,Ft]=i.useState(!1),[St,g]=i.useState(!1),s=Ot&&It&&St;let[S,lt]=i.useState(!1);a!==v.BUBBLE&&(C=!1,S=!1),i.useEffect(()=>{lt(!1)},[c]);const k=i.useRef({appearance:null,width:null,theme:t,bubbleFrameHeight:0,backdrop:!1,backdropPadding:"0",prevTooltipTargetParams:null,tooltipTargetParams:null,desiredTooltipPlacement:null,tooltipPlacement:null,lastReportedTooltipTargetMissing:!1,tooltipTargetMissing:!1,tooltipTargetMissingTimeout:void 0,stepKeyScrolledIntoView:void 0,targetScrolledIntoView:null}),[Y,x]=i.useState(null),Z=Y!=null&&s;i.useEffect(()=>{tt&&tt(Z)},[tt,Z]);const dt=i.useCallback(r=>{k.current.lastReportedTooltipTargetMissing!==r&&(k.current.lastReportedTooltipTargetMissing=r,H&&H(r))},[H]),z=i.useCallback(({forceAppearanceLayout:r,forceUpdatePosition:U}={})=>{const mt=ft.current,_t=pt.current,kt=at.current,Yt=gt.current,Zt=ht.current,qt=wt.current,Jt=Tt.current,Kt=Et.current,Qt=yt.current,te=vt.current,ee=Bt.current,oe=Lt.current;if(!mt||!_t||!kt||!X||!Yt||!Zt||!qt||!Jt||!Kt||!Qt||!te||!ee||!oe||!s)return;const h=k.current,{tooltipTargetParams:Ut}=h;_e();let W=a,ae=!1;W===v.TOOLTIP&&!y&&!Ut&&(h.tooltipTargetMissing?(W=v.BUBBLE,ae=!0):W=null);const le=W!==h.appearance,pe=m!==h.width;if((r||le||pe||t!==h.theme||_!=h.backdrop||$!=h.backdropPadding||F!==h.desiredTooltipPlacement)&&(h.appearance=W,h.width=m,h.theme=t,h.backdrop=_,h.backdropPadding=$,h.desiredTooltipPlacement=F,U=!0,Ue({layoutState:h,width:m,position:V,absoluteWidth:w,root:mt,bubble:_t,bubbleFrameRoot:X,avatar:Yt,avatarNotch:Zt,modalBackdrop:oe,dir:rt})),!j){const q=X.offsetHeight,Vt=Gt(),Wt=Ct()<800?0:$t,he=t.avatarType===ut.NONE?0:W===v.BUBBLE?Rt+t.avatarSize:W===v.MODAL?t.avatarSize/2:0,se=Vt-2*Wt-he,At=Math.min(q,se);if(W&&At!==h.bubbleFrameHeight){if(h.bubbleFrameHeight=At,b(kt,"height",nt(At)),Ie(kt)&&kt.contentDocument){const ge=kt.contentDocument.documentElement;ge.style.overflowY=q<=se?"hidden":"scroll"}U=!0}}if(U&&W){let q=le;if(W===v.TOOLTIP){const Vt=h.tooltipTargetParams&&h.tooltipTargetParams.targetEl,Wt=h.prevTooltipTargetParams&&h.prevTooltipTargetParams.targetEl;Vt!==Wt&&(q=!0)}h.prevTooltipTargetParams=h.tooltipTargetParams,Ve({layoutState:h,animateIn:q,position:V,absoluteWidth:w,absoluteHeight:E,desiredTooltipPlacement:F,root:mt,bubble:_t,tooltipNotch:qt,tooltipBackdrop:Jt,tooltipBlockTop:Kt,tooltipBlockRight:Qt,tooltipBlockBottom:te,tooltipBlockLeft:ee,dir:rt})}if(W===v.TOOLTIP){const q=Ut&&Ut.targetEl;q&&h.stepKeyScrolledIntoView!==c&&h.targetScrolledIntoView!==q&&(h.stepKeyScrolledIntoView=c,h.targetScrolledIntoView=q,Ae(q))}else h.stepKeyScrolledIntoView=void 0,h.targetScrolledIntoView=null;dt(ae),x(W)},[s,X,c,a,m,t,V,w,E,y,F,_,$,j,dt,rt]),Mt=i.useRef(z);Mt.current=z;const Xt=i.useRef(!1);i.useEffect(()=>{const r=()=>{Xt.current=!0};return window.addEventListener("pagehide",r),()=>window.removeEventListener("pagehide",r)},[]);const xt=()=>{window.clearTimeout(k.current.tooltipTargetMissingTimeout),k.current.tooltipTargetMissingTimeout=void 0};i.useEffect(()=>xt,[]);const fe=i.useCallback(()=>{const r=k.current;if(r.tooltipTargetParams=null,y||(r.tooltipPlacement=null),a!==v.TOOLTIP){xt(),r.tooltipTargetMissing=!1;return}if(!y&&!r.tooltipTargetMissingTimeout){r.tooltipTargetMissing=!1;const U=d&&!ie(d)&&d.type===Le.AUTO&&!d.autoData?1:parseFloat(t.tooltipMissingToleranceSeconds)*1e3;r.tooltipTargetMissingTimeout=window.setTimeout(()=>{if(!Xt.current){if(d&&!ie(d)){let mt=d.autoData;if(d.autoData)try{mt=JSON.parse(d.autoData)}catch{}console.warn(`Userflow.js: Tooltip target not found on page.
2
- `,{type:d.type,autoData:mt,excludeText:d.excludeText,precision:d.precision,text:d.text,css:d.css})}xt(),r.tooltipTargetMissing=!0,Mt.current()}},U)}Mt.current()},[a,y,d,t.tooltipMissingToleranceSeconds]),de=i.useCallback(r=>{const U=k.current;xt(),U.tooltipTargetParams&&U.tooltipTargetParams.targetEl!==r.targetEl&&(U.tooltipPlacement=null),U.tooltipTargetParams=r,z({forceUpdatePosition:!0})},[z]);je({selector:a===v.TOOLTIP&&d||null,targetMoved:de,targetLost:fe,onTargetClick:B});const be=i.useCallback(()=>z({forceAppearanceLayout:!0}),[z]);Ne(be),i.useEffect(()=>{if(!X||j||typeof ne!="function")return;let r;const U=new ne(()=>{r||(r=window.requestAnimationFrame(()=>{r=void 0,Mt.current()}))});return U.observe(X,{childList:!0,attributes:!0,subtree:!0}),()=>{U.disconnect(),r&&window.cancelAnimationFrame(r)}},[X,j]);const{startConfetti:me}=He({stepType:a,theme:t,bubbleFrame:at.current,isBubbleVisible:Z,confettiDelay:400,zIndex:jt});i.useEffect(()=>{Z&&et&&at.current&&me(!0)},[et,c,Z]),i.useLayoutEffect(()=>{Mt.current()}),i.useLayoutEffect(()=>{V==="absolute"&&z({forceAppearanceLayout:!0})},[V,w,E]);const bt=r=>{r.preventDefault(),r.stopPropagation()};return Ce(t,!!M&&Y===v.BUBBLE),p.createElement("div",{ref:ft,"data-testid":"flow-chrome",className:"userflowjs-flow-chrome userflowjs-theme-root",style:Be(t),dir:rt},p.createElement("div",{className:"userflowjs-bubble",ref:pt,style:{zIndex:ct}},p.createElement("div",{className:zt({"userflowjs-bubble-outline":!0,[`userflowjs-bubble-outline--bubble-placement-${(t.bubblePlacement||"").toLowerCase().replace(/_/,"-")}`]:!0,"userflowjs-bubble-outline--minimizable":!!C,"userflowjs-bubble-outline--minimized":S})},p.createElement("div",{className:"userflowjs-bubble__frame-wrapper",...P},p.createElement(re,{className:"userflowjs-bubble__frame",elRef:at,stylesheet:Pe,theme:t,onStylesheetsLoad:Ft,noIframe:j,title:a.toLowerCase()},p.createElement("div",{className:"userflowjs-bubble-frame-root",ref:r=>{L&&L(r),Nt(r)},style:T?{backgroundImage:`url("${encodeURI(T)}")`}:void 0},l,e.flowBranding&&!u&&p.createElement("div",{className:"userflowjs-bubble-made-with-userflow"},p.createElement("div",{className:"userflowjs-bubble-made-with-userflow__absolute"},p.createElement(ot,{company:e},p.createElement(Oe,null),p.createElement("div",null,"Made with Userflow"))))))),p.createElement("div",{ref:ht,className:"userflowjs-bubble__avatar-notch"})),p.createElement(re,{className:zt({"userflowjs-bubble__avatar":!0,"userflowjs-bubble__avatar--minimizable":!!C,"userflowjs-bubble__avatar--speaking":!!D}),elRef:gt,stylesheet:De,theme:t,onStylesheetsLoad:g,noIframe:j,ariaHidden:!0,title:a.toLowerCase()},p.createElement("div",{className:zt({"userflowjs-avatar-frame-root":!0,"userflowjs-avatar-frame-root--minimizable":!!C}),onClick:C?()=>lt(r=>!r):void 0},p.createElement(Fe,{theme:t}))),p.createElement("div",{ref:wt,className:"userflowjs-bubble__tooltip-notch"})),p.createElement("div",{ref:Tt,className:"userflowjs-tooltip-backdrop",onMouseDown:bt,style:{zIndex:K,pointerEvents:A?void 0:"none"}}),p.createElement("div",{ref:Et,className:"userflowjs-tooltip-block",onMouseDown:bt,style:{zIndex:K}}),p.createElement("div",{ref:yt,className:"userflowjs-tooltip-block",onMouseDown:bt,style:{zIndex:K}}),p.createElement("div",{ref:vt,className:"userflowjs-tooltip-block",onMouseDown:bt,style:{zIndex:K}}),p.createElement("div",{ref:Bt,className:"userflowjs-tooltip-block",onMouseDown:bt,style:{zIndex:K}}),p.createElement("div",{ref:Lt,className:"userflowjs-modal-backdrop",onMouseDown:bt,onClick:J,style:{zIndex:K}}),I&&I({visible:Z,bubbleFrame:at.current}))},Fe=({theme:e})=>{const t="https://js.userflow.com/cartoon-avatars-no-bg/";let o;return e.avatarType===ut.ASSET&&e.avatarAsset?o=e.avatarAsset.assetUrl:e.avatarType===ut.CARTOON&&e.avatarName?o=t+e.avatarName+".svg?3":e.avatarType===ut.URL&&e.avatarUrl?o=e.avatarUrl:o=t+"none.svg",p.createElement("img",{src:o,alt:""})},Se=({company:e,children:t})=>p.createElement("a",{href:"https://userflow.com/?utm_source=made-with-userflow&utm_medium=link&utm_campaign=made-with-userflow-"+e.slug,target:"_blank",rel:"noopener noreferrer"},t);function Ue({layoutState:{appearance:e,theme:t,backdrop:o,tooltipTargetMissing:w},width:E,position:c,absoluteWidth:a,root:m,bubble:T,bubbleFrameRoot:d,avatar:y,avatarNotch:R,modalBackdrop:_,dir:A}){const Q=c==="absolute"?a||1024:nt(Ct()),{avatarSize:O,bubblePlacement:B}=t;let H=t.bubbleWidth,J=null,tt=null,D=`userflowjs-bubble-frame-root userflowjs-bubble-frame-root--appearance-${e?.toLowerCase()}`,j="hidden",n=null,C=null,M=null,L=null,P="userflowjs-bubble__avatar-notch",I="hidden",l=null,u=null,et=null,V=null,F="userflowjs-modal-backdrop";switch((e===v.MODAL||!w&&e===v.BUBBLE&&o)&&(F+=" userflowjs-modal-backdrop--visible"),e){case v.BUBBLE:if(t.avatarType!==ut.NONE){j="",I="",B===N.TOP_LEFT||B===N.TOP_CENTER||B===N.TOP_RIGHT?(J=O+Rt,n=0,l=-2*Rt,P+=" userflowjs-bubble__avatar-notch--top"):(tt=O+Rt,M=0,et=-2*Rt,P+=" userflowjs-bubble__avatar-notch--bottom");const ot=B===N.TOP_LEFT||B===N.TOP_CENTER||B===N.BOTTOM_LEFT||B===N.BOTTOM_CENTER||B===N.CENTER;A==="ltr"&&ot||A==="rtl"&&!ot?(L=0,V=O,P+=" userflowjs-bubble__avatar-notch--left"):(C=0,u=O,P+=" userflowjs-bubble__avatar-notch--right")}break;case v.MODAL:H=t.modalWidth,t.avatarType!==ut.NONE&&(j="",L=`calc(50% - ${O/2}px)`,n=-O/2);break;case v.TOOLTIP:H=t.tooltipWidth;break}E!=null&&(H=E),H=Math.min(H,Q-2*$t),m.classList.toggle("userflowjs-flow-chrome--position-absolute",c==="absolute"),m.classList.toggle("userflowjs-flow-chrome--position-relative",c==="relative"),m.classList.toggle("userflowjs-flow-chrome--position-fixed",c==="fixed"),m.classList.toggle("userflowjs-flow-chrome--appearance-modal",e===v.MODAL);const $=e!=null&&e!==v.HIDDEN;m.style.position="",m.style.top="",m.style.left="",m.style.visibility=$?"":"hidden",m.style.animation=$?"":"none",b(T,"width",nt(H)),b(T,"padding-top",J),b(T,"padding-bottom",tt),d.className=D,b(y,"width",nt(t.avatarSize)),b(y,"height",nt(t.avatarSize)),y.style.visibility=j,b(y,"top",n),b(y,"right",C),b(y,"bottom",M),b(y,"left",L),R.className=P,R.style.visibility=I,b(R,"top",l),b(R,"right",u),b(R,"bottom",et),b(R,"left",V),_.className=F}function Ve({layoutState:e,animateIn:t,position:o,absoluteWidth:w,absoluteHeight:E,desiredTooltipPlacement:c,root:a,bubble:m,tooltipNotch:T,tooltipBackdrop:d,tooltipBlockTop:y,tooltipBlockRight:R,tooltipBlockBottom:_,tooltipBlockLeft:A,dir:Q}){const{appearance:O,theme:B,tooltipTargetParams:H,backdrop:J,backdropPadding:tt}=e,{bubblePlacement:D}=B,j=$t,n=B.tooltipNotchSize,C=10,{width:M,height:L}=m.getBoundingClientRect(),P=o==="absolute"?w||1024:nt(Ct()),I=o==="absolute"?E||768:nt(Gt());let l=0,u=0,et="userflowjs-bubble__tooltip-notch",V="hidden",F=null,$=null,ot=null,st=null,ct="userflowjs-tooltip-backdrop",K=null,jt=null,Pt=null,rt=null,ft=null,pt=null,at=null,X=null,Nt="userflowjs-tooltip-block userflowjs-tooltip-block--top",ht=null,gt=null,wt="userflowjs-tooltip-block userflowjs-tooltip-block--right",Tt=null,Et=null,yt="userflowjs-tooltip-block userflowjs-tooltip-block--bottom",vt=null,Bt=null,Lt="userflowjs-tooltip-block userflowjs-tooltip-block--left",Ot=null,It=null;switch(O){case v.BUBBLE:{D===N.TOP_LEFT||D===N.BOTTOM_LEFT?l=B.bubbleX:D===N.TOP_CENTER||D===N.CENTER||D===N.BOTTOM_CENTER?l=(P-M)/2:l=P-M-B.bubbleX,D===N.TOP_LEFT||D===N.TOP_CENTER||D===N.TOP_RIGHT?u=B.bubbleY:D===N.CENTER?u=(I-L)/2:u=I-L-B.bubbleY,Q==="rtl"&&(l=P-l-M),l=Math.max(0,Math.min(P-M,l)),u=Math.max(0,Math.min(I-L,u));break}case v.MODAL:{let g=j;B.avatarType!==ut.NONE&&(g+=B.avatarSize/2),l=j+(P-j*2-M)/2,u=g+(I-g-j-L)/2;break}case v.TOOLTIP:{let g;if(H){let{targetRect:s,viewportClipRect:S}=H;if(o==="absolute"){const x=a.offsetParent.getBoundingClientRect();S={top:0,right:P,bottom:I,left:0},s={top:s.top-x.top,right:s.right-x.left,bottom:s.bottom-x.top,left:s.left-x.left,width:s.width,height:s.height}}let lt=0;if(J){const{paddingTop:x,paddingRight:Z,paddingBottom:dt,paddingLeft:z}=ze(tt);s={top:s.top-x,right:s.right+Z,bottom:s.bottom+dt,left:s.left-z,width:s.width+z+Z,height:s.height+x+dt},lt=Math.min(x,Z,dt,z)}const k=s,Y=B.backdropHighlightType==Me.OUTSIDE?B.backdropHighlightSpread:0;if(J&&Y&&(s={top:s.top-Y,right:s.right+Y,bottom:s.bottom+Y,left:s.left-Y,width:s.width+2*Y,height:s.height+2*Y}),g=We({targetRect:s,bubbleWidth:M,bubbleHeight:L,containerWidth:P,containerHeight:I,viewportClipRect:S,tooltipNotchSize:n,currentTooltipPlacement:e.tooltipPlacement,desiredTooltipPlacement:c}),g===f.BELOW||g===f.ABOVE?(l=s.left+s.width/2-M/2,l=Math.max(j,Math.min(P-M-j,l)),st=Math.max(C,Math.min(M-C-n*2,s.left+s.width/2-n-l)),g===f.BELOW?F=-n*2:ot=-n*2):g===f.RIGHT?(l=s.right+n,l=Math.max(l,S.left+n),l=Math.min(l,S.right+n),l=Math.max(l,n),l=Math.min(l,P-M)):(l=s.left-n-M,l=Math.max(l,S.left-M-n),l=Math.min(l,S.right-M-n),l=Math.max(l,0),l=Math.min(l,P-M-n)),g===f.LEFT||g===f.RIGHT?(u=s.top+s.height/2-L/2,u=Math.max(j,Math.min(I-L-j,u)),F=Math.max(C,Math.min(L-C-n*2,s.top+s.height/2-n-u)),g===f.LEFT?$=-n*2:st=-n*2):g===f.BELOW?(u=s.bottom+n,u=Math.max(u,S.top+n),u=Math.min(u,S.bottom+n),u=Math.max(u,n),u=Math.min(u,I-L)):(u=s.top-n-L,u=Math.max(u,S.top-L-n),u=Math.min(u,S.bottom-L-n),u=Math.max(u,0),u=Math.min(u,I-L-n)),J){const x=window.getComputedStyle(H.targetEl);K=Math.max(0,k.top),jt=Math.max(0,P-k.right),Pt=Math.max(0,I-k.bottom),rt=Math.max(0,k.left),ft=Math.max(0,Dt(x.borderTopLeftRadius)+lt),pt=Math.max(0,Dt(x.borderTopRightRadius)+lt),at=Math.max(0,Dt(x.borderBottomRightRadius)+lt),X=Math.max(0,Dt(x.borderBottomLeftRadius)+lt),ht=Math.max(0,k.right),gt=Math.max(0,k.top),Tt=Math.max(0,k.right),Et=Math.max(0,k.bottom),vt=Math.max(0,k.left),Bt=Math.max(0,k.bottom),Ot=Math.max(0,k.left),It=Math.max(0,k.top)}}else g=c||f.BELOW,(g===f.BELOW||g===f.ABOVE)&&(st=M/2-n,g===f.BELOW?F=-n*2:ot=-n*2),(g===f.LEFT||g===f.RIGHT)&&(F=L/2-n,g===f.LEFT?$=-n*2:st=-n*2);e.tooltipPlacement=g,et+=` userflowjs-bubble__tooltip-notch--${g.toLowerCase()}`,V="",J&&(ct+=" userflowjs-tooltip-backdrop--visible",Nt+=" userflowjs-tooltip-block--visible",wt+=" userflowjs-tooltip-block--visible",yt+=" userflowjs-tooltip-block--visible",Lt+=" userflowjs-tooltip-block--visible");break}}m.style.transition="";let Ft=l,St=u;if(t&&(m.style.opacity="0",O===v.TOOLTIP))switch(e.tooltipPlacement){case f.BELOW:u+=24;break;case f.ABOVE:u-=24;break;case f.RIGHT:l+=24;break;case f.LEFT:l-=24;break}if(o!=="relative"&&ue(m,l,u),T.className=et,T.style.visibility=V,b(T,"top",F),b(T,"right",$),b(T,"bottom",ot),b(T,"left",st),d.className=ct,b(d,"top",K),b(d,"right",jt),b(d,"bottom",Pt),b(d,"left",rt),b(d,"border-top-left-radius",ft),b(d,"border-top-right-radius",pt),b(d,"border-bottom-right-radius",at),b(d,"border-bottom-left-radius",X),y.className=Nt,b(y,"width",ht),b(y,"height",gt),R.className=wt,b(R,"left",Tt),b(R,"height",Et),_.className=yt,b(_,"left",vt),b(_,"top",Bt),A.className=Lt,b(A,"width",Ot),b(A,"top",It),t){m.offsetWidth;const g="opacity 250ms linear";O===v.TOOLTIP?m.style.transition=`${g}, transform 500ms cubic-bezier(0.25, 0.8, 0.5, 1)`:m.style.transition=g,m.style.opacity="1",o!=="relative"&&ue(m,Ft,St)}}function We({targetRect:e,bubbleWidth:t,bubbleHeight:o,containerWidth:w,containerHeight:E,viewportClipRect:c,tooltipNotchSize:a,currentTooltipPlacement:m,desiredTooltipPlacement:T}){if(e.bottom<=c.top)return o+a<=E-c.top?f.BELOW:f.ABOVE;if(e.top>=c.bottom)return o+a<=c.bottom?f.ABOVE:f.BELOW;if(e.right<=c.left)return t+a<=w-c.left?f.RIGHT:f.LEFT;if(e.left>=c.right)return t+a<=c.right?f.LEFT:f.RIGHT;const d=R=>{const _=e.left+e.width/2,A=_>=c.left&&_<=c.right,Q=e.top+e.height/2,O=Q>=c.top&&Q<=c.bottom;switch(R){case f.BELOW:return E-e.bottom>o+a&&A;case f.ABOVE:return e.top>o+a&&A;case f.RIGHT:return w-e.right>t+a&&O;case f.LEFT:return e.left>t+a&&O}};if(T&&d(T))return T;if(m&&d(m))return m;const y=[{placement:f.BELOW,dist:e.top},{placement:f.ABOVE,dist:E-e.bottom},{placement:f.RIGHT,dist:e.left},{placement:f.LEFT,dist:w-e.right}];y.sort((R,_)=>R.dist-_.dist);for(const{placement:R}of y)if(d(R))return R;return f.BELOW}function b(e,t,o){o==null?e.style.removeProperty(t):e.style.setProperty(t,typeof o=="number"?o+"px":o,"important")}function ue(e,t,o){t=Math.round(t),o=Math.round(o),e.style.transform=`translate3d(${t}px, ${o}px, 0px)`}function Ae(e){if(G.customScrollIntoView){G.customScrollIntoView(e);return}const{scrollPadding:t}=G;if(t&&xe(e)===document.scrollingElement){const o=t.top||0,w=t.right||0,E=t.bottom||0,c=t.left||0;let a=0,m=0;const T=e.getBoundingClientRect(),d=Ct(),y=Gt();if(T.top<o?a=T.top-o:T.bottom>y-E&&(a=T.bottom-y+E),T.left<c?m=T.left-c:T.right>d-w&&(m=T.right-d+w),a!=0||m!=0){window.scrollBy({top:a,left:m,behavior:"smooth"});return}}try{e.scrollIntoView({behavior:"smooth",block:"nearest"})}catch(o){console.warn("Userflow.js: scrollIntoView error (falling back to no options).",o),e.scrollIntoView()}}function ze(e){if(!e||e==="0")return{paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0};const t=e.trim().split(" ");if(t.length===1){const o=it(t[0]);return{paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o}}else if(t.length===2){const o=it(t[0]),w=it(t[1]);return{paddingTop:o,paddingRight:w,paddingBottom:o,paddingLeft:w}}else return{paddingTop:it(t[0]),paddingRight:it(t[1]),paddingBottom:it(t[2]),paddingLeft:it(t[3])}}function it(e){const t=parseInt(e,10);return isNaN(t)?0:t}export{so as B,ro as F};
1
+ import{S as ye,T as Le,N as ve,D as Be}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{R as p,r as s}from"./vendor.react.js";import{D as Dt,u as Me,g as ke}from"./stylesheets.js";import"./vendor.core-js.js";import{u as de}from"./vendor.react-i18next.js";import{F as ie}from"./Frame.js";import{G,r as L,v as ct,F as Re,w as O,a4 as je,a3 as f}from"./userflow.js";import{u as Pe,f as Oe}from"./flow-host.styl.js";import{u as Ne,b as xe}from"./use-selector-element-monitoring.js";import{u as Ie}from"./use-window-resize.js";import{S as _e}from"./logomark.js";import{o as $t}from"./vendor.obj-str.js";import{h as Xt,e as Ct,j as ut,u as He,l as ue,v as De,M as ce,s as Ft,w as Fe,q as Ce,p as Se,x as Ue}from"./roots.js";import{u as Ve}from"./use-confetti.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e129d566-1b31-4be9-a044-0e7fbc6fd2a0",e._sentryDebugIdIdentifier="sentry-dbid-e129d566-1b31-4be9-a044-0e7fbc6fd2a0")}catch{}})();const fo=({draftMode:e,muted:t,toggleMuted:o,close:w,minimize:E})=>{const{t:c}=de();return p.createElement("div",{className:"userflowjs-bubble-toolbar"},e&&p.createElement("div",{className:"userflowjs-bubble-draft"},typeof e=="string"?e:"Preview"),o&&p.createElement("button",{className:"userflowjs-bubble-toolbar-button",onClick:o,"aria-label":t?"Unmute":"Mute"},t?p.createElement(Dt,{icon:ye}):p.createElement(Dt,{icon:Le})),E&&p.createElement("button",{"data-testid":"minimize-button",className:"userflowjs-bubble-toolbar-button",onClick:E,"aria-label":"Minimize checklist"},p.createElement(Dt,{icon:ve})),w&&p.createElement("button",{"data-testid":"close-button",className:"userflowjs-bubble-toolbar-button",onClick:w,"aria-label":c("menu.close")},p.createElement(Dt,{icon:Be})))},We=new URL("avatar-frame.css",import.meta.url).href;function Ae(e,t){const o=window.Intercom;s.useEffect(()=>{if(!(!t||!e.autoHideIntercom||typeof o!="function"||G.autoHide3pDisabled)){try{o("update",{hide_default_launcher:!0})}catch(l){console.warn("Userflow.js: Error when hiding Intercom launcher",l)}return()=>{if(!G.autoHide3pDisabled)try{o("update",{hide_default_launcher:!1})}catch(l){console.warn("Userflow.js: Error when unhiding Intercom launcher",l)}}}},[o,e.autoHideIntercom,t]);const w=window.$crisp;s.useEffect(()=>{if(!(!t||!e.autoHideCrisp||!w||G.autoHide3pDisabled)){try{w.push(["do","chat:hide"])}catch(l){console.warn("Userflow.js: Error when hiding Crisp Chat",l)}return()=>{if(!G.autoHide3pDisabled)try{w.push(["do","chat:show"])}catch(l){console.warn("Userflow.js: Error when unhiding Crisp Chat",l)}}}},[w,e.autoHideCrisp,t]);const E=window.HubSpotConversations;s.useEffect(()=>{if(!(!t||!e.autoHideHubspot||!E||G.autoHide3pDisabled)){try{E.widget.remove()}catch(l){console.warn("Userflow.js: Error when hiding HubSpot Chat",l)}return()=>{if(!G.autoHide3pDisabled)try{E.widget.load()}catch(l){console.warn("Userflow.js: Error when unhiding HubSpot Chat",l)}}}},[E,e.autoHideHubspot,t]);const c=window.drift;s.useEffect(()=>{if(!(!t||!e.autoHideDrift||!c||G.autoHide3pDisabled)){try{c.api.widget.hide()}catch(l){console.warn("Userflow.js: Error when hiding Drift Chat",l)}return()=>{if(!G.autoHide3pDisabled)try{c.api.widget.show()}catch(l){console.warn("Userflow.js: Error when unhiding Drift Chat",l)}}}},[c,e.autoHideDrift,t])}const Yt=16,Rt=20,bo=({company:e,theme:t,position:o,absoluteWidth:w,absoluteHeight:E,stepKey:c,stepAppearance:l,width:m,backgroundImageUrl:T,tooltipSelector:d,allowMissingTooltipTarget:y,tooltipPlacement:R,backdrop:_,tooltipTargetBlocked:A,backdropPadding:Q,zIndex:N,onTooltipTargetClick:v,onTooltipTargetMissingChange:H,onModalBackdropClick:J,onVisibleChange:tt,speaking:D,noIframe:j,MadeWithUserflow:i,minimizeOnAvatarClick:F,autoHide3pEnabled:M,bubbleFrameRootRef:B,frameWrapperHtmlAttributes:P,rootChildren:x,children:r,isModalAnnouncement:u,confettiEnabled:et})=>{const V=o||"absolute",C=R||null,$=Q||"0",ot=i||Ge,st=Pe(),ft=V==="fixed"?N??st+1:1,K=ft-1,jt=ft-2,{i18n:Pt}=de(),rt=Pt.dir(),dt=s.useRef(null),nt=s.useRef(null),at=s.useRef(null),[X,Ot]=s.useState(null),ht=s.useRef(null),gt=s.useRef(null),wt=s.useRef(null),Tt=s.useRef(null),Et=s.useRef(null),yt=s.useRef(null),Lt=s.useRef(null),vt=s.useRef(null),Bt=s.useRef(null);s.useLayoutEffect(()=>{const a=dt.current.style;a.animation="none",a.visibility="hidden",a.position="absolute",a.top="-99999px",a.left="-99999px"},[]);const{loaded:Nt}=Me(window,Oe,t),[xt,St]=s.useState(!1),[Ut,g]=s.useState(!1),n=Nt&&xt&&Ut;let[S,lt]=s.useState(!1);l!==L.BUBBLE&&(F=!1,S=!1),s.useEffect(()=>{lt(!1)},[c]);const k=s.useRef({appearance:null,width:null,theme:t,bubbleFrameHeight:0,backdrop:!1,backdropPadding:"0",prevTooltipTargetParams:null,tooltipTargetParams:null,desiredTooltipPlacement:null,tooltipPlacement:null,lastReportedTooltipTargetMissing:!1,tooltipTargetMissing:!1,tooltipTargetMissingTimeout:void 0,stepKeyScrolledIntoView:void 0,targetScrolledIntoView:null}),[Y,I]=s.useState(null),Z=Y!=null&&n;s.useEffect(()=>{tt&&tt(Z)},[tt,Z]);const bt=s.useCallback(a=>{k.current.lastReportedTooltipTargetMissing!==a&&(k.current.lastReportedTooltipTargetMissing=a,H&&H(a))},[H]),z=s.useCallback(({forceAppearanceLayout:a,forceUpdatePosition:U}={})=>{const pt=dt.current,Ht=nt.current,kt=at.current,qt=gt.current,Jt=ht.current,Kt=wt.current,Qt=Tt.current,te=Et.current,ee=yt.current,oe=Lt.current,ae=vt.current,le=Bt.current;if(!pt||!Ht||!kt||!X||!qt||!Jt||!Kt||!Qt||!te||!ee||!oe||!ae||!le||!n)return;const h=k.current,{tooltipTargetParams:Wt}=h;Ce();let W=l,se=!1;W===L.TOOLTIP&&!y&&!Wt&&(h.tooltipTargetMissing?(W=L.BUBBLE,se=!0):W=null);const re=W!==h.appearance,we=m!==h.width;if((a||re||we||t!==h.theme||_!=h.backdrop||$!=h.backdropPadding||C!==h.desiredTooltipPlacement)&&(h.appearance=W,h.width=m,h.theme=t,h.backdrop=_,h.backdropPadding=$,h.desiredTooltipPlacement=C,U=!0,$e({layoutState:h,width:m,position:V,absoluteWidth:w,root:pt,bubble:Ht,bubbleFrameRoot:X,avatar:qt,avatarNotch:Jt,modalBackdrop:le,dir:rt})),!j){const q=X.offsetHeight,At=Xt(),zt=Ct()<800?0:Yt,Te=t.avatarType===ct.NONE?0:W===L.BUBBLE?Rt+t.avatarSize:W===L.MODAL?t.avatarSize/2:0,ne=At-2*zt-Te,Gt=Math.min(q,ne);if(W&&Gt!==h.bubbleFrameHeight){if(h.bubbleFrameHeight=Gt,b(kt,"height",ut(Gt)),He(kt)&&kt.contentDocument){const Ee=kt.contentDocument.documentElement;Ee.style.overflowY=q<=ne?"hidden":"scroll"}U=!0}}if(U&&W){let q=re;if(W===L.TOOLTIP){const At=h.tooltipTargetParams&&h.tooltipTargetParams.targetEl,zt=h.prevTooltipTargetParams&&h.prevTooltipTargetParams.targetEl;At!==zt&&(q=!0)}h.prevTooltipTargetParams=h.tooltipTargetParams,Xe({layoutState:h,animateIn:q,position:V,absoluteWidth:w,absoluteHeight:E,desiredTooltipPlacement:C,root:pt,bubble:Ht,tooltipNotch:Kt,tooltipBackdrop:Qt,tooltipBlockTop:te,tooltipBlockRight:ee,tooltipBlockBottom:oe,tooltipBlockLeft:ae,dir:rt})}if(W===L.TOOLTIP){const q=Wt&&Wt.targetEl;q&&h.stepKeyScrolledIntoView!==c&&h.targetScrolledIntoView!==q&&(h.stepKeyScrolledIntoView=c,h.targetScrolledIntoView=q,Ze(q))}else h.stepKeyScrolledIntoView=void 0,h.targetScrolledIntoView=null;bt(se),I(W)},[n,X,c,l,m,t,V,w,E,y,C,_,$,j,bt,rt]),Mt=s.useRef(z);Mt.current=z;const Zt=s.useRef(!1);s.useEffect(()=>{const a=()=>{Zt.current=!0};return window.addEventListener("pagehide",a),()=>window.removeEventListener("pagehide",a)},[]);const It=()=>{window.clearTimeout(k.current.tooltipTargetMissingTimeout),k.current.tooltipTargetMissingTimeout=void 0};s.useLayoutEffect(()=>It,[]);const _t=s.useRef(!1),be=()=>{const a=nt.current;_t.current||!a||(Se(a),_t.current=!0)},Vt=()=>{const a=nt.current;!_t.current||!a||(Ue(a),_t.current=!1)};s.useLayoutEffect(()=>Vt,[]);const me=s.useCallback(()=>{Vt();const a=k.current;if(a.tooltipTargetParams=null,y||(a.tooltipPlacement=null),l!==L.TOOLTIP){It(),a.tooltipTargetMissing=!1;return}if(!y&&!a.tooltipTargetMissingTimeout){a.tooltipTargetMissing=!1;const U=d&&!ue(d)&&d.type===Re.AUTO&&!d.autoData?1:parseFloat(t.tooltipMissingToleranceSeconds)*1e3;a.tooltipTargetMissingTimeout=window.setTimeout(()=>{if(!Zt.current){if(d&&!ue(d)){let pt=d.autoData;if(d.autoData)try{pt=JSON.parse(d.autoData)}catch{}console.warn(`Userflow.js: Tooltip target not found on page.
2
+ `,{type:d.type,autoData:pt,excludeText:d.excludeText,precision:d.precision,text:d.text,css:d.css})}It(),a.tooltipTargetMissing=!0,Mt.current()}},U)}Mt.current()},[l,y,d,t.tooltipMissingToleranceSeconds]),pe=s.useCallback(a=>{const U=k.current;It(),De(a.targetEl)?be():Vt(),U.tooltipTargetParams&&U.tooltipTargetParams.targetEl!==a.targetEl&&(U.tooltipPlacement=null),U.tooltipTargetParams=a,z({forceUpdatePosition:!0})},[z]);Ne({selector:l===L.TOOLTIP&&d||null,targetMoved:pe,targetLost:me,onTargetClick:v});const he=s.useCallback(()=>z({forceAppearanceLayout:!0}),[z]);Ie(he),s.useEffect(()=>{if(!X||j||typeof ce!="function")return;let a;const U=new ce(()=>{a||(a=window.requestAnimationFrame(()=>{a=void 0,Mt.current()}))});return U.observe(X,{childList:!0,attributes:!0,subtree:!0}),()=>{U.disconnect(),a&&window.cancelAnimationFrame(a)}},[X,j]);const{startConfetti:ge}=Ve({stepType:l,theme:t,bubbleFrame:at.current,isBubbleVisible:Z,confettiDelay:400,zIndex:jt});s.useEffect(()=>{Z&&et&&at.current&&ge(!0)},[et,c,Z]),s.useLayoutEffect(()=>{Mt.current()}),s.useLayoutEffect(()=>{V==="absolute"&&z({forceAppearanceLayout:!0})},[V,w,E]);const mt=a=>{a.preventDefault(),a.stopPropagation()};return Ae(t,!!M&&Y===L.BUBBLE),p.createElement("div",{ref:dt,"data-testid":"flow-chrome",className:"userflowjs-flow-chrome userflowjs-theme-root",style:ke(t),dir:rt},p.createElement("div",{className:"userflowjs-bubble",ref:nt,style:{zIndex:ft}},p.createElement("div",{className:$t({"userflowjs-bubble-outline":!0,[`userflowjs-bubble-outline--bubble-placement-${(t.bubblePlacement||"").toLowerCase().replace(/_/,"-")}`]:!0,"userflowjs-bubble-outline--minimizable":!!F,"userflowjs-bubble-outline--minimized":S})},p.createElement("div",{className:"userflowjs-bubble__frame-wrapper",...P},p.createElement(ie,{className:"userflowjs-bubble__frame",elRef:at,stylesheet:xe,theme:t,onStylesheetsLoad:St,noIframe:j,title:l.toLowerCase()},p.createElement("div",{className:"userflowjs-bubble-frame-root",ref:a=>{B&&B(a),Ot(a)},style:T?{backgroundImage:`url("${encodeURI(T)}")`}:void 0},r,e.flowBranding&&!u&&p.createElement("div",{className:"userflowjs-bubble-made-with-userflow"},p.createElement("div",{className:"userflowjs-bubble-made-with-userflow__absolute"},p.createElement(ot,{company:e},p.createElement(_e,null),p.createElement("div",null,"Made with Userflow"))))))),p.createElement("div",{ref:ht,className:"userflowjs-bubble__avatar-notch"})),p.createElement(ie,{className:$t({"userflowjs-bubble__avatar":!0,"userflowjs-bubble__avatar--minimizable":!!F,"userflowjs-bubble__avatar--speaking":!!D}),elRef:gt,stylesheet:We,theme:t,onStylesheetsLoad:g,noIframe:j,ariaHidden:!0,title:l.toLowerCase()},p.createElement("div",{className:$t({"userflowjs-avatar-frame-root":!0,"userflowjs-avatar-frame-root--minimizable":!!F}),onClick:F?()=>lt(a=>!a):void 0},p.createElement(ze,{theme:t}))),p.createElement("div",{ref:wt,className:"userflowjs-bubble__tooltip-notch"})),p.createElement("div",{ref:Tt,className:"userflowjs-tooltip-backdrop",onMouseDown:mt,style:{zIndex:K,pointerEvents:A?void 0:"none"}}),p.createElement("div",{ref:Et,className:"userflowjs-tooltip-block",onMouseDown:mt,style:{zIndex:K}}),p.createElement("div",{ref:yt,className:"userflowjs-tooltip-block",onMouseDown:mt,style:{zIndex:K}}),p.createElement("div",{ref:Lt,className:"userflowjs-tooltip-block",onMouseDown:mt,style:{zIndex:K}}),p.createElement("div",{ref:vt,className:"userflowjs-tooltip-block",onMouseDown:mt,style:{zIndex:K}}),p.createElement("div",{ref:Bt,className:"userflowjs-modal-backdrop",onMouseDown:mt,onClick:J,style:{zIndex:K}}),x&&x({visible:Z,bubbleFrame:at.current}))},ze=({theme:e})=>{const t="https://js.userflow.com/cartoon-avatars-no-bg/";let o;return e.avatarType===ct.ASSET&&e.avatarAsset?o=e.avatarAsset.assetUrl:e.avatarType===ct.CARTOON&&e.avatarName?o=t+e.avatarName+".svg?3":e.avatarType===ct.URL&&e.avatarUrl?o=e.avatarUrl:o=t+"none.svg",p.createElement("img",{src:o,alt:""})},Ge=({company:e,children:t})=>p.createElement("a",{href:"https://userflow.com/?utm_source=made-with-userflow&utm_medium=link&utm_campaign=made-with-userflow-"+e.slug,target:"_blank",rel:"noopener noreferrer"},t);function $e({layoutState:{appearance:e,theme:t,backdrop:o,tooltipTargetMissing:w},width:E,position:c,absoluteWidth:l,root:m,bubble:T,bubbleFrameRoot:d,avatar:y,avatarNotch:R,modalBackdrop:_,dir:A}){const Q=c==="absolute"?l||1024:ut(Ct()),{avatarSize:N,bubblePlacement:v}=t;let H=t.bubbleWidth,J=null,tt=null,D=`userflowjs-bubble-frame-root userflowjs-bubble-frame-root--appearance-${e?.toLowerCase()}`,j="hidden",i=null,F=null,M=null,B=null,P="userflowjs-bubble__avatar-notch",x="hidden",r=null,u=null,et=null,V=null,C="userflowjs-modal-backdrop";switch((e===L.MODAL||!w&&e===L.BUBBLE&&o)&&(C+=" userflowjs-modal-backdrop--visible"),e){case L.BUBBLE:if(t.avatarType!==ct.NONE){j="",x="",v===O.TOP_LEFT||v===O.TOP_CENTER||v===O.TOP_RIGHT?(J=N+Rt,i=0,r=-2*Rt,P+=" userflowjs-bubble__avatar-notch--top"):(tt=N+Rt,M=0,et=-2*Rt,P+=" userflowjs-bubble__avatar-notch--bottom");const ot=v===O.TOP_LEFT||v===O.TOP_CENTER||v===O.BOTTOM_LEFT||v===O.BOTTOM_CENTER||v===O.CENTER;A==="ltr"&&ot||A==="rtl"&&!ot?(B=0,V=N,P+=" userflowjs-bubble__avatar-notch--left"):(F=0,u=N,P+=" userflowjs-bubble__avatar-notch--right")}break;case L.MODAL:H=t.modalWidth,t.avatarType!==ct.NONE&&(j="",B=`calc(50% - ${N/2}px)`,i=-N/2);break;case L.TOOLTIP:H=t.tooltipWidth;break}E!=null&&(H=E),H=Math.min(H,Q-2*Yt),m.classList.toggle("userflowjs-flow-chrome--position-absolute",c==="absolute"),m.classList.toggle("userflowjs-flow-chrome--position-relative",c==="relative"),m.classList.toggle("userflowjs-flow-chrome--position-fixed",c==="fixed"),m.classList.toggle("userflowjs-flow-chrome--appearance-modal",e===L.MODAL);const $=e!=null&&e!==L.HIDDEN;m.style.position="",m.style.top="",m.style.left="",m.style.visibility=$?"":"hidden",m.style.animation=$?"":"none",b(T,"width",ut(H)),b(T,"padding-top",J),b(T,"padding-bottom",tt),d.className=D,b(y,"width",ut(t.avatarSize)),b(y,"height",ut(t.avatarSize)),y.style.visibility=j,b(y,"top",i),b(y,"right",F),b(y,"bottom",M),b(y,"left",B),R.className=P,R.style.visibility=x,b(R,"top",r),b(R,"right",u),b(R,"bottom",et),b(R,"left",V),_.className=C}function Xe({layoutState:e,animateIn:t,position:o,absoluteWidth:w,absoluteHeight:E,desiredTooltipPlacement:c,root:l,bubble:m,tooltipNotch:T,tooltipBackdrop:d,tooltipBlockTop:y,tooltipBlockRight:R,tooltipBlockBottom:_,tooltipBlockLeft:A,dir:Q}){const{appearance:N,theme:v,tooltipTargetParams:H,backdrop:J,backdropPadding:tt}=e,{bubblePlacement:D}=v,j=Yt,i=v.tooltipNotchSize,F=10,{width:M,height:B}=m.getBoundingClientRect(),P=o==="absolute"?w||1024:ut(Ct()),x=o==="absolute"?E||768:ut(Xt());let r=0,u=0,et="userflowjs-bubble__tooltip-notch",V="hidden",C=null,$=null,ot=null,st=null,ft="userflowjs-tooltip-backdrop",K=null,jt=null,Pt=null,rt=null,dt=null,nt=null,at=null,X=null,Ot="userflowjs-tooltip-block userflowjs-tooltip-block--top",ht=null,gt=null,wt="userflowjs-tooltip-block userflowjs-tooltip-block--right",Tt=null,Et=null,yt="userflowjs-tooltip-block userflowjs-tooltip-block--bottom",Lt=null,vt=null,Bt="userflowjs-tooltip-block userflowjs-tooltip-block--left",Nt=null,xt=null;switch(N){case L.BUBBLE:{D===O.TOP_LEFT||D===O.BOTTOM_LEFT?r=v.bubbleX:D===O.TOP_CENTER||D===O.CENTER||D===O.BOTTOM_CENTER?r=(P-M)/2:r=P-M-v.bubbleX,D===O.TOP_LEFT||D===O.TOP_CENTER||D===O.TOP_RIGHT?u=v.bubbleY:D===O.CENTER?u=(x-B)/2:u=x-B-v.bubbleY,Q==="rtl"&&(r=P-r-M),r=Math.max(0,Math.min(P-M,r)),u=Math.max(0,Math.min(x-B,u));break}case L.MODAL:{let g=j;v.avatarType!==ct.NONE&&(g+=v.avatarSize/2),r=j+(P-j*2-M)/2,u=g+(x-g-j-B)/2;break}case L.TOOLTIP:{let g;if(H){let{targetRect:n,viewportClipRect:S}=H;if(o==="absolute"){const I=l.offsetParent.getBoundingClientRect();S={top:0,right:P,bottom:x,left:0},n={top:n.top-I.top,right:n.right-I.left,bottom:n.bottom-I.top,left:n.left-I.left,width:n.width,height:n.height}}let lt=0;if(J){const{paddingTop:I,paddingRight:Z,paddingBottom:bt,paddingLeft:z}=qe(tt);n={top:n.top-I,right:n.right+Z,bottom:n.bottom+bt,left:n.left-z,width:n.width+z+Z,height:n.height+I+bt},lt=Math.min(I,Z,bt,z)}const k=n,Y=v.backdropHighlightType==je.OUTSIDE?v.backdropHighlightSpread:0;if(J&&Y&&(n={top:n.top-Y,right:n.right+Y,bottom:n.bottom+Y,left:n.left-Y,width:n.width+2*Y,height:n.height+2*Y}),g=Ye({targetRect:n,bubbleWidth:M,bubbleHeight:B,containerWidth:P,containerHeight:x,viewportClipRect:S,tooltipNotchSize:i,currentTooltipPlacement:e.tooltipPlacement,desiredTooltipPlacement:c}),g===f.BELOW||g===f.ABOVE?(r=n.left+n.width/2-M/2,r=Math.max(j,Math.min(P-M-j,r)),st=Math.max(F,Math.min(M-F-i*2,n.left+n.width/2-i-r)),g===f.BELOW?C=-i*2:ot=-i*2):g===f.RIGHT?(r=n.right+i,r=Math.max(r,S.left+i),r=Math.min(r,S.right+i),r=Math.max(r,i),r=Math.min(r,P-M)):(r=n.left-i-M,r=Math.max(r,S.left-M-i),r=Math.min(r,S.right-M-i),r=Math.max(r,0),r=Math.min(r,P-M-i)),g===f.LEFT||g===f.RIGHT?(u=n.top+n.height/2-B/2,u=Math.max(j,Math.min(x-B-j,u)),C=Math.max(F,Math.min(B-F-i*2,n.top+n.height/2-i-u)),g===f.LEFT?$=-i*2:st=-i*2):g===f.BELOW?(u=n.bottom+i,u=Math.max(u,S.top+i),u=Math.min(u,S.bottom+i),u=Math.max(u,i),u=Math.min(u,x-B)):(u=n.top-i-B,u=Math.max(u,S.top-B-i),u=Math.min(u,S.bottom-B-i),u=Math.max(u,0),u=Math.min(u,x-B-i)),J){const I=window.getComputedStyle(H.targetEl);K=Math.max(0,k.top),jt=Math.max(0,P-k.right),Pt=Math.max(0,x-k.bottom),rt=Math.max(0,k.left),dt=Math.max(0,Ft(I.borderTopLeftRadius)+lt),nt=Math.max(0,Ft(I.borderTopRightRadius)+lt),at=Math.max(0,Ft(I.borderBottomRightRadius)+lt),X=Math.max(0,Ft(I.borderBottomLeftRadius)+lt),ht=Math.max(0,k.right),gt=Math.max(0,k.top),Tt=Math.max(0,k.right),Et=Math.max(0,k.bottom),Lt=Math.max(0,k.left),vt=Math.max(0,k.bottom),Nt=Math.max(0,k.left),xt=Math.max(0,k.top)}}else g=c||f.BELOW,(g===f.BELOW||g===f.ABOVE)&&(st=M/2-i,g===f.BELOW?C=-i*2:ot=-i*2),(g===f.LEFT||g===f.RIGHT)&&(C=B/2-i,g===f.LEFT?$=-i*2:st=-i*2);e.tooltipPlacement=g,et+=` userflowjs-bubble__tooltip-notch--${g.toLowerCase()}`,V="",J&&(ft+=" userflowjs-tooltip-backdrop--visible",Ot+=" userflowjs-tooltip-block--visible",wt+=" userflowjs-tooltip-block--visible",yt+=" userflowjs-tooltip-block--visible",Bt+=" userflowjs-tooltip-block--visible");break}}m.style.transition="";let St=r,Ut=u;if(t&&(m.style.opacity="0",N===L.TOOLTIP))switch(e.tooltipPlacement){case f.BELOW:u+=24;break;case f.ABOVE:u-=24;break;case f.RIGHT:r+=24;break;case f.LEFT:r-=24;break}if(o!=="relative"&&fe(m,r,u),T.className=et,T.style.visibility=V,b(T,"top",C),b(T,"right",$),b(T,"bottom",ot),b(T,"left",st),d.className=ft,b(d,"top",K),b(d,"right",jt),b(d,"bottom",Pt),b(d,"left",rt),b(d,"border-top-left-radius",dt),b(d,"border-top-right-radius",nt),b(d,"border-bottom-right-radius",at),b(d,"border-bottom-left-radius",X),y.className=Ot,b(y,"width",ht),b(y,"height",gt),R.className=wt,b(R,"left",Tt),b(R,"height",Et),_.className=yt,b(_,"left",Lt),b(_,"top",vt),A.className=Bt,b(A,"width",Nt),b(A,"top",xt),t){m.offsetWidth;const g="opacity 250ms linear";N===L.TOOLTIP?m.style.transition=`${g}, transform 500ms cubic-bezier(0.25, 0.8, 0.5, 1)`:m.style.transition=g,m.style.opacity="1",o!=="relative"&&fe(m,St,Ut)}}function Ye({targetRect:e,bubbleWidth:t,bubbleHeight:o,containerWidth:w,containerHeight:E,viewportClipRect:c,tooltipNotchSize:l,currentTooltipPlacement:m,desiredTooltipPlacement:T}){if(e.bottom<=c.top)return o+l<=E-c.top?f.BELOW:f.ABOVE;if(e.top>=c.bottom)return o+l<=c.bottom?f.ABOVE:f.BELOW;if(e.right<=c.left)return t+l<=w-c.left?f.RIGHT:f.LEFT;if(e.left>=c.right)return t+l<=c.right?f.LEFT:f.RIGHT;const d=R=>{const _=e.left+e.width/2,A=_>=c.left&&_<=c.right,Q=e.top+e.height/2,N=Q>=c.top&&Q<=c.bottom;switch(R){case f.BELOW:return E-e.bottom>o+l&&A;case f.ABOVE:return e.top>o+l&&A;case f.RIGHT:return w-e.right>t+l&&N;case f.LEFT:return e.left>t+l&&N}};if(T&&d(T))return T;if(m&&d(m))return m;const y=[{placement:f.BELOW,dist:e.top},{placement:f.ABOVE,dist:E-e.bottom},{placement:f.RIGHT,dist:e.left},{placement:f.LEFT,dist:w-e.right}];y.sort((R,_)=>R.dist-_.dist);for(const{placement:R}of y)if(d(R))return R;return f.BELOW}function b(e,t,o){o==null?e.style.removeProperty(t):e.style.setProperty(t,typeof o=="number"?o+"px":o,"important")}function fe(e,t,o){t=Math.round(t),o=Math.round(o),e.style.transform=`translate3d(${t}px, ${o}px, 0px)`}function Ze(e){if(G.customScrollIntoView){G.customScrollIntoView(e);return}const{scrollPadding:t}=G;if(t&&Fe(e)===document.scrollingElement){const o=t.top||0,w=t.right||0,E=t.bottom||0,c=t.left||0;let l=0,m=0;const T=e.getBoundingClientRect(),d=Ct(),y=Xt();if(T.top<o?l=T.top-o:T.bottom>y-E&&(l=T.bottom-y+E),T.left<c?m=T.left-c:T.right>d-w&&(m=T.right-d+w),l!=0||m!=0){window.scrollBy({top:l,left:m,behavior:"smooth"});return}}try{e.scrollIntoView({behavior:"smooth",block:"nearest"})}catch(o){console.warn("Userflow.js: scrollIntoView error (falling back to no options).",o),e.scrollIntoView()}}function qe(e){if(!e||e==="0")return{paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0};const t=e.trim().split(" ");if(t.length===1){const o=it(t[0]);return{paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o}}else if(t.length===2){const o=it(t[0]),w=it(t[1]);return{paddingTop:o,paddingRight:w,paddingBottom:o,paddingLeft:w}}else return{paddingTop:it(t[0]),paddingRight:it(t[1]),paddingBottom:it(t[2]),paddingLeft:it(t[3])}}function it(e){const t=parseInt(e,10);return isNaN(t)?0:t}export{fo as B,bo as F};
3
3
  //# sourceMappingURL=FlowChrome.js.map
@@ -1,2 +1,2 @@
1
- import{r as l,R as t}from"./vendor.react.js";import{o as Y}from"./vendor.obj-str.js";import{u as ne}from"./client-context.js";import{B as se}from"./BuilderBar.js";import"./vendor.core-js.js";import{v as q}from"./vendor.uuid.js";import{s as W,p as oe,a as ae,j as ce,f as le}from"./roots.js";import{u as y,n as ie,m as ue,o as de,p as me}from"./userflow.js";import{D as K}from"./stylesheets.js";import{f as fe}from"./vendor.fortawesome.pro-light-svg-icons.js";import{c as $}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.object-assign.js";import"./vendor.i18next.js";import"./vendor.babel.runtime.js";import"./vendor.react-i18next.js";import"./Frame.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./iframe-reset.styl.js";import"./logomark.js";import"./use-window-resize.js";import"./vendor.phoenix.js";import"./vendor.fortawesome.pro-regular-svg-icons.js";import"./flow-condition-types.js";import"./vendor.date-fns.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},u=new Error().stack;u&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[u]="ce122f12-6141-4c84-a59a-e93afa393e63",r._sentryDebugIdIdentifier="sentry-dbid-ce122f12-6141-4c84-a59a-e93afa393e63")}catch{}})();const Z=r=>q();let X=Z;function A(r){return X(r)}A.uuidv4=q;A.mock=r=>{X=r};A.unmock=()=>{X=Z};const we=500,pe=500,ge=5e3,he="builderBarPos",Ee=50,Se=500,T=30,Re=({stepCount:r,stepCountReceived:u,isPaused:w,onTogglePause:x,onStartOver:N})=>{const o=r>=T,S=k=>{k.preventDefault(),k.stopPropagation(),x()},p=k=>{k.preventDefault(),k.stopPropagation(),N()},P=()=>o?t.createElement("div",{className:"userflowjs-smart-flow-square"}):w?t.createElement(K,{icon:$,size:16}):t.createElement("div",{className:"userflowjs-smart-flow-pulse-dot"}),D=()=>o?"Stopped recording":w?"Recording paused":"Recording flow";return u?t.createElement(t.Fragment,null,t.createElement("div",{className:"userflowjs-smart-flow-recording"},P(),t.createElement("div",{className:"userflowjs-smart-flow-text"},t.createElement("span",{className:"userflowjs-smart-flow-text--bold"},D()),t.createElement("span",{className:Y({"userflowjs-smart-flow-text":!0,"text-normal":!o&&r<25,"text-warning":!o&&r>=25,"text-danger":o})},` ${r} steps recorded / ${T} steps limit`))),!o&&t.createElement(t.Fragment,null,t.createElement("button",{className:Y({"userflowjs-smart-flow-resume":w,"userflowjs-smart-flow-pause":!w}),onMouseDown:S},w?t.createElement(t.Fragment,null,t.createElement("div",{className:"userflowjs-smart-flow-resume-dot"}),t.createElement("span",null,"Resume recording")):t.createElement(t.Fragment,null,t.createElement(K,{icon:$,size:12}),t.createElement("span",null,"Pause recording"))),t.createElement("div",{className:"userflowjs-smart-flow-separator"})),t.createElement("button",{className:"userflowjs-smart-flow-start-over",onMouseDown:p},t.createElement("span",null,"Start over"),t.createElement(K,{icon:fe,size:12}))):t.createElement("div",{className:"userflowjs-smart-flow-recording"},t.createElement("div",{className:"userflowjs-smart-flow-pulse-dot"}),t.createElement("div",{className:"userflowjs-smart-flow-text"},t.createElement("span",{className:"userflowjs-smart-flow-text--bold"},"Initializing Recorder...")))};function Ie(r){try{const u=r.tagName.toLowerCase(),x=["input","textarea","select"].includes(u)||r.getAttribute("contenteditable")==="true"?ue.INPUT:void 0,N=ae(r,{elementType:x});if(!N)return null;const o=r.getBoundingClientRect(),S=P=>Math.round(P/ce(1)),p={...N.selector,targetX1:S(o.left),targetY1:S(o.top),targetX2:S(o.right),targetY2:S(o.bottom),screenshotWidth:window.innerWidth,screenshotHeight:window.innerHeight};return p.autoData&&le(p)?.length===0?null:p}catch{return null}}const Ze=({state:r})=>{const u=ne(),w=l.useRef(null),[x,N]=l.useState(!1),[o,S]=l.useState(0),[p,P]=l.useState(!1),[D,k]=l.useState(!1),[V,H]=l.useState(0),n=l.useRef(null),F=l.useRef(new Map),g=l.useRef(new Map),M=l.useRef(),v=l.useRef(new Set),C=l.useRef(!1),a=l.useRef(null),d=l.useRef();l.useEffect(()=>{if(!x||!r.isRecording)return;n.current||(oe(),v.current.clear(),n.current={sessionId:r.sessionId,isRecording:!0,startUrl:r.startUrl,steps:[]},y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowRecording",isRecording:!0}}));const m=n.current.sessionId,h={capture:!0},f=document.getElementById("userflow-ui"),_=()=>{const e=me.getItem(he)==="top"?"top":"bottom",c=w.current?.getRootEl()?.clientHeight||0;return{position:e,height:c}},L=async()=>{const{position:e,height:s}=_(),c=0,i=e==="top"?s:0,E=Math.round(window.innerWidth),R=Math.round(window.innerHeight)-s;try{const I=await new Promise((O,b)=>{const re=window.setTimeout(()=>{a.current=null,b(new Error("Screenshot timeout"))},ge);a.current={resolve:O,reject:b,timeoutId:re},y({kind:"userflow:crxScreenshot",x:c,y:i,width:E,height:R,devicePixelRatio:window.devicePixelRatio})});return I?.startsWith("data:image")?I:null}catch{return a.current=null,null}},B=(e,s)=>{if(!e.selector){console.warn("SmartFlowRecordingApp: Cannot send step without selector");return}if(g.current.has(e.stepId))return;const c=de(E=>E.kind==="userflow:smartFlowStepAcknowledgment"&&E.stepId===e.stepId?E:null).then(()=>{});g.current.set(e.stepId,c);const i={kind:"userflow:smartFlowStep",stepId:e.stepId,selectorData:e.selector,screenshotDataUrl:s,action:e.action,url:e.url};y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:i})},j=async(e,s,c)=>{if(!n.current?.isRecording)return;const i=e?Ie(e):null;if(e&&!i){console.warn("SmartFlowRecordingApp: Failed to generate selector for element");return}const R={stepId:A("smart-flow-step"),element:e,selector:i,action:s,url:c||window.location.href};n.current.steps.push(R);let I=null;R.element&&(I=await L()),B(R,I)},z=e=>{if(!n.current?.isRecording||D){console.debug("SmartFlowRecordingApp: Not recording or paused, ignoring click");return}if(o>=T){H(b=>b+1),console.warn("SmartFlowRecordingApp: Maximum step limit reached, ignoring click");return}if(C.current||!e.isTrusted)return;let c=e.composedPath()[0];if(c&&c.nodeType===Node.TEXT_NODE&&(c=c.parentElement),!(c instanceof Element))return;const i=c;if(f&&f.contains(i))return;const E=window.location.href,R=Date.now(),I=W(i),O=F.current.get(I)||0;R-O<we||(F.current.set(I,R),e.preventDefault(),e.stopImmediatePropagation(),C.current=!0,j(i,"click",E).catch(b=>{console.error("Recording failed, dispatching fallback click:",{error:b.message,element:{tagName:i.tagName,id:i.id,className:i.className},coordinates:{x:e.clientX,y:e.clientY}})}).finally(()=>{C.current=!1;const b=new MouseEvent(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,view:e.view,detail:e.detail,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,button:e.button,buttons:e.buttons,relatedTarget:e.relatedTarget});i.dispatchEvent(b)}))},U=e=>{if(!n.current?.isRecording||D)return;if(o>=T){console.warn("SmartFlowRecordingApp: Maximum step limit reached, ignoring input"),H(E=>E+1);return}const s=e.target;if(!s||f&&f.contains(s))return;const c=W(s);if(v.current.has(c))return;const i=window.location.href;M.current&&window.clearTimeout(M.current),M.current=window.setTimeout(()=>{v.current.add(c),j(s,"input",i)},pe)},te=ie(e=>{switch(e.kind){case"userflow:crxScreenshotResult":{a.current&&(window.clearTimeout(a.current.timeoutId),e.imageDataUrl&&e.imageDataUrl.startsWith("data:image")?a.current.resolve(e.imageDataUrl):a.current.reject(new Error("Invalid screenshot data from Chrome extension")),a.current=null);break}case"userflow:smartFlowStepAcknowledgment":{g.current.delete(e.stepId),S(Math.min(e.stepCount,T));break}case"userflow:stepCountResponse":{const s=e;s.sessionId===n.current?.sessionId&&(S(Math.min(s.stepCount,T)),P(!0),d.current&&(window.clearInterval(d.current),d.current=void 0));break}case"userflow:smartFlowCancel":{const s=e.sessionId;n.current&&n.current.sessionId===s&&(n.current.isRecording=!1,g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null),u.setSessionStorageState(c=>({...c,activeApp:null,smartFlowRecording:null})));break}case"userflow:smartFlowStartOverAck":{const s=e.startUrl;s&&window.location.href!==s&&(window.location.href=s);break}}return!1});return(()=>{if(!m)return;const e={kind:"userflow:requestStepCount",sessionId:m};y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e}),d.current&&window.clearInterval(d.current),d.current=window.setInterval(()=>{y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})},Ee),window.setTimeout(()=>{d.current&&(window.clearInterval(d.current),d.current=void 0)},Se)})(),p&&(document.addEventListener("click",z,h),document.addEventListener("input",U,h),document.addEventListener("change",U,h)),()=>{te(),document.removeEventListener("click",z,h),document.removeEventListener("input",U,h),document.removeEventListener("change",U,h),M.current&&(window.clearTimeout(M.current),M.current=void 0),d.current&&(window.clearInterval(d.current),d.current=void 0)}},[r.isRecording,r.sessionId,r.startUrl,x,p,o,D,u]);const G=l.useCallback(async m=>{if(m.preventDefault(),m.stopPropagation(),!n.current)return;const h=n.current.sessionId;if(n.current.isRecording=!1,g.current.size>0){const f=g.current.size,_=new Promise((B,j)=>setTimeout(()=>j(new Error(`Timeout waiting for ${f} pending step(s)`)),2e4)),L=Promise.allSettled(Array.from(g.current.values()));try{await Promise.race([L,_])}catch(B){throw console.error(`Failed to wait for ${f} pending step(s)`,B),new Error("Some steps were not acknowledged. Please try again.")}}g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null),y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowComplete",sessionId:h}}),u.setSessionStorageState(f=>({...f,activeApp:null,smartFlowRecording:null}))},[u]),J=l.useCallback(()=>{n.current&&(y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowStartOver"}}),n.current.isRecording=!1,g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null),u.setSessionStorageState(m=>({...m,activeApp:null,smartFlowRecording:null})))},[u]),Q=l.useCallback(m=>{m.preventDefault(),m.stopPropagation();const h=n.current?.sessionId||null;n.current&&(n.current.isRecording=!1,g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null)),y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowCancel",sessionId:h}}),u.setSessionStorageState(f=>({...f,activeApp:null,smartFlowRecording:null}))},[u]),ee=()=>{k(m=>!m)};return t.createElement(se,{ref:w,onReadyChange:N,buttons:t.createElement(t.Fragment,null,t.createElement("button",{className:"btn btn--default",disabled:!p||o===0,onMouseDown:G},"Done"),t.createElement("button",{className:"btn btn--secondary-on-dark",onMouseDown:Q},"Cancel"))},t.createElement("div",{className:"userflowjs-smart-flow-layout"},t.createElement("div",{className:"userflowjs-smart-flow-title"},"Userflow Smartflow Creation"),t.createElement("div",{className:"userflowjs-smart-flow-status-container"},t.createElement("div",{key:`status-${V}`,className:Y({"userflowjs-smart-flow-status":!0,"flash-warning":o>=25&&o<T,"flash-danger":o>=T})},t.createElement(Re,{stepCount:o,stepCountReceived:p,isPaused:D,onTogglePause:ee,onStartOver:J})))))};export{Ze as SmartFlowRecordingApp,Ze as default};
1
+ import{r as l,R as t}from"./vendor.react.js";import{o as Y}from"./vendor.obj-str.js";import{u as ne}from"./client-context.js";import{B as se}from"./BuilderBar.js";import"./vendor.core-js.js";import{v as $}from"./vendor.uuid.js";import{t as W,q as oe,a as ae,j as ce,f as le}from"./roots.js";import{u as y,n as ie,m as ue,o as de,p as me}from"./userflow.js";import{D as K}from"./stylesheets.js";import{f as fe}from"./vendor.fortawesome.pro-light-svg-icons.js";import{c as q}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.object-assign.js";import"./vendor.i18next.js";import"./vendor.babel.runtime.js";import"./vendor.react-i18next.js";import"./Frame.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./iframe-reset.styl.js";import"./logomark.js";import"./use-window-resize.js";import"./vendor.phoenix.js";import"./vendor.fortawesome.pro-regular-svg-icons.js";import"./flow-condition-types.js";import"./vendor.date-fns.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},u=new Error().stack;u&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[u]="f8e793e3-9460-40c3-b4f4-5ddde84c614c",r._sentryDebugIdIdentifier="sentry-dbid-f8e793e3-9460-40c3-b4f4-5ddde84c614c")}catch{}})();const Z=r=>$();let X=Z;function A(r){return X(r)}A.uuidv4=$;A.mock=r=>{X=r};A.unmock=()=>{X=Z};const we=500,pe=500,ge=5e3,he="builderBarPos",Ee=50,Se=500,T=30,Re=({stepCount:r,stepCountReceived:u,isPaused:w,onTogglePause:x,onStartOver:N})=>{const o=r>=T,S=k=>{k.preventDefault(),k.stopPropagation(),x()},p=k=>{k.preventDefault(),k.stopPropagation(),N()},P=()=>o?t.createElement("div",{className:"userflowjs-smart-flow-square"}):w?t.createElement(K,{icon:q,size:16}):t.createElement("div",{className:"userflowjs-smart-flow-pulse-dot"}),D=()=>o?"Stopped recording":w?"Recording paused":"Recording flow";return u?t.createElement(t.Fragment,null,t.createElement("div",{className:"userflowjs-smart-flow-recording"},P(),t.createElement("div",{className:"userflowjs-smart-flow-text"},t.createElement("span",{className:"userflowjs-smart-flow-text--bold"},D()),t.createElement("span",{className:Y({"userflowjs-smart-flow-text":!0,"text-normal":!o&&r<25,"text-warning":!o&&r>=25,"text-danger":o})},` ${r} steps recorded / ${T} steps limit`))),!o&&t.createElement(t.Fragment,null,t.createElement("button",{className:Y({"userflowjs-smart-flow-resume":w,"userflowjs-smart-flow-pause":!w}),onMouseDown:S},w?t.createElement(t.Fragment,null,t.createElement("div",{className:"userflowjs-smart-flow-resume-dot"}),t.createElement("span",null,"Resume recording")):t.createElement(t.Fragment,null,t.createElement(K,{icon:q,size:12}),t.createElement("span",null,"Pause recording"))),t.createElement("div",{className:"userflowjs-smart-flow-separator"})),t.createElement("button",{className:"userflowjs-smart-flow-start-over",onMouseDown:p},t.createElement("span",null,"Start over"),t.createElement(K,{icon:fe,size:12}))):t.createElement("div",{className:"userflowjs-smart-flow-recording"},t.createElement("div",{className:"userflowjs-smart-flow-pulse-dot"}),t.createElement("div",{className:"userflowjs-smart-flow-text"},t.createElement("span",{className:"userflowjs-smart-flow-text--bold"},"Initializing Recorder...")))};function Ie(r){try{const u=r.tagName.toLowerCase(),x=["input","textarea","select"].includes(u)||r.getAttribute("contenteditable")==="true"?ue.INPUT:void 0,N=ae(r,{elementType:x});if(!N)return null;const o=r.getBoundingClientRect(),S=P=>Math.round(P/ce(1)),p={...N.selector,targetX1:S(o.left),targetY1:S(o.top),targetX2:S(o.right),targetY2:S(o.bottom),screenshotWidth:window.innerWidth,screenshotHeight:window.innerHeight};return p.autoData&&le(p)?.length===0?null:p}catch{return null}}const Ze=({state:r})=>{const u=ne(),w=l.useRef(null),[x,N]=l.useState(!1),[o,S]=l.useState(0),[p,P]=l.useState(!1),[D,k]=l.useState(!1),[V,H]=l.useState(0),n=l.useRef(null),F=l.useRef(new Map),g=l.useRef(new Map),M=l.useRef(),v=l.useRef(new Set),C=l.useRef(!1),a=l.useRef(null),d=l.useRef();l.useEffect(()=>{if(!x||!r.isRecording)return;n.current||(oe(),v.current.clear(),n.current={sessionId:r.sessionId,isRecording:!0,startUrl:r.startUrl,steps:[]},y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowRecording",isRecording:!0}}));const m=n.current.sessionId,h={capture:!0},f=document.getElementById("userflow-ui"),_=()=>{const e=me.getItem(he)==="top"?"top":"bottom",c=w.current?.getRootEl()?.clientHeight||0;return{position:e,height:c}},L=async()=>{const{position:e,height:s}=_(),c=0,i=e==="top"?s:0,E=Math.round(window.innerWidth),R=Math.round(window.innerHeight)-s;try{const I=await new Promise((O,b)=>{const re=window.setTimeout(()=>{a.current=null,b(new Error("Screenshot timeout"))},ge);a.current={resolve:O,reject:b,timeoutId:re},y({kind:"userflow:crxScreenshot",x:c,y:i,width:E,height:R,devicePixelRatio:window.devicePixelRatio})});return I?.startsWith("data:image")?I:null}catch{return a.current=null,null}},B=(e,s)=>{if(!e.selector){console.warn("SmartFlowRecordingApp: Cannot send step without selector");return}if(g.current.has(e.stepId))return;const c=de(E=>E.kind==="userflow:smartFlowStepAcknowledgment"&&E.stepId===e.stepId?E:null).then(()=>{});g.current.set(e.stepId,c);const i={kind:"userflow:smartFlowStep",stepId:e.stepId,selectorData:e.selector,screenshotDataUrl:s,action:e.action,url:e.url};y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:i})},j=async(e,s,c)=>{if(!n.current?.isRecording)return;const i=e?Ie(e):null;if(e&&!i){console.warn("SmartFlowRecordingApp: Failed to generate selector for element");return}const R={stepId:A("smart-flow-step"),element:e,selector:i,action:s,url:c||window.location.href};n.current.steps.push(R);let I=null;R.element&&(I=await L()),B(R,I)},z=e=>{if(!n.current?.isRecording||D){console.debug("SmartFlowRecordingApp: Not recording or paused, ignoring click");return}if(o>=T){H(b=>b+1),console.warn("SmartFlowRecordingApp: Maximum step limit reached, ignoring click");return}if(C.current||!e.isTrusted)return;let c=e.composedPath()[0];if(c&&c.nodeType===Node.TEXT_NODE&&(c=c.parentElement),!(c instanceof Element))return;const i=c;if(f&&f.contains(i))return;const E=window.location.href,R=Date.now(),I=W(i),O=F.current.get(I)||0;R-O<we||(F.current.set(I,R),e.preventDefault(),e.stopImmediatePropagation(),C.current=!0,j(i,"click",E).catch(b=>{console.error("Recording failed, dispatching fallback click:",{error:b.message,element:{tagName:i.tagName,id:i.id,className:i.className},coordinates:{x:e.clientX,y:e.clientY}})}).finally(()=>{C.current=!1;const b=new MouseEvent(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,view:e.view,detail:e.detail,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,button:e.button,buttons:e.buttons,relatedTarget:e.relatedTarget});i.dispatchEvent(b)}))},U=e=>{if(!n.current?.isRecording||D)return;if(o>=T){console.warn("SmartFlowRecordingApp: Maximum step limit reached, ignoring input"),H(E=>E+1);return}const s=e.target;if(!s||f&&f.contains(s))return;const c=W(s);if(v.current.has(c))return;const i=window.location.href;M.current&&window.clearTimeout(M.current),M.current=window.setTimeout(()=>{v.current.add(c),j(s,"input",i)},pe)},te=ie(e=>{switch(e.kind){case"userflow:crxScreenshotResult":{a.current&&(window.clearTimeout(a.current.timeoutId),e.imageDataUrl&&e.imageDataUrl.startsWith("data:image")?a.current.resolve(e.imageDataUrl):a.current.reject(new Error("Invalid screenshot data from Chrome extension")),a.current=null);break}case"userflow:smartFlowStepAcknowledgment":{g.current.delete(e.stepId),S(Math.min(e.stepCount,T));break}case"userflow:stepCountResponse":{const s=e;s.sessionId===n.current?.sessionId&&(S(Math.min(s.stepCount,T)),P(!0),d.current&&(window.clearInterval(d.current),d.current=void 0));break}case"userflow:smartFlowCancel":{const s=e.sessionId;n.current&&n.current.sessionId===s&&(n.current.isRecording=!1,g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null),u.setSessionStorageState(c=>({...c,activeApp:null,smartFlowRecording:null})));break}case"userflow:smartFlowStartOverAck":{const s=e.startUrl;s&&window.location.href!==s&&(window.location.href=s);break}}return!1});return(()=>{if(!m)return;const e={kind:"userflow:requestStepCount",sessionId:m};y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e}),d.current&&window.clearInterval(d.current),d.current=window.setInterval(()=>{y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})},Ee),window.setTimeout(()=>{d.current&&(window.clearInterval(d.current),d.current=void 0)},Se)})(),p&&(document.addEventListener("click",z,h),document.addEventListener("input",U,h),document.addEventListener("change",U,h)),()=>{te(),document.removeEventListener("click",z,h),document.removeEventListener("input",U,h),document.removeEventListener("change",U,h),M.current&&(window.clearTimeout(M.current),M.current=void 0),d.current&&(window.clearInterval(d.current),d.current=void 0)}},[r.isRecording,r.sessionId,r.startUrl,x,p,o,D,u]);const G=l.useCallback(async m=>{if(m.preventDefault(),m.stopPropagation(),!n.current)return;const h=n.current.sessionId;if(n.current.isRecording=!1,g.current.size>0){const f=g.current.size,_=new Promise((B,j)=>setTimeout(()=>j(new Error(`Timeout waiting for ${f} pending step(s)`)),2e4)),L=Promise.allSettled(Array.from(g.current.values()));try{await Promise.race([L,_])}catch(B){throw console.error(`Failed to wait for ${f} pending step(s)`,B),new Error("Some steps were not acknowledged. Please try again.")}}g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null),y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowComplete",sessionId:h}}),u.setSessionStorageState(f=>({...f,activeApp:null,smartFlowRecording:null}))},[u]),J=l.useCallback(()=>{n.current&&(y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowStartOver"}}),n.current.isRecording=!1,g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null),u.setSessionStorageState(m=>({...m,activeApp:null,smartFlowRecording:null})))},[u]),Q=l.useCallback(m=>{m.preventDefault(),m.stopPropagation();const h=n.current?.sessionId||null;n.current&&(n.current.isRecording=!1,g.current.clear(),n.current=null,F.current.clear(),v.current.clear(),C.current=!1,a.current&&(window.clearTimeout(a.current.timeoutId),a.current=null)),y({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:{kind:"userflow:smartFlowCancel",sessionId:h}}),u.setSessionStorageState(f=>({...f,activeApp:null,smartFlowRecording:null}))},[u]),ee=()=>{k(m=>!m)};return t.createElement(se,{ref:w,onReadyChange:N,buttons:t.createElement(t.Fragment,null,t.createElement("button",{className:"btn btn--default",disabled:!p||o===0,onMouseDown:G},"Done"),t.createElement("button",{className:"btn btn--secondary-on-dark",onMouseDown:Q},"Cancel"))},t.createElement("div",{className:"userflowjs-smart-flow-layout"},t.createElement("div",{className:"userflowjs-smart-flow-title"},"Userflow Smartflow Creation"),t.createElement("div",{className:"userflowjs-smart-flow-status-container"},t.createElement("div",{key:`status-${V}`,className:Y({"userflowjs-smart-flow-status":!0,"flash-warning":o>=25&&o<T,"flash-danger":o>=T})},t.createElement(Re,{stepCount:o,stepCountReceived:p,isPaused:D,onTogglePause:ee,onStartOver:J})))))};export{Ze as SmartFlowRecordingApp,Ze as default};
2
2
  //# sourceMappingURL=SmartFlowRecordingApp.js.map
@@ -1,2 +1,2 @@
1
- import{f as c,h as w,aa as k,ab as z,ac as K,ad as L}from"./userflow.js";import"./vendor.core-js.js";import{i as S,b as I,c as X,a as B,d as P,s as Y}from"./vendor.date-fns.js";import{M as Z,o as H,f as x,w as F,x as q}from"./roots.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3d690c60-d56c-464a-88f6-7f6879edc3fb",e._sentryDebugIdIdentifier="sentry-dbid-3d690c60-d56c-464a-88f6-7f6879edc3fb")}catch{}})();const Q=/(\\*)\{\{([a-zA-Z0-9_.\\/]+)\}\}/g;function J(e,t){return(e||"").replace(Q,(r,n,s)=>{const o=n.length;return o%2===0?"\\".repeat(o/2)+(t(s)||""):"\\".repeat((o-1)/2)+"{{"+s+"}}"})}function ee(e){let t=null;return r=>(t||(t=new Map,e.forEach(({name:n,value:s})=>t.set(n,Array.isArray(s)?s[0]:s))),t.get(r)||null)}function g(e,t){const r=ee(t);return J(e,n=>r(n))}function U(e,t){const r=M(e,t),n=e.nearSelector&&M(e.nearSelector,t);return e===r&&e.nearSelector===n?e:e.nearSelector===n?r:{...r,nearSelector:n}}function M(e,t){if(!e.text)return e;const r=g(e.text,t);return r===e.text?e:{...e,text:r}}function te(e,t){return e.includes.length===0&&e.excludes.length===0?!1:(e.includes.length===0||e.includes.some(r=>{const n=V(r);return n&&t.match(n)}))&&!e.excludes.some(r=>{const n=V(r);return n&&t.match(n)})}function re(e){const t=e.match(/^(([a-z\d]+):\/\/)?([^/?#]+)?(\/[^?#]*)?(\?([^#]*))?(#.*)?$/i);if(!t)return null;const[,,r,n,s,,o,i]=t;return{scheme:r||"",domain:n||"",path:s||"",query:o||"",fragment:i||""}}function V(e){const t=re(e);if(!t)return console.error("Userflow: Invalid URL pattern:",e),null;const{scheme:r,domain:n,path:s,query:o,fragment:i}=t;let l;r?l=O(r):l="[a-z\\d]+";let f;n?f=A(n,"[^/]","."):f="[^/]*";const a="(:\\d+)?";let p;s?p=A(s,"[^?#]","/"):p="/[^?#]*";let E;o?(E="",new URLSearchParams(o).forEach((d,T)=>{let h;d===""?h="=?":d==="*"?h="(=[^&#]*)?":(d=d.split(/\*/g).map($=>encodeURI($)).join("*"),h="="+A(d,"[^#]")),E+="(?=.*[?&]"+O(T)+h+"([&#]|$))"}),E+="\\?[^#]*"):E="(\\?[^#]*)?";let m;return i?m=A(i,".","/"):m="(#.*)?",new RegExp("^"+l+"://"+f+a+p+E+m+"$")}function A(e,t,r){return e=O(e),e=e.replace(/\\\*/g,t+"*"),r&&(e=e.replace(/:[a-zA-Z0-9_]+/g,"[^"+r+"]+")),e}function O(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const y={[c.ABSOLUTE_EQ]:{compare:({condition:e,value:t})=>{const r=b(t),n=D(e.value,"00:00:00.000"),s=D(e.value,"23:59:59.999");return r!=null&&n!=null&&s!=null&&!S(r,n)&&!I(r,s)}},[c.ABSOLUTE_GT]:{compare:({condition:e,value:t})=>{const r=b(t),n=D(e.value,"23:59:59.999");return r!=null&&n!=null&&I(r,n)}},[c.ABSOLUTE_LT]:{compare:({condition:e,value:t})=>{const r=b(t),n=D(e.value,"00:00:00.000");return r!=null&&n!=null&&S(r,n)}},[c.AND]:{compare:()=>W("AND.compare")},[c.BETWEEN]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&!!e.value2&&parseFloat(v(t))>=parseFloat(e.value)&&parseFloat(v(t))<=parseFloat(e.value2)},[c.CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().includes(g(t.value||"",e).toLowerCase())},[c.EMPTY]:{compare:({value:e})=>e==null||e===""||Array.isArray(e)&&e.length===0},[c.ENDS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().endsWith(g(t.value||"",e).toLowerCase())},[c.EQ]:{compare:({sessionData:e,condition:t,value:r})=>g(t.value||"",e)===v(r)},[c.EXCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).some(n=>r.has(n))}},[c.EXCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).every(n=>r.has(n))}},[c.FALSE]:{compare:({value:e})=>v(e).toLowerCase()==="false"},[c.GT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>parseFloat(e.value)},[c.GTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>=parseFloat(e.value)},[c.INCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).every(n=>r.has(n))}},[c.INCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).some(n=>r.has(n))}},[c.LT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<parseFloat(e.value)},[c.LTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<=parseFloat(e.value)},[c.NE]:{compare:({sessionData:e,condition:t,value:r})=>g(t.value||"",e)!==v(r)},[c.NOT_CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!r||!v(r).toLowerCase().includes(g(t.value||"",e).toLowerCase())},[c.NOT_EMPTY]:{compare:({value:e})=>e!=null&&e!==""&&(!Array.isArray(e)||e.length>0)},[c.NOT_REGEX]:{compare:({condition:e,value:t})=>!j(e,t)},[c.OR]:{compare:()=>W("OR.compare")},[c.REGEX]:{compare:({condition:e,value:t})=>j(e,t)},[c.RELATIVE_EQ]:{compare:({condition:e,value:t})=>{const r=b(t),n=_(e.value);return r==null||n==null?!1:!S(r,n)&&S(r,X(n,1))}},[c.RELATIVE_GT]:{compare:({condition:e,value:t})=>{const r=b(t),n=_(e.value);return r==null||n==null?!1:I(r,n)}},[c.RELATIVE_LT]:{compare:({condition:e,value:t})=>{const r=b(t),n=_(e.value);return r==null||n==null?!1:S(r,n)}},[c.STARTS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().startsWith(g(t.value||"",e).toLowerCase())},[c.TRUE]:{compare:({value:e})=>v(e).toLowerCase()==="true"},[c.URL]:{compare:({condition:e,value:t})=>e.urlPattern&&t!=null?te(e.urlPattern,v(t)):!1}};function W(e){throw new Error(`conditionOperators.${e} is not supported`)}function b(e){if(Array.isArray(e)&&(e=e[0]),!e)return null;e.match(/(Z|((\+|-)\d\d:\d\d))$/i)||(e+="Z");const t=B(e);return P(t)?t:null}function D(e,t){if(!e)return null;e+="T"+t+"Z";const r=B(e);return P(r)?r:null}function _(e){if(!e)return null;const t=parseInt(e,10);return isNaN(t)?null:Y(Date.now(),t)}function j(e,t){return e.value?new RegExp(e.value).test(v(t)):!1}function v(e){return Array.isArray(e)?e[0]:e??""}function N(e){return Array.isArray(e)?e:e===""||e==null?[]:[e]}const ne=50,se=1e3;function R(e,t={}){let r,n;const s=()=>{n=void 0,e()},o=()=>{if(window.clearTimeout(r),n==null)n=Date.now();else if(Date.now()-n>se){s();return}r=window.setTimeout(s,ne)},i=a=>{const p=a.target;if(!p||!G(p))return;const E=document.getElementById("userflow-ui");E&&E.contains(p)||o()},l=new Z(a=>{oe(a)||o()}),f=H(a=>{l.observe(a,{attributes:!0,subtree:!0,childList:!0,characterData:!0}),a.addEventListener("animationend",i),a.addEventListener("transitionend",i),t.observeInput&&(a.addEventListener("input",o),a.addEventListener("keypress",o),a.addEventListener("change",o))},a=>{a.removeEventListener("animationend",i),a.removeEventListener("transitionend",i),t.observeInput&&(a.removeEventListener("input",o),a.removeEventListener("keypress",o),a.removeEventListener("change",o))});return{disconnect:()=>{window.clearTimeout(r),l.disconnect(),f()}}}function oe(e){const t=document.getElementById("userflow-ui");for(const r of e){const{target:n}=r;if(G(n)&&t&&t.contains(n))return!0}return!1}function G(e){return e.nodeType===Node.ELEMENT_NODE}const C={[w.ALWAYS_TRUE]:{track:({callback:e})=>(e(!0),()=>{})},[w.ATTRIBUTE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let o=!1;if(e&&t.operator){const i=e.value.find(a=>a.name===t.attributeName),l=i?i.value:null;o=y[t.operator].compare({sessionData:e.value,condition:t,value:l})}r(o)};n();const s=e.observe(n);return()=>{s()}}},[w.CLAUSE]:{isExpensive:e=>{for(const t of e.conditions){const r=C[t.type];if(r.isExpensive&&r.isExpensive(t))return!0}return!1},track:({sessionData:e,condition:t,flipBackEvents:r,callback:n,description:s})=>{let o,i,l=null;const f=t.conditions.map(m=>{const u=C[m.type];return{condition:m,typeDef:u,expensive:!!u.isExpensive&&u.isExpensive(m),active:!1,isTrue:null}}),a=m=>{for(const u of f){const d=!r||!u.expensive||m;d&&!u.active?(u.active=!0,u.isTrue=!1,u.untrack=u.typeDef.track({sessionData:e,condition:u.condition,flipBackEvents:r,callback:(T,h={})=>{u.isTrue=T,window.clearTimeout(o),h.immediate?p({immediate:!0}):o=window.setTimeout(p,0)},description:s})):!d&&u.active&&(u.untrack&&u.untrack(),u.active=!1,u.isTrue=null,u.untrack=void 0)}},p=(m={})=>{if(f.length===0){E(!1,m);return}let u,d;if(t.operator===c.AND){u=!0,d=!0;for(const T of f)T.isTrue===!1?(u=!1,T.expensive||(d=!1)):u!==!1&&T.isTrue===null&&(u=null)}else{u=!1,d=!0;for(const T of f)T.isTrue===!0?(u=!0,T.expensive||(d=!1)):u!==!0&&T.isTrue===null&&(u=null)}u!==null&&u!==l&&(l=u,E(u,m)),a(d)},E=(m,u)=>{if(!m||t.waitTime==null||t.waitTime=="0")window.clearTimeout(i),i=void 0,n(m,u);else if(!i){const d=parseFloat(t.waitTime)*1e3;i=window.setTimeout(()=>{n(!0,{})},d)}};return a(!1),p(),()=>{window.clearTimeout(o),window.clearTimeout(i);for(const m of f)m.untrack&&m.untrack()}}},[w.ELEMENT]:{isExpensive:()=>!0,track:e=>{const{elementState:t}=e.condition;if(!t)return()=>{};const r=ae(t);switch(r.kind){case"observer":return le(e,r.checkElement);case"event":return ue(e,r.eventName,r.valueWhenOccurred)}}},[w.FILLED_IN_INPUT]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{let n=null,s;const o=()=>{if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}const f=x(U(t.selector,e.value));let a=null;for(const p of f){const E=F(p);if(E){a=E;break}}a?a!=n&&(window.clearTimeout(s),s=window.setTimeout(()=>{r(!0)},1e3)):(r(!1),window.clearTimeout(s)),n=a};o();const i=e.observe(o),{disconnect:l}=R(o,{observeInput:!0});return()=>{i(),l(),window.clearTimeout(s)}}},[w.FLOW]:{track:()=>(console.warn("Userflow.js: Flow conditions do not work client-side"),()=>{})},[w.INPUT_VALUE]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{if(!t.operator){console.warn("Userflow.js: INPUT_VALUE condition missing operator",t);return}if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}let i=!1;const l=y[t.operator],f=x(U(t.selector,e.value));if(f.length>0)for(const a of f){const p=F(a);if(l.compare({sessionData:e.value,condition:t,value:p})){i=!0;break}}else l.compare({sessionData:e.value,condition:t,value:""})&&(i=!0);r(i)};n();const s=e.observe(n),{disconnect:o}=R(n,{observeInput:!0});return()=>{s(),o()}}},[w.PAGE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let l=!1;if(t.operator){const f=k();l=y[t.operator].compare({sessionData:e.value,condition:t,value:f})}r(l)};let s=k();const o=()=>{const l=k();l!==s&&(s=l,n())};z(o),n();const i=e.observe(n);return()=>{i(),K(o)}}},[w.SEGMENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Segment conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.CHECKLIST_TASK_CLICKED]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Checklist conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.EVENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Event conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.TIME]:{track:({condition:e,callback:t})=>{let r=null;const n=e.value?new Date(e.value):null,s=e.value2?new Date(e.value2):null,o=()=>{let l=!0;(n&&!isNaN(n.valueOf())&&Date.now()<n.valueOf()||s&&!isNaN(s.valueOf())&&Date.now()>=s.valueOf())&&(l=!1),l!==r&&(r=l,t(l))};o();const i=window.setInterval(o,10*1e3);return()=>{window.clearInterval(i)}}}};function ae(e){switch(e){case L.CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!0};case L.DISABLED:return{kind:"observer",checkElement:t=>!!t&&t.disabled};case L.MOUSEDOWN:return{kind:"event",eventName:"mousedown",valueWhenOccurred:!0};case L.NOT_CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!1};case L.NOT_DISABLED:return{kind:"observer",checkElement:t=>!!t&&!t.disabled};case L.NOT_PRESENT:return{kind:"observer",checkElement:t=>!t};case L.PRESENT:return{kind:"observer",checkElement:t=>!!t}}}function le({sessionData:e,condition:t,callback:r},n){const s=()=>{if(!t.elementState){console.warn("Userflow.js: ELEMENT_STATE condition missing elementState",t);return}if(!t.selector){console.warn("Userflow.js: ELEMENT_STATE condition missing selector",t);return}let l=!1;const f=x(U(t.selector,e.value));if(f.length>0){for(const a of f)if(n(a)){l=!0;break}}else n(null)&&(l=!0);r(l)};s();const o=e.observe(s),{disconnect:i}=R(s);return()=>{o(),i()}}function ue({condition:e,flipBackEvents:t,callback:r},n,s){const{selector:o}=e;if(!o)return()=>{};r(!s);const i=a=>{const p=a.target;p&&q(p,o)&&(t?(r(s,{immediate:!0}),r(!s,{immediate:!0})):r(s))},l={capture:!0},f=H(a=>a.addEventListener(n,i,l),a=>a.removeEventListener(n,i,l));return()=>{f()}}const me=Object.freeze(Object.defineProperty({__proto__:null,conditionTypes:C},Symbol.toStringTag,{value:"Module"}));export{g as a,J as b,C as c,me as f,ee as g,U as i,R as o};
1
+ import{f as c,h as w,aa as k,ab as z,ac as K,ad as g}from"./userflow.js";import"./vendor.core-js.js";import{i as b,b as I,c as X,a as P,d as j,s as Y}from"./vendor.date-fns.js";import{M as Z,o as H,f as U,A as F,B as q}from"./roots.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0f9d9a44-d268-4021-a000-677093c66c9c",e._sentryDebugIdIdentifier="sentry-dbid-0f9d9a44-d268-4021-a000-677093c66c9c")}catch{}})();const Q=/(\\*)\{\{([a-zA-Z0-9_.\\/]+)\}\}/g;function J(e,t){return(e||"").replace(Q,(r,n,s)=>{const o=n.length;return o%2===0?"\\".repeat(o/2)+(t(s)||""):"\\".repeat((o-1)/2)+"{{"+s+"}}"})}function ee(e){let t=null;return r=>(t||(t=new Map,e.forEach(({name:n,value:s})=>t.set(n,Array.isArray(s)?s[0]:s))),t.get(r)||null)}function L(e,t){const r=ee(t);return J(e,n=>r(n))}function x(e,t){const r=M(e,t),n=e.nearSelector&&M(e.nearSelector,t);return e===r&&e.nearSelector===n?e:e.nearSelector===n?r:{...r,nearSelector:n}}function M(e,t){if(!e.text)return e;const r=L(e.text,t);return r===e.text?e:{...e,text:r}}function te(e,t){return e.includes.length===0&&e.excludes.length===0?!1:(e.includes.length===0||e.includes.some(r=>{const n=V(r);return n&&t.match(n)}))&&!e.excludes.some(r=>{const n=V(r);return n&&t.match(n)})}function re(e){const t=e.match(/^(([a-z\d]+):\/\/)?([^/?#]+)?(\/[^?#]*)?(\?([^#]*))?(#.*)?$/i);if(!t)return null;const[,,r,n,s,,o,u]=t;return{scheme:r||"",domain:n||"",path:s||"",query:o||"",fragment:u||""}}function V(e){const t=re(e);if(!t)return console.error("Userflow: Invalid URL pattern:",e),null;const{scheme:r,domain:n,path:s,query:o,fragment:u}=t;let a;r?a=O(r):a="[a-z\\d]+";let f;n?f=A(n,"[^/]","."):f="[^/]*";const p="(:\\d+)?";let i;s?i=A(s,"[^?#]","/"):i="/[^?#]*";let E;o?(E="",new URLSearchParams(o).forEach((d,T)=>{let h;d===""?h="=?":d==="*"?h="(=[^&#]*)?":(d=d.split(/\*/g).map($=>encodeURI($)).join("*"),h="="+A(d,"[^#]")),E+="(?=.*[?&]"+O(T)+h+"([&#]|$))"}),E+="\\?[^#]*"):E="(\\?[^#]*)?";let m;return u?m=A(u,".","/"):m="(#.*)?",new RegExp("^"+a+"://"+f+p+i+E+m+"$")}function A(e,t,r){return e=O(e),e=e.replace(/\\\*/g,t+"*"),r&&(e=e.replace(/:[a-zA-Z0-9_]+/g,"[^"+r+"]+")),e}function O(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const y={[c.ABSOLUTE_EQ]:{compare:({condition:e,value:t})=>{const r=S(t),n=D(e.value,"00:00:00.000"),s=D(e.value,"23:59:59.999");return r!=null&&n!=null&&s!=null&&!b(r,n)&&!I(r,s)}},[c.ABSOLUTE_GT]:{compare:({condition:e,value:t})=>{const r=S(t),n=D(e.value,"23:59:59.999");return r!=null&&n!=null&&I(r,n)}},[c.ABSOLUTE_LT]:{compare:({condition:e,value:t})=>{const r=S(t),n=D(e.value,"00:00:00.000");return r!=null&&n!=null&&b(r,n)}},[c.AND]:{compare:()=>W("AND.compare")},[c.BETWEEN]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&!!e.value2&&parseFloat(v(t))>=parseFloat(e.value)&&parseFloat(v(t))<=parseFloat(e.value2)},[c.CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().includes(L(t.value||"",e).toLowerCase())},[c.EMPTY]:{compare:({value:e})=>e==null||e===""||Array.isArray(e)&&e.length===0},[c.ENDS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().endsWith(L(t.value||"",e).toLowerCase())},[c.EQ]:{compare:({sessionData:e,condition:t,value:r})=>L(t.value||"",e)===v(r)},[c.EXCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).some(n=>r.has(n))}},[c.EXCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).every(n=>r.has(n))}},[c.FALSE]:{compare:({value:e})=>v(e).toLowerCase()==="false"},[c.GT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>parseFloat(e.value)},[c.GTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>=parseFloat(e.value)},[c.INCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).every(n=>r.has(n))}},[c.INCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).some(n=>r.has(n))}},[c.LT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<parseFloat(e.value)},[c.LTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<=parseFloat(e.value)},[c.NE]:{compare:({sessionData:e,condition:t,value:r})=>L(t.value||"",e)!==v(r)},[c.NOT_CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!r||!v(r).toLowerCase().includes(L(t.value||"",e).toLowerCase())},[c.NOT_EMPTY]:{compare:({value:e})=>e!=null&&e!==""&&(!Array.isArray(e)||e.length>0)},[c.NOT_REGEX]:{compare:({condition:e,value:t})=>!B(e,t)},[c.OR]:{compare:()=>W("OR.compare")},[c.REGEX]:{compare:({condition:e,value:t})=>B(e,t)},[c.RELATIVE_EQ]:{compare:({condition:e,value:t})=>{const r=S(t),n=_(e.value);return r==null||n==null?!1:!b(r,n)&&b(r,X(n,1))}},[c.RELATIVE_GT]:{compare:({condition:e,value:t})=>{const r=S(t),n=_(e.value);return r==null||n==null?!1:I(r,n)}},[c.RELATIVE_LT]:{compare:({condition:e,value:t})=>{const r=S(t),n=_(e.value);return r==null||n==null?!1:b(r,n)}},[c.STARTS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().startsWith(L(t.value||"",e).toLowerCase())},[c.TRUE]:{compare:({value:e})=>v(e).toLowerCase()==="true"},[c.URL]:{compare:({condition:e,value:t})=>e.urlPattern&&t!=null?te(e.urlPattern,v(t)):!1}};function W(e){throw new Error(`conditionOperators.${e} is not supported`)}function S(e){if(Array.isArray(e)&&(e=e[0]),!e)return null;e.match(/(Z|((\+|-)\d\d:\d\d))$/i)||(e+="Z");const t=P(e);return j(t)?t:null}function D(e,t){if(!e)return null;e+="T"+t+"Z";const r=P(e);return j(r)?r:null}function _(e){if(!e)return null;const t=parseInt(e,10);return isNaN(t)?null:Y(Date.now(),t)}function B(e,t){return e.value?new RegExp(e.value).test(v(t)):!1}function v(e){return Array.isArray(e)?e[0]:e??""}function N(e){return Array.isArray(e)?e:e===""||e==null?[]:[e]}const ne=50,se=1e3;function R(e,t={}){let r,n;const s=()=>{n=void 0,e()},o=()=>{if(window.clearTimeout(r),n==null)n=Date.now();else if(Date.now()-n>se){s();return}r=window.setTimeout(s,ne)},u=i=>{const E=i.target;if(!E||!G(E))return;const m=document.getElementById("userflow-ui");m&&m.contains(E)||o()},a=new Z(i=>{oe(i)||o()}),f=()=>{o()},p=H(i=>{a.observe(i,{attributes:!0,subtree:!0,childList:!0,characterData:!0}),i.addEventListener("animationend",u),i.addEventListener("transitionend",u),i.addEventListener("toggle",f,!0),t.observeInput&&(i.addEventListener("input",o),i.addEventListener("keypress",o),i.addEventListener("change",o))},i=>{i.removeEventListener("animationend",u),i.removeEventListener("transitionend",u),i.removeEventListener("toggle",f,!0),t.observeInput&&(i.removeEventListener("input",o),i.removeEventListener("keypress",o),i.removeEventListener("change",o))});return{disconnect:()=>{window.clearTimeout(r),a.disconnect(),p()}}}function oe(e){const t=document.getElementById("userflow-ui");for(const r of e){const{target:n}=r;if(G(n)&&t&&t.contains(n))return!0}return!1}function G(e){return e.nodeType===Node.ELEMENT_NODE}const C={[w.ALWAYS_TRUE]:{track:({callback:e})=>(e(!0),()=>{})},[w.ATTRIBUTE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let o=!1;if(e&&t.operator){const u=e.value.find(p=>p.name===t.attributeName),a=u?u.value:null;o=y[t.operator].compare({sessionData:e.value,condition:t,value:a})}r(o)};n();const s=e.observe(n);return()=>{s()}}},[w.CLAUSE]:{isExpensive:e=>{for(const t of e.conditions){const r=C[t.type];if(r.isExpensive&&r.isExpensive(t))return!0}return!1},track:({sessionData:e,condition:t,flipBackEvents:r,callback:n,description:s})=>{let o,u,a=null;const f=t.conditions.map(m=>{const l=C[m.type];return{condition:m,typeDef:l,expensive:!!l.isExpensive&&l.isExpensive(m),active:!1,isTrue:null}}),p=m=>{for(const l of f){const d=!r||!l.expensive||m;d&&!l.active?(l.active=!0,l.isTrue=!1,l.untrack=l.typeDef.track({sessionData:e,condition:l.condition,flipBackEvents:r,callback:(T,h={})=>{l.isTrue=T,window.clearTimeout(o),h.immediate?i({immediate:!0}):o=window.setTimeout(i,0)},description:s})):!d&&l.active&&(l.untrack&&l.untrack(),l.active=!1,l.isTrue=null,l.untrack=void 0)}},i=(m={})=>{if(f.length===0){E(!1,m);return}let l,d;if(t.operator===c.AND){l=!0,d=!0;for(const T of f)T.isTrue===!1?(l=!1,T.expensive||(d=!1)):l!==!1&&T.isTrue===null&&(l=null)}else{l=!1,d=!0;for(const T of f)T.isTrue===!0?(l=!0,T.expensive||(d=!1)):l!==!0&&T.isTrue===null&&(l=null)}l!==null&&l!==a&&(a=l,E(l,m)),p(d)},E=(m,l)=>{if(!m||t.waitTime==null||t.waitTime=="0")window.clearTimeout(u),u=void 0,n(m,l);else if(!u){const d=parseFloat(t.waitTime)*1e3;u=window.setTimeout(()=>{n(!0,{})},d)}};return p(!1),i(),()=>{window.clearTimeout(o),window.clearTimeout(u);for(const m of f)m.untrack&&m.untrack()}}},[w.ELEMENT]:{isExpensive:()=>!0,track:e=>{const{elementState:t}=e.condition;if(!t)return()=>{};const r=ae(t);switch(r.kind){case"observer":return le(e,r.checkElement);case"event":return ue(e,r.eventName,r.valueWhenOccurred)}}},[w.FILLED_IN_INPUT]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{let n=null,s;const o=()=>{if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}const f=U(x(t.selector,e.value));let p=null;for(const i of f){const E=F(i);if(E){p=E;break}}p?p!=n&&(window.clearTimeout(s),s=window.setTimeout(()=>{r(!0)},1e3)):(r(!1),window.clearTimeout(s)),n=p};o();const u=e.observe(o),{disconnect:a}=R(o,{observeInput:!0});return()=>{u(),a(),window.clearTimeout(s)}}},[w.FLOW]:{track:()=>(console.warn("Userflow.js: Flow conditions do not work client-side"),()=>{})},[w.INPUT_VALUE]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{if(!t.operator){console.warn("Userflow.js: INPUT_VALUE condition missing operator",t);return}if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}let u=!1;const a=y[t.operator],f=U(x(t.selector,e.value));if(f.length>0)for(const p of f){const i=F(p);if(a.compare({sessionData:e.value,condition:t,value:i})){u=!0;break}}else a.compare({sessionData:e.value,condition:t,value:""})&&(u=!0);r(u)};n();const s=e.observe(n),{disconnect:o}=R(n,{observeInput:!0});return()=>{s(),o()}}},[w.PAGE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let a=!1;if(t.operator){const f=k();a=y[t.operator].compare({sessionData:e.value,condition:t,value:f})}r(a)};let s=k();const o=()=>{const a=k();a!==s&&(s=a,n())};z(o),n();const u=e.observe(n);return()=>{u(),K(o)}}},[w.SEGMENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Segment conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.CHECKLIST_TASK_CLICKED]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Checklist conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.EVENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Event conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.TIME]:{track:({condition:e,callback:t})=>{let r=null;const n=e.value?new Date(e.value):null,s=e.value2?new Date(e.value2):null,o=()=>{let a=!0;(n&&!isNaN(n.valueOf())&&Date.now()<n.valueOf()||s&&!isNaN(s.valueOf())&&Date.now()>=s.valueOf())&&(a=!1),a!==r&&(r=a,t(a))};o();const u=window.setInterval(o,10*1e3);return()=>{window.clearInterval(u)}}}};function ae(e){switch(e){case g.CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!0};case g.DISABLED:return{kind:"observer",checkElement:t=>!!t&&t.disabled};case g.MOUSEDOWN:return{kind:"event",eventName:"mousedown",valueWhenOccurred:!0};case g.NOT_CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!1};case g.NOT_DISABLED:return{kind:"observer",checkElement:t=>!!t&&!t.disabled};case g.NOT_PRESENT:return{kind:"observer",checkElement:t=>!t};case g.PRESENT:return{kind:"observer",checkElement:t=>!!t}}}function le({sessionData:e,condition:t,callback:r},n){const s=()=>{if(!t.elementState){console.warn("Userflow.js: ELEMENT_STATE condition missing elementState",t);return}if(!t.selector){console.warn("Userflow.js: ELEMENT_STATE condition missing selector",t);return}let a=!1;const f=U(x(t.selector,e.value));if(f.length>0){for(const p of f)if(n(p)){a=!0;break}}else n(null)&&(a=!0);r(a)};s();const o=e.observe(s),{disconnect:u}=R(s);return()=>{o(),u()}}function ue({condition:e,flipBackEvents:t,callback:r},n,s){const{selector:o}=e;if(!o)return()=>{};r(!s);const u=p=>{const i=p.target;i&&q(i,o)&&(t?(r(s,{immediate:!0}),r(!s,{immediate:!0})):r(s))},a={capture:!0},f=H(p=>p.addEventListener(n,u,a),p=>p.removeEventListener(n,u,a));return()=>{f()}}const me=Object.freeze(Object.defineProperty({__proto__:null,conditionTypes:C},Symbol.toStringTag,{value:"Module"}));export{L as a,J as b,C as c,me as f,ee as g,x as i,R as o};
2
2
  //# sourceMappingURL=flow-condition-types.js.map
package/hash.txt CHANGED
@@ -1 +1 @@
1
- 3e47d2c6a81bab0fe6c5238c8cc6d3ac14bc4a7e
1
+ 4a33939e5904e43cdae6d19d67ec2d78bff29c23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "userflow.js-self-hosted",
3
- "version": "0.1.1022169",
3
+ "version": "0.1.1022200",
4
4
  "description": "Self-hosted version of Userflow.js",
5
5
  "main": "userflow.js"
6
6
  }
package/roots.js CHANGED
@@ -1,2 +1,2 @@
1
- import{d as l,G as v,ae as ne,m as ae,F as z,af as Me}from"./userflow.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8cea55c8-a9a9-4f0e-9dee-484e311b9c04",e._sentryDebugIdIdentifier="sentry-dbid-8cea55c8-a9a9-4f0e-9dee-484e311b9c04")}catch{}})();class Ne extends Error{constructor(t,o){const n=`Unreachable case: ${t}`;o?o=`${o} (${n})`:o=n,super(o)}}function pt(e){return typeof e=="object"&&e!=null}let ue=window.MutationObserver;const L=window;if(L.Zone&&typeof L.Zone.__symbol__=="function"){const e=L.Zone.__symbol__("MutationObserver");e&&typeof e=="string"&&L.hasOwnProperty(e)&&typeof L[e]=="function"&&(ue=L[e])}function fe(e,t){const o=e.left,n=e.top,r=o+e.width,i=n+e.height,c=t.left,s=t.top,f=c+t.width,u=s+t.height;return Le(o,n,r,i,c,s,f,u)}function Le(e,t,o,n,r,i,c,s){const f=c<e,u=o<r,d=s<t,a=n<i;return a&&f?U(e,n,c,i):f&&d?U(e,t,c,s):d&&u?U(o,t,r,s):u&&a?U(o,n,r,i):f?e-c:u?r-o:d?t-s:a?i-n:0}function U(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function _(e){window.performance.mark&&window.performance.mark(e)}function X(e,t,o){window.performance.measure&&window.performance.measure(e,t,o)}function ve(){const e=window.getComputedStyle(window.document.body);if(e.zoom&&e.zoom!=="1"){const t=parseFloat(e.zoom);if(!isNaN(t))return t}return 1}function wt(e){return _e(),Re(e)}let V;function Re(e){return V==null&&(V=ve()),V==1?e:e/V}function _e(){V=null}function gt(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientWidth||window.innerWidth}function De(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientHeight||window.innerHeight}function yt(e){return e?parseFloat(e.replace(/px$/,"")):0}function bt(e){return e==null?void 0:e+"px"}function Et(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}const ke=50,Ve=100,oe=25,Fe=new Set(["left","start","justify","justify-all"]);class Be{constructor(t){this.ctx=t,this.rectCache=new Map,this.isLabelLikeCache=new Map,this.hasPlaceholderCache=new Map}calcScore(t,o){const n=this.getRect(t),r=this.getRect(o),i=this.distBetween(t,o),c=K(o)?Ve:ke;if(i>c)return 0;const s=this.isLabelLike(t),f=this.isCloserToOtherInput(t,o),u=window.getComputedStyle(t).textAlign||"",d=n.top+n.height<=r.top,a=Math.abs(n.left-r.left)<oe&&(!u||Fe.has(u)),h=n.left+n.width<=r.left,T=Math.abs(n.top-r.top)<oe,E=d&&a||h&&T,y=n.height>=De()/2,b=be(o);if(b&&n.top>=r.top+r.height)return 0;let m=1;const S=t.htmlFor;return S&&S===o.id&&(m+=Math.pow(1e3,4)),b&&!y&&!f&&(s&&E?m+=Math.pow(1e3,3):o===t&&this.hasPlaceholder(o)?m+=Math.pow(1e3,2):!s&&E&&(m+=Math.pow(1e3,1))),m+=c-i,m}getRect(t){let o=this.rectCache.get(t);return o||(o=A(t),this.rectCache.set(t,o)),o}isLabelLike(t){let o=this.isLabelLikeCache.get(t);if(o===void 0){const n="a, button, h1, h2, h3, h4, h5, h6, input";o=!t.closest(n)&&!t.querySelector(n),this.isLabelLikeCache.set(t,o)}return o}hasPlaceholder(t){let o=this.hasPlaceholderCache.get(t);return o===void 0&&(o=!!F(t),this.hasPlaceholderCache.set(t,o)),o}getAllInputs(){return this.allInputs||(this.allInputs=Array.from(document.querySelectorAll(we())).filter(t=>ee(t,this.ctx))),this.allInputs}distBetween(t,o){return Math.round(fe(this.getRect(t),this.getRect(o)))}isCloserToOtherInput(t,o){let n=this.distBetween(t,o);for(let r of this.getAllInputs()){if(r===o)continue;if(this.distBetween(t,r)<n)return!0}return!1}}function Oe(e,t={}){const o=performance.now();_("userflow:inferSelector:start"),l.groupCollapsed("inferSelector for",e,t);let n;try{n=Ue(e,t)}catch(r){console.error("Userflow findElement error:",r),n=null}return l("time",performance.now()-o),l.groupEnd(),_("userflow:inferSelector:end"),X("userflow:inferSelector","userflow:inferSelector:start","userflow:inferSelector:end"),n}function de(e){const t=[],o=e.tagName.toLowerCase();return v.inferenceAttributeNames.forEach(n=>{const r=e.getAttribute(n);if(!r)return;const i=v.inferenceAttributeFilters[n];if(!(i&&!ne(i,r)))if(n==="id")t.push(`#${r}`);else{const c=n==="name"||n==="placeholder"?o:"";t.push(`${c}[${n}="${r}"]`)}}),e.classList.forEach(n=>{ne(v.inferenceClassNameFilters,n)&&(n=n.replace(/:/g,"\\:").trim(),t.push(`.${n}`))}),t}const $e=window.userflow||{};$e.__inferSelector=Oe;function Ue(e,{elementType:t}={}){const o={minorVersion:Ge};let n=be(e);const r=nt(e);if(t===ae.INPUT&&!n)if(r)e=r,n=!0,l("use custom input parent",r);else return l("not an input"),null;else r&&(e=r,n=!0);const i=Pe(e);let c=null;n||(c=pe(e),c&&c.length>250&&(c=null)),l("text is:"+c);let s=new Map,f=new Map;const u=new Map,d=new Y(i,null,o),a=new Y(i,c,o),h=(y,b,m,S,g)=>{if(S<0)return;let p=y.get(b);p||(p=[],y.set(b,p)),p.push({css:m,offset:S,complexity:g}),l(`use css=${m}, cardinality=${b}, offset=${S}`)},T=qe(e),E=[e.tagName.toLowerCase(),...de(e)];l("shadowRootSelectors:",i),l("ancestorCssSelectors:",T),l("ownCssSelectors:",E);for(const y of E)for(const b of T){const m=b?`${b} ${y}`:y,S=b?2:1,g=d.query(m),p=Array.from(g),w=p.length;if(w>100){l(`cardinality too high css=${m}, cardinality=${w}`);continue}u.set(m,w);const x=p.indexOf(e);if(h(s,w,m,x,S),c){const k=a.query(m),N=Array.from(k),Ce=N.indexOf(e),Ie=N.length;h(f,Ie,m,Ce,S)}}if(s.size>0||f.size>0){const y=S=>Array.from(S.entries()).map(([g,p])=>({cardinality:g,cssSelectors:p.sort((w,x)=>{const k=u.get(w.css),N=u.get(x.css);return k!==N?k?N?k-N:-1:1:w.complexity!==x.complexity?x.complexity-w.complexity:w.css.localeCompare(x.css)}).map(({css:w,offset:x})=>({css:w,offset:x}))})).sort((g,p)=>g.cardinality-p.cardinality),b={version:"v1",minorVersion:o.minorVersion,shadowRootSelectors:i,notextGroups:y(s),textGroups:y(f)},m={el:e,selector:{type:z.AUTO,autoData:JSON.stringify(b),text:c,elementType:t}};return l("inference result",m),m}return l("no selector inferred "),null}function Pe(e){let t=[],o=e;for(;o;){let n=o.getRootNode();if($(n)){const{host:i}=n;t.unshift(i.tagName.toLowerCase()),o=i;continue}const r=q(o);if(r){let i=r.tagName.toLowerCase();const c=r.getAttribute("name");c?i+=`[name="${c}"]`:r.id&&!r.id.match(/\d$/)&&(i+="#"+r.id),t.unshift(i),o=r;continue}break}if(t.length!==0)return t}function qe(e){const t=new Map;t.set(null,0);let o=e.parentNode;for(;o&&!(o.tagName==="BODY"||$(o));){for(const r of de(o)){if(t.has(r))continue;const i=P(document.body,r);if(i){const c=i.length;t.set(r,c)}}o=o.parentNode}return Array.from(t.entries()).sort(([,r],[,i])=>r-i).slice(0,20).map(([r])=>r)}function je(e,t){const{text:o,excludeText:n,precision:r}=e,i={minorVersion:t.minorVersion||0},c=o!=null&&!n,s=c?t.textGroups:t.notextGroups,f=Math.max(1,Math.min(s.length,Math.ceil((1-parseFloat(r||"1"))*s.length))),u=new Y(t.shadowRootSelectors,c&&o||null,i);l("findElementAutoV1",{text:o,excludeText:n,precision:r,groups:s,groupCount:f});for(let d=0;d<f;d++){const a=s[d];let h=new Map,T=0,E=null;l.group(`group cardinality=${a.cardinality}`,a);try{for(let y=0;y<a.cssSelectors.length;y++){const{css:b,offset:m}=a.cssSelectors[y];l(`css=${b}, offset=${m}`);let S=u.query(b),g=null;for(let w=0;w<=m;w++){const x=S.next();if(x.done)break;g=x.value}if(!g)continue;const p=(h.get(g)||0)+1;if(h.set(g,p),l(`el with frequency=${p}`+(p>T&&g!==E?" NEW BEST":""),g),p>T&&(T=p,E=g,p>=Math.ceil(a.cssSelectors.length/2)))return l("early winner",E),E}}finally{l.groupEnd()}if(E)return l("winner",E),E}return l("element not found"),null}class Y{constructor(t,o,n){this.shadowRootSelectors=t,this.text=o,this.ctx=n,this.isVisibleCache=new Map,this.textCache=new Map}*query(t){const o=P(document.body,t,this.shadowRootSelectors);if(l("found",o),!o)return;const{text:n}=this;for(let r=0;r<o.length;r++){const i=o[r];if(n){let s=this.textCache.get(i);if(s==null&&(s=G(i,n),this.textCache.set(i,s)),!s){l("skip, text mismatch",i);continue}}let c=this.isVisibleCache.get(i);if(c==null&&(c=ee(i,this.ctx),this.isVisibleCache.set(i,c)),!c){l("skip, not visible",i);continue}l("yield",i),yield i}}}const Ge=5,O=window.userflow||{};function Z(e){const t=performance.now();_("userflow:findAllElements:start"),l.groupCollapsed("findAllElements",e);let o;try{if(e.type===z.MANUAL)o=Ye(e);else if(e.autoData){const n=JSON.parse(e.autoData);let r;if(n.version==="v1")r=je(e,n);else throw new Ne(n.version,"Unknown autoData version: "+n.version);o=r?[r]:[]}else o=[]}catch(n){console.error("Userflow findElement error:",n),o=[]}return l("time",performance.now()-t),l.groupEnd(),_("userflow:findAllElements:end"),X("userflow:findAllElements","userflow:findAllElements:start","userflow:findAllElements:end"),o}function Ye(e){const t={minorVersion:e.minorVersion==null?1:e.minorVersion};let{css:o,text:n,elementType:r,offset:i}=e;n=n&&R(n);const c="nearSelector"in e?e.nearSelector:null;l("findAllElementsManual",e),i!=null&&c!=null&&console.warn("Userflow.js: Both selector.offset and selector.nearSelector was set; ignoring nearSelector.");let s;if(n&&!o){if(s=[],t.minorVersion>=2)for(const f of se())W(f,n,s);else W(document.body,n,s);l("els after traverseElementForText",s)}else if(o){if(t.minorVersion>=2){s=[];for(const f of se()){const u=P(f,o);u&&u.length>0&&s.push(...u)}}else s=Array.from(P(document.body,o)||[]);l("els after safeQueryAll",s),n&&(s=ze(s,n),l("els after filterElementsByText",s))}else console.warn("Userflow.js: findAllElements() requires least one of `css` and `text` to be set."),s=[];if(s.length>0&&(s=s.filter(f=>ee(f,t)),l("els after isVisible",s)),s.length>0&&r===ae.INPUT&&(s=et(s,t),l("els after mapElementsToInputs",s)),s.length>0&&(s.sort((f,u)=>{const d=A(f),a=A(u);return d.top<a.top?-1:d.top>a.top?1:d.left-a.left}),l("els after sort",s)),s.length>0){if(i!=null)s=s[i]?[s[i]]:[],l("els after offset",s);else if(c!=null){const f=Z(c);let u=null,d=0;for(const a of s)for(const h of f){const T=fe(A(a),A(h));(!u||T<d)&&(u=a,d=T)}s=u?[u]:[],l("els after nearSelector",s)}}return s}function he(e){return Z(e)[0]||null}function We(e,t){const o=performance.now();_("userflow:elementMatchesSelector:start"),l.groupCollapsed("elementMatchesSelector",e,t);let n;try{if(t.type===z.MANUAL)n=He(e,t);else{const r=he(t);n=r!=null&&r.contains(e)}}catch(r){console.error("Userflow findElement error:",r),n=!1}return l(n?"match":"not match"),l("time",performance.now()-o),l.groupEnd(),_("userflow:elementMatchesSelector:end"),X("userflow:elementMatchesSelector","userflow:elementMatchesSelector:start","userflow:elementMatchesSelector:end"),n}function He(e,t){t.offset!=null&&console.warn("Userflow.js: selector.offset is not supported for elementMatchesSelector yet"),"nearSelector"in t&&t.nearSelector!=null&&console.warn("Userflow.js: selector.nearSelector is not supported for elementMatchesSelector yet");let{css:o,text:n}=t;n=n&&R(n);let r=!1,i=e;for(;i&&i.tagName!=="BODY";){if((!o||i.matches(o))&&(!n||G(i,n))){r=!0;break}i=i.parentElement}return r}function W(e,t,o){if(B(e)){const{tagName:r}=e;if(r==="SCRIPT"||r==="STYLE")return!1}let n=!1;for(let r=0;r<e.children.length;r++)W(e.children[r],t,o)&&(n=!0);return!n&&B(e)&&G(e,t)&&(o.push(e),n=!0),n}function P(e,t,o){try{return o==null?e.querySelectorAll(t):me(t,o,0,e)}catch{return console.info("Userflow.js: Invalid CSS selector: ",t),null}}function me(e,t,o,n){if(o>=t.length)return Array.from(n.querySelectorAll(e));const r=t[o],i=n.querySelectorAll(r),c=[];return i.forEach(s=>{let f;if(s.shadowRoot)f=s.shadowRoot;else{if(!Se(s))return;let u=null;try{u=s.contentDocument}catch{}if(!u)return;f=u.body}c.push(...me(e,t,o+1,f))}),c}function ze(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];o.some(i=>i.contains(r))||G(r,t)&&o.push(r)}return o.reverse()}const Xe={email:!0,number:!0,password:!0,search:!0,tel:!0,text:!0,url:!0},Ze={date:!0,"datetime-local":!0,month:!0,time:!0,week:!0},Qe={button:!0,email:!0,reset:!0,search:!0,submit:!0,tel:!0,text:!0,url:!0};function pe(e){let t=e.innerText;return t===void 0&&e.tagName!=="SELECT"&&(t=e.textContent),t=R(t),t||null}function F(e){if(ge(e)||Q(e)){const t=R(e.getAttribute("placeholder")),o=e.value||"";if(t&&!o)return t;const n=R(o);if(n&&ot(e))return n}if(J(e)&&e.selectedIndex>=0){const t=R(e.options[e.selectedIndex].text);if(t)return t}return pe(e)}function G(e,t){const o=F(e);return o?Je(t,o):!1}function Je(e,t){const o=e.toLowerCase();return t.toLowerCase()===o}function R(e){return!e||e.length>250?null:e.replace(/^[\s\uFEFF\xA0\u200B*]+|[\s\uFEFF\xA0\u200B*]+$/g,"").replace(/\s+/g," ")}function Ke(e){for(const{cssSelector:t,getValue:o}of v.customInputs)if(e.matches(t))if(o)try{return(o(e)||"").trim()}catch(n){return console.error(`Userflow.js: getValue function for custom input '${t}' failed:`,n),""}else return F(e)||"";return J(e)?e.selectedIndex==-1?"":e.options[e.selectedIndex].text:K(e)?F(e)||"":e.value}function we(){return"input, select, textarea, [contenteditable]"+v.customInputs.map(({cssSelector:e})=>`, ${e}`).join("")}function et(e,t){const o=new Set,n=new Be(t),r=we();for(const i of e){if(i.matches(r)){o.add(i);continue}let c=null,s=null;n.getAllInputs().forEach(f=>{const u=n.calcScore(i,f);l("input",u,f),u!==0&&(c&&s&&u<=s||(l("input is best so far"),c=f,s=u))}),c&&(l("best input was",c),o.add(c))}return Array.from(o)}function ge(e){if(e.tagName!=="INPUT")return!1;const t=e.getAttribute("type");return t==null?!0:Xe[(t||"").toLowerCase()]===!0}function Q(e){return e.tagName==="TEXTAREA"}function tt(e){if(e.tagName!=="INPUT")return!1;const t=(e.getAttribute("type")||"").toLowerCase();return Ze[t]===!0}function J(e){return e.tagName==="SELECT"}function K(e){return"hasAttribute"in e&&e.hasAttribute("contenteditable")}function ye(e){return!!(K(e)||v.customInputs.some(({cssSelector:t})=>e.matches(t)))}function nt(e){let t=e.parentNode;for(;t&&!(t.tagName==="BODY"||$(t));){if(ye(t))return t;t=t.parentNode}return null}function be(e){return ge(e)||tt(e)||Q(e)||J(e)||ye(e)}function ot(e){if(Q(e))return!0;const t=(e.getAttribute("type")||"").toLowerCase();return Qe[t]}function ee(e,t){const o=A(e);let n=e,r=!0,i=!1,c=!1,s=!1,f=!1;for(;n;){const u=n===document.body,d=n.tagName==="BODY",a=window.getComputedStyle(n);let h=null;if(r){if(a.visibility&&a.visibility!=="visible")return l("not visible because visibility is",a.visibility,e,{cur:n}),!1;r=!1}if(a.display==="none")return l("not visible because display is",a.display,e,{cur:n}),!1;if(a.opacity!=null&&parseFloat(a.opacity)<.01)return l("not visible because opacity is",a.opacity,e,{cur:n}),!1;if(a.position==="absolute"?s=!0:(a.position==="relative"||a.position==="fixed"||a.position==="sticky")&&(s=!1),t.minorVersion>=4&&!i&&!d&&!(f&&a.position==="static")&&(I(a.overflowX)||I(a.overflowY))&&(h=h||A(n),h.width===0||h.height===0))return l("not visible because width/height (v1.4 check) is",h.width,h.height,e,{cur:n}),!1;if(!c&&Ee(a.display)&&(t.minorVersion<1||d||a.position!=="static")){const T=d||I(a.overflow),E=T||I(a.overflowX),y=T||I(a.overflowY),{scrollLeft:b,scrollTop:m}=d?n.ownerDocument.documentElement:n,S=!d&&!s;if(E){if(h=h||A(n),S&&h.width===0)return l("not visible because width is",h.width,e,{cur:n}),!1;const g=t.minorVersion>=5?o.width/2:0,p=Math.round(o.left+g),w=Math.round(h.left-b);if(p<w)return l("not visible because it's clipped left",e,{elX:p,curLeft:w,cur:n}),!1}if(y){if(h=h||A(n),S&&h.height===0)return l("not visible because height is",h.height,e,{cur:n}),!1;const g=t.minorVersion>=5?o.height/2:0,p=Math.round(o.top+g),w=Math.round(h.top-m);if(p<w)return l("not visible because it's clipped top",e,{elY:p,curTop:w,cur:n}),!1}(E||y)&&(c=!0)}if(a.position==="fixed"&&(i=!0,c=!0),t.minorVersion>=3&&(n.scrollTop>0||n.scrollLeft>0)&&(c=!0),u)break;d?(n=q(n),r=!0):n=n.parentElement,f=s}return!0}function I(e){return e==="hidden"||e==="clip"||e==="scroll"||e==="auto"}function Ee(e){return!e||!e.includes("inline")&&e!=="contents"}function St(e){let t=e.parentNode,o=!1;for(;t&&t.tagName!=="BODY";){$(t)&&(t=t.host);const n=window.getComputedStyle(t);if(n.position==="absolute"?o=!0:(n.position==="relative"||n.position==="fixed"||n.position==="sticky")&&(o=!1),!o&&Ee(n.display)&&(I(n.overflow)||I(n.overflowY)))return t;if(n.position==="fixed")return e.ownerDocument.documentElement;t=t.parentNode}return e.ownerDocument.documentElement}function A(e){if(e.tagName==="HTML"){const n=q(e);if(n)return A(n)}let t=e.getBoundingClientRect(),o=e;for(;o&&(o=q(o),!!o);){const n=o.getBoundingClientRect();t={width:t.width,height:t.height,left:t.left+n.left,right:t.right+n.left,top:t.top+n.top,bottom:t.bottom+n.top}}return t}const re=new WeakSet;function q(e){const t=e.ownerDocument?.defaultView;if(!t||re.has(t))return null;{const o=t.frameElement;return o||re.add(t),o}}function $(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e&&"mode"in e}function B(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Se(e){return B(e)&&e.tagName==="IFRAME"}const rt=e=>{if(!e)return null;const t=e.className;if(t==null)return null;if(typeof t=="string")return t;if(typeof t=="object"&&"baseVal"in t)return t.baseVal||null;try{return String(t)}catch{return null}},Tt=e=>{const t=e.getBoundingClientRect();return`${e.tagName}-${e.id||""}-${rt(e)||""}-${Math.round(t.left)}-${Math.round(t.top)}`};O.__findElement=he;O.__findAllElements=Z;O.__elementMatchesSelector=We;O.__getElementText=F;O.__getInputValue=Ke;const C=new Set,H=new Map,j=new Set;function se(){return Te(),C}function xt(e,t){Te();for(const n of C)e(n);const o={setup:e,teardown:t};return j.add(o),()=>{j.delete(o);for(const n of C)t(n)}}let ie=!1,M=null;function Te(){if(le(),!ie){l("roots started"),ie=!0,M=document.body,D(M),it();for(const e of Me)document.addEventListener(e,st);window.setInterval(le,10*1e3)}}function st(){M&&!document.contains(M)&&(l("roots detected new Turbo body"),te(M),M=document.body,D(M))}function it(){for(const e of document.documentElement.children)e!==document.body&&e.shadowRoot&&D(e.shadowRoot)}function le(){for(const e of C)$(e)&&(lt(e)||(l("roots clean before removeRoot",e),te(e)));l("roots clean finished, remaining=",C.size)}function lt(e){return e.ownerDocument.defaultView?e.host.isConnected:!1}function D(e){if(!C.has(e)){l("roots addRoot",e),C.add(e),ct(e),xe(e),ft(e),dt(e);for(const{setup:t}of j)t(e)}}function te(e){if(C.has(e)){l("roots removeRoot",e),H.get(e)?.disconnect(),H.delete(e),C.delete(e);for(const{teardown:t}of j)t(e)}}function ct(e){let t;const o=()=>{xe(e)},n=new ue(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(o)});n.observe(e,{childList:!0,subtree:!0}),H.set(e,n)}function xe(e){const t=B(e)?e.ownerDocument.getElementsByTagName("iframe"):e.querySelectorAll("iframe");for(const o of t)Ae(o)}const ce=new WeakSet;function Ae(e){if(ce.has(e)||e.closest("#userflow-ui"))return;e.addEventListener("load",at);const t=e.contentWindow,o=e.contentDocument;if(!t||!o){ce.add(e);return}const n=o.body;n&&(t.addEventListener("pagehide",ut),l("roots setupFrame before addRoot",e,o,n),D(n))}function at(e){const t=e.target;t&&Se(t)&&Ae(t)}function ut(e){const t=e.currentTarget.document.body;l("roots onFrameUnload before removeRoot",t),te(t)}function ft(e){const t=e.ownerDocument.defaultView;if(t.__userflowAttachShadowInstalled)return;t.__userflowAttachShadowInstalled=!0;const o=t.Element.prototype.attachShadow;o!=null&&(t.Element.prototype.attachShadow=function(n){const r=o.call(this,n);return this.shadowRoot&&(l("roots monitorShadowDom before addRoot",this,this.shadowRoot),D(this.shadowRoot)),r})}function dt(e){const t=o=>{o.childNodes.forEach(n=>{B(n)&&n.shadowRoot&&(l("roots queryShadowDom before addRoot",n,n.shadowRoot),D(n.shadowRoot)),t(n)})};t(e)}export{ue as M,Ne as U,Oe as a,be as b,pt as c,bt as d,gt as e,Z as f,pe as g,De as h,Et as i,Re as j,$ as k,B as l,q as m,R as n,xt as o,_e as p,yt as q,A as r,Tt as s,Se as t,St as u,he as v,Ke as w,We as x,wt as z};
1
+ import{d as l,G as R,ae as ne,m as ae,F as z,af as Me}from"./userflow.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1c1e07f2-b8e2-4ae7-8c35-b2c76a95768f",e._sentryDebugIdIdentifier="sentry-dbid-1c1e07f2-b8e2-4ae7-8c35-b2c76a95768f")}catch{}})();class Ie extends Error{constructor(t,o){const n=`Unreachable case: ${t}`;o?o=`${o} (${n})`:o=n,super(o)}}function pt(e){return typeof e=="object"&&e!=null}let ue=window.MutationObserver;const L=window;if(L.Zone&&typeof L.Zone.__symbol__=="function"){const e=L.Zone.__symbol__("MutationObserver");e&&typeof e=="string"&&L.hasOwnProperty(e)&&typeof L[e]=="function"&&(ue=L[e])}function fe(e,t){const o=e.left,n=e.top,r=o+e.width,i=n+e.height,c=t.left,s=t.top,f=c+t.width,u=s+t.height;return Ne(o,n,r,i,c,s,f,u)}function Ne(e,t,o,n,r,i,c,s){const f=c<e,u=o<r,d=s<t,a=n<i;return a&&f?P(e,n,c,i):f&&d?P(e,t,c,s):d&&u?P(o,t,r,s):u&&a?P(o,n,r,i):f?e-c:u?r-o:d?t-s:a?i-n:0}function P(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function D(e){window.performance.mark&&window.performance.mark(e)}function X(e,t,o){window.performance.measure&&window.performance.measure(e,t,o)}function Le(){const e=window.getComputedStyle(window.document.body);if(e.zoom&&e.zoom!=="1"){const t=parseFloat(e.zoom);if(!isNaN(t))return t}return 1}function wt(e){return _e(),Re(e)}let B;function Re(e){return B==null&&(B=Le()),B==1?e:e/B}function _e(){B=null}function gt(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientWidth||window.innerWidth}function De(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientHeight||window.innerHeight}function yt(e){return e?parseFloat(e.replace(/px$/,"")):0}function bt(e){return e==null?void 0:e+"px"}function Et(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}const ke=50,Fe=100,oe=25,Ve=new Set(["left","start","justify","justify-all"]);class Be{constructor(t){this.ctx=t,this.rectCache=new Map,this.isLabelLikeCache=new Map,this.hasPlaceholderCache=new Map}calcScore(t,o){const n=this.getRect(t),r=this.getRect(o),i=this.distBetween(t,o),c=K(o)?Fe:ke;if(i>c)return 0;const s=this.isLabelLike(t),f=this.isCloserToOtherInput(t,o),u=window.getComputedStyle(t).textAlign||"",d=n.top+n.height<=r.top,a=Math.abs(n.left-r.left)<oe&&(!u||Ve.has(u)),h=n.left+n.width<=r.left,T=Math.abs(n.top-r.top)<oe,E=d&&a||h&&T,y=n.height>=De()/2,b=be(o);if(b&&n.top>=r.top+r.height)return 0;let m=1;const S=t.htmlFor;return S&&S===o.id&&(m+=Math.pow(1e3,4)),b&&!y&&!f&&(s&&E?m+=Math.pow(1e3,3):o===t&&this.hasPlaceholder(o)?m+=Math.pow(1e3,2):!s&&E&&(m+=Math.pow(1e3,1))),m+=c-i,m}getRect(t){let o=this.rectCache.get(t);return o||(o=x(t),this.rectCache.set(t,o)),o}isLabelLike(t){let o=this.isLabelLikeCache.get(t);if(o===void 0){const n="a, button, h1, h2, h3, h4, h5, h6, input";o=!t.closest(n)&&!t.querySelector(n),this.isLabelLikeCache.set(t,o)}return o}hasPlaceholder(t){let o=this.hasPlaceholderCache.get(t);return o===void 0&&(o=!!O(t),this.hasPlaceholderCache.set(t,o)),o}getAllInputs(){return this.allInputs||(this.allInputs=Array.from(document.querySelectorAll(we())).filter(t=>ee(t,this.ctx))),this.allInputs}distBetween(t,o){return Math.round(fe(this.getRect(t),this.getRect(o)))}isCloserToOtherInput(t,o){let n=this.distBetween(t,o);for(let r of this.getAllInputs()){if(r===o)continue;if(this.distBetween(t,r)<n)return!0}return!1}}function Oe(e,t={}){const o=performance.now();D("userflow:inferSelector:start"),l.groupCollapsed("inferSelector for",e,t);let n;try{n=Pe(e,t)}catch(r){console.error("Userflow findElement error:",r),n=null}return l("time",performance.now()-o),l.groupEnd(),D("userflow:inferSelector:end"),X("userflow:inferSelector","userflow:inferSelector:start","userflow:inferSelector:end"),n}function de(e){const t=[],o=e.tagName.toLowerCase();return R.inferenceAttributeNames.forEach(n=>{const r=e.getAttribute(n);if(!r)return;const i=R.inferenceAttributeFilters[n];if(!(i&&!ne(i,r)))if(n==="id")t.push(`#${r}`);else{const c=n==="name"||n==="placeholder"?o:"";t.push(`${c}[${n}="${r}"]`)}}),e.classList.forEach(n=>{ne(R.inferenceClassNameFilters,n)&&(n=n.replace(/:/g,"\\:").trim(),t.push(`.${n}`))}),t}const $e=window.userflow||{};$e.__inferSelector=Oe;function Pe(e,{elementType:t}={}){const o={minorVersion:Ge};let n=be(e);const r=nt(e);if(t===ae.INPUT&&!n)if(r)e=r,n=!0,l("use custom input parent",r);else return l("not an input"),null;else r&&(e=r,n=!0);const i=Ue(e);let c=null;n||(c=pe(e),c&&c.length>250&&(c=null)),l("text is:"+c);let s=new Map,f=new Map;const u=new Map,d=new Y(i,null,o),a=new Y(i,c,o),h=(y,b,m,S,g)=>{if(S<0)return;let p=y.get(b);p||(p=[],y.set(b,p)),p.push({css:m,offset:S,complexity:g}),l(`use css=${m}, cardinality=${b}, offset=${S}`)},T=qe(e),E=[e.tagName.toLowerCase(),...de(e)];l("shadowRootSelectors:",i),l("ancestorCssSelectors:",T),l("ownCssSelectors:",E);for(const y of E)for(const b of T){const m=b?`${b} ${y}`:y,S=b?2:1,g=d.query(m),p=Array.from(g),w=p.length;if(w>100){l(`cardinality too high css=${m}, cardinality=${w}`);continue}u.set(m,w);const A=p.indexOf(e);if(h(s,w,m,A,S),c){const V=a.query(m),N=Array.from(V),Ce=N.indexOf(e),ve=N.length;h(f,ve,m,Ce,S)}}if(s.size>0||f.size>0){const y=S=>Array.from(S.entries()).map(([g,p])=>({cardinality:g,cssSelectors:p.sort((w,A)=>{const V=u.get(w.css),N=u.get(A.css);return V!==N?V?N?V-N:-1:1:w.complexity!==A.complexity?A.complexity-w.complexity:w.css.localeCompare(A.css)}).map(({css:w,offset:A})=>({css:w,offset:A}))})).sort((g,p)=>g.cardinality-p.cardinality),b={version:"v1",minorVersion:o.minorVersion,shadowRootSelectors:i,notextGroups:y(s),textGroups:y(f)},m={el:e,selector:{type:z.AUTO,autoData:JSON.stringify(b),text:c,elementType:t}};return l("inference result",m),m}return l("no selector inferred "),null}function Ue(e){let t=[],o=e;for(;o;){let n=o.getRootNode();if(k(n)){const{host:i}=n;t.unshift(i.tagName.toLowerCase()),o=i;continue}const r=q(o);if(r){let i=r.tagName.toLowerCase();const c=r.getAttribute("name");c?i+=`[name="${c}"]`:r.id&&!r.id.match(/\d$/)&&(i+="#"+r.id),t.unshift(i),o=r;continue}break}if(t.length!==0)return t}function qe(e){const t=new Map;t.set(null,0);let o=e.parentNode;for(;o&&v(o)&&!(o.tagName==="BODY"||k(o));){for(const r of de(o)){if(t.has(r))continue;const i=U(document.documentElement,r);if(i){const c=i.length;t.set(r,c)}}o=o.parentNode}return Array.from(t.entries()).sort(([,r],[,i])=>r-i).slice(0,20).map(([r])=>r)}function je(e,t){const{text:o,excludeText:n,precision:r}=e,i={minorVersion:t.minorVersion||0},c=o!=null&&!n,s=c?t.textGroups:t.notextGroups,f=Math.max(1,Math.min(s.length,Math.ceil((1-parseFloat(r||"1"))*s.length))),u=new Y(t.shadowRootSelectors,c&&o||null,i);l("findElementAutoV1",{text:o,excludeText:n,precision:r,groups:s,groupCount:f});for(let d=0;d<f;d++){const a=s[d];let h=new Map,T=0,E=null;l.group(`group cardinality=${a.cardinality}`,a);try{for(let y=0;y<a.cssSelectors.length;y++){const{css:b,offset:m}=a.cssSelectors[y];l(`css=${b}, offset=${m}`);let S=u.query(b),g=null;for(let w=0;w<=m;w++){const A=S.next();if(A.done)break;g=A.value}if(!g)continue;const p=(h.get(g)||0)+1;if(h.set(g,p),l(`el with frequency=${p}`+(p>T&&g!==E?" NEW BEST":""),g),p>T&&(T=p,E=g,p>=Math.ceil(a.cssSelectors.length/2)))return l("early winner",E),E}}finally{l.groupEnd()}if(E)return l("winner",E),E}return l("element not found"),null}class Y{constructor(t,o,n){this.shadowRootSelectors=t,this.text=o,this.ctx=n,this.isVisibleCache=new Map,this.textCache=new Map}*query(t){const o=U(document.documentElement,t,this.shadowRootSelectors);if(l("found",o),!o)return;const{text:n}=this;for(let r=0;r<o.length;r++){const i=o[r];if(n){let s=this.textCache.get(i);if(s==null&&(s=G(i,n),this.textCache.set(i,s)),!s){l("skip, text mismatch",i);continue}}let c=this.isVisibleCache.get(i);if(c==null&&(c=ee(i,this.ctx),this.isVisibleCache.set(i,c)),!c){l("skip, not visible",i);continue}l("yield",i),yield i}}}const Ge=5,$=window.userflow||{};function Z(e){const t=performance.now();D("userflow:findAllElements:start"),l.groupCollapsed("findAllElements",e);let o;try{if(e.type===z.MANUAL)o=Ye(e);else if(e.autoData){const n=JSON.parse(e.autoData);let r;if(n.version==="v1")r=je(e,n);else throw new Ie(n.version,"Unknown autoData version: "+n.version);o=r?[r]:[]}else o=[]}catch(n){console.error("Userflow findElement error:",n),o=[]}return l("time",performance.now()-t),l.groupEnd(),D("userflow:findAllElements:end"),X("userflow:findAllElements","userflow:findAllElements:start","userflow:findAllElements:end"),o}function Ye(e){const t={minorVersion:e.minorVersion==null?1:e.minorVersion};let{css:o,text:n,elementType:r,offset:i}=e;n=n&&_(n);const c="nearSelector"in e?e.nearSelector:null;l("findAllElementsManual",e),i!=null&&c!=null&&console.warn("Userflow.js: Both selector.offset and selector.nearSelector was set; ignoring nearSelector.");let s;if(n&&!o){if(s=[],t.minorVersion>=2)for(const f of se())H(f,n,s);else H(document.body,n,s);l("els after traverseElementForText",s)}else if(o){if(t.minorVersion>=2){s=[];for(const f of se()){const u=U(f,o);u&&u.length>0&&s.push(...u)}}else s=Array.from(U(document.body,o)||[]);l("els after safeQueryAll",s),n&&(s=ze(s,n),l("els after filterElementsByText",s))}else console.warn("Userflow.js: findAllElements() requires least one of `css` and `text` to be set."),s=[];if(s.length>0&&(s=s.filter(f=>ee(f,t)),l("els after isVisible",s)),s.length>0&&r===ae.INPUT&&(s=et(s,t),l("els after mapElementsToInputs",s)),s.length>0&&(s.sort((f,u)=>{const d=x(f),a=x(u);return d.top<a.top?-1:d.top>a.top?1:d.left-a.left}),l("els after sort",s)),s.length>0){if(i!=null)s=s[i]?[s[i]]:[],l("els after offset",s);else if(c!=null){const f=Z(c);let u=null,d=0;for(const a of s)for(const h of f){const T=fe(x(a),x(h));(!u||T<d)&&(u=a,d=T)}s=u?[u]:[],l("els after nearSelector",s)}}return s}function he(e){return Z(e)[0]||null}function He(e,t){const o=performance.now();D("userflow:elementMatchesSelector:start"),l.groupCollapsed("elementMatchesSelector",e,t);let n;try{if(t.type===z.MANUAL)n=We(e,t);else{const r=he(t);n=r!=null&&r.contains(e)}}catch(r){console.error("Userflow findElement error:",r),n=!1}return l(n?"match":"not match"),l("time",performance.now()-o),l.groupEnd(),D("userflow:elementMatchesSelector:end"),X("userflow:elementMatchesSelector","userflow:elementMatchesSelector:start","userflow:elementMatchesSelector:end"),n}function We(e,t){t.offset!=null&&console.warn("Userflow.js: selector.offset is not supported for elementMatchesSelector yet"),"nearSelector"in t&&t.nearSelector!=null&&console.warn("Userflow.js: selector.nearSelector is not supported for elementMatchesSelector yet");let{css:o,text:n}=t;n=n&&_(n);let r=!1,i=e;for(;i&&i.tagName!=="BODY";){if((!o||i.matches(o))&&(!n||G(i,n))){r=!0;break}i=i.parentElement}return r}function H(e,t,o){if(v(e)){const{tagName:r}=e;if(r==="SCRIPT"||r==="STYLE")return!1}let n=!1;for(let r=0;r<e.children.length;r++)H(e.children[r],t,o)&&(n=!0);return!n&&v(e)&&G(e,t)&&(o.push(e),n=!0),n}function U(e,t,o){try{return o==null?e.querySelectorAll(t):me(t,o,0,e)}catch{return console.info("Userflow.js: Invalid CSS selector: ",t),null}}function me(e,t,o,n){if(o>=t.length)return Array.from(n.querySelectorAll(e));const r=t[o],i=n.querySelectorAll(r),c=[];return i.forEach(s=>{let f;if(s.shadowRoot)f=s.shadowRoot;else{if(!Se(s))return;let u=null;try{u=s.contentDocument}catch{}if(!u)return;f=u.body}c.push(...me(e,t,o+1,f))}),c}function ze(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];o.some(i=>i.contains(r))||G(r,t)&&o.push(r)}return o.reverse()}const Xe={email:!0,number:!0,password:!0,search:!0,tel:!0,text:!0,url:!0},Ze={date:!0,"datetime-local":!0,month:!0,time:!0,week:!0},Qe={button:!0,email:!0,reset:!0,search:!0,submit:!0,tel:!0,text:!0,url:!0};function pe(e){let t=e.innerText;return t===void 0&&e.tagName!=="SELECT"&&(t=e.textContent),t=_(t),t||null}function O(e){if(ge(e)||Q(e)){const t=_(e.getAttribute("placeholder")),o=e.value||"";if(t&&!o)return t;const n=_(o);if(n&&ot(e))return n}if(J(e)&&e.selectedIndex>=0){const t=_(e.options[e.selectedIndex].text);if(t)return t}return pe(e)}function G(e,t){const o=O(e);return o?Je(t,o):!1}function Je(e,t){const o=e.toLowerCase();return t.toLowerCase()===o}function _(e){return!e||e.length>250?null:e.replace(/^[\s\uFEFF\xA0\u200B*]+|[\s\uFEFF\xA0\u200B*]+$/g,"").replace(/\s+/g," ")}function Ke(e){for(const{cssSelector:t,getValue:o}of R.customInputs)if(e.matches(t))if(o)try{return(o(e)||"").trim()}catch(n){return console.error(`Userflow.js: getValue function for custom input '${t}' failed:`,n),""}else return O(e)||"";return J(e)?e.selectedIndex==-1?"":e.options[e.selectedIndex].text:K(e)?O(e)||"":e.value}function we(){return"input, select, textarea, [contenteditable]"+R.customInputs.map(({cssSelector:e})=>`, ${e}`).join("")}function et(e,t){const o=new Set,n=new Be(t),r=we();for(const i of e){if(i.matches(r)){o.add(i);continue}let c=null,s=null;n.getAllInputs().forEach(f=>{const u=n.calcScore(i,f);l("input",u,f),u!==0&&(c&&s&&u<=s||(l("input is best so far"),c=f,s=u))}),c&&(l("best input was",c),o.add(c))}return Array.from(o)}function ge(e){if(e.tagName!=="INPUT")return!1;const t=e.getAttribute("type");return t==null?!0:Xe[(t||"").toLowerCase()]===!0}function Q(e){return e.tagName==="TEXTAREA"}function tt(e){if(e.tagName!=="INPUT")return!1;const t=(e.getAttribute("type")||"").toLowerCase();return Ze[t]===!0}function J(e){return e.tagName==="SELECT"}function K(e){return"hasAttribute"in e&&e.hasAttribute("contenteditable")}function ye(e){return!!(K(e)||R.customInputs.some(({cssSelector:t})=>e.matches(t)))}function nt(e){let t=e.parentNode;for(;t&&v(t)&&!(t.tagName==="BODY"||k(t));){if(ye(t))return t;t=t.parentNode}return null}function be(e){return ge(e)||tt(e)||Q(e)||J(e)||ye(e)}function ot(e){if(Q(e))return!0;const t=(e.getAttribute("type")||"").toLowerCase();return Qe[t]}function ee(e,t){const o=x(e);let n=e,r=!0,i=!1,c=!1,s=!1,f=!1;for(;n;){const u=n===document.body,d=n.tagName==="BODY",a=window.getComputedStyle(n);let h=null;if(r){if(a.visibility&&a.visibility!=="visible")return l("not visible because visibility is",a.visibility,e,{cur:n}),!1;r=!1}if(a.display==="none")return l("not visible because display is",a.display,e,{cur:n}),!1;if(a.opacity!=null&&parseFloat(a.opacity)<.01)return l("not visible because opacity is",a.opacity,e,{cur:n}),!1;if(a.position==="absolute"?s=!0:(a.position==="relative"||a.position==="fixed"||a.position==="sticky")&&(s=!1),t.minorVersion>=4&&!i&&!d&&!(f&&a.position==="static")&&(M(a.overflowX)||M(a.overflowY))&&(h=h||x(n),h.width===0||h.height===0))return l("not visible because width/height (v1.4 check) is",h.width,h.height,e,{cur:n}),!1;if(!c&&Ee(a.display)&&(t.minorVersion<1||d||a.position!=="static")){const T=d||M(a.overflow),E=T||M(a.overflowX),y=T||M(a.overflowY),{scrollLeft:b,scrollTop:m}=d?n.ownerDocument.documentElement:n,S=!d&&!s;if(E){if(h=h||x(n),S&&h.width===0)return l("not visible because width is",h.width,e,{cur:n}),!1;const g=t.minorVersion>=5?o.width/2:0,p=Math.round(o.left+g),w=Math.round(h.left-b);if(p<w)return l("not visible because it's clipped left",e,{elX:p,curLeft:w,cur:n}),!1}if(y){if(h=h||x(n),S&&h.height===0)return l("not visible because height is",h.height,e,{cur:n}),!1;const g=t.minorVersion>=5?o.height/2:0,p=Math.round(o.top+g),w=Math.round(h.top-m);if(p<w)return l("not visible because it's clipped top",e,{elY:p,curTop:w,cur:n}),!1}(E||y)&&(c=!0)}if(a.position==="fixed"&&(i=!0,c=!0),t.minorVersion>=3&&(n.scrollTop>0||n.scrollLeft>0)&&(c=!0),u)break;d?(n=q(n),r=!0):n=n.parentElement,f=s}return!0}function M(e){return e==="hidden"||e==="clip"||e==="scroll"||e==="auto"}function Ee(e){return!e||!e.includes("inline")&&e!=="contents"}function St(e){let t=e.parentNode,o=!1;for(;t&&t.tagName!=="BODY";){k(t)&&(t=t.host);const n=window.getComputedStyle(t);if(n.position==="absolute"?o=!0:(n.position==="relative"||n.position==="fixed"||n.position==="sticky")&&(o=!1),!o&&Ee(n.display)&&(M(n.overflow)||M(n.overflowY)))return t;if(n.position==="fixed")return e.ownerDocument.documentElement;t=t.parentNode}return e.ownerDocument.documentElement}function x(e){if(e.tagName==="HTML"){const n=q(e);if(n)return x(n)}let t=e.getBoundingClientRect(),o=e;for(;o&&(o=q(o),!!o);){const n=o.getBoundingClientRect();t={width:t.width,height:t.height,left:t.left+n.left,right:t.right+n.left,top:t.top+n.top,bottom:t.bottom+n.top}}return t}const re=new WeakSet;function q(e){const t=e.ownerDocument?.defaultView;if(!t||re.has(t))return null;{const o=t.frameElement;return o||re.add(t),o}}function k(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e&&"mode"in e}function v(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Se(e){return v(e)&&e.tagName==="IFRAME"}function Tt(e){let t=e;for(;t;)if(v(t)){if(t.hasAttribute("popover")&&t.matches(":popover-open"))return t;t=t.parentNode}else if(k(t))t=t.host;else break;return null}const rt=e=>{if(!e)return null;const t=e.className;if(t==null)return null;if(typeof t=="string")return t;if(typeof t=="object"&&"baseVal"in t)return t.baseVal||null;try{return String(t)}catch{return null}},At=e=>{const t=e.getBoundingClientRect();return`${e.tagName}-${e.id||""}-${rt(e)||""}-${Math.round(t.left)}-${Math.round(t.top)}`},xt=e=>{e instanceof HTMLElement&&e.hasAttribute("popover")===!1&&typeof e.showPopover=="function"&&(e.setAttribute("popover","manual"),e.showPopover(),e.style.border="none",e.style.padding="0",e.style.margin="0",e.style.overflow="visible")},Ct=e=>{e instanceof HTMLElement&&e.hasAttribute("popover")&&typeof e.hidePopover=="function"&&(e.hidePopover(),e.removeAttribute("popover"),e.style.border="",e.style.padding="",e.style.margin="",e.style.overflow="")};$.__findElement=he;$.__findAllElements=Z;$.__elementMatchesSelector=He;$.__getElementText=O;$.__getInputValue=Ke;const C=new Set,W=new Map,j=new Set;function se(){return Te(),C}function vt(e,t){Te();for(const n of C)e(n);const o={setup:e,teardown:t};return j.add(o),()=>{j.delete(o);for(const n of C)t(n)}}let ie=!1,I=null;function Te(){if(le(),!ie){l("roots started"),ie=!0,I=document.body,F(I),it();for(const e of Me)document.addEventListener(e,st);window.setInterval(le,10*1e3)}}function st(){I&&!document.contains(I)&&(l("roots detected new Turbo body"),te(I),I=document.body,F(I))}function it(){for(const e of document.documentElement.children)e!==document.body&&e.shadowRoot&&F(e.shadowRoot)}function le(){for(const e of C)k(e)&&(lt(e)||(l("roots clean before removeRoot",e),te(e)));l("roots clean finished, remaining=",C.size)}function lt(e){return e.ownerDocument.defaultView?e.host.isConnected:!1}function F(e){if(!C.has(e)){l("roots addRoot",e),C.add(e),ct(e),Ae(e),ft(e),dt(e);for(const{setup:t}of j)t(e)}}function te(e){if(C.has(e)){l("roots removeRoot",e),W.get(e)?.disconnect(),W.delete(e),C.delete(e);for(const{teardown:t}of j)t(e)}}function ct(e){let t;const o=()=>{Ae(e)},n=new ue(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(o)});n.observe(e,{childList:!0,subtree:!0}),W.set(e,n)}function Ae(e){const t=v(e)?e.ownerDocument.getElementsByTagName("iframe"):e.querySelectorAll("iframe");for(const o of t)xe(o)}const ce=new WeakSet;function xe(e){if(ce.has(e)||e.closest("#userflow-ui"))return;e.addEventListener("load",at);const t=e.contentWindow,o=e.contentDocument;if(!t||!o){ce.add(e);return}const n=o.body;n&&(t.addEventListener("pagehide",ut),l("roots setupFrame before addRoot",e,o,n),F(n))}function at(e){const t=e.target;t&&Se(t)&&xe(t)}function ut(e){const t=e.currentTarget.document.body;l("roots onFrameUnload before removeRoot",t),te(t)}function ft(e){const t=e.ownerDocument.defaultView;if(t.__userflowAttachShadowInstalled)return;t.__userflowAttachShadowInstalled=!0;const o=t.Element.prototype.attachShadow;o!=null&&(t.Element.prototype.attachShadow=function(n){const r=o.call(this,n);return this.shadowRoot&&(l("roots monitorShadowDom before addRoot",this,this.shadowRoot),F(this.shadowRoot)),r})}function dt(e){const t=o=>{o.childNodes.forEach(n=>{v(n)&&n.shadowRoot&&(l("roots queryShadowDom before addRoot",n,n.shadowRoot),F(n.shadowRoot)),t(n)})};t(e)}export{Ke as A,He as B,ue as M,Ie as U,Oe as a,be as b,pt as c,bt as d,gt as e,Z as f,pe as g,De as h,Et as i,Re as j,k,v as l,q as m,_ as n,vt as o,xt as p,_e as q,x as r,yt as s,At as t,Se as u,Tt as v,St as w,Ct as x,he as y,wt as z};
2
2
  //# sourceMappingURL=roots.js.map
package/stylesheets.js CHANGED
@@ -1,2 +1,2 @@
1
- import{r as k,R as y}from"./vendor.react.js";import{V as R,W as $,R as P,P as D,X as z,B as U,Y as q,Z as O,z as _,_ as j,$ as N,a0 as K,Q as V,l as G,a1 as Y,a2 as Q,a3 as X,e as Z,a4 as J}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{i as oo,j as ro,k as no,l as to,m as eo,n as lo,o as ao,p as uo,q as co,r as io}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.core-js.js";import{j as so,a4 as fo,v as go,a9 as H}from"./userflow.js";import{c as Co}from"./flow-condition-types.js";import{a as Bo}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="9388d936-1b04-4415-8036-8147c39e95cb",o._sentryDebugIdIdentifier="sentry-dbid-9388d936-1b04-4415-8036-8147c39e95cb")}catch{}})();function bo(o){const[n]=k.useState(()=>new so(o));return n.update(o),n}const Ro=({icon:o,size:n,dataAttrs:t})=>{n=n||16;const e=typeof o=="string"&&A[o]?A[o]:o;if(typeof e=="string")return y.createElement("img",{...t,"aria-hidden":"true",src:e,width:n,height:n,style:{objectFit:"contain"}});{const l=e.icon[0],a=e.icon[1],c=e.icon[4];return y.createElement("svg",{"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:`0 0 ${l} ${a}`,...t},y.createElement("path",{fill:"currentColor",d:String(c)}))}},A={"regular/calendar-day":R,"regular/comment-alt":$,"regular/comments-alt":P,"regular/envelope":D,"regular/exclamation-triangle":z,"regular/external-link":U,"regular/file-alt":q,"regular/graduation-cap":O,"regular/info-circle":_,"regular/lightbulb":j,"regular/megaphone":N,"regular/pencil":K,"regular/phone":V,"regular/play-circle":G,"regular/question-circle":Y,"regular/shoe-prints":Q,"solid/shoe-prints":oo,"solid/file-invoice":ro,"solid/receipt":no,"solid/university":to,"solid/users":eo,"solid/stars":lo,"regular/tasks":X,"regular/user":Z,"regular/users":J,"solid/exclamation-triangle":ao,"solid/info-circle":uo,"solid/play-circle":co,"solid/question-circle":io};function ko(o,n,t){if(!o.document.fonts)return t(),()=>{};let e=!1;const l=()=>{const i=o.document.fonts.load(`100px ${n}`,"BESbswy");if(!i){c(),t();return}i.then(u=>{e||(u.length>=1?(c(),t()):window.setTimeout(l,25))},u=>{console.log("Userflow.js: observeFont error:"),console.log(u),t()})};l();const a=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${n} to load. Will continue anyway.`),t()},2e3),c=()=>{e=!0,window.clearTimeout(a)};return c}function p(o){return o?o.match(/^#[0-9a-f]{6}$/i)?[parseInt(o.substring(1,3),16),parseInt(o.substring(3,5),16),parseInt(o.substring(5,7),16)]:o.match(/^#[0-9a-f]{3}$/i)?[parseInt(o.substring(1,2).repeat(2),16),parseInt(o.substring(2,3).repeat(2),16),parseInt(o.substring(3,4).repeat(2),16)]:[0,0,0]:[0,0,0]}function v([o,n,t]){return"#"+o.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")}function b(o){const n=p(o);return n?n.join(", "):"0, 0, 0"}function x(o){return v(p(o))}function po([o,n,t]){return[Math.round(255-o),Math.round(255-n),Math.round(255-t)]}function F(o,n,t){return[Math.max(0,Math.min(255,Math.round(o[0]+(n[0]-o[0])*t))),Math.max(0,Math.min(255,Math.round(o[1]+(n[1]-o[1])*t))),Math.max(0,Math.min(255,Math.round(o[2]+(n[2]-o[2])*t)))]}function h(o,n,t){const e=p(o),l=p(n);return!e||!l?o:v(F(e,l,t))}function S([o,n,t]){o/=255,n/=255,t/=255;const e=Math.max(o,n,t),l=Math.min(o,n,t);let a,c,i=(e+l)/2;if(e==l)a=c=0;else{const u=e-l;switch(c=i>.5?u/(2-e-l):u/(e+l),e){case o:a=(n-t)/u+(n<t?6:0);break;case n:a=(t-o)/u+2;break;default:a=(o-n)/u+4;break}a/=6}return[a,c,i]}function m([o,n,t]){let e=o/255,l=n/255,a=t/255;function c(r){let s=0;return r<=.04045?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),s}let i=.2126*c(e)+.7152*c(l)+.0722*c(a);function u(r){let s=0;return r<=216/24389?s=r*(24389/27):s=Math.pow(r,1/3)*116-16,s}return Math.round(u(i)*10)/1e3}function L(o,n){const t=m(o),e=m(n),l=.05;let i=(1-(e-t))/2*(.18-l)+l,u=1-Math.abs(e-t),r=Math.pow((1-i)*u,4),s=i+r;return Math.round(s*1e3)/1e3}function w(o,n){const t=p(o),e=S(t);let l=null,a=null;for(const g of n){const d=p(g),f=S(d);let C=!1;!l||!a?C=!0:Math.abs(f[2]-e[2])>.3?f[1]>a[1]&&(C=!0):Math.abs(e[2]-f[2])>Math.abs(e[2]-a[2])&&(C=!0),C&&(l=d,a=f)}let c=l,i=l,u=L(c,t),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(i=po(i),r=L(i,t)),[v(F(t,c,u)),v(F(t,i,r))]}function wo(o,n,t,e){const[l,a]=w(o,[n]);let c,i;if(o===t)c=l,i=a;else{const B=w(t,[o,n,e]);c=B[0],i=B[1]}const u=p(o),r=p(t),s=20;let g,d,f,C;if(Math.abs(u[0]-r[0])<s&&Math.abs(u[1]-r[1])<s&&Math.abs(u[2]-r[2])<s){g=n,d=o;const B=w(g,[d]);f=B[0],C=B[1]}else g=o,d=n,f=l,C=a;return[l,a,c,i,g,d,f,C]}function ho(o){const[n,t,e,l,a,c,i,u]=wo(o.brandBackgroundColor,o.brandForegroundColor,o.mainBackgroundColor,o.mainForegroundColor),r={...o,widgetBackgroundColor:a,widgetForegroundColor:c,widgetHoverBackgroundColor:i,widgetActiveBackgroundColor:u,sameBackground:x(o.mainBackgroundColor)==x(o.brandBackgroundColor)};r.brandHoverBackgroundColor&&(r.widgetHoverBackgroundColor=r.brandHoverBackgroundColor),r.brandActiveBackgroundColor&&(r.widgetActiveBackgroundColor=r.brandActiveBackgroundColor),r.brandHoverBackgroundColor||(r.brandHoverBackgroundColor=n),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=t),r.mainHoverBackgroundColor||(r.mainHoverBackgroundColor=e),r.mainActiveBackgroundColor||(r.mainActiveBackgroundColor=l),r.bannerBackgroundColor||(r.bannerBackgroundColor=r.brandBackgroundColor),r.bannerForegroundColor||(r.bannerForegroundColor=r.brandForegroundColor);const[s,g]=w(r.bannerBackgroundColor,[r.bannerForegroundColor]);r.bannerHoverBackgroundColor=s,r.bannerActiveBackgroundColor=g;const[d,f]=w(r.bannerForegroundColor,[r.bannerBackgroundColor]);if(r.bannerHoverForegroundColor=d,r.bannerActiveForegroundColor=f,r.bubbleBorderColor||(r.bubbleBorderColor=r.mainForegroundColor),r.checklistLauncherActiveBackgroundColor||(r.checklistLauncherActiveBackgroundColor=r.brandActiveBackgroundColor),r.checklistLauncherBackgroundColor||(r.checklistLauncherBackgroundColor=r.brandBackgroundColor),r.checklistLauncherCounterBackgroundColor||(r.checklistLauncherCounterBackgroundColor=r.brandForegroundColor),r.checklistLauncherCounterFontColor||(r.checklistLauncherCounterFontColor=r.brandBackgroundColor),r.checklistLauncherFontColor||(r.checklistLauncherFontColor=r.brandForegroundColor),r.checklistLauncherHoverBackgroundColor||(r.checklistLauncherHoverBackgroundColor=r.brandHoverBackgroundColor),r.focusColor||(r.focusColor=r.mainActiveBackgroundColor),r.launcherIconActiveColor||(r.launcherIconActiveColor=r.brandActiveBackgroundColor),r.launcherIconColor||(r.launcherIconColor=r.brandBackgroundColor),r.launcherIconHoverColor||(r.launcherIconHoverColor=r.brandHoverBackgroundColor),r.linkColor||(r.linkColor=r.widgetBackgroundColor),r.progressBarColor||(r.progressBarColor=r.widgetBackgroundColor),r.questionColor||(r.questionColor=r.widgetBackgroundColor),r.toolbarForegroundColor||(r.toolbarForegroundColor=r.mainForegroundColor),r.primaryButtonBackgroundColor||(r.primaryButtonBackgroundColor=r.widgetBackgroundColor),r.primaryButtonFontColor||(r.primaryButtonFontColor=r.widgetForegroundColor),r.primaryButtonHoverFontColor||(r.primaryButtonHoverFontColor=r.primaryButtonFontColor),r.primaryButtonActiveFontColor||(r.primaryButtonActiveFontColor=r.primaryButtonFontColor),!r.primaryButtonHoverBackgroundColor||!r.primaryButtonActiveBackgroundColor){const[C,B]=w(r.primaryButtonBackgroundColor,[r.primaryButtonFontColor]);r.primaryButtonHoverBackgroundColor||(r.primaryButtonHoverBackgroundColor=C),r.primaryButtonActiveBackgroundColor||(r.primaryButtonActiveBackgroundColor=B)}if(r.primaryButtonBorderColor||(r.primaryButtonBorderColor=r.widgetBackgroundColor),r.primaryButtonHoverBorderColor||(r.primaryButtonHoverBorderColor=r.primaryButtonHoverBackgroundColor),r.primaryButtonActiveBorderColor||(r.primaryButtonActiveBorderColor=r.primaryButtonActiveBackgroundColor),r.defaultButtonBackgroundColor||(r.defaultButtonBackgroundColor=r.mainBackgroundColor),r.defaultButtonFontColor||(r.defaultButtonFontColor=a),r.defaultButtonHoverFontColor||(r.defaultButtonHoverFontColor=r.defaultButtonFontColor),r.defaultButtonActiveFontColor||(r.defaultButtonActiveFontColor=r.defaultButtonFontColor),!r.defaultButtonHoverBackgroundColor||!r.defaultButtonActiveBackgroundColor){const[C,B]=w(r.defaultButtonBackgroundColor,[r.defaultButtonFontColor]);r.defaultButtonHoverBackgroundColor||(r.defaultButtonHoverBackgroundColor=C),r.defaultButtonActiveBackgroundColor||(r.defaultButtonActiveBackgroundColor=B)}return r.defaultButtonBorderColor||(r.defaultButtonBorderColor=r.defaultButtonFontColor),r.defaultButtonHoverBorderColor||(r.defaultButtonHoverBorderColor=r.defaultButtonBorderColor),r.defaultButtonActiveBorderColor||(r.defaultButtonActiveBorderColor=r.defaultButtonBorderColor),r.launcherButtonBackgroundColor||(r.launcherButtonBackgroundColor=r.brandBackgroundColor),r.launcherButtonBorderColor||(r.launcherButtonBorderColor=r.brandBackgroundColor),r.launcherButtonFontColor||(r.launcherButtonFontColor=r.brandForegroundColor),r.launcherButtonHoverBackgroundColor||(r.launcherButtonHoverBackgroundColor=r.brandHoverBackgroundColor),r.launcherButtonHoverBorderColor||(r.launcherButtonHoverBorderColor=r.launcherButtonHoverBackgroundColor),r.launcherButtonHoverFontColor||(r.launcherButtonHoverFontColor=r.launcherButtonFontColor),r.launcherButtonActiveBackgroundColor||(r.launcherButtonActiveBackgroundColor=r.brandActiveBackgroundColor),r.launcherButtonActiveBorderColor||(r.launcherButtonActiveBorderColor=r.launcherButtonActiveBackgroundColor),r.launcherButtonActiveFontColor||(r.launcherButtonActiveFontColor=r.launcherButtonFontColor),r.siteHeroForegroundColor||(r.siteHeroForegroundColor=r.brandForegroundColor),r.siteHeroBackgroundColor||(r.siteHeroBackgroundColor=r.brandBackgroundColor),r.siteBackgroundColor||(r.siteBackgroundColor=r.mainHoverBackgroundColor),r.siteContentForegroundColor||(r.siteContentForegroundColor=r.mainForegroundColor),r.siteContentBackgroundColor||(r.siteContentBackgroundColor=r.mainBackgroundColor),r}function vo(o){const{questionColor:n}=o;return{"--userflow-backdrop-highlight-color-rgb":b(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===fo.INSIDE?"inset":"","--userflow-backdrop-highlight-opacity":o.backdropHighlightOpacity,"--userflow-backdrop-highlight-radius":o.backdropHighlightRadius+"px","--userflow-backdrop-highlight-spread":o.backdropHighlightSpread+"px","--userflow-backdrop-opacity":o.backdropOpacity,"--userflow-banner-background-color":o.bannerBackgroundColor,"--userflow-banner-hover-background-color":o.bannerHoverBackgroundColor,"--userflow-banner-active-background-color":o.bannerActiveBackgroundColor,"--userflow-banner-foreground-color":o.bannerForegroundColor,"--userflow-banner-hover-foreground-color":o.bannerHoverForegroundColor,"--userflow-banner-active-foreground-color":o.bannerActiveForegroundColor,"--userflow-beacon-color":o.beaconColor,"--userflow-beacon-size":o.beaconSize+"px","--userflow-brand-active-background-color":o.brandActiveBackgroundColor,"--userflow-brand-background-color":o.brandBackgroundColor,"--userflow-brand-background-color-rgb":b(o.brandBackgroundColor),"--userflow-brand-foreground-color":o.brandForegroundColor,"--userflow-brand-foreground-color-rgb":b(o.brandForegroundColor),"--userflow-brand-hover-background-color":o.brandHoverBackgroundColor,"--userflow-bubble-border-color":o.bubbleBorderColor,"--userflow-bubble-border-radius":o.bubbleBorderRadius+"px","--userflow-bubble-border-width":o.bubbleBorderWidth+"px","--userflow-button-border-radius":o.buttonBorderRadius+"px","--userflow-button-height":o.buttonHeight+"px","--userflow-button-min-width":o.buttonMinWidth+"px","--userflow-button-text-align":o.buttonMinWidth===0?"start":"center","--userflow-buttons-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="right"?"end":"center","--userflow-buttons-bubble-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="center"?"center":"end","--userflow-checklist-launcher-active-background-color":o.checklistLauncherActiveBackgroundColor,"--userflow-checklist-launcher-background-color":o.checklistLauncherBackgroundColor,"--userflow-checklist-launcher-border-radius":o.checklistLauncherBorderRadius+"px","--userflow-checklist-launcher-counter-background-color":o.checklistLauncherCounterBackgroundColor,"--userflow-checklist-launcher-counter-font-color":o.checklistLauncherCounterFontColor,"--userflow-checklist-launcher-font-color-rgb":b(o.checklistLauncherFontColor),"--userflow-checklist-launcher-font-color":o.checklistLauncherFontColor,"--userflow-checklist-launcher-font-weight":String(o.checklistLauncherFontWeight),"--userflow-checklist-launcher-height":o.checklistLauncherHeight+"px","--userflow-checklist-launcher-hover-background-color":o.checklistLauncherHoverBackgroundColor,"--userflow-checkmark-background-color":o.checkmarkBackgroundColor,"--userflow-completed-task-text-decoration":o.completedTaskTextDecoration,"--userflow-default-button-active-background-color":o.defaultButtonActiveBackgroundColor,"--userflow-default-button-active-border-color":o.defaultButtonActiveBorderColor,"--userflow-default-button-active-font-color":o.defaultButtonActiveFontColor,"--userflow-default-button-background-color":o.defaultButtonBackgroundColor,"--userflow-default-button-border-color":o.defaultButtonBorderColor,"--userflow-default-button-border-width":o.defaultButtonBorderWidth+"px","--userflow-default-button-font-color":o.defaultButtonFontColor,"--userflow-default-button-font-weight":String(o.defaultButtonFontWeight),"--userflow-default-button-hover-background-color":o.defaultButtonHoverBackgroundColor,"--userflow-default-button-hover-border-color":o.defaultButtonHoverBorderColor,"--userflow-default-button-hover-font-color":o.defaultButtonHoverFontColor,"--userflow-focus-color":`rgba(${b(o.focusColor)}, ${o.focusOpacity})`,"--userflow-font-family":o.builtinFontFamily?Fo(o.builtinFontFamily.name)+(o.builtinFontFamily.fallback?", "+o.builtinFontFamily.fallback:""):o.fontFamily?o.fontFamily:"sans-serif","--userflow-font-size":o.fontSize+"px","--userflow-font-weight-bold":String(o.fontWeightBold),"--userflow-font-weight-normal":String(o.fontWeightNormal),"--userflow-h1-font-size":o.h1FontSize+"px","--userflow-h2-font-size":o.h2FontSize+"px","--userflow-launcher-button-active-background-color":o.launcherButtonActiveBackgroundColor,"--userflow-launcher-button-active-border-color":o.launcherButtonActiveBorderColor,"--userflow-launcher-button-active-font-color":o.launcherButtonActiveFontColor,"--userflow-launcher-button-background-color":o.launcherButtonBackgroundColor,"--userflow-launcher-button-border-color":o.launcherButtonBorderColor,"--userflow-launcher-button-border-radius":o.launcherButtonBorderRadius+"px","--userflow-launcher-button-border-width":o.launcherButtonBorderWidth+"px","--userflow-launcher-button-font-color":o.launcherButtonFontColor,"--userflow-launcher-button-font-weight":String(o.launcherButtonFontWeight),"--userflow-launcher-button-height":o.launcherButtonHeight+"px","--userflow-launcher-button-horizontal-padding":o.launcherButtonHorizontalPadding+"px","--userflow-launcher-button-hover-background-color":o.launcherButtonHoverBackgroundColor,"--userflow-launcher-button-hover-border-color":o.launcherButtonHoverBorderColor,"--userflow-launcher-button-hover-font-color":o.launcherButtonHoverFontColor,"--userflow-launcher-button-width":o.launcherButtonWidth?o.launcherButtonWidth+"px":"auto","--userflow-launcher-icon-active-color":o.launcherIconActiveColor,"--userflow-launcher-icon-color":o.launcherIconColor,"--userflow-launcher-icon-hover-color":o.launcherIconHoverColor,"--userflow-launcher-icon-opacity":o.launcherIconOpacity,"--userflow-launcher-icon-size":o.launcherIconSize+"px","--userflow-line-height":o.lineHeight+"px","--userflow-link-color":o.linkColor,"--userflow-main-active-background-color":o.mainActiveBackgroundColor,"--userflow-main-background-color":o.mainBackgroundColor,"--userflow-main-background-color-rgb":b(o.mainBackgroundColor),"--userflow-main-foreground-color":o.mainForegroundColor,"--userflow-main-foreground-color-rgb":b(o.mainForegroundColor),"--userflow-main-hover-background-color":o.mainHoverBackgroundColor,"--userflow-modal-padding":o.modalPadding+"px","--userflow-modal-padding-top":(o.avatarType===go.NONE?o.modalPadding:o.modalPadding+Math.max((o.avatarSize-o.modalPadding)/2,0))+"px","--userflow-backdrop-color-rgb":b(o.backdropColor),"--userflow-notch-color":o.bubbleBorderWidth>0&&o.bubbleBorderColor||o.mainBackgroundColor,"--userflow-primary-button-active-background-color":o.primaryButtonActiveBackgroundColor,"--userflow-primary-button-active-border-color":o.primaryButtonActiveBorderColor,"--userflow-primary-button-active-font-color":o.primaryButtonActiveFontColor,"--userflow-primary-button-background-color":o.primaryButtonBackgroundColor,"--userflow-primary-button-border-color":o.primaryButtonBorderColor,"--userflow-primary-button-border-width":o.primaryButtonBorderWidth+"px","--userflow-primary-button-font-color":o.primaryButtonFontColor,"--userflow-primary-button-font-weight":String(o.primaryButtonFontWeight),"--userflow-primary-button-hover-background-color":o.primaryButtonHoverBackgroundColor,"--userflow-primary-button-hover-border-color":o.primaryButtonHoverBorderColor,"--userflow-primary-button-hover-font-color":o.primaryButtonHoverFontColor,"--userflow-progress-bar-color":o.progressBarColor,"--userflow-progress-bar-height":o.progressBarHeight+"px","--userflow-narrow-progress-bar-height":o.narrowBarHeight+"px","--userflow-squared-progress-bar-height":o.squaredBarHeight+"px","--userflow-rounded-progress-bar-height":o.roundedBarHeight+"px","--userflow-dotted-progress-bar-height":o.dottedBarHeight+"px","--userflow-numbered-progress-bar-height":o.numberedBarFontSize+"px","--userflow-resource-center-collapsed-height":o.resourceCenterCollapsedHeight+"px","--userflow-resource-center-launcher-icon-img-size":o.rcIconSize+"px","--userflow-resource-center-full-width":o.resourceCenterFullWidth+"px","--userflow-resource-center-launcher-border-radius":(o.resourceCenterLauncherBorderRadius!=null?Math.min(o.resourceCenterLauncherBorderRadius,o.resourceCenterCollapsedHeight/2):o.resourceCenterCollapsedHeight/2)+"px","--userflow-resource-center-padding-x":o.resourceCenterPaddingX+"px","--userflow-resource-center-padding-y":o.resourceCenterPaddingY+"px","--userflow-resource-center-transition-duration":o.resourceCenterTransitionDuration+"ms","--userflow-resource-center-width":o.resourceCenterWidth+"px","--userflow-question-color-light":h(n,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(n,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(n,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(n,o.mainBackgroundColor,.15),"--userflow-question-color":n,"--userflow-toast-padding":o.toastPadding+"px","--userflow-toast-auto-dismiss":o.toastAutoDismiss+"ms","--userflow-toast-placement":o.toastPlacement+"px","--userflow-toast-width":o.toastWidth+"px","--userflow-toolbar-foreground-color":o.toolbarForegroundColor,"--userflow-toolbar-foreground-color-rgb":b(o.toolbarForegroundColor),"--userflow-tooltip-notch-size":o.tooltipNotchSize+"px","--userflow-unread-badge-background-color":o.unreadBadgeBackgroundColor,"--userflow-unread-badge-foreground-color":o.unreadBadgeForegroundColor,"--userflow-widget-active-background-color":o.widgetActiveBackgroundColor,"--userflow-widget-background-color":o.widgetBackgroundColor,"--userflow-widget-foreground-color":o.widgetForegroundColor,"--userflow-widget-hover-background-color":o.widgetHoverBackgroundColor,"--userflow-site-hero-foreground-color":o.siteHeroForegroundColor,"--userflow-site-hero-background-color":o.siteHeroBackgroundColor,"--userflow-site-background-color":o.siteBackgroundColor,"--userflow-site-content-foreground-color":o.siteContentForegroundColor,"--userflow-site-content-background-color":o.siteContentBackgroundColor}}const yo=[];function $o(o){let[n,t]=k.useState(o);const e=bo(o.sessionData||yo);return k.useLayoutEffect(()=>{const{variations:l}=o;if(!l)return;const a=[],c=[],i=()=>{let u=o,r=!1;for(const[s,g]of l.entries())if(a[s]){r||(r=!0,u={...u});for(const d of g.overriddenKeys){const f=d,C=g[f];u[f]=C}}t(u)};for(const[u,r]of l.entries()){a[u]=!1;const{condition:s}=r;if(s&&r.overriddenKeys&&r.overriddenKeys.length>0){const d=Co[s.type].track({sessionData:e,condition:s,callback:f=>{a[u]=f,i()}});c[u]=d}else c[u]=()=>{}}return i(),()=>{for(const u of c)u()}},[o,e]),k.useMemo(()=>ho(n),[n])}function Po(o){return o?.cssVersion?`https://cdn.userflow.com/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}function Fo(o){return`"${o.trim()}"`}const M=new Map;function W(o){let n=M.get(o);return n||(n={stylesheets:new Map},M.set(o,n)),n}function Do(o,n,t,{uninstallOnUnmount:e}={}){const l=Bo(),[a,c]=k.useState(!n);return k.useLayoutEffect(()=>{if(!o||!n)return;let i=!1,u;const r=async d=>{await E(l,o,d),u&&T(o,u),u=d};(async()=>{let d=typeof n=="string"?n:n.get();if(Ho()&&t){let f=await Ao(d);if(i)return;f=xo(f,vo(t)),d="data:text/css;base64,"+btoa(f)}await r(d),!i&&c(!0)})();let g=null;return typeof n!="string"&&(g=n.onUpdate(async()=>{r(n.get())})),()=>{i=!0,g&&g(),e&&u&&T(o,u)}},[l,o,n,t,e]),{loaded:a}}function Ho(){return!!window.MSInputMethodContext&&!!document.documentMode}const I=new Map;function Ao(o){return new Promise((n,t)=>{let e=I.get(o);if(e){n(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){t(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;I.set(o,a),n(a)}),l.addEventListener("error",()=>{t(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function xo(o,n){for(const t in n)if(n.hasOwnProperty(t)){const e=n[t];e&&(o=o.replace(new RegExp(`var\\(${t}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function zo(o,n){const t=n&&So(n),e=t?.url,l=t?.fontFamily,[a,c]=k.useState(!e||!l);return k.useLayoutEffect(()=>{if(!o||!e||!l)return;let i=!1;return E(null,o,e),ko(o,l,()=>{i||c(!0)}),()=>{i=!0}},[o,e,l]),{loaded:a}}function E(o,n,t){const e=W(n),l=e.stylesheets.get(t);if(l)return l.loadPromise;const a=n.document.createElement("link"),c=new Promise((i,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=t,a.onload=()=>{i()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${t}:`,r),o&&o.reportCspIssue(),u()},n.document.head.appendChild(a)});return e.stylesheets.set(t,{link:a,loadPromise:c}),c}function T(o,n){const t=W(o),e=t.stylesheets.get(n);e&&(o.document.head.removeChild(e.link),t.stylesheets.delete(n))}function So(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const n=Array.from(new Set(["0,400","1,400",`0,${o.fontWeightBold}`,`0,${o.fontWeightNormal}`,`0,${o.defaultButtonFontWeight}`,`0,${o.primaryButtonFontWeight}`,`0,${o.checklistLauncherFontWeight}`,`0,${o.launcherButtonFontWeight}`])).sort().join(";");return{url:`https://fonts.googleapis.com/css2?family=${encodeURIComponent(o.builtinFontFamily.name)}:ital,wght@${n}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{Ro as D,$o as a,zo as b,bo as c,Po as d,vo as g,Do as u};
1
+ import{r as k,R as y}from"./vendor.react.js";import{V as R,W as $,R as P,P as D,X as z,B as U,Y as O,Z as q,z as _,_ as j,$ as N,a0 as K,Q as V,l as G,a1 as Y,a2 as Q,a3 as X,e as Z,a4 as J}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{i as oo,j as ro,k as no,l as to,m as eo,n as lo,o as ao,p as uo,q as co,r as io}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.core-js.js";import{j as so,a4 as fo,v as go,a9 as H}from"./userflow.js";import{c as Co}from"./flow-condition-types.js";import{a as bo}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="8a5c2aba-a8b5-4a8d-b990-eaaa09bfa3e5",o._sentryDebugIdIdentifier="sentry-dbid-8a5c2aba-a8b5-4a8d-b990-eaaa09bfa3e5")}catch{}})();function Bo(o){const[n]=k.useState(()=>new so(o));return n.update(o),n}const Ro=({icon:o,size:n,dataAttrs:t})=>{n=n||16;const e=typeof o=="string"&&A[o]?A[o]:o;if(typeof e=="string")return y.createElement("img",{...t,"aria-hidden":"true",src:e,width:n,height:n,style:{objectFit:"contain"}});{const l=e.icon[0],a=e.icon[1],c=e.icon[4];return y.createElement("svg",{"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:`0 0 ${l} ${a}`,...t},y.createElement("path",{fill:"currentColor",d:String(c)}))}},A={"regular/calendar-day":R,"regular/comment-alt":$,"regular/comments-alt":P,"regular/envelope":D,"regular/exclamation-triangle":z,"regular/external-link":U,"regular/file-alt":O,"regular/graduation-cap":q,"regular/info-circle":_,"regular/lightbulb":j,"regular/megaphone":N,"regular/pencil":K,"regular/phone":V,"regular/play-circle":G,"regular/question-circle":Y,"regular/shoe-prints":Q,"solid/shoe-prints":oo,"solid/file-invoice":ro,"solid/receipt":no,"solid/university":to,"solid/users":eo,"solid/stars":lo,"regular/tasks":X,"regular/user":Z,"regular/users":J,"solid/exclamation-triangle":ao,"solid/info-circle":uo,"solid/play-circle":co,"solid/question-circle":io};function ko(o,n,t){if(!o.document.fonts)return t(),()=>{};let e=!1;const l=()=>{const i=o.document.fonts.load(`100px ${n}`,"BESbswy");if(!i){c(),t();return}i.then(u=>{e||(u.length>=1?(c(),t()):window.setTimeout(l,25))},u=>{console.log("Userflow.js: observeFont error:"),console.log(u),t()})};l();const a=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${n} to load. Will continue anyway.`),t()},2e3),c=()=>{e=!0,window.clearTimeout(a)};return c}function p(o){return o?o.match(/^#[0-9a-f]{6}$/i)?[parseInt(o.substring(1,3),16),parseInt(o.substring(3,5),16),parseInt(o.substring(5,7),16)]:o.match(/^#[0-9a-f]{3}$/i)?[parseInt(o.substring(1,2).repeat(2),16),parseInt(o.substring(2,3).repeat(2),16),parseInt(o.substring(3,4).repeat(2),16)]:[0,0,0]:[0,0,0]}function v([o,n,t]){return"#"+o.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")}function B(o){const n=p(o);return n?n.join(", "):"0, 0, 0"}function x(o){return v(p(o))}function po([o,n,t]){return[Math.round(255-o),Math.round(255-n),Math.round(255-t)]}function F(o,n,t){return[Math.max(0,Math.min(255,Math.round(o[0]+(n[0]-o[0])*t))),Math.max(0,Math.min(255,Math.round(o[1]+(n[1]-o[1])*t))),Math.max(0,Math.min(255,Math.round(o[2]+(n[2]-o[2])*t)))]}function h(o,n,t){const e=p(o),l=p(n);return!e||!l?o:v(F(e,l,t))}function S([o,n,t]){o/=255,n/=255,t/=255;const e=Math.max(o,n,t),l=Math.min(o,n,t);let a,c,i=(e+l)/2;if(e==l)a=c=0;else{const u=e-l;switch(c=i>.5?u/(2-e-l):u/(e+l),e){case o:a=(n-t)/u+(n<t?6:0);break;case n:a=(t-o)/u+2;break;default:a=(o-n)/u+4;break}a/=6}return[a,c,i]}function m([o,n,t]){let e=o/255,l=n/255,a=t/255;function c(r){let s=0;return r<=.04045?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),s}let i=.2126*c(e)+.7152*c(l)+.0722*c(a);function u(r){let s=0;return r<=216/24389?s=r*(24389/27):s=Math.pow(r,1/3)*116-16,s}return Math.round(u(i)*10)/1e3}function L(o,n){const t=m(o),e=m(n),l=.05;let i=(1-(e-t))/2*(.18-l)+l,u=1-Math.abs(e-t),r=Math.pow((1-i)*u,4),s=i+r;return Math.round(s*1e3)/1e3}function w(o,n){const t=p(o),e=S(t);let l=null,a=null;for(const g of n){const d=p(g),f=S(d);let C=!1;!l||!a?C=!0:Math.abs(f[2]-e[2])>.3?f[1]>a[1]&&(C=!0):Math.abs(e[2]-f[2])>Math.abs(e[2]-a[2])&&(C=!0),C&&(l=d,a=f)}let c=l,i=l,u=L(c,t),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(i=po(i),r=L(i,t)),[v(F(t,c,u)),v(F(t,i,r))]}function wo(o,n,t,e){const[l,a]=w(o,[n]);let c,i;if(o===t)c=l,i=a;else{const b=w(t,[o,n,e]);c=b[0],i=b[1]}const u=p(o),r=p(t),s=20;let g,d,f,C;if(Math.abs(u[0]-r[0])<s&&Math.abs(u[1]-r[1])<s&&Math.abs(u[2]-r[2])<s){g=n,d=o;const b=w(g,[d]);f=b[0],C=b[1]}else g=o,d=n,f=l,C=a;return[l,a,c,i,g,d,f,C]}function ho(o){const[n,t,e,l,a,c,i,u]=wo(o.brandBackgroundColor,o.brandForegroundColor,o.mainBackgroundColor,o.mainForegroundColor),r={...o,widgetBackgroundColor:a,widgetForegroundColor:c,widgetHoverBackgroundColor:i,widgetActiveBackgroundColor:u,sameBackground:x(o.mainBackgroundColor)==x(o.brandBackgroundColor)};r.brandHoverBackgroundColor&&(r.widgetHoverBackgroundColor=r.brandHoverBackgroundColor),r.brandActiveBackgroundColor&&(r.widgetActiveBackgroundColor=r.brandActiveBackgroundColor),r.brandHoverBackgroundColor||(r.brandHoverBackgroundColor=n),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=t),r.mainHoverBackgroundColor||(r.mainHoverBackgroundColor=e),r.mainActiveBackgroundColor||(r.mainActiveBackgroundColor=l),r.bannerBackgroundColor||(r.bannerBackgroundColor=r.brandBackgroundColor),r.bannerForegroundColor||(r.bannerForegroundColor=r.brandForegroundColor);const[s,g]=w(r.bannerBackgroundColor,[r.bannerForegroundColor]);r.bannerHoverBackgroundColor=s,r.bannerActiveBackgroundColor=g;const[d,f]=w(r.bannerForegroundColor,[r.bannerBackgroundColor]);if(r.bannerHoverForegroundColor=d,r.bannerActiveForegroundColor=f,r.bubbleBorderColor||(r.bubbleBorderColor=r.mainForegroundColor),r.checklistLauncherActiveBackgroundColor||(r.checklistLauncherActiveBackgroundColor=r.brandActiveBackgroundColor),r.checklistLauncherBackgroundColor||(r.checklistLauncherBackgroundColor=r.brandBackgroundColor),r.checklistLauncherCounterBackgroundColor||(r.checklistLauncherCounterBackgroundColor=r.brandForegroundColor),r.checklistLauncherCounterFontColor||(r.checklistLauncherCounterFontColor=r.brandBackgroundColor),r.checklistLauncherFontColor||(r.checklistLauncherFontColor=r.brandForegroundColor),r.checklistLauncherHoverBackgroundColor||(r.checklistLauncherHoverBackgroundColor=r.brandHoverBackgroundColor),r.focusColor||(r.focusColor=r.mainActiveBackgroundColor),r.launcherIconActiveColor||(r.launcherIconActiveColor=r.brandActiveBackgroundColor),r.launcherIconColor||(r.launcherIconColor=r.brandBackgroundColor),r.launcherIconHoverColor||(r.launcherIconHoverColor=r.brandHoverBackgroundColor),r.linkColor||(r.linkColor=r.widgetBackgroundColor),r.progressBarColor||(r.progressBarColor=r.widgetBackgroundColor),r.questionColor||(r.questionColor=r.widgetBackgroundColor),r.toolbarForegroundColor||(r.toolbarForegroundColor=r.mainForegroundColor),r.primaryButtonBackgroundColor||(r.primaryButtonBackgroundColor=r.widgetBackgroundColor),r.primaryButtonFontColor||(r.primaryButtonFontColor=r.widgetForegroundColor),r.primaryButtonHoverFontColor||(r.primaryButtonHoverFontColor=r.primaryButtonFontColor),r.primaryButtonActiveFontColor||(r.primaryButtonActiveFontColor=r.primaryButtonFontColor),!r.primaryButtonHoverBackgroundColor||!r.primaryButtonActiveBackgroundColor){const[C,b]=w(r.primaryButtonBackgroundColor,[r.primaryButtonFontColor]);r.primaryButtonHoverBackgroundColor||(r.primaryButtonHoverBackgroundColor=C),r.primaryButtonActiveBackgroundColor||(r.primaryButtonActiveBackgroundColor=b)}if(r.primaryButtonBorderColor||(r.primaryButtonBorderColor=r.widgetBackgroundColor),r.primaryButtonHoverBorderColor||(r.primaryButtonHoverBorderColor=r.primaryButtonHoverBackgroundColor),r.primaryButtonActiveBorderColor||(r.primaryButtonActiveBorderColor=r.primaryButtonActiveBackgroundColor),r.defaultButtonBackgroundColor||(r.defaultButtonBackgroundColor=r.mainBackgroundColor),r.defaultButtonFontColor||(r.defaultButtonFontColor=a),r.defaultButtonHoverFontColor||(r.defaultButtonHoverFontColor=r.defaultButtonFontColor),r.defaultButtonActiveFontColor||(r.defaultButtonActiveFontColor=r.defaultButtonFontColor),!r.defaultButtonHoverBackgroundColor||!r.defaultButtonActiveBackgroundColor){const[C,b]=w(r.defaultButtonBackgroundColor,[r.defaultButtonFontColor]);r.defaultButtonHoverBackgroundColor||(r.defaultButtonHoverBackgroundColor=C),r.defaultButtonActiveBackgroundColor||(r.defaultButtonActiveBackgroundColor=b)}return r.defaultButtonBorderColor||(r.defaultButtonBorderColor=r.defaultButtonFontColor),r.defaultButtonHoverBorderColor||(r.defaultButtonHoverBorderColor=r.defaultButtonBorderColor),r.defaultButtonActiveBorderColor||(r.defaultButtonActiveBorderColor=r.defaultButtonBorderColor),r.launcherButtonBackgroundColor||(r.launcherButtonBackgroundColor=r.brandBackgroundColor),r.launcherButtonBorderColor||(r.launcherButtonBorderColor=r.brandBackgroundColor),r.launcherButtonFontColor||(r.launcherButtonFontColor=r.brandForegroundColor),r.launcherButtonHoverBackgroundColor||(r.launcherButtonHoverBackgroundColor=r.brandHoverBackgroundColor),r.launcherButtonHoverBorderColor||(r.launcherButtonHoverBorderColor=r.launcherButtonHoverBackgroundColor),r.launcherButtonHoverFontColor||(r.launcherButtonHoverFontColor=r.launcherButtonFontColor),r.launcherButtonActiveBackgroundColor||(r.launcherButtonActiveBackgroundColor=r.brandActiveBackgroundColor),r.launcherButtonActiveBorderColor||(r.launcherButtonActiveBorderColor=r.launcherButtonActiveBackgroundColor),r.launcherButtonActiveFontColor||(r.launcherButtonActiveFontColor=r.launcherButtonFontColor),r.siteHeroForegroundColor||(r.siteHeroForegroundColor=r.brandForegroundColor),r.siteHeroBackgroundColor||(r.siteHeroBackgroundColor=r.brandBackgroundColor),r.siteBackgroundColor||(r.siteBackgroundColor=r.mainHoverBackgroundColor),r.siteContentForegroundColor||(r.siteContentForegroundColor=r.mainForegroundColor),r.siteContentBackgroundColor||(r.siteContentBackgroundColor=r.mainBackgroundColor),r}function vo(o){const{questionColor:n}=o;return{"--userflow-backdrop-highlight-color-rgb":B(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===fo.INSIDE?"inset":"","--userflow-backdrop-highlight-opacity":o.backdropHighlightOpacity,"--userflow-backdrop-highlight-radius":o.backdropHighlightRadius+"px","--userflow-backdrop-highlight-spread":o.backdropHighlightSpread+"px","--userflow-backdrop-opacity":o.backdropOpacity,"--userflow-banner-background-color":o.bannerBackgroundColor,"--userflow-banner-hover-background-color":o.bannerHoverBackgroundColor,"--userflow-banner-active-background-color":o.bannerActiveBackgroundColor,"--userflow-banner-foreground-color":o.bannerForegroundColor,"--userflow-banner-hover-foreground-color":o.bannerHoverForegroundColor,"--userflow-banner-active-foreground-color":o.bannerActiveForegroundColor,"--userflow-beacon-color":o.beaconColor,"--userflow-beacon-size":o.beaconSize+"px","--userflow-brand-active-background-color":o.brandActiveBackgroundColor,"--userflow-brand-background-color":o.brandBackgroundColor,"--userflow-brand-background-color-rgb":B(o.brandBackgroundColor),"--userflow-brand-foreground-color":o.brandForegroundColor,"--userflow-brand-foreground-color-rgb":B(o.brandForegroundColor),"--userflow-brand-hover-background-color":o.brandHoverBackgroundColor,"--userflow-bubble-border-color":o.bubbleBorderColor,"--userflow-bubble-border-radius":o.bubbleBorderRadius+"px","--userflow-bubble-border-width":o.bubbleBorderWidth+"px","--userflow-button-border-radius":o.buttonBorderRadius+"px","--userflow-button-height":o.buttonHeight+"px","--userflow-button-min-width":o.buttonMinWidth+"px","--userflow-button-text-align":o.buttonMinWidth===0?"start":"center","--userflow-buttons-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="right"?"end":"center","--userflow-buttons-bubble-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="center"?"center":"end","--userflow-checklist-launcher-active-background-color":o.checklistLauncherActiveBackgroundColor,"--userflow-checklist-launcher-background-color":o.checklistLauncherBackgroundColor,"--userflow-checklist-launcher-border-radius":o.checklistLauncherBorderRadius+"px","--userflow-checklist-launcher-counter-background-color":o.checklistLauncherCounterBackgroundColor,"--userflow-checklist-launcher-counter-font-color":o.checklistLauncherCounterFontColor,"--userflow-checklist-launcher-font-color-rgb":B(o.checklistLauncherFontColor),"--userflow-checklist-launcher-font-color":o.checklistLauncherFontColor,"--userflow-checklist-launcher-font-weight":String(o.checklistLauncherFontWeight),"--userflow-checklist-launcher-height":o.checklistLauncherHeight+"px","--userflow-checklist-launcher-hover-background-color":o.checklistLauncherHoverBackgroundColor,"--userflow-checkmark-background-color":o.checkmarkBackgroundColor,"--userflow-completed-task-text-decoration":o.completedTaskTextDecoration,"--userflow-default-button-active-background-color":o.defaultButtonActiveBackgroundColor,"--userflow-default-button-active-border-color":o.defaultButtonActiveBorderColor,"--userflow-default-button-active-font-color":o.defaultButtonActiveFontColor,"--userflow-default-button-background-color":o.defaultButtonBackgroundColor,"--userflow-default-button-border-color":o.defaultButtonBorderColor,"--userflow-default-button-border-width":o.defaultButtonBorderWidth+"px","--userflow-default-button-font-color":o.defaultButtonFontColor,"--userflow-default-button-font-weight":String(o.defaultButtonFontWeight),"--userflow-default-button-hover-background-color":o.defaultButtonHoverBackgroundColor,"--userflow-default-button-hover-border-color":o.defaultButtonHoverBorderColor,"--userflow-default-button-hover-font-color":o.defaultButtonHoverFontColor,"--userflow-focus-color":`rgba(${B(o.focusColor)}, ${o.focusOpacity})`,"--userflow-font-family":o.builtinFontFamily?Fo(o.builtinFontFamily.name)+(o.builtinFontFamily.fallback?", "+o.builtinFontFamily.fallback:""):o.fontFamily?o.fontFamily:"sans-serif","--userflow-font-size":o.fontSize+"px","--userflow-font-weight-bold":String(o.fontWeightBold),"--userflow-font-weight-normal":String(o.fontWeightNormal),"--userflow-h1-font-size":o.h1FontSize+"px","--userflow-h2-font-size":o.h2FontSize+"px","--userflow-launcher-button-active-background-color":o.launcherButtonActiveBackgroundColor,"--userflow-launcher-button-active-border-color":o.launcherButtonActiveBorderColor,"--userflow-launcher-button-active-font-color":o.launcherButtonActiveFontColor,"--userflow-launcher-button-background-color":o.launcherButtonBackgroundColor,"--userflow-launcher-button-border-color":o.launcherButtonBorderColor,"--userflow-launcher-button-border-radius":o.launcherButtonBorderRadius+"px","--userflow-launcher-button-border-width":o.launcherButtonBorderWidth+"px","--userflow-launcher-button-font-color":o.launcherButtonFontColor,"--userflow-launcher-button-font-weight":String(o.launcherButtonFontWeight),"--userflow-launcher-button-height":o.launcherButtonHeight+"px","--userflow-launcher-button-horizontal-padding":o.launcherButtonHorizontalPadding+"px","--userflow-launcher-button-hover-background-color":o.launcherButtonHoverBackgroundColor,"--userflow-launcher-button-hover-border-color":o.launcherButtonHoverBorderColor,"--userflow-launcher-button-hover-font-color":o.launcherButtonHoverFontColor,"--userflow-launcher-button-width":o.launcherButtonWidth?o.launcherButtonWidth+"px":"auto","--userflow-launcher-icon-active-color":o.launcherIconActiveColor,"--userflow-launcher-icon-color":o.launcherIconColor,"--userflow-launcher-icon-hover-color":o.launcherIconHoverColor,"--userflow-launcher-icon-opacity":o.launcherIconOpacity,"--userflow-launcher-icon-size":o.launcherIconSize+"px","--userflow-line-height":o.lineHeight+"px","--userflow-link-color":o.linkColor,"--userflow-main-active-background-color":o.mainActiveBackgroundColor,"--userflow-main-background-color":o.mainBackgroundColor,"--userflow-main-background-color-rgb":B(o.mainBackgroundColor),"--userflow-main-foreground-color":o.mainForegroundColor,"--userflow-main-foreground-color-rgb":B(o.mainForegroundColor),"--userflow-main-hover-background-color":o.mainHoverBackgroundColor,"--userflow-modal-padding":o.modalPadding+"px","--userflow-modal-padding-top":(o.avatarType===go.NONE?o.modalPadding:o.modalPadding+Math.max((o.avatarSize-o.modalPadding)/2,0))+"px","--userflow-backdrop-color-rgb":B(o.backdropColor),"--userflow-notch-color":o.bubbleBorderWidth>0&&o.bubbleBorderColor||o.mainBackgroundColor,"--userflow-primary-button-active-background-color":o.primaryButtonActiveBackgroundColor,"--userflow-primary-button-active-border-color":o.primaryButtonActiveBorderColor,"--userflow-primary-button-active-font-color":o.primaryButtonActiveFontColor,"--userflow-primary-button-background-color":o.primaryButtonBackgroundColor,"--userflow-primary-button-border-color":o.primaryButtonBorderColor,"--userflow-primary-button-border-width":o.primaryButtonBorderWidth+"px","--userflow-primary-button-font-color":o.primaryButtonFontColor,"--userflow-primary-button-font-weight":String(o.primaryButtonFontWeight),"--userflow-primary-button-hover-background-color":o.primaryButtonHoverBackgroundColor,"--userflow-primary-button-hover-border-color":o.primaryButtonHoverBorderColor,"--userflow-primary-button-hover-font-color":o.primaryButtonHoverFontColor,"--userflow-progress-bar-color":o.progressBarColor,"--userflow-progress-bar-height":o.progressBarHeight+"px","--userflow-narrow-progress-bar-height":o.narrowBarHeight+"px","--userflow-squared-progress-bar-height":o.squaredBarHeight+"px","--userflow-rounded-progress-bar-height":o.roundedBarHeight+"px","--userflow-dotted-progress-bar-height":o.dottedBarHeight+"px","--userflow-numbered-progress-bar-height":o.numberedBarFontSize+"px","--userflow-resource-center-collapsed-height":o.resourceCenterCollapsedHeight+"px","--userflow-resource-center-launcher-icon-img-size":o.rcIconSize+"px","--userflow-resource-center-full-width":o.resourceCenterFullWidth+"px","--userflow-resource-center-launcher-border-radius":(o.resourceCenterLauncherBorderRadius!=null?Math.min(o.resourceCenterLauncherBorderRadius,o.resourceCenterCollapsedHeight/2):o.resourceCenterCollapsedHeight/2)+"px","--userflow-resource-center-padding-x":o.resourceCenterPaddingX+"px","--userflow-resource-center-padding-y":o.resourceCenterPaddingY+"px","--userflow-resource-center-transition-duration":o.resourceCenterTransitionDuration+"ms","--userflow-resource-center-width":o.resourceCenterWidth+"px","--userflow-question-color-light":h(n,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(n,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(n,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(n,o.mainBackgroundColor,.15),"--userflow-question-color":n,"--userflow-toast-padding":o.toastPadding+"px","--userflow-toast-auto-dismiss":o.toastAutoDismiss+"ms","--userflow-toast-placement":o.toastPlacement+"px","--userflow-toast-width":o.toastWidth+"px","--userflow-toolbar-foreground-color":o.toolbarForegroundColor,"--userflow-toolbar-foreground-color-rgb":B(o.toolbarForegroundColor),"--userflow-tooltip-notch-size":o.tooltipNotchSize+"px","--userflow-unread-badge-background-color":o.unreadBadgeBackgroundColor,"--userflow-unread-badge-foreground-color":o.unreadBadgeForegroundColor,"--userflow-widget-active-background-color":o.widgetActiveBackgroundColor,"--userflow-widget-background-color":o.widgetBackgroundColor,"--userflow-widget-foreground-color":o.widgetForegroundColor,"--userflow-widget-hover-background-color":o.widgetHoverBackgroundColor,"--userflow-site-hero-foreground-color":o.siteHeroForegroundColor,"--userflow-site-hero-background-color":o.siteHeroBackgroundColor,"--userflow-site-background-color":o.siteBackgroundColor,"--userflow-site-content-foreground-color":o.siteContentForegroundColor,"--userflow-site-content-background-color":o.siteContentBackgroundColor}}const yo=[];function $o(o){let[n,t]=k.useState(o);const e=Bo(o.sessionData||yo);return k.useLayoutEffect(()=>{const{variations:l}=o;if(!l)return;const a=[],c=[],i=()=>{let u=o,r=!1;for(const[s,g]of l.entries())if(a[s]){r||(r=!0,u={...u});for(const d of g.overriddenKeys){const f=d,C=g[f];u[f]=C}}t(u)};for(const[u,r]of l.entries()){a[u]=!1;const{condition:s}=r;if(s&&r.overriddenKeys&&r.overriddenKeys.length>0){const d=Co[s.type].track({sessionData:e,condition:s,callback:f=>{a[u]=f,i()}});c[u]=d}else c[u]=()=>{}}return i(),()=>{for(const u of c)u()}},[o,e]),k.useMemo(()=>ho(n),[n])}function Po(o){return o?.cssVersion?`https://cdn.userflow.com/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}function Fo(o){return`"${o.trim()}"`}const M=new Map;function W(o){let n=M.get(o);return n||(n={stylesheets:new Map},M.set(o,n)),n}function Do(o,n,t,{uninstallOnUnmount:e}={}){const l=bo(),[a,c]=k.useState(!n);return k.useLayoutEffect(()=>{if(!o||!n)return;let i=!1,u;const r=async d=>{await E(l,o,d),u&&T(o,u),u=d};(async()=>{let d=typeof n=="string"?n:n.get();if(Ho()&&t){let f=await Ao(d);if(i)return;f=xo(f,vo(t)),d="data:text/css;base64,"+btoa(f)}await r(d),!i&&c(!0)})();let g=null;return typeof n!="string"&&(g=n.onUpdate(async()=>{r(n.get())})),()=>{i=!0,g&&g(),e&&u&&T(o,u)}},[l,o,n,t,e]),{loaded:a}}function Ho(){return!!window.MSInputMethodContext&&!!document.documentMode}const I=new Map;function Ao(o){return new Promise((n,t)=>{let e=I.get(o);if(e){n(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){t(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;I.set(o,a),n(a)}),l.addEventListener("error",()=>{t(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function xo(o,n){for(const t in n)if(n.hasOwnProperty(t)){const e=n[t];e&&(o=o.replace(new RegExp(`var\\(${t}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function zo(o,n){const t=n&&So(n),e=t?.url,l=t?.fontFamily,[a,c]=k.useState(!e||!l);return k.useLayoutEffect(()=>{if(!o||!e||!l)return;let i=!1;E(null,o,e);const u=ko(o,l,()=>{i||c(!0)});return()=>{i=!0,u()}},[o,e,l]),{loaded:a}}function E(o,n,t){const e=W(n),l=e.stylesheets.get(t);if(l)return l.loadPromise;const a=n.document.createElement("link"),c=new Promise((i,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=t,a.onload=()=>{i()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${t}:`,r),o&&o.reportCspIssue(),u()},n.document.head.appendChild(a)});return e.stylesheets.set(t,{link:a,loadPromise:c}),c}function T(o,n){const t=W(o),e=t.stylesheets.get(n);e&&(o.document.head.removeChild(e.link),t.stylesheets.delete(n))}function So(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const n=Array.from(new Set(["0,400","1,400",`0,${o.fontWeightBold}`,`0,${o.fontWeightNormal}`,`0,${o.defaultButtonFontWeight}`,`0,${o.primaryButtonFontWeight}`,`0,${o.checklistLauncherFontWeight}`,`0,${o.launcherButtonFontWeight}`])).sort().join(";");return{url:`https://fonts.googleapis.com/css2?family=${encodeURIComponent(o.builtinFontFamily.name)}:ital,wght@${n}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{Ro as D,$o as a,zo as b,Bo as c,Po as d,vo as g,Do as u};
2
2
  //# sourceMappingURL=stylesheets.js.map
@@ -1,2 +1,2 @@
1
- import{r as i}from"./vendor.react.js";import{o as q}from"./flow-condition-types.js";import{l as O,v as S,u as B,r as M,p as H,j as x,h as Z,e as j}from"./roots.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9bd446dc-f2f8-4edc-b9ca-35f686143d3b",e._sentryDebugIdIdentifier="sentry-dbid-9bd446dc-f2f8-4edc-b9ca-35f686143d3b")}catch{}})();const X=new URL("bubble-frame.css",import.meta.url).href;let E=!1;const c=[];let l=[],D;function G(e){c.push(e),c.length===1&&(E=!0,I(),window.addEventListener("scroll",T))}function N(e){const t=c.indexOf(e);t>=0&&(c.splice(t,1),c.length===0&&(E=!1,window.cancelAnimationFrame(D),window.removeEventListener("scroll",T)))}function Y(e){l.push(e)}function P(){c.forEach(e=>e()),l.length>0&&(l.forEach(e=>e()),l=[]),I()}function I(){E&&(D=window.requestAnimationFrame(P))}function T(){}function $({selector:e,targetMoved:t,targetLost:s,onTargetClick:o,onTargetMouseEnter:w,onTargetMouseLeave:R}){const L=i.useRef(t),k=i.useRef(s),d=i.useRef(o),m=i.useRef(w),h=i.useRef(R);i.useLayoutEffect(()=>{L.current=t,k.current=s,d.current=o,m.current=w,h.current=R}),i.useLayoutEffect(()=>{let n=null,a=null,f=null,y=!1;const v=()=>{n=null,a=null,f=null,k.current()};if(!e){v();return}const A=()=>{if(!f||!n)return;const r=M(n);(!a||!U(a,r))&&(a=r,r.width===0&&r.height===0?v():L.current({targetEl:n,targetRect:a,clipEl:f,viewportClipRect:V(f)}))};let u=!1;const W=()=>{u||(u=!0,G(A))},C=()=>{u&&(u=!1,N(A))},g=()=>{d.current&&d.current()},b=()=>{m.current&&m.current()},p=()=>{h.current&&h.current()},F=()=>{const r=n;n=O(e)?e:S(e),(!y||n!==r)&&(r&&(r.removeEventListener("click",g),r.removeEventListener("mouseenter",b),r.removeEventListener("mouseleave",p)),n?(W(),n.addEventListener("click",g),n.addEventListener("mouseenter",b),n.addEventListener("mouseleave",p),f=B(n)):(C(),v())),y=!0};F();const _=q(F);return()=>{_.disconnect(),C(),n&&(n.removeEventListener("click",g),n.removeEventListener("mouseenter",b),n.removeEventListener("mouseleave",p))}},[e])}function U(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function V(e){H();const t=x(Z()),s=x(j());if(!e||e===document.documentElement)return{top:0,right:s,bottom:t,left:0};{const o=M(e);return{top:Math.max(0,o.top),right:Math.min(s,o.right),bottom:Math.min(t,o.bottom),left:Math.max(0,o.left)}}}export{X as b,Y as r,$ as u};
1
+ import{r as i}from"./vendor.react.js";import{o as _}from"./flow-condition-types.js";import{l as O,y as S,w as B,r as M,q as H,j as x,h as Z,e as j}from"./roots.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d5c14e83-c67a-4192-b842-6dd065589f86",e._sentryDebugIdIdentifier="sentry-dbid-d5c14e83-c67a-4192-b842-6dd065589f86")}catch{}})();const X=new URL("bubble-frame.css",import.meta.url).href;let E=!1;const c=[];let f=[],D;function G(e){c.push(e),c.length===1&&(E=!0,I(),window.addEventListener("scroll",q))}function N(e){const t=c.indexOf(e);t>=0&&(c.splice(t,1),c.length===0&&(E=!1,window.cancelAnimationFrame(D),window.removeEventListener("scroll",q)))}function Y(e){f.push(e)}function P(){c.forEach(e=>e()),f.length>0&&(f.forEach(e=>e()),f=[]),I()}function I(){E&&(D=window.requestAnimationFrame(P))}function q(){}function $({selector:e,targetMoved:t,targetLost:s,onTargetClick:o,onTargetMouseEnter:b,onTargetMouseLeave:R}){const L=i.useRef(t),y=i.useRef(s),m=i.useRef(o),d=i.useRef(b),h=i.useRef(R);i.useLayoutEffect(()=>{L.current=t,y.current=s,m.current=o,d.current=b,h.current=R}),i.useLayoutEffect(()=>{let n=null,a=null,l=null,k=!1;const v=()=>{n=null,a=null,l=null,y.current()};if(!e){v();return}const A=()=>{if(!l||!n)return;const r=M(n);(!a||!U(a,r))&&(a=r,r.width===0&&r.height===0?v():L.current({targetEl:n,targetRect:a,clipEl:l,viewportClipRect:V(l)}))};let u=!1;const T=()=>{u||(u=!0,G(A))},C=()=>{u&&(u=!1,N(A))},g=()=>{m.current&&m.current()},p=()=>{d.current&&d.current()},w=()=>{h.current&&h.current()},F=()=>{const r=n;n=O(e)?e:S(e),(!k||n!==r)&&(r&&(r.removeEventListener("click",g),r.removeEventListener("mouseenter",p),r.removeEventListener("mouseleave",w)),n?(T(),n.addEventListener("click",g),n.addEventListener("mouseenter",p),n.addEventListener("mouseleave",w),l=B(n)):(C(),v())),k=!0};F();const W=_(F);return()=>{W.disconnect(),C(),n&&(n.removeEventListener("click",g),n.removeEventListener("mouseenter",p),n.removeEventListener("mouseleave",w))}},[e])}function U(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function V(e){H();const t=x(Z()),s=x(j());if(!e||e===document.documentElement)return{top:0,right:s,bottom:t,left:0};{const o=M(e);return{top:Math.max(0,o.top),right:Math.min(s,o.right),bottom:Math.min(t,o.bottom),left:Math.max(0,o.left)}}}export{X as b,Y as r,$ as u};
2
2
  //# sourceMappingURL=use-selector-element-monitoring.js.map
package/userflow.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ResourceCenterApp.js","vendor.react.js","vendor.core-js.js","vendor.object-assign.js","client-context.js","vendor.i18next.js","vendor.babel.runtime.js","vendor.react-i18next.js","flow-host.styl.js","TreeDoc.js","flow-condition-types.js","vendor.date-fns.js","roots.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","vendor.obj-str.js","use-selector-element-monitoring.js","Frame.js","vendor.react-dom.js","vendor.scheduler.js","iframe-reset.styl.js","use-window-resize.js","logomark.js","ChecklistUI.js","FlowChrome.js","use-confetti.js","vendor.canvas-confetti.js","AnnouncementEngagement.js","vendor.memoize-one.js","vendor.bignumber.js.js","use-element-rect.js","BannerApp.js","vendor.phoenix.js","vendor.uuid.js","SitePage.js","vendor.react-router-dom.js","vendor.react-router.js","vendor.prop-types.js","vendor.history.js","vendor.resolve-pathname.js","vendor.value-equal.js","vendor.tiny-invariant.js","vendor.mini-create-react-context.js","vendor.path-to-regexp.js","vendor.react-is.js","Popover.js","react-hooks.js","vendor.lodash.js","implicit-tracking.js","DebuggerUI.js","vendor.fortawesome.react-fontawesome.js","vendor.fortawesome.fontawesome-svg-core.js","vendor.react-day-picker.js","ui.js"])))=>i.map(i=>d[i]);
2
2
  import"./vendor.core-js.js";import{S as z}from"./vendor.phoenix.js";import{v as O}from"./vendor.uuid.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="61d9c9bb-9ebd-4da2-87c5-d9d37b48bfaf",t._sentryDebugIdIdentifier="sentry-dbid-61d9c9bb-9ebd-4da2-87c5-d9d37b48bfaf")}catch{}})();const J="modulepreload",Q=function(t){return new URL("./",import.meta.url).toString()+t},b={},T=function(e,s,n){let i=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(s.map(c=>{if(c=Q(c),c in b)return;b[c]=!0;const l=c.endsWith(".css"),g=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${g}`))return;const E=document.createElement("link");if(E.rel=l?"stylesheet":J,l||(E.as="script"),E.crossOrigin="",E.href=c,u&&E.setAttribute("nonce",u),document.head.appendChild(E),l)return new Promise((j,Y)=>{E.addEventListener("load",j),E.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return i.then(a=>{for(const u of a||[])u.status==="rejected"&&r(u.reason);return e().catch(r)})};class h extends Error{constructor(e,s,n){super(e),Object.setPrototypeOf(this,h.prototype),this.name="UserflowError",this.code=s,this.humanMessage=n}}class x{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if(typeof window>"u")return!1;try{return window[this.type]!=null}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,s){e=this.formatKey(e);{if(!this.isSupported())return;window[this.type].setItem(e,s)}}removeItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].removeItem(e):void 0}clear(){return this.isSupported()?window[this.type].clear():void 0}}const w=new x("localStorage"),d=new x("sessionStorage");function ct(t){window.location.href=t}function m(){return window.location.href}function _(t){window.postMessage(t,window.origin)}function G(t){const e=n=>{if(n.source!==window||n.origin!==window.origin)return;const i=n.data;!i||typeof i!="object"||typeof i.kind!="string"||!i.kind.startsWith("userflow:")||t(i)===!0&&s()};window.addEventListener("message",e);const s=()=>window.removeEventListener("message",e);return s}function X(t){return new Promise(e=>{G(s=>{const n=t(s);return n?(e(n),!0):!1})})}const R=new Set;let D=!1;function Z(t){return q(),R.add(t),()=>{W(t)}}function W(t){R.delete(t)}function C(){R.forEach(t=>t())}function q(){if(D)return;D=!0;const{history:t}=window,e=s=>{const n=t[s];t[s]=(...i)=>{const r=n.apply(t,i);return C(),r}};window.__userflowStatePatched?(window.addEventListener("userflow:pushstate",()=>{C()}),window.addEventListener("userflow:replacestate",()=>{C()})):(e("pushState"),e("replaceState")),window.addEventListener("popstate",()=>{C()})}class ee{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){_({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=G(e),!1}async captureScreenshot(e,s,n,i){return _({kind:"userflow:crxScreenshot",x:e,y:s,width:n,height:i,devicePixelRatio:window.devicePixelRatio}),(await X(a=>a.kind==="userflow:crxScreenshotResult"?a:null)).imageDataUrl}}var k=(t=>(t.ACTION="ACTION",t.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",t.REPLACED="REPLACED",t.SNOOZED="SNOOZED",t.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",t.USERFLOWJS="USERFLOWJS",t.USER_CLOSED="USER_CLOSED",t))(k||{}),te=(t=>(t.POSITIVE="POSITIVE",t.NEUTRAL="NEUTRAL",t.NEGATIVE="NEGATIVE",t))(te||{}),se=(t=>(t.SECOND="SECOND",t.MINUTE="MINUTE",t.HOUR="HOUR",t.DAY="DAY",t))(se||{}),p=(t=>(t.ACTION="ACTION",t.DRAFT="DRAFT",t.LINK="LINK",t.LAUNCHER_SEEN="LAUNCHER_SEEN",t.RESOURCE_CENTER="RESOURCE_CENTER",t.USERFLOWJS="USERFLOWJS",t.ASSISTANT="ASSISTANT",t))(p||{}),ie=(t=>(t.LIKE="LIKE",t.DISLIKE="DISLIKE",t))(ie||{}),S=(t=>(t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.NUMBER="NUMBER",t.DATETIME="DATETIME",t.LIST="LIST",t.RANDOM_AB="RANDOM_AB",t.RANDOM_NUMBER="RANDOM_NUMBER",t.CHECKLIST_TASK="CHECKLIST_TASK",t.FLOW="FLOW",t.FLOW_SESSION="FLOW_SESSION",t.FLOW_STEP="FLOW_STEP",t.FLOW_VERSION="FLOW_VERSION",t))(S||{}),U=(t=>(t.FLOW="FLOW",t.BANNER="BANNER",t.EMBED="EMBED",t.CHECKLIST="CHECKLIST",t.LAUNCHER="LAUNCHER",t.RESOURCE_CENTER="RESOURCE_CENTER",t.SITE="SITE",t))(U||{}),ne=(t=>(t.ALWAYS_TRUE="ALWAYS_TRUE",t.ATTRIBUTE="ATTRIBUTE",t.CHECKLIST_TASK_CLICKED="CHECKLIST_TASK_CLICKED",t.CLAUSE="CLAUSE",t.ELEMENT="ELEMENT",t.EVENT="EVENT",t.FILLED_IN_INPUT="FILLED_IN_INPUT",t.FLOW="FLOW",t.INPUT_VALUE="INPUT_VALUE",t.PAGE="PAGE",t.SEGMENT="SEGMENT",t.TIME="TIME",t))(ne||{}),re=(t=>(t.AUTO="AUTO",t.MANUAL="MANUAL",t))(re||{}),oe=(t=>(t.INPUT="INPUT",t))(oe||{}),ae=(t=>(t.ABSOLUTE_EQ="ABSOLUTE_EQ",t.ABSOLUTE_GT="ABSOLUTE_GT",t.ABSOLUTE_LT="ABSOLUTE_LT",t.AND="AND",t.BETWEEN="BETWEEN",t.CONTAINS="CONTAINS",t.EMPTY="EMPTY",t.ENDS_WITH="ENDS_WITH",t.EQ="EQ",t.EXCLUDES_ALL="EXCLUDES_ALL",t.EXCLUDES_ANY="EXCLUDES_ANY",t.FALSE="FALSE",t.GT="GT",t.GTE="GTE",t.INCLUDES_ALL="INCLUDES_ALL",t.INCLUDES_ANY="INCLUDES_ANY",t.LT="LT",t.LTE="LTE",t.NE="NE",t.NOT_CONTAINS="NOT_CONTAINS",t.NOT_EMPTY="NOT_EMPTY",t.NOT_REGEX="NOT_REGEX",t.OR="OR",t.REGEX="REGEX",t.RELATIVE_EQ="RELATIVE_EQ",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t.STARTS_WITH="STARTS_WITH",t.TRUE="TRUE",t.URL="URL",t))(ae||{}),ce=(t=>(t.CLICK="CLICK",t.DISABLED="DISABLED",t.MOUSEDOWN="MOUSEDOWN",t.NOT_CLICK="NOT_CLICK",t.NOT_DISABLED="NOT_DISABLED",t.NOT_PRESENT="NOT_PRESENT",t.PRESENT="PRESENT",t))(ce||{}),le=(t=>(t.END_USER="END_USER",t.GROUP="GROUP",t))(le||{}),ue=(t=>(t.BETWEEN="BETWEEN",t.EQ="EQ",t.GTE="GTE",t.LTE="LTE",t))(ue||{}),he=(t=>(t.ANY="ANY",t.RELATIVE_BETWEEN="RELATIVE_BETWEEN",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t))(he||{}),de=(t=>(t.CURRENT_USER="CURRENT_USER",t.CURRENT_USER_CURRENT_GROUP="CURRENT_USER_CURRENT_GROUP",t.CURRENT_GROUP="CURRENT_GROUP",t))(de||{}),fe=(t=>(t.ASSET="ASSET",t.CARTOON="CARTOON",t.NONE="NONE",t.URL="URL",t))(fe||{}),Ee=(t=>(t.INSIDE="INSIDE",t.OUTSIDE="OUTSIDE",t))(Ee||{}),Se=(t=>(t.TOP_LEFT="TOP_LEFT",t.TOP_CENTER="TOP_CENTER",t.TOP_RIGHT="TOP_RIGHT",t.BOTTOM_RIGHT="BOTTOM_RIGHT",t.BOTTOM_CENTER="BOTTOM_CENTER",t.BOTTOM_LEFT="BOTTOM_LEFT",t.CENTER="CENTER",t))(Se||{}),Te=(t=>(t.GOOGLE="GOOGLE",t.STANDARD="STANDARD",t))(Te||{}),ge=(t=>(t.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",t.DISMISS="DISMISS",t))(ge||{}),Ie=(t=>(t.DISMISS="DISMISS",t.NONE="NONE",t))(Ie||{}),we=(t=>(t.DEFAULT="DEFAULT",t.NARROW="NARROW",t.CHAINED_SQUARED="CHAINED_SQUARED",t.CHAINED_ROUNDED="CHAINED_ROUNDED",t.DOTTED="DOTTED",t.NUMBERED="NUMBERED",t))(we||{}),Ce=(t=>(t.TOP="TOP",t.BOTTOM="BOTTOM",t))(Ce||{}),me=(t=>(t.DEFAULT="DEFAULT",t.PLAINTEXT="PLAINTEXT",t.CUSTOM="CUSTOM",t))(me||{}),ke=(t=>(t.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",t.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",t.NONE="NONE",t))(ke||{}),Ue=(t=>(t.BUBBLE="BUBBLE",t.END="END",t.ERROR="ERROR",t.FLAG="FLAG",t))(Ue||{}),pe=(t=>(t.MANUAL="MANUAL",t.NONE="NONE",t.SYNTHETIC="SYNTHETIC",t))(pe||{}),Le=(t=>(t.BUBBLE="BUBBLE",t.HIDDEN="HIDDEN",t.MODAL="MODAL",t.TOOLTIP="TOOLTIP",t))(Le||{}),Ne=(t=>(t.ABOVE="ABOVE",t.BELOW="BELOW",t.LEFT="LEFT",t.RIGHT="RIGHT",t))(Ne||{}),_e=(t=>(t.CLOSE_FLOW="CLOSE_FLOW",t.EVAL_JS="EVAL_JS",t.GO_TO_STEP="GO_TO_STEP",t.NAVIGATE="NAVIGATE",t.SET_ATTRIBUTE="SET_ATTRIBUTE",t.SNOOZE="SNOOZE",t.START_FLOW="START_FLOW",t.TRACK_BUTTON_EVENT="TRACK_BUTTON_EVENT",t))(_e||{}),Ae=(t=>(t.NEW_TAB="NEW_TAB",t.SAME_TAB="SAME_TAB",t))(Ae||{}),Re=(t=>(t.SET="SET",t.SET_DATETIME="SET_DATETIME",t.SET_DATETIME_ONCE="SET_DATETIME_ONCE",t.SET_ONCE="SET_ONCE",t.ADD="ADD",t.SUBTRACT="SUBTRACT",t.APPEND="APPEND",t.PREPEND="PREPEND",t.REMOVE="REMOVE",t.UNSET="UNSET",t))(Re||{}),ve=(t=>(t.MULTILINE_TEXT="MULTILINE_TEXT",t.MULTIPLE_CHOICE="MULTIPLE_CHOICE",t.NPS="NPS",t.SCALE="SCALE",t.STARS="STARS",t.TEXT="TEXT",t))(ve||{}),A=(t=>(t.ACTION="ACTION",t.ANNOUNCEMENTS="ANNOUNCEMENTS",t.ASSISTANT="ASSISTANT",t.CHECKLIST="CHECKLIST",t.CONTACT="CONTACT",t.DIVIDER="DIVIDER",t.FLOWS="FLOWS",t.KNOWLEDGE_BASE="KNOWLEDGE_BASE",t.MESSAGE="MESSAGE",t.SUBPAGE="SUBPAGE",t))(A||{}),Oe=(t=>(t.CRISP="CRISP",t.CUSTOM="CUSTOM",t.FRESHCHAT="FRESHCHAT",t.HELPSCOUT="HELPSCOUT",t.HUBSPOT="HUBSPOT",t.INTERCOM="INTERCOM",t.ZENDESK="ZENDESK",t.ZENDESK_MESSENGER="ZENDESK_MESSENGER",t))(Oe||{}),be=(t=>(t.BUTTON="BUTTON",t.INPUT="INPUT",t))(be||{}),De=(t=>(t.EMAIL="EMAIL",t.PHONE="PHONE",t.CHAT="CHAT",t))(De||{}),ye=(t=>(t.SILENT="SILENT",t.BADGE="BADGE",t.POPOUT="POPOUT",t.MODAL="MODAL",t.TOAST="TOAST",t))(ye||{}),Me=(t=>(t.DEFAULT="DEFAULT",t.CUSTOM="CUSTOM",t.NONE="NONE",t))(Me||{}),Pe=(t=>(t.LAUNCHER_CLICK="LAUNCHER_CLICK",t.LAUNCHER_HOVER="LAUNCHER_HOVER",t.TARGET_CLICK="TARGET_CLICK",t.TARGET_HOVER="TARGET_HOVER",t.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",t.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",t))(Pe||{}),V=(t=>(t.ACTIVATE="ACTIVATE",t.DEACTIVATE="DEACTIVATE",t.NEVER="NEVER",t))(V||{}),Be=(t=>(t.AUTO="AUTO",t.TOP="TOP",t.RIGHT="RIGHT",t.BOTTOM="BOTTOM",t.LEFT="LEFT",t))(Be||{}),He=(t=>(t.START="START",t.CENTER="CENTER",t.END="END",t))(He||{}),xe=(t=>(t.PERCENT="PERCENT",t.PX="PX",t))(xe||{}),Ge=(t=>(t.BEACON="BEACON",t.BUTTON="BUTTON",t.HIDDEN="HIDDEN",t.ICON="ICON",t))(Ge||{}),We=(t=>(t.LAUNCHER="LAUNCHER",t.TARGET="TARGET",t))(We||{}),Ve=(t=>(t.BODY_FIRST="BODY_FIRST",t.BODY_LAST="BODY_LAST",t.ELEMENT_FIRST="ELEMENT_FIRST",t.ELEMENT_LAST="ELEMENT_LAST",t.ELEMENT_BEFORE="ELEMENT_BEFORE",t.ELEMENT_AFTER="ELEMENT_AFTER",t))(Ve||{}),Ke=(t=>(t.BODY_FIRST="BODY_FIRST",t.BODY_LAST="BODY_LAST",t.ELEMENT_FIRST="ELEMENT_FIRST",t.ELEMENT_LAST="ELEMENT_LAST",t.ELEMENT_BEFORE="ELEMENT_BEFORE",t.ELEMENT_AFTER="ELEMENT_AFTER",t))(Ke||{}),K=(t=>(t.CHECKLIST="CHECKLIST",t))(K||{}),Fe=(t=>(t.HIDE="HIDE",t.OTHERS="OTHERS",t))(Fe||{}),$e=(t=>(t.ALWAYS="ALWAYS",t.MULTIPLE="MULTIPLE",t.NEVER="NEVER",t.ONCE="ONCE",t.ONCE_PER_GROUP="ONCE_PER_GROUP",t))($e||{}),je=(t=>(t.NONE="NONE",t.PENDING_SCHEDULE="PENDING_SCHEDULE",t.SCHEDULED="SCHEDULED",t.FIRED="FIRED",t))(je||{}),Ye=(t=>(t.NONE="NONE",t.LIKE="LIKE",t.SCALE="SCALE",t))(Ye||{}),ze=(t=>(t.HIDE="HIDE",t.BLOCK="BLOCK",t.OTHERS="OTHERS",t))(ze||{});function Je(){return{customInputs:[],customNavigate:null,urlFilter:null,linkUrlDecorator:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[t=>!t.match(/\d$/)],"data-id":[t=>!t.match(/\d$/)]},inferenceClassNameFilters:[t=>!t.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1}}const f=Je();function y(t){return Array.isArray(t)||(t=t?[t]:[]),t=t.map(e=>typeof e=="string"?new RegExp(e):e),t}function lt(t,e){return t.every(s=>typeof s=="function"?s(e):s instanceof RegExp?s.test(e):!0)}function Qe(){let t=m();if(f.urlFilter){if(t=f.urlFilter(t),typeof t!="string")throw new h("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(t)}catch(e){throw new h(`Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.
3
3
  Returned URL: `+t+`
4
- Error message: `+e.message)}}return t}let F="";try{F=localStorage.getItem("debug")||""}catch{}const $=F.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=v("log");o.group=v("group");o.groupCollapsed=v("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let L;function v(t){return function(e,...s){if($){const n=performance.now(),i=L?Math.round(n-L):0;L=n,console[t](`%cuserflow %c${e} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const Xe=()=>T(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));function Ze(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class M{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const P=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],qe=()=>T(()=>import("./BannerApp.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,16,13,14,15,10,11,12,9,8,17,19,20,18,21,31,22,33,34])),N="1022169",et=import.meta.url,B=50,tt=5*60*1e3,H="userflowClientState",I="userflowClientSiteId";class st{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.debuggerUI=null,this.debuggerMountInProgress=!1,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{o(`builder ${e.kind} message received`,e);const s="idempotencyKey"in e&&typeof e.idempotencyKey=="string"?e.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(e.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),e.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:e.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:e.sessionId,isRecording:!0,startUrl:e.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),B))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(e,s)=>{d.setItem(I,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await T(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([35,1,2,3,4,5,6,7,19,20,36,37,38,39,40,41,42,43,44,45,28,16,13,14,15,10,11,12,26,27,21,9,46,29,47,48,33,34]));new n(this,e).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+N),Z(this.onUrlChange),this.setTargetEnv(new ee),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const e of P)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),W(this.onUrlChange),this.destroyTargetEnv();for(const e of P)document.removeEventListener(e,this.remountIfNecessary)}setTargetEnv(e){this.destroyTargetEnv(),this.targetEnv=e,e.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const s=e(this.getSessionStorageState());d.setItem(H,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const s=d.getItem(H);if(s)try{e=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState(i=>({...i,testUser:e})),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const s=[this.identify(e.id,{name:e.name,email:e.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:e.signature})],{group:n}=e;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(e=>({...e,testUser:null}))}init(e){if(o("init",e),!e)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==e){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=e,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");const e=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=f.serverEndpoint||e+"userflow.com";new URL(et).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new z(n,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
4
+ Error message: `+e.message)}}return t}let F="";try{F=localStorage.getItem("debug")||""}catch{}const $=F.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=v("log");o.group=v("group");o.groupCollapsed=v("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let L;function v(t){return function(e,...s){if($){const n=performance.now(),i=L?Math.round(n-L):0;L=n,console[t](`%cuserflow %c${e} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const Xe=()=>T(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));function Ze(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class M{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const P=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],qe=()=>T(()=>import("./BannerApp.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,16,13,14,15,10,11,12,9,8,17,19,20,18,21,31,22,33,34])),N="1022200",et=import.meta.url,B=50,tt=5*60*1e3,H="userflowClientState",I="userflowClientSiteId";class st{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.debuggerUI=null,this.debuggerMountInProgress=!1,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{o(`builder ${e.kind} message received`,e);const s="idempotencyKey"in e&&typeof e.idempotencyKey=="string"?e.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(e.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),e.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:e.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:e.sessionId,isRecording:!0,startUrl:e.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),B))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(e,s)=>{d.setItem(I,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await T(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([35,1,2,3,4,5,6,7,19,20,36,37,38,39,40,41,42,43,44,45,28,16,13,14,15,10,11,12,26,27,21,9,46,29,47,48,33,34]));new n(this,e).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+N),Z(this.onUrlChange),this.setTargetEnv(new ee),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const e of P)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),W(this.onUrlChange),this.destroyTargetEnv();for(const e of P)document.removeEventListener(e,this.remountIfNecessary)}setTargetEnv(e){this.destroyTargetEnv(),this.targetEnv=e,e.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const s=e(this.getSessionStorageState());d.setItem(H,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const s=d.getItem(H);if(s)try{e=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState(i=>({...i,testUser:e})),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const s=[this.identify(e.id,{name:e.name,email:e.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:e.signature})],{group:n}=e;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(e=>({...e,testUser:null}))}init(e){if(o("init",e),!e)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==e){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=e,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");const e=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=f.serverEndpoint||e+"userflow.com";new URL(et).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new z(n,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
5
5
  Details:
6
6
  `+i.details.map(r=>(r.path?`${r.path}: `:"")+r.message):""))})}async startImplicitTracking(){await T(()=>import("./implicit-tracking.js"),__vite__mapDeps([49,12,2,34,33])).then(e=>{this.implicitTracking=new e.ImplicitTracking(this),this.implicitTracking.start()}).catch(e=>o(`Implicit tracking failed to load ${e}`))}makeChannelJoinPayload(){let e;d.getItem(I)&&(e=new URL(m()).searchParams.get("announcement_id")||void 0);const n=this.buildClientContext();this.clientContext=n;const i={protocolVersion:2,userflowClientBuild:N,signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,bannerSessionId:this.bannerSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,siteSessionId:this.siteSession?.id||null,launchers:this.launcherSessions.map(r=>({flowId:r.flow.id})),trackers:Array.from(this.trackers.values()).map(r=>({flowId:r.tracker.flowId})),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map(r=>({conditionId:r.condition.id,isTrue:r.isTrue})),previewFlowId:d.getItem("previewFlowId"),announcementPreviewId:e,clientContext:n};return o("channel join payload",i),i}disconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.socket&&this.socket.disconnect(),this._socketStatus="disconnected",this.socket=null,this.channel=null}debounceInactiveDisconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.debounceInactiveDisconnectTimeout=window.setTimeout(()=>{if(this.hasDraftSession()||this.assistantMessageInProgress){this.debounceInactiveDisconnect();return}o("disconnecting from socket due to inactivity"),this.disconnect()},tt)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some(e=>e.draftMode)}async send(e,{batch:s,endBatch:n,handlesRejection:i}={}){return(!this.inBatch||!["ToggleClientCondition","UpdateClientContext"].includes(e.kind))&&this.checkPushRateLimit(),this.ensureConnected(),s&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),n?this.endBatch():this.endBatchTimeout=window.setTimeout(()=>{this.endBatch()},B)),this.sendRaw(e,{handlesRejection:i})}clearInitialMessagesQueue(e){if(this.initialMessagesQueue.length===0)return;const s=e.includes("cff_disable_page_views")===!0,n=e.includes("cff_implicit_events")===!1;for(const i of this.initialMessagesQueue){const{message:r,handlesRejection:a,resolve:u,reject:c}=i;if(n&&r.kind==="TrackRawEvent"){u("skipped due to disabled implicit events");continue}if(s&&(r.kind==="TrackEvent"&&r.name==="page_viewed"||r.kind==="TrackRawEvent"&&r.name==="page_viewed")){u("skipped due to disabled page views tracking");continue}this._sendToChannel(r,u,c,{handlesRejection:a})}this.initialMessagesQueue=[]}async sendRaw(e,{handlesRejection:s}={}){return typeof this.featureFlags>"u"?new Promise((n,i)=>{this.initialMessagesQueue.push({message:e,resolve:n,reject:i,handlesRejection:s})}):new Promise((n,i)=>{this._sendToChannel(e,n,i,{handlesRejection:s})})}_sendToChannel(e,s,n,{handlesRejection:i}={}){if(!this.channel){const c=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(i)throw Error(c);console.log(c,`
7
7
  Client message:`,e);return}o(`push ${e.kind} message`,e);const r=this.clientClock,a=()=>{this.serverClock=r,this.channel?.off("phx_error",u)},u=this.channel.on("phx_error",c=>{a();const l=`Userflow.js send ${e.kind} got phx_error`;this._socketStatus==="connected"&&console.log(l,`
package/vendor.core-js.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="7b4eafa7-0f85-4e4e-a91a-9d51d1c8c3a5",r._sentryDebugIdIdentifier="sentry-dbid-7b4eafa7-0f85-4e4e-a91a-9d51d1c8c3a5")}catch{}})();var Ze=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ze.SENTRY_RELEASE={id:"349a00ed48e39cc0cfb34a425f1db2a4f3781333"};var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var P=function(r){return r&&r.Math===Math&&r},f=P(typeof globalThis=="object"&&globalThis)||P(typeof window=="object"&&window)||P(typeof self=="object"&&self)||P(typeof F=="object"&&F)||P(typeof F=="object"&&F)||function(){return this}()||Function("return this")(),gr={},h=function(r){try{return!!r()}catch{return!0}},Qe=h,g=!Qe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rt=h,Or=!rt(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),et=Or,B=Function.prototype.call,O=et?B.bind(B):function(){return B.apply(B,arguments)},fe={},se={}.propertyIsEnumerable,ye=Object.getOwnPropertyDescriptor,tt=ye&&!se.call({1:2},1);fe.f=tt?function(e){var t=ye(this,e);return!!t&&t.enumerable}:se;var de=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},$e=Or,pe=Function.prototype,sr=pe.call,nt=$e&&pe.bind.bind(sr,sr),b=$e?nt:function(r){return function(){return sr.apply(r,arguments)}},be=b,at=be({}.toString),ot=be("".slice),q=function(r){return ot(at(r),8,-1)},it=b,vt=h,ut=q,H=Object,ct=it("".split),lt=vt(function(){return!H("z").propertyIsEnumerable(0)})?function(r){return ut(r)==="String"?ct(r,""):H(r)}:H,Sr=function(r){return r==null},ft=Sr,st=TypeError,he=function(r){if(ft(r))throw new st("Can't call method on "+r);return r},yt=lt,dt=he,Er=function(r){return yt(dt(r))},X=typeof document=="object"&&document.all,d=typeof X>"u"&&X!==void 0?function(r){return typeof r=="function"||r===X}:function(r){return typeof r=="function"},$t=d,_=function(r){return typeof r=="object"?r!==null:$t(r)},Z=f,pt=d,bt=function(r){return pt(r)?r:void 0},ge=function(r,e){return arguments.length<2?bt(Z[r]):Z[r]&&Z[r][e]},ht=b,Oe=ht({}.isPrototypeOf),gt=f,_r=gt.navigator,Dr=_r&&_r.userAgent,Se=Dr?String(Dr):"",Ee=f,Q=Se,Mr=Ee.process,Ar=Ee.Deno,Fr=Mr&&Mr.versions||Ar&&Ar.version,Br=Fr&&Fr.v8,$,W;Br&&($=Br.split("."),W=$[0]>0&&$[0]<4?1:+($[0]+$[1]));!W&&Q&&($=Q.match(/Edge\/(\d+)/),(!$||$[1]>=74)&&($=Q.match(/Chrome\/(\d+)/),$&&(W=+$[1])));var Te=W,Lr=Te,Ot=h,St=f,Et=St.String,we=!!Object.getOwnPropertySymbols&&!Ot(function(){var r=Symbol("symbol detection");return!Et(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Lr&&Lr<41}),Tt=we,Ie=Tt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",wt=ge,It=d,mt=Oe,Rt=Ie,Pt=Object,me=Rt?function(r){return typeof r=="symbol"}:function(r){var e=wt("Symbol");return It(e)&&mt(e.prototype,Pt(r))},Ct=String,Tr=function(r){try{return Ct(r)}catch{return"Object"}},jt=d,Nt=Tr,_t=TypeError,D=function(r){if(jt(r))return r;throw new _t(Nt(r)+" is not a function")},Dt=D,Mt=Sr,wr=function(r,e){var t=r[e];return Mt(t)?void 0:Dt(t)},rr=O,er=d,tr=_,At=TypeError,Ft=function(r,e){var t,n;if(e==="string"&&er(t=r.toString)&&!tr(n=rr(t,r))||er(t=r.valueOf)&&!tr(n=rr(t,r))||e!=="string"&&er(t=r.toString)&&!tr(n=rr(t,r)))return n;throw new At("Can't convert object to primitive value")},Re={exports:{}},Ur=f,Bt=Object.defineProperty,Ir=function(r,e){try{Bt(Ur,r,{value:e,configurable:!0,writable:!0})}catch{Ur[r]=e}return e},Lt=f,Ut=Ir,Gr="__core-js_shared__",xr=Re.exports=Lt[Gr]||Ut(Gr,{});(xr.versions||(xr.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mr=Re.exports,Kr=mr,Pe=function(r,e){return Kr[r]||(Kr[r]=e||{})},Gt=he,xt=Object,Kt=function(r){return xt(Gt(r))},Vt=b,kt=Kt,Wt=Vt({}.hasOwnProperty),S=Object.hasOwn||function(e,t){return Wt(kt(e),t)},zt=b,Yt=0,qt=Math.random(),Jt=zt(1 .toString),Ce=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Jt(++Yt+qt,36)},Ht=f,Xt=Pe,Vr=S,Zt=Ce,Qt=we,rn=Ie,m=Ht.Symbol,nr=Xt("wks"),en=rn?m.for||m:m&&m.withoutSetter||Zt,E=function(r){return Vr(nr,r)||(nr[r]=Qt&&Vr(m,r)?m[r]:en("Symbol."+r)),nr[r]},tn=O,kr=_,Wr=me,nn=wr,an=Ft,on=E,vn=TypeError,un=on("toPrimitive"),cn=function(r,e){if(!kr(r)||Wr(r))return r;var t=nn(r,un),n;if(t){if(e===void 0&&(e="default"),n=tn(t,r,e),!kr(n)||Wr(n))return n;throw new vn("Can't convert object to primitive value")}return e===void 0&&(e="number"),an(r,e)},ln=cn,fn=me,je=function(r){var e=ln(r,"string");return fn(e)?e:e+""},sn=f,zr=_,yr=sn.document,yn=zr(yr)&&zr(yr.createElement),dn=function(r){return yn?yr.createElement(r):{}},$n=g,pn=h,bn=dn,Ne=!$n&&!pn(function(){return Object.defineProperty(bn("div"),"a",{get:function(){return 7}}).a!==7}),hn=g,gn=O,On=fe,Sn=de,En=Er,Tn=je,wn=S,In=Ne,Yr=Object.getOwnPropertyDescriptor;gr.f=hn?Yr:function(e,t){if(e=En(e),t=Tn(t),In)try{return Yr(e,t)}catch{}if(wn(e,t))return Sn(!gn(On.f,e,t),e[t])};var J={},mn=g,Rn=h,Pn=mn&&Rn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cn=_,jn=String,Nn=TypeError,M=function(r){if(Cn(r))return r;throw new Nn(jn(r)+" is not an object")},_n=g,Dn=Ne,Mn=Pn,L=M,qr=je,An=TypeError,ar=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",vr="writable";J.f=_n?Mn?function(e,t,n){if(L(e),t=qr(t),L(n),typeof e=="function"&&t==="prototype"&&"value"in n&&vr in n&&!n[vr]){var a=Fn(e,t);a&&a[vr]&&(e[t]=n.value,n={configurable:ir in n?n[ir]:a[ir],enumerable:or in n?n[or]:a[or],writable:!1})}return ar(e,t,n)}:ar:function(e,t,n){if(L(e),t=qr(t),L(n),Dn)try{return ar(e,t,n)}catch{}if("get"in n||"set"in n)throw new An("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Bn=g,Ln=J,Un=de,_e=Bn?function(r,e,t){return Ln.f(r,e,Un(1,t))}:function(r,e,t){return r[e]=t,r},De={exports:{}},dr=g,Gn=S,Me=Function.prototype,xn=dr&&Object.getOwnPropertyDescriptor,Rr=Gn(Me,"name"),Kn=Rr&&function(){}.name==="something",Vn=Rr&&(!dr||dr&&xn(Me,"name").configurable),kn={EXISTS:Rr,PROPER:Kn,CONFIGURABLE:Vn},Wn=b,zn=d,$r=mr,Yn=Wn(Function.toString);zn($r.inspectSource)||($r.inspectSource=function(r){return Yn(r)});var Ae=$r.inspectSource,qn=f,Jn=d,Jr=qn.WeakMap,Hn=Jn(Jr)&&/native code/.test(String(Jr)),Xn=Pe,Zn=Ce,Hr=Xn("keys"),Qn=function(r){return Hr[r]||(Hr[r]=Zn(r))},Fe={},ra=Hn,Be=f,ea=_,ta=_e,ur=S,cr=mr,na=Qn,aa=Fe,Xr="Object already initialized",pr=Be.TypeError,oa=Be.WeakMap,z,N,Y,ia=function(r){return Y(r)?N(r):z(r,{})},va=function(r){return function(e){var t;if(!ea(e)||(t=N(e)).type!==r)throw new pr("Incompatible receiver, "+r+" required");return t}};if(ra||cr.state){var p=cr.state||(cr.state=new oa);p.get=p.get,p.has=p.has,p.set=p.set,z=function(r,e){if(p.has(r))throw new pr(Xr);return e.facade=r,p.set(r,e),e},N=function(r){return p.get(r)||{}},Y=function(r){return p.has(r)}}else{var I=na("state");aa[I]=!0,z=function(r,e){if(ur(r,I))throw new pr(Xr);return e.facade=r,ta(r,I,e),e},N=function(r){return ur(r,I)?r[I]:{}},Y=function(r){return ur(r,I)}}var ua={set:z,get:N,has:Y,enforce:ia,getterFor:va},Pr=b,ca=h,la=d,U=S,br=g,fa=kn.CONFIGURABLE,sa=Ae,Le=ua,ya=Le.enforce,da=Le.get,Zr=String,K=Object.defineProperty,$a=Pr("".slice),pa=Pr("".replace),ba=Pr([].join),ha=br&&!ca(function(){return K(function(){},"length",{value:8}).length!==8}),ga=String(String).split("String"),Oa=De.exports=function(r,e,t){$a(Zr(e),0,7)==="Symbol("&&(e="["+pa(Zr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!U(r,"name")||fa&&r.name!==e)&&(br?K(r,"name",{value:e,configurable:!0}):r.name=e),ha&&t&&U(t,"arity")&&r.length!==t.arity&&K(r,"length",{value:t.arity});try{t&&U(t,"constructor")&&t.constructor?br&&K(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var n=ya(r);return U(n,"source")||(n.source=ba(ga,typeof e=="string"?e:"")),r};Function.prototype.toString=Oa(function(){return la(this)&&da(this).source||sa(this)},"toString");var Sa=De.exports,Ea=d,Ta=J,wa=Sa,Ia=Ir,ma=function(r,e,t,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:e;if(Ea(t)&&wa(t,o,n),n.global)a?r[e]=t:Ia(e,t);else{try{n.unsafe?r[e]&&(a=!0):delete r[e]}catch{}a?r[e]=t:Ta.f(r,e,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r},Ue={},Ra=Math.ceil,Pa=Math.floor,Ca=Math.trunc||function(e){var t=+e;return(t>0?Pa:Ra)(t)},ja=Ca,Ge=function(r){var e=+r;return e!==e||e===0?0:ja(e)},Na=Ge,_a=Math.max,Da=Math.min,Ma=function(r,e){var t=Na(r);return t<0?_a(t+e,0):Da(t,e)},Aa=Ge,Fa=Math.min,Ba=function(r){var e=Aa(r);return e>0?Fa(e,9007199254740991):0},La=Ba,xe=function(r){return La(r.length)},Ua=Er,Ga=Ma,xa=xe,Qr=function(r){return function(e,t,n){var a=Ua(e),o=xa(a);if(o===0)return!r&&-1;var i=Ga(n,o),v;if(r&&t!==t){for(;o>i;)if(v=a[i++],v!==v)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},Ka={includes:Qr(!0),indexOf:Qr(!1)},Va=b,lr=S,ka=Er,Wa=Ka.indexOf,za=Fe,re=Va([].push),Ya=function(r,e){var t=ka(r),n=0,a=[],o;for(o in t)!lr(za,o)&&lr(t,o)&&re(a,o);for(;e.length>n;)lr(t,o=e[n++])&&(~Wa(a,o)||re(a,o));return a},qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ja=Ya,Ha=qa,Xa=Ha.concat("length","prototype");Ue.f=Object.getOwnPropertyNames||function(e){return Ja(e,Xa)};var Ke={};Ke.f=Object.getOwnPropertySymbols;var Za=ge,Qa=b,ro=Ue,eo=Ke,to=M,no=Qa([].concat),ao=Za("Reflect","ownKeys")||function(e){var t=ro.f(to(e)),n=eo.f;return n?no(t,n(e)):t},ee=S,oo=ao,io=gr,vo=J,uo=function(r,e,t){for(var n=oo(e),a=vo.f,o=io.f,i=0;i<n.length;i++){var v=n[i];!ee(r,v)&&!(t&&ee(t,v))&&a(r,v,o(e,v))}},co=h,lo=d,fo=/#|\.prototype\./,A=function(r,e){var t=yo[so(r)];return t===po?!0:t===$o?!1:lo(e)?co(e):!!e},so=A.normalize=function(r){return String(r).replace(fo,".").toLowerCase()},yo=A.data={},$o=A.NATIVE="N",po=A.POLYFILL="P",Ve=A,G=f,bo=gr.f,ho=_e,go=ma,Oo=Ir,So=uo,Eo=Ve,To=function(r,e){var t=r.target,n=r.global,a=r.stat,o,i,v,u,c,s;if(n?i=G:a?i=G[t]||Oo(t,{}):i=G[t]&&G[t].prototype,i)for(v in e){if(c=e[v],r.dontCallGetSet?(s=bo(i,v),u=s&&s.value):u=i[v],o=Eo(n?v:t+(a?".":"#")+v,r.forced),!o&&u!==void 0){if(typeof c==typeof u)continue;So(c,u)}(r.sham||u&&u.sham)&&ho(c,"sham",!0),go(i,v,c,r)}},ke={},te=D,wo=TypeError,Io=function(r){var e,t;this.promise=new r(function(n,a){if(e!==void 0||t!==void 0)throw new wo("Bad Promise constructor");e=n,t=a}),this.resolve=te(e),this.reject=te(t)};ke.f=function(r){return new Io(r)};var mo=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}},Ro=q,Po=b,Co=function(r){if(Ro(r)==="Function")return Po(r)},ne=Co,jo=D,No=Or,_o=ne(ne.bind),Do=function(r,e){return jo(r),e===void 0?r:No?_o(r,e):function(){return r.apply(e,arguments)}},We={},Mo=E,Ao=We,Fo=Mo("iterator"),Bo=Array.prototype,Lo=function(r){return r!==void 0&&(Ao.Array===r||Bo[Fo]===r)},Uo=E,Go=Uo("toStringTag"),ze={};ze[Go]="z";var xo=String(ze)==="[object z]",Ko=xo,Vo=d,V=q,ko=E,Wo=ko("toStringTag"),zo=Object,Yo=V(function(){return arguments}())==="Arguments",qo=function(r,e){try{return r[e]}catch{}},Jo=Ko?V:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=qo(e=zo(r),Wo))=="string"?t:Yo?V(e):(n=V(e))==="Object"&&Vo(e.callee)?"Arguments":n},Ho=Jo,ae=wr,Xo=Sr,Zo=We,Qo=E,ri=Qo("iterator"),Ye=function(r){if(!Xo(r))return ae(r,ri)||ae(r,"@@iterator")||Zo[Ho(r)]},ei=O,ti=D,ni=M,ai=Tr,oi=Ye,ii=TypeError,vi=function(r,e){var t=arguments.length<2?oi(r):e;if(ti(t))return ni(ei(t,r));throw new ii(ai(r)+" is not iterable")},ui=O,oe=M,ci=wr,li=function(r,e,t){var n,a;oe(r);try{if(n=ci(r,"return"),!n){if(e==="throw")throw t;return t}n=ui(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return oe(n),t},fi=Do,si=O,yi=M,di=Tr,$i=Lo,pi=xe,ie=Oe,bi=vi,hi=Ye,ve=li,gi=TypeError,k=function(r,e){this.stopped=r,this.result=e},ue=k.prototype,Oi=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),v=!!(t&&t.INTERRUPTED),u=fi(e,n),c,s,T,R,l,w,Cr,jr=function(y){return c&&ve(c,"normal",y),new k(!0,y)},Nr=function(y){return a?(yi(y),v?u(y[0],y[1],jr):u(y[0],y[1])):v?u(y,jr):u(y)};if(o)c=r.iterator;else if(i)c=r;else{if(s=hi(r),!s)throw new gi(di(r)+" is not iterable");if($i(s)){for(T=0,R=pi(r);R>T;T++)if(l=Nr(r[T]),l&&ie(ue,l))return l;return new k(!1)}c=bi(r,s)}for(w=o?r.next:c.next;!(Cr=si(w,c)).done;){try{l=Nr(Cr.value)}catch(y){ve(c,"throw",y)}if(typeof l=="object"&&l&&ie(ue,l))return l}return new k(!1)},Si=f,qe=Si.Promise,Ei=E,Je=Ei("iterator"),He=!1;try{var Ti=0,ce={next:function(){return{done:!!Ti++}},return:function(){He=!0}};ce[Je]=function(){return this},Array.from(ce,function(){throw 2})}catch{}var wi=function(r,e){try{if(!e&&!He)return!1}catch{return!1}var t=!1;try{var n={};n[Je]=function(){return{next:function(){return{done:t=!0}}}},r(n)}catch{}return t},C=f,Ii=Se,mi=q,x=function(r){return Ii.slice(0,r.length)===r},Ri=function(){return x("Bun/")?"BUN":x("Cloudflare-Workers")?"CLOUDFLARE":x("Deno/")?"DENO":x("Node.js/")?"NODE":C.Bun&&typeof Bun.version=="string"?"BUN":C.Deno&&typeof Deno.version=="object"?"DENO":mi(C.process)==="process"?"NODE":C.window&&C.document?"BROWSER":"REST"}(),Pi=f,j=qe,Ci=d,ji=Ve,Ni=Ae,_i=E,le=Ri,fr=Te;j&&j.prototype;var Di=_i("species"),hr=!1,Xe=Ci(Pi.PromiseRejectionEvent),Mi=ji("Promise",function(){var r=Ni(j),e=r!==String(j);if(!e&&fr===66)return!0;if(!fr||fr<51||!/native code/.test(r)){var t=new j(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=t.constructor={};if(a[Di]=n,hr=t.then(function(){})instanceof n,!hr)return!0}return!e&&(le==="BROWSER"||le==="DENO")&&!Xe}),Ai={CONSTRUCTOR:Mi,REJECTION_EVENT:Xe,SUBCLASSING:hr},Fi=qe,Bi=wi,Li=Ai.CONSTRUCTOR,Ui=Li||!Bi(function(r){Fi.all(r).then(void 0,function(){})}),Gi=To,xi=O,Ki=D,Vi=ke,ki=mo,Wi=Oi,zi=Ui;Gi({target:"Promise",stat:!0,forced:zi},{allSettled:function(e){var t=this,n=Vi.f(t),a=n.resolve,o=n.reject,i=ki(function(){var v=Ki(t.resolve),u=[],c=0,s=1;Wi(e,function(T){var R=c++,l=!1;s++,xi(v,t,T).then(function(w){l||(l=!0,u[R]={status:"fulfilled",value:w},--s||a(u))},function(w){l||(l=!0,u[R]={status:"rejected",reason:w},--s||a(u))})}),--s||a(u)});return i.error&&o(i.value),n.promise}});export{F as c,Yi as g};
1
+ (function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="5f92b88c-bcaa-4758-81d5-1d1f39850fc4",r._sentryDebugIdIdentifier="sentry-dbid-5f92b88c-bcaa-4758-81d5-1d1f39850fc4")}catch{}})();var Ze=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ze.SENTRY_RELEASE={id:"cb3dda32ec8415c94c799d4216baa3c05fd50118"};var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var P=function(r){return r&&r.Math===Math&&r},f=P(typeof globalThis=="object"&&globalThis)||P(typeof window=="object"&&window)||P(typeof self=="object"&&self)||P(typeof F=="object"&&F)||P(typeof F=="object"&&F)||function(){return this}()||Function("return this")(),gr={},h=function(r){try{return!!r()}catch{return!0}},Qe=h,g=!Qe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rt=h,Or=!rt(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),et=Or,B=Function.prototype.call,O=et?B.bind(B):function(){return B.apply(B,arguments)},fe={},se={}.propertyIsEnumerable,ye=Object.getOwnPropertyDescriptor,tt=ye&&!se.call({1:2},1);fe.f=tt?function(e){var t=ye(this,e);return!!t&&t.enumerable}:se;var de=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},$e=Or,pe=Function.prototype,sr=pe.call,nt=$e&&pe.bind.bind(sr,sr),b=$e?nt:function(r){return function(){return sr.apply(r,arguments)}},be=b,at=be({}.toString),ot=be("".slice),q=function(r){return ot(at(r),8,-1)},it=b,vt=h,ut=q,H=Object,ct=it("".split),lt=vt(function(){return!H("z").propertyIsEnumerable(0)})?function(r){return ut(r)==="String"?ct(r,""):H(r)}:H,Sr=function(r){return r==null},ft=Sr,st=TypeError,he=function(r){if(ft(r))throw new st("Can't call method on "+r);return r},yt=lt,dt=he,Er=function(r){return yt(dt(r))},X=typeof document=="object"&&document.all,d=typeof X>"u"&&X!==void 0?function(r){return typeof r=="function"||r===X}:function(r){return typeof r=="function"},$t=d,_=function(r){return typeof r=="object"?r!==null:$t(r)},Z=f,pt=d,bt=function(r){return pt(r)?r:void 0},ge=function(r,e){return arguments.length<2?bt(Z[r]):Z[r]&&Z[r][e]},ht=b,Oe=ht({}.isPrototypeOf),gt=f,_r=gt.navigator,Dr=_r&&_r.userAgent,Se=Dr?String(Dr):"",Ee=f,Q=Se,Mr=Ee.process,Ar=Ee.Deno,Fr=Mr&&Mr.versions||Ar&&Ar.version,Br=Fr&&Fr.v8,$,W;Br&&($=Br.split("."),W=$[0]>0&&$[0]<4?1:+($[0]+$[1]));!W&&Q&&($=Q.match(/Edge\/(\d+)/),(!$||$[1]>=74)&&($=Q.match(/Chrome\/(\d+)/),$&&(W=+$[1])));var Te=W,Lr=Te,Ot=h,St=f,Et=St.String,we=!!Object.getOwnPropertySymbols&&!Ot(function(){var r=Symbol("symbol detection");return!Et(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Lr&&Lr<41}),Tt=we,Ie=Tt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",wt=ge,It=d,mt=Oe,Rt=Ie,Pt=Object,me=Rt?function(r){return typeof r=="symbol"}:function(r){var e=wt("Symbol");return It(e)&&mt(e.prototype,Pt(r))},Ct=String,Tr=function(r){try{return Ct(r)}catch{return"Object"}},jt=d,Nt=Tr,_t=TypeError,D=function(r){if(jt(r))return r;throw new _t(Nt(r)+" is not a function")},Dt=D,Mt=Sr,wr=function(r,e){var t=r[e];return Mt(t)?void 0:Dt(t)},rr=O,er=d,tr=_,At=TypeError,Ft=function(r,e){var t,n;if(e==="string"&&er(t=r.toString)&&!tr(n=rr(t,r))||er(t=r.valueOf)&&!tr(n=rr(t,r))||e!=="string"&&er(t=r.toString)&&!tr(n=rr(t,r)))return n;throw new At("Can't convert object to primitive value")},Re={exports:{}},Ur=f,Bt=Object.defineProperty,Ir=function(r,e){try{Bt(Ur,r,{value:e,configurable:!0,writable:!0})}catch{Ur[r]=e}return e},Lt=f,Ut=Ir,Gr="__core-js_shared__",xr=Re.exports=Lt[Gr]||Ut(Gr,{});(xr.versions||(xr.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mr=Re.exports,Kr=mr,Pe=function(r,e){return Kr[r]||(Kr[r]=e||{})},Gt=he,xt=Object,Kt=function(r){return xt(Gt(r))},Vt=b,kt=Kt,Wt=Vt({}.hasOwnProperty),S=Object.hasOwn||function(e,t){return Wt(kt(e),t)},zt=b,Yt=0,qt=Math.random(),Jt=zt(1 .toString),Ce=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Jt(++Yt+qt,36)},Ht=f,Xt=Pe,Vr=S,Zt=Ce,Qt=we,rn=Ie,m=Ht.Symbol,nr=Xt("wks"),en=rn?m.for||m:m&&m.withoutSetter||Zt,E=function(r){return Vr(nr,r)||(nr[r]=Qt&&Vr(m,r)?m[r]:en("Symbol."+r)),nr[r]},tn=O,kr=_,Wr=me,nn=wr,an=Ft,on=E,vn=TypeError,un=on("toPrimitive"),cn=function(r,e){if(!kr(r)||Wr(r))return r;var t=nn(r,un),n;if(t){if(e===void 0&&(e="default"),n=tn(t,r,e),!kr(n)||Wr(n))return n;throw new vn("Can't convert object to primitive value")}return e===void 0&&(e="number"),an(r,e)},ln=cn,fn=me,je=function(r){var e=ln(r,"string");return fn(e)?e:e+""},sn=f,zr=_,yr=sn.document,yn=zr(yr)&&zr(yr.createElement),dn=function(r){return yn?yr.createElement(r):{}},$n=g,pn=h,bn=dn,Ne=!$n&&!pn(function(){return Object.defineProperty(bn("div"),"a",{get:function(){return 7}}).a!==7}),hn=g,gn=O,On=fe,Sn=de,En=Er,Tn=je,wn=S,In=Ne,Yr=Object.getOwnPropertyDescriptor;gr.f=hn?Yr:function(e,t){if(e=En(e),t=Tn(t),In)try{return Yr(e,t)}catch{}if(wn(e,t))return Sn(!gn(On.f,e,t),e[t])};var J={},mn=g,Rn=h,Pn=mn&&Rn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cn=_,jn=String,Nn=TypeError,M=function(r){if(Cn(r))return r;throw new Nn(jn(r)+" is not an object")},_n=g,Dn=Ne,Mn=Pn,L=M,qr=je,An=TypeError,ar=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",vr="writable";J.f=_n?Mn?function(e,t,n){if(L(e),t=qr(t),L(n),typeof e=="function"&&t==="prototype"&&"value"in n&&vr in n&&!n[vr]){var a=Fn(e,t);a&&a[vr]&&(e[t]=n.value,n={configurable:ir in n?n[ir]:a[ir],enumerable:or in n?n[or]:a[or],writable:!1})}return ar(e,t,n)}:ar:function(e,t,n){if(L(e),t=qr(t),L(n),Dn)try{return ar(e,t,n)}catch{}if("get"in n||"set"in n)throw new An("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Bn=g,Ln=J,Un=de,_e=Bn?function(r,e,t){return Ln.f(r,e,Un(1,t))}:function(r,e,t){return r[e]=t,r},De={exports:{}},dr=g,Gn=S,Me=Function.prototype,xn=dr&&Object.getOwnPropertyDescriptor,Rr=Gn(Me,"name"),Kn=Rr&&function(){}.name==="something",Vn=Rr&&(!dr||dr&&xn(Me,"name").configurable),kn={EXISTS:Rr,PROPER:Kn,CONFIGURABLE:Vn},Wn=b,zn=d,$r=mr,Yn=Wn(Function.toString);zn($r.inspectSource)||($r.inspectSource=function(r){return Yn(r)});var Ae=$r.inspectSource,qn=f,Jn=d,Jr=qn.WeakMap,Hn=Jn(Jr)&&/native code/.test(String(Jr)),Xn=Pe,Zn=Ce,Hr=Xn("keys"),Qn=function(r){return Hr[r]||(Hr[r]=Zn(r))},Fe={},ra=Hn,Be=f,ea=_,ta=_e,ur=S,cr=mr,na=Qn,aa=Fe,Xr="Object already initialized",pr=Be.TypeError,oa=Be.WeakMap,z,N,Y,ia=function(r){return Y(r)?N(r):z(r,{})},va=function(r){return function(e){var t;if(!ea(e)||(t=N(e)).type!==r)throw new pr("Incompatible receiver, "+r+" required");return t}};if(ra||cr.state){var p=cr.state||(cr.state=new oa);p.get=p.get,p.has=p.has,p.set=p.set,z=function(r,e){if(p.has(r))throw new pr(Xr);return e.facade=r,p.set(r,e),e},N=function(r){return p.get(r)||{}},Y=function(r){return p.has(r)}}else{var I=na("state");aa[I]=!0,z=function(r,e){if(ur(r,I))throw new pr(Xr);return e.facade=r,ta(r,I,e),e},N=function(r){return ur(r,I)?r[I]:{}},Y=function(r){return ur(r,I)}}var ua={set:z,get:N,has:Y,enforce:ia,getterFor:va},Pr=b,ca=h,la=d,U=S,br=g,fa=kn.CONFIGURABLE,sa=Ae,Le=ua,ya=Le.enforce,da=Le.get,Zr=String,K=Object.defineProperty,$a=Pr("".slice),pa=Pr("".replace),ba=Pr([].join),ha=br&&!ca(function(){return K(function(){},"length",{value:8}).length!==8}),ga=String(String).split("String"),Oa=De.exports=function(r,e,t){$a(Zr(e),0,7)==="Symbol("&&(e="["+pa(Zr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!U(r,"name")||fa&&r.name!==e)&&(br?K(r,"name",{value:e,configurable:!0}):r.name=e),ha&&t&&U(t,"arity")&&r.length!==t.arity&&K(r,"length",{value:t.arity});try{t&&U(t,"constructor")&&t.constructor?br&&K(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var n=ya(r);return U(n,"source")||(n.source=ba(ga,typeof e=="string"?e:"")),r};Function.prototype.toString=Oa(function(){return la(this)&&da(this).source||sa(this)},"toString");var Sa=De.exports,Ea=d,Ta=J,wa=Sa,Ia=Ir,ma=function(r,e,t,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:e;if(Ea(t)&&wa(t,o,n),n.global)a?r[e]=t:Ia(e,t);else{try{n.unsafe?r[e]&&(a=!0):delete r[e]}catch{}a?r[e]=t:Ta.f(r,e,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r},Ue={},Ra=Math.ceil,Pa=Math.floor,Ca=Math.trunc||function(e){var t=+e;return(t>0?Pa:Ra)(t)},ja=Ca,Ge=function(r){var e=+r;return e!==e||e===0?0:ja(e)},Na=Ge,_a=Math.max,Da=Math.min,Ma=function(r,e){var t=Na(r);return t<0?_a(t+e,0):Da(t,e)},Aa=Ge,Fa=Math.min,Ba=function(r){var e=Aa(r);return e>0?Fa(e,9007199254740991):0},La=Ba,xe=function(r){return La(r.length)},Ua=Er,Ga=Ma,xa=xe,Qr=function(r){return function(e,t,n){var a=Ua(e),o=xa(a);if(o===0)return!r&&-1;var i=Ga(n,o),v;if(r&&t!==t){for(;o>i;)if(v=a[i++],v!==v)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},Ka={includes:Qr(!0),indexOf:Qr(!1)},Va=b,lr=S,ka=Er,Wa=Ka.indexOf,za=Fe,re=Va([].push),Ya=function(r,e){var t=ka(r),n=0,a=[],o;for(o in t)!lr(za,o)&&lr(t,o)&&re(a,o);for(;e.length>n;)lr(t,o=e[n++])&&(~Wa(a,o)||re(a,o));return a},qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ja=Ya,Ha=qa,Xa=Ha.concat("length","prototype");Ue.f=Object.getOwnPropertyNames||function(e){return Ja(e,Xa)};var Ke={};Ke.f=Object.getOwnPropertySymbols;var Za=ge,Qa=b,ro=Ue,eo=Ke,to=M,no=Qa([].concat),ao=Za("Reflect","ownKeys")||function(e){var t=ro.f(to(e)),n=eo.f;return n?no(t,n(e)):t},ee=S,oo=ao,io=gr,vo=J,uo=function(r,e,t){for(var n=oo(e),a=vo.f,o=io.f,i=0;i<n.length;i++){var v=n[i];!ee(r,v)&&!(t&&ee(t,v))&&a(r,v,o(e,v))}},co=h,lo=d,fo=/#|\.prototype\./,A=function(r,e){var t=yo[so(r)];return t===po?!0:t===$o?!1:lo(e)?co(e):!!e},so=A.normalize=function(r){return String(r).replace(fo,".").toLowerCase()},yo=A.data={},$o=A.NATIVE="N",po=A.POLYFILL="P",Ve=A,G=f,bo=gr.f,ho=_e,go=ma,Oo=Ir,So=uo,Eo=Ve,To=function(r,e){var t=r.target,n=r.global,a=r.stat,o,i,v,u,c,s;if(n?i=G:a?i=G[t]||Oo(t,{}):i=G[t]&&G[t].prototype,i)for(v in e){if(c=e[v],r.dontCallGetSet?(s=bo(i,v),u=s&&s.value):u=i[v],o=Eo(n?v:t+(a?".":"#")+v,r.forced),!o&&u!==void 0){if(typeof c==typeof u)continue;So(c,u)}(r.sham||u&&u.sham)&&ho(c,"sham",!0),go(i,v,c,r)}},ke={},te=D,wo=TypeError,Io=function(r){var e,t;this.promise=new r(function(n,a){if(e!==void 0||t!==void 0)throw new wo("Bad Promise constructor");e=n,t=a}),this.resolve=te(e),this.reject=te(t)};ke.f=function(r){return new Io(r)};var mo=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}},Ro=q,Po=b,Co=function(r){if(Ro(r)==="Function")return Po(r)},ne=Co,jo=D,No=Or,_o=ne(ne.bind),Do=function(r,e){return jo(r),e===void 0?r:No?_o(r,e):function(){return r.apply(e,arguments)}},We={},Mo=E,Ao=We,Fo=Mo("iterator"),Bo=Array.prototype,Lo=function(r){return r!==void 0&&(Ao.Array===r||Bo[Fo]===r)},Uo=E,Go=Uo("toStringTag"),ze={};ze[Go]="z";var xo=String(ze)==="[object z]",Ko=xo,Vo=d,V=q,ko=E,Wo=ko("toStringTag"),zo=Object,Yo=V(function(){return arguments}())==="Arguments",qo=function(r,e){try{return r[e]}catch{}},Jo=Ko?V:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=qo(e=zo(r),Wo))=="string"?t:Yo?V(e):(n=V(e))==="Object"&&Vo(e.callee)?"Arguments":n},Ho=Jo,ae=wr,Xo=Sr,Zo=We,Qo=E,ri=Qo("iterator"),Ye=function(r){if(!Xo(r))return ae(r,ri)||ae(r,"@@iterator")||Zo[Ho(r)]},ei=O,ti=D,ni=M,ai=Tr,oi=Ye,ii=TypeError,vi=function(r,e){var t=arguments.length<2?oi(r):e;if(ti(t))return ni(ei(t,r));throw new ii(ai(r)+" is not iterable")},ui=O,oe=M,ci=wr,li=function(r,e,t){var n,a;oe(r);try{if(n=ci(r,"return"),!n){if(e==="throw")throw t;return t}n=ui(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return oe(n),t},fi=Do,si=O,yi=M,di=Tr,$i=Lo,pi=xe,ie=Oe,bi=vi,hi=Ye,ve=li,gi=TypeError,k=function(r,e){this.stopped=r,this.result=e},ue=k.prototype,Oi=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),v=!!(t&&t.INTERRUPTED),u=fi(e,n),c,s,T,R,l,w,Cr,jr=function(y){return c&&ve(c,"normal",y),new k(!0,y)},Nr=function(y){return a?(yi(y),v?u(y[0],y[1],jr):u(y[0],y[1])):v?u(y,jr):u(y)};if(o)c=r.iterator;else if(i)c=r;else{if(s=hi(r),!s)throw new gi(di(r)+" is not iterable");if($i(s)){for(T=0,R=pi(r);R>T;T++)if(l=Nr(r[T]),l&&ie(ue,l))return l;return new k(!1)}c=bi(r,s)}for(w=o?r.next:c.next;!(Cr=si(w,c)).done;){try{l=Nr(Cr.value)}catch(y){ve(c,"throw",y)}if(typeof l=="object"&&l&&ie(ue,l))return l}return new k(!1)},Si=f,qe=Si.Promise,Ei=E,Je=Ei("iterator"),He=!1;try{var Ti=0,ce={next:function(){return{done:!!Ti++}},return:function(){He=!0}};ce[Je]=function(){return this},Array.from(ce,function(){throw 2})}catch{}var wi=function(r,e){try{if(!e&&!He)return!1}catch{return!1}var t=!1;try{var n={};n[Je]=function(){return{next:function(){return{done:t=!0}}}},r(n)}catch{}return t},C=f,Ii=Se,mi=q,x=function(r){return Ii.slice(0,r.length)===r},Ri=function(){return x("Bun/")?"BUN":x("Cloudflare-Workers")?"CLOUDFLARE":x("Deno/")?"DENO":x("Node.js/")?"NODE":C.Bun&&typeof Bun.version=="string"?"BUN":C.Deno&&typeof Deno.version=="object"?"DENO":mi(C.process)==="process"?"NODE":C.window&&C.document?"BROWSER":"REST"}(),Pi=f,j=qe,Ci=d,ji=Ve,Ni=Ae,_i=E,le=Ri,fr=Te;j&&j.prototype;var Di=_i("species"),hr=!1,Xe=Ci(Pi.PromiseRejectionEvent),Mi=ji("Promise",function(){var r=Ni(j),e=r!==String(j);if(!e&&fr===66)return!0;if(!fr||fr<51||!/native code/.test(r)){var t=new j(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=t.constructor={};if(a[Di]=n,hr=t.then(function(){})instanceof n,!hr)return!0}return!e&&(le==="BROWSER"||le==="DENO")&&!Xe}),Ai={CONSTRUCTOR:Mi,REJECTION_EVENT:Xe,SUBCLASSING:hr},Fi=qe,Bi=wi,Li=Ai.CONSTRUCTOR,Ui=Li||!Bi(function(r){Fi.all(r).then(void 0,function(){})}),Gi=To,xi=O,Ki=D,Vi=ke,ki=mo,Wi=Oi,zi=Ui;Gi({target:"Promise",stat:!0,forced:zi},{allSettled:function(e){var t=this,n=Vi.f(t),a=n.resolve,o=n.reject,i=ki(function(){var v=Ki(t.resolve),u=[],c=0,s=1;Wi(e,function(T){var R=c++,l=!1;s++,xi(v,t,T).then(function(w){l||(l=!0,u[R]={status:"fulfilled",value:w},--s||a(u))},function(w){l||(l=!0,u[R]={status:"rejected",reason:w},--s||a(u))})}),--s||a(u)});return i.error&&o(i.value),n.promise}});export{F as c,Yi as g};
2
2
  //# sourceMappingURL=vendor.core-js.js.map