@frigade/react 1.32.79 → 1.32.80

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 ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import{ThemeProvider as Wa}from"styled-components";import gt,{useContext as Ua,useEffect as To,useState as tr}from"react";import{useCallback as mt,useContext as ll,useEffect as al}from"react";import Do,{useMemo as yr}from"react";var Sr="1.32.79 ";var Ee="NOT_STARTED_STEP",Y="COMPLETED_FLOW",so="ABORTED_FLOW",ct="STARTED_FLOW",Ne="NOT_STARTED_FLOW",Le="COMPLETED_STEP",lo="STARTED_STEP";function Me(){let{publicApiKey:e,userId:t,apiUrl:o}=Do.useContext(q);return{config:yr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Sr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:yr(()=>`${o}/v1/public/`,[o])}}var Xs="frigade-last-call-at-",Qs="frigade-last-call-data-";function wt(){let{shouldGracefullyDegrade:e}=Do.useContext(q);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),zt();let n=Xs+t,r=Qs+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(n),p=window.localStorage.getItem(r);if(s&&p&&p==o.body){let d=new Date(s);if(new Date().getTime()-d.getTime()<1e3)return zt()}window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,o.body)}let i;try{i=await fetch(t,o)}catch(s){return zt(s)}return i?i.ok?i:zt(i.statusText):zt()}}function zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Tt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Do.useContext(q);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 il,useState as br}from"react";import{useContext as Rs,useEffect as el,useState as tl}from"react";import ol from"swr";import{useContext as Zs}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=Zs(q);function i(c,f=!1){return e[c]??f}function s(c,f){t(C=>({...C,[c]:f}))}function p(c){t(f=>{let{[c]:C,...k}=f;return{...k}})}function d(c){r.includes(c)||n(f=>[...f,c])}function a(c){return r.includes(c)}function x(c){return Object.entries(e).some(([f,C])=>C&&f!=c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:x,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var rl="unknown";function Ae(){let{config:e,apiUrl:t}=Me(),{publicApiKey:o,userId:n,organizationId:r,flows:i,setShouldGracefullyDegrade:s}=Rs(q),{resetOpenFlowState:p}=ke(),[d,a]=tl(!1),x={data:i.map(m=>({flowId:m.id,flowState:Y,lastStepId:null,userId:n,foreignUserId:n,stepStates:{},shouldTrigger:!1}))},c=m=>fetch(m,e).then(h=>{if(h.ok)return h.json();throw new Error("Failed to fetch user flow states")}).catch(h=>(console.log(`Error fetching ${m}: ${h}. Will gracefully degrade and hide Frigade`),s(!0),x)),{data:f,isLoading:C,mutate:k,error:B}=ol(o&&i&&n?`${t}userFlowStates?foreignUserId=${encodeURIComponent(n)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,c,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>x,onLoadingSlow:()=>x}),u=f==null?void 0:f.data;el(()=>{!d&&!C&&u&&a(!0)},[u,d,C]);async function y(m){if(u){let h=u.find(w=>w.flowId===m);h&&h.flowState!==Y&&(h.flowState=Y),await k(Promise.resolve({...f,data:u}),{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function E(m,h,w){if(u){let I=u.find(W=>W.flowId===m);I&&(I.stepStates[h]=w,I.flowState=ct),await k(Promise.resolve({...f,data:u}),{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function P(m,h,w){if(u){let I=u.find(W=>W.flowId===m);I&&(I.lastStepId=h,I.stepStates[h]=w,I.flowState=ct),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function T(m){if(u){let h=u.find(w=>w.flowId===m);h&&h.flowState!==Ne&&(h.flowState=Ne,h.lastStepId=rl,Object.keys(h.stepStates).forEach(w=>{h.stepStates[w].actionType=Ee,h.stepStates[w].createdAt=new Date().toISOString()}),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1}),p(m))}}async function S(m,h){if(u){let w=u.find(I=>I.flowId===m);w&&w.stepStates[h]!==Ee&&(w.stepStates[h]=Ee),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:u,isLoadingUserFlowStateData:!d,mutateUserFlowState:k,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:S,optimisticallyMarkStepStarted:P,error:B}}function Wt(){let{config:e,apiUrl:t}=Me(),{userFlowStatesData:o,mutateUserFlowState:n}=Ae(),{failedFlowResponses:r,setFailedFlowResponses:i,flowResponses:s,setFlowResponses:p}=il(q),[d,a]=br(new Set),[x,c]=br(new Set),f=wt();function C(u){let y=JSON.stringify(u);if(d.has(y))return null;d.add(y),a(d),x.add(u),c(x);let E=s==null?void 0:s.find(P=>P.flowSlug===u.flowSlug&&P.stepId===u.stepId&&P.actionType===u.actionType&&P.createdAt===u.createdAt);return f(`${t}flowResponses`,{...e,method:"POST",body:y}).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),i([...r,u])):E||p(T=>[...T??[],u])})}async function k(u){u.foreignUserId&&(u.actionType===ct||u.actionType===Ne?await C(u):u.actionType===Y?await C(u):u.actionType===lo?await C(u):u.actionType===Le?await C(u):u.actionType===so?await C(u):u.actionType===Ee&&await C(u))}function B(){let u=[];return o==null||o.forEach(y=>{if(y&&y.stepStates&&Object.keys(y.stepStates).length!==0)for(let E in y.stepStates){let P=y.stepStates[E];u.push({foreignUserId:y.foreignUserId,flowSlug:y.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...u,...s]}return{addResponse:k,setFlowResponses:p,getFlowResponses:B}}import pl from"swr";var nl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,wr=e=>{let t=nl.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=sl(n,"'","");i.startsWith("flow_")&&(o=i)}),o},sl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function J(){let{config:e,apiUrl:t}=Me(),{flows:o,setFlows:n,userId:r,publicApiKey:i,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,setFlowResponses:x,setShouldGracefullyDegrade:c}=ll(q),f={data:[]},{verifySDKInitiated:C}=Tt(),{addResponse:k,getFlowResponses:B}=Wt(),u=g=>fetch(g,e).then(b=>b.ok?b.json():(console.log(`Error fetching ${g} (${b.status}): ${b.statusText}. .Will gracefully degrade and hide Frigade`),c(!0),f)).catch(b=>(console.log(`Error fetching ${g}: ${b}. Will gracefully degrade and hide Frigade`),c(!0),f)),{userFlowStatesData:y,isLoadingUserFlowStateData:E,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:m,optimisticallyMarkStepStarted:h}=Ae(),{data:w,error:I,isLoading:W}=pl(i?`${t}flows`:null,u,{keepPreviousData:!0});al(()=>{if(I){console.error(I);return}w&&w.data&&(w.data=n(w.data))},[w,I]);function V(g){if(W)return null;let b=o.find(v=>v.slug===g);return!b&&o.length>0&&!E&&!W?(console.log(`Flow with slug ${g} not found`),null):(b==null?void 0:b.active)===!1?null:b}function A(g){var H;if(!V(g))return[];let b=V(g).data;return b?(b=z(b),(((H=JSON.parse(b))==null?void 0:H.data)??[]).map(N=>{let Be=X(N);return{handleSecondaryButtonClick:()=>{N.skippable===!0&&xe(g,N.id,{skipped:!0})},...N,complete:ee(g,N.id)===Le||Be>=1,blocked:L(g,N.id),hidden:re(g,N.id),handlePrimaryButtonClick:()=>{(!N.completionCriteria&&(N.autoMarkCompleted||N.autoMarkCompleted===void 0)||N.completionCriteria&&N.autoMarkCompleted===!0)&&xe(g,N.id)},progress:Be}}).filter(N=>N.hidden!==!0)):[]}function z(g){return g.replaceAll(/\${(.*?)}/g,(b,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(H){return"&#"+H.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function M(g){if(!V(g))return[];let b=V(g).data;return b?(b=z(b),JSON.parse(b)??{}):[]}function O(g,b){p(v=>({...v,[g]:b}))}function se(g){!E&&!W&&g&&JSON.stringify(s)!=JSON.stringify({...s,...g})&&Object.keys(g).forEach(b=>{O(b,g[b])})}let ce=mt(async(g,b,v)=>{C();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:lo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};le(H)&&(await h(g,b,H),k(H))},[r,y]),$=mt(async(g,b,v)=>{C();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:Ee,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};le(H)&&(await m(g,b),k(H))},[r,y]),xe=mt(async(g,b,v)=>{C();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:Le,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};le(H)&&(await S(g,b,H),k(H))},[r,y]),Te=mt(async(g,b)=>{if(C(),$e(g)===Ne)return;let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:Ne,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};await T(g),le(v)&&k(v)},[r,y]),R=mt(async(g,b)=>{C();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:ct,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};le(v)&&k(v)},[r,y]),G=mt(async(g,b)=>{C();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:Y,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};le(v)&&(await P(g),k(v))},[r,y]),ge=mt(async(g,b)=>{C();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:so,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};le(v)&&(await P(g),k(v))},[r,y]);function le(g){var b;if(!y&&g.actionType===Ee)return!1;if(y){let v=y.find(H=>H.flowId===g.flowSlug);if(g.actionType===Ee&&(!(v!=null&&v.stepStates[g.stepId])||v.stepStates[g.stepId].actionType===Ee)||v&&((b=v.stepStates[g.stepId])==null?void 0:b.actionType)===g.actionType||v&&v.flowState===Y&&g.actionType===Y)return!1}return!0}function ee(g,b){let v=_(g,b);return E?null:v?v.actionType:Ee}function L(g,b){let v=_(g,b);return v?v.blocked:!1}function re(g,b){let v=_(g,b);return v?v.hidden:!1}function _(g,b){if(E)return null;let v=y==null?void 0:y.find(H=>H.flowId===g);return!v||!v.stepStates[b]?null:v.stepStates[b]??null}function ae(g){var v;if(E||!y)return null;if($e(g)===Ne)return A(g)[0]??null;let b=(v=y.find(H=>H.flowId===g))==null?void 0:v.lastStepId;return b?A(g).find(H=>H.id===b):null}function K(g){let b=ae(g);if(!b)return 0;let v=A(g).findIndex(H=>H.id===b.id)??0;return ee(g,b.id)===Le&&v<A(g).length-1?v+1:v}function X(g){if(!g.completionCriteria)return;let b=wr(g.completionCriteria);if(b===null)return;let v=je(b),H=dt(b);return H===0?void 0:v/H}function $e(g){let b=y==null?void 0:y.find(v=>v.flowId===g);return b?b.flowState:null}function je(g){let b=A(g);return b.length===0?0:b.filter(H=>ee(g,H.id)===Le).length}function dt(g){return A(g).length}function j(g){return JSON.parse(o.find(b=>b.slug===g).data)}function Fe(g){if(E)return!0;if(g!=null&&g.targetingLogic&&y){let b=y.find(v=>v.flowId===g.slug);if(b)return b.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&r&&r.startsWith("guest_"))}function Ge(g){return!Fe(V(g))}return{getFlow:V,getFlowData:j,isLoading:E||W,getStepStatus:ee,getFlowSteps:A,getCurrentStepIndex:K,markStepStarted:ce,markStepCompleted:xe,markFlowNotStarted:Te,markFlowStarted:R,markFlowCompleted:G,markFlowAborted:ge,markStepNotStarted:$,getFlowStatus:$e,getNumberOfStepsCompleted:je,getNumberOfSteps:dt,targetingLogicShouldHideFlow:Fe,setCustomVariable:O,updateCustomVariables:se,customVariables:s,getStepOptionalProgress:X,getFlowMetadata:M,isStepBlocked:L,isStepHidden:re,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Ge}}import{useCallback as Tr,useContext as dl,useEffect as cl}from"react";var Ft="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=dl(q),{config:i,apiUrl:s}=Me(),{mutateUserFlowState:p}=Ae(),d=wt(),{verifySDKInitiated:a}=Tt();cl(()=>{if(e&&!t){if(e.startsWith(Ft))return;let f=`frigade-user-registered-${e}`;localStorage.getItem(f)||(d(`${s}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(f,"true"))}},[e,r,t]);let x=Tr(async f=>{a();let C={foreignId:e,properties:f};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(C)}),n(k=>({...k,...f})),p()},[e,i,r,p]),c=Tr(async(f,C)=>{a();let B={foreignId:e,events:[{event:f,properties:C}]};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(B)}),p()},[e,i,p]);return{userId:e,setUserId:o,addPropertiesToUser:x,trackEventForUser:c}}import{v4 as _a}from"uuid";import _e,{useEffect as Oa,useState as Da}from"react";import Oe,{useEffect as Cl}from"react";import co from"styled-components";import ml from"react";import ul from"styled-components";var Fr="fr-",Vt="cfr-";function l(e,t){let o=`${Fr}${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+" "+Vt+e}return o}function F(e){if(!e.className||e.className.indexOf(Vt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Fr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function $o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function qe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${$o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function jt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var fl=ul.div`
2
+ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import{ThemeProvider as Wa}from"styled-components";import gt,{useContext as Ua,useEffect as To,useState as tr}from"react";import{useCallback as mt,useContext as ll,useEffect as al}from"react";import Do,{useMemo as yr}from"react";var Sr="1.32.80 ";var Ee="NOT_STARTED_STEP",J="COMPLETED_FLOW",so="ABORTED_FLOW",ct="STARTED_FLOW",Ne="NOT_STARTED_FLOW",Le="COMPLETED_STEP",lo="STARTED_STEP";function Me(){let{publicApiKey:e,userId:t,apiUrl:o}=Do.useContext(K);return{config:yr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Sr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:yr(()=>`${o}/v1/public/`,[o])}}var Xs="frigade-last-call-at-",Qs="frigade-last-call-data-";function wt(){let{shouldGracefullyDegrade:e}=Do.useContext(K);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),zt();let n=Xs+t,r=Qs+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(n),p=window.localStorage.getItem(r);if(s&&p&&p==o.body){let d=new Date(s);if(new Date().getTime()-d.getTime()<1e3)return zt()}window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,o.body)}let i;try{i=await fetch(t,o)}catch(s){return zt(s)}return i?i.ok?i:zt(i.statusText):zt()}}function zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Tt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Do.useContext(K);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 il,useState as br}from"react";import{useContext as Rs,useEffect as el,useState as tl}from"react";import ol from"swr";import{useContext as Zs}from"react";function Fe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=Zs(K);function i(c,f=!1){return e[c]??f}function s(c,f){t(C=>({...C,[c]:f}))}function p(c){t(f=>{let{[c]:C,...k}=f;return{...k}})}function d(c){r.includes(c)||n(f=>[...f,c])}function a(c){return r.includes(c)}function x(c){return Object.entries(e).some(([f,C])=>C&&f!=c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:x,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var rl="unknown";function Ae(){let{config:e,apiUrl:t}=Me(),{publicApiKey:o,userId:n,organizationId:r,flows:i,setShouldGracefullyDegrade:s}=Rs(K),{resetOpenFlowState:p}=Fe(),[d,a]=tl(!1),x={data:i.map(m=>({flowId:m.id,flowState:J,lastStepId:null,userId:n,foreignUserId:n,stepStates:{},shouldTrigger:!1}))},c=m=>fetch(m,e).then(h=>{if(h.ok)return h.json();throw new Error("Failed to fetch user flow states")}).catch(h=>(console.log(`Error fetching ${m}: ${h}. Will gracefully degrade and hide Frigade`),s(!0),x)),{data:f,isLoading:C,mutate:k,error:E}=ol(o&&i&&n?`${t}userFlowStates?foreignUserId=${encodeURIComponent(n)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,c,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>x,onLoadingSlow:()=>x}),u=f==null?void 0:f.data;el(()=>{!d&&!C&&u&&a(!0)},[u,d,C]);async function b(m){if(u){let h=u.find(w=>w.flowId===m);h&&h.flowState!==J&&(h.flowState=J),await k(Promise.resolve({...f,data:u}),{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function v(m,h,w){if(u){let N=u.find(U=>U.flowId===m);N&&(N.stepStates[h]=w,N.flowState=ct),await k(Promise.resolve({...f,data:u}),{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function P(m,h,w){if(u){let N=u.find(U=>U.flowId===m);N&&(N.lastStepId=h,N.stepStates[h]=w,N.flowState=ct),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function T(m){if(u){let h=u.find(w=>w.flowId===m);h&&h.flowState!==Ne&&(h.flowState=Ne,h.lastStepId=rl,Object.keys(h.stepStates).forEach(w=>{h.stepStates[w].actionType=Ee,h.stepStates[w].createdAt=new Date().toISOString()}),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1}),p(m))}}async function S(m,h){if(u){let w=u.find(N=>N.flowId===m);w&&w.stepStates[h]!==Ee&&(w.stepStates[h]=Ee),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:u,isLoadingUserFlowStateData:!d,mutateUserFlowState:k,optimisticallyMarkFlowCompleted:b,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:v,optimisticallyMarkStepNotStarted:S,optimisticallyMarkStepStarted:P,error:E}}function Wt(){let{config:e,apiUrl:t}=Me(),{userFlowStatesData:o,mutateUserFlowState:n}=Ae(),{failedFlowResponses:r,setFailedFlowResponses:i,flowResponses:s,setFlowResponses:p}=il(K),[d,a]=br(new Set),[x,c]=br(new Set),f=wt();function C(u){let b=JSON.stringify(u);if(d.has(b))return null;d.add(b),a(d),x.add(u),c(x);let v=s==null?void 0:s.find(P=>P.flowSlug===u.flowSlug&&P.stepId===u.stepId&&P.actionType===u.actionType&&P.createdAt===u.createdAt);return f(`${t}flowResponses`,{...e,method:"POST",body:b}).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),i([...r,u])):v||p(T=>[...T??[],u])})}async function k(u){u.foreignUserId&&(u.actionType===ct||u.actionType===Ne?await C(u):u.actionType===J?await C(u):u.actionType===lo?await C(u):u.actionType===Le?await C(u):u.actionType===so?await C(u):u.actionType===Ee&&await C(u))}function E(){let u=[];return o==null||o.forEach(b=>{if(b&&b.stepStates&&Object.keys(b.stepStates).length!==0)for(let v in b.stepStates){let P=b.stepStates[v];u.push({foreignUserId:b.foreignUserId,flowSlug:b.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...u,...s]}return{addResponse:k,setFlowResponses:p,getFlowResponses:E}}import pl from"swr";var nl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,wr=e=>{let t=nl.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=sl(n,"'","");i.startsWith("flow_")&&(o=i)}),o},sl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e,apiUrl:t}=Me(),{flows:o,setFlows:n,userId:r,publicApiKey:i,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,setFlowResponses:x,setShouldGracefullyDegrade:c}=ll(K),f={data:[]},{verifySDKInitiated:C}=Tt(),{addResponse:k,getFlowResponses:E}=Wt(),u=g=>fetch(g,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${g} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),c(!0),f)).catch(y=>(console.log(`Error fetching ${g}: ${y}. Will gracefully degrade and hide Frigade`),c(!0),f)),{userFlowStatesData:b,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:m,optimisticallyMarkStepStarted:h}=Ae(),{data:w,error:N,isLoading:U}=pl(i?`${t}flows`:null,u,{keepPreviousData:!0});al(()=>{if(N){console.error(N);return}w&&w.data&&(w.data=n(w.data))},[w,N]);function W(g){if(U)return null;let y=o.find(B=>B.slug===g);return!y&&o.length>0&&!v&&!U?(console.log(`Flow with slug ${g} not found`),null):(y==null?void 0:y.active)===!1?null:y}function A(g){var z;if(!W(g))return[];let y=W(g).data;return y?(y=_(y),(((z=JSON.parse(y))==null?void 0:z.data)??[]).map(L=>{let Be=Z(L);return{handleSecondaryButtonClick:()=>{L.skippable===!0&&Y(g,L.id,{skipped:!0})},...L,complete:Q(g,L.id)===Le||Be>=1,blocked:ge(g,L.id),hidden:M(g,L.id),handlePrimaryButtonClick:()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&Y(g,L.id)},progress:Be}}).filter(L=>L.hidden!==!0)):[]}function _(g){return g.replaceAll(/\${(.*?)}/g,(y,B)=>s[B]===void 0?"":String(s[B]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function j(g){if(!W(g))return[];let y=W(g).data;return y?(y=_(y),JSON.parse(y)??{}):[]}function I(g,y){p(B=>({...B,[g]:y}))}function ie(g){!v&&!U&&g&&JSON.stringify(s)!=JSON.stringify({...s,...g})&&Object.keys(g).forEach(y=>{I(y,g[y])})}let fe=mt(async(g,y,B)=>{C();let z={foreignUserId:r,flowSlug:g,stepId:y,actionType:lo,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};ae(z)&&(await h(g,y,z),k(z))},[r,b]),H=mt(async(g,y,B)=>{C();let z={foreignUserId:r,flowSlug:g,stepId:y,actionType:Ee,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};ae(z)&&(await m(g,y),k(z))},[r,b]),Y=mt(async(g,y,B)=>{C();let z={foreignUserId:r,flowSlug:g,stepId:y,actionType:Le,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};ae(z)&&(await S(g,y,z),k(z))},[r,b]),ve=mt(async(g,y)=>{if(C(),$e(g)===Ne)return;let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:Ne,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await T(g),ae(B)&&k(B)},[r,b]),te=mt(async(g,y)=>{C();let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:ct,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ae(B)&&k(B)},[r,b]),q=mt(async(g,y)=>{C();let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:J,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ae(B)&&(await P(g),k(B))},[r,b]),he=mt(async(g,y)=>{C();let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:so,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ae(B)&&(await P(g),k(B))},[r,b]);function ae(g){var y;if(!b&&g.actionType===Ee)return!1;if(b){let B=b.find(z=>z.flowId===g.flowSlug);if(g.actionType===Ee&&(!(B!=null&&B.stepStates[g.stepId])||B.stepStates[g.stepId].actionType===Ee)||B&&((y=B.stepStates[g.stepId])==null?void 0:y.actionType)===g.actionType||B&&B.flowState===J&&g.actionType===J)return!1}return!0}function Q(g,y){let B=O(g,y);return v?null:B?B.actionType:Ee}function ge(g,y){let B=O(g,y);return B?B.blocked:!1}function M(g,y){let B=O(g,y);return B?B.hidden:!1}function O(g,y){if(v)return null;let B=b==null?void 0:b.find(z=>z.flowId===g);return!B||!B.stepStates[y]?null:B.stepStates[y]??null}function ne(g){var B;if(v||!b)return null;if($e(g)===Ne)return A(g)[0]??null;let y=(B=b.find(z=>z.flowId===g))==null?void 0:B.lastStepId;return y?A(g).find(z=>z.id===y):null}function G(g){let y=ne(g);if(!y)return 0;let B=A(g).findIndex(z=>z.id===y.id)??0;return Q(g,y.id)===Le&&B<A(g).length-1?B+1:B}function Z(g){if(!g.completionCriteria)return;let y=wr(g.completionCriteria);if(y===null)return;let B=je(y),z=dt(y);return z===0?void 0:B/z}function $e(g){let y=b==null?void 0:b.find(B=>B.flowId===g);return y?y.flowState:null}function je(g){let y=A(g);return y.length===0?0:y.filter(z=>Q(g,z.id)===Le).length}function dt(g){return A(g).length}function V(g){return JSON.parse(o.find(y=>y.slug===g).data)}function Te(g){if(v)return!0;if(g!=null&&g.targetingLogic&&b){let y=b.find(B=>B.flowId===g.slug);if(y)return y.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&r&&r.startsWith("guest_"))}function Ge(g){return!Te(W(g))}return{getFlow:W,getFlowData:V,isLoading:v||U,getStepStatus:Q,getFlowSteps:A,getCurrentStepIndex:G,markStepStarted:fe,markStepCompleted:Y,markFlowNotStarted:ve,markFlowStarted:te,markFlowCompleted:q,markFlowAborted:he,markStepNotStarted:H,getFlowStatus:$e,getNumberOfStepsCompleted:je,getNumberOfSteps:dt,targetingLogicShouldHideFlow:Te,setCustomVariable:I,updateCustomVariables:ie,customVariables:s,getStepOptionalProgress:Z,getFlowMetadata:j,isStepBlocked:ge,isStepHidden:M,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Ge}}import{useCallback as Tr,useContext as dl,useEffect as cl}from"react";var Ft="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=dl(K),{config:i,apiUrl:s}=Me(),{mutateUserFlowState:p}=Ae(),d=wt(),{verifySDKInitiated:a}=Tt();cl(()=>{if(e&&!t){if(e.startsWith(Ft))return;let f=`frigade-user-registered-${e}`;localStorage.getItem(f)||(d(`${s}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(f,"true"))}},[e,r,t]);let x=Tr(async f=>{a();let C={foreignId:e,properties:f};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(C)}),n(k=>({...k,...f})),p()},[e,i,r,p]),c=Tr(async(f,C)=>{a();let E={foreignId:e,events:[{event:f,properties:C}]};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(E)}),p()},[e,i,p]);return{userId:e,setUserId:o,addPropertiesToUser:x,trackEventForUser:c}}import{v4 as _a}from"uuid";import _e,{useEffect as Oa,useState as Da}from"react";import Oe,{useEffect as Cl}from"react";import co from"styled-components";import ml from"react";import ul from"styled-components";var Fr="fr-",Vt="cfr-";function l(e,t){let o=`${Fr}${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+" "+Vt+e}return o}function F(e){if(!e.className||e.className.indexOf(Vt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Fr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function $o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function qe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${$o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function jt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var fl=ul.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -27,7 +27,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
27
27
  :hover {
28
28
  opacity: 0.8;
29
29
  }
30
- `,Pe=()=>Mo.createElement(hl,null,Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Mo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Sl}from"react-portal";import Mr from"react";import Uo from"react";function xl({style:e,className:t}){return Uo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Uo.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Uo.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var Pr=xl;import _o from"styled-components";import tt from"styled-components";var ao=tt.div`
30
+ `,ke=()=>Mo.createElement(hl,null,Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Mo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Sl}from"react-portal";import Mr from"react";import Uo from"react";function xl({style:e,className:t}){return Uo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Uo.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Uo.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var Pr=xl;import _o from"styled-components";import tt from"styled-components";var ao=tt.div`
31
31
  ${e=>F(e)} {
32
32
  background: ${e=>e.appearance.theme.colorBackground};
33
33
  }
@@ -188,7 +188,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
188
188
  ::-webkit-scrollbar {
189
189
  display: none;
190
190
  }
191
- `,ot=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:r,appearance:i,dismissible:s=!0,showFrigadeBranding:p=!1})=>(Cl(()=>{let d=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",d),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),t?Oe.createElement(Sl,null,Oe.createElement(kr,{appearance:i,onClose:()=>{s&&e()}}),Oe.createElement(yl,{appearance:i,className:l("modalContainer",i),styleOverrides:n},s&&Oe.createElement(wl,{className:l("modalClose",i),onClick:()=>e(),appearance:i},Oe.createElement(Pe,null)),o&&Oe.createElement(bl,null,o),Oe.createElement(Tl,null,r),p&&Oe.createElement(Or,{appearance:i,className:l("poweredByFrigadeRibbon",i)},Oe.createElement(po,{appearance:i})))):Oe.createElement(Oe.Fragment,null));import rt,{useEffect as Fl}from"react";import mo from"styled-components";import{Portal as kl}from"react-portal";var Pl=mo.div`
191
+ `,ot=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:r,appearance:i,dismissible:s=!0,showFrigadeBranding:p=!1})=>(Cl(()=>{let d=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",d),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),t?Oe.createElement(Sl,null,Oe.createElement(kr,{appearance:i,onClose:()=>{s&&e()}}),Oe.createElement(yl,{appearance:i,className:l("modalContainer",i),styleOverrides:n},s&&Oe.createElement(wl,{className:l("modalClose",i),onClick:()=>e(),appearance:i},Oe.createElement(ke,null)),o&&Oe.createElement(bl,null,o),Oe.createElement(Tl,null,r),p&&Oe.createElement(Or,{appearance:i,className:l("poweredByFrigadeRibbon",i)},Oe.createElement(po,{appearance:i})))):Oe.createElement(Oe.Fragment,null));import rt,{useEffect as Fl}from"react";import mo from"styled-components";import{Portal as kl}from"react-portal";var Pl=mo.div`
192
192
  ${e=>F(e)} {
193
193
  // Anything inside this block will be ignored if the user provides a custom class
194
194
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -225,7 +225,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
225
225
  ::-webkit-scrollbar {
226
226
  display: none;
227
227
  }
228
- `,Ur=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:r})=>(Fl(()=>{let i=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",i),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",i)}},[e,t]),t?rt.createElement(kl,null,rt.createElement(Pl,{appearance:r,className:l("cornerModalContainer",r)},rt.createElement(Bl,{className:l("cornerModalClose",r),onClick:()=>e()},rt.createElement(Pe,null)),o&&rt.createElement(vl,null,o),rt.createElement(El,null,n))):rt.createElement(rt.Fragment,null));import{useContext as Al}from"react";function Q(){let{defaultAppearance:e}=Al(q);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 nt,{useEffect as ea,useState as Yo}from"react";import xo from"styled-components";import go,{useEffect as Il,useState as jr}from"react";import Ho from"styled-components";import uo from"styled-components";var _r=uo.label`
228
+ `,Ur=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:r})=>(Fl(()=>{let i=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",i),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",i)}},[e,t]),t?rt.createElement(kl,null,rt.createElement(Pl,{appearance:r,className:l("cornerModalContainer",r)},rt.createElement(Bl,{className:l("cornerModalClose",r),onClick:()=>e()},rt.createElement(ke,null)),o&&rt.createElement(vl,null,o),rt.createElement(El,null,n))):rt.createElement(rt.Fragment,null));import{useContext as Al}from"react";function R(){let{defaultAppearance:e}=Al(K);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 nt,{useEffect as ea,useState as Yo}from"react";import xo from"styled-components";import go,{useEffect as Il,useState as jr}from"react";import Ho from"styled-components";import uo from"styled-components";var _r=uo.label`
229
229
  ${e=>F(e)} {
230
230
  font-size: 14px;
231
231
  line-height: 20px;
@@ -316,7 +316,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
316
316
  background-repeat: no-repeat;
317
317
  background-size: 1.5em 1.5em;
318
318
  -webkit-print-color-adjust: exact;
319
- `;function Yr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var x,c,f,C,k,B;let i=e,[s,p]=qr(((x=n==null?void 0:n.choice)==null?void 0:x[0])||""),[d,a]=qr(!1);return Gr(()=>{var u,y,E,P;if(s===""&&!d){if(a(!0),i.requireSelection){p(Go);return}if(i.defaultValue&&((u=i.props.options)!=null&&u.find(T=>T.id===i.defaultValue))){let T=(y=i.props.options)==null?void 0:y.find(S=>S.id===i.defaultValue);p(T.id),o({choice:[T.id]})}else p(((E=i.props.options)==null?void 0:E[0].id)||""),o({choice:[((P=i.props.options)==null?void 0:P[0].id)||""]})}},[]),Gr(()=>{i.requireSelection&&s===Go?r([{message:"Please select an option",id:i.id}]):r([])},[s]),Ue.createElement(Ol,null,Ue.createElement(it,{title:i.title,required:!1,appearance:t.appearance}),Ue.createElement(Dl,{value:s,onChange:u=>{p(u.target.value),o({choice:[u.target.value]})},placeholder:i.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},i.requireSelection&&Ue.createElement("option",{key:"null-value",value:Go,disabled:!0},i.placeholder??"Select an option"),(c=i.props.options)==null?void 0:c.map(u=>Ue.createElement("option",{key:u.id,value:u.id},u.title))),((C=(f=i.props.options)==null?void 0:f.find(u=>u.id===s))==null?void 0:C.isOpenEnded)&&Ue.createElement(Ue.Fragment,null,Ue.createElement(it,{title:((B=(k=i.props.options)==null?void 0:k.find(u=>u.id===s))==null?void 0:B.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Ue.createElement(Vo,{type:"text",placeholder:"Enter your answer here",onChange:u=>{o({choice:[u.target.value]})},appearance:t.appearance})),Ue.createElement(kt,{title:i.subtitle,appearance:t.appearance}))}import Kt,{useEffect as qo,useState as Xr}from"react";import Qr from"styled-components";import qt from"react";import Gt from"react";import{motion as $l}from"framer-motion";var Jr=({color:e,percentage:t,size:o})=>{let n=o*.5-2,r=2*Math.PI*n,i=(1-t)*r,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:r,transition:s},show:{strokeDashoffset:i,transition:s}};return Gt.createElement($l.circle,{r:n,cx:o*.5,cy:o*.5,fill:"transparent",stroke:i!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?i:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Ml=({fillColor:e,size:t,percentage:o,children:n,bgColor:r="#D9D9D9",className:i,style:s})=>Gt.createElement("svg",{style:s,className:i,width:t,height:t,overflow:"visible"},Gt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Gt.createElement(Jr,{color:r,size:t}),Gt.createElement(Jr,{color:e,percentage:o,size:t})),n),Pt=Ml;import Ul from"styled-components";var _l=({color:e="#FFFFFF"})=>qt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),zl={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"},Vl={border:"1px solid #E6E6E6"},jl={color:"#FFFFFF"},Gl={border:"3px solid #D9D9D9"},ql=e=>e==="square"?zl:Wl,Kl=(e,t)=>e==="square"?t?Hl:Vl:t?jl:Gl,Yl=Ul.div`
319
+ `;function Yr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var x,c,f,C,k,E;let i=e,[s,p]=qr(((x=n==null?void 0:n.choice)==null?void 0:x[0])||""),[d,a]=qr(!1);return Gr(()=>{var u,b,v,P;if(s===""&&!d){if(a(!0),i.requireSelection){p(Go);return}if(i.defaultValue&&((u=i.props.options)!=null&&u.find(T=>T.id===i.defaultValue))){let T=(b=i.props.options)==null?void 0:b.find(S=>S.id===i.defaultValue);p(T.id),o({choice:[T.id]})}else p(((v=i.props.options)==null?void 0:v[0].id)||""),o({choice:[((P=i.props.options)==null?void 0:P[0].id)||""]})}},[]),Gr(()=>{i.requireSelection&&s===Go?r([{message:"Please select an option",id:i.id}]):r([])},[s]),Ue.createElement(Ol,null,Ue.createElement(it,{title:i.title,required:!1,appearance:t.appearance}),Ue.createElement(Dl,{value:s,onChange:u=>{p(u.target.value),o({choice:[u.target.value]})},placeholder:i.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},i.requireSelection&&Ue.createElement("option",{key:"null-value",value:Go,disabled:!0},i.placeholder??"Select an option"),(c=i.props.options)==null?void 0:c.map(u=>Ue.createElement("option",{key:u.id,value:u.id},u.title))),((C=(f=i.props.options)==null?void 0:f.find(u=>u.id===s))==null?void 0:C.isOpenEnded)&&Ue.createElement(Ue.Fragment,null,Ue.createElement(it,{title:((E=(k=i.props.options)==null?void 0:k.find(u=>u.id===s))==null?void 0:E.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Ue.createElement(Vo,{type:"text",placeholder:"Enter your answer here",onChange:u=>{o({choice:[u.target.value]})},appearance:t.appearance})),Ue.createElement(kt,{title:i.subtitle,appearance:t.appearance}))}import Kt,{useEffect as qo,useState as Xr}from"react";import Qr from"styled-components";import qt from"react";import Gt from"react";import{motion as $l}from"framer-motion";var Jr=({color:e,percentage:t,size:o})=>{let n=o*.5-2,r=2*Math.PI*n,i=(1-t)*r,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:r,transition:s},show:{strokeDashoffset:i,transition:s}};return Gt.createElement($l.circle,{r:n,cx:o*.5,cy:o*.5,fill:"transparent",stroke:i!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?i:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Ml=({fillColor:e,size:t,percentage:o,children:n,bgColor:r="#D9D9D9",className:i,style:s})=>Gt.createElement("svg",{style:s,className:i,width:t,height:t,overflow:"visible"},Gt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Gt.createElement(Jr,{color:r,size:t}),Gt.createElement(Jr,{color:e,percentage:o,size:t})),n),Pt=Ml;import Ul from"styled-components";var _l=({color:e="#FFFFFF"})=>qt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),zl={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"},Vl={border:"1px solid #E6E6E6"},jl={color:"#FFFFFF"},Gl={border:"3px solid #D9D9D9"},ql=e=>e==="square"?zl:Wl,Kl=(e,t)=>e==="square"?t?Hl:Vl:t?jl:Gl,Yl=Ul.div`
320
320
  ${e=>qe(e)}
321
321
  `,Ye=({value:e,type:t="square",primaryColor:o="#000000",progress:n,appearance:r=Ke,style:i,className:s})=>{let p=ql(t),d=Kl(t,e);return e===!0?p={...p,...d,backgroundColor:o,borderColor:t==="square"?o:"none"}:p={...p,...d},e!==!0&&t==="round"&&n!==void 0&&n!==1?qt.createElement(Pt,{fillColor:o,percentage:n,size:22}):qt.createElement(Yl,{styleOverrides:p,style:i,role:"checkbox",className:Ce(l("checkIconContainer",r),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&qt.createElement(_l,{color:"#FFFFFF"}))};var Jl=Qr.div`
322
322
  display: flex;
@@ -349,7 +349,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
349
349
  height: 60px;
350
350
  padding: 0 18px;
351
351
  margin-bottom: 10px;
352
- `;function Zr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var x;let i=e,[s,p]=Xr((n==null?void 0:n.choice)||[]),[d,a]=Xr(!1);return qo(()=>{s.length==0&&!d&&(a(!0),o({choice:[]}))},[]),qo(()=>{o({choice:s})},[s]),qo(()=>{i.required&&(s.length<i.props.minChoices||s.length>i.props.maxChoices)?r([{message:"",id:i.id}]):r([])},[s]),Kt.createElement(Jl,null,Kt.createElement(it,{title:i.title,required:i.required,appearance:t.appearance}),(x=i.props.options)==null?void 0:x.map(c=>Kt.createElement(Xl,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(f=>f!==c.id));return}s.length<i.props.maxChoices?p([...s,c.id]):s.length==1&&i.props.maxChoices==1&&p([c.id])}},c.title,Kt.createElement(Ye,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),Kt.createElement(kt,{title:i.subtitle,appearance:t.appearance}))}import ho from"react";import Rr from"styled-components";import Ql from"dompurify";function me(e){return{__html:Ql.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Zl=Rr.h1`
352
+ `;function Zr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var x;let i=e,[s,p]=Xr((n==null?void 0:n.choice)||[]),[d,a]=Xr(!1);return qo(()=>{s.length==0&&!d&&(a(!0),o({choice:[]}))},[]),qo(()=>{o({choice:s})},[s]),qo(()=>{i.required&&(s.length<i.props.minChoices||s.length>i.props.maxChoices)?r([{message:"",id:i.id}]):r([])},[s]),Kt.createElement(Jl,null,Kt.createElement(it,{title:i.title,required:i.required,appearance:t.appearance}),(x=i.props.options)==null?void 0:x.map(c=>Kt.createElement(Xl,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(f=>f!==c.id));return}s.length<i.props.maxChoices?p([...s,c.id]):s.length==1&&i.props.maxChoices==1&&p([c.id])}},c.title,Kt.createElement(Ye,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),Kt.createElement(kt,{title:i.subtitle,appearance:t.appearance}))}import ho from"react";import Rr from"styled-components";import Ql from"dompurify";function ce(e){return{__html:Ql.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Zl=Rr.h1`
353
353
  ${e=>F(e)} {
354
354
  font-style: normal;
355
355
  font-weight: 600;
@@ -368,7 +368,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
368
368
  line-height: 20px;
369
369
  color: ${e=>e.appearance.theme.colorTextSecondary};
370
370
  }
371
- `;function Se({appearance:e,title:t,subtitle:o,size:n="medium",classPrefix:r=""}){return ho.createElement(ho.Fragment,null,ho.createElement(Zl,{appearance:e,className:l(`${r}${r?jt(n):n}Title`,e),dangerouslySetInnerHTML:me(t),size:n}),o&&ho.createElement(Rl,{appearance:e,className:l(`${r}${r?jt(n):n}Subtitle`,e),dangerouslySetInnerHTML:me(o),size:n}))}import*as Ko from"react";var ei=e=>Ko.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},Ko.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));import{AnimatePresence as ta,motion as oa}from"framer-motion";var ra=xo.div`
371
+ `;function Se({appearance:e,title:t,subtitle:o,size:n="medium",classPrefix:r=""}){return ho.createElement(ho.Fragment,null,ho.createElement(Zl,{appearance:e,className:l(`${r}${r?jt(n):n}Title`,e),dangerouslySetInnerHTML:ce(t),size:n}),o&&ho.createElement(Rl,{appearance:e,className:l(`${r}${r?jt(n):n}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:n}))}import*as Ko from"react";var ei=e=>Ko.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},Ko.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));import{AnimatePresence as ta,motion as oa}from"framer-motion";var ra=xo.div`
372
372
  display: flex;
373
373
  flex-direction: column;
374
374
  justify-content: flex-end;
@@ -386,7 +386,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
386
386
  `,sa=xo.div`
387
387
  padding-left: 1px;
388
388
  padding-right: 1px;
389
- `,la={text:jo,multipleChoice:Yr,multipleChoiceList:Zr};function ti({flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:r,appearance:i,customFormElements:s}){var P;let p=t.props,[d,a]=Yo([]),[x,c]=Yo([]),{userId:f}=Ht(),[C,k]=Yo(y()||{}),B={...la,...s};ea(()=>{n(d.length===0)},[d,n]);function u(T,S){let m={...C,[T.id]:S};k(m),r(m),window&&window.localStorage&&window.localStorage.setItem(E(),JSON.stringify(m))}function y(){if(window&&window.localStorage){let T=window.localStorage.getItem(E());if(T)return JSON.parse(T)}return{}}function E(){return`frigade-multiInputStepTypeData-${e}-${t.id}-${f}`}return nt.createElement(sa,{className:l("multiInput",i)},nt.createElement(Se,{appearance:i,title:t.title,subtitle:t.subtitle}),nt.createElement(ra,{className:l("multiInputContainer",i)},(P=p.data)==null?void 0:P.map(T=>{var m;let S=(m=d.reverse().find(h=>h.id===T.id))==null?void 0:m.message;return B[T.type]?nt.createElement("span",{key:T.id,"data-field-id":T.id,className:l("multiInputField",i)},B[T.type]({formInput:T,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:r,appearance:i},onSaveInputData:h=>{!x.includes(T.id)&&h&&(h==null?void 0:h.text)!==""&&c(w=>[...w,T.id]),u(T,h)},inputData:C[T.id],setFormValidationErrors:h=>{a(w=>h.length===0?w.filter(I=>I.id!==T.id):[...w,...h])}}),nt.createElement(ta,null,S&&x.includes(T.id)&&nt.createElement(ia,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:T.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:i,className:l("multiInputValidationError",i)},nt.createElement(na,{appearance:i,className:l("multiInputValidationErrorIcon",i)},nt.createElement(ei,null)),S))):null})))}import ut from"styled-components";var oi=ut.div`
389
+ `,la={text:jo,multipleChoice:Yr,multipleChoiceList:Zr};function ti({flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:r,appearance:i,customFormElements:s}){var P;let p=t.props,[d,a]=Yo([]),[x,c]=Yo([]),{userId:f}=Ht(),[C,k]=Yo(b()||{}),E={...la,...s};ea(()=>{n(d.length===0)},[d,n]);function u(T,S){let m={...C,[T.id]:S};k(m),r(m),window&&window.localStorage&&window.localStorage.setItem(v(),JSON.stringify(m))}function b(){if(window&&window.localStorage){let T=window.localStorage.getItem(v());if(T)return JSON.parse(T)}return{}}function v(){return`frigade-multiInputStepTypeData-${e}-${t.id}-${f}`}return nt.createElement(sa,{className:l("multiInput",i)},nt.createElement(Se,{appearance:i,title:t.title,subtitle:t.subtitle}),nt.createElement(ra,{className:l("multiInputContainer",i)},(P=p.data)==null?void 0:P.map(T=>{var m;let S=(m=d.reverse().find(h=>h.id===T.id))==null?void 0:m.message;return E[T.type]?nt.createElement("span",{key:T.id,"data-field-id":T.id,className:l("multiInputField",i)},E[T.type]({formInput:T,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:r,appearance:i},onSaveInputData:h=>{!x.includes(T.id)&&h&&(h==null?void 0:h.text)!==""&&c(w=>[...w,T.id]),u(T,h)},inputData:C[T.id],setFormValidationErrors:h=>{a(w=>h.length===0?w.filter(N=>N.id!==T.id):[...w,...h])}}),nt.createElement(ta,null,S&&x.includes(T.id)&&nt.createElement(ia,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:T.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:i,className:l("multiInputValidationError",i)},nt.createElement(na,{appearance:i,className:l("multiInputValidationErrorIcon",i)},nt.createElement(ei,null)),S))):null})))}import ut from"styled-components";var oi=ut.div`
390
390
  align-items: center;
391
391
  display: flex;
392
392
  justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
@@ -466,9 +466,9 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
466
466
  margin-right: 8px;
467
467
  }
468
468
  }
469
- `,te=({onClick:e,title:t,style:o,disabled:n,type:r="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function x(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${jt(c)}`}return aa.createElement(pa,{secondary:s,appearance:p,disabled:n,onClick:e,styleOverrides:o,type:r,withMargin:d,size:i,className:l(x(),p)},t)};var di=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:r,formType:i,selectedStep:s,steps:p,onBack:d,allowBackNavigation:a,errorMessage:x})=>{let c=i==="inline"?"inline":"full-width",f=p.length>1&&s!=0&&a;return st.createElement(st.Fragment,null,x&&st.createElement(ri,{appearance:o,className:l("formCTAError",o)},x),st.createElement(oi,{showBackButton:f,className:l("formCTAContainer",o)},f&&st.createElement(te,{title:e.backButtonTitle??"\u2190",onClick:d,secondary:!0,withMargin:!1,type:c,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),st.createElement(ii,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?st.createElement(te,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:c,appearance:o}):null," ",e.primaryButtonTitle?st.createElement(te,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:c,appearance:o}):null)))};import Jo from"react";import da from"styled-components";var ca=da.div`
469
+ `,oe=({onClick:e,title:t,style:o,disabled:n,type:r="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function x(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${jt(c)}`}return aa.createElement(pa,{secondary:s,appearance:p,disabled:n,onClick:e,styleOverrides:o,type:r,withMargin:d,size:i,className:l(x(),p)},t)};var di=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:r,formType:i,selectedStep:s,steps:p,onBack:d,allowBackNavigation:a,errorMessage:x})=>{let c=i==="inline"?"inline":"full-width",f=p.length>1&&s!=0&&a;return st.createElement(st.Fragment,null,x&&st.createElement(ri,{appearance:o,className:l("formCTAError",o)},x),st.createElement(oi,{showBackButton:f,className:l("formCTAContainer",o)},f&&st.createElement(oe,{title:e.backButtonTitle??"\u2190",onClick:d,secondary:!0,withMargin:!1,type:c,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),st.createElement(ii,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?st.createElement(oe,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:c,appearance:o}):null," ",e.primaryButtonTitle?st.createElement(oe,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:c,appearance:o}):null)))};import Jo from"react";import da from"styled-components";var ca=da.div`
470
470
  text-align: center;
471
- `,ci=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:r}=Q().mergeAppearanceWithDefault(n);return Jo.createElement(ca,{className:o},Jo.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((i,s)=>Jo.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import ft from"react";import vt from"styled-components";import{useContext as ma}from"react";function ie(){let e=ma(q);function t(r){n(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){n(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function n(r,i){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";i&&i!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:n}}var ua=vt.div`
471
+ `,ci=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:r}=R().mergeAppearanceWithDefault(n);return Jo.createElement(ca,{className:o},Jo.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((i,s)=>Jo.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import ft from"react";import vt from"styled-components";import{useContext as ma}from"react";function se(){let e=ma(K);function t(r){n(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){n(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function n(r,i){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";i&&i!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:n}}var ua=vt.div`
472
472
  display: flex;
473
473
  flex-wrap: wrap;
474
474
  align-content: center;
@@ -516,7 +516,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
516
516
  margin-top: 12px;
517
517
  margin-bottom: 16px;
518
518
  max-width: 70%;
519
- `;function mi({stepData:e,appearance:t}){var n,r;let{handleUrl:o}=ie();return ft.createElement("div",null,ft.createElement(xa,null,e.title),ft.createElement(Ca,null,e.subtitle),ft.createElement(ua,null,(r=(n=e.props)==null?void 0:n.links)==null?void 0:r.map(i=>ft.createElement(fa,{key:i.title},ft.createElement(ga,{src:i.imageUri}),ft.createElement(ha,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{i.uri&&o(i.uri,i.uriTarget??"_blank")}},i.title)))))}import Et,{useEffect as ka}from"react";import bo from"styled-components";import Xo from"react";var So=({style:e,className:t})=>Xo.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},Xo.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Xo.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 Yt,{useRef as Sa,useState as ya}from"react";import yo from"styled-components";var ba=yo.div`
519
+ `;function mi({stepData:e,appearance:t}){var n,r;let{handleUrl:o}=se();return ft.createElement("div",null,ft.createElement(xa,null,e.title),ft.createElement(Ca,null,e.subtitle),ft.createElement(ua,null,(r=(n=e.props)==null?void 0:n.links)==null?void 0:r.map(i=>ft.createElement(fa,{key:i.title},ft.createElement(ga,{src:i.imageUri}),ft.createElement(ha,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{i.uri&&o(i.uri,i.uriTarget??"_blank")}},i.title)))))}import Et,{useEffect as ka}from"react";import bo from"styled-components";import Xo from"react";var So=({style:e,className:t})=>Xo.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},Xo.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Xo.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 Yt,{useRef as Sa,useState as ya}from"react";import yo from"styled-components";var ba=yo.div`
520
520
  display: flex;
521
521
  align-items: center;
522
522
  justify-content: flex-start;
@@ -630,8 +630,8 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
630
630
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
631
631
  display: flex;
632
632
  align-self: center;
633
- `;var wi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let r=e.props,[i,s]=Zo([]),[p,d]=Zo(!1),[a,x]=Zo(e.id);return Qo(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Qo(()=>{a!==e.id&&(x(e.id),s([]))},[e]),Qo(()=>{o({choice:i}),i.length>=r.minChoices?t(!0):t(!1)},[i]),Je.createElement(fi,{className:l("selectListContainer",n)},Je.createElement(gi,null,Je.createElement(hi,{className:l("selectListTitle",n)},e.title),Je.createElement(xi,{appearance:n,className:l("selectListSubtitle",n)},e.subtitle)),r.options.map((c,f)=>{let C=i.includes(c.id);return Je.createElement(Ci,{key:`select-item-${f}`,onClick:()=>{if(i.includes(c.id)){s(i.filter(k=>k!==c.id));return}i.length<r.maxChoices?s([...i,c.id]):i.length==1&&r.maxChoices==1&&s([c.id])},hideBottomBorder:f===r.options.length-1,className:l("selectListSelectItem",n)},Je.createElement(Si,{className:l("selectListItemImage",n)},c.imageUri&&Je.createElement(yi,{src:c.imageUri,alt:`select-icon-${f}`}),Je.createElement(bi,{appearance:n,className:l("selectListSelectItemText",n)},c.title)),Je.createElement(Ye,{appearance:n,value:C,primaryColor:n.theme.colorPrimary}))}))};import ye,{useEffect as Ro,useState as Jt}from"react";import{AnimatePresence as Aa,motion as Ia}from"framer-motion";var Na=({children:e,id:t,shouldWrap:o=!1})=>ye.createElement(ye.Fragment,null,o?ye.createElement(Aa,{initial:!1},ye.createElement(Ia.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),wo=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:r,onButtonClick:i,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:x,setVisible:c,setShowModal:f,onDismiss:C,showPagination:k=!1,customFormElements:B,allowBackNavigation:u,validationHandler:y})=>{var re;let P={...{linkCollection:mi,multiInput:ti,callToAction:ui,selectList:wi},...n},{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:S}=ie(),[m,h]=Jt(!1),[w,I]=Jt({}),[W,V]=Jt(!1),[A,z]=Jt(!1),[M,O]=Jt(null),se=t[o]??null,{markStepCompleted:ce,markStepStarted:$,isLoading:xe,updateCustomVariables:Te,markFlowCompleted:R}=J();Ro(()=>{Te(r)},[r,xe]),Ro(()=>{window&&u&&!A&&(window.location.hash=t[o].id,z(!0))},[u,A,z]),Ro(()=>{var _;if(window&&((_=window==null?void 0:window.location)!=null&&_.hash)&&window.location.hash.replace("#","")!==t[o].id){let ae=window.location.hash.replace("#",""),K=t.findIndex(X=>X.id===ae);K!==-1&&$(p,t[K].id)}},[(re=window==null?void 0:window.location)==null?void 0:re.hash,$,o,t]);function G(){return{data:w[t[o].id]??{},stepId:t[o].id,customVariables:r}}function ge(_,ae,K){let X=o+1<t.length?t[o+1]:null;return s&&s(_,K,X,w,G()),i?i(_,o,ae,X):!0}function le(_,ae){I(K=>{let X={};return X[_.id]=ae,{...K,...X}})}function ee(_){return _.selectedStep.imageUri?ye.createElement(ai,{image:_.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let L=ye.createElement(di,{step:t[o],canContinue:m&&!W,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(V(!0),y){let K=await y(t[o],o,t[o+1],w,G());if(K){O(K),V(!1);return}else O(null)}let _={...G()};await ce(p,t[o].id,_),o+1<t.length&&await $(p,t[o+1].id);let ae=ge(t[o],"primary",o);o+1>=t.length&&(x&&x(),C&&C(),a&&ae&&(c&&c(!1),f(!1)),await R(p)),T(t[o]),V(!1),window&&u&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{ge(t[o],"secondary",o),S(t[o])},onBack:async()=>{o-1>=0&&(V(!0),await $(p,t[o-1].id),V(!1))},steps:t,allowBackNavigation:u,errorMessage:M});return ye.createElement(ye.Fragment,null,ye.createElement(ni,{className:l("formContainer",e)},ye.createElement(si,null,ye.createElement(Na,{id:o,shouldWrap:d==="large-modal"},ye.createElement(li,{key:se.id,type:d,className:l("formContent",e)},t.map(_=>{let ae=P[_.type];return se.id!==_.id?null:ye.createElement(ae,{key:_.id,stepData:_,canContinue:m,setCanContinue:h,onSaveData:K=>{le(_,K)},appearance:e,customFormElements:B,flowId:p})}),k&&ye.createElement(ci,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),L))),d=="large-modal"&&ye.createElement(ee,{selectedStep:t[o]})))};import Xt from"react";import{createGlobalStyle as La}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return Xt.createElement(Xt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([n,r])=>typeof r=="object");if(t.length===0)return Xt.createElement(Xt.Fragment,null);let o=La`
634
- ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map(([s,p])=>`${$o(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Xt.createElement(o,{inlineStyles:t})}var Ti=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:r,customVariables:i,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:x,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:C=!1,modalPosition:k="center",repeatable:B=!1,onDismiss:u,showPagination:y=!1,allowBackNavigation:E=!1,validationHandler:P,showFrigadeBranding:T=!1})=>{let{getFlow:S,getFlowSteps:m,isLoading:h,targetingLogicShouldHideFlow:w,getFlowStatus:I,getCurrentStepIndex:W,markFlowCompleted:V,markFlowNotStarted:A}=J(),z=W(e),{mergeAppearanceWithDefault:M}=Q(),[O,se]=Da(!1),{setOpenFlowState:ce,getOpenFlowState:$,hasOpenModals:xe}=ke();d=M(d);let[Te,R]=n!==void 0&&r!==void 0?[n,r]:[$(e,!0),ee=>ce(e,ee)];if(Oa(()=>{!O&&!h&&(se(!0),I(e)===Y&&B&&A(e),se(!0))},[O,se,h]),h)return null;let G=S(e);if(!G||w(G))return null;let ge=m(e);if(!ge||n!==void 0&&n===!1||I(e)===Y&&a||(o=="modal"||o=="corner-modal")&&xe(e))return null;let le=()=>{R(!1),u&&u(),C===!0&&V(e)};if(k=="center"&&o==="modal"||o==="large-modal"){let ee={padding:"24px"};return o==="large-modal"?(ee.width="85%",ee.height="90%",ee.maxHeight="800px",ee.minHeight="500px",ee.padding="0"):ee.width="400px",_e.createElement(ot,{appearance:d,onClose:le,visible:Te,style:ee,dismissible:f,showFrigadeBranding:T},_e.createElement(oe,{appearance:d}),_e.createElement(wo,{appearance:d,steps:ge,selectedStep:z,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:R,onDismiss:u,showPagination:y,customFormElements:s,allowBackNavigation:E,validationHandler:P}))}return o==="modal"&&k!=="center"?_e.createElement(Ur,{appearance:d,onClose:le,visible:Te},_e.createElement(oe,{appearance:d}),_e.createElement(wo,{appearance:d,steps:ge,selectedStep:z,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:R,onDismiss:u,showPagination:y,customFormElements:s,allowBackNavigation:E,validationHandler:P})):_e.createElement(_e.Fragment,null,_e.createElement(oe,{appearance:d}),_e.createElement(wo,{appearance:d,steps:ge,selectedStep:z,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:R,onDismiss:u,showPagination:y,customFormElements:s,allowBackNavigation:E,validationHandler:P}))},Fi=Ti;import{useCallback as ki,useContext as $a,useEffect as Ma}from"react";function er(){let{organizationId:e,userId:t,setOrganizationId:o}=$a(q),{mutateUserFlowState:n}=Ae(),{config:r,apiUrl:i}=Me(),s=wt(),{verifySDKInitiated:p}=Tt();Ma(()=>{if(t&&e){if(t.startsWith(Ft))return;let x=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(x)||(s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let d=ki(async x=>{if(p(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let c={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify(c)}),n()},[e,t,r,n]),a=ki(async(x,c)=>{if(p(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let C={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:c}]};await s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify(C)}),n()},[e,t,r,n]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:d,trackEventForOrganization:a}}var Pi="frigade-xFrigade_guestUserId",Qt="frigade-xFrigade_userId",vi=({})=>{let{setFlowResponses:e}=Wt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Ae(),{userId:r,setUserId:i}=Ht(),[s,p]=tr(null),{getFlowStatus:d}=J(),{flows:a,userProperties:x,setIsNewGuestUser:c,flowResponses:f}=Ua(q),[C,k]=tr([]),[B,u]=tr([]),{organizationId:y}=er();To(()=>{if(!o&&t)for(let S=0;S<t.length;S++){let m=t[S],h=a.find(w=>w.slug===(m==null?void 0:m.flowId));if(h&&m&&m.shouldTrigger===!0&&h.type=="FORM"&&h.triggerType==="AUTOMATIC"&&!B.includes(h.slug)){setTimeout(()=>{E(m.flowId)},500);break}}},[o,t]),To(()=>{f.length>0&&n()},[f]);function E(S){let m=a.find(h=>h.slug===S);m&&m.triggerType==="AUTOMATIC"&&!B.includes(m.slug)&&(u([...B,m.slug]),k([m]))}function P(){if(!r){let S=localStorage.getItem(Qt);if(S){i(S);return}let m=localStorage.getItem(Pi);if(m){i(m);return}c(!0);let h=Ft+_a();try{localStorage.setItem(Pi,h)}catch(w){console.log("Failed to save guest user id locally: Local storage unavailable",w)}i(w=>w||h)}}To(()=>{try{if(a){let S=[];a.forEach(m=>{if(m.data){let h=m.data.match(/"imageUri":"(.*?)"/g);h&&h.forEach(w=>{let I=w.replace('"imageUri":"',"").replace('"',"");if(S.includes(I))return;let W=new Image;W.src=I,S.push(I)})}})}}catch{}},[a]),To(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Ft))try{localStorage.setItem(Qt,r)}catch(S){console.log("Failed to save user id locally: Local storage available",S)}r===null&&setTimeout(()=>{r===null&&P()},50)},[r,a,x]);function T(){return gt.createElement(gt.Fragment,null,C.map(S=>d(S.slug)!==Ne?null:gt.createElement("span",{key:S.slug},gt.createElement(Fi,{flowId:S.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return gt.createElement(gt.Fragment,null,gt.createElement(T,null))};import{ErrorBoundary as Ha}from"react-error-boundary";var or="https://api.frigade.com",q=za({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Ke,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:or});function Va(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var ja=({publicApiKey:e,userId:t,organizationId:o,config:n,children:r})=>{var se,ce;let[i,s]=Ie(t||null),[p,d]=Ie(o||null),[a,x]=Ie([]),[c,f]=Ie([]),[C,k]=Ie([]),[B,u]=Ie({}),[y,E]=Ie({}),[P,T]=Ie([]),[S,m]=Ie({}),[h,w]=Ie(!1),[I,W]=Ie(!1),[V,A]=Ie(!O(e)),z=($,xe)=>{if(xe==="_blank"){window.open($,"_blank");return}setTimeout(()=>{window.location.href=$},50)},M={theme:{...Ke.theme,...((se=n==null?void 0:n.defaultAppearance)==null?void 0:se.theme)??{}},styleOverrides:{...Ke.styleOverrides,...((ce=n==null?void 0:n.defaultAppearance)==null?void 0:ce.styleOverrides)??{}}};function O($){return!!($&&$.length>10&&$.substring(0,10)==="api_public")}return Fo(()=>{t&&s(t)},[t]),Fo(()=>{i&&window&&window.localStorage&&window.localStorage.getItem(Qt)&&window.localStorage.getItem(Qt)!==i&&Va()},[i]),Fo(()=>{o&&d(o)},[o]),Fo(()=>{if(O(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]),V?ht.createElement(q.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:x,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:k,userProperties:B,setUserProperties:u,openFlowStates:y,setOpenFlowStates:E,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:T,customVariables:S,setCustomVariables:m,isNewGuestUser:h,setIsNewGuestUser:w,hasActiveFullPageFlow:I,setHasActiveFullPageFlow:W,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:z,defaultAppearance:M,shouldGracefullyDegrade:V,setShouldGracefullyDegrade:A,apiUrl:n&&n.apiUrl?n.apiUrl:or}},r):ht.createElement(Ha,{fallback:ht.createElement(ht.Fragment,null,r)},ht.createElement(q.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:x,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:k,userProperties:B,setUserProperties:u,openFlowStates:y,setOpenFlowStates:E,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:T,customVariables:S,setCustomVariables:m,isNewGuestUser:h,setIsNewGuestUser:w,hasActiveFullPageFlow:I,setHasActiveFullPageFlow:W,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:z,defaultAppearance:M,shouldGracefullyDegrade:V,setShouldGracefullyDegrade:A,apiUrl:n&&n.apiUrl?n.apiUrl:or}},ht.createElement(Wa,{theme:M.theme},r,ht.createElement(vi,null))))};import Wp from"react";import de,{useEffect as is,useState as ns}from"react";import De,{useState as mp}from"react";import St from"styled-components";import vo from"react";import xt from"react";import Ei from"styled-components";var Bi=Ei.span`
633
+ `;var wi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let r=e.props,[i,s]=Zo([]),[p,d]=Zo(!1),[a,x]=Zo(e.id);return Qo(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Qo(()=>{a!==e.id&&(x(e.id),s([]))},[e]),Qo(()=>{o({choice:i}),i.length>=r.minChoices?t(!0):t(!1)},[i]),Je.createElement(fi,{className:l("selectListContainer",n)},Je.createElement(gi,null,Je.createElement(hi,{className:l("selectListTitle",n)},e.title),Je.createElement(xi,{appearance:n,className:l("selectListSubtitle",n)},e.subtitle)),r.options.map((c,f)=>{let C=i.includes(c.id);return Je.createElement(Ci,{key:`select-item-${f}`,onClick:()=>{if(i.includes(c.id)){s(i.filter(k=>k!==c.id));return}i.length<r.maxChoices?s([...i,c.id]):i.length==1&&r.maxChoices==1&&s([c.id])},hideBottomBorder:f===r.options.length-1,className:l("selectListSelectItem",n)},Je.createElement(Si,{className:l("selectListItemImage",n)},c.imageUri&&Je.createElement(yi,{src:c.imageUri,alt:`select-icon-${f}`}),Je.createElement(bi,{appearance:n,className:l("selectListSelectItemText",n)},c.title)),Je.createElement(Ye,{appearance:n,value:C,primaryColor:n.theme.colorPrimary}))}))};import ye,{useEffect as Ro,useState as Jt}from"react";import{AnimatePresence as Aa,motion as Ia}from"framer-motion";var Na=({children:e,id:t,shouldWrap:o=!1})=>ye.createElement(ye.Fragment,null,o?ye.createElement(Aa,{initial:!1},ye.createElement(Ia.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),wo=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:r,onButtonClick:i,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:x,setVisible:c,setShowModal:f,onDismiss:C,showPagination:k=!1,customFormElements:E,allowBackNavigation:u,validationHandler:b})=>{var M;let P={...{linkCollection:mi,multiInput:ti,callToAction:ui,selectList:wi},...n},{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:S}=se(),[m,h]=Jt(!1),[w,N]=Jt({}),[U,W]=Jt(!1),[A,_]=Jt(!1),[j,I]=Jt(null),ie=t[o]??null,{markStepCompleted:fe,markStepStarted:H,isLoading:Y,updateCustomVariables:ve,markFlowCompleted:te}=X();Ro(()=>{ve(r)},[r,Y]),Ro(()=>{window&&u&&!A&&(window.location.hash=t[o].id,_(!0))},[u,A,_]),Ro(()=>{var O;if(window&&((O=window==null?void 0:window.location)!=null&&O.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),G=t.findIndex(Z=>Z.id===ne);G!==-1&&H(p,t[G].id)}},[(M=window==null?void 0:window.location)==null?void 0:M.hash,H,o,t]);function q(){return{data:w[t[o].id]??{},stepId:t[o].id,customVariables:r}}function he(O,ne,G){let Z=o+1<t.length?t[o+1]:null;return s&&s(O,G,Z,w,q()),i?i(O,o,ne,Z):!0}function ae(O,ne){N(G=>{let Z={};return Z[O.id]=ne,{...G,...Z}})}function Q(O){return O.selectedStep.imageUri?ye.createElement(ai,{image:O.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let ge=ye.createElement(di,{step:t[o],canContinue:m&&!U,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(W(!0),b){let G=await b(t[o],o,t[o+1],w,q());if(G){I(G),W(!1);return}else I(null)}let O={...q()};await fe(p,t[o].id,O),o+1<t.length&&await H(p,t[o+1].id);let ne=he(t[o],"primary",o);o+1>=t.length&&(x&&x(),C&&C(),a&&ne&&(c&&c(!1),f(!1)),await te(p)),T(t[o]),W(!1),window&&u&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{he(t[o],"secondary",o),S(t[o])},onBack:async()=>{o-1>=0&&(W(!0),await H(p,t[o-1].id),W(!1))},steps:t,allowBackNavigation:u,errorMessage:j});return ye.createElement(ye.Fragment,null,ye.createElement(ni,{className:l("formContainer",e)},ye.createElement(si,null,ye.createElement(Na,{id:o,shouldWrap:d==="large-modal"},ye.createElement(li,{key:ie.id,type:d,className:l("formContent",e)},t.map(O=>{let ne=P[O.type];return ie.id!==O.id?null:ye.createElement(ne,{key:O.id,stepData:O,canContinue:m,setCanContinue:h,onSaveData:G=>{ae(O,G)},appearance:e,customFormElements:E,flowId:p})}),k&&ye.createElement(ci,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ge))),d=="large-modal"&&ye.createElement(Q,{selectedStep:t[o]})))};import Xt from"react";import{createGlobalStyle as La}from"styled-components";function re({appearance:e}){if(!e||!e.styleOverrides)return Xt.createElement(Xt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([n,r])=>typeof r=="object");if(t.length===0)return Xt.createElement(Xt.Fragment,null);let o=La`
634
+ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map(([s,p])=>`${$o(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Xt.createElement(o,{inlineStyles:t})}var Ti=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:r,customVariables:i,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:x,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:C=!1,modalPosition:k="center",repeatable:E=!1,onDismiss:u,showPagination:b=!1,allowBackNavigation:v=!1,validationHandler:P,showFrigadeBranding:T=!1})=>{let{getFlow:S,getFlowSteps:m,isLoading:h,targetingLogicShouldHideFlow:w,getFlowStatus:N,getCurrentStepIndex:U,markFlowCompleted:W,markFlowNotStarted:A}=X(),_=U(e),{mergeAppearanceWithDefault:j}=R(),[I,ie]=Da(!1),{setOpenFlowState:fe,getOpenFlowState:H,hasOpenModals:Y}=Fe();d=j(d);let[ve,te]=n!==void 0&&r!==void 0?[n,r]:[H(e,!0),Q=>fe(e,Q)];if(Oa(()=>{!I&&!h&&(ie(!0),N(e)===J&&E&&A(e),ie(!0))},[I,ie,h]),h)return null;let q=S(e);if(!q||w(q))return null;let he=m(e);if(!he||n!==void 0&&n===!1||N(e)===J&&a||(o=="modal"||o=="corner-modal")&&Y(e))return null;let ae=()=>{te(!1),u&&u(),C===!0&&W(e)};if(k=="center"&&o==="modal"||o==="large-modal"){let Q={padding:"24px"};return o==="large-modal"?(Q.width="85%",Q.height="90%",Q.maxHeight="800px",Q.minHeight="500px",Q.padding="0"):Q.width="400px",_e.createElement(ot,{appearance:d,onClose:ae,visible:ve,style:Q,dismissible:f,showFrigadeBranding:T},_e.createElement(re,{appearance:d}),_e.createElement(wo,{appearance:d,steps:he,selectedStep:_,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:te,onDismiss:u,showPagination:b,customFormElements:s,allowBackNavigation:v,validationHandler:P}))}return o==="modal"&&k!=="center"?_e.createElement(Ur,{appearance:d,onClose:ae,visible:ve},_e.createElement(re,{appearance:d}),_e.createElement(wo,{appearance:d,steps:he,selectedStep:_,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:te,onDismiss:u,showPagination:b,customFormElements:s,allowBackNavigation:v,validationHandler:P})):_e.createElement(_e.Fragment,null,_e.createElement(re,{appearance:d}),_e.createElement(wo,{appearance:d,steps:he,selectedStep:_,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:te,onDismiss:u,showPagination:b,customFormElements:s,allowBackNavigation:v,validationHandler:P}))},Fi=Ti;import{useCallback as ki,useContext as $a,useEffect as Ma}from"react";function er(){let{organizationId:e,userId:t,setOrganizationId:o}=$a(K),{mutateUserFlowState:n}=Ae(),{config:r,apiUrl:i}=Me(),s=wt(),{verifySDKInitiated:p}=Tt();Ma(()=>{if(t&&e){if(t.startsWith(Ft))return;let x=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(x)||(s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let d=ki(async x=>{if(p(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let c={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify(c)}),n()},[e,t,r,n]),a=ki(async(x,c)=>{if(p(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let C={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:c}]};await s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify(C)}),n()},[e,t,r,n]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:d,trackEventForOrganization:a}}var Pi="frigade-xFrigade_guestUserId",Qt="frigade-xFrigade_userId",vi=({})=>{let{setFlowResponses:e}=Wt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Ae(),{userId:r,setUserId:i}=Ht(),[s,p]=tr(null),{getFlowStatus:d}=X(),{flows:a,userProperties:x,setIsNewGuestUser:c,flowResponses:f}=Ua(K),[C,k]=tr([]),[E,u]=tr([]),{organizationId:b}=er();To(()=>{if(!o&&t)for(let S=0;S<t.length;S++){let m=t[S],h=a.find(w=>w.slug===(m==null?void 0:m.flowId));if(h&&m&&m.shouldTrigger===!0&&h.type=="FORM"&&h.triggerType==="AUTOMATIC"&&!E.includes(h.slug)){setTimeout(()=>{v(m.flowId)},500);break}}},[o,t]),To(()=>{f.length>0&&n()},[f]);function v(S){let m=a.find(h=>h.slug===S);m&&m.triggerType==="AUTOMATIC"&&!E.includes(m.slug)&&(u([...E,m.slug]),k([m]))}function P(){if(!r){let S=localStorage.getItem(Qt);if(S){i(S);return}let m=localStorage.getItem(Pi);if(m){i(m);return}c(!0);let h=Ft+_a();try{localStorage.setItem(Pi,h)}catch(w){console.log("Failed to save guest user id locally: Local storage unavailable",w)}i(w=>w||h)}}To(()=>{try{if(a){let S=[];a.forEach(m=>{if(m.data){let h=m.data.match(/"imageUri":"(.*?)"/g);h&&h.forEach(w=>{let N=w.replace('"imageUri":"',"").replace('"',"");if(S.includes(N))return;let U=new Image;U.src=N,S.push(N)})}})}}catch{}},[a]),To(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Ft))try{localStorage.setItem(Qt,r)}catch(S){console.log("Failed to save user id locally: Local storage available",S)}r===null&&setTimeout(()=>{r===null&&P()},50)},[r,a,x]);function T(){return gt.createElement(gt.Fragment,null,C.map(S=>d(S.slug)!==Ne?null:gt.createElement("span",{key:S.slug},gt.createElement(Fi,{flowId:S.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return gt.createElement(gt.Fragment,null,gt.createElement(T,null))};import{ErrorBoundary as Ha}from"react-error-boundary";var or="https://api.frigade.com",K=za({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Ke,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:or});function Va(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var ja=({publicApiKey:e,userId:t,organizationId:o,config:n,children:r})=>{var ie,fe;let[i,s]=Ie(t||null),[p,d]=Ie(o||null),[a,x]=Ie([]),[c,f]=Ie([]),[C,k]=Ie([]),[E,u]=Ie({}),[b,v]=Ie({}),[P,T]=Ie([]),[S,m]=Ie({}),[h,w]=Ie(!1),[N,U]=Ie(!1),[W,A]=Ie(!I(e)),_=(H,Y)=>{if(Y==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},50)},j={theme:{...Ke.theme,...((ie=n==null?void 0:n.defaultAppearance)==null?void 0:ie.theme)??{}},styleOverrides:{...Ke.styleOverrides,...((fe=n==null?void 0:n.defaultAppearance)==null?void 0:fe.styleOverrides)??{}}};function I(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}return Fo(()=>{t&&s(t)},[t]),Fo(()=>{i&&window&&window.localStorage&&window.localStorage.getItem(Qt)&&window.localStorage.getItem(Qt)!==i&&Va()},[i]),Fo(()=>{o&&d(o)},[o]),Fo(()=>{if(I(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]),W?ht.createElement(K.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:x,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:k,userProperties:E,setUserProperties:u,openFlowStates:b,setOpenFlowStates:v,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:T,customVariables:S,setCustomVariables:m,isNewGuestUser:h,setIsNewGuestUser:w,hasActiveFullPageFlow:N,setHasActiveFullPageFlow:U,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:_,defaultAppearance:j,shouldGracefullyDegrade:W,setShouldGracefullyDegrade:A,apiUrl:n&&n.apiUrl?n.apiUrl:or}},r):ht.createElement(Ha,{fallback:ht.createElement(ht.Fragment,null,r)},ht.createElement(K.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:x,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:k,userProperties:E,setUserProperties:u,openFlowStates:b,setOpenFlowStates:v,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:T,customVariables:S,setCustomVariables:m,isNewGuestUser:h,setIsNewGuestUser:w,hasActiveFullPageFlow:N,setHasActiveFullPageFlow:U,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:_,defaultAppearance:j,shouldGracefullyDegrade:W,setShouldGracefullyDegrade:A,apiUrl:n&&n.apiUrl?n.apiUrl:or}},ht.createElement(Wa,{theme:j.theme},r,ht.createElement(vi,null))))};import Wp from"react";import de,{useEffect as is,useState as ns}from"react";import De,{useState as mp}from"react";import St from"styled-components";import vo from"react";import xt from"react";import Ei from"styled-components";var Bi=Ei.span`
635
635
  font-weight: 400;
636
636
  font-size: 15px;
637
637
  line-height: 20px;
@@ -648,7 +648,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
648
648
  padding-bottom: 20px;
649
649
  border-top: 1px solid ${e=>e.theme.colorBorder};
650
650
  width: 100%;
651
- `,ko=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:r,primaryColor:i="#000000",checkBoxType:s="square",appearance:p})=>xt.createElement(xt.Fragment,null,xt.createElement(Ga,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},n==="left"&&e&&xt.createElement(Bi,{className:l("checklistStepLabel",p),style:o},e),xt.createElement(Ye,{appearance:p,value:t,type:s,primaryColor:i}),n==="right"&&e&&xt.createElement(Bi,{className:l("checklistStepLabel",p),style:o},e)),xt.createElement(oe,{appearance:p}));import{motion as qa}from"framer-motion";import Zt from"styled-components";var Ai=Zt.div`
651
+ `,ko=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:r,primaryColor:i="#000000",checkBoxType:s="square",appearance:p})=>xt.createElement(xt.Fragment,null,xt.createElement(Ga,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},n==="left"&&e&&xt.createElement(Bi,{className:l("checklistStepLabel",p),style:o},e),xt.createElement(Ye,{appearance:p,value:t,type:s,primaryColor:i}),n==="right"&&e&&xt.createElement(Bi,{className:l("checklistStepLabel",p),style:o},e)),xt.createElement(re,{appearance:p}));import{motion as qa}from"framer-motion";import Zt from"styled-components";var Ai=Zt.div`
652
652
  font-weight: 700;
653
653
  font-size: 18px;
654
654
  line-height: 22px;
@@ -695,11 +695,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
695
695
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
696
696
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
697
697
  ${e=>qe(e)}
698
- `,Za={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Ra={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},ze=({count:e,total:t,fillColor:o,bgColor:n=Ya.backgroundColor,display:r="count",textLocation:i="left",style:s={},textStyle:p={},appearance:d})=>{var k,B;if(t===0)return Ct.createElement(Ct.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,x=r==="compact"?"5px":"10px",c=Math.round(e/t*100),f=r==="compact"?"5px":"20px",C;return r==="count"?C=`${e} of ${t}`:r==="compact"?C=`${c}%`:r==="percent"&&(C=`${c}% complete`),i==="top"&&(f="0px"),Ct.createElement(Ja,{className:l("progressBarContainer",d),textLocation:i,styleOverrides:s},Ct.createElement(Qa,{className:l("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:f,textLocation:i},C),Ct.createElement(Xa,{textLocation:i,className:l("progressBar",d)},Ct.createElement(Ka.div,{style:{...Ra,width:a,height:x,backgroundColor:((k=d==null?void 0:d.theme)==null?void 0:k.colorPrimary)??o,zIndex:r=="compact"?1:5},className:l("progressBarFill",d)}),Ct.createElement("div",{className:l("progressBarBackground",d),style:{...Za,height:x,backgroundColor:((B=d==null?void 0:d.theme)==null?void 0:B.colorSecondary)??n}})))};import Rt from"react";import ep from"styled-components";import Eo from"react";import Bo from"react";var At=({stepData:e,appearance:t})=>Bo.createElement(Bo.Fragment,null,Bo.createElement(Ii,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),Bo.createElement(Ni,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import ir from"react";var It=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return ir.createElement(Co,{className:l("ctaContainer",t)},e.secondaryButtonTitle&&ir.createElement(te,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}),ir.createElement(te,{appearance:t,title:e.primaryButtonTitle,onClick:o}))};var Nt=({stepData:e,appearance:t})=>Eo.createElement(Eo.Fragment,null,Eo.createElement(At,{stepData:e,appearance:t}),Eo.createElement(It,{stepData:e,appearance:t}));import Di from"react";function $i(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),Di.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:l("checklistStepVideo",e.appearance)})}else return Di.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var nr="default",tp=ep.img`
698
+ `,Za={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Ra={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},ze=({count:e,total:t,fillColor:o,bgColor:n=Ya.backgroundColor,display:r="count",textLocation:i="left",style:s={},textStyle:p={},appearance:d})=>{var k,E;if(t===0)return Ct.createElement(Ct.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,x=r==="compact"?"5px":"10px",c=Math.round(e/t*100),f=r==="compact"?"5px":"20px",C;return r==="count"?C=`${e} of ${t}`:r==="compact"?C=`${c}%`:r==="percent"&&(C=`${c}% complete`),i==="top"&&(f="0px"),Ct.createElement(Ja,{className:l("progressBarContainer",d),textLocation:i,styleOverrides:s},Ct.createElement(Qa,{className:l("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:f,textLocation:i},C),Ct.createElement(Xa,{textLocation:i,className:l("progressBar",d)},Ct.createElement(Ka.div,{style:{...Ra,width:a,height:x,backgroundColor:((k=d==null?void 0:d.theme)==null?void 0:k.colorPrimary)??o,zIndex:r=="compact"?1:5},className:l("progressBarFill",d)}),Ct.createElement("div",{className:l("progressBarBackground",d),style:{...Za,height:x,backgroundColor:((E=d==null?void 0:d.theme)==null?void 0:E.colorSecondary)??n}})))};import Rt from"react";import ep from"styled-components";import Eo from"react";import Bo from"react";var At=({stepData:e,appearance:t})=>Bo.createElement(Bo.Fragment,null,Bo.createElement(Ii,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),Bo.createElement(Ni,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import ir from"react";var It=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return ir.createElement(Co,{className:l("ctaContainer",t)},e.secondaryButtonTitle&&ir.createElement(oe,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}),ir.createElement(oe,{appearance:t,title:e.primaryButtonTitle,onClick:o}))};var Nt=({stepData:e,appearance:t})=>Eo.createElement(Eo.Fragment,null,Eo.createElement(At,{stepData:e,appearance:t}),Eo.createElement(It,{stepData:e,appearance:t}));import Di from"react";function $i(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),Di.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:l("checklistStepVideo",e.appearance)})}else return Di.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var nr="default",tp=ep.img`
699
699
  border-radius: 4px;
700
700
  max-height: 260px;
701
701
  min-height: 200px;
702
- `,Mi=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Rt.createElement("div",null,o)}return Rt.createElement(Ai,{className:l("checklistStepContent",t)},e.imageUri?Rt.createElement(tp,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Rt.createElement($i,{videoUri:e.videoUri,appearance:t}):null,Rt.createElement(Nt,{stepData:e,appearance:t}))};import ve,{useRef as op,useState as rp}from"react";import Lt from"styled-components";var Ui=Lt.div`
702
+ `,Mi=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Rt.createElement("div",null,o)}return Rt.createElement(Ai,{className:l("checklistStepContent",t)},e.imageUri?Rt.createElement(tp,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Rt.createElement($i,{videoUri:e.videoUri,appearance:t}):null,Rt.createElement(Nt,{stepData:e,appearance:t}))};import Pe,{useRef as op,useState as rp}from"react";import Lt from"styled-components";var Ui=Lt.div`
703
703
  display: block;
704
704
  `,ip=Lt.div`
705
705
  display: flex;
@@ -744,7 +744,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
744
744
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
745
745
  border-radius: 50%;
746
746
  }
747
- `,_i="videoCarousel",zi=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return ve.createElement(Ui,null,ve.createElement(Nt,{stepData:e,appearance:t}));function o({video:i}){let s=op(),[p,d]=rp(!1);return ve.createElement(np,null,!p&&ve.createElement(ap,{onClick:()=>{d(!0),s.current.play()},appearance:t},ve.createElement(So,null)),ve.createElement(sp,{controls:p,ref:s,play:p,src:i.uri}),ve.createElement(lp,null,i.title))}let n=e.props;return n.videos?ve.createElement(Ui,null,ve.createElement(At,{stepData:e,appearance:t}),ve.createElement(ip,null,n.videos.map((i,s)=>ve.createElement("span",{key:`${i.uri}-${s}`},ve.createElement(o,{video:i})))),ve.createElement(It,{stepData:e,appearance:t})):null};import Xe from"react";import Ao from"styled-components";var Wi=Ao.div`
747
+ `,_i="videoCarousel",zi=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Pe.createElement(Ui,null,Pe.createElement(Nt,{stepData:e,appearance:t}));function o({video:i}){let s=op(),[p,d]=rp(!1);return Pe.createElement(np,null,!p&&Pe.createElement(ap,{onClick:()=>{d(!0),s.current.play()},appearance:t},Pe.createElement(So,null)),Pe.createElement(sp,{controls:p,ref:s,play:p,src:i.uri}),Pe.createElement(lp,null,i.title))}let n=e.props;return n.videos?Pe.createElement(Ui,null,Pe.createElement(At,{stepData:e,appearance:t}),Pe.createElement(ip,null,n.videos.map((i,s)=>Pe.createElement("span",{key:`${i.uri}-${s}`},Pe.createElement(o,{video:i})))),Pe.createElement(It,{stepData:e,appearance:t})):null};import Xe from"react";import Ao from"styled-components";var Wi=Ao.div`
748
748
  display: block;
749
749
  `,pp=Ao.pre`
750
750
  display: block;
@@ -800,30 +800,30 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
800
800
  `,Cp=St.div`
801
801
  flex: 2;
802
802
  padding: 2rem;
803
- `,Sp=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:r,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:x}=Q();d=x(d);let f={...{[nr]:Mi,[_i]:zi,[Hi]:Vi},...p},[C,k]=mp(0),B=r??C,u=i??k,y=o.filter(P=>P.complete===!0).length,E=()=>{var P;return!((P=o[B])!=null&&P.type)||!f[o[B].type]?f[nr]({stepData:o[B],appearance:d}):f[o[B].type]({stepData:o[B],appearance:d})};return De.createElement(up,{type:a,style:n,className:s,appearance:d},De.createElement(ji,{style:{flex:1}},De.createElement(ji,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},De.createElement(fp,{className:l("checklistTitle",d),appearance:d},e),De.createElement(gp,{className:l("checklistSubtitle",d),appearance:d},t),De.createElement(ze,{total:o.length,count:y,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),De.createElement(hp,{className:l("checklistStepsContainer",d)},o.map((P,T)=>De.createElement(Oi,{data:P,index:T,key:T,listLength:o.length,isSelected:T===B,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{u(T)}})))),De.createElement(xp,{appearance:d,className:l("checklistDivider",d)}),De.createElement(Cp,null,De.createElement(E,null)))},sr=Sp;import U,{useState as kp}from"react";import Gi from"react";import yp from"styled-components";var bp=yp.svg`
803
+ `,Sp=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:r,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:x}=R();d=x(d);let f={...{[nr]:Mi,[_i]:zi,[Hi]:Vi},...p},[C,k]=mp(0),E=r??C,u=i??k,b=o.filter(P=>P.complete===!0).length,v=()=>{var P;return!((P=o[E])!=null&&P.type)||!f[o[E].type]?f[nr]({stepData:o[E],appearance:d}):f[o[E].type]({stepData:o[E],appearance:d})};return De.createElement(up,{type:a,style:n,className:s,appearance:d},De.createElement(ji,{style:{flex:1}},De.createElement(ji,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},De.createElement(fp,{className:l("checklistTitle",d),appearance:d},e),De.createElement(gp,{className:l("checklistSubtitle",d),appearance:d},t),De.createElement(ze,{total:o.length,count:b,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),De.createElement(hp,{className:l("checklistStepsContainer",d)},o.map((P,T)=>De.createElement(Oi,{data:P,index:T,key:T,listLength:o.length,isSelected:T===E,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{u(T)}})))),De.createElement(xp,{appearance:d,className:l("checklistDivider",d)}),De.createElement(Cp,null,De.createElement(v,null)))},sr=Sp;import $,{useState as kp}from"react";import Gi from"react";import yp from"styled-components";var bp=yp.svg`
804
804
  transition: 'transform 0.35s ease-in-out';
805
- `,Ot=({color:e="#323232",style:t,className:o})=>Gi.createElement(bp,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},Gi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as Pp}from"framer-motion";import ue from"styled-components";var lr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},qi=ue.div`
805
+ `,Ot=({color:e="#323232",style:t,className:o})=>Gi.createElement(bp,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},Gi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as Pp}from"framer-motion";import me from"styled-components";var lr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},qi=me.div`
806
806
  max-height: 350px;
807
807
  padding-bottom: 40px;
808
- `,Ki=ue.div`
808
+ `,Ki=me.div`
809
809
  display: flex;
810
810
  flex-direction: column;
811
811
  margin-top: 20px;
812
- `,Yi=ue.h1`
812
+ `,Yi=me.h1`
813
813
  font-style: normal;
814
814
  font-weight: 600;
815
815
  font-size: 30px;
816
816
  line-height: 36px;
817
817
  margin-bottom: 16px;
818
818
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
819
- `,Ji=ue.h2`
819
+ `,Ji=me.h2`
820
820
  font-weight: 400;
821
821
  font-size: 16px;
822
822
  line-height: 20px;
823
823
  margin-bottom: 16px;
824
824
  padding-left: 1px;
825
825
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
826
- `,Xi=ue.div`
826
+ `,Xi=me.div`
827
827
  ${e=>F(e)} {
828
828
  border: 1px solid #fafafa;
829
829
  }
@@ -833,11 +833,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
833
833
  flex-direction: column;
834
834
  min-height: 240px;
835
835
  overflow: hidden;
836
- `,Qi=ue.div`
836
+ `,Qi=me.div`
837
837
  display: flex;
838
838
  flex-direction: row;
839
839
  justify-content: space-between;
840
- `,Zi=ue.p`
840
+ `,Zi=me.p`
841
841
  ${e=>F(e)} {
842
842
  font-weight: 400;
843
843
  font-size: 10px;
@@ -846,12 +846,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
846
846
  color: #8c8c8c;
847
847
  margin: 20px;
848
848
  }
849
- `,Ri=ue.div`
849
+ `,Ri=me.div`
850
850
  display: flex;
851
851
  flex-direction: row;
852
- `,en=ue.div`
852
+ `,en=me.div`
853
853
  flex: 1;
854
- `,tn=ue.div`
854
+ `,tn=me.div`
855
855
  ${e=>F(e)} {
856
856
  display: flex;
857
857
  justify-content: center;
@@ -861,7 +861,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
861
861
  padding-left: 8px;
862
862
  padding-right: 8px;
863
863
  }
864
- `,on=ue.p`
864
+ `,on=me.p`
865
865
  ${e=>F(e)} {
866
866
  font-style: normal;
867
867
  font-weight: 600;
@@ -873,7 +873,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
873
873
  margin-top: 20px;
874
874
  margin-bottom: 16px;
875
875
  }
876
- `,rn=ue.p`
876
+ `,rn=me.p`
877
877
  ${e=>F(e)} {
878
878
  font-weight: 400;
879
879
  font-size: 14px;
@@ -882,14 +882,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
882
882
  color: ${e=>e.appearance.theme.colorTextSecondary};
883
883
  margin-bottom: 8px;
884
884
  }
885
- `,nn=ue.div`
885
+ `,nn=me.div`
886
886
  ${e=>F(e)} {
887
887
  display: flex;
888
888
  flex-direction: row;
889
889
  justify-content: center;
890
890
  gap: 8px;
891
891
  }
892
- `,sn=ue.div`
892
+ `,sn=me.div`
893
893
  ${e=>F(e)} {
894
894
  // Anything inside this block will be ignored if the user provides a custom class
895
895
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
@@ -909,7 +909,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
909
909
  justify-content: space-between;
910
910
  position: relative;
911
911
  cursor: pointer;
912
- `,ln=ue.p`
912
+ `,ln=me.p`
913
913
  ${e=>F(e)} {
914
914
  // Anything inside this block will be ignored if the user provides a custom class
915
915
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
@@ -918,12 +918,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
918
918
  font-size: 14px;
919
919
  line-height: 22px;
920
920
  margin: 0;
921
- `,an=ue.div`
921
+ `,an=me.div`
922
922
  display: flex;
923
923
  flex-direction: row;
924
924
  justify-content: flex-end;
925
925
  align-content: center;
926
- `,pn=ue.div`
926
+ `,pn=me.div`
927
927
  display: flex;
928
928
  flex: 1;
929
929
  flex-direction: row;
@@ -931,7 +931,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
931
931
  align-content: center;
932
932
  align-items: center;
933
933
  margin-right: 20px;
934
- `,dn=ue.div`
934
+ `,dn=me.div`
935
935
  display: block;
936
936
  width: 100%;
937
937
  `;import wp from"styled-components";var cn=wp.div`
@@ -1015,7 +1015,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1015
1015
  line-height: 14px;
1016
1016
  font-weight: 400;
1017
1017
  cursor: pointer;
1018
- `;var Fp=({steps:e,style:t,title:o,primaryColor:n,appearance:r,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=ie();return Ze.createElement(mn,{style:t,className:l("guideContainer",r)},Ze.createElement(fn,{className:l("guideTitle",r)},o),Ze.createElement(un,{className:l("guideItemContainer",r)},e.map((p,d)=>Ze.createElement(gn,{key:`guide-${p.id??d}`,as:Tp.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",r)},p.icon&&Ze.createElement(hn,{className:l("guideIcon",r)},Ze.createElement(xn,null,p.icon)),Ze.createElement(Cn,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:me(p.title)}),Ze.createElement(Sn,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:me(p.subtitle)}),Ze.createElement(yn,{className:l("guideItemLink",r),color:n,onClick:()=>{p.primaryButtonUri&&s(p),i&&i(p)}},p.primaryButtonTitle)))))},eo=Fp;var vp=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:r,onClose:i,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:x,guideTitle:c,onGuideButtonClick:f})=>{let C=({stepData:m,handleSecondaryCTAClick:h,handleCTAClick:w})=>m?U.createElement(tn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},U.createElement(on,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:me(m.title)}),U.createElement(rn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:me(m.subtitle)}),U.createElement(nn,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&U.createElement(te,{title:m.secondaryButtonTitle,onClick:h,appearance:a,secondary:!0}),U.createElement(te,{title:m.primaryButtonTitle,onClick:w,appearance:a}))):U.createElement(U.Fragment,null),B={...{default:m=>{var W;if((W=e[E])!=null&&W.StepContent){let V=e[E].StepContent;return U.createElement("div",null,V)}let h=e[E];return U.createElement(C,{stepData:m,handleCTAClick:()=>{h.handlePrimaryButtonClick&&h.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{h.handleSecondaryButtonClick&&h.handleSecondaryButtonClick()}})}},...d},[u,y]=kp(0),E=s??u,P=p??y,T=()=>{var m;return e?!((m=e[E])!=null&&m.type)||!B[e[E].type]?B.default(e[E]):B[e[E].type]({stepData:e[E],primaryColor:a.theme.colorPrimary}):U.createElement(U.Fragment,null)},S=e.filter(m=>m.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(lr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=lr),U.createElement(ot,{onClose:i,visible:r,appearance:a},U.createElement(dn,null,U.createElement(Ki,null,U.createElement(Yi,{appearance:a,className:l("checklistTitle",a)},t),U.createElement(Ji,{appearance:a,className:l("checklistSubtitle",a)},o)),U.createElement(qi,null,e&&e.length>0&&U.createElement(Xi,{className:l("stepsContainer",a)},U.createElement(Qi,null,U.createElement("div",{style:{flex:3}},U.createElement(Zi,{className:l("stepsTitle",a)},n)),U.createElement(pn,null,U.createElement(ze,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:S,total:e.length,appearance:a}))),U.createElement(Ri,null,U.createElement(en,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,h)=>{let w=E===h;return U.createElement(sn,{selected:w,className:l(`checklistStepListItem${w?"Selected":""}`,a),key:`checklist-guide-step-${m.id??h}`,disabled:m.blocked,onClick:()=>{m.blocked||P(h)},title:m.blocked?"Finish remaining steps to continue":void 0},w&&U.createElement(Po,{className:l("checklistStepItemSelectedIndicator",a),as:Pp.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),U.createElement(ln,{selected:w,className:l(`checklistStepListStepName${w?"Selected":""}`,a)},m.stepName),U.createElement(an,null,U.createElement(Ye,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),U.createElement(cn,null,U.createElement(Ot,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),U.createElement(T,null))),x&&x.length>0&&U.createElement(eo,{steps:x,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(f&&f(m),!0)}))))):U.createElement(U.Fragment,null)},ar=vp;import{useEffect as Bp,useState as Ep}from"react";var bn=()=>{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]=Ep(t),r=null,i=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,a])=>{if(!window)return[d,!1];let x=window.matchMedia(a);return x.addEventListener("change",i),[d,x.matches]}));n(p)};return Bp(()=>{s()},[]),o};import we,{useEffect as $n,useState as Np}from"react";import fe from"react";import{AnimatePresence as Ap,motion as Ip}from"framer-motion";import Re from"styled-components";var wn=Re.div`
1018
+ `;var Fp=({steps:e,style:t,title:o,primaryColor:n,appearance:r,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=se();return Ze.createElement(mn,{style:t,className:l("guideContainer",r)},Ze.createElement(fn,{className:l("guideTitle",r)},o),Ze.createElement(un,{className:l("guideItemContainer",r)},e.map((p,d)=>Ze.createElement(gn,{key:`guide-${p.id??d}`,as:Tp.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",r)},p.icon&&Ze.createElement(hn,{className:l("guideIcon",r)},Ze.createElement(xn,null,p.icon)),Ze.createElement(Cn,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:ce(p.title)}),Ze.createElement(Sn,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:ce(p.subtitle)}),Ze.createElement(yn,{className:l("guideItemLink",r),color:n,onClick:()=>{p.primaryButtonUri&&s(p),i&&i(p)}},p.primaryButtonTitle)))))},eo=Fp;var vp=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:r,onClose:i,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:x,guideTitle:c,onGuideButtonClick:f})=>{let C=({stepData:m,handleSecondaryCTAClick:h,handleCTAClick:w})=>m?$.createElement(tn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},$.createElement(on,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:ce(m.title)}),$.createElement(rn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:ce(m.subtitle)}),$.createElement(nn,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&$.createElement(oe,{title:m.secondaryButtonTitle,onClick:h,appearance:a,secondary:!0}),$.createElement(oe,{title:m.primaryButtonTitle,onClick:w,appearance:a}))):$.createElement($.Fragment,null),E={...{default:m=>{var U;if((U=e[v])!=null&&U.StepContent){let W=e[v].StepContent;return $.createElement("div",null,W)}let h=e[v];return $.createElement(C,{stepData:m,handleCTAClick:()=>{h.handlePrimaryButtonClick&&h.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{h.handleSecondaryButtonClick&&h.handleSecondaryButtonClick()}})}},...d},[u,b]=kp(0),v=s??u,P=p??b,T=()=>{var m;return e?!((m=e[v])!=null&&m.type)||!E[e[v].type]?E.default(e[v]):E[e[v].type]({stepData:e[v],primaryColor:a.theme.colorPrimary}):$.createElement($.Fragment,null)},S=e.filter(m=>m.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(lr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=lr),$.createElement(ot,{onClose:i,visible:r,appearance:a},$.createElement(dn,null,$.createElement(Ki,null,$.createElement(Yi,{appearance:a,className:l("checklistTitle",a)},t),$.createElement(Ji,{appearance:a,className:l("checklistSubtitle",a)},o)),$.createElement(qi,null,e&&e.length>0&&$.createElement(Xi,{className:l("stepsContainer",a)},$.createElement(Qi,null,$.createElement("div",{style:{flex:3}},$.createElement(Zi,{className:l("stepsTitle",a)},n)),$.createElement(pn,null,$.createElement(ze,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:S,total:e.length,appearance:a}))),$.createElement(Ri,null,$.createElement(en,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,h)=>{let w=v===h;return $.createElement(sn,{selected:w,className:l(`checklistStepListItem${w?"Selected":""}`,a),key:`checklist-guide-step-${m.id??h}`,disabled:m.blocked,onClick:()=>{m.blocked||P(h)},title:m.blocked?"Finish remaining steps to continue":void 0},w&&$.createElement(Po,{className:l("checklistStepItemSelectedIndicator",a),as:Pp.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),$.createElement(ln,{selected:w,className:l(`checklistStepListStepName${w?"Selected":""}`,a)},m.stepName),$.createElement(an,null,$.createElement(Ye,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),$.createElement(cn,null,$.createElement(Ot,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),$.createElement(T,null))),x&&x.length>0&&$.createElement(eo,{steps:x,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(f&&f(m),!0)}))))):$.createElement($.Fragment,null)},ar=vp;import{useEffect as Bp,useState as Ep}from"react";var bn=()=>{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]=Ep(t),r=null,i=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,a])=>{if(!window)return[d,!1];let x=window.matchMedia(a);return x.addEventListener("change",i),[d,x.matches]}));n(p)};return Bp(()=>{s()},[]),o};import we,{useEffect as $n,useState as Np}from"react";import ue from"react";import{AnimatePresence as Ap,motion as Ip}from"framer-motion";import Re from"styled-components";var wn=Re.div`
1019
1019
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1020
1020
  border: 1px solid;
1021
1021
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -1062,7 +1062,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1062
1062
  flex-direction: row;
1063
1063
  justify-content: flex-start;
1064
1064
  align-items: center;
1065
- `;var An=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:r,appearance:i,customStepTypes:s})=>{var x,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return fe.createElement(fe.Fragment,null,e.imageUri||e.videoUri?fe.createElement(Tn,{className:l("stepMediaContainer",i)},e.imageUri?fe.createElement(Fn,{className:l("stepImage",i),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?fe.createElement(Bt,{appearance:i,videoUri:e.videoUri}):null):null,fe.createElement(Bn,{className:l("stepSubtitle",i),appearance:i,dangerouslySetInnerHTML:me(e.subtitle)}),fe.createElement(Co,{className:l("checklistCTAContainer",i)},e.secondaryButtonTitle?fe.createElement(te,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:i}):null,fe.createElement(te,{title:e.primaryButtonTitle??"Continue",onClick:()=>n(),appearance:i})))}function a(){if(!s)return null;let f=s[e.type];return f?f(e,i):null}return fe.createElement(wn,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",i),appearance:i},fe.createElement(kn,{className:l("stepHeader",i)},fe.createElement(En,null,fe.createElement(ko,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(x=i==null?void 0:i.theme)==null?void 0:x.colorPrimary,appearance:i}),fe.createElement(Pn,{appearance:i,className:l("stepTitle",i),dangerouslySetInnerHTML:me(e.title)})),fe.createElement(vn,{className:l("stepChevronContainer",i),onClick:()=>o()},fe.createElement(Ot,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=i==null?void 0:i.theme)==null?void 0:c.colorTextSecondary}))),fe.createElement(Ap,null,!t&&fe.createElement(Ip.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??d())))};import Dt from"styled-components";var Mx=Dt.div`
1065
+ `;var An=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:r,appearance:i,customStepTypes:s})=>{var x,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return ue.createElement(ue.Fragment,null,e.imageUri||e.videoUri?ue.createElement(Tn,{className:l("stepMediaContainer",i)},e.imageUri?ue.createElement(Fn,{className:l("stepImage",i),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ue.createElement(Bt,{appearance:i,videoUri:e.videoUri}):null):null,ue.createElement(Bn,{className:l("stepSubtitle",i),appearance:i,dangerouslySetInnerHTML:ce(e.subtitle)}),ue.createElement(Co,{className:l("checklistCTAContainer",i)},e.secondaryButtonTitle?ue.createElement(oe,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:i}):null,ue.createElement(oe,{title:e.primaryButtonTitle??"Continue",onClick:()=>n(),appearance:i})))}function a(){if(!s)return null;let f=s[e.type];return f?f(e,i):null}return ue.createElement(wn,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",i),appearance:i},ue.createElement(kn,{className:l("stepHeader",i)},ue.createElement(En,null,ue.createElement(ko,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(x=i==null?void 0:i.theme)==null?void 0:x.colorPrimary,appearance:i}),ue.createElement(Pn,{appearance:i,className:l("stepTitle",i),dangerouslySetInnerHTML:ce(e.title)})),ue.createElement(vn,{className:l("stepChevronContainer",i),onClick:()=>o()},ue.createElement(Ot,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=i==null?void 0:i.theme)==null?void 0:c.colorTextSecondary}))),ue.createElement(Ap,null,!t&&ue.createElement(Ip.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??d())))};import Dt from"styled-components";var Mx=Dt.div`
1066
1066
  background: #ffffff;
1067
1067
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
1068
1068
  border-radius: 6px;
@@ -1102,7 +1102,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1102
1102
  justify-content: space-between;
1103
1103
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1104
1104
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1105
- `;var Lp=({title:e,subtitle:t,steps:o,onClose:n,visible:r,autoExpandFirstIncompleteStep:i=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,primaryColor:d="#000000",selectedStep:a,setSelectedStep:x,appearance:c,type:f,className:C,customStepTypes:k})=>{let B=o.filter(S=>S.complete).length,[u,y]=Np(Array(o.length).fill(!0));$n(()=>{let S=[...u];if(i){for(let m=0;m<o.length;m++)if(!o[m].complete){S[m]=!1;break}y(S)}},[]),$n(()=>{E(a)},[a]);let E=S=>{let m=[...u];if(s)for(let h=0;h<u.length;++h)h!==S&&(m[h]=!0);m[S]=!m[S],y(m)};if(!r&&f=="modal")return we.createElement(we.Fragment,null);let P=we.createElement(we.Fragment,null,we.createElement(In,null,we.createElement(Nn,{appearance:c,className:l("checklistTitle",c),dangerouslySetInnerHTML:me(e)}),we.createElement(Ln,{appearance:c,className:l("checklistSubtitle",c),dangerouslySetInnerHTML:me(t)})),we.createElement(ze,{display:"percent",count:B,total:o.length,fillColor:d,style:{margin:"14px 0px 8px 0px"},appearance:c})),T=we.createElement(On,{className:Ce(l("checklistContainer",c),C)},o.map((S,m)=>{let h=u[m];return we.createElement(An,{appearance:c,stepData:S,collapsed:h,key:`modal-checklist-${S.id??m}`,onClick:()=>{if(a===m){E(m);return}x(m)},onPrimaryButtonClick:()=>{S.handlePrimaryButtonClick&&S.handlePrimaryButtonClick(),p&&!S.completionCriteria&&m<u.length-1&&u[m+1]&&x(m+1)},onSecondaryButtonClick:()=>{S.handleSecondaryButtonClick&&S.handleSecondaryButtonClick()},customStepTypes:k})}));return f==="inline"?we.createElement(Dn,{appearance:c,className:Ce(l("checklistInlineContainer",c),C)},P,T):we.createElement(we.Fragment,null,we.createElement(ot,{onClose:n,visible:r,appearance:c,style:{maxWidth:"600px"},headerContent:P},T))},pr=Lp;import ne,{useEffect as dr,useRef as _p,useState as yt}from"react";import $t from"react";import pe,{css as Mn,keyframes as Un}from"styled-components";var _n=Mn`
1105
+ `;var Lp=({title:e,subtitle:t,steps:o,onClose:n,visible:r,autoExpandFirstIncompleteStep:i=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,primaryColor:d="#000000",selectedStep:a,setSelectedStep:x,appearance:c,type:f,className:C,customStepTypes:k})=>{let E=o.filter(S=>S.complete).length,[u,b]=Np(Array(o.length).fill(!0));$n(()=>{let S=[...u];if(i){for(let m=0;m<o.length;m++)if(!o[m].complete){S[m]=!1;break}b(S)}},[]),$n(()=>{v(a)},[a]);let v=S=>{let m=[...u];if(s)for(let h=0;h<u.length;++h)h!==S&&(m[h]=!0);m[S]=!m[S],b(m)};if(!r&&f=="modal")return we.createElement(we.Fragment,null);let P=we.createElement(we.Fragment,null,we.createElement(In,null,we.createElement(Nn,{appearance:c,className:l("checklistTitle",c),dangerouslySetInnerHTML:ce(e)}),we.createElement(Ln,{appearance:c,className:l("checklistSubtitle",c),dangerouslySetInnerHTML:ce(t)})),we.createElement(ze,{display:"percent",count:E,total:o.length,fillColor:d,style:{margin:"14px 0px 8px 0px"},appearance:c})),T=we.createElement(On,{className:Ce(l("checklistContainer",c),C)},o.map((S,m)=>{let h=u[m];return we.createElement(An,{appearance:c,stepData:S,collapsed:h,key:`modal-checklist-${S.id??m}`,onClick:()=>{if(a===m){v(m);return}x(m)},onPrimaryButtonClick:()=>{S.handlePrimaryButtonClick&&S.handlePrimaryButtonClick(),p&&!S.completionCriteria&&m<u.length-1&&u[m+1]&&x(m+1)},onSecondaryButtonClick:()=>{S.handleSecondaryButtonClick&&S.handleSecondaryButtonClick()},customStepTypes:k})}));return f==="inline"?we.createElement(Dn,{appearance:c,className:Ce(l("checklistInlineContainer",c),C)},P,T):we.createElement(we.Fragment,null,we.createElement(ot,{onClose:n,visible:r,appearance:c,style:{maxWidth:"600px"},headerContent:P},T))},pr=Lp;import le,{useEffect as dr,useRef as _p,useState as yt}from"react";import $t from"react";import pe,{css as Mn,keyframes as Un}from"styled-components";var _n=Mn`
1106
1106
  border: 1px solid ${({theme:e})=>e.colorBorder};
1107
1107
  `,Op=Mn`
1108
1108
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
@@ -1240,7 +1240,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1240
1240
  color: ${({theme:e})=>e.colorTextSecondary};
1241
1241
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1242
1242
  `}
1243
- `;var es=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=Q(),{primaryCTAClickSideEffects:r}=ie();o=n(o);let{imageUri:i=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:a=!1}=e,x=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{r(e)};return $t.createElement(Gn,{className:l("carouselCard",o),onClick:a?null:c,style:t,blocked:a,complete:d},i&&$t.createElement(qn,{className:l("carouselCardImage",o),src:i,alt:p,style:{opacity:d||a?.4:1}}),(d||!0)&&$t.createElement(Xn,{className:l("carouselCompletedPill",o)},$t.createElement(Rn,{style:{color:"#108E0B"}},"Complete")),p&&$t.createElement(Zn,{blocked:a,complete:d,className:l("carouselCardTitle",o)},p),s&&$t.createElement(We.Quiet,{blocked:a,complete:d,className:l("carouselCardSubtitle",o)},s))};import to from"react";var ts=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let n=t>0?e/t:0,r=200,i=Math.min(r,Math.max(10,Math.round(r*n)));return to.createElement(Yn,{className:l("carouselProgressBar",o)},to.createElement(Jn,{as:We.Loud,style:{marginRight:8}},e," of ",t),to.createElement("svg",{height:10,width:r},to.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),to.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"currentColor"})))};var zp=()=>ne.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ne.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ne.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ne.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),os=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,r]=yt(!1),[i,s]=yt(!1);dr(()=>{t===!0&&n===!1?r(!0):t===!1&&n===!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 n?ne.createElement(Hn,{style:d,reversed:i,onAnimationEnd:i?p:null},ne.createElement(Vn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ne.createElement(zp,null))):null},rs=({flowId:e,appearance:t,customVariables:o,className:n})=>{let r=_p(null),[i,s]=yt(!1),[p,d]=yt(!1),[a,x]=yt(null),[c,f]=yt([]),[C,k]=yt(0),{getFlowMetadata:B,getFlowSteps:u,getNumberOfStepsCompleted:y,updateCustomVariables:E,getFlowStatus:P,isLoading:T,targetingLogicShouldHideFlow:S,getFlow:m}=J();dr(()=>{E(o)},[o,T]),dr(()=>{if(T)return;let A=B(e),z=y(e),M=u(e);x(A),A.data!==null&&(f(M.sort((O,se)=>Number(O.complete)-Number(se.complete))),d(M.length>3),k(z))},[T]);let h=[];for(let A=0;A<c.length;A+=3)h.push(c.slice(A,A+3));let w=A=>{let z=A.target,M=z.scrollWidth-z.clientWidth,O=Math.ceil(z.scrollLeft);O>0&&i===!1&&s(!0),O===0&&i===!0&&s(!1),O<M&&p===!1&&d(!0),O===M&&p===!0&&d(!1)},I=(A=!0)=>{let z=A?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*z,behavior:"smooth"})},W=null,V=A=>{W!==null?clearTimeout(W):w(A),W=setTimeout(()=>{w(A)},16)};return T?null:ne.createElement(Kn,{className:Ce(l("carouselContainer",t),n)},ne.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},ne.createElement("div",null,ne.createElement(Qn,{className:l("carouselTitle",t)},a==null?void 0:a.title),ne.createElement(We.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),ne.createElement(ts,{numberOfStepsCompleted:C,numberOfSteps:c.length})),ne.createElement("div",{style:{position:"relative"}},ne.createElement(os,{show:i,onClick:()=>I(!1)}),ne.createElement(os,{side:"right",show:p,onClick:I}),ne.createElement(zn,{ref:r,onScroll:V},h.map((A,z)=>ne.createElement(Wn,{key:z,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},A.map((M,O)=>ne.createElement(es,{key:O,stepData:M,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))),ne.createElement(oe,{appearance:t}))};var cr=({flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:r,className:i,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:x,onButtonClick:c,appearance:f,hideOnFlowCompletion:C,setVisible:k,customStepTypes:B,checklistStyle:u="default",autoExpandFirstIncompleteStep:y,autoExpandNextStep:E,...P})=>{let{getFlow:T,getFlowSteps:S,markStepCompleted:m,getStepStatus:h,getNumberOfStepsCompleted:w,isLoading:I,targetingLogicShouldHideFlow:W,updateCustomVariables:V,getFlowMetadata:A,isStepBlocked:z,getFlowStatus:M,hasActiveFullPageFlow:O,setHasActiveFullPageFlow:se}=J(),{primaryCTAClickSideEffects:ce,secondaryCTAClickSideEffects:$}=ie(),{getOpenFlowState:xe,setOpenFlowState:Te}=ke(),[R,G]=ns(r||0),[ge,le]=ns(!1),ee=d===void 0?xe(e):d,L=s==="modal",{mergeAppearanceWithDefault:re}=Q(),{isLarge:_}=bn();if(f=re(f),is(()=>{V(a)},[a,I]),is(()=>{d!==void 0&&(L&&d===!0?se(!0):L&&d===!1&&se(!1))},[d,k,O]),I)return null;let ae=T(e);if(!ae||W(ae))return null;let K=S(e);if(!K||C===!0&&M(e)===Y)return null;let X=A(e);if(X!=null&&X.title&&(t=X.title),X!=null&&X.subtitle&&(o=X.subtitle),!ge&&r===void 0&&w(e)>0){let N=K.findIndex(Be=>Be.complete===!1);G(N>-1?N:K.length-1),le(!0)}function $e(){if(R+1>=K.length){L&&Te(e,!1);return}z(e,K[R+1].id)||G(R+1)}function je(N,Be,no){let Cr=R+1<K.length?K[R+1]:null;c&&c(N,R,Be,Cr)===!0&&L&&Ge(),x&&x(N,no,Cr),!x&&!c&&(N.primaryButtonUri||N.secondaryButtonUri)&&L&&Ge()}function dt(){return K.map((N,Be)=>({...N,handleSecondaryButtonClick:()=>{$e(),$(N),N.skippable===!0&&m(e,N.id,{skipped:!0}),je(N,"secondary",Be)},handlePrimaryButtonClick:()=>{(!N.completionCriteria&&(N.autoMarkCompleted||N.autoMarkCompleted===void 0)||N.completionCriteria&&N.autoMarkCompleted===!0)&&(m(e,N.id),$e()),je(N,"primary",Be),ce(N),h(e,N.id)===Le&&$e()}}))}function j(){return de.createElement(oe,{appearance:f})}let Fe={steps:dt(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:B,type:s,className:i,autoExpandFirstIncompleteStep:y,autoExpandNextStep:E};function Ge(){Te(e,!1),p&&p(),k&&k(!1)}function g(){return de.createElement(de.Fragment,null,de.createElement(j,null),de.createElement(rs,{flowId:e,appearance:f,customVariables:a,className:i}))}function b(){return de.createElement(de.Fragment,null,de.createElement(j,null),de.createElement(pr,{visible:ee,onClose:()=>{Ge()},selectedStep:R,setSelectedStep:G,autoExpandNextStep:!0,appearance:f,...Fe}))}function v(){if(!_)return b();let N=P.guideFlowId,Be;return N&&T(N)&&(Be=S(N)),de.createElement(de.Fragment,null,de.createElement(j,null),de.createElement(ar,{visible:ee,stepsTitle:X.stepsTitle?X.stepsTitle:"Your quick start guide",onClose:()=>{Ge()},selectedStep:R,setSelectedStep:G,guideData:Be,guideTitle:P.guideTitle??"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:no=>{je(no,"link",0)},customStepTypes:B,...Fe}))}function H(){if(!_)return b();let N=de.createElement(sr,{flowId:e,style:n,selectedStep:R,setSelectedStep:G,appearance:f,type:s,...Fe});return L?de.createElement(ot,{onClose:()=>{Ge()},visible:ee,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},de.createElement(j,null),N):de.createElement(de.Fragment,null,de.createElement(j,null),N)}switch(u){case"condensed":return b();case"with-guide":return v();case"default":return H();case"carousel":return g();default:return H()}};var Hp=e=>Wp.createElement(cr,{type:"inline",...e});import pt,{useEffect as jp}from"react";import He from"react";import Io from"styled-components";var ss=Io.div`
1243
+ `;var es=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=R(),{primaryCTAClickSideEffects:r}=se();o=n(o);let{imageUri:i=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:a=!1}=e,x=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{r(e)};return $t.createElement(Gn,{className:l("carouselCard",o),onClick:a?null:c,style:t,blocked:a,complete:d},i&&$t.createElement(qn,{className:l("carouselCardImage",o),src:i,alt:p,style:{opacity:d||a?.4:1}}),(d||!0)&&$t.createElement(Xn,{className:l("carouselCompletedPill",o)},$t.createElement(Rn,{style:{color:"#108E0B"}},"Complete")),p&&$t.createElement(Zn,{blocked:a,complete:d,className:l("carouselCardTitle",o)},p),s&&$t.createElement(We.Quiet,{blocked:a,complete:d,className:l("carouselCardSubtitle",o)},s))};import to from"react";var ts=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let n=t>0?e/t:0,r=200,i=Math.min(r,Math.max(10,Math.round(r*n)));return to.createElement(Yn,{className:l("carouselProgressBar",o)},to.createElement(Jn,{as:We.Loud,style:{marginRight:8}},e," of ",t),to.createElement("svg",{height:10,width:r},to.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),to.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"currentColor"})))};var zp=()=>le.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},le.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),os=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,r]=yt(!1),[i,s]=yt(!1);dr(()=>{t===!0&&n===!1?r(!0):t===!1&&n===!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 n?le.createElement(Hn,{style:d,reversed:i,onAnimationEnd:i?p:null},le.createElement(Vn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(zp,null))):null},rs=({flowId:e,appearance:t,customVariables:o,className:n})=>{let r=_p(null),[i,s]=yt(!1),[p,d]=yt(!1),[a,x]=yt(null),[c,f]=yt([]),[C,k]=yt(0),{getFlowMetadata:E,getFlowSteps:u,getNumberOfStepsCompleted:b,updateCustomVariables:v,getFlowStatus:P,isLoading:T,targetingLogicShouldHideFlow:S,getFlow:m}=X();dr(()=>{v(o)},[o,T]),dr(()=>{if(T)return;let A=E(e),_=b(e),j=u(e);x(A),A.data!==null&&(f(j.sort((I,ie)=>Number(I.complete)-Number(ie.complete))),d(j.length>3),k(_))},[T]);let h=[];for(let A=0;A<c.length;A+=3)h.push(c.slice(A,A+3));let w=A=>{let _=A.target,j=_.scrollWidth-_.clientWidth,I=Math.ceil(_.scrollLeft);I>0&&i===!1&&s(!0),I===0&&i===!0&&s(!1),I<j&&p===!1&&d(!0),I===j&&p===!0&&d(!1)},N=(A=!0)=>{let _=A?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*_,behavior:"smooth"})},U=null,W=A=>{U!==null?clearTimeout(U):w(A),U=setTimeout(()=>{w(A)},16)};return T?null:le.createElement(Kn,{className:Ce(l("carouselContainer",t),n)},le.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},le.createElement("div",null,le.createElement(Qn,{className:l("carouselTitle",t)},a==null?void 0:a.title),le.createElement(We.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),le.createElement(ts,{numberOfStepsCompleted:C,numberOfSteps:c.length})),le.createElement("div",{style:{position:"relative"}},le.createElement(os,{show:i,onClick:()=>N(!1)}),le.createElement(os,{side:"right",show:p,onClick:N}),le.createElement(zn,{ref:r,onScroll:W},h.map((A,_)=>le.createElement(Wn,{key:_,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},A.map((j,I)=>le.createElement(es,{key:I,stepData:j,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))),le.createElement(re,{appearance:t}))};var cr=({flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:r,className:i,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:x,onButtonClick:c,appearance:f,hideOnFlowCompletion:C,setVisible:k,customStepTypes:E,checklistStyle:u="default",autoExpandFirstIncompleteStep:b,autoExpandNextStep:v,...P})=>{let{getFlow:T,getFlowSteps:S,markStepCompleted:m,getStepStatus:h,getNumberOfStepsCompleted:w,isLoading:N,targetingLogicShouldHideFlow:U,updateCustomVariables:W,getFlowMetadata:A,isStepBlocked:_,getFlowStatus:j,hasActiveFullPageFlow:I,setHasActiveFullPageFlow:ie}=X(),{primaryCTAClickSideEffects:fe,secondaryCTAClickSideEffects:H}=se(),{getOpenFlowState:Y,setOpenFlowState:ve}=Fe(),[te,q]=ns(r||0),[he,ae]=ns(!1),Q=d===void 0?Y(e):d,ge=s==="modal",{mergeAppearanceWithDefault:M}=R(),{isLarge:O}=bn();if(f=M(f),is(()=>{W(a)},[a,N]),is(()=>{d!==void 0&&(ge&&d===!0?ie(!0):ge&&d===!1&&ie(!1))},[d,k,I]),N)return null;let ne=T(e);if(!ne||U(ne))return null;let G=S(e);if(!G||C===!0&&j(e)===J)return null;let Z=A(e);if(Z!=null&&Z.title&&(t=Z.title),Z!=null&&Z.subtitle&&(o=Z.subtitle),!he&&r===void 0&&w(e)>0){let L=G.findIndex(Be=>Be.complete===!1);q(L>-1?L:G.length-1),ae(!0)}function $e(){if(te+1>=G.length){ge&&ve(e,!1);return}_(e,G[te+1].id)||q(te+1)}function je(L,Be,no){let Cr=te+1<G.length?G[te+1]:null;c&&c(L,te,Be,Cr)===!0&&ge&&Ge(),x&&x(L,no,Cr),!x&&!c&&(L.primaryButtonUri||L.secondaryButtonUri)&&ge&&Ge()}function dt(){return G.map((L,Be)=>({...L,handleSecondaryButtonClick:()=>{$e(),H(L),L.skippable===!0&&m(e,L.id,{skipped:!0}),je(L,"secondary",Be)},handlePrimaryButtonClick:()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&(m(e,L.id),$e()),je(L,"primary",Be),fe(L),h(e,L.id)===Le&&$e()}}))}function V(){return de.createElement(re,{appearance:f})}let Te={steps:dt(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:E,type:s,className:i,autoExpandFirstIncompleteStep:b,autoExpandNextStep:v};function Ge(){ve(e,!1),p&&p(),k&&k(!1)}function g(){return de.createElement(de.Fragment,null,de.createElement(V,null),de.createElement(rs,{flowId:e,appearance:f,customVariables:a,className:i}))}function y(){return de.createElement(de.Fragment,null,de.createElement(V,null),de.createElement(pr,{visible:Q,onClose:()=>{Ge()},selectedStep:te,setSelectedStep:q,autoExpandNextStep:!0,appearance:f,...Te}))}function B(){if(!O)return y();let L=P.guideFlowId,Be;return L&&T(L)&&(Be=S(L)),de.createElement(de.Fragment,null,de.createElement(V,null),de.createElement(ar,{visible:Q,stepsTitle:Z.stepsTitle?Z.stepsTitle:"Your quick start guide",onClose:()=>{Ge()},selectedStep:te,setSelectedStep:q,guideData:Be,guideTitle:P.guideTitle??"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:no=>{je(no,"link",0)},customStepTypes:E,...Te}))}function z(){if(!O)return y();let L=de.createElement(sr,{flowId:e,style:n,selectedStep:te,setSelectedStep:q,appearance:f,type:s,...Te});return ge?de.createElement(ot,{onClose:()=>{Ge()},visible:Q,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},de.createElement(V,null),L):de.createElement(de.Fragment,null,de.createElement(V,null),L)}switch(u){case"condensed":return y();case"with-guide":return B();case"default":return z();case"carousel":return g();default:return z()}};var Hp=e=>Wp.createElement(cr,{type:"inline",...e});import pt,{useEffect as jp}from"react";import He from"react";import Io from"styled-components";var ss=Io.div`
1244
1244
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1245
1245
  border-radius: 8px;
1246
1246
  padding: 6px 10px 6px 10px;
@@ -1267,7 +1267,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1267
1267
  display: flex;
1268
1268
  height: 100%;
1269
1269
  align-items: center;
1270
- `;import{motion as Vp}from"framer-motion";var ds=({title:e,count:t,total:o,onClick:n,style:r={},className:i,appearance:s,type:p="default"})=>He.createElement(He.Fragment,null,He.createElement(oe,{appearance:s}),He.createElement(ss,{as:Vp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>n!==void 0&&n(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:Ce(i??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&He.createElement(ps,{className:l("progressRingContainer",s)},He.createElement(Pt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),He.createElement(ls,{type:p,className:l("badgeTitleContainer",s)},He.createElement(as,{type:p,appearance:s,className:l("badgeTitle",s)},e),n!==void 0&&He.createElement(Ot,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&He.createElement(ze,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import at from"react";import oo from"styled-components";var cs=oo.div`
1270
+ `;import{motion as Vp}from"framer-motion";var ds=({title:e,count:t,total:o,onClick:n,style:r={},className:i,appearance:s,type:p="default"})=>He.createElement(He.Fragment,null,He.createElement(re,{appearance:s}),He.createElement(ss,{as:Vp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>n!==void 0&&n(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:Ce(i??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&He.createElement(ps,{className:l("progressRingContainer",s)},He.createElement(Pt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),He.createElement(ls,{type:p,className:l("badgeTitleContainer",s)},He.createElement(as,{type:p,appearance:s,className:l("badgeTitle",s)},e),n!==void 0&&He.createElement(Ot,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&He.createElement(ze,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import at from"react";import oo from"styled-components";var cs=oo.div`
1271
1271
  display: flex;
1272
1272
  flex-direction: row;
1273
1273
  width: 100%;
@@ -1305,7 +1305,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1305
1305
  :hover {
1306
1306
  opacity: 0.8;
1307
1307
  }
1308
- `;var gs=({title:e,subtitle:t,icon:o,appearance:n,count:r,total:i,className:s,style:p})=>at.createElement(at.Fragment,null,at.createElement(cs,{appearance:n,className:Ce(l("fullWidthProgressBadgeContainer",n),s??""),style:p},o&&at.createElement(ms,{className:l("fullWidthProgressBadgeIcon",n)},o),at.createElement(us,null,at.createElement(Se,{size:"small",appearance:n,title:e,subtitle:t})),at.createElement(fs,{className:l("fullWidthProgressBadgeProgressContainer",n)},at.createElement(ze,{count:r,total:i,display:"percent",textLocation:"top",fillColor:n.theme.colorPrimary}))));var Gp=({flowId:e,title:t,subtitle:o,icon:n,style:r,onClick:i,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:x="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:C,getNumberOfStepsCompleted:k,isLoading:B,targetingLogicShouldHideFlow:u,updateCustomVariables:y}=J(),{mergeAppearanceWithDefault:E}=Q();a=E(a);let{setOpenFlowState:P,getOpenFlowState:T}=ke();if(jp(()=>{y(p)},[p,B]),B)return null;let S=c(e);if(!S||u(S)||d===!0&&C(e)===Y)return null;let m=f(e),h=k(e);return x==="full-width"?pt.createElement(pt.Fragment,null,pt.createElement(oe,{appearance:a}),pt.createElement(gs,{title:t,subtitle:o,count:h,total:m.length,style:r,className:s,appearance:a,icon:n,onClick:()=>{}})):pt.createElement(pt.Fragment,null,pt.createElement(oe,{appearance:a}),pt.createElement(ds,{count:h,total:m.length,title:t,style:r,onClick:()=>{P(e,!0),i&&i()},type:x,className:s,appearance:a}))};import qp from"react";var Kp=({flowId:e,style:t,appearance:o,...n})=>{let{getFlow:r,targetingLogicShouldHideFlow:i,getFlowSteps:s}=J(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let d=r(e);if(!d||i(d))return null;let a=s(e);return qp.createElement(eo,{steps:a,style:t,appearance:o,...n})};import Ut,{useContext as nd,useEffect as sd}from"react";import D,{useEffect as No,useLayoutEffect as Cs,useRef as Zp,useState as ro}from"react";import io from"styled-components";import{useCallback as Yp,useEffect as Jp,useState as Xp}from"react";var mr=(e,t,o,n={x:20,y:20},r)=>{let i=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+n.x+s,y:e.top-n.y+i}:t==="right"?{x:e.left+e.width+n.x+s,y:e.top-n.y+i}:{x:0,y:0}},hs={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Qp(e){let t=hs;return e&&(t=e.getBoundingClientRect()),t}function xs(e,t){let[o,n]=Xp(hs),r=Yp(()=>{e&&n(Qp(e))},[e]);return Jp(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}var Ss=300,ys=100,Rp=500,Mt=12,ed=io.div`
1308
+ `;var gs=({title:e,subtitle:t,icon:o,appearance:n,count:r,total:i,className:s,style:p})=>at.createElement(at.Fragment,null,at.createElement(cs,{appearance:n,className:Ce(l("fullWidthProgressBadgeContainer",n),s??""),style:p},o&&at.createElement(ms,{className:l("fullWidthProgressBadgeIcon",n)},o),at.createElement(us,null,at.createElement(Se,{size:"small",appearance:n,title:e,subtitle:t})),at.createElement(fs,{className:l("fullWidthProgressBadgeProgressContainer",n)},at.createElement(ze,{count:r,total:i,display:"percent",textLocation:"top",fillColor:n.theme.colorPrimary}))));var Gp=({flowId:e,title:t,subtitle:o,icon:n,style:r,onClick:i,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:x="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:C,getNumberOfStepsCompleted:k,isLoading:E,targetingLogicShouldHideFlow:u,updateCustomVariables:b}=X(),{mergeAppearanceWithDefault:v}=R();a=v(a);let{setOpenFlowState:P,getOpenFlowState:T}=Fe();if(jp(()=>{b(p)},[p,E]),E)return null;let S=c(e);if(!S||u(S)||d===!0&&C(e)===J)return null;let m=f(e),h=k(e);return x==="full-width"?pt.createElement(pt.Fragment,null,pt.createElement(re,{appearance:a}),pt.createElement(gs,{title:t,subtitle:o,count:h,total:m.length,style:r,className:s,appearance:a,icon:n,onClick:()=>{}})):pt.createElement(pt.Fragment,null,pt.createElement(re,{appearance:a}),pt.createElement(ds,{count:h,total:m.length,title:t,style:r,onClick:()=>{P(e,!0),i&&i()},type:x,className:s,appearance:a}))};import qp from"react";var Kp=({flowId:e,style:t,appearance:o,...n})=>{let{getFlow:r,targetingLogicShouldHideFlow:i,getFlowSteps:s}=X(),{mergeAppearanceWithDefault:p}=R();o=p(o);let d=r(e);if(!d||i(d))return null;let a=s(e);return qp.createElement(eo,{steps:a,style:t,appearance:o,...n})};import Ut,{useContext as nd,useEffect as sd}from"react";import D,{useEffect as No,useLayoutEffect as Cs,useRef as Zp,useState as ro}from"react";import io from"styled-components";import{useCallback as Yp,useEffect as Jp,useState as Xp}from"react";var mr=(e,t,o,n={x:20,y:20},r)=>{let i=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+n.x+s,y:e.top-n.y+i}:t==="right"?{x:e.left+e.width+n.x+s,y:e.top-n.y+i}:{x:0,y:0}},hs={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Qp(e){let t=hs;return e&&(t=e.getBoundingClientRect()),t}function xs(e,t){let[o,n]=Xp(hs),r=Yp(()=>{e&&n(Qp(e))},[e]);return Jp(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}var Ss=300,ys=100,Rp=500,Mt=12,ed=io.div`
1309
1309
  width: 100%;
1310
1310
  height: 100%;
1311
1311
  border-radius: 9999px;
@@ -1346,7 +1346,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1346
1346
  `,rd=io(bs)`
1347
1347
  width: ${Mt+12}px;
1348
1348
  height: ${Mt+12}px;
1349
- `,id=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:r=!0,primaryColor:i="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:x,appearance:c,dismissible:f=!1,showHighlightOnly:C,showStepCount:k=!0,completedStepsCount:B=0,showFrigadeBranding:u=!1})=>{var X,$e,je,dt;let[y,E]=ro(),[P,T]=ro(new Date),S=Zp(null),[m,h]=ro(document.querySelector(e[a].selector)),w=xs(m,P),[I,W]=ro(),[V,A]=ro(!C),z=($e=(X=e[a])==null?void 0:X.props)!=null&&$e.position?e[a].props.position:"absolute",M=((dt=(je=e[a])==null?void 0:je.props)==null?void 0:dt.zIndex)??90,O=(y==null?void 0:y.width)??Ss,se=(y==null?void 0:y.height)??ys;Cs(()=>{S.current&&E({width:S.current.clientWidth,height:S.current.clientHeight})},[a,P,z]),No(()=>{C||A(!0)},[a]);let ce=n==="auto"?"right":n,$=mr(w,ce,O,s,z),xe=w.right+O>(window.innerWidth||document.documentElement.clientWidth),Te=w.bottom+ys>(window.innerHeight||document.documentElement.clientHeight);xe&&n==="auto"&&($=mr(w,"left",O,s,z),ce="left");let R=window.location.pathname.split("/").pop(),G=()=>{let j=document.querySelector(e[a].selector);I&&I===JSON.stringify(j==null?void 0:j.getBoundingClientRect())||(h(j),T(new Date),j&&W(JSON.stringify(j.getBoundingClientRect())))};if(No(()=>{let j=new MutationObserver(G);return j.observe(document.body,{subtree:!0,childList:!0}),()=>j.disconnect()},[G]),No(()=>{let j=new MutationObserver(G);return j.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>j.disconnect()},[G]),No(()=>{let j=setInterval(()=>{G()},10);return()=>clearInterval(j)},[G]),Cs(()=>{setTimeout(()=>{G()},Rp),G()},[a,R]),m===null)return D.createElement(D.Fragment,null);if($.x==0&&$.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let ge=()=>{let j=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),A(!1),setTimeout(()=>{G()},30)),B===e.length-1)return o()},Fe=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),C&&!e[a].secondaryButtonUri&&A(!1))};return D.createElement(D.Fragment,null,k&&e.length>1&&D.createElement(Ir,null,D.createElement(Lr,{className:l("tooltipStepCounter",c)},a+1," of ",e.length)),D.createElement(Nr,{showStepCount:k,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&D.createElement(te,{title:e[a].secondaryButtonTitle,appearance:c,onClick:Fe,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&D.createElement(te,{title:e[a].primaryButtonTitle,appearance:c,onClick:j,withMargin:!1,size:"small"})))},le=()=>D.createElement(D.Fragment,null,f&&D.createElement(vr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",c)},D.createElement(Pe,null)),e[a].imageUri&&D.createElement(Br,{dismissible:f,appearance:c,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&D.createElement(Er,{dismissible:f,appearance:c,className:l("tooltipVideoContainer",c)},D.createElement(Bt,{appearance:c,videoUri:e[a].videoUri})),D.createElement(Se,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),D.createElement(Ar,{className:l("tooltipFooter",c)},D.createElement(ge,null))),L={...{default:j=>{var Fe;if((Fe=e[a])!=null&&Fe.StepContent){let Ge=e[a].StepContent;return D.createElement("div",null,Ge)}return D.createElement(le,null)}},...x},re=()=>{var j;return e?!((j=e[a])!=null&&j.type)||!L[e[a].type]?L.default(e[a]):L[e[a].type]({stepData:e[a],primaryColor:i}):D.createElement(D.Fragment,null)};if(C&&e[a].complete===!0)return null;let _={top:($==null?void 0:$.y)-Mt,left:(ce=="left"?w.x+s.x:($==null?void 0:$.x)-Mt)??0,cursor:C?"pointer":"default",position:z},ae=()=>{let Fe=_.left+(ce=="left"?-O:24);return Math.min(Math.max(Fe,20),window.innerWidth-O-20)},K=()=>{C&&(T(new Date),A(!V))};return D.createElement(od,null,D.createElement(rd,{style:_,zIndex:M,className:l("tourHighlightContainer",c)},r&&e[a].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(td,{style:{position:z},onClick:K,primaryColor:c.theme.colorPrimary,className:l("tourHighlightInnerCircle",c)}),D.createElement(ed,{style:{position:"absolute"},onClick:K,primaryColor:c.theme.colorPrimary,className:l("tourHighlightOuterCircle",c)}))),D.createElement(bs,{style:{..._,left:ae()},zIndex:M+1,className:l("tooltipContainerWrapper",c)},V&&D.createElement(D.Fragment,null,D.createElement(ao,{ref:S,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:Ss,zIndex:M+10},D.createElement(re,null)),u&&D.createElement(Dr,{className:l("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:M+10},D.createElement(po,{appearance:c})))))},Lo=id;import{Portal as ld}from"react-portal";var ad=({flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:r,showTooltipsSimultaneously:i=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:x="complete-flow",onComplete:c,...f})=>{let{getFlow:C,getFlowSteps:k,isLoading:B,targetingLogicShouldHideFlow:u,markStepCompleted:y,markStepStarted:E,markFlowCompleted:P,updateCustomVariables:T,getCurrentStepIndex:S,getStepStatus:m,isStepBlocked:h,getFlowStatus:w,getNumberOfStepsCompleted:I}=J(),{isLoadingUserFlowStateData:W}=Ae(),{primaryCTAClickSideEffects:V,secondaryCTAClickSideEffects:A}=ie(),{hasOpenModals:z}=ke(),M=S(e),{openFlowStates:O}=nd(q),{mergeAppearanceWithDefault:se}=Q();if(o=se(o),sd(()=>{T(t)},[t,B]),W)return null;let ce=C(e);if(!ce||u(ce)||w(e)==Y||z())return null;let $=k(e);if(Object.keys(O).length>0){let L=Object.keys(O).find(re=>O[re]===!0);if(L!==void 0&&L!==e)return Ut.createElement(Ut.Fragment,null)}async function xe(L){if(await y(e,L.id),$.map(re=>m(e,re.id)).every(re=>re===Le)){await P(e);return}if(!a&&M+1<$.length){if(h(e,$[M+1].id))return;await E(e,$[M+1].id)}}function Te(L,re,_){let ae=M+1<$.length?$[M+1]:null;r&&r(L,M,re,ae),n&&n(L,_,ae)}function R(){return $.map(L=>({...L,handleSecondaryButtonClick:async()=>{A(L),L.skippable===!0&&await y(e,L.id,{skipped:!0}),Te(L,"secondary",M)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await xe(L),Te(L,"primary",M),V(L)}}))}async function G(L){s&&s(),x==="complete-flow"?await P(e):await y(e,L.id)}function ge(){c&&c()}let le=!document.querySelector($[M].selector);function ee(){let L=$.findIndex(re=>!!document.querySelector(re.selector));return $.map((re,_)=>le&&!i&&_!==L?null:Ut.createElement(Lo,{key:re.id,appearance:o,steps:R(),selectedStep:_,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>G(re),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:I(e),onComplete:ge,...f}))}return Ut.createElement(ld,null,Ut.createElement(oe,{appearance:o}),i||le?ee():Ut.createElement(Lo,{appearance:o,steps:R(),selectedStep:M,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>G($[M]),tooltipPosition:d,completedStepsCount:I(e),showHighlightOnly:a,onComplete:ge,...f}))};import be,{useEffect as pd,useRef as dd,useState as cd}from"react";import{Portal as md}from"react-portal";import bt from"styled-components";var ws=bt.button`
1349
+ `,id=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:r=!0,primaryColor:i="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:x,appearance:c,dismissible:f=!1,showHighlightOnly:C,showStepCount:k=!0,completedStepsCount:E=0,showFrigadeBranding:u=!1})=>{var Z,$e,je,dt;let[b,v]=ro(),[P,T]=ro(new Date),S=Zp(null),[m,h]=ro(document.querySelector(e[a].selector)),w=xs(m,P),[N,U]=ro(),[W,A]=ro(!C),_=($e=(Z=e[a])==null?void 0:Z.props)!=null&&$e.position?e[a].props.position:"absolute",j=((dt=(je=e[a])==null?void 0:je.props)==null?void 0:dt.zIndex)??90,I=(b==null?void 0:b.width)??Ss,ie=(b==null?void 0:b.height)??ys;Cs(()=>{S.current&&v({width:S.current.clientWidth,height:S.current.clientHeight})},[a,P,_]),No(()=>{C||A(!0)},[a]);let fe=n==="auto"?"right":n,H=mr(w,fe,I,s,_),Y=w.right+I>(window.innerWidth||document.documentElement.clientWidth),ve=w.bottom+ys>(window.innerHeight||document.documentElement.clientHeight);Y&&n==="auto"&&(H=mr(w,"left",I,s,_),fe="left");let te=window.location.pathname.split("/").pop(),q=()=>{let V=document.querySelector(e[a].selector);N&&N===JSON.stringify(V==null?void 0:V.getBoundingClientRect())||(h(V),T(new Date),V&&U(JSON.stringify(V.getBoundingClientRect())))};if(No(()=>{let V=new MutationObserver(q);return V.observe(document.body,{subtree:!0,childList:!0}),()=>V.disconnect()},[q]),No(()=>{let V=new MutationObserver(q);return V.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>V.disconnect()},[q]),No(()=>{let V=setInterval(()=>{q()},10);return()=>clearInterval(V)},[q]),Cs(()=>{setTimeout(()=>{q()},Rp),q()},[a,te]),m===null)return D.createElement(D.Fragment,null);if(H.x==0&&H.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let he=()=>{let V=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),A(!1),setTimeout(()=>{q()},30)),E===e.length-1)return o()},Te=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),C&&!e[a].secondaryButtonUri&&A(!1))};return D.createElement(D.Fragment,null,k&&e.length>1&&D.createElement(Ir,null,D.createElement(Lr,{className:l("tooltipStepCounter",c)},a+1," of ",e.length)),D.createElement(Nr,{showStepCount:k,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&D.createElement(oe,{title:e[a].secondaryButtonTitle,appearance:c,onClick:Te,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&D.createElement(oe,{title:e[a].primaryButtonTitle,appearance:c,onClick:V,withMargin:!1,size:"small"})))},ae=()=>D.createElement(D.Fragment,null,f&&D.createElement(vr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",c)},D.createElement(ke,null)),e[a].imageUri&&D.createElement(Br,{dismissible:f,appearance:c,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&D.createElement(Er,{dismissible:f,appearance:c,className:l("tooltipVideoContainer",c)},D.createElement(Bt,{appearance:c,videoUri:e[a].videoUri})),D.createElement(Se,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),D.createElement(Ar,{className:l("tooltipFooter",c)},D.createElement(he,null))),ge={...{default:V=>{var Te;if((Te=e[a])!=null&&Te.StepContent){let Ge=e[a].StepContent;return D.createElement("div",null,Ge)}return D.createElement(ae,null)}},...x},M=()=>{var V;return e?!((V=e[a])!=null&&V.type)||!ge[e[a].type]?ge.default(e[a]):ge[e[a].type]({stepData:e[a],primaryColor:i}):D.createElement(D.Fragment,null)};if(C&&e[a].complete===!0)return null;let O={top:(H==null?void 0:H.y)-Mt,left:(fe=="left"?w.x+s.x:(H==null?void 0:H.x)-Mt)??0,cursor:C?"pointer":"default",position:_},ne=()=>{let Te=O.left+(fe=="left"?-I:24);return Math.min(Math.max(Te,20),window.innerWidth-I-20)},G=()=>{C&&(T(new Date),A(!W))};return D.createElement(od,null,D.createElement(rd,{style:O,zIndex:j,className:l("tourHighlightContainer",c)},r&&e[a].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(td,{style:{position:_},onClick:G,primaryColor:c.theme.colorPrimary,className:l("tourHighlightInnerCircle",c)}),D.createElement(ed,{style:{position:"absolute"},onClick:G,primaryColor:c.theme.colorPrimary,className:l("tourHighlightOuterCircle",c)}))),D.createElement(bs,{style:{...O,left:ne()},zIndex:j+1,className:l("tooltipContainerWrapper",c)},W&&D.createElement(D.Fragment,null,D.createElement(ao,{ref:S,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:Ss,zIndex:j+10},D.createElement(M,null)),u&&D.createElement(Dr,{className:l("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:j+10},D.createElement(po,{appearance:c})))))},Lo=id;import{Portal as ld}from"react-portal";var ad=({flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:r,showTooltipsSimultaneously:i=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:x="complete-flow",onComplete:c,skipIfNotFound:f=!1,...C})=>{let{getFlow:k,getFlowSteps:E,isLoading:u,targetingLogicShouldHideFlow:b,markStepCompleted:v,markStepStarted:P,markFlowCompleted:T,updateCustomVariables:S,getCurrentStepIndex:m,getStepStatus:h,isStepBlocked:w,getFlowStatus:N,getNumberOfStepsCompleted:U}=X(),{isLoadingUserFlowStateData:W}=Ae(),{primaryCTAClickSideEffects:A,secondaryCTAClickSideEffects:_}=se(),{hasOpenModals:j}=Fe(),I=m(e),{openFlowStates:ie}=nd(K),{mergeAppearanceWithDefault:fe}=R();if(o=fe(o),sd(()=>{S(t)},[t,u]),W)return null;let H=k(e);if(!H||b(H)||N(e)==J||j())return null;let Y=E(e);if(Object.keys(ie).length>0){let M=Object.keys(ie).find(O=>ie[O]===!0);if(M!==void 0&&M!==e)return Ut.createElement(Ut.Fragment,null)}async function ve(M){if(await v(e,M.id),Y.map(O=>h(e,O.id)).every(O=>O===Le)){await T(e);return}if(!a&&I+1<Y.length){if(w(e,Y[I+1].id))return;await P(e,Y[I+1].id)}}function te(M,O,ne){let G=I+1<Y.length?Y[I+1]:null;r&&r(M,I,O,G),n&&n(M,ne,G)}function q(){return Y.map(M=>({...M,handleSecondaryButtonClick:async()=>{_(M),M.skippable===!0&&await v(e,M.id,{skipped:!0}),te(M,"secondary",I)},handlePrimaryButtonClick:async()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&await ve(M),te(M,"primary",I),A(M)}}))}async function he(M){s&&s(),x==="complete-flow"?await T(e):await v(e,M.id)}function ae(){c&&c()}let Q=!document.querySelector(Y[I].selector);function ge(){let M=Y.findIndex(O=>!!document.querySelector(O.selector));return Y.map((O,ne)=>Q&&!i&&ne!==M&&f?null:Ut.createElement(Lo,{key:O.id,appearance:o,steps:q(),selectedStep:ne,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>he(O),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:U(e),onComplete:ae,...C}))}return Ut.createElement(ld,null,Ut.createElement(re,{appearance:o}),i||Q&&f?ge():Ut.createElement(Lo,{appearance:o,steps:q(),selectedStep:I,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>he(Y[I]),tooltipPosition:d,completedStepsCount:U(e),showHighlightOnly:a,onComplete:ae,...C}))};import be,{useEffect as pd,useRef as dd,useState as cd}from"react";import{Portal as md}from"react-portal";import bt from"styled-components";var ws=bt.button`
1350
1350
  ${e=>F(e)} {
1351
1351
  // Anything inside this block will be ignored if the user provides a custom class
1352
1352
 
@@ -1434,7 +1434,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1434
1434
  font-size: 14px;
1435
1435
 
1436
1436
  padding: 8px 12px;
1437
- `;import{AnimatePresence as Ls,motion as Os}from"framer-motion";import Es from"react";var As=({style:e,className:t})=>Es.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Es.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 Is from"react";var Ns=({style:e,className:t})=>Is.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"},Is.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 ud=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:r="inline",title:i="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:x,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C}=J(),{primaryCTAClickSideEffects:k}=ie(),B=dd(null),[u,y]=cd(!1),{mergeAppearanceWithDefault:E}=Q();s=E(s),pd(()=>(document.addEventListener("click",P,!1),()=>{document.removeEventListener("click",P,!1)}),[]);let P=w=>{B.current&&!B.current.contains(w.target)&&y(!1)};if(f)return null;let T=p(e);if(!T||C(T))return null;let S=d(e);if(!S||!n)return null;function m(w,I){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&a(e,w.id),k(w),o&&o(w,I),y(!1)}function h(){return u&&be.createElement(vs,{className:l("floatingWidgetMenu",s),as:Os.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},S.map((w,I)=>be.createElement(Bs,{className:l("floatingWidgetMenuItem",s),key:I,onClick:()=>m(w,I)},w.title)))}return r=="inline"?be.createElement("span",{ref:B},be.createElement(ws,{style:t,onClick:()=>{y(!u)},className:l("supportButton",s)},be.createElement(Fs,{className:l("supportIconContainer",s)},be.createElement(Ns,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),be.createElement(Ts,{className:l("supportButtonTitle",s)},i)),be.createElement(Ls,null,be.createElement(h,null))):be.createElement(md,null,be.createElement(ks,{style:t,ref:B},be.createElement(Ls,null,be.createElement(h,null)),be.createElement(Ps,{onClick:()=>{y(!u)},as:Os.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},be.createElement(As,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Ve,{useEffect as fd}from"react";import Oo from"styled-components";var Ds=Oo.div`
1437
+ `;import{AnimatePresence as Ls,motion as Os}from"framer-motion";import Es from"react";var As=({style:e,className:t})=>Es.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Es.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 Is from"react";var Ns=({style:e,className:t})=>Is.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"},Is.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 ud=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:r="inline",title:i="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:x,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C}=X(),{primaryCTAClickSideEffects:k}=se(),E=dd(null),[u,b]=cd(!1),{mergeAppearanceWithDefault:v}=R();s=v(s),pd(()=>(document.addEventListener("click",P,!1),()=>{document.removeEventListener("click",P,!1)}),[]);let P=w=>{E.current&&!E.current.contains(w.target)&&b(!1)};if(f)return null;let T=p(e);if(!T||C(T))return null;let S=d(e);if(!S||!n)return null;function m(w,N){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&a(e,w.id),k(w),o&&o(w,N),b(!1)}function h(){return u&&be.createElement(vs,{className:l("floatingWidgetMenu",s),as:Os.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},S.map((w,N)=>be.createElement(Bs,{className:l("floatingWidgetMenuItem",s),key:N,onClick:()=>m(w,N)},w.title)))}return r=="inline"?be.createElement("span",{ref:E},be.createElement(ws,{style:t,onClick:()=>{b(!u)},className:l("supportButton",s)},be.createElement(Fs,{className:l("supportIconContainer",s)},be.createElement(Ns,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),be.createElement(Ts,{className:l("supportButtonTitle",s)},i)),be.createElement(Ls,null,be.createElement(h,null))):be.createElement(md,null,be.createElement(ks,{style:t,ref:E},be.createElement(Ls,null,be.createElement(h,null)),be.createElement(Ps,{onClick:()=>{b(!u)},as:Os.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},be.createElement(As,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Ve,{useEffect as fd}from"react";import Oo from"styled-components";var Ds=Oo.div`
1438
1438
  ${e=>F(e)} {
1439
1439
  display: flex;
1440
1440
  flex-direction: column;
@@ -1470,7 +1470,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1470
1470
  opacity: 0.8;
1471
1471
  }
1472
1472
  }
1473
- `;var gd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:x,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowSteps:k,getFlowStatus:B,getCurrentStepIndex:u}=J(),{primaryCTAClickSideEffects:y}=ie(),{mergeAppearanceWithDefault:E}=Q();if(r=E(r),fd(()=>{C(o)},[o,c]),c)return null;let P=d(e);if(!P||f(P)||B(e)===Y)return null;let S=k(e)[u(e)];return Ve.createElement(Ve.Fragment,null,Ve.createElement(oe,{appearance:r}),Ve.createElement(Ds,{appearance:r,className:Ce(l("embeddedTipContainer",r),i),style:s},(p===!0||S.dismissible)&&Ve.createElement(Us,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},Ve.createElement(Pe,null)),Ve.createElement($s,null,Ve.createElement(Se,{size:"small",appearance:r,title:S.title,subtitle:S.subtitle})),S.primaryButtonTitle&&Ve.createElement(Ms,{className:l("embeddedTipCallToActionContainer",r)},Ve.createElement(te,{classPrefix:"embeddedTip",title:S.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{S.handlePrimaryButtonClick(),y(S),!(n&&n(S,u(e),"primary")===!1)&&(await x(e,S.id),await a(e))}}))))};import he,{useEffect as hd}from"react";import _t from"styled-components";var _s=_t.div`
1473
+ `;var gd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:x,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowSteps:k,getFlowStatus:E,getCurrentStepIndex:u}=X(),{primaryCTAClickSideEffects:b}=se(),{mergeAppearanceWithDefault:v}=R();if(r=v(r),fd(()=>{C(o)},[o,c]),c)return null;let P=d(e);if(!P||f(P)||E(e)===J)return null;let S=k(e)[u(e)];return Ve.createElement(Ve.Fragment,null,Ve.createElement(re,{appearance:r}),Ve.createElement(Ds,{appearance:r,className:Ce(l("embeddedTipContainer",r),i),style:s},(p===!0||S.dismissible)&&Ve.createElement(Us,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},Ve.createElement(ke,null)),Ve.createElement($s,null,Ve.createElement(Se,{size:"small",appearance:r,title:S.title,subtitle:S.subtitle})),S.primaryButtonTitle&&Ve.createElement(Ms,{className:l("embeddedTipCallToActionContainer",r)},Ve.createElement(oe,{classPrefix:"embeddedTip",title:S.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{S.handlePrimaryButtonClick(),b(S),!(n&&n(S,u(e),"primary")===!1)&&(await x(e,S.id),await a(e))}}))))};import xe,{useEffect as hd}from"react";import _t from"styled-components";var _s=_t.div`
1474
1474
  // use the :not annotation
1475
1475
  ${e=>F(e)} {
1476
1476
  display: flex;
@@ -1515,7 +1515,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1515
1515
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1516
1516
  align-items: flex-end;
1517
1517
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1518
- `;import Vs from"react";var js=({style:e,className:t})=>Vs.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"},Vs.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 xd=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:r,onButtonClick:i,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:a,markFlowCompleted:x,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowMetadata:k,getFlowStatus:B,getFlowSteps:u,getCurrentStepIndex:y}=J(),{primaryCTAClickSideEffects:E}=ie(),{mergeAppearanceWithDefault:P}=Q();if(s=P(s),hd(()=>{C(r)},[r,c]),c)return null;let T=a(e);if(!T||f(T)||B(e)===Y)return null;let S=u(e),m=S.length>0?S[y(e)]:k(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),he.createElement(he.Fragment,null,he.createElement(oe,{appearance:s}),he.createElement(_s,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&he.createElement(zs,{className:l("bannerIconContainer",s)},d||he.createElement(js,null)),p==="square"&&m.dismissible&&he.createElement(fr,{type:p,className:l("bannerDismissButtonContainer",s)},he.createElement(ur,{type:p,onClick:async()=>{await x(e),n&&n()},className:l("bannerDismissButton",s)},he.createElement(Pe,null))),he.createElement(Ws,{type:p},he.createElement(Se,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),he.createElement(Hs,{type:p,className:l("bannerCallToActionContainer",s)},he.createElement(te,{title:(m==null?void 0:m.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{E(m),i&&i(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&he.createElement(fr,{type:p,className:l("bannerDismissButtonContainer",s)},he.createElement(ur,{type:p,onClick:async()=>{await x(e),n&&n()},className:l("bannerDismissButton",s)},he.createElement(Pe,null)))))};import Z,{useEffect as Cd}from"react";import{Portal as Sd}from"react-portal";import et from"styled-components";var Gs=et.div`
1518
+ `;import Vs from"react";var js=({style:e,className:t})=>Vs.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"},Vs.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 xd=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:r,onButtonClick:i,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:a,markFlowCompleted:x,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowMetadata:k,getFlowStatus:E,getFlowSteps:u,getCurrentStepIndex:b}=X(),{primaryCTAClickSideEffects:v}=se(),{mergeAppearanceWithDefault:P}=R();if(s=P(s),hd(()=>{C(r)},[r,c]),c)return null;let T=a(e);if(!T||f(T)||E(e)===J)return null;let S=u(e),m=S.length>0?S[b(e)]:k(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),xe.createElement(xe.Fragment,null,xe.createElement(re,{appearance:s}),xe.createElement(_s,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&xe.createElement(zs,{className:l("bannerIconContainer",s)},d||xe.createElement(js,null)),p==="square"&&m.dismissible&&xe.createElement(fr,{type:p,className:l("bannerDismissButtonContainer",s)},xe.createElement(ur,{type:p,onClick:async()=>{await x(e),n&&n()},className:l("bannerDismissButton",s)},xe.createElement(ke,null))),xe.createElement(Ws,{type:p},xe.createElement(Se,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),xe.createElement(Hs,{type:p,className:l("bannerCallToActionContainer",s)},xe.createElement(oe,{title:(m==null?void 0:m.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{v(m),i&&i(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&xe.createElement(fr,{type:p,className:l("bannerDismissButtonContainer",s)},xe.createElement(ur,{type:p,onClick:async()=>{await x(e),n&&n()},className:l("bannerDismissButton",s)},xe.createElement(ke,null)))))};import ee,{useEffect as Cd}from"react";import{Portal as Sd}from"react-portal";import et from"styled-components";var Gs=et.div`
1519
1519
  ${e=>F(e)} {
1520
1520
  display: flex;
1521
1521
  flex-direction: column;
@@ -1602,5 +1602,5 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
1602
1602
  opacity: 0.8;
1603
1603
  }
1604
1604
  }
1605
- `;var yd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:a,getNumberOfStepsCompleted:x,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowSteps:k,getFlowStatus:B,getCurrentStepIndex:u}=J(),{primaryCTAClickSideEffects:y}=ie(),{mergeAppearanceWithDefault:E}=Q(),[P,T]=Z.useState(null),[S,m]=Z.useState(""),{hasOpenModals:h,setKeepCompletedFlowOpenDuringSession:w,shouldKeepCompletedFlowOpenDuringSession:I}=ke();if(r=E(r),Cd(()=>{C(o)},[o,c]),c)return null;let W=p(e);if(!W||f(W)||B(e)===Y||x(e)===1&&!I(e)||h())return null;let A=k(e)[u(e)];function z(){return Z.createElement(Z.Fragment,null,Z.createElement(xr,null,Z.createElement(Se,{size:"large",appearance:r,title:A.title,subtitle:A.subtitle})),Z.createElement(gr,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(O=>Z.createElement(qs,{className:l("npsNumberButton",r),selected:P===O+1,key:O,onClick:async()=>{w(e),T(O+1),await a(e,A.id,{score:O+1})},appearance:r},O+1))),Z.createElement(Ks,{appearance:r},Z.createElement(hr,{appearance:r},"Not likely at all"),Z.createElement(hr,{appearance:r},"Extremely likely")))}function M(){return Z.createElement(Z.Fragment,null,Z.createElement(xr,null,Z.createElement(Se,{appearance:r,title:"Why did you choose this score?",size:"large"})),Z.createElement(Ys,{appearance:r,value:S,onChange:O=>{m(O.target.value)},placeHolder:"Add your optional fedback here..."}),Z.createElement(gr,{appearance:r,className:l("npsNumberButtonContainer",r)},Z.createElement(te,{size:"large",withMargin:!1,onClick:async()=>{await d(e),n&&n(A,1,"primary")},appearance:r,title:A.secondaryButtonTitle||"Skip",secondary:!0}),Z.createElement(te,{size:"large",withMargin:!1,onClick:async()=>{await a(e,A.id,{feedbackText:S}),await d(e),n&&n(A,1,"primary")},appearance:r,title:A.primaryButtonTitle||"Submit"})))}return Z.createElement(Sd,null,Z.createElement(oe,{appearance:r}),Z.createElement(Gs,{appearance:r,className:Ce(l("npsSurveyContainer",r),i),style:s},Z.createElement(Js,{onClick:async()=>{await d(e),t&&t()},className:l("npsSurveyDismissButton",r)},Z.createElement(Pe,null)),x(e)==0&&z(),x(e)==1&&M()))};export{Ye as CheckBox,it as FormLabel,jo as FormTextField,xd as FrigadeBanner,cr as FrigadeChecklist,Ke as FrigadeDefaultAppearance,gd as FrigadeEmbeddedTip,Ti as FrigadeForm,Kp as FrigadeGuide,Hp as FrigadeHeroChecklist,yd as FrigadeNPSSurvey,Gp as FrigadeProgressBadge,ja as FrigadeProvider,ud as FrigadeSupportWidget,ad as FrigadeTour,Pt as ProgressRing,ke as useFlowOpens,Wt as useFlowResponses,J as useFlows,er as useOrganization,Ht as useUser};
1605
+ `;var yd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:a,getNumberOfStepsCompleted:x,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowSteps:k,getFlowStatus:E,getCurrentStepIndex:u}=X(),{primaryCTAClickSideEffects:b}=se(),{mergeAppearanceWithDefault:v}=R(),[P,T]=ee.useState(null),[S,m]=ee.useState(""),{hasOpenModals:h,setKeepCompletedFlowOpenDuringSession:w,shouldKeepCompletedFlowOpenDuringSession:N}=Fe();if(r=v(r),Cd(()=>{C(o)},[o,c]),c)return null;let U=p(e);if(!U||f(U)||E(e)===J||x(e)===1&&!N(e)||h())return null;let A=k(e)[u(e)];function _(){return ee.createElement(ee.Fragment,null,ee.createElement(xr,null,ee.createElement(Se,{size:"large",appearance:r,title:A.title,subtitle:A.subtitle})),ee.createElement(gr,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(I=>ee.createElement(qs,{className:l("npsNumberButton",r),selected:P===I+1,key:I,onClick:async()=>{w(e),T(I+1),await a(e,A.id,{score:I+1})},appearance:r},I+1))),ee.createElement(Ks,{appearance:r},ee.createElement(hr,{appearance:r},"Not likely at all"),ee.createElement(hr,{appearance:r},"Extremely likely")))}function j(){return ee.createElement(ee.Fragment,null,ee.createElement(xr,null,ee.createElement(Se,{appearance:r,title:"Why did you choose this score?",size:"large"})),ee.createElement(Ys,{appearance:r,value:S,onChange:I=>{m(I.target.value)},placeHolder:"Add your optional fedback here..."}),ee.createElement(gr,{appearance:r,className:l("npsNumberButtonContainer",r)},ee.createElement(oe,{size:"large",withMargin:!1,onClick:async()=>{await d(e),n&&n(A,1,"primary")},appearance:r,title:A.secondaryButtonTitle||"Skip",secondary:!0}),ee.createElement(oe,{size:"large",withMargin:!1,onClick:async()=>{await a(e,A.id,{feedbackText:S}),await d(e),n&&n(A,1,"primary")},appearance:r,title:A.primaryButtonTitle||"Submit"})))}return ee.createElement(Sd,null,ee.createElement(re,{appearance:r}),ee.createElement(Gs,{appearance:r,className:Ce(l("npsSurveyContainer",r),i),style:s},ee.createElement(Js,{onClick:async()=>{await d(e),t&&t()},className:l("npsSurveyDismissButton",r)},ee.createElement(ke,null)),x(e)==0&&_(),x(e)==1&&j()))};export{Ye as CheckBox,it as FormLabel,jo as FormTextField,xd as FrigadeBanner,cr as FrigadeChecklist,Ke as FrigadeDefaultAppearance,gd as FrigadeEmbeddedTip,Ti as FrigadeForm,Kp as FrigadeGuide,Hp as FrigadeHeroChecklist,yd as FrigadeNPSSurvey,Gp as FrigadeProgressBadge,ja as FrigadeProvider,ud as FrigadeSupportWidget,ad as FrigadeTour,Pt as ProgressRing,Fe as useFlowOpens,Wt as useFlowResponses,X as useFlows,er as useOrganization,Ht as useUser};
1606
1606
  //# sourceMappingURL=index.mjs.map