@frigade/react 1.32.21 → 1.32.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import{ThemeProvider as na}from"styled-components";import lt,{useContext as oa,useEffect as lo,useState as $o}from"react";import{useCallback as rt,useContext as Is,useEffect as As}from"react";import To,{useMemo as ys}from"react";var Qo="1.32.21 ";var ge="https://api.frigade.com/v1/public/",be="NOT_STARTED_STEP",Z="COMPLETED_FLOW",Kt="ABORTED_FLOW",ot="STARTED_FLOW",Be="NOT_STARTED_FLOW",Fe="COMPLETED_STEP",Yt="STARTED_STEP";function Oe(){let{publicApiKey:e,userId:t}=To.useContext(G);return{config:ys(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Qo,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function ft(){let{shouldGracefullyDegrade:e}=To.useContext(G);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),qt();let i;try{i=await fetch(t,o)}catch(r){return qt(r)}return i?i.ok?i:qt(i.statusText):qt()}}function qt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=To.useContext(G);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as Ps,useState as Zo}from"react";import{useContext as bs,useEffect as Ts,useState as ws}from"react";import Fs from"swr";import{useContext as Ss}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o}=Ss(G);function i(p,d=!1){return e[p]??d}function r(p,d){t(l=>({...l,[p]:d}))}function n(p){t(d=>{let{[p]:l,...h}=d;return{...h}})}function s(){return Object.values(e).some(p=>p)||o}return{getOpenFlowState:i,setOpenFlowState:r,resetOpenFlowState:n,hasOpenModals:s}}var ks="unknown";function Te(){let{config:e}=Oe(),{publicApiKey:t,userId:o,flows:i,setShouldGracefullyDegrade:r}=bs(G),{resetOpenFlowState:n}=ke(),[s,p]=ws(!1),d={data:i.map(k=>({flowId:k.id,flowState:Z,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=k=>fetch(k,e).then(c=>{if(c.ok)return c.json();throw new Error("Failed to fetch user flow states")}).catch(c=>(console.log(`Error fetching ${k}: ${c}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:h,isLoading:m,mutate:g,error:w}=Fs(t&&i&&o?`${ge}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),x=h==null?void 0:h.data;Ts(()=>{!s&&!m&&x&&p(!0)},[x,s,m]);async function y(k){if(x){let c=x.find(u=>u.flowId===k);c&&c.flowState!==Z&&(c.flowState=Z),await g(Promise.resolve({...h,data:x}),{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}async function C(k,c,u){if(x){let b=x.find(I=>I.flowId===k);b&&(b.stepStates[c]=u,b.flowState=ot),await g(Promise.resolve({...h,data:x}),{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}async function v(k,c,u){if(x){let b=x.find(I=>I.flowId===k);b&&(b.lastStepId=c,b.stepStates[c]=u,b.flowState=ot),await g({...h,data:x},{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}async function F(k){if(x){let c=x.find(u=>u.flowId===k);c&&c.flowState!==Be&&(c.flowState=Be,c.lastStepId=ks,Object.keys(c.stepStates).forEach(u=>{c.stepStates[u].actionType=be,c.stepStates[u].createdAt=new Date().toISOString()}),await g({...h,data:x},{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1}),n(k))}}async function A(k,c){if(x){let u=x.find(b=>b.flowId===k);u&&u.stepStates[c]!==be&&(u.stepStates[c]=be),await g({...h,data:x},{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:x,isLoadingUserFlowStateData:!s,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:F,optimisticallyMarkStepCompleted:C,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:v,error:w}}function At(){let{config:e}=Oe(),{userFlowStatesData:t,mutateUserFlowState:o}=Te(),{failedFlowResponses:i,setFailedFlowResponses:r,flowResponses:n,setFlowResponses:s}=Ps(G),[p,d]=Zo(new Set),[l,h]=Zo(new Set),m=ft();function g(y){let C=JSON.stringify(y);if(p.has(C))return null;p.add(C),d(p),l.add(y),h(l);let v=n==null?void 0:n.find(F=>F.flowSlug===y.flowSlug&&F.stepId===y.stepId&&F.actionType===y.actionType&&F.createdAt===y.createdAt);return m(`${ge}flowResponses`,{...e,method:"POST",body:C}).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+y.stepId+". Will retry again later."),r([...i,y])):v||s(A=>[...A??[],y])})}async function w(y){y.foreignUserId&&(y.actionType===ot||y.actionType===Be?await g(y):y.actionType===Z?await g(y):y.actionType===Yt?await g(y):y.actionType===Fe?await g(y):y.actionType===Kt?await g(y):y.actionType===be&&await g(y))}function x(){let y=[];return t==null||t.forEach(C=>{if(C&&C.stepStates&&Object.keys(C.stepStates).length!==0)for(let v in C.stepStates){let F=C.stepStates[v];y.push({foreignUserId:C.foreignUserId,flowSlug:C.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...y,...n]}return{addResponse:w,setFlowResponses:s,getFlowResponses:x}}import Bs from"swr";var vs=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Ro=e=>{let t=vs.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Es(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Es=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e}=Oe(),{flows:t,setFlows:o,userId:i,publicApiKey:r,customVariables:n,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:h}=Is(G),m={data:[]},{verifySDKInitiated:g}=gt(),{addResponse:w,getFlowResponses:x}=At(),y=f=>fetch(f,e).then(S=>S.ok?S.json():(console.log(`Error fetching ${f} (${S.status}): ${S.statusText}. .Will gracefully degrade and hide Frigade`),h(!0),m)).catch(S=>(console.log(`Error fetching ${f}: ${S}. Will gracefully degrade and hide Frigade`),h(!0),m)),{userFlowStatesData:C,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:c,optimisticallyMarkStepStarted:u}=Te(),{data:b,error:I,isLoading:$}=Bs(r?`${ge}flows`:null,y,{keepPreviousData:!0});As(()=>{if(I){console.error(I);return}b&&b.data&&(b.data=o(b.data))},[b,I]);function U(f){if($)return null;let S=t.find(P=>P.slug===f);return!S&&t.length>0&&!v&&!$?(console.log(`Flow with slug ${f} not found`),null):(S==null?void 0:S.active)===!1?null:S}function H(f){var E;if(!U(f))return[];let S=U(f).data;return S?(S=L(S),(((E=JSON.parse(S))==null?void 0:E.data)??[]).map(K=>{let tt=_e(K);return{handleSecondaryButtonClick:()=>{K.skippable===!0&&q(f,K.id,{skipped:!0})},...K,complete:B(f,K.id)===Fe||tt>=1,blocked:re(f,K.id),hidden:Ue(f,K.id),handlePrimaryButtonClick:()=>{(!K.completionCriteria&&(K.autoMarkCompleted||K.autoMarkCompleted===void 0)||K.completionCriteria&&K.autoMarkCompleted===!0)&&q(f,K.id)},progress:tt}}).filter(K=>K.hidden!==!0)):[]}function L(f){return f.replace(/\${(.*?)}/g,(S,P)=>n[P]!==void 0?String(n[P]):"")}function W(f){if(!U(f))return[];let S=U(f).data;return S?(S=L(S),JSON.parse(S)??{}):[]}function D(f,S){s(P=>({...P,[f]:S}))}function V(f){!v&&!$&&f&&JSON.stringify(n)!=JSON.stringify({...n,...f})&&Object.keys(f).forEach(S=>{D(S,f[S])})}let j=rt(async(f,S,P)=>{g();let E={foreignUserId:i,flowSlug:f,stepId:S,actionType:Yt,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};X(E)&&(await u(f,S,E),w(E))},[i,C]),z=rt(async(f,S,P)=>{g();let E={foreignUserId:i,flowSlug:f,stepId:S,actionType:be,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};X(E)&&(await c(f,S),w(E))},[i,C]),q=rt(async(f,S,P)=>{g();let E={foreignUserId:i,flowSlug:f,stepId:S,actionType:Fe,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};X(E)&&(await k(f,S,E),w(E))},[i,C]),Q=rt(async(f,S)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Be,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};await A(f),X(P)&&w(P)},[i,C]),le=rt(async(f,S)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:ot,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};X(P)&&w(P)},[i,C]),O=rt(async(f,S)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Z,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};X(P)&&(await F(f),w(P))},[i,C]),fe=rt(async(f,S)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Kt,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};X(P)&&(await F(f),w(P))},[i,C]);function X(f){var S;if(!C&&f.actionType===be)return!1;if(C){let P=C.find(E=>E.flowId===f.flowSlug);if(f.actionType===be&&(!(P!=null&&P.stepStates[f.stepId])||P.stepStates[f.stepId].actionType===be)||P&&((S=P.stepStates[f.stepId])==null?void 0:S.actionType)===f.actionType)return!1}return!0}function B(f,S){let P=xe(f,S);return v?null:P?P.actionType:be}function re(f,S){let P=xe(f,S);return P?P.blocked:!1}function Ue(f,S){let P=xe(f,S);return P?P.hidden:!1}function xe(f,S){if(v)return null;let P=C==null?void 0:C.find(E=>E.flowId===f);return!P||!P.stepStates[S]?null:P.stepStates[S]??null}function Se(f){var P;if(v||!C)return null;if(We(f)===Be)return H(f)[0]??null;let S=(P=C.find(E=>E.flowId===f))==null?void 0:P.lastStepId;return S?H(f).find(E=>E.id===S):null}function ce(f){let S=Se(f);if(!S)return 0;let P=H(f).findIndex(E=>E.id===S.id)??0;return B(f,S.id)===Fe&&P<H(f).length-1?P+1:P}function _e(f){if(!f.completionCriteria)return;let S=Ro(f.completionCriteria);if(S===null)return;let P=et(S),E=_(S);return E===0?void 0:P/E}function We(f){let S=C==null?void 0:C.find(P=>P.flowId===f);return S?S.flowState:null}function et(f){let S=H(f);return S.length===0?0:S.filter(E=>B(f,E.id)===Fe).length}function _(f){return H(f).length}function Ie(f){return JSON.parse(t.find(S=>S.slug===f).data)}function Ae(f){if(v)return!0;if(f!=null&&f.targetingLogic&&C){let S=C.find(P=>P.flowId===f.slug);if(S)return S.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&i&&i.startsWith("guest_"))}function bo(f){return!Ae(U(f))}return{getFlow:U,getFlowData:Ie,isLoading:v||$,getStepStatus:B,getFlowSteps:H,getCurrentStepIndex:ce,markStepStarted:j,markStepCompleted:q,markFlowNotStarted:Q,markFlowStarted:le,markFlowCompleted:O,markFlowAborted:fe,markStepNotStarted:z,getFlowStatus:We,getNumberOfStepsCompleted:et,getNumberOfSteps:_,targetingLogicShouldHideFlow:Ae,setCustomVariable:D,updateCustomVariables:V,customVariables:n,getStepOptionalProgress:_e,getFlowMetadata:W,isStepBlocked:re,isStepHidden:Ue,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:bo}}import{useCallback as er,useContext as Os,useEffect as Ls}from"react";var ht="guest_";function wo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Os(G),{config:n}=Oe(),{mutateUserFlowState:s}=Te(),p=ft(),{verifySDKInitiated:d}=gt();Ls(()=>{if(e&&!t){if(e.startsWith(ht))return;let m=`frigade-user-registered-${e}`;localStorage.getItem(m)||(p(`${ge}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(m,"true"))}},[e,r,t]);let l=er(async m=>{d();let g={foreignId:e,properties:m};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(g)}),i(w=>({...w,...m})),s()},[e,n,r,s]),h=er(async(m,g)=>{d();let x={foreignId:e,events:[{event:m,properties:g}]};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(x)}),s()},[e,n,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:h}}import{v4 as ra}from"uuid";import Le,{useEffect as Zl,useState as Rl}from"react";import He,{useEffect as _s}from"react";import Jt from"styled-components";import Ns from"react";import Ds from"styled-components";var tr="fr-",Bt="cfr-";function a(e,t){let o=`${tr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Bt+e}return o}function T(e){if(!e.className||e.className.indexOf(Bt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(tr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Fo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function it(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Fo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function or(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ms=Ds.div`
2
+ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import{ThemeProvider as sa}from"styled-components";import lt,{useContext as ra,useEffect as lo,useState as $o}from"react";import{useCallback as rt,useContext as Bs,useEffect as As}from"react";import wo,{useMemo as ys}from"react";var Qo="1.32.23 ";var ge="https://api.frigade.com/v1/public/",be="NOT_STARTED_STEP",R="COMPLETED_FLOW",Yt="ABORTED_FLOW",ot="STARTED_FLOW",Ae="NOT_STARTED_FLOW",Fe="COMPLETED_STEP",Xt="STARTED_STEP";function Ne(){let{publicApiKey:e,userId:t}=wo.useContext(G);return{config:ys(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Qo,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function ft(){let{shouldGracefullyDegrade:e}=wo.useContext(G);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),Kt();let n;try{n=await fetch(t,o)}catch(i){return Kt(i)}return n?n.ok?n:Kt(n.statusText):Kt()}}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=wo.useContext(G);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as vs,useState as Zo}from"react";import{useContext as ws,useEffect as Ts,useState as Fs}from"react";import ks from"swr";import{useContext as bs}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o}=bs(G);function n(p,d=!1){return e[p]??d}function i(p,d){t(l=>({...l,[p]:d}))}function r(p){t(d=>{let{[p]:l,...f}=d;return{...f}})}function s(){return Object.values(e).some(p=>p)||o}return{getOpenFlowState:n,setOpenFlowState:i,resetOpenFlowState:r,hasOpenModals:s}}var Ps="unknown";function we(){let{config:e}=Ne(),{publicApiKey:t,userId:o,flows:n,setShouldGracefullyDegrade:i}=ws(G),{resetOpenFlowState:r}=ke(),[s,p]=Fs(!1),d={data:n.map(k=>({flowId:k.id,flowState:R,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=k=>fetch(k,e).then(c=>{if(c.ok)return c.json();throw new Error("Failed to fetch user flow states")}).catch(c=>(console.log(`Error fetching ${k}: ${c}. Will gracefully degrade and hide Frigade`),i(!0),d)),{data:f,isLoading:u,mutate:g,error:F}=ks(t&&n&&o?`${ge}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),b=f==null?void 0:f.data;Ts(()=>{!s&&!u&&b&&p(!0)},[b,s,u]);async function C(k){if(b){let c=b.find(h=>h.flowId===k);c&&c.flowState!==R&&(c.flowState=R),await g(Promise.resolve({...f,data:b}),{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}async function m(k,c,h){if(b){let y=b.find(E=>E.flowId===k);y&&(y.stepStates[c]=h,y.flowState=ot),await g(Promise.resolve({...f,data:b}),{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}async function v(k,c,h){if(b){let y=b.find(E=>E.flowId===k);y&&(y.lastStepId=c,y.stepStates[c]=h,y.flowState=ot),await g({...f,data:b},{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}async function w(k){if(b){let c=b.find(h=>h.flowId===k);c&&c.flowState!==Ae&&(c.flowState=Ae,c.lastStepId=Ps,Object.keys(c.stepStates).forEach(h=>{c.stepStates[h].actionType=be,c.stepStates[h].createdAt=new Date().toISOString()}),await g({...f,data:b},{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1}),r(k))}}async function B(k,c){if(b){let h=b.find(y=>y.flowId===k);h&&h.stepStates[c]!==be&&(h.stepStates[c]=be),await g({...f,data:b},{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:b,isLoadingUserFlowStateData:!s,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowNotStarted:w,optimisticallyMarkStepCompleted:m,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:v,error:F}}function At(){let{config:e}=Ne(),{userFlowStatesData:t,mutateUserFlowState:o}=we(),{failedFlowResponses:n,setFailedFlowResponses:i,flowResponses:r,setFlowResponses:s}=vs(G),[p,d]=Zo(new Set),[l,f]=Zo(new Set),u=ft();function g(C){let m=JSON.stringify(C);if(p.has(m))return null;p.add(m),d(p),l.add(C),f(l);let v=r==null?void 0:r.find(w=>w.flowSlug===C.flowSlug&&w.stepId===C.stepId&&w.actionType===C.actionType&&w.createdAt===C.createdAt);return u(`${ge}flowResponses`,{...e,method:"POST",body:m}).then(w=>{w.status!==200&&w.status!==201?(console.log("Failed to send flow response for step "+C.stepId+". Will retry again later."),i([...n,C])):v||s(B=>[...B??[],C])})}async function F(C){C.foreignUserId&&(C.actionType===ot||C.actionType===Ae?await g(C):C.actionType===R?await g(C):C.actionType===Xt?await g(C):C.actionType===Fe?await g(C):C.actionType===Yt?await g(C):C.actionType===be&&await g(C))}function b(){let C=[];return t==null||t.forEach(m=>{if(m&&m.stepStates&&Object.keys(m.stepStates).length!==0)for(let v in m.stepStates){let w=m.stepStates[v];C.push({foreignUserId:m.foreignUserId,flowSlug:m.flowId,stepId:w.stepId,actionType:w.actionType,data:{},createdAt:new Date(w.createdAt),blocked:w.blocked,hidden:w.hidden})}}),[...C,...r]}return{addResponse:F,setFlowResponses:s,getFlowResponses:b}}import Ns from"swr";var Is=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Ro=e=>{let t=Is.exec(e);if(t===null)return null;let o=null;return t.forEach((n,i)=>{let r=Es(n,"'","");r.startsWith("flow_")&&(o=r)}),o},Es=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Ne(),{flows:t,setFlows:o,userId:n,publicApiKey:i,customVariables:r,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:f}=Bs(G),u={data:[]},{verifySDKInitiated:g}=gt(),{addResponse:F,getFlowResponses:b}=At(),C=x=>fetch(x,e).then(S=>S.ok?S.json():(console.log(`Error fetching ${x} (${S.status}): ${S.statusText}. .Will gracefully degrade and hide Frigade`),f(!0),u)).catch(S=>(console.log(`Error fetching ${x}: ${S}. Will gracefully degrade and hide Frigade`),f(!0),u)),{userFlowStatesData:m,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:c,optimisticallyMarkStepStarted:h}=we(),{data:y,error:E,isLoading:U}=Ns(i?`${ge}flows`:null,C,{keepPreviousData:!0});As(()=>{if(E){console.error(E);return}y&&y.data&&(y.data=o(y.data))},[y,E]);function M(x){if(U)return null;let S=t.find(P=>P.slug===x);return!S&&t.length>0&&!v&&!U?(console.log(`Flow with slug ${x} not found`),null):(S==null?void 0:S.active)===!1?null:S}function _(x){var I;if(!M(x))return[];let S=M(x).data;return S?(S=O(S),(((I=JSON.parse(S))==null?void 0:I.data)??[]).map(Y=>{let tt=_e(Y);return{handleSecondaryButtonClick:()=>{Y.skippable===!0&&z(x,Y.id,{skipped:!0})},...Y,complete:A(x,Y.id)===Fe||tt>=1,blocked:q(x,Y.id),hidden:Ue(x,Y.id),handlePrimaryButtonClick:()=>{(!Y.completionCriteria&&(Y.autoMarkCompleted||Y.autoMarkCompleted===void 0)||Y.completionCriteria&&Y.autoMarkCompleted===!0)&&z(x,Y.id)},progress:tt}}).filter(Y=>Y.hidden!==!0)):[]}function O(x){return x.replace(/\${(.*?)}/g,(S,P)=>r[P]!==void 0?String(r[P]):"")}function H(x){if(!M(x))return[];let S=M(x).data;return S?(S=O(S),JSON.parse(S)??{}):[]}function N(x,S){s(P=>({...P,[x]:S}))}function j(x){!v&&!U&&x&&JSON.stringify(r)!=JSON.stringify({...r,...x})&&Object.keys(x).forEach(S=>{N(S,x[S])})}let K=rt(async(x,S,P)=>{g();let I={foreignUserId:n,flowSlug:x,stepId:S,actionType:Xt,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(I)&&(await h(x,S,I),F(I))},[n,m]),V=rt(async(x,S,P)=>{g();let I={foreignUserId:n,flowSlug:x,stepId:S,actionType:be,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(I)&&(await c(x,S),F(I))},[n,m]),z=rt(async(x,S,P)=>{g();let I={foreignUserId:n,flowSlug:x,stepId:S,actionType:Fe,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(I)&&(await k(x,S,I),F(I))},[n,m]),te=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:Ae,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};await B(x),J(P)&&F(P)},[n,m]),oe=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:ot,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&F(P)},[n,m]),Z=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:R,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await w(x),F(P))},[n,m]),$=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:Yt,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await w(x),F(P))},[n,m]);function J(x){var S;if(!m&&x.actionType===be)return!1;if(m){let P=m.find(I=>I.flowId===x.flowSlug);if(x.actionType===be&&(!(P!=null&&P.stepStates[x.stepId])||P.stepStates[x.stepId].actionType===be)||P&&((S=P.stepStates[x.stepId])==null?void 0:S.actionType)===x.actionType)return!1}return!0}function A(x,S){let P=xe(x,S);return v?null:P?P.actionType:be}function q(x,S){let P=xe(x,S);return P?P.blocked:!1}function Ue(x,S){let P=xe(x,S);return P?P.hidden:!1}function xe(x,S){if(v)return null;let P=m==null?void 0:m.find(I=>I.flowId===x);return!P||!P.stepStates[S]?null:P.stepStates[S]??null}function ye(x){var P;if(v||!m)return null;if(We(x)===Ae)return _(x)[0]??null;let S=(P=m.find(I=>I.flowId===x))==null?void 0:P.lastStepId;return S?_(x).find(I=>I.id===S):null}function me(x){let S=ye(x);if(!S)return 0;let P=_(x).findIndex(I=>I.id===S.id)??0;return A(x,S.id)===Fe&&P<_(x).length-1?P+1:P}function _e(x){if(!x.completionCriteria)return;let S=Ro(x.completionCriteria);if(S===null)return;let P=et(S),I=W(S);return I===0?void 0:P/I}function We(x){let S=m==null?void 0:m.find(P=>P.flowId===x);return S?S.flowState:null}function et(x){let S=_(x);return S.length===0?0:S.filter(I=>A(x,I.id)===Fe).length}function W(x){return _(x).length}function Ee(x){return JSON.parse(t.find(S=>S.slug===x).data)}function Be(x){if(v)return!0;if(x!=null&&x.targetingLogic&&m){let S=m.find(P=>P.flowId===x.slug);if(S)return S.shouldTrigger===!1}return!!(x!=null&&x.targetingLogic&&n&&n.startsWith("guest_"))}function bo(x){return!Be(M(x))}return{getFlow:M,getFlowData:Ee,isLoading:v||U,getStepStatus:A,getFlowSteps:_,getCurrentStepIndex:me,markStepStarted:K,markStepCompleted:z,markFlowNotStarted:te,markFlowStarted:oe,markFlowCompleted:Z,markFlowAborted:$,markStepNotStarted:V,getFlowStatus:We,getNumberOfStepsCompleted:et,getNumberOfSteps:W,targetingLogicShouldHideFlow:Be,setCustomVariable:N,updateCustomVariables:j,customVariables:r,getStepOptionalProgress:_e,getFlowMetadata:H,isStepBlocked:q,isStepHidden:Ue,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:bo}}import{useCallback as er,useContext as Os,useEffect as Ls}from"react";var ht="guest_";function To(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:i}=Os(G),{config:r}=Ne(),{mutateUserFlowState:s}=we(),p=ft(),{verifySDKInitiated:d}=gt();Ls(()=>{if(e&&!t){if(e.startsWith(ht))return;let u=`frigade-user-registered-${e}`;localStorage.getItem(u)||(p(`${ge}users`,{...r,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(u,"true"))}},[e,i,t]);let l=er(async u=>{d();let g={foreignId:e,properties:u};await p(`${ge}users`,{...r,method:"POST",body:JSON.stringify(g)}),n(F=>({...F,...u})),s()},[e,r,i,s]),f=er(async(u,g)=>{d();let b={foreignId:e,events:[{event:u,properties:g}]};await p(`${ge}users`,{...r,method:"POST",body:JSON.stringify(b)}),s()},[e,r,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:f}}import{v4 as ia}from"uuid";import Oe,{useEffect as Rl,useState as ea}from"react";import He,{useEffect as Ws}from"react";import Qt from"styled-components";import Ds from"react";import Ms from"styled-components";var tr="fr-",Nt="cfr-";function a(e,t){let o=`${tr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Nt+e}return o}function T(e){if(!e.className||e.className.indexOf(Nt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(tr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Fo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function it(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Fo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function or(e){return e.charAt(0).toUpperCase()+e.slice(1)}var $s=Ms.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -23,11 +23,11 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
23
23
  opacity: 1;
24
24
  }
25
25
  }
26
- `,rr=({onClose:e,appearance:t})=>Ns.createElement(Ms,{className:a("modalBackground",t),onClick:()=>e()});import Xt from"react";import $s from"styled-components";var Us=$s.div`
26
+ `,rr=({onClose:e,appearance:t})=>Ds.createElement($s,{className:a("modalBackground",t),onClick:()=>e()});import Jt from"react";import Us from"styled-components";var _s=Us.div`
27
27
  :hover {
28
28
  opacity: 0.8;
29
29
  }
30
- `,Pe=()=>Xt.createElement(Us,null,Xt.createElement("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Xt.createElement("rect",{y:"1.39844",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(-45 0 1.39844)",fill:"currentColor"}),Xt.createElement("rect",{x:"12.6023",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(45 12.6023 0)",fill:"currentColor"})));import{Portal as Ws}from"react-portal";var Hs=Jt.div`
30
+ `,Pe=()=>Jt.createElement(_s,null,Jt.createElement("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jt.createElement("rect",{y:"1.39844",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(-45 0 1.39844)",fill:"currentColor"}),Jt.createElement("rect",{x:"12.6023",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(45 12.6023 0)",fill:"currentColor"})));import{Portal as Hs}from"react-portal";var zs=Qt.div`
31
31
  ${e=>T(e)} {
32
32
  // Anything inside this block will be ignored if the user provides a custom class
33
33
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -71,10 +71,10 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
71
71
  opacity: 1;
72
72
  }
73
73
  }
74
- `,zs=Jt.div`
74
+ `,Gs=Qt.div`
75
75
  position: relative;
76
76
  flex: 0 1 auto;
77
- `,Gs=Jt.div`
77
+ `,js=Qt.div`
78
78
  position: absolute;
79
79
  top: 24px;
80
80
  right: 24px;
@@ -84,14 +84,14 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
84
84
  // Anything inside this block will be ignored if the user provides a custom class
85
85
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
86
86
  }
87
- `,js=Jt.div`
87
+ `,Vs=Qt.div`
88
88
  overflow: scroll;
89
89
  flex: 1 1;
90
90
  display: flex;
91
91
  ::-webkit-scrollbar {
92
92
  display: none;
93
93
  }
94
- `,Ye=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0})=>(_s(()=>{let p=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?He.createElement(Ws,null,He.createElement(rr,{appearance:n,onClose:()=>{s&&e()}}),He.createElement(Hs,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&He.createElement(Gs,{className:a("modalClose",n),onClick:()=>e(),appearance:n},He.createElement(Pe,null)),o&&He.createElement(zs,null,o),He.createElement(js,null,r))):He.createElement(He.Fragment,null));import Xe,{useEffect as Vs}from"react";import Qt from"styled-components";import{Portal as qs}from"react-portal";var Ks=Qt.div`
94
+ `,Ye=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:i,appearance:r,dismissible:s=!0})=>(Ws(()=>{let p=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?He.createElement(Hs,null,He.createElement(rr,{appearance:r,onClose:()=>{s&&e()}}),He.createElement(zs,{appearance:r,className:a("modalContainer",r),styleOverrides:n},s&&He.createElement(js,{className:a("modalClose",r),onClick:()=>e(),appearance:r},He.createElement(Pe,null)),o&&He.createElement(Gs,null,o),He.createElement(Vs,null,i))):He.createElement(He.Fragment,null));import Xe,{useEffect as qs}from"react";import Zt from"styled-components";import{Portal as Ks}from"react-portal";var Ys=Zt.div`
95
95
  ${e=>T(e)} {
96
96
  // Anything inside this block will be ignored if the user provides a custom class
97
97
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -109,10 +109,10 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
109
109
  bottom: 0;
110
110
  margin-right: 28px;
111
111
  margin-bottom: 28px;
112
- `,Ys=Qt.div`
112
+ `,Xs=Zt.div`
113
113
  position: relative;
114
114
  flex: 1;
115
- `,Xs=Qt.div`
115
+ `,Js=Zt.div`
116
116
  position: absolute;
117
117
  top: 24px;
118
118
  right: 24px;
@@ -122,13 +122,13 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
122
122
  // Anything inside this block will be ignored if the user provides a custom class
123
123
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
124
124
  }
125
- `,Js=Qt.div`
125
+ `,Qs=Zt.div`
126
126
  overflow: scroll;
127
127
  flex: 5;
128
128
  ::-webkit-scrollbar {
129
129
  display: none;
130
130
  }
131
- `,ir=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r})=>(Vs(()=>{let n=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",n),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",n)}},[e,t]),t?Xe.createElement(qs,null,Xe.createElement(Ks,{appearance:r,className:a("cornerModalContainer",r)},Xe.createElement(Xs,{className:a("cornerModalClose",r),onClick:()=>e()},Xe.createElement(Pe,null)),o&&Xe.createElement(Ys,null,o),Xe.createElement(Js,null,i))):Xe.createElement(Xe.Fragment,null));import{useContext as Qs}from"react";function J(){let{defaultAppearance:e}=Qs(G);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import eo,{useEffect as al,useState as yr}from"react";import Sr from"styled-components";import vo,{useEffect as Zs,useState as ar}from"react";import Eo from"styled-components";import ko from"styled-components";var nr=ko.label`
131
+ `,ir=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:i})=>(qs(()=>{let r=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",r),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",r)}},[e,t]),t?Xe.createElement(Ks,null,Xe.createElement(Ys,{appearance:i,className:a("cornerModalContainer",i)},Xe.createElement(Js,{className:a("cornerModalClose",i),onClick:()=>e()},Xe.createElement(Pe,null)),o&&Xe.createElement(Xs,null,o),Xe.createElement(Qs,null,n))):Xe.createElement(Xe.Fragment,null));import{useContext as Zs}from"react";function Q(){let{defaultAppearance:e}=Zs(G);function t(o){let n=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(n.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(n.theme,o.theme??{})}:n}return{mergeAppearanceWithDefault:t}}import to,{useEffect as pl,useState as Sr}from"react";import yr from"styled-components";import vo,{useEffect as Rs,useState as ar}from"react";import Io from"styled-components";import ko from"styled-components";var nr=ko.label`
132
132
  ${e=>T(e)} {
133
133
  font-size: 14px;
134
134
  line-height: 20px;
@@ -149,11 +149,11 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
149
149
  align-items: flex-start;
150
150
  justify-content: left;
151
151
  margin-bottom: 10px;
152
- `;import Po from"react";function nt({title:e,required:t,appearance:o}){return Po.createElement(lr,null,t?Po.createElement(sr,null,"*"):null,Po.createElement(nr,{className:a("formLabel",o)},e))}var Rs=Eo.div`
152
+ `;import Po from"react";function nt({title:e,required:t,appearance:o}){return Po.createElement(lr,null,t?Po.createElement(sr,null,"*"):null,Po.createElement(nr,{className:a("formLabel",o)},e))}var el=Io.div`
153
153
  display: flex;
154
154
  flex-direction: column;
155
155
  width: 100%;
156
- `,Io=Eo.input`
156
+ `,Eo=Io.input`
157
157
  ${e=>T(e)} {
158
158
  // Anything inside this block will be ignored if the user provides a custom class
159
159
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -169,7 +169,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
169
169
  box-sizing: border-box;
170
170
  padding: 0 10px;
171
171
  margin-bottom: 10px;
172
- `,el=Eo.textarea`
172
+ `,tl=Io.textarea`
173
173
  ${e=>T(e)} {
174
174
  // Anything inside this block will be ignored if the user provides a custom class
175
175
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -185,13 +185,13 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
185
185
  min-height: 70px;
186
186
  box-sizing: border-box;
187
187
  margin-bottom: 10px;
188
- `;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i}){let r=e,[n,s]=ar(""),[p,d]=ar(!1),l=Io;Zs(()=>{n===""&&!p&&(d(!0),h(""))},[]);function h(m){if(s(m),r.required===!0&&m.trim()===""){i([{id:r.id,message:`${r.title} is required`}]);return}i([]),o({text:m})}return r.multiline&&(l=el),vo.createElement(Rs,null,vo.createElement(nt,{title:r.title,required:r.required,appearance:t.appearance}),vo.createElement(l,{className:a("inputComponent",t.appearance),value:n,onChange:m=>{h(m.target.value)},appearance:t.appearance,placeholder:r.placeholder}))}import ze,{useEffect as dr,useState as cr}from"react";import mr from"styled-components";var tl=mr.div`
188
+ `;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:i}){let r=e,[s,p]=ar((i==null?void 0:i.text)||""),[d,l]=ar(!1),f=Eo;Rs(()=>{s===""&&!d&&(l(!0),u(""))},[]);function u(g){if(p(g),r.required===!0&&g.trim()===""){n([{id:r.id,message:`${r.title} is required`}]);return}n([]),o({text:g})}return r.multiline&&(f=tl),vo.createElement(el,null,vo.createElement(nt,{title:r.title,required:r.required,appearance:t.appearance}),vo.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:g=>{u(g.target.value)},appearance:t.appearance,placeholder:r.placeholder}))}import ze,{useEffect as dr,useState as cr}from"react";import mr from"styled-components";var ol=mr.div`
189
189
  display: flex;
190
190
  flex-direction: column;
191
191
  width: 100%;
192
192
  -webkit-appearance: none;
193
193
  appearance: none;
194
- `,ol=mr.select`
194
+ `,rl=mr.select`
195
195
  ${e=>T(e)} {
196
196
  // Anything inside this block will be ignored if the user provides a custom class
197
197
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -215,13 +215,13 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
215
215
  background-repeat: no-repeat;
216
216
  background-size: 1.5em 1.5em;
217
217
  -webkit-print-color-adjust: exact;
218
- `,Zt="null";function ur({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i}){var l,h,m,g,w;let r=e,[n,s]=cr(""),[p,d]=cr(!1);return dr(()=>{var x,y,C,v;if(n===""&&!p){if(d(!0),r.requireSelection){s(Zt);return}if(r.defaultValue&&((x=r.props.options)!=null&&x.find(F=>F.id===r.defaultValue))){let F=(y=r.props.options)==null?void 0:y.find(A=>A.id===r.defaultValue);s(F.id),o({choice:[F.id]})}else s(((C=r.props.options)==null?void 0:C[0].id)||""),o({choice:[((v=r.props.options)==null?void 0:v[0].id)||""]})}},[]),dr(()=>{r.requireSelection&&n===Zt?i([{message:"Please select an option",id:r.id}]):i([])},[n]),ze.createElement(tl,null,ze.createElement(nt,{title:r.title,required:!1,appearance:t.appearance}),ze.createElement(ol,{value:n,onChange:x=>{s(x.target.value),o({choice:[x.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&ze.createElement("option",{key:Zt,value:Zt},"Select an option"),(l=r.props.options)==null?void 0:l.map(x=>ze.createElement("option",{key:x.id,value:x.id},x.title))),((m=(h=r.props.options)==null?void 0:h.find(x=>x.id===n))==null?void 0:m.isOpenEnded)&&ze.createElement(ze.Fragment,null,ze.createElement(nt,{title:((w=(g=r.props.options)==null?void 0:g.find(x=>x.id===n))==null?void 0:w.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),ze.createElement(Io,{type:"text",placeholder:"Enter your answer here",onChange:x=>{o({choice:[x.target.value]})},appearance:t.appearance})))}import Ao,{useEffect as fr,useState as gr}from"react";import hr from"styled-components";var rl=hr.div`
218
+ `,Rt="null";function ur({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:i}){var f,u,g,F,b,C;let r=e,[s,p]=cr(((f=n==null?void 0:n.choice)==null?void 0:f[0])||""),[d,l]=cr(!1);return dr(()=>{var m,v,w,B;if(s===""&&!d){if(l(!0),r.requireSelection){p(Rt);return}if(r.defaultValue&&((m=r.props.options)!=null&&m.find(k=>k.id===r.defaultValue))){let k=(v=r.props.options)==null?void 0:v.find(c=>c.id===r.defaultValue);p(k.id),o({choice:[k.id]})}else p(((w=r.props.options)==null?void 0:w[0].id)||""),o({choice:[((B=r.props.options)==null?void 0:B[0].id)||""]})}},[]),dr(()=>{r.requireSelection&&s===Rt?i([{message:"Please select an option",id:r.id}]):i([])},[s]),ze.createElement(ol,null,ze.createElement(nt,{title:r.title,required:!1,appearance:t.appearance}),ze.createElement(rl,{value:s,onChange:m=>{p(m.target.value),o({choice:[m.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&ze.createElement("option",{key:Rt,value:Rt},"Select an option"),(u=r.props.options)==null?void 0:u.map(m=>ze.createElement("option",{key:m.id,value:m.id},m.title))),((F=(g=r.props.options)==null?void 0:g.find(m=>m.id===s))==null?void 0:F.isOpenEnded)&&ze.createElement(ze.Fragment,null,ze.createElement(nt,{title:((C=(b=r.props.options)==null?void 0:b.find(m=>m.id===s))==null?void 0:C.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),ze.createElement(Eo,{type:"text",placeholder:"Enter your answer here",onChange:m=>{o({choice:[m.target.value]})},appearance:t.appearance})))}import Bo,{useEffect as fr,useState as gr}from"react";import hr from"styled-components";var il=hr.div`
219
219
  display: flex;
220
220
  flex-direction: column;
221
221
  width: 100%;
222
222
  -webkit-appearance: none;
223
223
  appearance: none;
224
- `,il=hr.button`
224
+ `,nl=hr.button`
225
225
  ${e=>T(e)} {
226
226
  // Anything inside this block will be ignored if the user provides a custom class
227
227
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -243,7 +243,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
243
243
  height: 60px;
244
244
  padding: 0 18px;
245
245
  margin-bottom: 10px;
246
- `;function xr({formInput:e,customFormTypeProps:t,onSaveInputData:o}){var d;let i=e,[r,n]=gr([]),[s,p]=gr(!1);return fr(()=>{r.length==0&&!s&&(p(!0),o({choice:[]}))},[]),fr(()=>{o({choice:r})},[r]),Ao.createElement(rl,null,Ao.createElement(nt,{title:i.title,required:i.required,appearance:t.appearance}),(d=i.props.options)==null?void 0:d.map(l=>Ao.createElement(il,{appearance:t.appearance,key:l.id,value:l.id,"data-selected":r.includes(l.id),onClick:()=>{if(r.includes(l.id)){n(r.filter(h=>h!==l.id));return}r.length<i.props.maxChoices?n([...r,l.id]):r.length==1&&i.props.maxChoices==1&&n([l.id])}},l.title)))}import Rt from"react";import Cr from"styled-components";import nl from"dompurify";function ie(e){return{__html:nl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var sl=Cr.h1`
246
+ `;function xr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n}){var l;let i=e,[r,s]=gr(n.choice||[]),[p,d]=gr(!1);return fr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[]),fr(()=>{o({choice:r})},[r]),Bo.createElement(il,null,Bo.createElement(nt,{title:i.title,required:i.required,appearance:t.appearance}),(l=i.props.options)==null?void 0:l.map(f=>Bo.createElement(nl,{appearance:t.appearance,key:f.id,value:f.id,"data-selected":r.includes(f.id),onClick:()=>{if(r.includes(f.id)){s(r.filter(u=>u!==f.id));return}r.length<i.props.maxChoices?s([...r,f.id]):r.length==1&&i.props.maxChoices==1&&s([f.id])}},f.title)))}import eo from"react";import Cr from"styled-components";import sl from"dompurify";function se(e){return{__html:sl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var ll=Cr.h1`
247
247
  ${e=>T(e)} {
248
248
  font-style: normal;
249
249
  font-weight: 600;
@@ -254,7 +254,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
254
254
  margin-bottom: 4px;
255
255
  color: ${e=>e.appearance.theme.colorText};
256
256
  }
257
- `,ll=Cr.h2`
257
+ `,al=Cr.h2`
258
258
  ${e=>T(e)} {
259
259
  font-style: normal;
260
260
  font-weight: 400;
@@ -262,24 +262,28 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
262
262
  line-height: 20px;
263
263
  color: ${e=>e.appearance.theme.colorTextSecondary};
264
264
  }
265
- `;function we({appearance:e,title:t,subtitle:o,size:i="medium"}){return Rt.createElement(Rt.Fragment,null,Rt.createElement(sl,{appearance:e,className:a(`${i}Title`,e),dangerouslySetInnerHTML:ie(t),size:i}),Rt.createElement(ll,{appearance:e,className:a(`${i}Subtitle`,e),dangerouslySetInnerHTML:ie(o),size:i}))}var pl=Sr.div`
265
+ `;function Te({appearance:e,title:t,subtitle:o,size:n="medium"}){return eo.createElement(eo.Fragment,null,eo.createElement(ll,{appearance:e,className:a(`${n}Title`,e),dangerouslySetInnerHTML:se(t),size:n}),eo.createElement(al,{appearance:e,className:a(`${n}Subtitle`,e),dangerouslySetInnerHTML:se(o),size:n}))}var dl=yr.div`
266
266
  display: flex;
267
267
  flex-direction: column;
268
268
  justify-content: flex-end;
269
269
  padding-bottom: 14px;
270
270
  overflow: visible;
271
- `,dl=Sr.div`
271
+ `,cl=yr.div`
272
272
  padding-left: 1px;
273
273
  padding-right: 1px;
274
- `,cl={text:pr,multipleChoice:ur,multipleChoiceList:xr};function br({stepData:e,canContinue:t,setCanContinue:o,onSaveData:i,appearance:r,customFormElements:n}){var w;let s=e.props,[p,d]=yr({}),[l,h]=yr([]),m={...cl,...n};al(()=>{o(l.length===0)},[l,o]);function g(x,y){let C={...p,[x.id]:y};d(C),i(C)}return eo.createElement(dl,{className:a("multiInput",r)},eo.createElement(we,{appearance:r,title:e.title,subtitle:e.subtitle}),eo.createElement(pl,{className:a("multiInputContainer",r)},(w=s.data)==null?void 0:w.map(x=>m[x.type]?eo.createElement("span",{key:x.id},m[x.type]({formInput:x,customFormTypeProps:{stepData:e,canContinue:t,setCanContinue:o,onSaveData:i,appearance:r},onSaveInputData:y=>{g(x,y)},setFormValidationErrors:y=>{h(C=>y.length===0?C.filter(v=>v.id!==x.id):[...C,...y])}})):null)))}import Ot from"styled-components";var Tr=Ot.div`
275
- align-content: flex-end;
276
- text-align: right;
274
+ `,ml={text:pr,multipleChoice:ur,multipleChoiceList:xr};function br({stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:i,customFormElements:r}){var C;let s=e.props,[p,d]=Sr(F()||{}),[l,f]=Sr([]),u={...ml,...r};pl(()=>{o(l.length===0)},[l,o]);function g(m,v){let w={...p,[m.id]:v};d(w),n(w),window&&window.localStorage&&window.localStorage.setItem(b(),JSON.stringify(w))}function F(){if(window&&window.localStorage){let m=window.localStorage.getItem(b());if(m)return JSON.parse(m)}return{}}function b(){return`frigade-multiInputStepTypeData-${e.id}`}return to.createElement(cl,{className:a("multiInput",i)},to.createElement(Te,{appearance:i,title:e.title,subtitle:e.subtitle}),to.createElement(dl,{className:a("multiInputContainer",i)},(C=s.data)==null?void 0:C.map(m=>u[m.type]?to.createElement("span",{key:m.id},u[m.type]({formInput:m,customFormTypeProps:{stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:i},onSaveInputData:v=>{g(m,v)},inputData:p[m.id],setFormValidationErrors:v=>{f(w=>v.length===0?w.filter(B=>B.id!==m.id):[...w,...v])}})):null)))}import xt from"styled-components";var wr=xt.div`
275
+ align-items: center;
276
+ display: flex;
277
+ justify-content: space-between;
277
278
  padding-top: 14px;
278
- `,wr=Ot.div`
279
+ `,Tr=xt.div`
280
+ display: flex;
281
+ gap: 12px;
282
+ `,Fr=xt.div`
279
283
  display: flex;
280
284
  flex-direction: row;
281
285
  flex: 1 1;
282
- `,Fr=Ot.div`
286
+ `,kr=xt.div`
283
287
  display: flex;
284
288
  // If type is set to large-modal, use padding 60px horizontal, 80px vertical
285
289
  // Otherwise, use 4px padding
@@ -287,11 +291,11 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
287
291
  flex-grow: 1;
288
292
  flex-basis: 0;
289
293
  position: relative;
290
- `,kr=Ot.div`
294
+ `,Pr=xt.div`
291
295
  padding: ${e=>e.type==="large-modal"?"50px":"0px"};
292
296
  position: relative;
293
297
  overflow-y: auto;
294
- `,Pr=Ot.div`
298
+ `,vr=xt.div`
295
299
  display: flex;
296
300
  align-self: stretch;
297
301
  flex-grow: 1;
@@ -303,7 +307,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
303
307
  background-position: center;
304
308
  border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
305
309
  border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
306
- `;import oo from"react";import ml from"react";import vr from"styled-components";var ul=vr.button`
310
+ `;import Ot from"react";import ul from"react";import Ir from"styled-components";var fl=Ir.button`
307
311
  justify-content: center;
308
312
  align-content: center;
309
313
  ${e=>T(e)} {
@@ -314,8 +318,8 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
314
318
  ${e=>e.withMargin?"margin: 16px 0px 16px 0px;":""}
315
319
 
316
320
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary}};
317
- color: ${e=>{var t,o,i,r;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary:(r=(i=e.appearance)==null?void 0:i.theme)==null?void 0:r.colorTextOnPrimaryBackground}};
318
- background-color: ${e=>{var t,o,i,r;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground:(r=(i=e==null?void 0:e.appearance)==null?void 0:i.theme)==null?void 0:r.colorPrimary}};
321
+ color: ${e=>{var t,o,n,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary:(i=(n=e.appearance)==null?void 0:n.theme)==null?void 0:i.colorTextOnPrimaryBackground}};
322
+ background-color: ${e=>{var t,o,n,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground:(i=(n=e==null?void 0:e.appearance)==null?void 0:n.theme)==null?void 0:i.colorPrimary}};
319
323
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
320
324
  padding: ${e=>e.size=="small"?"6px 14px 6px 14px":"8px 20px 8px 20px"};
321
325
  font-size: ${e=>e.size=="small"?"14px":"15px"};
@@ -333,7 +337,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
333
337
  opacity: 0.3;
334
338
  cursor: not-allowed;
335
339
  }
336
- `,to=vr.div`
340
+ `,oo=Ir.div`
337
341
  ${e=>T(e)} {
338
342
  display: flex;
339
343
  flex-direction: row;
@@ -343,14 +347,14 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
343
347
  margin-right: 8px;
344
348
  }
345
349
  }
346
- `,R=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l=""})=>{function h(){let m=s?"buttonSecondary":"button";return l===""?m:`${l}${or(m)}`}return ml.createElement(ul,{secondary:s,appearance:p,disabled:i,onClick:e,style:o,type:r,withMargin:d,size:n,className:a(h(),p)},t)};var Er=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,formType:n,selectedStep:s,steps:p,onBack:d})=>{let l=n==="inline"?"inline":"full-width";return oo.createElement(Tr,{className:a("formCTAContainer",o)},p.length>1&&s!=0&&oo.createElement(R,{title:"\u2190",onClick:d,secondary:!0,type:l,style:{display:"inline-block"},appearance:o}),e.secondaryButtonTitle?oo.createElement(R,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:l,appearance:o}):null," ",e.primaryButtonTitle?oo.createElement(R,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:l,appearance:o}):null)};import Bo from"react";import fl from"styled-components";var gl=fl.div`
350
+ `,ee=({onClick:e,title:t,style:o,disabled:n,type:i="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l=""})=>{function f(){let u=s?"buttonSecondary":"button";return l===""?u:`${l}${or(u)}`}return ul.createElement(fl,{secondary:s,appearance:p,disabled:n,onClick:e,style:o,type:i,withMargin:d,size:r,className:a(f(),p)},t)};var Er=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:i,formType:r,selectedStep:s,steps:p,onBack:d,allowBackNavigation:l})=>{let f=r==="inline"?"inline":"full-width";return Ot.createElement(wr,{className:a("formCTAContainer",o)},p.length>1&&s!=0&&l&&Ot.createElement(ee,{title:"\u2190",onClick:d,secondary:!0,withMargin:!1,type:f,appearance:o}),Ot.createElement(Tr,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?Ot.createElement(ee,{title:e.secondaryButtonTitle,onClick:i,secondary:!0,withMargin:!1,type:f,appearance:o}):null," ",e.primaryButtonTitle?Ot.createElement(ee,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:f,appearance:o}):null))};import Ao from"react";import gl from"styled-components";var hl=gl.div`
347
351
  text-align: center;
348
- `,Ir=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=J().mergeAppearanceWithDefault(i);return Bo.createElement(gl,{className:o},Bo.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>Bo.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import st from"react";import xt from"styled-components";import{useContext as hl}from"react";function ne(){let e=hl(G);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var xl=xt.div`
352
+ `,Br=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:i}=Q().mergeAppearanceWithDefault(n);return Ao.createElement(hl,{className:o},Ao.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Ao.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?i.colorPrimary:"#E6E6E6"}))))};import st from"react";import Ct from"styled-components";import{useContext as xl}from"react";function le(){let e=xl(G);function t(i){n(i.primaryButtonUri,i.primaryButtonUriTarget)}function o(i){n(i.secondaryButtonUri,i.secondaryButtonUriTarget)}function n(i,r){if(!i)return;let s=i.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(i,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:n}}var Cl=Ct.div`
349
353
  display: flex;
350
354
  flex-wrap: wrap;
351
355
  align-content: center;
352
356
  justify-content: center;
353
- `,Cl=xt.div`
357
+ `,Sl=Ct.div`
354
358
  align-content: center;
355
359
  align-items: center;
356
360
  display: flex;
@@ -364,10 +368,10 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
364
368
  flex-basis: 255px;
365
369
  flex-grow: 0;
366
370
  flex-shrink: 0;
367
- `,yl=xt.img`
371
+ `,yl=Ct.img`
368
372
  width: 78px;
369
373
  height: auto;
370
- `,Sl=xt.button`
374
+ `,bl=Ct.button`
371
375
  font-style: normal;
372
376
  font-weight: 600;
373
377
  font-size: 13px;
@@ -380,11 +384,11 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
380
384
  border-radius: 100px;
381
385
  padding: 8px 12px;
382
386
  margin-top: 16px;
383
- `,bl=xt.h1`
387
+ `,wl=Ct.h1`
384
388
  font-weight: 700;
385
389
  font-size: 28px;
386
390
  line-height: 34px;
387
- `,Tl=xt.h2`
391
+ `,Tl=Ct.h2`
388
392
  font-style: normal;
389
393
  font-weight: 400;
390
394
  font-size: 16px;
@@ -393,7 +397,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
393
397
  margin-top: 12px;
394
398
  margin-bottom: 16px;
395
399
  max-width: 70%;
396
- `;function Ar({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ne();return st.createElement("div",null,st.createElement(bl,null,e.title),st.createElement(Tl,null,e.subtitle),st.createElement(xl,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>st.createElement(Cl,{key:n.title},st.createElement(yl,{src:n.imageUri}),st.createElement(Sl,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import yt,{useEffect as Il}from"react";import no from"styled-components";import Oo from"react";var ro=({style:e,className:t})=>Oo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},Oo.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Oo.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Lt,{useRef as wl,useState as Fl}from"react";import io from"styled-components";var kl=io.div`
400
+ `;function Ar({stepData:e,appearance:t}){var n,i;let{handleUrl:o}=le();return st.createElement("div",null,st.createElement(wl,null,e.title),st.createElement(Tl,null,e.subtitle),st.createElement(Cl,null,(i=(n=e.props)==null?void 0:n.links)==null?void 0:i.map(r=>st.createElement(Sl,{key:r.title},st.createElement(yl,{src:r.imageUri}),st.createElement(bl,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{r.uri&&o(r.uri,r.uriTarget??"_blank")}},r.title)))))}import yt,{useEffect as Bl}from"react";import no from"styled-components";import No from"react";var ro=({style:e,className:t})=>No.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},No.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),No.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Lt,{useRef as Fl,useState as kl}from"react";import io from"styled-components";var Pl=io.div`
397
401
  display: flex;
398
402
  align-items: center;
399
403
  justify-content: flex-start;
@@ -401,7 +405,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
401
405
  width: 100%;
402
406
  height: 100%;
403
407
  position: relative;
404
- `,Pl=io.div`
408
+ `,vl=io.div`
405
409
  position: absolute;
406
410
  display: flex;
407
411
  align-items: center;
@@ -420,7 +424,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
420
424
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
421
425
  border-radius: 50%;
422
426
  }
423
- `,vl=io.video`
427
+ `,Il=io.video`
424
428
  width: 100%;
425
429
  height: 100%;
426
430
  min-height: 200px;
@@ -430,13 +434,13 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
430
434
  height: 100%;
431
435
  min-height: 200px;
432
436
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
433
- `;function Ct({appearance:e,videoUri:t}){let o=wl(),[i,r]=Fl(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),Lt.createElement(El,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Lt.createElement(kl,{appearance:e},!i&&Lt.createElement(Pl,{onClick:()=>{r(!0),o.current.play()},appearance:e},Lt.createElement(ro,null)),Lt.createElement(vl,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Al=no.div`
437
+ `;function St({appearance:e,videoUri:t}){let o=Fl(),[n,i]=kl(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Lt.createElement(El,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Lt.createElement(Pl,{appearance:e},!n&&Lt.createElement(vl,{onClick:()=>{i(!0),o.current.play()},appearance:e},Lt.createElement(ro,null)),Lt.createElement(Il,{appearance:e,controls:n,ref:o,play:n,src:t}))}var Al=no.div`
434
438
  ${e=>T(e)} {
435
439
  display: flex;
436
440
  flex-direction: column;
437
441
  justify-content: center;
438
442
  }
439
- `,Bl=no.img`
443
+ `,Nl=no.img`
440
444
  ${e=>T(e)} {
441
445
  width: 100%;
442
446
  height: auto;
@@ -454,25 +458,25 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
454
458
  max-height: 250px;
455
459
  margin-bottom: 24px;
456
460
  }
457
- `;function Br({stepData:e,appearance:t,setCanContinue:o}){return Il(()=>{o(!0)},[]),yt.createElement(Al,{className:a("callToActionContainer",t)},yt.createElement(Ol,{className:a("callToActionTextContainer",t)},yt.createElement(we,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&yt.createElement(Bl,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&yt.createElement(Ll,{appearance:t,className:a("callToActionVideo",t)},yt.createElement(Ct,{appearance:t,videoUri:e.videoUri})))}import Ge,{useEffect as Lo,useState as No}from"react";import Mt from"react";import Nt from"react";import{motion as Nl}from"framer-motion";var Or=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:r,transition:s},show:{strokeDashoffset:n,transition:s}};return Nt.createElement(Nl.circle,{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Dl=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9"})=>Nt.createElement("svg",{width:t,height:t,overflow:"visible"},Nt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Nt.createElement(Or,{color:r,size:t}),Nt.createElement(Or,{color:e,percentage:o,size:t})),i),Dt=Dl;import Ml from"styled-components";var $l=({color:e="#FFFFFF"})=>Mt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Mt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ul={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},_l={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Wl={border:"1px solid #000000",color:"#FFFFFF"},Hl={border:"1px solid #E6E6E6"},zl={color:"#FFFFFF"},Gl={border:"3px solid #D9D9D9"},jl=e=>e==="square"?Ul:_l,Vl=(e,t)=>e==="square"?t?Wl:Hl:t?zl:Gl,ql=Ml.div`
461
+ `;function Nr({stepData:e,appearance:t,setCanContinue:o}){return Bl(()=>{o(!0)},[]),yt.createElement(Al,{className:a("callToActionContainer",t)},yt.createElement(Ol,{className:a("callToActionTextContainer",t)},yt.createElement(Te,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&yt.createElement(Nl,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&yt.createElement(Ll,{appearance:t,className:a("callToActionVideo",t)},yt.createElement(St,{appearance:t,videoUri:e.videoUri})))}import Ge,{useEffect as Oo,useState as Lo}from"react";import $t from"react";import Dt from"react";import{motion as Dl}from"framer-motion";var Or=({color:e,percentage:t,size:o})=>{let n=o*.5-2,i=2*Math.PI*n,r=(1-t)*i,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:i,transition:s},show:{strokeDashoffset:r,transition:s}};return Dt.createElement(Dl.circle,{r:n,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==i?e:"",strokeWidth:"3px",strokeDasharray:i,strokeDashoffset:t?r:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Ml=({fillColor:e,size:t,percentage:o,children:n,bgColor:i="#D9D9D9"})=>Dt.createElement("svg",{width:t,height:t,overflow:"visible"},Dt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Dt.createElement(Or,{color:i,size:t}),Dt.createElement(Or,{color:e,percentage:o,size:t})),n),Mt=Ml;import $l from"styled-components";var Ul=({color:e="#FFFFFF"})=>$t.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$t.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),_l={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Wl={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Hl={border:"1px solid #000000",color:"#FFFFFF"},zl={border:"1px solid #E6E6E6"},Gl={color:"#FFFFFF"},jl={border:"3px solid #D9D9D9"},Vl=e=>e==="square"?_l:Wl,ql=(e,t)=>e==="square"?t?Hl:zl:t?Gl:jl,Kl=$l.div`
458
462
  ${e=>it(e)}
459
- `,St=({value:e,type:t="square",primaryColor:o="#000000",progress:i,appearance:r})=>{let n=jl(t),s=Vl(t,e);return e===!0?n={...n,...s,backgroundColor:o,borderColor:t==="square"?o:"none"}:n={...n,...s},e!==!0&&t==="round"&&i!==void 0&&i!==1?Mt.createElement(Dt,{fillColor:o,percentage:i,size:22}):Mt.createElement(ql,{styleOverrides:n,role:"checkbox",className:Ce(a("checkIconContainer",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked")},e&&Mt.createElement($l,{color:"#FFFFFF"}))};import Je from"styled-components";var Lr=Je.div`
463
+ `,bt=({value:e,type:t="square",primaryColor:o="#000000",progress:n,appearance:i})=>{let r=Vl(t),s=ql(t,e);return e===!0?r={...r,...s,backgroundColor:o,borderColor:t==="square"?o:"none"}:r={...r,...s},e!==!0&&t==="round"&&n!==void 0&&n!==1?$t.createElement(Mt,{fillColor:o,percentage:n,size:22}):$t.createElement(Kl,{styleOverrides:r,role:"checkbox",className:Ce(a("checkIconContainer",i),e?"checkIconContainerChecked":"checkIconContainerUnchecked")},e&&$t.createElement(Ul,{color:"#FFFFFF"}))};import Je from"styled-components";var Lr=Je.div`
460
464
  width: auto;
461
465
  display: flex;
462
466
  flex-direction: column;
463
467
  justify-content: center;
464
468
  align-items: center;
465
469
  padding: 4px;
466
- `,Nr=Je.div`
470
+ `,Dr=Je.div`
467
471
  width: 100%;
468
472
  text-align: left;
469
- `,Dr=Je.h1`
473
+ `,Mr=Je.h1`
470
474
  font-style: normal;
471
475
  font-weight: 700;
472
476
  font-size: 32px;
473
477
  line-height: 38px;
474
478
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
475
- `,Mr=Je.h1`
479
+ `,$r=Je.h1`
476
480
  font-style: normal;
477
481
  font-weight: 400;
478
482
  font-size: 16px;
@@ -480,7 +484,7 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
480
484
  margin-top: 16px;
481
485
  margin-bottom: 16px;
482
486
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
483
- `,$r=Je.div`
487
+ `,Ur=Je.div`
484
488
  padding-top: 12px;
485
489
  padding-bottom: 12px;
486
490
  flex-direction: row;
@@ -491,17 +495,17 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
491
495
  cursor: pointer;
492
496
  border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
493
497
  width: 100%;
494
- `,Ur=Je.div`
498
+ `,_r=Je.div`
495
499
  padding-top: 10px;
496
500
  padding-bottom: 10px;
497
501
  flex-direction: row;
498
502
  display: flex;
499
503
  justify-content: flex-start;
500
- `,_r=Je.img`
504
+ `,Wr=Je.img`
501
505
  width: 42px;
502
506
  height: 42px;
503
507
  margin-right: 12px;
504
- `,Wr=Je.p`
508
+ `,Hr=Je.p`
505
509
  font-style: normal;
506
510
  font-weight: 500;
507
511
  font-size: 17px;
@@ -509,8 +513,8 @@ import at,{createContext as ia,useEffect as Uo,useState as ve}from"react";import
509
513
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
510
514
  display: flex;
511
515
  align-self: center;
512
- `;var Hr=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=No([]),[p,d]=No(!1),[l,h]=No(e.id);return Lo(()=>{n.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Lo(()=>{l!==e.id&&(h(e.id),s([]))},[e]),Lo(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ge.createElement(Lr,{className:a("selectListContainer",i)},Ge.createElement(Nr,null,Ge.createElement(Dr,{className:a("selectListTitle",i)},e.title),Ge.createElement(Mr,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((m,g)=>{let w=n.includes(m.id);return Ge.createElement($r,{key:`select-item-${g}`,onClick:()=>{if(n.includes(m.id)){s(n.filter(x=>x!==m.id));return}n.length<r.maxChoices?s([...n,m.id]):n.length==1&&r.maxChoices==1&&s([m.id])},hideBottomBorder:g===r.options.length-1,className:a("selectListSelectItem",i)},Ge.createElement(Ur,{className:a("selectListItemImage",i)},m.imageUri&&Ge.createElement(_r,{src:m.imageUri,alt:`select-icon-${g}`}),Ge.createElement(Wr,{appearance:i,className:a("selectListSelectItemText",i)},m.title)),Ge.createElement(St,{appearance:i,value:w,primaryColor:i.theme.colorPrimary}))}))};import me,{useEffect as Kl,useState as Do}from"react";import{AnimatePresence as Yl,motion as Xl}from"framer-motion";var Jl=({children:e,id:t,shouldWrap:o=!1})=>me.createElement(me.Fragment,null,o?me.createElement(Yl,{initial:!1},me.createElement(Xl.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),so=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:h,setVisible:m,setShowModal:g,onDismiss:w,showPagination:x=!1,customFormElements:y})=>{let v={...{linkCollection:Ar,multiInput:br,callToAction:Br,selectList:Hr},...i},{primaryCTAClickSideEffects:F,secondaryCTAClickSideEffects:A}=ne(),[k,c]=Do(!1),[u,b]=Do({}),[I,$]=Do(!1),U=t[o]??null,{markStepCompleted:H,markStepStarted:L,isLoading:W,updateCustomVariables:D,markFlowCompleted:V}=Y();Kl(()=>{D(r)},[r,W]);function j(){return{data:u[t[o].id]??{},stepId:t[o].id,customVariables:r}}function z(O,fe,X){let B=o+1<t.length?t[o+1]:null;n&&n(O,o,fe,B),s&&s(O,X,B,u,j())}function q(O,fe){b(X=>{let B={};return B[O.id]=fe,{...X,...B}})}function Q(O){return O.selectedStep.imageUri?me.createElement(Pr,{image:O.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let le=me.createElement(Er,{step:t[o],canContinue:k||!I,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{$(!0);let O={...j()};await H(p,t[o].id,O),o+1<t.length&&await L(p,t[o+1].id),z(t[o],"primary",o),o+1>=t.length&&(h&&h(),w&&w(),l&&(m&&m(!1),g(!1)),await V(p)),F(t[o]),$(!1)},onSecondaryClick:()=>{z(t[o],"secondary",o),A(t[o])},onBack:async()=>{o-1>=0&&($(!0),await L(p,t[o-1].id),$(!1))},steps:t});return me.createElement(me.Fragment,null,me.createElement(wr,{className:a("formContainer",e)},me.createElement(Fr,null,me.createElement(Jl,{id:o,shouldWrap:d==="large-modal"},me.createElement(kr,{key:U.id,type:d,className:a("formContent",e)},t.map(O=>{let fe=v[O.type];return U.id!==O.id?null:me.createElement(fe,{key:O.id,stepData:O,canContinue:k,setCanContinue:c,onSaveData:X=>{q(O,X)},appearance:e,customFormElements:y})}),x&&me.createElement(Ir,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),le))),d=="large-modal"&&me.createElement(Q,{selectedStep:t[o]})))};import $t from"react";import{createGlobalStyle as Ql}from"styled-components";function ae({appearance:e}){if(!e||!e.styleOverrides)return $t.createElement($t.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return $t.createElement($t.Fragment,null);let o=Ql`
513
- ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map(([s,p])=>`${Fo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return $t.createElement(o,{inlineStyles:t})}var zr=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:h,onButtonClick:m,dismissible:g=!0,endFlowOnDismiss:w=!1,modalPosition:x="center",repeatable:y=!1,onDismiss:C,showPagination:v=!1})=>{let{getFlow:F,getFlowSteps:A,isLoading:k,targetingLogicShouldHideFlow:c,getFlowStatus:u,getCurrentStepIndex:b,markFlowCompleted:I,markFlowNotStarted:$}=Y(),U=b(e),{mergeAppearanceWithDefault:H}=J(),[L,W]=Rl(!1),{setOpenFlowState:D,getOpenFlowState:V}=ke();d=H(d);let[j,z]=i!==void 0&&r!==void 0?[i,r]:[V(e,!0),O=>D(e,O)];if(Zl(()=>{!L&&!k&&(W(!0),u(e)===Z&&y&&$(e),W(!0))},[L,W,k]),k)return null;let q=F(e);if(!q||c(q))return null;let Q=A(e);if(!Q||i!==void 0&&i===!1||u(e)===Z&&l)return null;let le=()=>{z(!1),C&&C(),w===!0&&I(e)};if(x=="center"&&o==="modal"||o==="large-modal"){let O={padding:"24px"};return o==="large-modal"?(O.width="85%",O.height="90%",O.maxHeight="800px",O.minHeight="500px",O.padding="0"):O.width="400px",Le.createElement(Ye,{appearance:d,onClose:le,visible:j,style:O,dismissible:g},Le.createElement(ae,{appearance:d}),Le.createElement(so,{appearance:d,steps:Q,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:m,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:z,onDismiss:C,showPagination:v,customFormElements:s}))}return o==="modal"&&x!=="center"?Le.createElement(ir,{appearance:d,onClose:le,visible:j},Le.createElement(ae,{appearance:d}),Le.createElement(so,{appearance:d,steps:Q,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:m,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:z,onDismiss:C,showPagination:v,customFormElements:s})):Le.createElement(Le.Fragment,null,Le.createElement(ae,{appearance:d}),Le.createElement(so,{appearance:d,steps:Q,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:m,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:z,onDismiss:C,showPagination:v,customFormElements:s}))},Gr=zr;import{useCallback as jr,useContext as ea,useEffect as ta}from"react";function Mo(){let{organizationId:e,userId:t,setOrganizationId:o}=ea(G),{mutateUserFlowState:i}=Te(),{config:r}=Oe(),n=ft(),{verifySDKInitiated:s}=gt();ta(()=>{if(t&&e){if(t.startsWith(ht))return;let l=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(l)||(n(`${ge}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(l,"true"))}},[t,e]);let p=jr(async l=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let h={foreignUserId:t,foreignUserGroupId:e,properties:l};await n(`${ge}userGroups`,{...r,method:"POST",body:JSON.stringify(h)}),i()},[e,t,r,i]),d=jr(async(l,h)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let g={foreignUserId:t,foreignUserGroupId:e,events:[{event:l,properties:h}]};await n(`${ge}userGroups`,{...r,method:"POST",body:JSON.stringify(g)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var Vr="xFrigade_guestUserId",qr="xFrigade_userId",Kr=({})=>{let{setFlowResponses:e}=At(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Te(),{userId:r,setUserId:n}=wo(),[s,p]=$o(null),{getFlowStatus:d}=Y(),{flows:l,userProperties:h,setIsNewGuestUser:m,flowResponses:g}=oa(G),[w,x]=$o([]),[y,C]=$o([]),{organizationId:v}=Mo();lo(()=>{if(!o&&t)for(let c=0;c<t.length;c++){let u=t[c],b=l.find(I=>I.slug===(u==null?void 0:u.flowId));if(b&&u&&u.shouldTrigger===!0&&b.type=="FORM"&&b.triggerType==="AUTOMATIC"&&!y.includes(b.slug)){setTimeout(()=>{F(u.flowId)},500);break}}},[o,t]),lo(()=>{g.length>0&&i()},[g]);function F(c){let u=l.find(b=>b.slug===c);u&&u.triggerType==="AUTOMATIC"&&!y.includes(u.slug)&&(C([...y,u.slug]),x([u]))}function A(){if(!r){let c=localStorage.getItem(qr);if(c){n(c);return}let u=localStorage.getItem(Vr);if(u){n(u);return}m(!0);let b=ht+ra();try{localStorage.setItem(Vr,b)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}n(I=>I||b)}}lo(()=>{try{if(l){let c=[];l.forEach(u=>{if(u.data){let b=u.data.match(/"imageUri":"(.*?)"/g);b&&b.forEach(I=>{let $=I.replace('"imageUri":"',"").replace('"',"");if(c.includes($))return;let U=new Image;U.src=$,c.push($)})}})}}catch{}},[l]),lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(ht))try{localStorage.setItem(qr,r)}catch(c){console.log("Failed to save user id locally: Local storage available",c)}r===null&&setTimeout(()=>{r===null&&A()},50)},[r,l,h]);function k(){return lt.createElement(lt.Fragment,null,w.map(c=>d(c.slug)!==Be?null:lt.createElement("span",{key:c.slug},lt.createElement(Gr,{flowId:c.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return lt.createElement(lt.Fragment,null,lt.createElement(k,null))};var ao={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",borderRadius:20}};import{ErrorBoundary as sa}from"react-error-boundary";var G=ia({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:ao,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),la=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var D,V;let[n,s]=ve(t||null),[p,d]=ve(o||null),[l,h]=ve([]),[m,g]=ve([]),[w,x]=ve([]),[y,C]=ve({}),[v,F]=ve({}),[A,k]=ve({}),[c,u]=ve(!1),[b,I]=ve(!1),[$,U]=ve(!W(e)),H=(j,z)=>{if(z==="_blank"){window.open(j,"_blank");return}setTimeout(()=>{window.location.href=j},50)},L={theme:{...ao.theme,...((D=i==null?void 0:i.defaultAppearance)==null?void 0:D.theme)??{}},styleOverrides:{...ao.styleOverrides,...((V=i==null?void 0:i.defaultAppearance)==null?void 0:V.styleOverrides)??{}}};function W(j){return!!(j&&j.length>10&&j.substring(0,10)==="api_public")}return Uo(()=>{t&&s(t)},[t]),Uo(()=>{o&&d(o)},[o]),Uo(()=>{if(W(e))U(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),U(!0);return}},[e,U]),$?at.createElement(G.Provider,{value:{publicApiKey:e,userId:n,setUserId:s,setFlows:h,flows:l,failedFlowResponses:m,setFailedFlowResponses:g,flowResponses:w,setFlowResponses:x,userProperties:y,setUserProperties:C,openFlowStates:v,setOpenFlowStates:F,customVariables:A,setCustomVariables:k,isNewGuestUser:c,setIsNewGuestUser:u,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:H,defaultAppearance:L,shouldGracefullyDegrade:$,setShouldGracefullyDegrade:U}},r):at.createElement(sa,{fallback:at.createElement(at.Fragment,null,r)},at.createElement(G.Provider,{value:{publicApiKey:e,userId:n,setUserId:s,setFlows:h,flows:l,failedFlowResponses:m,setFailedFlowResponses:g,flowResponses:w,setFlowResponses:x,userProperties:y,setUserProperties:C,openFlowStates:v,setOpenFlowStates:F,customVariables:A,setCustomVariables:k,isNewGuestUser:c,setIsNewGuestUser:u,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:H,defaultAppearance:L,shouldGracefullyDegrade:$,setShouldGracefullyDegrade:U}},at.createElement(na,{theme:L.theme},r,at.createElement(Kr,null))))};import ip from"react";import oe,{useEffect as Fn,useState as kn}from"react";import Ee,{useState as Ia}from"react";import dt from"styled-components";import uo from"react";import po from"react";import Xr from"styled-components";var Yr=Xr.span`
516
+ `;var zr=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let i=e.props,[r,s]=Lo([]),[p,d]=Lo(!1),[l,f]=Lo(e.id);return Oo(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Oo(()=>{l!==e.id&&(f(e.id),s([]))},[e]),Oo(()=>{o({choice:r}),r.length>=i.minChoices?t(!0):t(!1)},[r]),Ge.createElement(Lr,{className:a("selectListContainer",n)},Ge.createElement(Dr,null,Ge.createElement(Mr,{className:a("selectListTitle",n)},e.title),Ge.createElement($r,{appearance:n,className:a("selectListSubtitle",n)},e.subtitle)),i.options.map((u,g)=>{let F=r.includes(u.id);return Ge.createElement(Ur,{key:`select-item-${g}`,onClick:()=>{if(r.includes(u.id)){s(r.filter(b=>b!==u.id));return}r.length<i.maxChoices?s([...r,u.id]):r.length==1&&i.maxChoices==1&&s([u.id])},hideBottomBorder:g===i.options.length-1,className:a("selectListSelectItem",n)},Ge.createElement(_r,{className:a("selectListItemImage",n)},u.imageUri&&Ge.createElement(Wr,{src:u.imageUri,alt:`select-icon-${g}`}),Ge.createElement(Hr,{appearance:n,className:a("selectListSelectItemText",n)},u.title)),Ge.createElement(bt,{appearance:n,value:F,primaryColor:n.theme.colorPrimary}))}))};import ue,{useEffect as Yl,useState as Do}from"react";import{AnimatePresence as Xl,motion as Jl}from"framer-motion";var Ql=({children:e,id:t,shouldWrap:o=!1})=>ue.createElement(ue.Fragment,null,o?ue.createElement(Xl,{initial:!1},ue.createElement(Jl.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),so=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:i,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:f,setVisible:u,setShowModal:g,onDismiss:F,showPagination:b=!1,customFormElements:C,allowBackNavigation:m})=>{let w={...{linkCollection:Ar,multiInput:br,callToAction:Nr,selectList:zr},...n},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:k}=le(),[c,h]=Do(!1),[y,E]=Do({}),[U,M]=Do(!1),_=t[o]??null,{markStepCompleted:O,markStepStarted:H,isLoading:N,updateCustomVariables:j,markFlowCompleted:K}=X();Yl(()=>{j(i)},[i,N]);function V(){return{data:y[t[o].id]??{},stepId:t[o].id,customVariables:i}}function z($,J,A){let q=o+1<t.length?t[o+1]:null;r&&r($,o,J,q),s&&s($,A,q,y,V())}function te($,J){E(A=>{let q={};return q[$.id]=J,{...A,...q}})}function oe($){return $.selectedStep.imageUri?ue.createElement(vr,{image:$.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Z=ue.createElement(Er,{step:t[o],canContinue:c||!U,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{M(!0);let $={...V()};await O(p,t[o].id,$),o+1<t.length&&await H(p,t[o+1].id),z(t[o],"primary",o),o+1>=t.length&&(f&&f(),F&&F(),l&&(u&&u(!1),g(!1)),await K(p)),B(t[o]),M(!1)},onSecondaryClick:()=>{z(t[o],"secondary",o),k(t[o])},onBack:async()=>{o-1>=0&&(M(!0),await H(p,t[o-1].id),M(!1))},steps:t,allowBackNavigation:m});return ue.createElement(ue.Fragment,null,ue.createElement(Fr,{className:a("formContainer",e)},ue.createElement(kr,null,ue.createElement(Ql,{id:o,shouldWrap:d==="large-modal"},ue.createElement(Pr,{key:_.id,type:d,className:a("formContent",e)},t.map($=>{let J=w[$.type];return _.id!==$.id?null:ue.createElement(J,{key:$.id,stepData:$,canContinue:c,setCanContinue:h,onSaveData:A=>{te($,A)},appearance:e,customFormElements:C})}),b&&ue.createElement(Br,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Z))),d=="large-modal"&&ue.createElement(oe,{selectedStep:t[o]})))};import Ut from"react";import{createGlobalStyle as Zl}from"styled-components";function pe({appearance:e}){if(!e||!e.styleOverrides)return Ut.createElement(Ut.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([n,i])=>typeof i=="object");if(t.length===0)return Ut.createElement(Ut.Fragment,null);let o=Zl`
517
+ ${n=>n.inlineStyles.map(([i,r])=>`.${Nt}${i}.${Nt}${i} { ${Object.entries(r).map(([s,p])=>`${Fo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Ut.createElement(o,{inlineStyles:t})}var Gr=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:i,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:f,onButtonClick:u,dismissible:g=!0,endFlowOnDismiss:F=!1,modalPosition:b="center",repeatable:C=!1,onDismiss:m,showPagination:v=!1,allowBackNavigation:w=!1})=>{let{getFlow:B,getFlowSteps:k,isLoading:c,targetingLogicShouldHideFlow:h,getFlowStatus:y,getCurrentStepIndex:E,markFlowCompleted:U,markFlowNotStarted:M}=X(),_=E(e),{mergeAppearanceWithDefault:O}=Q(),[H,N]=ea(!1),{setOpenFlowState:j,getOpenFlowState:K}=ke();d=O(d);let[V,z]=n!==void 0&&i!==void 0?[n,i]:[K(e,!0),$=>j(e,$)];if(Rl(()=>{!H&&!c&&(N(!0),y(e)===R&&C&&M(e),N(!0))},[H,N,c]),c)return null;let te=B(e);if(!te||h(te))return null;let oe=k(e);if(!oe||n!==void 0&&n===!1||y(e)===R&&l)return null;let Z=()=>{z(!1),m&&m(),F===!0&&U(e)};if(b=="center"&&o==="modal"||o==="large-modal"){let $={padding:"24px"};return o==="large-modal"?($.width="85%",$.height="90%",$.maxHeight="800px",$.minHeight="500px",$.padding="0"):$.width="400px",Oe.createElement(Ye,{appearance:d,onClose:Z,visible:V,style:$,dismissible:g},Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:u,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:z,onDismiss:m,showPagination:v,customFormElements:s,allowBackNavigation:w}))}return o==="modal"&&b!=="center"?Oe.createElement(ir,{appearance:d,onClose:Z,visible:V},Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:u,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:z,onDismiss:m,showPagination:v,customFormElements:s,allowBackNavigation:w})):Oe.createElement(Oe.Fragment,null,Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:u,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:z,onDismiss:m,showPagination:v,customFormElements:s,allowBackNavigation:w}))},jr=Gr;import{useCallback as Vr,useContext as ta,useEffect as oa}from"react";function Mo(){let{organizationId:e,userId:t,setOrganizationId:o}=ta(G),{mutateUserFlowState:n}=we(),{config:i}=Ne(),r=ft(),{verifySDKInitiated:s}=gt();oa(()=>{if(t&&e){if(t.startsWith(ht))return;let l=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(l)||(r(`${ge}userGroups`,{...i,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(l,"true"))}},[t,e]);let p=Vr(async l=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let f={foreignUserId:t,foreignUserGroupId:e,properties:l};await r(`${ge}userGroups`,{...i,method:"POST",body:JSON.stringify(f)}),n()},[e,t,i,n]),d=Vr(async(l,f)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let g={foreignUserId:t,foreignUserGroupId:e,events:[{event:l,properties:f}]};await r(`${ge}userGroups`,{...i,method:"POST",body:JSON.stringify(g)}),n()},[e,t,i,n]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var qr="xFrigade_guestUserId",Kr="xFrigade_userId",Yr=({})=>{let{setFlowResponses:e}=At(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=we(),{userId:i,setUserId:r}=To(),[s,p]=$o(null),{getFlowStatus:d}=X(),{flows:l,userProperties:f,setIsNewGuestUser:u,flowResponses:g}=ra(G),[F,b]=$o([]),[C,m]=$o([]),{organizationId:v}=Mo();lo(()=>{if(!o&&t)for(let c=0;c<t.length;c++){let h=t[c],y=l.find(E=>E.slug===(h==null?void 0:h.flowId));if(y&&h&&h.shouldTrigger===!0&&y.type=="FORM"&&y.triggerType==="AUTOMATIC"&&!C.includes(y.slug)){setTimeout(()=>{w(h.flowId)},500);break}}},[o,t]),lo(()=>{g.length>0&&n()},[g]);function w(c){let h=l.find(y=>y.slug===c);h&&h.triggerType==="AUTOMATIC"&&!C.includes(h.slug)&&(m([...C,h.slug]),b([h]))}function B(){if(!i){let c=localStorage.getItem(Kr);if(c){r(c);return}let h=localStorage.getItem(qr);if(h){r(h);return}u(!0);let y=ht+ia();try{localStorage.setItem(qr,y)}catch(E){console.log("Failed to save guest user id locally: Local storage unavailable",E)}r(E=>E||y)}}lo(()=>{try{if(l){let c=[];l.forEach(h=>{if(h.data){let y=h.data.match(/"imageUri":"(.*?)"/g);y&&y.forEach(E=>{let U=E.replace('"imageUri":"',"").replace('"',"");if(c.includes(U))return;let M=new Image;M.src=U,c.push(U)})}})}}catch{}},[l]),lo(()=>{if(i!==s&&e([]),p(i),i&&!i.startsWith(ht))try{localStorage.setItem(Kr,i)}catch(c){console.log("Failed to save user id locally: Local storage available",c)}i===null&&setTimeout(()=>{i===null&&B()},50)},[i,l,f]);function k(){return lt.createElement(lt.Fragment,null,F.map(c=>d(c.slug)!==Ae?null:lt.createElement("span",{key:c.slug},lt.createElement(jr,{flowId:c.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return lt.createElement(lt.Fragment,null,lt.createElement(k,null))};var ao={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",borderRadius:20}};import{ErrorBoundary as la}from"react-error-boundary";var G=na({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:ao,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),aa=({publicApiKey:e,userId:t,organizationId:o,config:n,children:i})=>{var N,j;let[r,s]=ve(t||null),[p,d]=ve(o||null),[l,f]=ve([]),[u,g]=ve([]),[F,b]=ve([]),[C,m]=ve({}),[v,w]=ve({}),[B,k]=ve({}),[c,h]=ve(!1),[y,E]=ve(!1),[U,M]=ve(!H(e)),_=(K,V)=>{if(V==="_blank"){window.open(K,"_blank");return}setTimeout(()=>{window.location.href=K},50)},O={theme:{...ao.theme,...((N=n==null?void 0:n.defaultAppearance)==null?void 0:N.theme)??{}},styleOverrides:{...ao.styleOverrides,...((j=n==null?void 0:n.defaultAppearance)==null?void 0:j.styleOverrides)??{}}};function H(K){return!!(K&&K.length>10&&K.substring(0,10)==="api_public")}return Uo(()=>{t&&s(t)},[t]),Uo(()=>{o&&d(o)},[o]),Uo(()=>{if(H(e))M(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),M(!0);return}},[e,M]),U?at.createElement(G.Provider,{value:{publicApiKey:e,userId:r,setUserId:s,setFlows:f,flows:l,failedFlowResponses:u,setFailedFlowResponses:g,flowResponses:F,setFlowResponses:b,userProperties:C,setUserProperties:m,openFlowStates:v,setOpenFlowStates:w,customVariables:B,setCustomVariables:k,isNewGuestUser:c,setIsNewGuestUser:h,hasActiveFullPageFlow:y,setHasActiveFullPageFlow:E,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:_,defaultAppearance:O,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:M}},i):at.createElement(la,{fallback:at.createElement(at.Fragment,null,i)},at.createElement(G.Provider,{value:{publicApiKey:e,userId:r,setUserId:s,setFlows:f,flows:l,failedFlowResponses:u,setFailedFlowResponses:g,flowResponses:F,setFlowResponses:b,userProperties:C,setUserProperties:m,openFlowStates:v,setOpenFlowStates:w,customVariables:B,setCustomVariables:k,isNewGuestUser:c,setIsNewGuestUser:h,hasActiveFullPageFlow:y,setHasActiveFullPageFlow:E,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:_,defaultAppearance:O,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:M}},at.createElement(sa,{theme:O.theme},i,at.createElement(Yr,null))))};import np from"react";import ne,{useEffect as kn,useState as Pn}from"react";import Ie,{useState as Ba}from"react";import dt from"styled-components";import uo from"react";import po from"react";import Jr from"styled-components";var Xr=Jr.span`
514
518
  font-weight: 400;
515
519
  font-size: 15px;
516
520
  line-height: 20px;
@@ -519,7 +523,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
519
523
  vertical-align: middle;
520
524
  margin-left: 12px;
521
525
  padding-right: 12px;
522
- `,aa=Xr.div`
526
+ `,pa=Jr.div`
523
527
  flex-direction: row;
524
528
  justify-content: space-between;
525
529
  display: flex;
@@ -527,24 +531,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
527
531
  padding-bottom: 20px;
528
532
  border-top: 1px solid ${e=>e.theme.colorBorder};
529
533
  width: 100%;
530
- `,co=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="square",appearance:p})=>po.createElement(aa,{className:a("checklistStepsContainer",p),appearance:p,style:{...r}},i==="left"&&e&&po.createElement(Yr,{className:a("checklistStepLabel",p),style:o},e),po.createElement(St,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&po.createElement(Yr,{className:a("checklistStepLabel",p),style:o},e));import{motion as pa}from"framer-motion";import Ut from"styled-components";var Jr=Ut.div`
534
+ `,co=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:i,primaryColor:r="#000000",checkBoxType:s="square",appearance:p})=>po.createElement(pa,{className:a("checklistStepsContainer",p),appearance:p,style:{...i}},n==="left"&&e&&po.createElement(Xr,{className:a("checklistStepLabel",p),style:o},e),po.createElement(bt,{appearance:p,value:t,type:s,primaryColor:r}),n==="right"&&e&&po.createElement(Xr,{className:a("checklistStepLabel",p),style:o},e));import{motion as da}from"framer-motion";import _t from"styled-components";var Qr=_t.div`
531
535
  font-weight: 700;
532
536
  font-size: 18px;
533
537
  line-height: 22px;
534
- `,Qr=Ut.p`
538
+ `,Zr=_t.p`
535
539
  font-weight: 700;
536
540
  font-size: 18px;
537
541
  line-height: 22px;
538
542
  margin: 20px 0px 0px 0px;
539
543
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
540
- `,Zr=Ut.p`
544
+ `,Rr=_t.p`
541
545
  font-weight: 400;
542
546
  font-size: 15px;
543
547
  line-height: 28px;
544
548
  max-width: 540px;
545
549
  margin: 8px 0px 0px 0px;
546
550
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
547
- `,mo=Ut.div`
551
+ `,mo=_t.div`
548
552
  width: 4px;
549
553
  position: absolute;
550
554
  left: 0;
@@ -552,21 +556,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
552
556
  height: 80%;
553
557
  border-top-right-radius: 8px;
554
558
  border-bottom-right-radius: 8px;
555
- `,Rr=Ut.div`
559
+ `,ei=_t.div`
556
560
  flex-direction: row;
557
561
  justify-content: flex-start;
558
- `;var ei=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,d;return uo.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{n()}},o&&uo.createElement(mo,{className:a("checklistStepItemSelectedIndicator",s),as:pa.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),uo.createElement(Rr,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},uo.createElement(co,{value:e.complete,labelPosition:"left",label:e.stepName,style:r,primaryColor:((d=s==null?void 0:s.theme)==null?void 0:d.colorPrimary)??i,appearance:s})))};import pt from"react";import{motion as da}from"framer-motion";import _o from"styled-components";var ca={backgroundColor:"#E6E6E6"},ma=_o.div`
562
+ `;var ti=({data:e,index:t,isSelected:o,primaryColor:n,style:i,onClick:r,appearance:s})=>{var p,d;return uo.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{r()}},o&&uo.createElement(mo,{className:a("checklistStepItemSelectedIndicator",s),as:da.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??n}}),uo.createElement(ei,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},uo.createElement(co,{value:e.complete,labelPosition:"left",label:e.stepName,style:i,primaryColor:((d=s==null?void 0:s.theme)==null?void 0:d.colorPrimary)??n,appearance:s})))};import pt from"react";import{motion as ca}from"framer-motion";import _o from"styled-components";var ma={backgroundColor:"#E6E6E6"},ua=_o.div`
559
563
  display: flex;
560
564
  flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
561
565
  justify-content: flex-start;
562
566
  align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
563
567
 
564
568
  ${e=>it(e)}
565
- `,ua=_o.div`
569
+ `,fa=_o.div`
566
570
  flex-grow: 1;
567
571
  position: relative;
568
572
  ${e=>e.textLocation=="top"?"width: 100%;":""}
569
- `,fa=_o.span`
573
+ `,ga=_o.span`
570
574
  font-weight: 500;
571
575
  font-size: 15px;
572
576
  line-height: 18px;
@@ -574,13 +578,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
574
578
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
575
579
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
576
580
  ${e=>it(e)}
577
- `,ga={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},ha={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},Ne=({count:e,total:t,fillColor:o,bgColor:i=ca.backgroundColor,display:r="count",textLocation:n="left",style:s={},textStyle:p={},appearance:d})=>{var x,y;if(t===0)return pt.createElement(pt.Fragment,null);let l=e===0?"10px":`${e/t*100}%`,h=r==="compact"?"5px":"10px",m=Math.round(e/t*100),g=r==="compact"?"5px":"20px",w;return r==="count"?w=`${e} of ${t}`:r==="compact"?w=`${m}%`:r==="percent"&&(w=`${m}% complete`),n==="top"&&(g="0px"),pt.createElement(ma,{className:a("progressBarContainer",d),textLocation:n,styleOverrides:s},pt.createElement(fa,{className:a("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:g,textLocation:n},w),pt.createElement(ua,{textLocation:n,className:a("progressBar",d)},pt.createElement(da.div,{style:{...ha,width:l,height:h,backgroundColor:((x=d==null?void 0:d.theme)==null?void 0:x.colorPrimary)??o,zIndex:r=="compact"?1:5},className:a("progressBarFill",d)}),pt.createElement("div",{className:a("progressBarBackground",d),style:{...ga,height:h,backgroundColor:((y=d==null?void 0:d.theme)==null?void 0:y.colorSecondary)??i}})))};import Wt from"react";import xa from"styled-components";import go from"react";import fo from"react";var bt=({stepData:e,appearance:t})=>fo.createElement(fo.Fragment,null,fo.createElement(Qr,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ie(e.title)}),fo.createElement(Zr,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ie(e.subtitle)}));import _t from"react";var Tt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return _t.createElement(_t.Fragment,null,_t.createElement(to,null,e.secondaryButtonTitle&&_t.createElement(R,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}),_t.createElement(R,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var wt=({stepData:e,appearance:t})=>go.createElement(go.Fragment,null,go.createElement(bt,{stepData:e,appearance:t}),go.createElement(Tt,{stepData:e,appearance:t}));import ti from"react";function oi(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),ti.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:a("checklistStepVideo",e.appearance)})}else return ti.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var Wo="default",Ca=xa.img`
581
+ `,ha={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},xa={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},Le=({count:e,total:t,fillColor:o,bgColor:n=ma.backgroundColor,display:i="count",textLocation:r="left",style:s={},textStyle:p={},appearance:d})=>{var b,C;if(t===0)return pt.createElement(pt.Fragment,null);let l=e===0?"10px":`${e/t*100}%`,f=i==="compact"?"5px":"10px",u=Math.round(e/t*100),g=i==="compact"?"5px":"20px",F;return i==="count"?F=`${e} of ${t}`:i==="compact"?F=`${u}%`:i==="percent"&&(F=`${u}% complete`),r==="top"&&(g="0px"),pt.createElement(ua,{className:a("progressBarContainer",d),textLocation:r,styleOverrides:s},pt.createElement(ga,{className:a("progressBarStepText",d),style:{...p,fontSize:i==="compact"?12:15,fontWeight:i==="compact"?400:500},appearance:d,padding:g,textLocation:r},F),pt.createElement(fa,{textLocation:r,className:a("progressBar",d)},pt.createElement(ca.div,{style:{...xa,width:l,height:f,backgroundColor:((b=d==null?void 0:d.theme)==null?void 0:b.colorPrimary)??o,zIndex:i=="compact"?1:5},className:a("progressBarFill",d)}),pt.createElement("div",{className:a("progressBarBackground",d),style:{...ha,height:f,backgroundColor:((C=d==null?void 0:d.theme)==null?void 0:C.colorSecondary)??n}})))};import Ht from"react";import Ca from"styled-components";import go from"react";import fo from"react";var wt=({stepData:e,appearance:t})=>fo.createElement(fo.Fragment,null,fo.createElement(Zr,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:se(e.title)}),fo.createElement(Rr,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:se(e.subtitle)}));import Wt from"react";var Tt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Wt.createElement(Wt.Fragment,null,Wt.createElement(oo,null,e.secondaryButtonTitle&&Wt.createElement(ee,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}),Wt.createElement(ee,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Ft=({stepData:e,appearance:t})=>go.createElement(go.Fragment,null,go.createElement(wt,{stepData:e,appearance:t}),go.createElement(Tt,{stepData:e,appearance:t}));import oi from"react";function ri(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),oi.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:a("checklistStepVideo",e.appearance)})}else return oi.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var Wo="default",Sa=Ca.img`
578
582
  border-radius: 4px;
579
583
  max-height: 260px;
580
584
  min-height: 200px;
581
- `,ri=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Wt.createElement("div",null,o)}return Wt.createElement(Jr,{className:a("checklistStepContent",t)},e.imageUri?Wt.createElement(Ca,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Wt.createElement(oi,{videoUri:e.videoUri,appearance:t}):null,Wt.createElement(wt,{stepData:e,appearance:t}))};import ye,{useRef as ya,useState as Sa}from"react";import Ft from"styled-components";var ii=Ft.div`
585
+ `,ii=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Ht.createElement("div",null,o)}return Ht.createElement(Qr,{className:a("checklistStepContent",t)},e.imageUri?Ht.createElement(Sa,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Ht.createElement(ri,{videoUri:e.videoUri,appearance:t}):null,Ht.createElement(Ft,{stepData:e,appearance:t}))};import Se,{useRef as ya,useState as ba}from"react";import kt from"styled-components";var ni=kt.div`
582
586
  display: block;
583
- `,ba=Ft.div`
587
+ `,wa=kt.div`
584
588
  display: flex;
585
589
  flex-direction: row;
586
590
  flex-wrap: wrap;
@@ -590,20 +594,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
590
594
  align-content: center;
591
595
  margin-top: 24px;
592
596
  margin-bottom: 24px;
593
- `,Ta=Ft.div`
597
+ `,Ta=kt.div`
594
598
  display: flex;
595
599
  align-items: center;
596
600
  justify-content: flex-start;
597
601
  flex-direction: column;
598
602
  margin-right: 16px;
599
- `,wa=Ft.video`
603
+ `,Fa=kt.video`
600
604
  width: 200px;
601
605
  height: 120px;
602
- `,Fa=Ft.div`
606
+ `,ka=kt.div`
603
607
  font-size: 14px;
604
608
  line-height: 20px;
605
609
  text-align: center;
606
- `,ka=Ft.div`
610
+ `,Pa=kt.div`
607
611
  position: absolute;
608
612
  width: 200px;
609
613
  height: 120px;
@@ -623,9 +627,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
623
627
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
624
628
  border-radius: 50%;
625
629
  }
626
- `,ni="videoCarousel",si=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return ye.createElement(ii,null,ye.createElement(wt,{stepData:e,appearance:t}));function o({video:n}){let s=ya(),[p,d]=Sa(!1);return ye.createElement(Ta,null,!p&&ye.createElement(ka,{onClick:()=>{d(!0),s.current.play()},appearance:t},ye.createElement(ro,null)),ye.createElement(wa,{controls:p,ref:s,play:p,src:n.uri}),ye.createElement(Fa,null,n.title))}let i=e.props;return i.videos?ye.createElement(ii,null,ye.createElement(bt,{stepData:e,appearance:t}),ye.createElement(ba,null,i.videos.map((n,s)=>ye.createElement("span",{key:`${n.uri}-${s}`},ye.createElement(o,{video:n})))),ye.createElement(Tt,{stepData:e,appearance:t})):null};import je from"react";import ho from"styled-components";var li=ho.div`
630
+ `,si="videoCarousel",li=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.videos))return Se.createElement(ni,null,Se.createElement(Ft,{stepData:e,appearance:t}));function o({video:r}){let s=ya(),[p,d]=ba(!1);return Se.createElement(Ta,null,!p&&Se.createElement(Pa,{onClick:()=>{d(!0),s.current.play()},appearance:t},Se.createElement(ro,null)),Se.createElement(Fa,{controls:p,ref:s,play:p,src:r.uri}),Se.createElement(ka,null,r.title))}let n=e.props;return n.videos?Se.createElement(ni,null,Se.createElement(wt,{stepData:e,appearance:t}),Se.createElement(wa,null,n.videos.map((r,s)=>Se.createElement("span",{key:`${r.uri}-${s}`},Se.createElement(o,{video:r})))),Se.createElement(Tt,{stepData:e,appearance:t})):null};import je from"react";import ho from"styled-components";var ai=ho.div`
627
631
  display: block;
628
- `,Pa=ho.pre`
632
+ `,va=ho.pre`
629
633
  display: block;
630
634
  background-color: #2a2a2a;
631
635
  color: #f8f8f8;
@@ -641,21 +645,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
641
645
  white-space: -o-pre-wrap; /* Opera 7 */
642
646
  word-wrap: break-word; /* Internet Explorer 5.5+ */
643
647
  margin-bottom: 24px;
644
- `,va=ho.div`
648
+ `,Ia=ho.div`
645
649
  font-size: 15px;
646
650
  line-height: 20px;
647
651
  margin-bottom: 12px;
648
652
  margin-top: 12px;
649
653
  `,Ea=ho.div`
650
654
  margin-top: 24px;
651
- `,ai="codeSnippet",pi=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return je.createElement(li,null,je.createElement(wt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?je.createElement(li,null,je.createElement(bt,{stepData:e,appearance:t}),je.createElement(Ea,null,o.codeSnippets.map((r,n)=>je.createElement("div",{key:n},r.title?je.createElement(va,null,r.title):null,r.code?je.createElement(Pa,null,r.code):null))),je.createElement(Tt,{stepData:e,appearance:t})):null};var Aa=dt.div`
655
+ `,pi="codeSnippet",di=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.codeSnippets))return je.createElement(ai,null,je.createElement(Ft,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?je.createElement(ai,null,je.createElement(wt,{stepData:e,appearance:t}),je.createElement(Ea,null,o.codeSnippets.map((i,r)=>je.createElement("div",{key:r},i.title?je.createElement(Ia,null,i.title):null,i.code?je.createElement(va,null,i.code):null))),je.createElement(Tt,{stepData:e,appearance:t})):null};var Aa=dt.div`
652
656
  display: flex;
653
657
  flex-direction: row;
654
658
  min-width: ${e=>e.type!="modal"?"1000px":"100%"};
655
659
  background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
656
660
  box-shadow: ${e=>e.type!="modal"?"0px 6px 25px rgba(0, 0, 0, 0.06)":"none"};
657
661
  border-radius: 8px;
658
- `,Ba=dt.h1`
662
+ `,Na=dt.h1`
659
663
  font-size: 24px;
660
664
  font-weight: 600;
661
665
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
@@ -664,7 +668,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
664
668
  line-height: 20px;
665
669
  color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary)??"#4d4d4d"}};
666
670
  margin: 10px 0px 0px 0px;
667
- `,di=dt.div`
671
+ `,ci=dt.div`
668
672
  padding-bottom: 16px;
669
673
  `,La=dt.div`
670
674
  list-style: none;
@@ -672,37 +676,37 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
672
676
  margin: 0;
673
677
  cursor: pointer;
674
678
  width: 300px;
675
- `,Na=dt.div`
679
+ `,Da=dt.div`
676
680
  width: 1px;
677
681
  margin: 40px;
678
682
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
679
- `,Da=dt.div`
683
+ `,Ma=dt.div`
680
684
  flex: 2;
681
685
  padding: 2rem;
682
- `,Ma=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:h}=J();d=h(d);let g={...{[Wo]:ri,[ni]:si,[ai]:pi},...p},[w,x]=Ia(0),y=r??w,C=n??x,v=o.filter(A=>A.complete===!0).length,F=()=>{var A;return!((A=o[y])!=null&&A.type)||!g[o[y].type]?g[Wo]({stepData:o[y],appearance:d}):g[o[y].type]({stepData:o[y],appearance:d})};return Ee.createElement(Aa,{type:l,style:i,className:s,appearance:d},Ee.createElement(di,{style:{flex:1}},Ee.createElement(di,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Ee.createElement(Ba,{className:a("checklistTitle",d),appearance:d},e),Ee.createElement(Oa,{className:a("checklistSubtitle",d),appearance:d},t),Ee.createElement(Ne,{total:o.length,count:v,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Ee.createElement(La,{className:a("checklistStepsContainer",d)},o.map((A,k)=>Ee.createElement(ei,{data:A,index:k,key:k,listLength:o.length,isSelected:k===y,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{C(k)}})))),Ee.createElement(Na,{appearance:d,className:a("checklistDivider",d)}),Ee.createElement(Da,null,Ee.createElement(F,null)))},Ho=Ma;import N,{useState as za}from"react";import ci from"react";import $a from"styled-components";var Ua=$a.svg`
686
+ `,$a=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:i,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:f}=Q();d=f(d);let g={...{[Wo]:ii,[si]:li,[pi]:di},...p},[F,b]=Ba(0),C=i??F,m=r??b,v=o.filter(B=>B.complete===!0).length,w=()=>{var B;return!((B=o[C])!=null&&B.type)||!g[o[C].type]?g[Wo]({stepData:o[C],appearance:d}):g[o[C].type]({stepData:o[C],appearance:d})};return Ie.createElement(Aa,{type:l,style:n,className:s,appearance:d},Ie.createElement(ci,{style:{flex:1}},Ie.createElement(ci,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Ie.createElement(Na,{className:a("checklistTitle",d),appearance:d},e),Ie.createElement(Oa,{className:a("checklistSubtitle",d),appearance:d},t),Ie.createElement(Le,{total:o.length,count:v,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Ie.createElement(La,{className:a("checklistStepsContainer",d)},o.map((B,k)=>Ie.createElement(ti,{data:B,index:k,key:k,listLength:o.length,isSelected:k===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{m(k)}})))),Ie.createElement(Da,{appearance:d,className:a("checklistDivider",d)}),Ie.createElement(Ma,null,Ie.createElement(w,null)))},Ho=$a;import L,{useState as Ga}from"react";import mi from"react";import Ua from"styled-components";var _a=Ua.svg`
683
687
  transition: 'transform 0.35s ease-in-out';
684
- `,kt=({color:e="#323232",style:t,className:o})=>ci.createElement(Ua,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},ci.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as Ga}from"framer-motion";import se from"styled-components";var zo={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},mi=se.div`
688
+ `,Pt=({color:e="#323232",style:t,className:o})=>mi.createElement(_a,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},mi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as ja}from"framer-motion";import ae from"styled-components";var zo={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},ui=ae.div`
685
689
  max-height: 350px;
686
690
  padding-bottom: 40px;
687
- `,ui=se.div`
691
+ `,fi=ae.div`
688
692
  display: flex;
689
693
  flex-direction: column;
690
694
  margin-top: 20px;
691
- `,fi=se.h1`
695
+ `,gi=ae.h1`
692
696
  font-style: normal;
693
697
  font-weight: 600;
694
698
  font-size: 30px;
695
699
  line-height: 36px;
696
700
  margin-bottom: 16px;
697
701
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
698
- `,gi=se.h2`
702
+ `,hi=ae.h2`
699
703
  font-weight: 400;
700
704
  font-size: 16px;
701
705
  line-height: 20px;
702
706
  margin-bottom: 16px;
703
707
  padding-left: 1px;
704
708
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
705
- `,hi=se.div`
709
+ `,xi=ae.div`
706
710
  ${e=>T(e)} {
707
711
  border: 1px solid #fafafa;
708
712
  }
@@ -712,11 +716,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
712
716
  flex-direction: column;
713
717
  min-height: 240px;
714
718
  overflow: hidden;
715
- `,xi=se.div`
719
+ `,Ci=ae.div`
716
720
  display: flex;
717
721
  flex-direction: row;
718
722
  justify-content: space-between;
719
- `,Ci=se.p`
723
+ `,Si=ae.p`
720
724
  ${e=>T(e)} {
721
725
  font-weight: 400;
722
726
  font-size: 10px;
@@ -725,12 +729,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
725
729
  color: #8c8c8c;
726
730
  margin: 20px;
727
731
  }
728
- `,yi=se.div`
732
+ `,yi=ae.div`
729
733
  display: flex;
730
734
  flex-direction: row;
731
- `,Si=se.div`
735
+ `,bi=ae.div`
732
736
  flex: 1;
733
- `,bi=se.div`
737
+ `,wi=ae.div`
734
738
  ${e=>T(e)} {
735
739
  display: flex;
736
740
  justify-content: center;
@@ -740,7 +744,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
740
744
  padding-left: 8px;
741
745
  padding-right: 8px;
742
746
  }
743
- `,Ti=se.p`
747
+ `,Ti=ae.p`
744
748
  ${e=>T(e)} {
745
749
  font-style: normal;
746
750
  font-weight: 600;
@@ -752,7 +756,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
752
756
  margin-top: 20px;
753
757
  margin-bottom: 16px;
754
758
  }
755
- `,wi=se.p`
759
+ `,Fi=ae.p`
756
760
  ${e=>T(e)} {
757
761
  font-weight: 400;
758
762
  font-size: 14px;
@@ -761,14 +765,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
761
765
  color: ${e=>e.appearance.theme.colorTextSecondary};
762
766
  margin-bottom: 8px;
763
767
  }
764
- `,Fi=se.div`
768
+ `,ki=ae.div`
765
769
  ${e=>T(e)} {
766
770
  display: flex;
767
771
  flex-direction: row;
768
772
  justify-content: center;
769
773
  gap: 8px;
770
774
  }
771
- `,ki=se.div`
775
+ `,Pi=ae.div`
772
776
  ${e=>T(e)} {
773
777
  // Anything inside this block will be ignored if the user provides a custom class
774
778
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
@@ -788,7 +792,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
788
792
  justify-content: space-between;
789
793
  position: relative;
790
794
  cursor: pointer;
791
- `,Pi=se.p`
795
+ `,vi=ae.p`
792
796
  ${e=>T(e)} {
793
797
  // Anything inside this block will be ignored if the user provides a custom class
794
798
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
@@ -797,12 +801,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
797
801
  font-size: 14px;
798
802
  line-height: 22px;
799
803
  margin: 0;
800
- `,vi=se.div`
804
+ `,Ii=ae.div`
801
805
  display: flex;
802
806
  flex-direction: row;
803
807
  justify-content: flex-end;
804
808
  align-content: center;
805
- `,Ei=se.div`
809
+ `,Ei=ae.div`
806
810
  display: flex;
807
811
  flex: 1;
808
812
  flex-direction: row;
@@ -810,14 +814,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
810
814
  align-content: center;
811
815
  align-items: center;
812
816
  margin-right: 20px;
813
- `,Ii=se.div`
817
+ `,Bi=ae.div`
814
818
  display: block;
815
819
  width: 100%;
816
- `;import _a from"styled-components";var Ai=_a.div`
820
+ `;import Wa from"styled-components";var Ai=Wa.div`
817
821
  flex-direction: column;
818
822
  justify-content: center;
819
823
  display: flex;
820
- `;import qe from"react";import{motion as Wa}from"framer-motion";import Ve from"styled-components";var Bi=Ve.div`
824
+ `;import qe from"react";import{motion as Ha}from"framer-motion";import Ve from"styled-components";var Ni=Ve.div`
821
825
  border: 1px solid #fafafa;
822
826
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
823
827
  border-radius: 14px;
@@ -841,7 +845,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
841
845
  line-height: 12px;
842
846
  letter-spacing: 0.09em;
843
847
  margin-bottom: 12px;
844
- `,Ni=Ve.div`
848
+ `,Di=Ve.div`
845
849
  ${e=>T(e)} {
846
850
  // Anything inside this block will be ignored if the user provides a custom class
847
851
  background: #ffffff;
@@ -854,7 +858,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
854
858
 
855
859
  max-width: 150px;
856
860
  min-width: 200px;
857
- `,Di=Ve.div`
861
+ `,Mi=Ve.div`
858
862
  ${e=>T(e)} {
859
863
  background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
860
864
  }
@@ -866,13 +870,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
866
870
  justify-content: center;
867
871
  align-content: center;
868
872
  align-items: center;
869
- `,Mi=Ve.div`
873
+ `,$i=Ve.div`
870
874
  font-weight: 600;
871
875
  font-size: 20px;
872
876
  line-height: 24px;
873
877
  width: 20px;
874
878
  height: 20px;
875
- `,$i=Ve.div`
879
+ `,Ui=Ve.div`
876
880
  ${e=>T(e)} {
877
881
  color: #434343;
878
882
  }
@@ -881,20 +885,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
881
885
  line-height: 17px;
882
886
  margin-top: 12px;
883
887
  margin-bottom: 8px;
884
- `,Ui=Ve.div`
888
+ `,_i=Ve.div`
885
889
  ${e=>T(e)} {
886
890
  color: #8c8c8c;
887
891
  }
888
892
  font-weight: 400;
889
893
  font-size: 12px;
890
894
  line-height: 14px;
891
- `,_i=Ve.a`
895
+ `,Wi=Ve.a`
892
896
  color: ${e=>e.color};
893
897
  font-size: 12px;
894
898
  line-height: 14px;
895
899
  font-weight: 400;
896
900
  cursor: pointer;
897
- `;var Ha=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ne();return qe.createElement(Bi,{style:t,className:a("guideContainer",r)},qe.createElement(Li,{className:a("guideTitle",r)},o),qe.createElement(Oi,{className:a("guideItemContainer",r)},e.map((p,d)=>qe.createElement(Ni,{key:`guide-${p.id??d}`,as:Wa.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:a("guideItem",r)},p.icon&&qe.createElement(Di,{className:a("guideIcon",r)},qe.createElement(Mi,null,p.icon)),qe.createElement($i,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:ie(p.title)}),qe.createElement(Ui,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:ie(p.subtitle)}),qe.createElement(_i,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},Ht=Ha;var ja=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:h,guideTitle:m,onGuideButtonClick:g})=>{let w=({stepData:u,handleSecondaryCTAClick:b,handleCTAClick:I})=>u?N.createElement(bi,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},N.createElement(Ti,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ie(u.title)}),N.createElement(wi,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ie(u.subtitle)}),N.createElement(Fi,{className:a("checklistCTAContainer",l)},u.secondaryButtonTitle&&N.createElement(R,{title:u.secondaryButtonTitle,onClick:b,appearance:l,secondary:!0}),N.createElement(R,{title:u.primaryButtonTitle,onClick:I,appearance:l}))):N.createElement(N.Fragment,null),y={...{default:u=>{var U;if((U=e[F])!=null&&U.StepContent){let H=e[F].StepContent;return N.createElement("div",null,H)}let b=e[F];return N.createElement(w,{stepData:u,handleCTAClick:()=>{b.handlePrimaryButtonClick&&b.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{b.handleSecondaryButtonClick&&b.handleSecondaryButtonClick()}})}},...d},[C,v]=za(0),F=s??C,A=p??v,k=()=>{var u;return e?!((u=e[F])!=null&&u.type)||!y[e[F].type]?y.default(e[F]):y[e[F].type]({stepData:e[F],primaryColor:l.theme.colorPrimary}):N.createElement(N.Fragment,null)},c=e.filter(u=>u.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(zo.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=zo),N.createElement(Ye,{onClose:n,visible:r,appearance:l},N.createElement(Ii,null,N.createElement(ui,null,N.createElement(fi,{appearance:l,className:a("checklistTitle",l)},t),N.createElement(gi,{appearance:l,className:a("checklistSubtitle",l)},o)),N.createElement(mi,null,e&&e.length>0&&N.createElement(hi,{className:a("stepsContainer",l)},N.createElement(xi,null,N.createElement("div",{style:{flex:3}},N.createElement(Ci,{className:a("stepsTitle",l)},i)),N.createElement(Ei,null,N.createElement(Ne,{fillColor:l.theme.colorPrimary,style:{width:"100%"},count:c,total:e.length,appearance:l}))),N.createElement(yi,null,N.createElement(Si,{className:a("checklistStepListContainer",l),appearance:l},e.map((u,b)=>{let I=F===b;return N.createElement(ki,{selected:I,className:a(`checklistStepListItem${I?"Selected":""}`,l),key:`checklist-guide-step-${u.id??b}`,disabled:u.blocked,onClick:()=>{u.blocked||A(b)},title:u.blocked?"Finish remaining steps to continue":void 0},I&&N.createElement(mo,{className:a("checklistStepItemSelectedIndicator",l),as:Ga.div,layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),N.createElement(Pi,{selected:I,className:a(`checklistStepListStepName${I?"Selected":""}`,l)},u.stepName),N.createElement(vi,null,N.createElement(St,{value:u.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:u.progress,appearance:l}),N.createElement(Ai,null,N.createElement(kt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),N.createElement(k,null))),h&&h.length>0&&N.createElement(Ht,{steps:h,title:m,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:u=>(g&&g(u),!0)}))))):N.createElement(N.Fragment,null)},Go=ja;import{useEffect as Va,useState as qa}from"react";var Wi=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=qa(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let h=window.matchMedia(l);return h.addEventListener("change",n),[d,h.matches]}));i(p)};return Va(()=>{s()},[]),o};import he,{useEffect as tn,useState as Xa}from"react";import pe from"react";import{AnimatePresence as Ka,motion as Ya}from"framer-motion";import Ke from"styled-components";var Hi=Ke.div`
901
+ `;var za=({steps:e,style:t,title:o,primaryColor:n,appearance:i,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=le();return qe.createElement(Ni,{style:t,className:a("guideContainer",i)},qe.createElement(Li,{className:a("guideTitle",i)},o),qe.createElement(Oi,{className:a("guideItemContainer",i)},e.map((p,d)=>qe.createElement(Di,{key:`guide-${p.id??d}`,as:Ha.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:a("guideItem",i)},p.icon&&qe.createElement(Mi,{className:a("guideIcon",i)},qe.createElement($i,null,p.icon)),qe.createElement(Ui,{className:a("guideItemTitle",i),dangerouslySetInnerHTML:se(p.title)}),qe.createElement(_i,{className:a("guideItemSubtitle",i),dangerouslySetInnerHTML:se(p.subtitle)}),qe.createElement(Wi,{className:a("guideItemLink",i),color:n,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle)))))},zt=za;var Va=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:i,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:f,guideTitle:u,onGuideButtonClick:g})=>{let F=({stepData:h,handleSecondaryCTAClick:y,handleCTAClick:E})=>h?L.createElement(wi,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},L.createElement(Ti,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:se(h.title)}),L.createElement(Fi,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:se(h.subtitle)}),L.createElement(ki,{className:a("checklistCTAContainer",l)},h.secondaryButtonTitle&&L.createElement(ee,{title:h.secondaryButtonTitle,onClick:y,appearance:l,secondary:!0}),L.createElement(ee,{title:h.primaryButtonTitle,onClick:E,appearance:l}))):L.createElement(L.Fragment,null),C={...{default:h=>{var M;if((M=e[w])!=null&&M.StepContent){let _=e[w].StepContent;return L.createElement("div",null,_)}let y=e[w];return L.createElement(F,{stepData:h,handleCTAClick:()=>{y.handlePrimaryButtonClick&&y.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{y.handleSecondaryButtonClick&&y.handleSecondaryButtonClick()}})}},...d},[m,v]=Ga(0),w=s??m,B=p??v,k=()=>{var h;return e?!((h=e[w])!=null&&h.type)||!C[e[w].type]?C.default(e[w]):C[e[w].type]({stepData:e[w],primaryColor:l.theme.colorPrimary}):L.createElement(L.Fragment,null)},c=e.filter(h=>h.complete).length;return i?(l.theme.modalContainer||(l.theme.borderRadius&&(zo.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=zo),L.createElement(Ye,{onClose:r,visible:i,appearance:l},L.createElement(Bi,null,L.createElement(fi,null,L.createElement(gi,{appearance:l,className:a("checklistTitle",l)},t),L.createElement(hi,{appearance:l,className:a("checklistSubtitle",l)},o)),L.createElement(ui,null,e&&e.length>0&&L.createElement(xi,{className:a("stepsContainer",l)},L.createElement(Ci,null,L.createElement("div",{style:{flex:3}},L.createElement(Si,{className:a("stepsTitle",l)},n)),L.createElement(Ei,null,L.createElement(Le,{fillColor:l.theme.colorPrimary,style:{width:"100%"},count:c,total:e.length,appearance:l}))),L.createElement(yi,null,L.createElement(bi,{className:a("checklistStepListContainer",l),appearance:l},e.map((h,y)=>{let E=w===y;return L.createElement(Pi,{selected:E,className:a(`checklistStepListItem${E?"Selected":""}`,l),key:`checklist-guide-step-${h.id??y}`,disabled:h.blocked,onClick:()=>{h.blocked||B(y)},title:h.blocked?"Finish remaining steps to continue":void 0},E&&L.createElement(mo,{className:a("checklistStepItemSelectedIndicator",l),as:ja.div,layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),L.createElement(vi,{selected:E,className:a(`checklistStepListStepName${E?"Selected":""}`,l)},h.stepName),L.createElement(Ii,null,L.createElement(bt,{value:h.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:h.progress,appearance:l}),L.createElement(Ai,null,L.createElement(Pt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),L.createElement(k,null))),f&&f.length>0&&L.createElement(zt,{steps:f,title:u,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:h=>(g&&g(h),!0)}))))):L.createElement(L.Fragment,null)},Go=Va;import{useEffect as qa,useState as Ka}from"react";var Hi=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,n]=Ka(t),i=null,r=()=>{i!==null?clearTimeout(i):s(),i=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let f=window.matchMedia(l);return f.addEventListener("change",r),[d,f.matches]}));n(p)};return qa(()=>{s()},[]),o};import he,{useEffect as on,useState as Ja}from"react";import de from"react";import{AnimatePresence as Ya,motion as Xa}from"framer-motion";import Ke from"styled-components";var zi=Ke.div`
898
902
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
899
903
  border: 1px solid;
900
904
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -906,42 +910,42 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
906
910
  display: flex;
907
911
  flex-direction: column;
908
912
  transition: max-height 0.25s;
909
- `,zi=Ke.div`
913
+ `,Gi=Ke.div`
910
914
  display: flex;
911
915
  margin-bottom: 20px;
912
- `,Gi=Ke.img`
916
+ `,ji=Ke.img`
913
917
  border-radius: 4px;
914
918
  max-height: 260px;
915
919
  min-height: 200px;
916
- `,ji=Ke.div`
920
+ `,Vi=Ke.div`
917
921
  display: flex;
918
922
  flex-direction: row;
919
923
  justify-content: space-between;
920
924
  align-items: center;
921
- `,Vi=Ke.p`
925
+ `,qi=Ke.p`
922
926
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
923
927
  font-style: normal;
924
928
  font-weight: 500;
925
929
  font-size: 16px;
926
930
  line-height: 18px;
927
931
  margin-left: 8px;
928
- `,qi=Ke.div`
932
+ `,Ki=Ke.div`
929
933
  padding: 20px;
930
934
  cursor: pointer;
931
935
  :hover {
932
936
  opacity: 0.8;
933
937
  }
934
- `,eh=Ke.div``,Ki=Ke.p`
938
+ `,th=Ke.div``,Yi=Ke.p`
935
939
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
936
940
  font-weight: 400;
937
941
  font-size: 14px;
938
942
  line-height: 22px;
939
- `,Yi=Ke.div`
943
+ `,Xi=Ke.div`
940
944
  display: flex;
941
945
  flex-direction: row;
942
946
  justify-content: flex-start;
943
947
  align-items: center;
944
- `;var Xi=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n})=>{var p,d;let s=t?{}:{transform:"rotate(90deg)"};return pe.createElement(Hi,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},pe.createElement(ji,{className:a("stepHeader",n)},pe.createElement(Yi,null,pe.createElement(co,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(p=n==null?void 0:n.theme)==null?void 0:p.colorPrimary,appearance:n}),pe.createElement(Vi,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:ie(e.title)})),pe.createElement(qi,{className:a("stepChevronContainer",n),onClick:()=>o()},pe.createElement(kt,{style:{...s,transition:"transform 0.1s ease-in-out"},color:(d=n==null?void 0:n.theme)==null?void 0:d.colorTextSecondary}))),pe.createElement(Ka,null,!t&&pe.createElement(Ya.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},e.imageUri||e.videoUri&&pe.createElement(zi,{className:a("stepMediaContainer",n)},e.imageUri?pe.createElement(Gi,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?pe.createElement(Ct,{appearance:n,videoUri:e.videoUri}):null),pe.createElement(Ki,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:ie(e.subtitle)}),pe.createElement(to,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?pe.createElement(R,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,pe.createElement(R,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))))};import Pt from"styled-components";var fh=Pt.div`
948
+ `;var Ji=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:i,appearance:r})=>{var p,d;let s=t?{}:{transform:"rotate(90deg)"};return de.createElement(zi,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},de.createElement(Vi,{className:a("stepHeader",r)},de.createElement(Xi,null,de.createElement(co,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(p=r==null?void 0:r.theme)==null?void 0:p.colorPrimary,appearance:r}),de.createElement(qi,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:se(e.title)})),de.createElement(Ki,{className:a("stepChevronContainer",r),onClick:()=>o()},de.createElement(Pt,{style:{...s,transition:"transform 0.1s ease-in-out"},color:(d=r==null?void 0:r.theme)==null?void 0:d.colorTextSecondary}))),de.createElement(Ya,null,!t&&de.createElement(Xa.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},e.imageUri||e.videoUri&&de.createElement(Gi,{className:a("stepMediaContainer",r)},e.imageUri?de.createElement(ji,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?de.createElement(St,{appearance:r,videoUri:e.videoUri}):null),de.createElement(Yi,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:se(e.subtitle)}),de.createElement(oo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?de.createElement(ee,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>i(),appearance:r}):null,de.createElement(ee,{title:e.primaryButtonTitle??"Continue",onClick:()=>n(),appearance:r})))))};import vt from"styled-components";var gh=vt.div`
945
949
  background: #ffffff;
946
950
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
947
951
  border-radius: 6px;
@@ -955,49 +959,49 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
955
959
 
956
960
  max-width: 800px;
957
961
  min-width: 350px;
958
- `,Ji=Pt.div`
962
+ `,Qi=vt.div`
959
963
  display: flex;
960
964
  flex-direction: column;
961
- `,Qi=Pt.h1`
965
+ `,Zi=vt.h1`
962
966
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
963
967
  font-style: normal;
964
968
  font-weight: 700;
965
969
  font-size: 20px;
966
970
  line-height: 24px;
967
971
  margin-bottom: 8px;
968
- `,Zi=Pt.h2`
972
+ `,Ri=vt.h2`
969
973
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
970
974
  font-weight: 400;
971
975
  font-size: 14px;
972
976
  line-height: 23px;
973
977
  margin: 2px 0 0 0;
974
- `,Ri=Pt.div`
978
+ `,en=vt.div`
975
979
  display: block;
976
980
  width: 100%;
977
- `,en=Pt.div`
981
+ `,tn=vt.div`
978
982
  display: flex;
979
983
  width: 100%;
980
984
  flex-direction: column;
981
985
  justify-content: space-between;
982
986
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
983
987
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
984
- `;var Ja=({title:e,subtitle:t,steps:o,onClose:i,visible:r,onCompleteStep:n,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:l="#000000",selectedStep:h,setSelectedStep:m,appearance:g,type:w,className:x})=>{let y=o.filter(c=>c.complete).length,[C,v]=Xa(Array(o.length).fill(!0));tn(()=>{let c=[...C];if(s){for(let u=0;u<o.length;u++)if(!o[u].complete){c[u]=!1;break}v(c)}},[]),tn(()=>{F(h)},[h]);let F=c=>{let u=[...C];if(p)for(let b=0;b<C.length;++b)b!==c&&(u[b]=!0);u[c]=!u[c],v(u)};if(!r&&w=="modal")return he.createElement(he.Fragment,null);let A=he.createElement(he.Fragment,null,he.createElement(Ji,null,he.createElement(Qi,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:ie(e)}),he.createElement(Zi,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:ie(t)})),he.createElement(Ne,{display:"percent",count:y,total:o.length,fillColor:l,style:{margin:"14px 0px 8px 0px"},appearance:g})),k=he.createElement(Ri,{className:Ce(a("checklistContainer",g),x)},o.map((c,u)=>{let b=C[u];return he.createElement(Xi,{appearance:g,stepData:c,collapsed:b,key:`modal-checklist-${c.id??u}`,onClick:()=>{if(h===u){F(u);return}m(u)},onPrimaryButtonClick:()=>{n&&n(u,c),c.handlePrimaryButtonClick&&c.handlePrimaryButtonClick(),d&&!c.completionCriteria&&u<C.length-1&&C[u+1]&&m(u+1)},onSecondaryButtonClick:()=>{c.handleSecondaryButtonClick&&c.handleSecondaryButtonClick()}})}));return w==="inline"?he.createElement(en,{appearance:g,className:Ce(a("checklistInlineContainer",g),x)},A,k):he.createElement(he.Fragment,null,he.createElement(Ye,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:A},k))},jo=Ja;import te,{useEffect as Vo,useRef as op,useState as mt}from"react";import ct from"react";import ee,{css as on,keyframes as rn}from"styled-components";var nn=on`
988
+ `;var Qa=({title:e,subtitle:t,steps:o,onClose:n,visible:i,onCompleteStep:r,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:l="#000000",selectedStep:f,setSelectedStep:u,appearance:g,type:F,className:b})=>{let C=o.filter(c=>c.complete).length,[m,v]=Ja(Array(o.length).fill(!0));on(()=>{let c=[...m];if(s){for(let h=0;h<o.length;h++)if(!o[h].complete){c[h]=!1;break}v(c)}},[]),on(()=>{w(f)},[f]);let w=c=>{let h=[...m];if(p)for(let y=0;y<m.length;++y)y!==c&&(h[y]=!0);h[c]=!h[c],v(h)};if(!i&&F=="modal")return he.createElement(he.Fragment,null);let B=he.createElement(he.Fragment,null,he.createElement(Qi,null,he.createElement(Zi,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:se(e)}),he.createElement(Ri,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:se(t)})),he.createElement(Le,{display:"percent",count:C,total:o.length,fillColor:l,style:{margin:"14px 0px 8px 0px"},appearance:g})),k=he.createElement(en,{className:Ce(a("checklistContainer",g),b)},o.map((c,h)=>{let y=m[h];return he.createElement(Ji,{appearance:g,stepData:c,collapsed:y,key:`modal-checklist-${c.id??h}`,onClick:()=>{if(f===h){w(h);return}u(h)},onPrimaryButtonClick:()=>{r&&r(h,c),c.handlePrimaryButtonClick&&c.handlePrimaryButtonClick(),d&&!c.completionCriteria&&h<m.length-1&&m[h+1]&&u(h+1)},onSecondaryButtonClick:()=>{c.handleSecondaryButtonClick&&c.handleSecondaryButtonClick()}})}));return F==="inline"?he.createElement(tn,{appearance:g,className:Ce(a("checklistInlineContainer",g),b)},B,k):he.createElement(he.Fragment,null,he.createElement(Ye,{onClose:n,visible:i,appearance:g,style:{maxWidth:"600px"},headerContent:B},k))},jo=Qa;import ie,{useEffect as Vo,useRef as rp,useState as mt}from"react";import ct from"react";import re,{css as rn,keyframes as nn}from"styled-components";var sn=rn`
985
989
  border: 1px solid ${({theme:e})=>e.colorBorder};
986
- `,Qa=on`
987
- box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
988
990
  `,Za=rn`
991
+ box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
992
+ `,Ra=nn`
989
993
  from {
990
994
  opacity: 0;
991
995
  } to {
992
996
  opacity: 1;
993
997
  }
994
- `,Ra=rn`
998
+ `,ep=nn`
995
999
  from {
996
1000
  opacity: 1;
997
1001
  } to {
998
1002
  opacity: 0;
999
1003
  }
1000
- `,sn=ee.div`
1004
+ `,ln=re.div`
1001
1005
  margin: 0 -20px;
1002
1006
  overflow-x: auto;
1003
1007
  padding-left: 20px;
@@ -1014,14 +1018,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1014
1018
  ::-webkit-scrollbar {
1015
1019
  display: none;
1016
1020
  }
1017
- `,ln=ee.div`
1021
+ `,an=re.div`
1018
1022
  display: flex;
1019
1023
  flex-flow: row nowrap;
1020
1024
  gap: 0 16px;
1021
1025
  scroll-snap-align: center;
1022
1026
  scroll-snap-stop: always;
1023
- `,an=ee.div`
1024
- animation: ${e=>e.reversed?Ra:Za} 0.25s ease-out;
1027
+ `,pn=re.div`
1028
+ animation: ${e=>e.reversed?ep:Ra} 0.25s ease-out;
1025
1029
  background: linear-gradient(
1026
1030
  to right,
1027
1031
  ${({theme:e})=>e.colorBackground}00,
@@ -1029,8 +1033,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1029
1033
  );
1030
1034
  position: absolute;
1031
1035
  width: 64px;
1032
- `,pn=ee.button`
1033
- ${nn}
1036
+ `,dn=re.button`
1037
+ ${sn}
1034
1038
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
1035
1039
  align-items: center;
1036
1040
  border-radius: 50%;
@@ -1041,11 +1045,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1041
1045
  justify-content: center;
1042
1046
  position: absolute;
1043
1047
  width: 48px;
1044
- `,dn=ee.div`
1048
+ `,cn=re.div`
1045
1049
  border-radius: ${({theme:e})=>e.borderRadius}px;
1046
1050
  padding: 20px;
1047
- `,cn=ee(dn)`
1048
- ${nn}
1051
+ `,mn=re(cn)`
1052
+ ${sn}
1049
1053
  background: ${({theme:e})=>e.colorBackground};
1050
1054
 
1051
1055
  &:active {
@@ -1056,74 +1060,74 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1056
1060
  ${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
1057
1061
  ${e=>e.blocked?"cursor: default":"cursor: pointer"}
1058
1062
  }
1059
- `,mn=ee.img`
1063
+ `,un=re.img`
1060
1064
  border-radius: 50%;
1061
1065
  height: 40px;
1062
1066
  margin-bottom: 12px;
1063
1067
  width: 40px;
1064
- `,un=ee(dn)`
1068
+ `,fn=re(cn)`
1065
1069
  ${e=>T(e)} {
1066
- ${Qa}
1070
+ ${Za}
1067
1071
 
1068
1072
  background: ${({theme:e})=>e.colorBackground};
1069
1073
  }
1070
- `,fn=ee.div`
1074
+ `,gn=re.div`
1071
1075
  color: ${({theme:e})=>e.colorPrimary};
1072
1076
  display: flex;
1073
1077
  flex-flow: row nowrap;
1074
1078
  align-items: center;
1075
1079
  margin-left: 20px;
1076
- `,gn=ee.div`
1080
+ `,hn=re.div`
1077
1081
  white-space: nowrap;
1078
- `,hn=ee.div`
1082
+ `,xn=re.div`
1079
1083
  background: #d8fed8;
1080
1084
  border-radius: 6px;
1081
1085
  margin-bottom: 12px;
1082
1086
  padding: 4px 10px;
1083
- `,ep=ee.p`
1087
+ `,tp=re.p`
1084
1088
  font-weight: bold;
1085
1089
  font-size: 18px;
1086
1090
  line-height: 22px;
1087
1091
  letter-spacing: calc(18px * -0.01);
1088
1092
  margin: 0;
1089
- `,xn=ee(ep)`
1093
+ `,Cn=re(tp)`
1090
1094
  margin-bottom: 4px;
1091
- `,tp=ee.p`
1095
+ `,op=re.p`
1092
1096
  font-weight: bold;
1093
1097
  font-size: 16px;
1094
1098
  line-height: 20px;
1095
1099
  letter-spacing: calc(16px * -0.01);
1096
1100
  margin: 0;
1097
- `,Cn=ee(tp)`
1101
+ `,Sn=re(op)`
1098
1102
  margin-bottom: 4px;
1099
1103
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1100
1104
  `}
1101
- `,De=ee.p`
1105
+ `,De=re.p`
1102
1106
  color: ${({theme:e})=>e.colorText};
1103
1107
  font-weight: normal;
1104
1108
  font-size: 14px;
1105
1109
  line-height: 22px;
1106
1110
  margin: 0;
1107
- `,yn=ee.p`
1111
+ `,yn=re.p`
1108
1112
  color: ${({theme:e})=>e.colorText};
1109
1113
  font-weight: 600;
1110
1114
  font-size: 12px;
1111
1115
  line-height: 16px;
1112
1116
  margin: 0;
1113
- `;De.Loud=ee(De)`
1117
+ `;De.Loud=re(De)`
1114
1118
  font-weight: 600;
1115
- `;De.Quiet=ee(De)`
1119
+ `;De.Quiet=re(De)`
1116
1120
  color: ${({theme:e})=>e.colorTextSecondary};
1117
1121
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1118
1122
  `}
1119
- `;var Sn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=J(),{primaryCTAClickSideEffects:r}=ne(),{theme:n,styleOverrides:s}=i(o),{imageUri:p=null,subtitle:d=null,title:l=null,complete:h=!1,blocked:m=!1}=e,g=()=>{r(e)};return ct.createElement(cn,{className:a("carouselCard",o),onClick:m?null:g,style:t,blocked:m,complete:h},ct.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&ct.createElement(mn,{className:a("carouselCardImage",o),src:p,alt:l,style:{opacity:h||m?.4:1}}),h&&ct.createElement(hn,{className:a("carouselCompletedPill",o)},ct.createElement(yn,{style:{color:"#108E0B"}},"Complete"))),l&&ct.createElement(Cn,{blocked:m,complete:h,className:a("carouselCardTitle",o)},l),d&&ct.createElement(De.Quiet,{blocked:m,complete:h,className:a("carouselCardSubtitle",o)},d))};import zt from"react";var bn=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let i=t>0?e/t:0,r=200,n=Math.min(r,Math.max(10,Math.round(r*i)));return zt.createElement(fn,{className:a("carouselProgressBar",o)},zt.createElement(gn,{as:De.Loud,style:{marginRight:8}},e," of ",t),zt.createElement("svg",{height:10,width:r},zt.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),zt.createElement("rect",{x:0,y:0,rx:5,width:n,height:10,fill:"currentColor"})))};var rp=()=>te.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},te.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),te.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),te.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Tn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=mt(!1),[n,s]=mt(!1);Vo(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?te.createElement(an,{style:d,reversed:n,onAnimationEnd:n?p:null},te.createElement(pn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},te.createElement(rp,null))):null},wn=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=op(null),[n,s]=mt(!1),[p,d]=mt(!1),[l,h]=mt(null),[m,g]=mt([]),[w,x]=mt(0),{getFlowMetadata:y,getFlowSteps:C,getNumberOfStepsCompleted:v,updateCustomVariables:F,getFlowStatus:A,isLoading:k,targetingLogicShouldHideFlow:c,getFlow:u}=Y();Vo(()=>{F(o)},[o,k]),Vo(()=>{if(k)return;let L=y(e),W=v(e),D=C(e);h(L),L.data!==null&&(g(D.sort((V,j)=>Number(V.complete)-Number(j.complete))),d(D.length>3),x(W))},[k]);let b=[];for(let L=0;L<m.length;L+=3)b.push(m.slice(L,L+3));let I=L=>{let W=L.target,D=W.scrollWidth-W.clientWidth,V=Math.ceil(W.scrollLeft);V>0&&n===!1&&s(!0),V===0&&n===!0&&s(!1),V<D&&p===!1&&d(!0),V===D&&p===!0&&d(!1)},$=(L=!0)=>{let W=L?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*W,behavior:"smooth"})},U=null,H=L=>{U!==null?clearTimeout(U):I(L),U=setTimeout(()=>{I(L)},16)};return k?null:te.createElement(un,{className:Ce(a("carouselContainer",t),i)},te.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},te.createElement("div",null,te.createElement(xn,{className:a("carouselTitle",t)},l==null?void 0:l.title),te.createElement(De.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),te.createElement(bn,{numberOfStepsCompleted:w,numberOfSteps:m.length})),te.createElement("div",{style:{position:"relative"}},te.createElement(Tn,{show:n,onClick:()=>$(!1)}),te.createElement(Tn,{side:"right",show:p,onClick:$}),te.createElement(sn,{ref:r,onScroll:H},b.map((L,W)=>te.createElement(ln,{key:W,style:{flex:`0 0 calc(100% - ${m.length>3?36:0}px)`}},L.map((D,V)=>te.createElement(Sn,{key:V,stepData:D,style:{flex:m.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var qo=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:h,onButtonClick:m,appearance:g,hideOnFlowCompletion:w,setVisible:x,customStepTypes:y,checklistStyle:C="default",...v})=>{let{getFlow:F,getFlowSteps:A,markStepCompleted:k,getStepStatus:c,getNumberOfStepsCompleted:u,isLoading:b,targetingLogicShouldHideFlow:I,updateCustomVariables:$,getFlowMetadata:U,isStepBlocked:H,getFlowStatus:L,hasActiveFullPageFlow:W,setHasActiveFullPageFlow:D}=Y(),{primaryCTAClickSideEffects:V,secondaryCTAClickSideEffects:j}=ne(),{getOpenFlowState:z,setOpenFlowState:q}=ke(),[Q,le]=kn(r||0),[O,fe]=kn(!1),X=d===void 0?z(e):d,B=s==="modal",{mergeAppearanceWithDefault:re}=J(),{isLarge:Ue}=Wi();if(g=re(g),Fn(()=>{$(l)},[l,b]),Fn(()=>{d!==void 0&&(B&&d===!0?D(!0):B&&d===!1&&D(!1))},[d,x,W]),b)return null;let xe=F(e);if(!xe||I(xe))return null;let Se=A(e);if(!Se||w===!0&&L(e)===Z)return null;let ce=U(e);if(ce!=null&&ce.title&&(t=ce.title),ce!=null&&ce.subtitle&&(o=ce.subtitle),!O&&r===void 0&&u(e)>0){let E=Math.min(u(e),Se.length-1);le(E),fe(!0)}function _e(){if(Q+1>=Se.length){B&&q(e,!1);return}H(e,Se[Q+1].id)||le(Q+1)}function We(E,K,tt){let Jo=Q+1<Se.length?Se[Q+1]:null;m&&m(E,Q,K,Jo)===!0&&B&&Ae(),h&&h(E,tt,Jo),!h&&!m&&(E.primaryButtonUri||E.secondaryButtonUri)&&B&&Ae()}function et(){return Se.map((E,K)=>({...E,handleSecondaryButtonClick:()=>{_e(),j(E),E.skippable===!0&&k(e,E.id,{skipped:!0}),We(E,"secondary",K)},handlePrimaryButtonClick:()=>{(!E.completionCriteria&&(E.autoMarkCompleted||E.autoMarkCompleted===void 0)||E.completionCriteria&&E.autoMarkCompleted===!0)&&(k(e,E.id),_e()),We(E,"primary",K),V(E),c(e,E.id)===Fe&&_e()}}))}function _(){return oe.createElement(ae,{appearance:g})}let Ie={steps:et(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:y,type:s,className:n};function Ae(){q(e,!1),p&&p(),x&&x(!1)}function bo(){return oe.createElement(oe.Fragment,null,oe.createElement(_,null),oe.createElement(wn,{flowId:e,appearance:g,customVariables:l,className:n}))}function f(){return oe.createElement(oe.Fragment,null,oe.createElement(_,null),oe.createElement(jo,{visible:X,onClose:()=>{Ae()},selectedStep:Q,setSelectedStep:le,autoExpandNextStep:!0,appearance:g,...Ie}))}function S(){if(!Ue)return f();let E=v.guideFlowId,K;return E&&F(E)&&(K=A(E)),oe.createElement(oe.Fragment,null,oe.createElement(_,null),oe.createElement(Go,{visible:X,stepsTitle:ce.stepsTitle?ce.stepsTitle:"Your quick start guide",onClose:()=>{Ae()},selectedStep:Q,setSelectedStep:le,guideData:K,guideTitle:v.guideTitle??"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:tt=>{We(tt,"link",0)},...Ie}))}function P(){if(!Ue)return f();let E=oe.createElement(Ho,{flowId:e,style:i,selectedStep:Q,setSelectedStep:le,appearance:g,type:s,...Ie});return B?oe.createElement(Ye,{onClose:()=>{Ae()},visible:X,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},oe.createElement(_,null),E):oe.createElement(oe.Fragment,null,oe.createElement(_,null),E)}switch(C){case"condensed":return f();case"with-guide":return S();case"default":return P();case"carousel":return bo();default:return P()}};var np=e=>ip.createElement(qo,{type:"inline",...e});import Ze,{useEffect as lp}from"react";import Me from"react";import xo from"styled-components";var Pn=xo.div`
1123
+ `;var bn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=Q(),{primaryCTAClickSideEffects:i}=le(),{theme:r,styleOverrides:s}=n(o),{imageUri:p=null,subtitle:d=null,title:l=null,complete:f=!1,blocked:u=!1}=e,g=()=>{i(e)};return ct.createElement(mn,{className:a("carouselCard",o),onClick:u?null:g,style:t,blocked:u,complete:f},ct.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&ct.createElement(un,{className:a("carouselCardImage",o),src:p,alt:l,style:{opacity:f||u?.4:1}}),f&&ct.createElement(xn,{className:a("carouselCompletedPill",o)},ct.createElement(yn,{style:{color:"#108E0B"}},"Complete"))),l&&ct.createElement(Sn,{blocked:u,complete:f,className:a("carouselCardTitle",o)},l),d&&ct.createElement(De.Quiet,{blocked:u,complete:f,className:a("carouselCardSubtitle",o)},d))};import Gt from"react";var wn=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let n=t>0?e/t:0,i=200,r=Math.min(i,Math.max(10,Math.round(i*n)));return Gt.createElement(gn,{className:a("carouselProgressBar",o)},Gt.createElement(hn,{as:De.Loud,style:{marginRight:8}},e," of ",t),Gt.createElement("svg",{height:10,width:i},Gt.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"#E6E6E6"}),Gt.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"currentColor"})))};var ip=()=>ie.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ie.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ie.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ie.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Tn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,i]=mt(!1),[r,s]=mt(!1);Vo(()=>{t===!0&&n===!1?i(!0):t===!1&&n===!0&&s(!0)},[t]);let p=()=>{i(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return n?ie.createElement(pn,{style:d,reversed:r,onAnimationEnd:r?p:null},ie.createElement(dn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ie.createElement(ip,null))):null},Fn=({flowId:e,appearance:t,customVariables:o,className:n})=>{let i=rp(null),[r,s]=mt(!1),[p,d]=mt(!1),[l,f]=mt(null),[u,g]=mt([]),[F,b]=mt(0),{getFlowMetadata:C,getFlowSteps:m,getNumberOfStepsCompleted:v,updateCustomVariables:w,getFlowStatus:B,isLoading:k,targetingLogicShouldHideFlow:c,getFlow:h}=X();Vo(()=>{w(o)},[o,k]),Vo(()=>{if(k)return;let O=C(e),H=v(e),N=m(e);f(O),O.data!==null&&(g(N.sort((j,K)=>Number(j.complete)-Number(K.complete))),d(N.length>3),b(H))},[k]);let y=[];for(let O=0;O<u.length;O+=3)y.push(u.slice(O,O+3));let E=O=>{let H=O.target,N=H.scrollWidth-H.clientWidth,j=Math.ceil(H.scrollLeft);j>0&&r===!1&&s(!0),j===0&&r===!0&&s(!1),j<N&&p===!1&&d(!0),j===N&&p===!0&&d(!1)},U=(O=!0)=>{let H=O?1:-1;i.current!==null&&i.current.scrollBy({left:i.current.clientWidth*H,behavior:"smooth"})},M=null,_=O=>{M!==null?clearTimeout(M):E(O),M=setTimeout(()=>{E(O)},16)};return k?null:ie.createElement(fn,{className:Ce(a("carouselContainer",t),n)},ie.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},ie.createElement("div",null,ie.createElement(Cn,{className:a("carouselTitle",t)},l==null?void 0:l.title),ie.createElement(De.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ie.createElement(wn,{numberOfStepsCompleted:F,numberOfSteps:u.length})),ie.createElement("div",{style:{position:"relative"}},ie.createElement(Tn,{show:r,onClick:()=>U(!1)}),ie.createElement(Tn,{side:"right",show:p,onClick:U}),ie.createElement(ln,{ref:i,onScroll:_},y.map((O,H)=>ie.createElement(an,{key:H,style:{flex:`0 0 calc(100% - ${u.length>3?36:0}px)`}},O.map((N,j)=>ie.createElement(bn,{key:j,stepData:N,style:{flex:u.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var qo=({flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:i,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:f,onButtonClick:u,appearance:g,hideOnFlowCompletion:F,setVisible:b,customStepTypes:C,checklistStyle:m="default",...v})=>{let{getFlow:w,getFlowSteps:B,markStepCompleted:k,getStepStatus:c,getNumberOfStepsCompleted:h,isLoading:y,targetingLogicShouldHideFlow:E,updateCustomVariables:U,getFlowMetadata:M,isStepBlocked:_,getFlowStatus:O,hasActiveFullPageFlow:H,setHasActiveFullPageFlow:N}=X(),{primaryCTAClickSideEffects:j,secondaryCTAClickSideEffects:K}=le(),{getOpenFlowState:V,setOpenFlowState:z}=ke(),[te,oe]=Pn(i||0),[Z,$]=Pn(!1),J=d===void 0?V(e):d,A=s==="modal",{mergeAppearanceWithDefault:q}=Q(),{isLarge:Ue}=Hi();if(g=q(g),kn(()=>{U(l)},[l,y]),kn(()=>{d!==void 0&&(A&&d===!0?N(!0):A&&d===!1&&N(!1))},[d,b,H]),y)return null;let xe=w(e);if(!xe||E(xe))return null;let ye=B(e);if(!ye||F===!0&&O(e)===R)return null;let me=M(e);if(me!=null&&me.title&&(t=me.title),me!=null&&me.subtitle&&(o=me.subtitle),!Z&&i===void 0&&h(e)>0){let I=Math.min(h(e),ye.length-1);oe(I),$(!0)}function _e(){if(te+1>=ye.length){A&&z(e,!1);return}_(e,ye[te+1].id)||oe(te+1)}function We(I,Y,tt){let Jo=te+1<ye.length?ye[te+1]:null;u&&u(I,te,Y,Jo)===!0&&A&&Be(),f&&f(I,tt,Jo),!f&&!u&&(I.primaryButtonUri||I.secondaryButtonUri)&&A&&Be()}function et(){return ye.map((I,Y)=>({...I,handleSecondaryButtonClick:()=>{_e(),K(I),I.skippable===!0&&k(e,I.id,{skipped:!0}),We(I,"secondary",Y)},handlePrimaryButtonClick:()=>{(!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)||I.completionCriteria&&I.autoMarkCompleted===!0)&&(k(e,I.id),_e()),We(I,"primary",Y),j(I),c(e,I.id)===Fe&&_e()}}))}function W(){return ne.createElement(pe,{appearance:g})}let Ee={steps:et(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:C,type:s,className:r};function Be(){z(e,!1),p&&p(),b&&b(!1)}function bo(){return ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(Fn,{flowId:e,appearance:g,customVariables:l,className:r}))}function x(){return ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(jo,{visible:J,onClose:()=>{Be()},selectedStep:te,setSelectedStep:oe,autoExpandNextStep:!0,appearance:g,...Ee}))}function S(){if(!Ue)return x();let I=v.guideFlowId,Y;return I&&w(I)&&(Y=B(I)),ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(Go,{visible:J,stepsTitle:me.stepsTitle?me.stepsTitle:"Your quick start guide",onClose:()=>{Be()},selectedStep:te,setSelectedStep:oe,guideData:Y,guideTitle:v.guideTitle??"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:tt=>{We(tt,"link",0)},...Ee}))}function P(){if(!Ue)return x();let I=ne.createElement(Ho,{flowId:e,style:n,selectedStep:te,setSelectedStep:oe,appearance:g,type:s,...Ee});return A?ne.createElement(Ye,{onClose:()=>{Be()},visible:J,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ne.createElement(W,null),I):ne.createElement(ne.Fragment,null,ne.createElement(W,null),I)}switch(m){case"condensed":return x();case"with-guide":return S();case"default":return P();case"carousel":return bo();default:return P()}};var sp=e=>np.createElement(qo,{type:"inline",...e});import Ze,{useEffect as ap}from"react";import Me from"react";import xo from"styled-components";var vn=xo.div`
1120
1124
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1121
1125
  border-radius: 8px;
1122
1126
  padding: 6px 10px 6px 10px;
1123
1127
  min-width: 160px;
1124
1128
  cursor: pointer;
1125
1129
  background-color: ${e=>e.appearance.theme.colorBackground}};
1126
- `,vn=xo.div`
1130
+ `,In=xo.div`
1127
1131
  display: flex;
1128
1132
  flex-direction: row;
1129
1133
  justify-content: space-between;
@@ -1137,13 +1141,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1137
1141
  line-height: 15px;
1138
1142
  text-align: ${e=>e.type==="condensed"?"left":"right"};
1139
1143
  color: ${e=>e.appearance.theme.colorPrimary};
1140
- `,In=xo.div`
1144
+ `,Bn=xo.div`
1141
1145
  width: 20px;
1142
1146
  margin-right: 8px;
1143
1147
  display: flex;
1144
1148
  height: 100%;
1145
1149
  align-items: center;
1146
- `;import{motion as sp}from"framer-motion";var An=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Me.createElement(Me.Fragment,null,Me.createElement(ae,{appearance:s}),Me.createElement(Pn,{as:sp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:Ce(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Me.createElement(In,{className:a("progressRingContainer",s)},Me.createElement(Dt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Me.createElement(vn,{type:p,className:a("badgeTitleContainer",s)},Me.createElement(En,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Me.createElement(kt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Me.createElement(Ne,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import Qe from"react";import Gt from"styled-components";var Bn=Gt.div`
1150
+ `;import{motion as lp}from"framer-motion";var An=({title:e,count:t,total:o,onClick:n,style:i={},className:r,appearance:s,type:p="default"})=>Me.createElement(Me.Fragment,null,Me.createElement(pe,{appearance:s}),Me.createElement(vn,{as:lp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>n!==void 0&&n(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...i},className:Ce(r??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Me.createElement(Bn,{className:a("progressRingContainer",s)},Me.createElement(Mt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Me.createElement(In,{type:p,className:a("badgeTitleContainer",s)},Me.createElement(En,{type:p,appearance:s,className:a("badgeTitle",s)},e),n!==void 0&&Me.createElement(Pt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Me.createElement(Le,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import Qe from"react";import jt from"styled-components";var Nn=jt.div`
1147
1151
  display: flex;
1148
1152
  flex-direction: row;
1149
1153
  width: 100%;
@@ -1154,25 +1158,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1154
1158
  border-width: 1px;
1155
1159
  border-color: ${e=>e.appearance.theme.colorPrimary};
1156
1160
  border-radius: 12px;
1157
- `,On=Gt.div`
1161
+ `,On=jt.div`
1158
1162
  ${e=>T(e)} {
1159
1163
  display: flex;
1160
1164
  justify-content: center;
1161
1165
  align-items: center;
1162
1166
  margin-right: 16px;
1163
1167
  }
1164
- `,Ln=Gt.div`
1168
+ `,Ln=jt.div`
1165
1169
  display: flex;
1166
1170
  flex-direction: column;
1167
1171
  flex: 1;
1168
1172
  margin-top: 0;
1169
- `,Nn=Gt.div`
1173
+ `,Dn=jt.div`
1170
1174
  display: flex;
1171
1175
  flex-direction: column;
1172
1176
  justify-content: center;
1173
1177
  margin-left: 16px;
1174
1178
  min-width: 200px;
1175
- `,Ax=Gt.div`
1179
+ `,Ax=jt.div`
1176
1180
  display: flex;
1177
1181
  justify-content: center;
1178
1182
  align-items: flex-end;
@@ -1181,7 +1185,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1181
1185
  :hover {
1182
1186
  opacity: 0.8;
1183
1187
  }
1184
- `;var Dn=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>Qe.createElement(Qe.Fragment,null,Qe.createElement(Bn,{appearance:i,className:Ce(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&Qe.createElement(On,{className:a("fullWidthProgressBadgeIcon",i)},o),Qe.createElement(Ln,null,Qe.createElement(we,{size:"small",appearance:i,title:e,subtitle:t})),Qe.createElement(Nn,{className:a("fullWidthProgressBadgeProgressContainer",i)},Qe.createElement(Ne,{count:r,total:n,display:"percent",textLocation:"top",fillColor:i.theme.colorPrimary}))));var ap=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:h="default"})=>{let{getFlow:m,getFlowSteps:g,getFlowStatus:w,getNumberOfStepsCompleted:x,isLoading:y,targetingLogicShouldHideFlow:C,updateCustomVariables:v}=Y(),{mergeAppearanceWithDefault:F}=J();l=F(l);let{setOpenFlowState:A,getOpenFlowState:k}=ke();if(lp(()=>{v(p)},[p,y]),y)return null;let c=m(e);if(!c||C(c)||d===!0&&w(e)===Z)return null;let u=g(e),b=x(e);return h==="full-width"?Ze.createElement(Ze.Fragment,null,Ze.createElement(ae,{appearance:l}),Ze.createElement(Dn,{title:t,subtitle:o,count:b,total:u.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):Ze.createElement(Ze.Fragment,null,Ze.createElement(ae,{appearance:l}),Ze.createElement(An,{count:b,total:u.length,title:t,style:r,onClick:()=>{A(e,!0),n&&n()},type:h,className:s,appearance:l}))};import pp from"react";var dp=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=J();o=p(o);let d=r(e);if(!d||n(d))return null;let l=s(e);return pp.createElement(Ht,{steps:l,style:t,appearance:o,...i})};import Et,{useContext as Tp,useEffect as wp}from"react";import M,{useEffect as Co,useLayoutEffect as qn,useRef as gp,useState as jt}from"react";import Vt from"styled-components";import{useCallback as cp,useEffect as mp,useState as up}from"react";var Ko=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}},Mn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function fp(e){let t=Mn;return e&&(t=e.getBoundingClientRect()),t}function $n(e,t){let[o,i]=up(Mn),r=cp(()=>{e&&i(fp(e))},[e]);return mp(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}import Re from"styled-components";var Un=Re.div`
1188
+ `;var Mn=({title:e,subtitle:t,icon:o,appearance:n,count:i,total:r,className:s,style:p})=>Qe.createElement(Qe.Fragment,null,Qe.createElement(Nn,{appearance:n,className:Ce(a("fullWidthProgressBadgeContainer",n),s??""),style:p},o&&Qe.createElement(On,{className:a("fullWidthProgressBadgeIcon",n)},o),Qe.createElement(Ln,null,Qe.createElement(Te,{size:"small",appearance:n,title:e,subtitle:t})),Qe.createElement(Dn,{className:a("fullWidthProgressBadgeProgressContainer",n)},Qe.createElement(Le,{count:i,total:r,display:"percent",textLocation:"top",fillColor:n.theme.colorPrimary}))));var pp=({flowId:e,title:t,subtitle:o,icon:n,style:i,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:f="default"})=>{let{getFlow:u,getFlowSteps:g,getFlowStatus:F,getNumberOfStepsCompleted:b,isLoading:C,targetingLogicShouldHideFlow:m,updateCustomVariables:v}=X(),{mergeAppearanceWithDefault:w}=Q();l=w(l);let{setOpenFlowState:B,getOpenFlowState:k}=ke();if(ap(()=>{v(p)},[p,C]),C)return null;let c=u(e);if(!c||m(c)||d===!0&&F(e)===R)return null;let h=g(e),y=b(e);return f==="full-width"?Ze.createElement(Ze.Fragment,null,Ze.createElement(pe,{appearance:l}),Ze.createElement(Mn,{title:t,subtitle:o,count:y,total:h.length,style:i,className:s,appearance:l,icon:n,onClick:()=>{}})):Ze.createElement(Ze.Fragment,null,Ze.createElement(pe,{appearance:l}),Ze.createElement(An,{count:y,total:h.length,title:t,style:i,onClick:()=>{B(e,!0),r&&r()},type:f,className:s,appearance:l}))};import dp from"react";var cp=({flowId:e,style:t,appearance:o,...n})=>{let{getFlow:i,targetingLogicShouldHideFlow:r,getFlowSteps:s}=X(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let d=i(e);if(!d||r(d))return null;let l=s(e);return dp.createElement(zt,{steps:l,style:t,appearance:o,...n})};import Et,{useContext as Tp,useEffect as Fp}from"react";import D,{useEffect as Co,useLayoutEffect as Kn,useRef as hp,useState as Vt}from"react";import qt from"styled-components";import{useCallback as mp,useEffect as up,useState as fp}from"react";var Ko=(e,t,o,n={x:20,y:20},i)=>{let r=i=="fixed"?0:window.scrollY,s=i=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+n.x+s,y:e.top-n.y+r}:t==="right"?{x:e.left+e.width+n.x+s,y:e.top-n.y+r}:{x:0,y:0}},$n={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function gp(e){let t=$n;return e&&(t=e.getBoundingClientRect()),t}function Un(e,t){let[o,n]=fp($n),i=mp(()=>{e&&n(gp(e))},[e]);return up(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[e,t]),o}import Re from"styled-components";var _n=Re.div`
1185
1189
  ${e=>T(e)} {
1186
1190
  background: ${e=>e.appearance.theme.colorBackground};
1187
1191
  }
@@ -1192,13 +1196,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1192
1196
  min-width: 300px;
1193
1197
  padding: 22px 22px 12px;
1194
1198
  z-index: ${e=>e.zIndex};
1195
- `,_n=Re.div`
1199
+ `,Wn=Re.div`
1196
1200
  display: block;
1197
1201
  cursor: pointer;
1198
1202
  position: absolute;
1199
1203
  top: 25px;
1200
1204
  right: 22px;
1201
- `,Wn=Re.img`
1205
+ `,Hn=Re.img`
1202
1206
  ${e=>T(e)} {
1203
1207
  display: block;
1204
1208
  width: 100%;
@@ -1207,7 +1211,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1207
1211
  margin-top: ${e=>e.dismissible?"24px":"0px"};
1208
1212
  margin-bottom: 16px;
1209
1213
  }
1210
- `,Hn=Re.div`
1214
+ `,zn=Re.div`
1211
1215
  ${e=>T(e)} {
1212
1216
  display: block;
1213
1217
  width: 100%;
@@ -1216,17 +1220,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1216
1220
  margin-top: ${e=>e.dismissible?"24px":"0px"};
1217
1221
  margin-bottom: 16px;
1218
1222
  }
1219
- `,zn=Re.div`
1223
+ `,Gn=Re.div`
1220
1224
  display: flex;
1221
1225
  flex-direction: row;
1222
1226
  justify-content: space-between;
1223
1227
  align-content: center;
1224
- `,Gn=Re.div`
1228
+ `,jn=Re.div`
1225
1229
  display: flex;
1226
1230
  flex: 1;
1227
1231
  flex-direction: column;
1228
1232
  justify-content: center;
1229
- `,jn=Re.div`
1233
+ `,Vn=Re.div`
1230
1234
  display: flex;
1231
1235
  flex: 2;
1232
1236
  flex-shrink: 1;
@@ -1238,7 +1242,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1238
1242
  align-content: center;
1239
1243
  align-items: center;
1240
1244
  }
1241
- `,Vn=Re.p`
1245
+ `,qn=Re.p`
1242
1246
  ${e=>T(e)} {
1243
1247
  font-style: normal;
1244
1248
  font-weight: 600;
@@ -1247,7 +1251,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1247
1251
  color: #808080;
1248
1252
  }
1249
1253
  margin: 0;
1250
- `;var Kn=300,Yn=100,hp=500,vt=12,xp=Vt.div`
1254
+ `;var Yn=300,Xn=100,xp=500,It=12,Cp=qt.div`
1251
1255
  width: 100%;
1252
1256
  height: 100%;
1253
1257
  border-radius: 9999px;
@@ -1270,25 +1274,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1270
1274
  opacity: 0;
1271
1275
  }
1272
1276
  }
1273
- `,Cp=Vt.div`
1274
- width: ${vt}px;
1275
- height: ${vt}px;
1277
+ `,Sp=qt.div`
1278
+ width: ${It}px;
1279
+ height: ${It}px;
1276
1280
  border-radius: 100px;
1277
1281
  background-color: ${e=>e.primaryColor};
1278
1282
  z-index: 20;
1279
1283
  opacity: 1;
1280
- `,yp=Vt.div`
1284
+ `,yp=qt.div`
1281
1285
  pointer-events: all;
1282
- `,Xn=Vt.div`
1286
+ `,Jn=qt.div`
1283
1287
  display: flex;
1284
1288
  align-content: center;
1285
1289
  justify-content: center;
1286
1290
  align-items: center;
1287
1291
  z-index: ${e=>e.zIndex?e.zIndex:90};
1288
- `,Sp=Vt(Xn)`
1289
- width: ${vt+12}px;
1290
- height: ${vt+12}px;
1291
- `,bp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:h,appearance:m,dismissible:g=!1,showHighlightOnly:w,showStepCount:x=!0,completedStepsCount:y=0})=>{var ce,_e,We,et;let[C,v]=jt(),[F,A]=jt(new Date),k=gp(null),[c,u]=jt(document.querySelector(e[l].selector)),b=$n(c,F),[I,$]=jt(),[U,H]=jt(!w),L=(_e=(ce=e[l])==null?void 0:ce.props)!=null&&_e.position?e[l].props.position:"absolute",W=((et=(We=e[l])==null?void 0:We.props)==null?void 0:et.zIndex)??90,D=(C==null?void 0:C.width)??Kn,V=(C==null?void 0:C.height)??Yn;qn(()=>{k.current&&v({width:k.current.clientWidth,height:k.current.clientHeight})},[l,F,L]),Co(()=>{w||H(!0)},[l]);let j=i==="auto"?"right":i,z=Ko(b,j,D,s,L),q=b.right+D>(window.innerWidth||document.documentElement.clientWidth),Q=b.bottom+Yn>(window.innerHeight||document.documentElement.clientHeight);q&&i==="auto"&&(z=Ko(b,"left",D,s,L),j="left");let le=window.location.pathname.split("/").pop(),O=()=>{let _=document.querySelector(e[l].selector);I&&I===JSON.stringify(_==null?void 0:_.getBoundingClientRect())||(u(_),A(new Date),_&&$(JSON.stringify(_.getBoundingClientRect())))};if(Co(()=>{let _=new MutationObserver(O);return _.observe(document.body,{subtree:!0,childList:!0}),()=>_.disconnect()},[O]),Co(()=>{let _=new MutationObserver(O);return _.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>_.disconnect()},[O]),Co(()=>{let _=setInterval(()=>{O()},10);return()=>clearInterval(_)},[O]),qn(()=>{setTimeout(()=>{O()},hp),O()},[l,le]),c===null)return M.createElement(M.Fragment,null);if(z.x==0&&z.y==0)return M.createElement(M.Fragment,null);if(!p)return M.createElement(M.Fragment,null);let fe=()=>{let _=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),H(!1),setTimeout(()=>{O()},30)),y===e.length-1)return o()},Ie=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),w&&H(!1))};return M.createElement(M.Fragment,null,x&&M.createElement(Gn,null,M.createElement(Vn,{className:a("tooltipStepCounter",m)},l+1," of ",e.length)),M.createElement(jn,{showStepCount:x,className:a("tooltipCTAContainer",m)},e[l].secondaryButtonTitle&&M.createElement(R,{title:e[l].secondaryButtonTitle,appearance:m,onClick:Ie,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&M.createElement(R,{title:e[l].primaryButtonTitle,appearance:m,onClick:_,withMargin:!1,size:"small"})))},X=()=>M.createElement(M.Fragment,null,g&&M.createElement(_n,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",m)},M.createElement(Pe,null)),e[l].imageUri&&M.createElement(Wn,{dismissible:g,appearance:m,src:e[l].imageUri,className:a("tooltipImageContainer",m)}),e[l].videoUri&&!e[l].imageUri&&M.createElement(Hn,{dismissible:g,appearance:m,className:a("tooltipVideoContainer",m)},M.createElement(Ct,{appearance:m,videoUri:e[l].videoUri})),M.createElement(we,{appearance:m,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),M.createElement(zn,{className:a("tooltipFooter",m)},M.createElement(fe,null))),re={...{default:_=>{var Ie;if((Ie=e[l])!=null&&Ie.StepContent){let Ae=e[l].StepContent;return M.createElement("div",null,Ae)}return M.createElement(X,null)}},...h},Ue=()=>{var _;return e?!((_=e[l])!=null&&_.type)||!re[e[l].type]?re.default(e[l]):re[e[l].type]({stepData:e[l],primaryColor:n}):M.createElement(M.Fragment,null)};if(w&&e[l].complete===!0)return null;let xe={top:(z==null?void 0:z.y)-vt,left:(j=="left"?b.x+s.x:(z==null?void 0:z.x)-vt)??0,cursor:w?"pointer":"default",position:L},Se=()=>{w&&(A(new Date),H(!U))};return M.createElement(yp,null,M.createElement(Sp,{style:xe,zIndex:W,className:a("tourHighlightContainer",m)},r&&e[l].showHighlight!==!1&&M.createElement(M.Fragment,null,M.createElement(Cp,{style:{position:L},onClick:Se,primaryColor:m.theme.colorPrimary}),M.createElement(xp,{style:{position:"absolute"},onClick:Se,primaryColor:m.theme.colorPrimary}))),M.createElement(Xn,{style:{...xe,left:xe.left+(j=="left"?-D:24)},zIndex:W+1,className:a("tooltipContainerWrapper",m)},U&&M.createElement(Un,{ref:k,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:m,className:a("tooltipContainer",m),maxWidth:Kn,zIndex:W+10},M.createElement(Ue,null))))},yo=bp;import{Portal as Fp}from"react-portal";var kp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:h="complete-flow",onComplete:m,...g})=>{let{getFlow:w,getFlowSteps:x,isLoading:y,targetingLogicShouldHideFlow:C,markStepCompleted:v,markStepStarted:F,markFlowCompleted:A,updateCustomVariables:k,getCurrentStepIndex:c,getStepStatus:u,isStepBlocked:b,getFlowStatus:I,getNumberOfStepsCompleted:$}=Y(),{isLoadingUserFlowStateData:U}=Te(),{primaryCTAClickSideEffects:H,secondaryCTAClickSideEffects:L}=ne(),{hasOpenModals:W}=ke(),D=c(e),{openFlowStates:V}=Tp(G),{mergeAppearanceWithDefault:j}=J();if(o=j(o),wp(()=>{k(t)},[t,y]),U)return null;let z=w(e);if(!z||C(z)||I(e)==Z||W())return null;let q=x(e);if(Object.keys(V).length>0){let B=Object.keys(V).find(re=>V[re]===!0);if(B!==void 0&&B!==e)return Et.createElement(Et.Fragment,null)}async function Q(B){if(await v(e,B.id),q.map(re=>u(e,re.id)).every(re=>re===Fe)){await A(e);return}if(!l&&D+1<q.length){if(b(e,q[D+1].id))return;await F(e,q[D+1].id)}}function le(B,re,Ue){let xe=D+1<q.length?q[D+1]:null;r&&r(B,D,re,xe),i&&i(B,Ue,xe)}function O(){return q.map(B=>({...B,handleSecondaryButtonClick:async()=>{L(B),B.skippable===!0&&await v(e,B.id,{skipped:!0}),le(B,"secondary",D)},handlePrimaryButtonClick:async()=>{(!B.completionCriteria&&(B.autoMarkCompleted||B.autoMarkCompleted===void 0)||B.completionCriteria&&B.autoMarkCompleted===!0)&&await Q(B),le(B,"primary",D),H(B)}}))}async function fe(B){s&&s(),h==="complete-flow"?await A(e):await v(e,B.id)}function X(){m&&m()}return Et.createElement(Fp,null,Et.createElement(ae,{appearance:o}),n?q.map((B,re)=>Et.createElement(yo,{key:B.id,appearance:o,steps:O(),selectedStep:re,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>fe(B),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:$(e),onComplete:X,...g})):Et.createElement(yo,{appearance:o,steps:O(),selectedStep:D,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>fe(q[D]),tooltipPosition:d,completedStepsCount:$(e),showHighlightOnly:l,onComplete:X,...g}))};import ue,{useEffect as Pp,useRef as vp,useState as Ep}from"react";import{Portal as Ip}from"react-portal";import ut from"styled-components";var Jn=ut.button`
1292
+ `,bp=qt(Jn)`
1293
+ width: ${It+12}px;
1294
+ height: ${It+12}px;
1295
+ `,wp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:i=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:f,appearance:u,dismissible:g=!1,showHighlightOnly:F,showStepCount:b=!0,completedStepsCount:C=0})=>{var me,_e,We,et;let[m,v]=Vt(),[w,B]=Vt(new Date),k=hp(null),[c,h]=Vt(document.querySelector(e[l].selector)),y=Un(c,w),[E,U]=Vt(),[M,_]=Vt(!F),O=(_e=(me=e[l])==null?void 0:me.props)!=null&&_e.position?e[l].props.position:"absolute",H=((et=(We=e[l])==null?void 0:We.props)==null?void 0:et.zIndex)??90,N=(m==null?void 0:m.width)??Yn,j=(m==null?void 0:m.height)??Xn;Kn(()=>{k.current&&v({width:k.current.clientWidth,height:k.current.clientHeight})},[l,w,O]),Co(()=>{F||_(!0)},[l]);let K=n==="auto"?"right":n,V=Ko(y,K,N,s,O),z=y.right+N>(window.innerWidth||document.documentElement.clientWidth),te=y.bottom+Xn>(window.innerHeight||document.documentElement.clientHeight);z&&n==="auto"&&(V=Ko(y,"left",N,s,O),K="left");let oe=window.location.pathname.split("/").pop(),Z=()=>{let W=document.querySelector(e[l].selector);E&&E===JSON.stringify(W==null?void 0:W.getBoundingClientRect())||(h(W),B(new Date),W&&U(JSON.stringify(W.getBoundingClientRect())))};if(Co(()=>{let W=new MutationObserver(Z);return W.observe(document.body,{subtree:!0,childList:!0}),()=>W.disconnect()},[Z]),Co(()=>{let W=new MutationObserver(Z);return W.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>W.disconnect()},[Z]),Co(()=>{let W=setInterval(()=>{Z()},10);return()=>clearInterval(W)},[Z]),Kn(()=>{setTimeout(()=>{Z()},xp),Z()},[l,oe]),c===null)return D.createElement(D.Fragment,null);if(V.x==0&&V.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let $=()=>{let W=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),_(!1),setTimeout(()=>{Z()},30)),C===e.length-1)return o()},Ee=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&_(!1))};return D.createElement(D.Fragment,null,b&&D.createElement(jn,null,D.createElement(qn,{className:a("tooltipStepCounter",u)},l+1," of ",e.length)),D.createElement(Vn,{showStepCount:b,className:a("tooltipCTAContainer",u)},e[l].secondaryButtonTitle&&D.createElement(ee,{title:e[l].secondaryButtonTitle,appearance:u,onClick:Ee,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&D.createElement(ee,{title:e[l].primaryButtonTitle,appearance:u,onClick:W,withMargin:!1,size:"small"})))},J=()=>D.createElement(D.Fragment,null,g&&D.createElement(Wn,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",u)},D.createElement(Pe,null)),e[l].imageUri&&D.createElement(Hn,{dismissible:g,appearance:u,src:e[l].imageUri,className:a("tooltipImageContainer",u)}),e[l].videoUri&&!e[l].imageUri&&D.createElement(zn,{dismissible:g,appearance:u,className:a("tooltipVideoContainer",u)},D.createElement(St,{appearance:u,videoUri:e[l].videoUri})),D.createElement(Te,{appearance:u,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),D.createElement(Gn,{className:a("tooltipFooter",u)},D.createElement($,null))),q={...{default:W=>{var Ee;if((Ee=e[l])!=null&&Ee.StepContent){let Be=e[l].StepContent;return D.createElement("div",null,Be)}return D.createElement(J,null)}},...f},Ue=()=>{var W;return e?!((W=e[l])!=null&&W.type)||!q[e[l].type]?q.default(e[l]):q[e[l].type]({stepData:e[l],primaryColor:r}):D.createElement(D.Fragment,null)};if(F&&e[l].complete===!0)return null;let xe={top:(V==null?void 0:V.y)-It,left:(K=="left"?y.x+s.x:(V==null?void 0:V.x)-It)??0,cursor:F?"pointer":"default",position:O},ye=()=>{F&&(B(new Date),_(!M))};return D.createElement(yp,null,D.createElement(bp,{style:xe,zIndex:H,className:a("tourHighlightContainer",u)},i&&e[l].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(Sp,{style:{position:O},onClick:ye,primaryColor:u.theme.colorPrimary}),D.createElement(Cp,{style:{position:"absolute"},onClick:ye,primaryColor:u.theme.colorPrimary}))),D.createElement(Jn,{style:{...xe,left:xe.left+(K=="left"?-N:24)},zIndex:H+1,className:a("tooltipContainerWrapper",u)},M&&D.createElement(_n,{ref:k,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:u,className:a("tooltipContainer",u),maxWidth:Yn,zIndex:H+10},D.createElement(Ue,null))))},So=wp;import{Portal as kp}from"react-portal";var Pp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:i,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:f="complete-flow",onComplete:u,...g})=>{let{getFlow:F,getFlowSteps:b,isLoading:C,targetingLogicShouldHideFlow:m,markStepCompleted:v,markStepStarted:w,markFlowCompleted:B,updateCustomVariables:k,getCurrentStepIndex:c,getStepStatus:h,isStepBlocked:y,getFlowStatus:E,getNumberOfStepsCompleted:U}=X(),{isLoadingUserFlowStateData:M}=we(),{primaryCTAClickSideEffects:_,secondaryCTAClickSideEffects:O}=le(),{hasOpenModals:H}=ke(),N=c(e),{openFlowStates:j}=Tp(G),{mergeAppearanceWithDefault:K}=Q();if(o=K(o),Fp(()=>{k(t)},[t,C]),M)return null;let V=F(e);if(!V||m(V)||E(e)==R||H())return null;let z=b(e);if(Object.keys(j).length>0){let A=Object.keys(j).find(q=>j[q]===!0);if(A!==void 0&&A!==e)return Et.createElement(Et.Fragment,null)}async function te(A){if(await v(e,A.id),z.map(q=>h(e,q.id)).every(q=>q===Fe)){await B(e);return}if(!l&&N+1<z.length){if(y(e,z[N+1].id))return;await w(e,z[N+1].id)}}function oe(A,q,Ue){let xe=N+1<z.length?z[N+1]:null;i&&i(A,N,q,xe),n&&n(A,Ue,xe)}function Z(){return z.map(A=>({...A,handleSecondaryButtonClick:async()=>{O(A),A.skippable===!0&&await v(e,A.id,{skipped:!0}),oe(A,"secondary",N)},handlePrimaryButtonClick:async()=>{(!A.completionCriteria&&(A.autoMarkCompleted||A.autoMarkCompleted===void 0)||A.completionCriteria&&A.autoMarkCompleted===!0)&&await te(A),oe(A,"primary",N),_(A)}}))}async function $(A){s&&s(),f==="complete-flow"?await B(e):await v(e,A.id)}function J(){u&&u()}return Et.createElement(kp,null,Et.createElement(pe,{appearance:o}),r?z.map((A,q)=>Et.createElement(So,{key:A.id,appearance:o,steps:Z(),selectedStep:q,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>$(A),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:U(e),onComplete:J,...g})):Et.createElement(So,{appearance:o,steps:Z(),selectedStep:N,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>$(z[N]),tooltipPosition:d,completedStepsCount:U(e),showHighlightOnly:l,onComplete:J,...g}))};import fe,{useEffect as vp,useRef as Ip,useState as Ep}from"react";import{Portal as Bp}from"react-portal";import ut from"styled-components";var Qn=ut.button`
1292
1296
  ${e=>T(e)} {
1293
1297
  // Anything inside this block will be ignored if the user provides a custom class
1294
1298
 
@@ -1306,17 +1310,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1306
1310
  opacity: 0.8;
1307
1311
  }
1308
1312
  }
1309
- `,Qn=ut.span`
1313
+ `,Zn=ut.span`
1310
1314
  ${e=>T(e)} {
1311
1315
  font-size: 12px;
1312
1316
  display: inline-block;
1313
1317
  }
1314
- `,Zn=ut.span`
1318
+ `,Rn=ut.span`
1315
1319
  ${e=>T(e)} {
1316
1320
  font-size: 12px;
1317
1321
  display: inline-block;
1318
1322
  }
1319
- `,Rn=ut.div`
1323
+ `,es=ut.div`
1320
1324
  position: fixed;
1321
1325
  right: 0;
1322
1326
  bottom: 0;
@@ -1326,7 +1330,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1326
1330
  flex-direction: column;
1327
1331
  align-items: flex-end;
1328
1332
  z-index: 50;
1329
- `,es=ut.button`
1333
+ `,ts=ut.button`
1330
1334
  ${e=>T(e)} {
1331
1335
  // Anything inside this block will be ignored if the user provides a custom class
1332
1336
  background-color: #ffffff;
@@ -1342,7 +1346,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1342
1346
  0px 3px 6px -4px rgba(0, 0, 0, 0.12);
1343
1347
  border-radius: 45px;
1344
1348
  cursor: pointer;
1345
- `,ts=ut.div`
1349
+ `,os=ut.div`
1346
1350
  ${e=>T(e)} {
1347
1351
  // Anything inside this block will be ignored if the user provides a custom class
1348
1352
  background: #ffffff;
@@ -1359,7 +1363,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1359
1363
  position: ${e=>e.type=="inline"?"absolute":"relative"};
1360
1364
  top: ${e=>e.type=="inline"?"68px":0};
1361
1365
  margin-left: ${e=>e.type=="inline"?"-127px":0};
1362
- `,os=ut.button`
1366
+ `,rs=ut.button`
1363
1367
  ${e=>T(e)} {
1364
1368
  // Anything inside this block will be ignored if the user provides a custom class
1365
1369
  color: #434343;
@@ -1376,7 +1380,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1376
1380
  font-size: 14px;
1377
1381
 
1378
1382
  padding: 8px 12px;
1379
- `;import{AnimatePresence as ls,motion as as}from"framer-motion";import rs from"react";var is=({style:e,className:t})=>rs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},rs.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import ns from"react";var ss=({style:e,className:t})=>ns.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},ns.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Ap=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:h,getNumberOfStepsCompleted:m,isLoading:g,targetingLogicShouldHideFlow:w}=Y(),{primaryCTAClickSideEffects:x}=ne(),y=vp(null),[C,v]=Ep(!1),{mergeAppearanceWithDefault:F}=J();s=F(s),Pp(()=>(document.addEventListener("click",A,!1),()=>{document.removeEventListener("click",A,!1)}),[]);let A=I=>{y.current&&!y.current.contains(I.target)&&v(!1)};if(g)return null;let k=p(e);if(!k||w(k))return null;let c=d(e);if(!c||!i)return null;function u(I,$){!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)&&l(e,I.id),x(I),o&&o(I,$),v(!1)}function b(){return C&&ue.createElement(ts,{className:a("floatingWidgetMenu",s),as:as.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},c.map((I,$)=>ue.createElement(os,{className:a("floatingWidgetMenuItem",s),key:$,onClick:()=>u(I,$)},I.title)))}return r=="inline"?ue.createElement("span",{ref:y},ue.createElement(Jn,{style:t,onClick:()=>{v(!C)},className:a("supportButton",s)},ue.createElement(Zn,{className:a("supportIconContainer",s)},ue.createElement(ss,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),ue.createElement(Qn,{className:a("supportButtonTitle",s)},n)),ue.createElement(ls,null,ue.createElement(b,null))):ue.createElement(Ip,null,ue.createElement(Rn,{style:t,ref:y},ue.createElement(ls,null,ue.createElement(b,null)),ue.createElement(es,{onClick:()=>{v(!C)},as:as.button,whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},ue.createElement(is,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import $e,{useEffect as Bp}from"react";import So from"styled-components";var ps=So.div`
1383
+ `;import{AnimatePresence as as,motion as ps}from"framer-motion";import is from"react";var ns=({style:e,className:t})=>is.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},is.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import ss from"react";var ls=({style:e,className:t})=>ss.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},ss.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Ap=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:i="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:f,getNumberOfStepsCompleted:u,isLoading:g,targetingLogicShouldHideFlow:F}=X(),{primaryCTAClickSideEffects:b}=le(),C=Ip(null),[m,v]=Ep(!1),{mergeAppearanceWithDefault:w}=Q();s=w(s),vp(()=>(document.addEventListener("click",B,!1),()=>{document.removeEventListener("click",B,!1)}),[]);let B=E=>{C.current&&!C.current.contains(E.target)&&v(!1)};if(g)return null;let k=p(e);if(!k||F(k))return null;let c=d(e);if(!c||!n)return null;function h(E,U){!E.completionCriteria&&(E.autoMarkCompleted||E.autoMarkCompleted===void 0)&&l(e,E.id),b(E),o&&o(E,U),v(!1)}function y(){return m&&fe.createElement(os,{className:a("floatingWidgetMenu",s),as:ps.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:i},c.map((E,U)=>fe.createElement(rs,{className:a("floatingWidgetMenuItem",s),key:U,onClick:()=>h(E,U)},E.title)))}return i=="inline"?fe.createElement("span",{ref:C},fe.createElement(Qn,{style:t,onClick:()=>{v(!m)},className:a("supportButton",s)},fe.createElement(Rn,{className:a("supportIconContainer",s)},fe.createElement(ls,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),fe.createElement(Zn,{className:a("supportButtonTitle",s)},r)),fe.createElement(as,null,fe.createElement(y,null))):fe.createElement(Bp,null,fe.createElement(es,{style:t,ref:C},fe.createElement(as,null,fe.createElement(y,null)),fe.createElement(ts,{onClick:()=>{v(!m)},as:ps.button,whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},fe.createElement(ns,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import $e,{useEffect as Np}from"react";import yo from"styled-components";var ds=yo.div`
1380
1384
  ${e=>T(e)} {
1381
1385
  display: flex;
1382
1386
  flex-direction: column;
@@ -1391,17 +1395,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1391
1395
  border-radius: 12px;
1392
1396
  position: relative;
1393
1397
  }
1394
- `,ds=So.div`
1398
+ `,cs=yo.div`
1395
1399
  display: flex;
1396
1400
  flex-direction: column;
1397
1401
  flex: 1;
1398
- `,cs=So.div`
1402
+ `,ms=yo.div`
1399
1403
  display: flex;
1400
1404
  flex-direction: column;
1401
1405
  justify-content: center;
1402
1406
  align-items: flex-start;
1403
1407
  margin-top: 16px;
1404
- `,ms=So.div`
1408
+ `,us=yo.div`
1405
1409
  ${e=>T(e)} {
1406
1410
  position: absolute;
1407
1411
  top: 16px;
@@ -1412,7 +1416,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1412
1416
  opacity: 0.8;
1413
1417
  }
1414
1418
  }
1415
- `;var Op=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:h,isLoading:m,targetingLogicShouldHideFlow:g,updateCustomVariables:w,getFlowSteps:x,getFlowStatus:y,getCurrentStepIndex:C}=Y(),{primaryCTAClickSideEffects:v}=ne(),{mergeAppearanceWithDefault:F}=J();if(r=F(r),Bp(()=>{w(o)},[o,m]),m)return null;let A=d(e);if(!A||g(A)||y(e)===Z)return null;let c=x(e)[C(e)];return $e.createElement($e.Fragment,null,$e.createElement(ae,{appearance:r}),$e.createElement(ps,{appearance:r,className:Ce(a("embeddedTipContainer",r),n),style:s},(p===!0||c.dismissible)&&$e.createElement(ms,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},$e.createElement(Pe,null)),$e.createElement(ds,null,$e.createElement(we,{size:"small",appearance:r,title:c.title,subtitle:c.subtitle})),c.primaryButtonTitle&&$e.createElement(cs,{className:a("embeddedTipCallToActionContainer",r)},$e.createElement(R,{classPrefix:"embeddedTip",title:c.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{c.handlePrimaryButtonClick(),v(c),!(i&&i(c,C(e),"primary")===!1)&&(await h(e,c.id),await l(e))}}))))};import de,{useEffect as Lp}from"react";import It from"styled-components";var us=It.div`
1419
+ `;var Op=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:f,isLoading:u,targetingLogicShouldHideFlow:g,updateCustomVariables:F,getFlowSteps:b,getFlowStatus:C,getCurrentStepIndex:m}=X(),{primaryCTAClickSideEffects:v}=le(),{mergeAppearanceWithDefault:w}=Q();if(i=w(i),Np(()=>{F(o)},[o,u]),u)return null;let B=d(e);if(!B||g(B)||C(e)===R)return null;let c=b(e)[m(e)];return $e.createElement($e.Fragment,null,$e.createElement(pe,{appearance:i}),$e.createElement(ds,{appearance:i,className:Ce(a("embeddedTipContainer",i),r),style:s},(p===!0||c.dismissible)&&$e.createElement(us,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",i)},$e.createElement(Pe,null)),$e.createElement(cs,null,$e.createElement(Te,{size:"small",appearance:i,title:c.title,subtitle:c.subtitle})),c.primaryButtonTitle&&$e.createElement(ms,{className:a("embeddedTipCallToActionContainer",i)},$e.createElement(ee,{classPrefix:"embeddedTip",title:c.primaryButtonTitle,appearance:i,withMargin:!1,size:"small",type:"inline",onClick:async()=>{c.handlePrimaryButtonClick(),v(c),!(n&&n(c,m(e),"primary")===!1)&&(await f(e,c.id),await l(e))}}))))};import ce,{useEffect as Lp}from"react";import Bt from"styled-components";var fs=Bt.div`
1416
1420
  // use the :not annotation
1417
1421
  ${e=>T(e)} {
1418
1422
  display: flex;
@@ -1426,24 +1430,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1426
1430
  border-color: ${e=>e.appearance.theme.colorPrimary};
1427
1431
  border-radius: 12px;
1428
1432
  }
1429
- `,fs=It.div`
1433
+ `,gs=Bt.div`
1430
1434
  ${e=>T(e)} {
1431
1435
  display: flex;
1432
1436
  width: 36px;
1433
1437
  height: 36px;
1434
1438
  }
1435
- `,gs=It.div`
1439
+ `,hs=Bt.div`
1436
1440
  display: flex;
1437
1441
  flex-direction: column;
1438
1442
  flex: 1;
1439
1443
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1440
1444
  margin-top: ${e=>e.type==="square"?"12px":"0"};
1441
- `,hs=It.div`
1445
+ `,xs=Bt.div`
1442
1446
  display: flex;
1443
1447
  flex-direction: column;
1444
1448
  justify-content: center;
1445
1449
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1446
- `,Yo=It.div`
1450
+ `,Yo=Bt.div`
1447
1451
  display: flex;
1448
1452
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1449
1453
  align-items: flex-end;
@@ -1452,10 +1456,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
1452
1456
  :hover {
1453
1457
  opacity: 0.8;
1454
1458
  }
1455
- `,Xo=It.div`
1459
+ `,Xo=Bt.div`
1456
1460
  display: flex;
1457
1461
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1458
1462
  align-items: flex-end;
1459
1463
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1460
- `;import xs from"react";var Cs=({style:e,className:t})=>xs.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor"},xs.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var Np=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width"})=>{let{getFlow:d,markFlowCompleted:l,isLoading:h,targetingLogicShouldHideFlow:m,updateCustomVariables:g,getFlowMetadata:w,getFlowStatus:x,getFlowSteps:y,getCurrentStepIndex:C}=Y(),{primaryCTAClickSideEffects:v}=ne(),{mergeAppearanceWithDefault:F}=J();if(s=F(s),Lp(()=>{g(r)},[r,h]),h)return null;let A=d(e);if(!A||m(A)||x(e)===Z)return null;let k=y(e),c=k.length>0?k[C(e)]:w(e);return c!=null&&c.title&&(t=c.title),c!=null&&c.subtitle&&(o=c.subtitle),de.createElement(de.Fragment,null,de.createElement(ae,{appearance:s}),de.createElement(us,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&de.createElement(fs,null,de.createElement(Cs,null)),p==="square"&&c.dismissible&&de.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},de.createElement(Yo,{type:p,onClick:async()=>{await l(e),i&&i()},className:a("bannerDismissButton",s)},de.createElement(Pe,null))),de.createElement(gs,{type:p},de.createElement(we,{appearance:s,title:t,subtitle:o})),de.createElement(hs,{type:p,className:a("bannerCallToActionContainer",s)},de.createElement(R,{title:(c==null?void 0:c.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{v(c),n&&n(c,0,"primary")}})),p!=="square"&&c.dismissible&&de.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},de.createElement(Yo,{type:p,onClick:async()=>{await l(e),i&&i()},className:a("bannerDismissButton",s)},de.createElement(Pe,null)))))};export{Np as FrigadeBanner,qo as FrigadeChecklist,Op as FrigadeEmbeddedTip,zr as FrigadeForm,dp as FrigadeGuide,np as FrigadeHeroChecklist,ap as FrigadeProgressBadge,la as FrigadeProvider,Ap as FrigadeSupportWidget,kp as FrigadeTour,ke as useFlowOpens,At as useFlowResponses,Y as useFlows,Mo as useOrganization,wo as useUser};
1464
+ `;import Cs from"react";var Ss=({style:e,className:t})=>Cs.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor"},Cs.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var Dp=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:i,onButtonClick:r,appearance:s,type:p="full-width"})=>{let{getFlow:d,markFlowCompleted:l,isLoading:f,targetingLogicShouldHideFlow:u,updateCustomVariables:g,getFlowMetadata:F,getFlowStatus:b,getFlowSteps:C,getCurrentStepIndex:m}=X(),{primaryCTAClickSideEffects:v}=le(),{mergeAppearanceWithDefault:w}=Q();if(s=w(s),Lp(()=>{g(i)},[i,f]),f)return null;let B=d(e);if(!B||u(B)||b(e)===R)return null;let k=C(e),c=k.length>0?k[m(e)]:F(e);return c!=null&&c.title&&(t=c.title),c!=null&&c.subtitle&&(o=c.subtitle),ce.createElement(ce.Fragment,null,ce.createElement(pe,{appearance:s}),ce.createElement(fs,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ce.createElement(gs,null,ce.createElement(Ss,null)),p==="square"&&c.dismissible&&ce.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},ce.createElement(Yo,{type:p,onClick:async()=>{await l(e),n&&n()},className:a("bannerDismissButton",s)},ce.createElement(Pe,null))),ce.createElement(hs,{type:p},ce.createElement(Te,{appearance:s,title:t,subtitle:o})),ce.createElement(xs,{type:p,className:a("bannerCallToActionContainer",s)},ce.createElement(ee,{title:(c==null?void 0:c.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{v(c),r&&r(c,0,"primary")}})),p!=="square"&&c.dismissible&&ce.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},ce.createElement(Yo,{type:p,onClick:async()=>{await l(e),n&&n()},className:a("bannerDismissButton",s)},ce.createElement(Pe,null)))))};export{Dp as FrigadeBanner,qo as FrigadeChecklist,Op as FrigadeEmbeddedTip,Gr as FrigadeForm,cp as FrigadeGuide,sp as FrigadeHeroChecklist,pp as FrigadeProgressBadge,aa as FrigadeProvider,Ap as FrigadeSupportWidget,Pp as FrigadeTour,ke as useFlowOpens,At as useFlowResponses,X as useFlows,Mo as useOrganization,To as useUser};
1461
1465
  //# sourceMappingURL=index.mjs.map