@frigade/react 1.35.21 → 1.35.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import{ThemeProvider as Yp}from"styled-components";import bt,{useContext as wp,useEffect as Do,useState as br}from"react";import{useCallback as ht,useContext as ql,useEffect as Yl}from"react";import Yo,{useMemo as jr}from"react";var Hr="1.35.21 ";var Oe="NOT_STARTED_STEP",X="COMPLETED_FLOW",ho="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",Co="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(G);return{config:jr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Hr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:jr(()=>`${o}/v1/public/`,[o])}}var Dl="frigade-last-call-at-",$l="frigade-last-call-data-";function Ot(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(G);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Nt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Nt();let r=Dl+o,n=$l+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Nt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return Nt(p)}return s?s.ok?s:Nt(s.statusText):Nt()}}function Nt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Lt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(G);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Vl,useState as Vr}from"react";import{useContext as Ul,useEffect as zl,useState as Wl}from"react";import _l from"swr";import{useContext as Ml}from"react";function be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Ml(G);function n(d,x=!1){return e[d]??x}function s(d,x){t(F=>({...F,[d]:x}))}function p(d){t(x=>{let{[d]:F,...y}=x;return{...y}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,F])=>F&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Hl from"swr/immutable";var jl="unknown";function Ee(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Ul(G),{resetOpenFlowState:c}=be(),[l,g]=Wl(!1),d={data:n.map(w=>({flowId:w.id,flowState:X,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=w=>fetch(w,e).then(E=>{if(E.ok)return E.json();throw new Error("Failed to fetch user flow states")}).catch(E=>(console.log(`Error fetching ${w}: ${E}. Will gracefully degrade and hide Frigade`),s(!0),d)),F=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:y,isLoading:S,mutate:f,error:B}=p?Hl(F,x):_l(F,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),T=y==null?void 0:y.data;zl(()=>{!l&&!S&&T&&g(!0)},[T,l,S]);async function h(w){if(T&&!p){let E=T.find(O=>O.flowId===w);E&&E.flowState!==X&&(E.flowState=X),await f(Promise.resolve({...y,data:T}),{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}async function A(w,E,O){if(T){let N=T.find(I=>I.flowId===w);N&&(N.stepStates[E]=O,N.flowState=xt),await f(Promise.resolve({...y,data:T}),{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}async function b(w,E,O){if(T){let N=T.find(I=>I.flowId===w);N&&(N.lastStepId=E,N.stepStates[E]=O,N.flowState=xt),await f({...y,data:T},{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}async function m(w){if(T){let E=T.find(O=>O.flowId===w);E&&E.flowState!==Me&&(E.flowState=Me,E.lastStepId=jl,Object.keys(E.stepStates).forEach(O=>{E.stepStates[O].actionType=Oe,E.stepStates[O].createdAt=new Date().toISOString()}),await f({...y,data:T},{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1}),c(w))}}async function P(w,E){if(T){let O=T.find(N=>N.flowId===w);O&&O.stepStates[E]!==Oe&&(O.stepStates[E]=Oe),await f({...y,data:T},{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:b,error:B}}function Jt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Ee(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Vl(G),[c,l]=Vr(new Set),[g,d]=Vr(new Set),x=Ot();function F(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),l(c),g.add(f),d(g);let T=s==null?void 0:s.find(h=>h.flowSlug===f.flowSlug&&h.stepId===f.stepId&&h.actionType===f.actionType&&h.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(h=>{h.status!==200&&h.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):T||p(A=>[...A??[],f])})}async function y(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await F(f):f.actionType===X?await F(f):f.actionType===Co?await F(f):f.actionType===Ue?await F(f):f.actionType===ho?await F(f):f.actionType===Oe&&await F(f))}function S(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let T in B.stepStates){let h=B.stepStates[T];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:h.stepId,actionType:h.actionType,data:{},createdAt:new Date(h.createdAt),blocked:h.blocked,hidden:h.hidden})}}),[...f,...s]}return{addResponse:y,setFlowResponses:p,getFlowResponses:S}}import Xl from"swr";var Gl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Gr=e=>{let t=Gl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Kl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Kl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Xo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Jo=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Jo||{});function J(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=ql(G),F={data:[]},{verifySDKInitiated:y}=Lt(),{addResponse:S,getFlowResponses:f}=Jt(),B=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),F)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),F)),{mutateUserFlowState:T,userFlowStatesData:h,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:b,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:E}=Ee(),{data:O,error:N,isLoading:I}=Xl(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});Yl(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function $(u){if(I)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!A&&!I?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function D(u){var _;if(!$(u))return[];let C=$(u).data;return C?(C=K(C),(((_=Xo(C))==null?void 0:_.data)??[]).map(ce=>{let Y=ne(ce);return{handleSecondaryButtonClick:()=>{ce.skippable===!0&&V(u,ce.id,{skipped:!0})},...ce,complete:Fe(u,ce.id)===Ue||Y>=1,blocked:te(u,ce.id),hidden:L(u,ce.id),handlePrimaryButtonClick:()=>{(!ce.completionCriteria&&(ce.autoMarkCompleted||ce.autoMarkCompleted===void 0)||ce.completionCriteria&&ce.autoMarkCompleted===!0)&&V(u,ce.id)},progress:Y}}).filter(ce=>ce.hidden!==!0)):[]}function K(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(_){return"&#"+_.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 z(u){if(!$(u))return[];let C=$(u).data;return C?(C=K(C),JSON.parse(C)??{}):[]}function q(u,C){p(v=>({...v,[u]:C}))}function ue(u){!A&&!I&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{q(C,u[C])})}let fe=ht(async(u,C,v)=>{if(!y())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Co,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await E(u,C,_),S(_))},[r,h]),W=ht(async(u,C,v)=>{if(!y())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await w(u,C),S(_))},[r,h]),V=ht(async(u,C,v)=>{if(!y())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await P(u,C,_),S(_))},[r,h]),re=ht(async(u,C)=>{if(!y()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),Q(v)&&S(v)},[r,h]),Ne=ht(async(u,C)=>{if(!y())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(v)&&S(v)},[r,h]),Be=ht(async(u,C)=>{if(!y())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:X,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(v)&&(await b(u),S(v))},[r,h]),xe=ht(async(u,C)=>{if(!y())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:ho,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(v)&&(await b(u),S(v))},[r,h]);function Q(u){var C;if(!h&&u.actionType===Oe)return!1;if(h){let v=h.find(_=>_.flowId===u.flowSlug);if(u.actionType===Oe&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Oe)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===X&&u.actionType===X)return!1}return!0}function Fe(u,C){let v=M(u,C);return A?null:v?v.actionType:Oe}function te(u,C){let v=M(u,C);return v?v.blocked:!1}function L(u,C){let v=M(u,C);return v?v.hidden:!1}function M(u,C){if(A)return null;let v=h==null?void 0:h.find(_=>_.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function j(u){var v;if(A||!h)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=h.find(_=>_.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(_=>_.id===C):null}function ae(u){let C=j(u);if(!C)return 0;let v=D(u).findIndex(_=>_.id===C.id)??0;return Fe(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function ne(u){if(!u.completionCriteria)return;let C=Gr(u.completionCriteria);if(C===null)return;let v=Ye(C),_=$e(C);return _===0?void 0:v/_}function pe(u){let C=h==null?void 0:h.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(_=>Fe(u,_.id)===Ue).length}function $e(u){return D(u).length}function At(u){let C=o.find(v=>v.slug===u);return C?Xo(C.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&h){let C=h.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function It(u){return!ft($(u))}function gt(){r&&T()}return{getFlow:$,getFlowData:At,isLoading:A||I,getStepStatus:Fe,getFlowSteps:D,getCurrentStepIndex:ae,markStepStarted:fe,markStepCompleted:V,markFlowNotStarted:re,markFlowStarted:Ne,markFlowCompleted:Be,markFlowAborted:xe,markStepNotStarted:W,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:$e,targetingLogicShouldHideFlow:ft,setCustomVariable:q,updateCustomVariables:ue,customVariables:s,getStepOptionalProgress:ne,getFlowMetadata:z,isStepBlocked:te,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:It,refresh:gt}}import{useCallback as Qo,useContext as Jl,useEffect as Ql}from"react";var Dt="guest_";function Qt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Jl(G),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Ee(),c=Ot(),{verifySDKInitiated:l}=Lt();function g(y){return`frigade-user-registered-${y}`}Ql(()=>{if(e&&!t){if(e.startsWith(Dt))return;let y=g(e);localStorage.getItem(y)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(y,"true"))}},[e,r,t]);let d=Qo(async y=>{if(!l())return;let S={foreignId:e,properties:y};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(f=>({...f,...y})),p()},[e,n,r,p]),x=Qo(async(y,S)=>{if(!l())return;let B={foreignId:e,events:[{event:y,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),F=Qo(async(y,S)=>{if(l())if(S){let f=g(y);localStorage.setItem(f,"true"),o(y);let B={foreignId:y,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(T=>({...T,...S})),p()}else o(y)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:F,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as Tp}from"uuid";import Ge,{useEffect as Cp,useState as yp}from"react";import ze,{useEffect as or,useState as sa}from"react";import bo from"styled-components";import Zl from"react";import Rl from"styled-components";var Kr="fr-",Zt="cfr-";function a(e,t){let o=`${Kr}${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+" "+Zt+e}return o}function k(e){if(!e.className||e.className.indexOf(Zt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Kr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Zo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Zo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function he(...e){return e.filter(Boolean).join(" ")}function Rt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ea=Rl.div`
2
+ import bt,{createContext as Yp,useEffect as Uo,useState as De}from"react";import{ThemeProvider as Xp}from"styled-components";import St,{useContext as Tp,useEffect as $o,useState as wr}from"react";import{useCallback as ht,useContext as Yl,useEffect as Xl}from"react";import Xo,{useMemo as Gr}from"react";var Vr="1.35.23 ";var Le="NOT_STARTED_STEP",X="COMPLETED_FLOW",Co="ABORTED_FLOW",xt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",ze="COMPLETED_STEP",yo="STARTED_STEP";function He(){let{publicApiKey:e,userId:t,apiUrl:o}=Xo.useContext(K);return{config:Gr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Vr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Gr(()=>`${o}/v1/public/`,[o])}}var $l="frigade-last-call-at-",Ml="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Xo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=$l+o,n=Ml+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Xo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Gl,useState as Kr}from"react";import{useContext as zl,useEffect as Wl,useState as _l}from"react";import Hl from"swr";import{useContext as Ul}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Ul(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(F=>({...F,[d]:x}))}function p(d){t(x=>{let{[d]:F,...S}=x;return{...S}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,F])=>F&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import jl from"swr/immutable";var Vl="unknown";function Ae(){let{config:e,apiUrl:t}=He(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=zl(K),{resetOpenFlowState:c}=ke(),[l,g]=_l(!1),d={data:n.map(w=>({flowId:w.id,flowState:X,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=w=>fetch(w,e).then(E=>{if(E.ok)return E.json();throw new Error("Failed to fetch user flow states")}).catch(E=>(console.log(`Error fetching ${w}: ${E}. Will gracefully degrade and hide Frigade`),s(!0),d)),F=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:S,isLoading:b,mutate:f,error:B}=p?jl(F,x):Hl(F,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),T=S==null?void 0:S.data;Wl(()=>{!l&&!b&&T&&g(!0)},[T,l,b]);async function h(w){if(T&&!p){let E=T.find(O=>O.flowId===w);E&&E.flowState!==X&&(E.flowState=X),await f(Promise.resolve({...S,data:T}),{optimisticData:{...S,data:T},revalidate:!1,rollbackOnError:!1})}}async function I(w,E,O){if(T){let N=T.find(A=>A.flowId===w);N&&(N.stepStates[E]=O,N.flowState=xt),await f(Promise.resolve({...S,data:T}),{optimisticData:{...S,data:T},revalidate:!1,rollbackOnError:!1})}}async function y(w,E,O){if(T){let N=T.find(A=>A.flowId===w);N&&(N.lastStepId=E,N.stepStates[E]=O,N.flowState=xt),await f({...S,data:T},{optimisticData:{...S,data:T},revalidate:!1,rollbackOnError:!1})}}async function m(w){if(T){let E=T.find(O=>O.flowId===w);E&&E.flowState!==Ue&&(E.flowState=Ue,E.lastStepId=Vl,Object.keys(E.stepStates).forEach(O=>{E.stepStates[O].actionType=Le,E.stepStates[O].createdAt=new Date().toISOString()}),await f({...S,data:T},{optimisticData:{...S,data:T},revalidate:!1,rollbackOnError:!1}),c(w))}}async function P(w,E){if(T){let O=T.find(N=>N.flowId===w);O&&O.stepStates[E]!==Le&&(O.stepStates[E]=Le),await f({...S,data:T},{optimisticData:{...S,data:T},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:y,error:B}}function Zt(){let{config:e,apiUrl:t}=He(),{userFlowStatesData:o,mutateUserFlowState:i}=Ae(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Gl(K),[c,l]=Kr(new Set),[g,d]=Kr(new Set),x=Nt();function F(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),l(c),g.add(f),d(g);let T=s==null?void 0:s.find(h=>h.flowSlug===f.flowSlug&&h.stepId===f.stepId&&h.actionType===f.actionType&&h.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(h=>{h.status!==200&&h.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):T||p(I=>[...I??[],f])})}async function S(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Ue?await F(f):f.actionType===X?await F(f):f.actionType===yo?await F(f):f.actionType===ze?await F(f):f.actionType===Co?await F(f):f.actionType===Le&&await F(f))}function b(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let T in B.stepStates){let h=B.stepStates[T];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:h.stepId,actionType:h.actionType,data:{},createdAt:new Date(h.createdAt),blocked:h.blocked,hidden:h.hidden})}}),[...f,...s]}return{addResponse:S,setFlowResponses:p,getFlowResponses:b}}import Jl from"swr";var Kl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,qr=e=>{let t=Kl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=ql(i,"'","");n.startsWith("flow_")&&(o=n)}),o},ql=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Jo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Qo=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Qo||{});function J(){let{config:e,apiUrl:t}=He(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Yl(K),F={data:[]},{verifySDKInitiated:S}=Ot(),{addResponse:b,getFlowResponses:f}=Zt(),B=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),F)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),F)),{mutateUserFlowState:T,userFlowStatesData:h,isLoadingUserFlowStateData:I,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:E}=Ae(),{data:O,error:N,isLoading:A}=Jl(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});Xl(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function D(u){if(A)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!I&&!A?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function $(u){var W;if(!D(u))return[];let C=D(u).data;return C?(C=j(C),(((W=Jo(C))==null?void 0:W.data)??[]).map(pe=>{let Qt=ye(pe);return{handleSecondaryButtonClick:()=>{pe.skippable===!0&&re(u,pe.id,{skipped:!0})},...pe,complete:me(u,pe.id)===ze||Qt>=1,blocked:Fe(u,pe.id),hidden:L(u,pe.id),handlePrimaryButtonClick:()=>{(!pe.completionCriteria&&(pe.autoMarkCompleted||pe.autoMarkCompleted===void 0)||pe.completionCriteria&&pe.autoMarkCompleted===!0)&&re(u,pe.id)},progress:Qt}}).filter(pe=>pe.hidden!==!0)):[]}function j(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.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 H(u){if(!D(u))return[];let C=D(u).data;return C?(C=j(C),JSON.parse(C)??{}):[]}function V(u,C){p(v=>({...v,[u]:C}))}function we(u){!I&&!A&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{V(C,u[C])})}let ce=ht(async(u,C,v)=>{if(!S())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:yo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};ee(W)&&(await E(u,C,W),b(W))},[r,h]),G=ht(async(u,C,v)=>{if(!S())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Le,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};ee(W)&&(await w(u,C),b(W))},[r,h]),re=ht(async(u,C,v)=>{if(!S())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:ze,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};ee(W)&&(await P(u,C,W),b(W))},[r,h]),Y=ht(async(u,C)=>{if(!S()||q(u)===Ue)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Ue,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),ee(v)&&b(v)},[r,h]),Te=ht(async(u,C)=>{if(!S())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};ee(v)&&b(v)},[r,h]),le=ht(async(u,C)=>{if(!S())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:X,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};ee(v)&&(await y(u),b(v))},[r,h]),he=ht(async(u,C)=>{if(!S())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Co,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};ee(v)&&(await y(u),b(v))},[r,h]);function ee(u){var C;if(!h&&u.actionType===Le)return!1;if(h){let v=h.find(W=>W.flowId===u.flowSlug);if(u.actionType===Le&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Le)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===X&&u.actionType===X)return!1}return!0}function me(u,C){let v=U(u,C);return I?null:v?v.actionType:Le}function Fe(u,C){let v=U(u,C);return v?v.blocked:!1}function L(u,C){let v=U(u,C);return v?v.hidden:!1}function U(u,C){if(I)return null;let v=h==null?void 0:h.find(W=>W.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function Ce(u){var v;if(I||!h)return null;if(q(u)===Ue)return $(u)[0]??null;let C=(v=h.find(W=>W.flowId===u))==null?void 0:v.lastStepId;return C?$(u).find(W=>W.id===C):null}function z(u){let C=Ce(u);if(!C)return 0;let v=$(u).findIndex(W=>W.id===C.id)??0;return me(u,C.id)===ze&&v<$(u).length-1?v+1:v}function ye(u){if(!u.completionCriteria)return;let C=qr(u.completionCriteria);if(C===null)return;let v=fe(C),W=Me(C);return W===0?void 0:v/W}function q(u){let C=h==null?void 0:h.find(v=>v.flowId===u);return C?C.flowState:null}function fe(u){let C=$(u);return C.length===0?0:C.filter(W=>me(u,W.id)===ze).length}function Me(u){return $(u).length}function Et(u){let C=o.find(v=>v.slug===u);return C?Jo(C.data):null}function ft(u){if(x)return!1;if(I)return!0;if(u!=null&&u.targetingLogic&&h){let C=h.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft(D(u))}function gt(){r&&T()}return{getFlow:D,getFlowData:Et,isLoading:I||A,getStepStatus:me,getFlowSteps:$,getCurrentStepIndex:z,markStepStarted:ce,markStepCompleted:re,markFlowNotStarted:Y,markFlowStarted:Te,markFlowCompleted:le,markFlowAborted:he,markStepNotStarted:G,getFlowStatus:q,getNumberOfStepsCompleted:fe,getNumberOfSteps:Me,targetingLogicShouldHideFlow:ft,setCustomVariable:V,updateCustomVariables:we,customVariables:s,getStepOptionalProgress:ye,getFlowMetadata:H,isStepBlocked:Fe,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Zo,useContext as Ql,useEffect as Zl}from"react";var Lt="guest_";function Rt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Ql(K),{config:n,apiUrl:s}=He(),{mutateUserFlowState:p}=Ae(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(S){return`frigade-user-registered-${S}`}Zl(()=>{if(e&&!t){if(e.startsWith(Lt))return;let S=g(e);localStorage.getItem(S)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(S,"true"))}},[e,r,t]);let d=Zo(async S=>{if(!l())return;let b={foreignId:e,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(b)}),i(f=>({...f,...S})),p()},[e,n,r,p]),x=Zo(async(S,b)=>{if(!l())return;let B={foreignId:e,events:[{event:S,properties:b}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),F=Zo(async(S,b)=>{if(l())if(b){let f=g(S);localStorage.setItem(f,"true"),o(S);let B={foreignId:S,properties:b};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(T=>({...T,...b})),p()}else o(S)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:F,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as Fp}from"uuid";import Ke,{useEffect as yp,useState as Sp}from"react";import We,{useEffect as rr,useState as la}from"react";import wo from"styled-components";import Rl from"react";import ea from"styled-components";var Yr="fr-",eo="cfr-";function a(e,t){let o=`${Yr}${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+" "+eo+e}return o}function k(e){if(!e.className||e.className.indexOf(eo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Yr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Ro(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Be(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Ro(t)}: ${e.styleOverrides[t]};`).join(" "):""}function ge(...e){return e.filter(Boolean).join(" ")}function to(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ta=ea.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -23,11 +23,11 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
23
23
  opacity: 1;
24
24
  }
25
25
  }
26
- `,qr=({onClose:e,appearance:t})=>Zl.createElement(ea,{className:a("modalBackground",t),onClick:()=>e()});import Ro from"react";import ta from"styled-components";var oa=ta.div`
26
+ `,Xr=({onClose:e,appearance:t})=>Rl.createElement(ta,{className:a("modalBackground",t),onClick:()=>e()});import er from"react";import oa from"styled-components";var ra=oa.div`
27
27
  :hover {
28
28
  opacity: 0.8;
29
29
  }
30
- `,we=()=>Ro.createElement(oa,null,Ro.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Ro.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as la}from"react-portal";import si from"react";import er from"react";function ra({style:e,className:t}){return er.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},er.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"}),er.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 Yr=ra;import tr from"styled-components";import Xe from"styled-components";var yo=Xe.div`
30
+ `,Pe=()=>er.createElement(ra,null,er.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},er.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as aa}from"react-portal";import ai from"react";import tr from"react";function ia({style:e,className:t}){return tr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},tr.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"}),tr.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 Jr=ia;import or from"styled-components";import Xe from"styled-components";var So=Xe.div`
31
31
  ${e=>k(e)} {
32
32
  background: ${e=>e.appearance.theme.colorBackground};
33
33
  }
@@ -38,7 +38,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
38
38
  min-width: 300px;
39
39
  z-index: ${e=>e.zIndex};
40
40
  overflow: hidden;
41
- `,ia=`
41
+ `,na=`
42
42
  display: block;
43
43
  cursor: pointer;
44
44
  position: absolute;
@@ -51,17 +51,17 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
51
51
  box-sizing: border-box;
52
52
  :hover {
53
53
  opacity: 0.8;
54
- }`,na=`
54
+ }`,sa=`
55
55
  display: block;
56
56
  cursor: pointer;
57
57
  position: absolute;
58
58
  top: 12px;
59
59
  right: 12px;
60
- `,Xr=Xe.div`
60
+ `,Qr=Xe.div`
61
61
  ${e=>k(e)} {
62
- ${e=>e.hasImage?ia:na};
62
+ ${e=>e.hasImage?na:sa};
63
63
  }
64
- `,Jr=Xe.img`
64
+ `,Zr=Xe.img`
65
65
  ${e=>k(e)} {
66
66
  display: block;
67
67
  width: 100%;
@@ -69,7 +69,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
69
69
  min-height: 200px;
70
70
  object-fit: cover;
71
71
  }
72
- `,Qr=Xe.div`
72
+ `,Rr=Xe.div`
73
73
  ${e=>k(e)} {
74
74
  display: block;
75
75
  width: 100%;
@@ -77,19 +77,19 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
77
77
  margin-top: ${e=>e.dismissible?"24px":"0px"};
78
78
  object-fit: cover;
79
79
  }
80
- `,Zr=Xe.div`
80
+ `,ei=Xe.div`
81
81
  display: flex;
82
82
  flex-direction: row;
83
83
  justify-content: space-between;
84
84
  align-content: center;
85
- `,Rr=Xe.div`
85
+ `,ti=Xe.div`
86
86
  padding: 22px 22px 12px;
87
- `,ei=Xe.div`
87
+ `,oi=Xe.div`
88
88
  display: flex;
89
89
  flex: 1;
90
90
  flex-direction: column;
91
91
  justify-content: center;
92
- `,ti=Xe.div`
92
+ `,ri=Xe.div`
93
93
  display: flex;
94
94
  flex: 2;
95
95
  flex-shrink: 1;
@@ -101,7 +101,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
101
101
  align-content: center;
102
102
  align-items: center;
103
103
  }
104
- `,oi=Xe.p`
104
+ `,ii=Xe.p`
105
105
  ${e=>k(e)} {
106
106
  font-style: normal;
107
107
  font-weight: 600;
@@ -110,7 +110,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
110
110
  color: #808080;
111
111
  }
112
112
  margin: 0;
113
- `;var ri=tr.div`
113
+ `;var ni=or.div`
114
114
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
115
115
  position: absolute;
116
116
  bottom: -47px;
@@ -121,7 +121,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
121
121
  align-items: center;
122
122
  justify-content: center;
123
123
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
124
- `,ii=tr(yo)`
124
+ `,si=or(So)`
125
125
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
126
126
  position: absolute;
127
127
  bottom: -60px;
@@ -134,7 +134,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
134
134
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
135
135
  padding: 0;
136
136
  z-index: ${e=>e.zIndex};
137
- `,ni=tr.div`
137
+ `,li=or.div`
138
138
  display: flex;
139
139
  justify-content: center;
140
140
  align-items: center;
@@ -143,7 +143,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
143
143
  font-size: 12px;
144
144
  line-height: 18px;
145
145
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
146
- `;function So({appearance:e}){return si.createElement(ni,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",si.createElement(Yr,null))}var aa=bo.div`
146
+ `;function bo({appearance:e}){return ai.createElement(li,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",ai.createElement(Jr,null))}var pa=wo.div`
147
147
  ${e=>k(e)} {
148
148
  // Anything inside this block will be ignored if the user provides a custom class
149
149
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -158,7 +158,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
158
158
  width: ${e=>e.width??"1000px"};
159
159
  z-index: 1500;
160
160
  border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)??8}}px;
161
- ${e=>ke(e)}
161
+ ${e=>Be(e)}
162
162
  }
163
163
 
164
164
  padding: 32px;
@@ -185,10 +185,10 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
185
185
  opacity: 1;
186
186
  }
187
187
  }
188
- `,pa=bo.div`
188
+ `,da=wo.div`
189
189
  position: relative;
190
190
  flex: 0 1 auto;
191
- `,da=bo.div`
191
+ `,ca=wo.div`
192
192
  position: absolute;
193
193
  top: 16px;
194
194
  right: 16px;
@@ -198,14 +198,14 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
198
198
  // Anything inside this block will be ignored if the user provides a custom class
199
199
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
200
200
  }
201
- `,ca=bo.div`
201
+ `,ma=wo.div`
202
202
  overflow: scroll;
203
203
  flex: 1 1;
204
204
  display: flex;
205
205
  ::-webkit-scrollbar {
206
206
  display: none;
207
207
  }
208
- `,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=sa("");return or(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),or(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),or(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?ze.createElement(la,null,ze.createElement(qr,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(aa,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&ze.createElement(da,{className:a("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(we,null)),o&&ze.createElement(pa,null,o),ze.createElement(ca,null,r),p&&ze.createElement(ri,{appearance:n,className:a("poweredByFrigadeRibbon",n)},ze.createElement(So,{appearance:n})))):ze.createElement(ze.Fragment,null)};import st,{useEffect as rr,useState as ma}from"react";import wo from"styled-components";import{Portal as ua}from"react-portal";function fa(e){switch(e){case"top-left":return`
208
+ `,je=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=la("");return rr(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),rr(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),rr(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?We.createElement(aa,null,We.createElement(Xr,{appearance:n,onClose:()=>{s&&e()}}),We.createElement(pa,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&We.createElement(ca,{className:a("modalClose",n),onClick:()=>e(),appearance:n},We.createElement(Pe,null)),o&&We.createElement(da,null,o),We.createElement(ma,null,r),p&&We.createElement(ni,{appearance:n,className:a("poweredByFrigadeRibbon",n)},We.createElement(bo,{appearance:n})))):We.createElement(We.Fragment,null)};import st,{useEffect as ir,useState as ua}from"react";import To from"styled-components";import{Portal as fa}from"react-portal";function ga(e){switch(e){case"top-left":return`
209
209
  top: 0;
210
210
  left: 0;
211
211
  `;case"top-right":return`
@@ -214,7 +214,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
214
214
  `;case"bottom-left":return`
215
215
  bottom: 0;
216
216
  left: 0;
217
- `}return"right: 0; bottom: 0;"}var ga=wo.div`
217
+ `}return"right: 0; bottom: 0;"}var xa=To.div`
218
218
  ${e=>k(e)} {
219
219
  // Anything inside this block will be ignored if the user provides a custom class
220
220
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -228,12 +228,12 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
228
228
  width: 350px;
229
229
  padding: 24px;
230
230
  }
231
- ${e=>fa(e.modalPosition)}
231
+ ${e=>ga(e.modalPosition)}
232
232
  margin: 28px;
233
- `,xa=wo.div`
233
+ `,ha=To.div`
234
234
  position: relative;
235
235
  flex: 1;
236
- `,ha=wo.div`
236
+ `,Ca=To.div`
237
237
  position: absolute;
238
238
  top: 16px;
239
239
  right: 16px;
@@ -243,13 +243,13 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
243
243
  // Anything inside this block will be ignored if the user provides a custom class
244
244
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
245
245
  }
246
- `,Ca=wo.div`
246
+ `,ya=To.div`
247
247
  overflow: scroll;
248
248
  flex: 5;
249
249
  ::-webkit-scrollbar {
250
250
  display: none;
251
251
  }
252
- `,To=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=ma("");return rr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),rr(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),rr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?st.createElement(ua,null,st.createElement(ga,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&st.createElement(ha,{className:a("cornerModalClose",r),onClick:()=>e()},st.createElement(we,null)),o&&st.createElement(xa,null,o),st.createElement(Ca,null,i))):st.createElement(st.Fragment,null)};import{useContext as ya}from"react";function Z(){let{defaultAppearance:e}=ya(G);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Ct,{useContext as _a,useEffect as Ha,useState as ur}from"react";import Bo from"styled-components";import Po,{useEffect as mi,useState as sr}from"react";import lr from"styled-components";import Fo from"styled-components";var li=Fo.label`
252
+ `,Fo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=ua("");return ir(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),ir(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),ir(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?st.createElement(fa,null,st.createElement(xa,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&st.createElement(Ca,{className:a("cornerModalClose",r),onClick:()=>e()},st.createElement(Pe,null)),o&&st.createElement(ha,null,o),st.createElement(ya,null,i))):st.createElement(st.Fragment,null)};import{useContext as Sa}from"react";function Q(){let{defaultAppearance:e}=Sa(K);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Ct,{useContext as Ha,useEffect as ja,useState as fr}from"react";import Eo from"styled-components";import vo,{useEffect as fi,useState as lr}from"react";import ar from"styled-components";import ko from"styled-components";var pi=ko.label`
253
253
  ${e=>k(e)} {
254
254
  font-size: 12px;
255
255
  line-height: 18px;
@@ -260,14 +260,14 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
260
260
  letter-spacing: 0.24px;
261
261
  }
262
262
  display: flex;
263
- `,ai=Fo.label`
263
+ `,di=ko.label`
264
264
  ${e=>k(e)} {
265
265
  font-size: 12px;
266
266
  line-height: 20px;
267
267
  margin-bottom: 5px;
268
268
  }
269
269
  display: flex;
270
- `,pi=Fo.span`
270
+ `,ci=ko.span`
271
271
  font-weight: 400;
272
272
  font-size: 14px;
273
273
  line-height: 22px;
@@ -275,16 +275,16 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
275
275
  display: flex;
276
276
  margin-right: 5px;
277
277
  margin-top: 10px;
278
- `,ko=Fo.div`
278
+ `,Po=ko.div`
279
279
  display: flex;
280
280
  align-items: flex-start;
281
281
  justify-content: left;
282
282
  margin-bottom: 10px;
283
- `;import ir from"react";var Je={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function lt({title:e,required:t,appearance:o=Je}){return e?ir.createElement(ko,{className:a("formLabelWrapper",o)},t?ir.createElement(pi,{className:a("formLabelRequired",o),appearance:o},"*"):null,ir.createElement(li,{className:a("formLabel",o)},e)):null}import di from"react";function $t({title:e,appearance:t}){return e?di.createElement(ko,null,di.createElement(ai,{className:a("formSubLabel",t)},e)):null}import{z as nr}from"zod";function ci(e,t){try{if(t){if(t.type=="number"){let o=nr.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=nr.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof nr.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var Sa=lr.div`
283
+ `;import nr from"react";var Je={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function lt({title:e,required:t,appearance:o=Je}){return e?nr.createElement(Po,{className:a("formLabelWrapper",o)},t?nr.createElement(ci,{className:a("formLabelRequired",o),appearance:o},"*"):null,nr.createElement(pi,{className:a("formLabel",o)},e)):null}import mi from"react";function Dt({title:e,appearance:t}){return e?mi.createElement(Po,null,mi.createElement(di,{className:a("formSubLabel",t)},e)):null}import{z as sr}from"zod";function ui(e,t){try{if(t){if(t.type=="number"){let o=sr.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=sr.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof sr.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var ba=ar.div`
284
284
  display: flex;
285
285
  flex-direction: column;
286
286
  width: 100%;
287
- `,ar=lr.input`
287
+ `,pr=ar.input`
288
288
  ${e=>k(e)} {
289
289
  // Anything inside this block will be ignored if the user provides a custom class
290
290
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -300,7 +300,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
300
300
  box-sizing: border-box;
301
301
  padding: 0 10px;
302
302
  margin-bottom: 10px;
303
- `,ba=lr.textarea`
303
+ `,wa=ar.textarea`
304
304
  ${e=>k(e)} {
305
305
  // Anything inside this block will be ignored if the user provides a custom class
306
306
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -316,13 +316,13 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
316
316
  min-height: 70px;
317
317
  box-sizing: border-box;
318
318
  margin-bottom: 10px;
319
- `;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=sr((r==null?void 0:r.text)||""),[c,l]=sr(!1),[g,d]=sr(!1),x=ar;mi(()=>{s===""&&!c&&(l(!0),F(""))},[]),mi(()=>{if(g){F(s);return}},[g]);function F(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`,hidden:!g}]);return}let f=ci(S,n.validation);if(f&&(S.trim()!==""||n.required===!0)){i([{id:n.id,message:f,hidden:!g}]);return}i([])}n.multiline&&(x=ba);function y(){var S;switch((S=n==null?void 0:n.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Po.createElement(Sa,null,Po.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),Po.createElement(x,{className:a("inputComponent",t.appearance),value:s,onChange:S=>{F(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:y(),onBlur:()=>{d(!0)}}),Po.createElement($t,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as ui,useState as fi}from"react";import gi from"styled-components";var dr="",wa=gi.div`
319
+ `;function dr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=lr((r==null?void 0:r.text)||""),[c,l]=lr(!1),[g,d]=lr(!1),x=pr;fi(()=>{s===""&&!c&&(l(!0),F(""))},[]),fi(()=>{if(g){F(s);return}},[g]);function F(b){if(p(b),o({text:b}),n.required===!0&&b.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`,hidden:!g}]);return}let f=ui(b,n.validation);if(f&&(b.trim()!==""||n.required===!0)){i([{id:n.id,message:f,hidden:!g}]);return}i([])}n.multiline&&(x=wa);function S(){var b;switch((b=n==null?void 0:n.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return vo.createElement(ba,null,vo.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),vo.createElement(x,{className:a("inputComponent",t.appearance),value:s,onChange:b=>{F(b.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:S(),onBlur:()=>{d(!0)}}),vo.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Ve,{useEffect as gi,useState as xi}from"react";import hi from"styled-components";var cr="",Ta=hi.div`
320
320
  display: flex;
321
321
  flex-direction: column;
322
322
  width: 100%;
323
323
  -webkit-appearance: none;
324
324
  appearance: none;
325
- `,Ta=gi.select`
325
+ `,Fa=hi.select`
326
326
  ${e=>k(e)} {
327
327
  // Anything inside this block will be ignored if the user provides a custom class
328
328
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -343,15 +343,15 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
343
343
  background-repeat: no-repeat;
344
344
  background-size: 1.5em 1.5em;
345
345
  -webkit-print-color-adjust: exact;
346
- `;function xi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,F,y,S;let n=e,[s,p]=fi(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=fi(!1);return ui(()=>{var f,B,T,h;if(s===""&&!c){if(l(!0),n.requireSelection){p(dr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(B=n.props.options)==null?void 0:B.find(b=>b.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((T=n.props.options)==null?void 0:T[0].id)||""),o({choice:[((h=n.props.options)==null?void 0:h[0].id)||""]})}},[]),ui(()=>{n.requireSelection&&s===dr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(wa,null,je.createElement(lt,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(Ta,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:dr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>je.createElement("option",{key:f.id,value:f.id},f.title))),((F=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:F.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(lt,{title:((S=(y=n.props.options)==null?void 0:y.find(f=>f.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(ar,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement($t,{title:n.subtitle,appearance:t.appearance}))}import oo,{useEffect as cr,useState as Ci}from"react";import yi from"styled-components";import to from"react";import eo from"react";var hi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return eo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},Fa=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>eo.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},eo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},eo.createElement(hi,{color:r,size:t}),eo.createElement(hi,{color:e,percentage:o,size:t})),i),Mt=Fa;import ka from"styled-components";var Pa=({color:e="#FFFFFF"})=>to.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},to.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),va={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Ba={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Ea={border:"1px solid #000000",color:"#FFFFFF"},Aa={border:"1px solid #C5CBD3"},Ia={color:"#FFFFFF"},Na={border:"1px solid #C5CBD3"},Oa=e=>e==="square"?va:Ba,La=(e,t)=>e==="square"?t?Ea:Aa:t?Ia:Na,Da=ka.div`
347
- ${e=>ke(e)}
348
- `,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Oa(t),c=La(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?to.createElement(Mt,{fillColor:o,percentage:i,size:22}):to.createElement(Da,{styleOverrides:p,style:n,role:"checkbox",className:he(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&to.createElement(Pa,{color:"#FFFFFF"}))};var $a=yi.div`
346
+ `;function Ci({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,F,S,b;let n=e,[s,p]=xi(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=xi(!1);return gi(()=>{var f,B,T,h;if(s===""&&!c){if(l(!0),n.requireSelection){p(cr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(I=>I.id===n.defaultValue))){let I=(B=n.props.options)==null?void 0:B.find(y=>y.id===n.defaultValue);p(I.id),o({choice:[I.id]})}else p(((T=n.props.options)==null?void 0:T[0].id)||""),o({choice:[((h=n.props.options)==null?void 0:h[0].id)||""]})}},[]),gi(()=>{n.requireSelection&&s===cr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),Ve.createElement(Ta,null,Ve.createElement(lt,{title:n.title,required:!1,appearance:t.appearance}),Ve.createElement(Fa,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&Ve.createElement("option",{key:"null-value",value:cr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>Ve.createElement("option",{key:f.id,value:f.id},f.title))),((F=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:F.isOpenEnded)&&Ve.createElement(Ve.Fragment,null,Ve.createElement(lt,{title:((b=(S=n.props.options)==null?void 0:S.find(f=>f.id===s))==null?void 0:b.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Ve.createElement(pr,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),Ve.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import io,{useEffect as mr,useState as Si}from"react";import bi from"styled-components";import ro from"react";import oo from"react";var yi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return oo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},ka=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>oo.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},oo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},oo.createElement(yi,{color:r,size:t}),oo.createElement(yi,{color:e,percentage:o,size:t})),i),$t=ka;import Pa from"styled-components";var va=({color:e="#FFFFFF"})=>ro.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ba={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Ea={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Aa={border:"1px solid #000000",color:"#FFFFFF"},Ia={border:"1px solid #C5CBD3"},Na={color:"#FFFFFF"},Oa={border:"1px solid #C5CBD3"},La=e=>e==="square"?Ba:Ea,Da=(e,t)=>e==="square"?t?Aa:Ia:t?Na:Oa,$a=Pa.div`
347
+ ${e=>Be(e)}
348
+ `,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=La(t),c=Da(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?ro.createElement($t,{fillColor:o,percentage:i,size:22}):ro.createElement($a,{styleOverrides:p,style:n,role:"checkbox",className:ge(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&ro.createElement(va,{color:"#FFFFFF"}))};var Ma=bi.div`
349
349
  display: flex;
350
350
  flex-direction: column;
351
351
  width: 100%;
352
352
  -webkit-appearance: none;
353
353
  appearance: none;
354
- `,Ma=yi.button`
354
+ `,Ua=bi.button`
355
355
  ${e=>k(e)} {
356
356
  // Anything inside this block will be ignored if the user provides a custom class
357
357
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -376,7 +376,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
376
376
  height: 48px;
377
377
  padding: 0 18px;
378
378
  margin-bottom: 10px;
379
- `;function Si({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=Ci((i==null?void 0:i.choice)||[]),[c,l]=Ci(!1);return cr(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),cr(()=>{o({choice:s})},[s]),cr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),oo.createElement($a,null,oo.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>oo.createElement(Ma,{appearance:t.appearance,className:a(s.includes(d.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,oo.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),oo.createElement($t,{title:n.subtitle,appearance:t.appearance}))}import vo from"react";import bi from"styled-components";import Ua from"dompurify";function se(e){return{__html:Ua.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var za=bi.h1`
379
+ `;function wi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=Si((i==null?void 0:i.choice)||[]),[c,l]=Si(!1);return mr(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),mr(()=>{o({choice:s})},[s]),mr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),io.createElement(Ma,null,io.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>io.createElement(Ua,{appearance:t.appearance,className:a(s.includes(d.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,io.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),io.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Bo from"react";import Ti from"styled-components";import za from"dompurify";function ne(e){return{__html:za.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Wa=Ti.h1`
380
380
  ${e=>k(e)} {
381
381
  font-style: normal;
382
382
  font-weight: 700;
@@ -388,7 +388,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
388
388
  margin-bottom: 4px;
389
389
  color: ${e=>e.appearance.theme.colorText};
390
390
  }
391
- `,Wa=bi.h2`
391
+ `,_a=Ti.h2`
392
392
  ${e=>k(e)} {
393
393
  font-style: normal;
394
394
  font-weight: 400;
@@ -397,42 +397,38 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
397
397
  letter-spacing: 0.28px;
398
398
  color: ${e=>e.appearance.theme.colorTextSecondary};
399
399
  }
400
- `;function Te({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return vo.createElement(vo.Fragment,null,vo.createElement(za,{appearance:e,className:a(`${r}${r?Rt(i):i}Title`,e),dangerouslySetInnerHTML:se(t),size:i}),o&&vo.createElement(Wa,{appearance:e,className:a(`${r}${r?Rt(i):i}Subtitle`,e),dangerouslySetInnerHTML:se(o),size:i}))}import*as mr from"react";var wi=e=>mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},mr.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"}));var ja=Bo.div`
400
+ `;function ve({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Bo.createElement(Bo.Fragment,null,Bo.createElement(Wa,{appearance:e,className:a(`${r}${r?to(i):i}Title`,e),dangerouslySetInnerHTML:ne(t),size:i}),o&&Bo.createElement(_a,{appearance:e,className:a(`${r}${r?to(i):i}Subtitle`,e),dangerouslySetInnerHTML:ne(o),size:i}))}import*as ur from"react";var Fi=e=>ur.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},ur.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"}));var Va=Eo.div`
401
401
  display: flex;
402
402
  flex-direction: column;
403
403
  justify-content: flex-end;
404
404
  overflow: visible;
405
405
  padding-top: 14px;
406
- `,Va=Bo.div`
406
+ `,Ga=Eo.div`
407
407
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
408
408
  font-size: 12px;
409
409
  margin-bottom: 12px;
410
410
  display: flex;
411
411
  align-items: center;
412
- `,Ga=Bo.div`
412
+ `,Ka=Eo.div`
413
413
  margin-right: 4px;
414
414
  display: inline-flex;
415
- `,Ka=Bo.div`
415
+ `,qa=Eo.div`
416
416
  padding-left: 1px;
417
417
  padding-right: 1px;
418
- `,qa={text:pr,multipleChoice:xi,multipleChoiceList:Si},fr="frigade-multiInputStepTypeData";function Ti({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var b;let c=t.props,[l,g]=ur([]),[d,x]=ur([]),{userId:F}=Qt(),[y,S]=ur(h()||(p?p[t.id]:null)||{}),{readonly:f}=_a(G),B={...qa,...s};Ha(()=>{i(l.length===0)},[l,i]);function T(m,P){let w={...y,[m.id]:P};S(w),r(w),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(w))}function h(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${fr}-${e}-${t.id}-${F}`}return Ct.createElement(Ka,{className:a("multiInput",n)},Ct.createElement(Te,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(ja,{className:a("multiInputContainer",n)},(b=c.data)==null?void 0:b.map(m=>{let P=l.reverse().find(w=>w.id===m.id);return B[m.type]?Ct.createElement("span",{key:m.id,"data-field-id":m.id,className:a("multiInputField",n)},B[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:w=>{!d.includes(m.id)&&w&&(w==null?void 0:w.text)!==""&&x(E=>[...E,m.id]),T(m,w)},inputData:y[m.id],setFormValidationErrors:w=>{g(E=>w.length===0?E.filter(O=>O.id!==m.id):[...E,...w])}}),P&&P.message&&d.includes(m.id)&&P.hidden!==!0&&Ct.createElement(Va,{key:m.id,style:{overflow:"hidden"},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(Ga,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(wi,null)),P.message)):null})))}import yt from"styled-components";var Fi=yt.div`
418
+ `,Ya={text:dr,multipleChoice:Ci,multipleChoiceList:wi},gr="frigade-multiInputStepTypeData";function ki({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var y;let c=t.props,[l,g]=fr([]),[d,x]=fr([]),{userId:F}=Rt(),[S,b]=fr(h()||(p?p[t.id]:null)||{}),{readonly:f}=Ha(K),B={...Ya,...s};ja(()=>{i(l.length===0)},[l,i]);function T(m,P){let w={...S,[m.id]:P};b(w),r(w),window&&window.localStorage&&!f&&window.localStorage.setItem(I(),JSON.stringify(w))}function h(){if(window&&window.localStorage){let m=window.localStorage.getItem(I());if(m)return JSON.parse(m)}return null}function I(){return`${gr}-${e}-${t.id}-${F}`}return Ct.createElement(qa,{className:a("multiInput",n)},Ct.createElement(ve,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(Va,{className:a("multiInputContainer",n)},(y=c.data)==null?void 0:y.map(m=>{let P=l.reverse().find(w=>w.id===m.id);return B[m.type]?Ct.createElement("span",{key:m.id,"data-field-id":m.id,className:a("multiInputField",n)},B[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:w=>{!d.includes(m.id)&&w&&(w==null?void 0:w.text)!==""&&x(E=>[...E,m.id]),T(m,w)},inputData:S[m.id],setFormValidationErrors:w=>{g(E=>w.length===0?E.filter(O=>O.id!==m.id):[...E,...w])}}),P&&P.message&&d.includes(m.id)&&P.hidden!==!0&&Ct.createElement(Ga,{key:m.id,style:{overflow:"hidden"},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(Ka,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(Fi,null)),P.message)):null})))}import Mt from"styled-components";var Pi=Mt.div`
419
419
  align-items: center;
420
420
  display: flex;
421
421
  justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
422
422
  padding-top: 14px;
423
- `,ki=yt.div`
423
+ `,vi=Mt.div`
424
424
  color: ${e=>e.appearance.theme.colorTextError};
425
425
  font-size: 12px;
426
- `,Pi=yt.div`
426
+ `,Bi=Mt.div`
427
427
  display: flex;
428
428
  gap: 12px;
429
429
  width: 100%;
430
430
  justify-content: flex-end;
431
- `,vi=yt.div`
432
- display: flex;
433
- flex-direction: row;
434
- flex: 1 1;
435
- `,Bi=yt.div`
431
+ `,Ei=Mt.div`
436
432
  display: flex;
437
433
  // If type is set to large-modal, use padding 60px horizontal, 80px vertical
438
434
  // Otherwise, use 4px padding
@@ -440,11 +436,11 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
440
436
  flex-grow: 1;
441
437
  flex-basis: 0;
442
438
  position: relative;
443
- `,Ei=yt.div`
439
+ `,Ai=Mt.div`
444
440
  padding: ${e=>e.type==="large-modal"?"50px":"0px"};
445
441
  position: relative;
446
442
  overflow-y: auto;
447
- `,Ai=yt.div`
443
+ `,Ii=Mt.div`
448
444
  display: flex;
449
445
  align-self: stretch;
450
446
  flex-grow: 1;
@@ -456,7 +452,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
456
452
  background-position: center;
457
453
  border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
458
454
  border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
459
- `;import at from"react";import Ya from"react";import Ii from"styled-components";var Xa=Ii.button`
455
+ `;import at from"react";import Xa from"react";import Ni from"styled-components";var Ja=Ni.button`
460
456
  justify-content: center;
461
457
  align-content: center;
462
458
  ${e=>k(e)} {
@@ -474,7 +470,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
474
470
  font-size: ${e=>e.size=="small"?"14px":"15px"};
475
471
  line-height: 20px;
476
472
  font-weight: 500;
477
- ${e=>ke(e)}
473
+ ${e=>Be(e)}
478
474
  }
479
475
 
480
476
  font-family: inherit;
@@ -487,7 +483,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
487
483
  opacity: 0.3;
488
484
  cursor: not-allowed;
489
485
  }
490
- `,Eo=Ii.div`
486
+ `,Ao=Ni.div`
491
487
  ${e=>k(e)} {
492
488
  display: flex;
493
489
  flex-direction: row;
@@ -498,14 +494,14 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
498
494
  margin-right: 8px;
499
495
  }
500
496
  }
501
- `,R=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Rt(d)}`}return Ya.createElement(Xa,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var Ni=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return at.createElement(at.Fragment,null,l!==null&&l!=null&&at.createElement(ki,{appearance:o,className:a("formCTAError",o)},l),at.createElement(Fi,{showBackButton:g,className:a("formCTAContainer",o)},g&&at.createElement(R,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),at.createElement(Pi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?at.createElement(R,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?at.createElement(R,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import gr from"react";import Ja from"styled-components";var Qa=Ja.div`
497
+ `,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${to(d)}`}return Xa.createElement(Ja,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var Oi=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return at.createElement(at.Fragment,null,l!==null&&l!=null&&at.createElement(vi,{appearance:o,className:a("formCTAError",o)},l),at.createElement(Pi,{showBackButton:g,className:a("formCTAContainer",o)},g&&at.createElement(Z,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),at.createElement(Bi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?at.createElement(Z,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?at.createElement(Z,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import xr from"react";import Qa from"styled-components";var Za=Qa.div`
502
498
  text-align: center;
503
- `,Oi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Z().mergeAppearanceWithDefault(i);return gr.createElement(Qa,{className:o},gr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>gr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import St from"react";import Ut from"styled-components";import{useContext as Za}from"react";function ie(){let e=Za(G);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Ra=Ut.div`
499
+ `,Li=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return xr.createElement(Za,{className:o},xr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>xr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import yt from"react";import Ut from"styled-components";import{useContext as Ra}from"react";function ie(){let e=Ra(K);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var ep=Ut.div`
504
500
  display: flex;
505
501
  flex-wrap: wrap;
506
502
  align-content: center;
507
503
  justify-content: center;
508
- `,ep=Ut.div`
504
+ `,tp=Ut.div`
509
505
  align-content: center;
510
506
  align-items: center;
511
507
  display: flex;
@@ -519,10 +515,10 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
519
515
  flex-basis: 255px;
520
516
  flex-grow: 0;
521
517
  flex-shrink: 0;
522
- `,tp=Ut.img`
518
+ `,op=Ut.img`
523
519
  width: 78px;
524
520
  height: auto;
525
- `,op=Ut.button`
521
+ `,rp=Ut.button`
526
522
  font-style: normal;
527
523
  font-weight: 600;
528
524
  font-size: 13px;
@@ -535,11 +531,11 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
535
531
  border-radius: 100px;
536
532
  padding: 8px 12px;
537
533
  margin-top: 16px;
538
- `,rp=Ut.h1`
534
+ `,ip=Ut.h1`
539
535
  font-weight: 700;
540
536
  font-size: 28px;
541
537
  line-height: 34px;
542
- `,ip=Ut.h2`
538
+ `,np=Ut.h2`
543
539
  font-style: normal;
544
540
  font-weight: 400;
545
541
  font-size: 16px;
@@ -548,7 +544,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
548
544
  margin-top: 12px;
549
545
  margin-bottom: 16px;
550
546
  max-width: 70%;
551
- `;function Li({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return St.createElement("div",null,St.createElement(rp,null,e.title),St.createElement(ip,null,e.subtitle),St.createElement(Ra,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>St.createElement(ep,{key:n.title},St.createElement(tp,{src:n.imageUri}),St.createElement(op,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import zt,{useEffect as cp}from"react";import No from"styled-components";import xr from"react";var Ao=({style:e,className:t})=>xr.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},xr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),xr.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 ro,{useRef as np,useState as sp}from"react";import Io from"styled-components";var lp=Io.div`
547
+ `;function Di({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return yt.createElement("div",null,yt.createElement(ip,null,e.title),yt.createElement(np,null,e.subtitle),yt.createElement(ep,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>yt.createElement(tp,{key:n.title},yt.createElement(op,{src:n.imageUri}),yt.createElement(rp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import zt,{useEffect as mp}from"react";import Oo from"styled-components";import hr from"react";var Io=({style:e,className:t})=>hr.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},hr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),hr.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 no,{useRef as sp,useState as lp}from"react";import No from"styled-components";var ap=No.div`
552
548
  display: flex;
553
549
  align-items: center;
554
550
  justify-content: flex-start;
@@ -556,7 +552,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
556
552
  width: 100%;
557
553
  height: 100%;
558
554
  position: relative;
559
- `,ap=Io.div`
555
+ `,pp=No.div`
560
556
  position: absolute;
561
557
  display: flex;
562
558
  align-items: center;
@@ -575,56 +571,56 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
575
571
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
576
572
  border-radius: 50%;
577
573
  }
578
- `,pp=Io.video`
574
+ `,dp=No.video`
579
575
  width: 100%;
580
576
  height: 100%;
581
577
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
582
- `,dp=Io.iframe`
578
+ `,cp=No.iframe`
583
579
  width: 100%;
584
580
  height: 100%;
585
581
  min-height: 260px;
586
582
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
587
- `;function Ve({appearance:e,videoUri:t}){let o=np(),[i,r]=sp(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),ro.createElement(dp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return ro.createElement(lp,{className:a("videoPlayerWrapper",e),appearance:e},!i&&ro.createElement(ap,{onClick:()=>{r(!0),o.current.play()},appearance:e},ro.createElement(Ao,null)),ro.createElement(pp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var mp=No.div`
583
+ `;function Ge({appearance:e,videoUri:t}){let o=sp(),[i,r]=lp(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),no.createElement(cp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return no.createElement(ap,{className:a("videoPlayerWrapper",e),appearance:e},!i&&no.createElement(pp,{onClick:()=>{r(!0),o.current.play()},appearance:e},no.createElement(Io,null)),no.createElement(dp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var up=Oo.div`
588
584
  ${e=>k(e)} {
589
585
  display: flex;
590
586
  flex-direction: column;
591
587
  justify-content: center;
592
588
  }
593
- `,up=No.img`
589
+ `,fp=Oo.img`
594
590
  ${e=>k(e)} {
595
591
  width: 100%;
596
592
  height: auto;
597
593
  max-height: 250px;
598
594
  margin-bottom: 24px;
599
595
  }
600
- `,fp=No.div`
596
+ `,gp=Oo.div`
601
597
  ${e=>k(e)} {
602
598
  margin-bottom: 24px;
603
599
  }
604
- `,gp=No.div`
600
+ `,xp=Oo.div`
605
601
  ${e=>k(e)} {
606
602
  width: 100%;
607
603
  height: auto;
608
604
  max-height: 250px;
609
605
  margin-bottom: 24px;
610
606
  }
611
- `;function Di({stepData:e,appearance:t,setCanContinue:o}){return cp(()=>{o(!0)},[]),zt.createElement(mp,{className:a("callToActionContainer",t)},zt.createElement(fp,{className:a("callToActionTextContainer",t)},zt.createElement(Te,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&zt.createElement(up,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&zt.createElement(gp,{appearance:t,className:a("callToActionVideo",t)},zt.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as hr,useState as Cr}from"react";import pt from"styled-components";var $i=pt.div`
607
+ `;function $i({stepData:e,appearance:t,setCanContinue:o}){return mp(()=>{o(!0)},[]),zt.createElement(up,{className:a("callToActionContainer",t)},zt.createElement(gp,{className:a("callToActionTextContainer",t)},zt.createElement(ve,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&zt.createElement(fp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&zt.createElement(xp,{appearance:t,className:a("callToActionVideo",t)},zt.createElement(Ge,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as Cr,useState as yr}from"react";import pt from"styled-components";var Mi=pt.div`
612
608
  width: auto;
613
609
  display: flex;
614
610
  flex-direction: column;
615
611
  justify-content: center;
616
612
  align-items: center;
617
613
  padding: 4px;
618
- `,Mi=pt.div`
614
+ `,Ui=pt.div`
619
615
  width: 100%;
620
616
  text-align: left;
621
- `,Ui=pt.h1`
617
+ `,zi=pt.h1`
622
618
  font-style: normal;
623
619
  font-weight: 700;
624
620
  font-size: 32px;
625
621
  line-height: 38px;
626
622
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
627
- `,zi=pt.h1`
623
+ `,Wi=pt.h1`
628
624
  font-style: normal;
629
625
  font-weight: 400;
630
626
  font-size: 16px;
@@ -632,7 +628,7 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
632
628
  margin-top: 16px;
633
629
  margin-bottom: 16px;
634
630
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
635
- `,Wi=pt.div`
631
+ `,_i=pt.div`
636
632
  padding-top: 12px;
637
633
  padding-bottom: 12px;
638
634
  flex-direction: row;
@@ -643,17 +639,17 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
643
639
  cursor: pointer;
644
640
  border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
645
641
  width: 100%;
646
- `,_i=pt.div`
642
+ `,Hi=pt.div`
647
643
  padding-top: 10px;
648
644
  padding-bottom: 10px;
649
645
  flex-direction: row;
650
646
  display: flex;
651
647
  justify-content: flex-start;
652
- `,Hi=pt.img`
648
+ `,ji=pt.img`
653
649
  width: 42px;
654
650
  height: 42px;
655
651
  margin-right: 12px;
656
- `,ji=pt.p`
652
+ `,Vi=pt.p`
657
653
  font-style: normal;
658
654
  font-weight: 500;
659
655
  font-size: 17px;
@@ -661,8 +657,8 @@ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import
661
657
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
662
658
  display: flex;
663
659
  align-self: center;
664
- `;var Vi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=Cr([]),[p,c]=Cr(!1),[l,g]=Cr(e.id);return hr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),hr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),hr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement($i,{className:a("selectListContainer",i)},Ze.createElement(Mi,null,Ze.createElement(Ui,{className:a("selectListTitle",i)},e.title),Ze.createElement(zi,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let F=n.includes(d.id);return Ze.createElement(Wi,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(y=>y!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:a("selectListSelectItem",i)},Ze.createElement(_i,{className:a("selectListItemImage",i)},d.imageUri&&Ze.createElement(Hi,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(ji,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:F,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as Oo,useState as io}from"react";var xp=({children:e,id:t,shouldWrap:o=!1})=>Pe.createElement(Pe.Fragment,null,o?Pe.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Lo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:l,onComplete:g,setVisible:d,setShowModal:x,onDismiss:F,showPagination:y=!1,customFormElements:S,allowBackNavigation:f,validationHandler:B,onFormDataChange:T,showFooter:h,prefillData:A})=>{var M;let m={...{linkCollection:Li,multiInput:Ti,callToAction:Di,selectList:Vi},...i},{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:w}=ie(),[E,O]=io(!1),[N,I]=io({}),[$,D]=io(!1),[K,z]=io(!1),[q,ue]=io(null),fe=t[o]??null,{markStepCompleted:W,markStepStarted:V,isLoading:re,updateCustomVariables:Ne,markFlowCompleted:Be}=J();Oo(()=>{Ne(r)},[r,re]),Oo(()=>{T&&T(N,xe(),t[o],o)},[N]),Oo(()=>{window&&f&&!K&&(window.location.hash=t[o].id,z(!0))},[f,K,z]),Oo(()=>{var j;if(window&&((j=window==null?void 0:window.location)!=null&&j.hash)&&window.location.hash.replace("#","")!==t[o].id){let ae=window.location.hash.replace("#",""),ne=t.findIndex(pe=>pe.id===ae);ne!==-1&&V(p,t[ne].id)}},[(M=window==null?void 0:window.location)==null?void 0:M.hash,V,o,t]);function xe(){return{data:N[t[o].id]??{},stepId:t[o].id,customVariables:r}}function Q(j,ae,ne){let pe=o+1<t.length?t[o+1]:null;return s&&s(j,ne,pe,N,xe()),n?n(j,o,ae,pe):!0}function Fe(j,ae){I(ne=>{let pe={};return pe[j.id]=ae,{...ne,...pe}})}function te(j){return j.selectedStep.imageUri?Pe.createElement(Ai,{image:j.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let L=h&&Pe.createElement(Ni,{step:t[o],canContinue:E&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),B){let ne=await B(t[o],o,t[o+1],N,xe());if(ne||ne===!1){ue(typeof ne=="string"?ne:null),D(!1);return}else ue(null)}let j={...xe()};await W(p,t[o].id,j),o+1<t.length&&await V(p,t[o+1].id);let ae=Q(t[o],"primary",o);o+1>=t.length&&(g&&g(),F&&F(),l&&ae&&(d&&d(!1),x(!1)),await Be(p)),P(t[o]),D(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{Q(t[o],"secondary",o),w(t[o])},onBack:async()=>{o-1>=0&&(D(!0),await V(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:q});return Pe.createElement(Pe.Fragment,null,Pe.createElement(vi,{className:a("formContainer",e)},Pe.createElement(Bi,null,Pe.createElement(xp,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(Ei,{key:fe.id,type:c,className:a("formContent",e)},t.map(j=>{let ae=m[j.type];return fe.id!==j.id?null:Pe.createElement(ae,{key:j.id,stepData:j,canContinue:E,setCanContinue:O,onSaveData:ne=>{Fe(j,ne)},appearance:e,customFormElements:S,flowId:p,prefillData:A})}),y&&Pe.createElement(Oi,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),L))),c=="large-modal"&&Pe.createElement(te,{selectedStep:t[o]})))};import no from"react";import{createGlobalStyle as hp}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return no.createElement(no.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return no.createElement(no.Fragment,null);let o=hp`
665
- ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map(([s,p])=>`${Zo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return no.createElement(o,{inlineStyles:t})}var Gi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:F=!1,modalPosition:y="center",repeatable:S=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:T=!1,validationHandler:h,showFrigadeBranding:A=!1,onFormDataChange:b,showFooter:m=!0,prefillData:P={}})=>{let{getFlow:w,getFlowSteps:E,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:I,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:K}=J(),z=$(e),{mergeAppearanceWithDefault:q}=Z(),[ue,fe]=yp(!1),{setOpenFlowState:W,getOpenFlowState:V,hasOpenModals:re}=be();c=q(c);let[Ne,Be]=i!==void 0&&r!==void 0?[i,r]:[V(e,!0),te=>W(e,te)];if(Cp(()=>{!ue&&!O&&(fe(!0),I(e)===X&&S&&(K(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(fr)&&window.localStorage.removeItem(L)})),fe(!0))},[ue,fe,O]),O)return null;let xe=w(e);if(!xe||N(xe))return null;let Q=E(e);if(!Q||i!==void 0&&i===!1||I(e)===X&&l||(o=="modal"||o=="corner-modal")&&re(e))return null;let Fe=()=>{Be(!1),f&&f(),F===!0&&D(e)};if(y=="center"&&o==="modal"||o==="large-modal"){let te={padding:"24px"};return o==="large-modal"?(te.width="85%",te.height="90%",te.maxHeight="800px",te.minHeight="500px",te.padding="0"):te.width="400px",Ge.createElement(He,{appearance:c,onClose:Fe,visible:Ne,style:te,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Lo,{appearance:c,steps:Q,selectedStep:z,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:b,showFooter:m,prefillData:P}))}return o==="modal"&&y!=="center"?Ge.createElement(To,{appearance:c,onClose:Fe,visible:Ne,modalPosition:y},Ge.createElement(oe,{appearance:c}),Ge.createElement(Lo,{appearance:c,steps:Q,selectedStep:z,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:b,showFooter:m,prefillData:P})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Lo,{appearance:c,steps:Q,selectedStep:z,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:b,showFooter:m,prefillData:P}))},Ki=Gi;import{useCallback as yr,useContext as Sp,useEffect as bp}from"react";function Sr(){let{organizationId:e,userId:t,setOrganizationId:o}=Sp(G),{mutateUserFlowState:i}=Ee(),{config:r,apiUrl:n}=_e(),s=Ot(),{verifySDKInitiated:p}=Lt();function c(x,F){return`frigade-user-group-registered-${x}-${F}`}bp(()=>{if(t&&e){if(t.startsWith(Dt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=yr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let F={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(F)}),i()},[e,t,r,i]),g=yr(async(x,F)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:F}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]),d=yr(async(x,F)=>{if(p())if(F){let y=c(t,x);localStorage.setItem(y,"true"),o(x);let S={foreignUserId:t,foreignUserGroupId:x,properties:F};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var qi="frigade-xFrigade_guestUserId",so="frigade-xFrigade_userId",Yi=({})=>{let{setFlowResponses:e}=Jt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ee(),{userId:r,setUserId:n}=Qt(),[s,p]=br(null),{getFlowStatus:c}=J(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=wp(G),[F,y]=br([]),[S,f]=br([]),{organizationId:B}=Sr();Do(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let m=t[b],P=l.find(w=>w.slug===(m==null?void 0:m.flowId));if(P&&m&&m.shouldTrigger===!0&&P.type=="FORM"&&P.triggerType==="AUTOMATIC"&&!S.includes(P.slug)){setTimeout(()=>{T(m.flowId)},500);break}}},[o,t]),Do(()=>{x.length>0&&i()},[x]);function T(b){let m=l.find(P=>P.slug===b);m&&m.triggerType==="AUTOMATIC"&&!S.includes(m.slug)&&(f([...S,m.slug]),y([m]))}function h(){if(!r){let b=localStorage.getItem(so);if(b){n(b);return}let m=localStorage.getItem(qi);if(m){n(m);return}d(!0);let P=Dt+Tp();try{localStorage.setItem(qi,P)}catch(w){console.log("Failed to save guest user id locally: Local storage unavailable",w)}n(w=>w||P)}}Do(()=>{try{if(l){let b=[];l.forEach(m=>{if(m.data){let P=m.data.match(/"imageUri":"(.*?)"/g);P&&P.forEach(w=>{let E=w.replace('"imageUri":"',"").replace('"',"");if(b.includes(E))return;let O=new Image;O.src=E,b.push(E)})}})}}catch{}},[l]),Do(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Dt))try{localStorage.setItem(so,r)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}r===null&&setTimeout(()=>{r===null&&h()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,F.map(b=>c(b.slug)!==Me?null:bt.createElement("span",{key:b.slug},bt.createElement(Ki,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as Xp}from"react-error-boundary";import lo from"core-js-pure/actual/structured-clone";function wr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dt(...e){let t=e.shift(),o=e.length===1?e[0]:dt(...e);if(!wr(t)||!wr(o))throw new Error("deepmerge can only merge Objects");let i=lo(t);return Object.entries(o).forEach(([r,n])=>{wr(n)?i[r]!==void 0?Object.assign(i,{[r]:dt(i[r],lo(n))}):Object.assign(i,{[r]:lo(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...lo(n)]}):Object.assign(i,{[r]:lo(n)}):Object.assign(i,{[r]:n})}),i}var Xi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function Fp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Xi[o]){let r=Xi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function kp(e){if(!e)return;let t=dt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Ji(e){let{theme:t,styleOverrides:o}=e,i=Fp(t),r=kp(o);return{overrides:i,css:r}}import zp from"styled-components";import{compose as Wp,variant as Zi}from"styled-system";import Qi from"react";import Pp,{ThemeProvider as vp,useTheme as Bp}from"styled-components";import{border as Ep,color as Ap,compose as Ip,get as Np,shadow as Op,space as Lp,system as Dp,typography as $p}from"styled-system";var Mp={width:{property:"width",scale:"sizes",transform:(e,t)=>Np(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},Up=Pp("div")(({css:e})=>e,Ip(Ep,Ap,Op,Lp,$p,Dp(Mp))),ao=({as:e,children:t,overrides:o,...i})=>{let r=Bp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Qi.createElement(Up,{as:e,...n,...i},t);if(o!==void 0){let p=dt(r,o);return Qi.createElement(vp,{theme:p},s())}return s()};var po={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},_p={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Ri=zp(ao)(()=>({whiteSpace:"nowrap"}),Wp(Zi({scale:"components.Button",variants:"components.Button"}),Zi({prop:"size",variants:_p})));import Hp from"styled-components";import{variant as jp,system as Vp}from"styled-system";var $o={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var en=Hp(ao)(jp({scale:"components.Text",variants:"components.Text"}),Vp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var tn=4,on="px",Gp=20,Kp=Object.fromEntries(Array.from(Array(Gp+1),(e,t)=>t===0?[.5,`${.5*tn}${on}`]:[t,`${t*tn}${on}`])),Wt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Tr={colors:{...Wt,neutral:{foreground:Wt.gray300},primary:{background:Wt.blue500,foreground:Wt.white,inverted:Wt.blue500},negative:{foreground:Wt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Kp,components:{Button:po,Text:$o}};var rn="https://api.frigade.com",G=qp({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:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:rn,readonly:!1,debug:!1});function Jp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Qp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var ue,fe;let[n,s]=Le(t||null),[p,c]=Le(o||null),[l,g]=Le([]),[d,x]=Le([]),[F,y]=Le([]),[S,f]=Le({}),[B,T]=Le({}),[h,A]=Le([]),[b,m]=Le({}),[P,w]=Le(!1),[E,O]=Le(!1),[N,I]=Le(!K(e)),$=(W,V)=>{if(V==="_blank"){window.open(W,"_blank");return}setTimeout(()=>{window.location.href=W},50)},D={theme:{...Je.theme,...((ue=i==null?void 0:i.defaultAppearance)==null?void 0:ue.theme)??{}},styleOverrides:{...Je.styleOverrides,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.styleOverrides)??{}}};function K(W){return!!(W&&W.length>10&&W.substring(0,10)==="api_public")}Mo(()=>{t&&s(t)},[t]),Mo(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(so)&&window.localStorage.getItem(so)!==n&&Jp()},[n]),Mo(()=>{o&&c(o)},[o]),Mo(()=>{if(K(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let z={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:F,setFlowResponses:y,userProperties:S,setUserProperties:f,openFlowStates:B,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:h,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:b,setCustomVariables:m,isNewGuestUser:P,setIsNewGuestUser:w,hasActiveFullPageFlow:E,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:rn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(N)return wt.createElement(G.Provider,{value:z},r);let{overrides:q}=Ji(D);return wt.createElement(Xp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(G.Provider,{value:z},wt.createElement(Yp,{theme:dt(D.theme,Tr,q??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(Yi,null))))};import Wd from"react";import me,{useEffect as Os,useState as Ls}from"react";import We,{useState as gd}from"react";import kt from"styled-components";import Wo from"react";import Tt from"react";import sn from"styled-components";var nn=sn.span`
660
+ `;var Gi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=yr([]),[p,c]=yr(!1),[l,g]=yr(e.id);return Cr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),Cr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),Cr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement(Mi,{className:a("selectListContainer",i)},Ze.createElement(Ui,null,Ze.createElement(zi,{className:a("selectListTitle",i)},e.title),Ze.createElement(Wi,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let F=n.includes(d.id);return Ze.createElement(_i,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(S=>S!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:a("selectListSelectItem",i)},Ze.createElement(Hi,{className:a("selectListItemImage",i)},d.imageUri&&Ze.createElement(ji,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(Vi,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:F,primaryColor:i.theme.colorPrimary}))}))};import Ie,{useEffect as Lo,useState as so}from"react";var hp=({children:e,id:t,shouldWrap:o=!1})=>Ie.createElement(Ie.Fragment,null,o?Ie.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Do=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:l,onComplete:g,setVisible:d,setShowModal:x,onDismiss:F,showPagination:S=!1,customFormElements:b,allowBackNavigation:f,validationHandler:B,onFormDataChange:T,showFooter:h,prefillData:I,updateUrlOnPageChange:y})=>{var Ce;let P={...{linkCollection:Di,multiInput:ki,callToAction:$i,selectList:Gi},...i},{primaryCTAClickSideEffects:w,secondaryCTAClickSideEffects:E}=ie(),[O,N]=so(!1),[A,D]=so({}),[$,j]=so(!1),[H,V]=so(!1),[we,ce]=so(null),G=t[o]??null,{markStepCompleted:re,markStepStarted:Y,isLoading:Te,updateCustomVariables:le,markFlowCompleted:he}=J();Lo(()=>{le(r)},[r,Te]),Lo(()=>{T&&T(A,ee(),t[o],o)},[A]),Lo(()=>{window&&f&&!H&&(window.location.hash=t[o].id,V(!0))},[f,H,V]),Lo(()=>{var z;if(window&&((z=window==null?void 0:window.location)!=null&&z.hash)&&window.location.hash.replace("#","")!==t[o].id){let ye=window.location.hash.replace("#",""),q=t.findIndex(fe=>fe.id===ye);q!==-1&&Y(p,t[q].id)}},[(Ce=window==null?void 0:window.location)==null?void 0:Ce.hash,Y,o,t]);function ee(){return{data:A[t[o].id]??{},stepId:t[o].id,customVariables:r}}function me(z,ye,q){let fe=o+1<t.length?t[o+1]:null;return s&&s(z,q,fe,A,ee()),n?n(z,o,ye,fe):!0}function Fe(z,ye){D(q=>{let fe={};return fe[z.id]=ye,{...q,...fe}})}function L(z){return z.selectedStep.imageUri?Ie.createElement(Ii,{image:z.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let U=h&&Ie.createElement(Oi,{step:t[o],canContinue:O&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(j(!0),B){let q=await B(t[o],o,t[o+1],A,ee());if(q||q===!1){ce(typeof q=="string"?q:null),j(!1);return}else ce(null)}let z={...ee()};await re(p,t[o].id,z),o+1<t.length&&await Y(p,t[o+1].id);let ye=me(t[o],"primary",o);if(o+1>=t.length&&(g&&g(),F&&F(),l&&ye&&(d&&d(!1),x(!1)),await he(p)),w(t[o]),j(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id),window&&!f&&y&&o+1<t.length){let q=new URL(window.location.href);q.searchParams.set("p",t[o+1].id),window.history.pushState({},"",q.toString())}},onSecondaryClick:()=>{me(t[o],"secondary",o),E(t[o])},onBack:async()=>{o-1>=0&&(j(!0),await Y(p,t[o-1].id),j(!1))},steps:t,allowBackNavigation:f,errorMessage:we});return Ie.createElement(Ie.Fragment,null,Ie.createElement(Ei,{className:a("formContainer",e)},Ie.createElement(hp,{id:o,shouldWrap:c==="large-modal"},Ie.createElement(Ai,{key:G.id,type:c,className:a("formContent",e)},t.map(z=>{let ye=P[z.type];return G.id!==z.id?null:Ie.createElement(ye,{key:z.id,stepData:z,canContinue:O,setCanContinue:N,onSaveData:q=>{Fe(z,q)},appearance:e,customFormElements:b,flowId:p,prefillData:I})}),S&&Ie.createElement(Li,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),U)),c=="large-modal"&&Ie.createElement(L,{selectedStep:t[o]})))};import lo from"react";import{createGlobalStyle as Cp}from"styled-components";function te({appearance:e}){if(!e||!e.styleOverrides)return lo.createElement(lo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return lo.createElement(lo.Fragment,null);let o=Cp`
661
+ ${i=>i.inlineStyles.map(([r,n])=>`.${eo}${r}.${eo}${r} { ${Object.entries(n).map(([s,p])=>`${Ro(s)}: ${p};`).join(" ")} }`).join(" ")}`;return lo.createElement(o,{inlineStyles:t})}var Ki=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:F=!1,modalPosition:S="center",repeatable:b=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:T=!1,validationHandler:h,showFrigadeBranding:I=!1,onFormDataChange:y,showFooter:m=!0,prefillData:P={},updateUrlOnPageChange:w=!1})=>{let{getFlow:E,getFlowSteps:O,isLoading:N,targetingLogicShouldHideFlow:A,getFlowStatus:D,getCurrentStepIndex:$,markFlowCompleted:j,markFlowNotStarted:H}=J(),V=$(e),{mergeAppearanceWithDefault:we}=Q(),[ce,G]=Sp(!1),{setOpenFlowState:re,getOpenFlowState:Y,hasOpenModals:Te}=ke();c=we(c);let[le,he]=i!==void 0&&r!==void 0?[i,r]:[Y(e,!0),L=>re(e,L)];if(yp(()=>{!ce&&!N&&(G(!0),D(e)===X&&b&&(H(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(U=>{U.startsWith(gr)&&window.localStorage.removeItem(U)})),G(!0))},[ce,G,N]),N)return null;let ee=E(e);if(!ee||A(ee))return null;let me=O(e);if(!me||i!==void 0&&i===!1||D(e)===X&&l||(o=="modal"||o=="corner-modal")&&Te(e))return null;let Fe=()=>{he(!1),f&&f(),F===!0&&j(e)};if(S=="center"&&o==="modal"||o==="large-modal"){let L={padding:"24px"};return o==="large-modal"?(L.width="85%",L.height="90%",L.maxHeight="800px",L.minHeight="500px",L.padding="0"):L.width="400px",Ke.createElement(je,{appearance:c,onClose:Fe,visible:le,style:L,dismissible:x,showFrigadeBranding:I},Ke.createElement(te,{appearance:c}),Ke.createElement(Do,{appearance:c,steps:me,selectedStep:V,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:he,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:y,showFooter:m,prefillData:P,updateUrlOnPageChange:w}))}return o==="modal"&&S!=="center"?Ke.createElement(Fo,{appearance:c,onClose:Fe,visible:le,modalPosition:S},Ke.createElement(te,{appearance:c}),Ke.createElement(Do,{appearance:c,steps:me,selectedStep:V,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:he,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:y,showFooter:m,prefillData:P,updateUrlOnPageChange:w})):Ke.createElement(Ke.Fragment,null,Ke.createElement(te,{appearance:c}),Ke.createElement(Do,{appearance:c,steps:me,selectedStep:V,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:he,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:y,showFooter:m,prefillData:P,updateUrlOnPageChange:w}))},qi=Ki;import{useCallback as Sr,useContext as bp,useEffect as wp}from"react";function br(){let{organizationId:e,userId:t,setOrganizationId:o}=bp(K),{mutateUserFlowState:i}=Ae(),{config:r,apiUrl:n}=He(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,F){return`frigade-user-group-registered-${x}-${F}`}wp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=Sr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let F={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(F)}),i()},[e,t,r,i]),g=Sr(async(x,F)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:F}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()},[e,t,r,i]),d=Sr(async(x,F)=>{if(p())if(F){let S=c(t,x);localStorage.setItem(S,"true"),o(x);let b={foreignUserId:t,foreignUserGroupId:x,properties:F};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var Yi="frigade-xFrigade_guestUserId",ao="frigade-xFrigade_userId",Xi=({})=>{let{setFlowResponses:e}=Zt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ae(),{userId:r,setUserId:n}=Rt(),[s,p]=wr(null),{getFlowStatus:c}=J(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Tp(K),[F,S]=wr([]),[b,f]=wr([]),{organizationId:B}=br();$o(()=>{if(!o&&t)for(let y=0;y<t.length;y++){let m=t[y],P=l.find(w=>w.slug===(m==null?void 0:m.flowId));if(P&&m&&m.shouldTrigger===!0&&P.type=="FORM"&&P.triggerType==="AUTOMATIC"&&!b.includes(P.slug)){setTimeout(()=>{T(m.flowId)},500);break}}},[o,t]),$o(()=>{x.length>0&&i()},[x]);function T(y){let m=l.find(P=>P.slug===y);m&&m.triggerType==="AUTOMATIC"&&!b.includes(m.slug)&&(f([...b,m.slug]),S([m]))}function h(){if(!r){let y=localStorage.getItem(ao);if(y){n(y);return}let m=localStorage.getItem(Yi);if(m){n(m);return}d(!0);let P=Lt+Fp();try{localStorage.setItem(Yi,P)}catch(w){console.log("Failed to save guest user id locally: Local storage unavailable",w)}n(w=>w||P)}}$o(()=>{try{if(l){let y=[];l.forEach(m=>{if(m.data){let P=m.data.match(/"imageUri":"(.*?)"/g);P&&P.forEach(w=>{let E=w.replace('"imageUri":"',"").replace('"',"");if(y.includes(E))return;let O=new Image;O.src=E,y.push(E)})}})}}catch{}},[l]),$o(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(ao,r)}catch(y){console.log("Failed to save user id locally: Local storage available",y)}r===null&&setTimeout(()=>{r===null&&h()},50)},[r,l,g]);function I(){return St.createElement(St.Fragment,null,F.map(y=>c(y.slug)!==Ue?null:St.createElement("span",{key:y.slug},St.createElement(qi,{flowId:y.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(I,null))};import{ErrorBoundary as Jp}from"react-error-boundary";import po from"core-js-pure/actual/structured-clone";function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dt(...e){let t=e.shift(),o=e.length===1?e[0]:dt(...e);if(!Tr(t)||!Tr(o))throw new Error("deepmerge can only merge Objects");let i=po(t);return Object.entries(o).forEach(([r,n])=>{Tr(n)?i[r]!==void 0?Object.assign(i,{[r]:dt(i[r],po(n))}):Object.assign(i,{[r]:po(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...po(n)]}):Object.assign(i,{[r]:po(n)}):Object.assign(i,{[r]:n})}),i}var Ji={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function kp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Ji[o]){let r=Ji[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Pp(e){if(!e)return;let t=dt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Qi(e){let{theme:t,styleOverrides:o}=e,i=kp(t),r=Pp(o);return{overrides:i,css:r}}import Wp from"styled-components";import{compose as _p,variant as Ri}from"styled-system";import Zi from"react";import vp,{ThemeProvider as Bp,useTheme as Ep}from"styled-components";import{border as Ap,color as Ip,compose as Np,get as Op,shadow as Lp,space as Dp,system as $p,typography as Mp}from"styled-system";var Up={width:{property:"width",scale:"sizes",transform:(e,t)=>Op(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},zp=vp("div")(({css:e})=>e,Np(Ap,Ip,Lp,Dp,Mp,$p(Up))),co=({as:e,children:t,overrides:o,...i})=>{let r=Ep(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Zi.createElement(zp,{as:e,...n,...i},t);if(o!==void 0){let p=dt(r,o);return Zi.createElement(Bp,{theme:p},s())}return s()};var mo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Hp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},en=Wp(co)(()=>({whiteSpace:"nowrap"}),_p(Ri({scale:"components.Button",variants:"components.Button"}),Ri({prop:"size",variants:Hp})));import jp from"styled-components";import{variant as Vp,system as Gp}from"styled-system";var Mo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var tn=jp(co)(Vp({scale:"components.Text",variants:"components.Text"}),Gp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var on=4,rn="px",Kp=20,qp=Object.fromEntries(Array.from(Array(Kp+1),(e,t)=>t===0?[.5,`${.5*on}${rn}`]:[t,`${t*on}${rn}`])),Wt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Fr={colors:{...Wt,neutral:{foreground:Wt.gray300},primary:{background:Wt.blue500,foreground:Wt.white,inverted:Wt.blue500},negative:{foreground:Wt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:qp,components:{Button:mo,Text:Mo}};var nn="https://api.frigade.com",K=Yp({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:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:nn,readonly:!1,debug:!1});function Qp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Zp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var we,ce;let[n,s]=De(t||null),[p,c]=De(o||null),[l,g]=De([]),[d,x]=De([]),[F,S]=De([]),[b,f]=De({}),[B,T]=De({}),[h,I]=De([]),[y,m]=De({}),[P,w]=De(!1),[E,O]=De(!1),[N,A]=De(!j(e)),D=(G,re)=>{if(re==="_blank"){window.open(G,"_blank");return}setTimeout(()=>{window.location.href=G},50)},$={theme:{...Je.theme,...((we=i==null?void 0:i.defaultAppearance)==null?void 0:we.theme)??{}},styleOverrides:{...Je.styleOverrides,...((ce=i==null?void 0:i.defaultAppearance)==null?void 0:ce.styleOverrides)??{}}};function j(G){return!!(G&&G.length>10&&G.substring(0,10)==="api_public")}Uo(()=>{t&&s(t)},[t]),Uo(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(ao)&&window.localStorage.getItem(ao)!==n&&Qp()},[n]),Uo(()=>{o&&c(o)},[o]),Uo(()=>{if(j(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let H={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:F,setFlowResponses:S,userProperties:b,setUserProperties:f,openFlowStates:B,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:h,setCompletedFlowsToKeepOpenDuringSession:I,customVariables:y,setCustomVariables:m,isNewGuestUser:P,setIsNewGuestUser:w,hasActiveFullPageFlow:E,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:D,defaultAppearance:$,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:nn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(N)return bt.createElement(K.Provider,{value:H},r);let{overrides:V}=Qi($);return bt.createElement(Jp,{fallback:bt.createElement(bt.Fragment,null,r)},bt.createElement(K.Provider,{value:H},bt.createElement(Xp,{theme:dt($.theme,Fr,V??{},(i==null?void 0:i.theme)??{})},r,bt.createElement(Xi,null))))};import _d from"react";import de,{useEffect as Ls,useState as Ds}from"react";import _e,{useState as xd}from"react";import Ft from"styled-components";import _o from"react";import wt from"react";import ln from"styled-components";var sn=ln.span`
666
662
  font-weight: 600;
667
663
  font-size: 14px;
668
664
  font-style: normal;
@@ -673,8 +669,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
673
669
  vertical-align: middle;
674
670
  margin-left: 32px;
675
671
  padding-right: 12px;
676
- ${e=>ke(e)}
677
- `,Zp=sn.div`
672
+ ${e=>Be(e)}
673
+ `,Rp=ln.div`
678
674
  flex-direction: row;
679
675
  justify-content: space-between;
680
676
  display: flex;
@@ -682,12 +678,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
682
678
  padding-bottom: 20px;
683
679
  padding-right: 8px;
684
680
  width: 100%;
685
- ${e=>ke(e)}
686
- `,Uo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(Zp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&Tt.createElement(nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Tt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&Tt.createElement(nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Tt.createElement(oe,{appearance:p}));import co from"styled-components";var ln=co.div`
681
+ ${e=>Be(e)}
682
+ `,zo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>wt.createElement(wt.Fragment,null,wt.createElement(Rp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&wt.createElement(sn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),wt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&wt.createElement(sn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),wt.createElement(te,{appearance:p}));import uo from"styled-components";var an=uo.div`
687
683
  font-weight: 700;
688
684
  font-size: 18px;
689
685
  line-height: 22px;
690
- `,an=co.p`
686
+ `,pn=uo.p`
691
687
  font-weight: 600;
692
688
  font-size: 16px;
693
689
  line-height: 24px;
@@ -695,7 +691,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
695
691
  letter-spacing: 0.32px;
696
692
  font-style: normal;
697
693
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
698
- `,pn=co.p`
694
+ `,dn=uo.p`
699
695
  font-weight: 400;
700
696
  font-size: 14px;
701
697
  font-style: normal;
@@ -704,45 +700,45 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
704
700
  letter-spacing: 0.28px;
705
701
  margin: 8px 0px 0px 0px;
706
702
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
707
- `,zo=co.div`
703
+ `,Wo=uo.div`
708
704
  width: 6px;
709
705
  position: absolute;
710
706
  left: 0;
711
707
  height: 100%;
712
708
  border-top-right-radius: 4px;
713
709
  border-bottom-right-radius: 4px;
714
- `,dn=co.div`
710
+ `,cn=uo.div`
715
711
  flex-direction: row;
716
712
  justify-content: flex-start;
717
713
  border-bottom: 1px solid ${e=>e.theme.colorBorder};
718
714
  padding-right: 16px;
719
- `;var cn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return Wo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&Wo.createElement(zo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),Wo.createElement(dn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Wo.createElement(Uo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Ft from"react";import Fr from"styled-components";import Re from"styled-components";var uh=Re.div`
715
+ `;var mn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return _o.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&_o.createElement(Wo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),_o.createElement(cn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},_o.createElement(zo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Tt from"react";import kr from"styled-components";import Re from"styled-components";var fh=Re.div`
720
716
  background: #ffffff;
721
717
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
722
718
  border-radius: 20px;
723
719
  width: 385px;
724
720
  padding: 24px 16px 16px 16px;
725
- `,fh=Re.div`
726
- /* Border bottom only on collapsable */
727
721
  `,gh=Re.div`
722
+ /* Border bottom only on collapsable */
723
+ `,xh=Re.div`
728
724
  display: flex;
729
725
  flex-direction: row;
730
726
  justify-content: space-between;
731
727
  align-content: flex-start;
732
- `,xh=Re.h1`
728
+ `,hh=Re.h1`
733
729
  display: flex;
734
730
  margin: 0;
735
731
  font-size: 18px;
736
- `,hh=Re.h2`
732
+ `,Ch=Re.h2`
737
733
  font-size: 15px;
738
734
  color: #4d4d4d;
739
- `,Ch=Re.ul`
735
+ `,yh=Re.ul`
740
736
  list-style: none;
741
- `,yh=Re.li`
737
+ `,Sh=Re.li`
742
738
  display: flex;
743
739
  justify-content: flex-start;
744
740
  flex-direction: row;
745
- `,mn=Re.div`
741
+ `,un=Re.div`
746
742
  position: absolute;
747
743
  left: 0;
748
744
  top: 0;
@@ -750,7 +746,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
750
746
  width: ${e=>e.fgWidth};
751
747
  border-radius: 20px;
752
748
  background-color: ${e=>e.theme.colorPrimary};
753
- `,un=Re.div`
749
+ `,fn=Re.div`
754
750
  position: relative;
755
751
  left: 0;
756
752
  top: 0;
@@ -760,33 +756,33 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
760
756
  border-radius: 20px;
761
757
  background-color: ${e=>e.theme.colorPrimary};
762
758
  opacity: 0.12;
763
- `;var Rp=Fr.div`
759
+ `;var ed=kr.div`
764
760
  display: flex;
765
761
  flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
766
762
  justify-content: flex-start;
767
763
  align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
768
764
  width: 100%;
769
765
 
770
- ${e=>ke(e)}
771
- `,ed=Fr.div`
766
+ ${e=>Be(e)}
767
+ `,td=kr.div`
772
768
  flex-grow: 1;
773
769
  position: relative;
774
770
  ${e=>e.textLocation=="top"?"width: 100%;":""}
775
- `,td=Fr.span`
771
+ `,od=kr.span`
776
772
  font-weight: 600;
777
773
  font-size: 14px;
778
774
  line-height: 18px;
779
775
  padding-right: ${e=>e.padding};
780
776
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
781
777
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
782
- ${e=>ke(e)}
783
- `;var De=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(Rp,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Ft.createElement(td,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Ft.createElement(ed,{textLocation:i,className:a("progressBar",s)},Ft.createElement(mn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Ft.createElement(un,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import mo from"react";import rd from"styled-components";import Ho from"react";import _o from"react";var _t=({stepData:e,appearance:t})=>_o.createElement(_o.Fragment,null,_o.createElement(an,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:se(e.title)}),_o.createElement(pn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:se(e.subtitle)}));import kr from"react";var Ht=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return kr.createElement(Eo,{className:a("ctaContainer",t)},kr.createElement(R,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&kr.createElement(R,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var jt=({stepData:e,appearance:t})=>Ho.createElement(Ho.Fragment,null,Ho.createElement(_t,{stepData:e,appearance:t}),Ho.createElement(Ht,{stepData:e,appearance:t}));import od from"react";function fn(e){return od.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Pr="default",id=rd.img`
778
+ ${e=>Be(e)}
779
+ `;var $e=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Tt.createElement(Tt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Tt.createElement(ed,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Tt.createElement(od,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Tt.createElement(td,{textLocation:i,className:a("progressBar",s)},Tt.createElement(un,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Tt.createElement(fn,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import fo from"react";import id from"styled-components";import jo from"react";import Ho from"react";var _t=({stepData:e,appearance:t})=>Ho.createElement(Ho.Fragment,null,Ho.createElement(pn,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ne(e.title)}),Ho.createElement(dn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ne(e.subtitle)}));import Pr from"react";var Ht=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Pr.createElement(Ao,{className:a("ctaContainer",t)},Pr.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Pr.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var jt=({stepData:e,appearance:t})=>jo.createElement(jo.Fragment,null,jo.createElement(_t,{stepData:e,appearance:t}),jo.createElement(Ht,{stepData:e,appearance:t}));import rd from"react";function gn(e){return rd.createElement(Ge,{appearance:e.appearance,videoUri:e.videoUri})}var vr="default",nd=id.img`
784
780
  border-radius: 4px;
785
781
  max-height: 260px;
786
782
  min-height: 200px;
787
- `,gn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return mo.createElement("div",null,o)}return mo.createElement(ln,{className:a("checklistStepContent",t)},e.imageUri?mo.createElement(id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?mo.createElement(fn,{videoUri:e.videoUri,appearance:t}):null,mo.createElement(jt,{stepData:e,appearance:t}))};import Ae,{useRef as nd,useState as sd}from"react";import Vt from"styled-components";var xn=Vt.div`
783
+ `,xn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return fo.createElement("div",null,o)}return fo.createElement(an,{className:a("checklistStepContent",t)},e.imageUri?fo.createElement(nd,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?fo.createElement(gn,{videoUri:e.videoUri,appearance:t}):null,fo.createElement(jt,{stepData:e,appearance:t}))};import Ne,{useRef as sd,useState as ld}from"react";import Vt from"styled-components";var hn=Vt.div`
788
784
  display: block;
789
- `,ld=Vt.div`
785
+ `,ad=Vt.div`
790
786
  display: flex;
791
787
  flex-direction: row;
792
788
  flex-wrap: wrap;
@@ -796,20 +792,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
796
792
  align-content: center;
797
793
  margin-top: 24px;
798
794
  margin-bottom: 24px;
799
- `,ad=Vt.div`
795
+ `,pd=Vt.div`
800
796
  display: flex;
801
797
  align-items: center;
802
798
  justify-content: flex-start;
803
799
  flex-direction: column;
804
800
  margin-right: 16px;
805
- `,pd=Vt.video`
801
+ `,dd=Vt.video`
806
802
  width: 200px;
807
803
  height: 120px;
808
- `,dd=Vt.div`
804
+ `,cd=Vt.div`
809
805
  font-size: 14px;
810
806
  line-height: 20px;
811
807
  text-align: center;
812
- `,cd=Vt.div`
808
+ `,md=Vt.div`
813
809
  position: absolute;
814
810
  width: 200px;
815
811
  height: 120px;
@@ -829,9 +825,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
829
825
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
830
826
  border-radius: 50%;
831
827
  }
832
- `,hn="videoCarousel",Cn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ae.createElement(xn,null,Ae.createElement(jt,{stepData:e,appearance:t}));function o({video:n}){let s=nd(),[p,c]=sd(!1);return Ae.createElement(ad,null,!p&&Ae.createElement(cd,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ae.createElement(Ao,null)),Ae.createElement(pd,{controls:p,ref:s,play:p,src:n.uri}),Ae.createElement(dd,null,n.title))}let i=e.props;return i.videos?Ae.createElement(xn,null,Ae.createElement(_t,{stepData:e,appearance:t}),Ae.createElement(ld,null,i.videos.map((n,s)=>Ae.createElement("span",{key:`${n.uri}-${s}`},Ae.createElement(o,{video:n})))),Ae.createElement(Ht,{stepData:e,appearance:t})):null};import et from"react";import jo from"styled-components";var yn=jo.div`
828
+ `,Cn="videoCarousel",yn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ne.createElement(hn,null,Ne.createElement(jt,{stepData:e,appearance:t}));function o({video:n}){let s=sd(),[p,c]=ld(!1);return Ne.createElement(pd,null,!p&&Ne.createElement(md,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ne.createElement(Io,null)),Ne.createElement(dd,{controls:p,ref:s,play:p,src:n.uri}),Ne.createElement(cd,null,n.title))}let i=e.props;return i.videos?Ne.createElement(hn,null,Ne.createElement(_t,{stepData:e,appearance:t}),Ne.createElement(ad,null,i.videos.map((n,s)=>Ne.createElement("span",{key:`${n.uri}-${s}`},Ne.createElement(o,{video:n})))),Ne.createElement(Ht,{stepData:e,appearance:t})):null};import et from"react";import Vo from"styled-components";var Sn=Vo.div`
833
829
  display: block;
834
- `,md=jo.pre`
830
+ `,ud=Vo.pre`
835
831
  display: block;
836
832
  background-color: #2a2a2a;
837
833
  color: #f8f8f8;
@@ -847,29 +843,29 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
847
843
  white-space: -o-pre-wrap; /* Opera 7 */
848
844
  word-wrap: break-word; /* Internet Explorer 5.5+ */
849
845
  margin-bottom: 24px;
850
- `,ud=jo.div`
846
+ `,fd=Vo.div`
851
847
  font-size: 15px;
852
848
  line-height: 20px;
853
849
  margin-bottom: 12px;
854
850
  margin-top: 12px;
855
- `,fd=jo.div`
851
+ `,gd=Vo.div`
856
852
  margin-top: 24px;
857
- `,Sn="codeSnippet",bn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(yn,null,et.createElement(jt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(yn,null,et.createElement(_t,{stepData:e,appearance:t}),et.createElement(fd,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(ud,null,r.title):null,r.code?et.createElement(md,null,r.code):null))),et.createElement(Ht,{stepData:e,appearance:t})):null};var xd=kt.div`
853
+ `,bn="codeSnippet",wn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(Sn,null,et.createElement(jt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(Sn,null,et.createElement(_t,{stepData:e,appearance:t}),et.createElement(gd,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(fd,null,r.title):null,r.code?et.createElement(ud,null,r.code):null))),et.createElement(Ht,{stepData:e,appearance:t})):null};var hd=Ft.div`
858
854
  display: flex;
859
855
  flex-direction: row;
860
856
  overflow: hidden;
861
857
  min-width: ${e=>e.type!="modal"?"600px":"100%"};
862
858
  background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
863
859
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
864
- ${e=>ke(e)}
865
- `,hd=kt.h1`
860
+ ${e=>Be(e)}
861
+ `,Cd=Ft.h1`
866
862
  font-size: 18px;
867
863
  font-style: normal;
868
864
  font-weight: 700;
869
865
  line-height: 24px;
870
866
  letter-spacing: 0.36px;
871
867
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
872
- `,Cd=kt.h2`
868
+ `,yd=Ft.h2`
873
869
  font-size: 14px;
874
870
  font-style: normal;
875
871
  font-weight: 400;
@@ -877,43 +873,43 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
877
873
  letter-spacing: 0.28px;
878
874
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
879
875
  margin: 10px 0px 0px 0px;
880
- `,wn=kt.div``,yd=kt.div`
876
+ `,Tn=Ft.div``,Sd=Ft.div`
881
877
  list-style: none;
882
878
  padding: 0;
883
879
  margin: 0;
884
880
  cursor: pointer;
885
881
  width: 300px;
886
- `,Sd=kt.div`
882
+ `,bd=Ft.div`
887
883
  width: 1px;
888
884
  margin-right: 40px;
889
885
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
890
- `,bd=kt.div`
886
+ `,wd=Ft.div`
891
887
  flex: 2;
892
888
  padding: 2rem 2rem 2rem 0rem;
893
- `,wd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Z();c=g(c);let x={...{[Pr]:gn,[hn]:Cn,[Sn]:bn},...p},[F,y]=gd(0),S=r??F,f=n??y,B=o.filter(h=>h.complete===!0).length,T=()=>{var h;return!((h=o[S])!=null&&h.type)||!x[o[S].type]?x[Pr]({stepData:o[S],appearance:c}):x[o[S].type]({stepData:o[S],appearance:c})};return We.createElement(xd,{type:l,styleOverrides:i,className:s,appearance:c},We.createElement(wn,{style:{flex:1}},We.createElement(wn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},We.createElement(hd,{className:a("checklistTitle",c),appearance:c},e),We.createElement(Cd,{className:a("checklistSubtitle",c),appearance:c},t),We.createElement(De,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),We.createElement(yd,{className:a("checklistStepsContainer",c)},o.map((h,A)=>We.createElement(cn,{data:h,index:A,key:A,listLength:o.length,isSelected:A===S,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)},appearance:c})))),We.createElement(Sd,{appearance:c,className:a("checklistDivider",c)}),We.createElement(bd,null,We.createElement(T,null)))},vr=wd;import U,{useState as vd}from"react";import Tn from"react";import Td from"styled-components";var Fd=Td.svg`
889
+ `,Td=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[vr]:xn,[Cn]:yn,[bn]:wn},...p},[F,S]=xd(0),b=r??F,f=n??S,B=o.filter(h=>h.complete===!0).length,T=()=>{var h;return!((h=o[b])!=null&&h.type)||!x[o[b].type]?x[vr]({stepData:o[b],appearance:c}):x[o[b].type]({stepData:o[b],appearance:c})};return _e.createElement(hd,{type:l,styleOverrides:i,className:s,appearance:c},_e.createElement(Tn,{style:{flex:1}},_e.createElement(Tn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},_e.createElement(Cd,{className:a("checklistTitle",c),appearance:c},e),_e.createElement(yd,{className:a("checklistSubtitle",c),appearance:c},t),_e.createElement($e,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),_e.createElement(Sd,{className:a("checklistStepsContainer",c)},o.map((h,I)=>_e.createElement(mn,{data:h,index:I,key:I,listLength:o.length,isSelected:I===b,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(I)},appearance:c})))),_e.createElement(bd,{appearance:c,className:a("checklistDivider",c)}),_e.createElement(wd,null,_e.createElement(T,null)))},Br=Td;import M,{useState as Bd}from"react";import Fn from"react";import Fd from"styled-components";var kd=Fd.svg`
894
890
  transition: 'transform 0.35s ease-in-out';
895
- `,Gt=({style:e,className:t})=>Tn.createElement(Fd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Tn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ge from"styled-components";var Br={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Fn=ge.div`
891
+ `,Gt=({style:e,className:t})=>Fn.createElement(kd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Fn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var Er={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},kn=ue.div`
896
892
  max-height: 350px;
897
893
  padding-bottom: 40px;
898
- `,kn=ge.div`
894
+ `,Pn=ue.div`
899
895
  display: flex;
900
896
  flex-direction: column;
901
897
  margin-top: 20px;
902
- `,Pn=ge.h1`
898
+ `,vn=ue.h1`
903
899
  font-style: normal;
904
900
  font-weight: 600;
905
901
  font-size: 30px;
906
902
  line-height: 36px;
907
903
  margin-bottom: 16px;
908
904
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
909
- `,vn=ge.h2`
905
+ `,Bn=ue.h2`
910
906
  font-weight: 400;
911
907
  font-size: 16px;
912
908
  line-height: 20px;
913
909
  margin-bottom: 16px;
914
910
  padding-left: 1px;
915
911
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
916
- `,Bn=ge.div`
912
+ `,En=ue.div`
917
913
  ${e=>k(e)} {
918
914
  border: 1px solid #fafafa;
919
915
  }
@@ -923,11 +919,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
923
919
  flex-direction: column;
924
920
  min-height: 240px;
925
921
  overflow: hidden;
926
- `,En=ge.div`
922
+ `,An=ue.div`
927
923
  display: flex;
928
924
  flex-direction: row;
929
925
  justify-content: space-between;
930
- `,An=ge.p`
926
+ `,In=ue.p`
931
927
  ${e=>k(e)} {
932
928
  font-weight: 400;
933
929
  font-size: 10px;
@@ -936,12 +932,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
936
932
  color: #8c8c8c;
937
933
  margin: 20px;
938
934
  }
939
- `,In=ge.div`
935
+ `,Nn=ue.div`
940
936
  display: flex;
941
937
  flex-direction: row;
942
- `,Nn=ge.div`
938
+ `,On=ue.div`
943
939
  flex: 1;
944
- `,On=ge.div`
940
+ `,Ln=ue.div`
945
941
  ${e=>k(e)} {
946
942
  display: flex;
947
943
  justify-content: center;
@@ -951,7 +947,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
951
947
  padding-left: 8px;
952
948
  padding-right: 8px;
953
949
  }
954
- `,Ln=ge.p`
950
+ `,Dn=ue.p`
955
951
  ${e=>k(e)} {
956
952
  font-style: normal;
957
953
  font-weight: 600;
@@ -963,7 +959,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
963
959
  margin-top: 20px;
964
960
  margin-bottom: 16px;
965
961
  }
966
- `,Dn=ge.p`
962
+ `,$n=ue.p`
967
963
  ${e=>k(e)} {
968
964
  font-weight: 400;
969
965
  font-size: 14px;
@@ -972,14 +968,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
972
968
  color: ${e=>e.appearance.theme.colorTextSecondary};
973
969
  margin-bottom: 8px;
974
970
  }
975
- `,$n=ge.div`
971
+ `,Mn=ue.div`
976
972
  ${e=>k(e)} {
977
973
  display: flex;
978
974
  flex-direction: row;
979
975
  justify-content: center;
980
976
  gap: 8px;
981
977
  }
982
- `,Mn=ge.div`
978
+ `,Un=ue.div`
983
979
  ${e=>k(e)} {
984
980
  // Anything inside this block will be ignored if the user provides a custom class
985
981
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
@@ -999,7 +995,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
999
995
  justify-content: space-between;
1000
996
  position: relative;
1001
997
  cursor: pointer;
1002
- `,Un=ge.p`
998
+ `,zn=ue.p`
1003
999
  ${e=>k(e)} {
1004
1000
  // Anything inside this block will be ignored if the user provides a custom class
1005
1001
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
@@ -1008,12 +1004,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1008
1004
  font-size: 14px;
1009
1005
  line-height: 22px;
1010
1006
  margin: 0;
1011
- `,zn=ge.div`
1007
+ `,Wn=ue.div`
1012
1008
  display: flex;
1013
1009
  flex-direction: row;
1014
1010
  justify-content: flex-end;
1015
1011
  align-content: center;
1016
- `,Wn=ge.div`
1012
+ `,_n=ue.div`
1017
1013
  display: flex;
1018
1014
  flex: 1;
1019
1015
  flex-direction: row;
@@ -1021,14 +1017,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1021
1017
  align-content: center;
1022
1018
  align-items: center;
1023
1019
  margin-right: 20px;
1024
- `,_n=ge.div`
1020
+ `,Hn=ue.div`
1025
1021
  display: block;
1026
1022
  width: 100%;
1027
- `;import kd from"styled-components";var Hn=kd.div`
1023
+ `;import Pd from"styled-components";var jn=Pd.div`
1028
1024
  flex-direction: column;
1029
1025
  justify-content: center;
1030
1026
  display: flex;
1031
- `;import ot from"react";import tt from"styled-components";var jn=tt.div`
1027
+ `;import ot from"react";import tt from"styled-components";var Vn=tt.div`
1032
1028
  border: 1px solid #fafafa;
1033
1029
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
1034
1030
  border-radius: 14px;
@@ -1036,13 +1032,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1036
1032
  display: flex;
1037
1033
  flex-direction: column;
1038
1034
  overflow: hidden;
1039
- `,Vn=tt.div`
1035
+ `,Gn=tt.div`
1040
1036
  display: flex;
1041
1037
  flex-wrap: wrap;
1042
1038
  justify-content: space-between;
1043
1039
  overflow: hidden;
1044
1040
  row-gap: 10px;
1045
- `,Gn=tt.div`
1041
+ `,Kn=tt.div`
1046
1042
  ${e=>k(e)} {
1047
1043
  color: #595959;
1048
1044
  }
@@ -1052,7 +1048,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1052
1048
  line-height: 12px;
1053
1049
  letter-spacing: 0.09em;
1054
1050
  margin-bottom: 12px;
1055
- `,Kn=tt.div`
1051
+ `,qn=tt.div`
1056
1052
  ${e=>k(e)} {
1057
1053
  // Anything inside this block will be ignored if the user provides a custom class
1058
1054
  background: #ffffff;
@@ -1065,7 +1061,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1065
1061
 
1066
1062
  max-width: 150px;
1067
1063
  min-width: 200px;
1068
- `,qn=tt.div`
1064
+ `,Yn=tt.div`
1069
1065
  ${e=>k(e)} {
1070
1066
  background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
1071
1067
  }
@@ -1077,13 +1073,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1077
1073
  justify-content: center;
1078
1074
  align-content: center;
1079
1075
  align-items: center;
1080
- `,Yn=tt.div`
1076
+ `,Xn=tt.div`
1081
1077
  font-weight: 600;
1082
1078
  font-size: 20px;
1083
1079
  line-height: 24px;
1084
1080
  width: 20px;
1085
1081
  height: 20px;
1086
- `,Xn=tt.div`
1082
+ `,Jn=tt.div`
1087
1083
  ${e=>k(e)} {
1088
1084
  color: #434343;
1089
1085
  }
@@ -1092,20 +1088,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1092
1088
  line-height: 17px;
1093
1089
  margin-top: 12px;
1094
1090
  margin-bottom: 8px;
1095
- `,Jn=tt.div`
1091
+ `,Qn=tt.div`
1096
1092
  ${e=>k(e)} {
1097
1093
  color: #8c8c8c;
1098
1094
  }
1099
1095
  font-weight: 400;
1100
1096
  font-size: 12px;
1101
1097
  line-height: 14px;
1102
- `,Qn=tt.a`
1098
+ `,Zn=tt.a`
1103
1099
  color: ${e=>e.color};
1104
1100
  font-size: 12px;
1105
1101
  line-height: 14px;
1106
1102
  font-weight: 400;
1107
1103
  cursor: pointer;
1108
- `;var Pd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(jn,{style:t,className:a("guideContainer",r)},ot.createElement(Gn,{className:a("guideTitle",r)},o),ot.createElement(Vn,{className:a("guideItemContainer",r)},e.map((p,c)=>ot.createElement(Kn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&ot.createElement(qn,{className:a("guideIcon",r)},ot.createElement(Yn,null,p.icon)),ot.createElement(Xn,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:se(p.title)}),ot.createElement(Jn,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:se(p.subtitle)}),ot.createElement(Qn,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},uo=Pd;var Bd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:l,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let F=({stepData:m,handleSecondaryCTAClick:P,handleCTAClick:w})=>m?U.createElement(On,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},U.createElement(Ln,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:se(m.title)}),U.createElement(Dn,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:se(m.subtitle)}),U.createElement($n,{className:a("checklistCTAContainer",l)},m.secondaryButtonTitle&&U.createElement(R,{title:m.secondaryButtonTitle,onClick:P,appearance:l,secondary:!0}),U.createElement(R,{title:m.primaryButtonTitle,onClick:w,appearance:l}))):U.createElement(U.Fragment,null),S={...{default:m=>{var O;if((O=e[T])!=null&&O.StepContent){let N=e[T].StepContent;return U.createElement("div",null,N)}let P=e[T];return U.createElement(F,{stepData:m,handleCTAClick:()=>{P.handlePrimaryButtonClick&&P.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{P.handleSecondaryButtonClick&&P.handleSecondaryButtonClick()}})}},...c},[f,B]=vd(0),T=s??f,h=p??B,A=()=>{var m;return e?!((m=e[T])!=null&&m.type)||!S[e[T].type]?S.default(e[T]):S[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):U.createElement(U.Fragment,null)},b=e.filter(m=>m.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Br.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Br),U.createElement(He,{onClose:n,visible:r,appearance:l},U.createElement(_n,null,U.createElement(kn,null,U.createElement(Pn,{appearance:l,className:a("checklistTitle",l)},t),U.createElement(vn,{appearance:l,className:a("checklistSubtitle",l)},o)),U.createElement(Fn,null,e&&e.length>0&&U.createElement(Bn,{className:a("stepsContainer",l)},U.createElement(En,null,U.createElement("div",{style:{flex:3}},U.createElement(An,{className:a("stepsTitle",l)},i)),U.createElement(Wn,null,U.createElement(De,{style:{width:"100%"},count:b,total:e.length,appearance:l}))),U.createElement(In,null,U.createElement(Nn,{className:a("checklistStepListContainer",l),appearance:l},e.map((m,P)=>{let w=T===P;return U.createElement(Mn,{selected:w,className:a(`checklistStepListItem${w?"Selected":""}`,l),key:`checklist-guide-step-${m.id??P}`,disabled:m.blocked,onClick:()=>{m.blocked||h(P)},title:m.blocked?"Finish remaining steps to continue":void 0},w&&U.createElement(zo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),U.createElement(Un,{selected:w,className:a(`checklistStepListStepName${w?"Selected":""}`,l)},m.stepName),U.createElement(zn,null,U.createElement(Qe,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),U.createElement(Hn,null,U.createElement(Gt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),U.createElement(A,null))),g&&g.length>0&&U.createElement(uo,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(x&&x(m),!0)}))))):U.createElement(U.Fragment,null)},Er=Bd;import ve,{useEffect as ms,useState as Ed}from"react";import Ce from"react";import rt from"styled-components";var Zn=rt.div`
1104
+ `;var vd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(Vn,{style:t,className:a("guideContainer",r)},ot.createElement(Kn,{className:a("guideTitle",r)},o),ot.createElement(Gn,{className:a("guideItemContainer",r)},e.map((p,c)=>ot.createElement(qn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&ot.createElement(Yn,{className:a("guideIcon",r)},ot.createElement(Xn,null,p.icon)),ot.createElement(Jn,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:ne(p.title)}),ot.createElement(Qn,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:ne(p.subtitle)}),ot.createElement(Zn,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},go=vd;var Ed=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:l,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let F=({stepData:m,handleSecondaryCTAClick:P,handleCTAClick:w})=>m?M.createElement(Ln,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},M.createElement(Dn,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ne(m.title)}),M.createElement($n,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ne(m.subtitle)}),M.createElement(Mn,{className:a("checklistCTAContainer",l)},m.secondaryButtonTitle&&M.createElement(Z,{title:m.secondaryButtonTitle,onClick:P,appearance:l,secondary:!0}),M.createElement(Z,{title:m.primaryButtonTitle,onClick:w,appearance:l}))):M.createElement(M.Fragment,null),b={...{default:m=>{var O;if((O=e[T])!=null&&O.StepContent){let N=e[T].StepContent;return M.createElement("div",null,N)}let P=e[T];return M.createElement(F,{stepData:m,handleCTAClick:()=>{P.handlePrimaryButtonClick&&P.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{P.handleSecondaryButtonClick&&P.handleSecondaryButtonClick()}})}},...c},[f,B]=Bd(0),T=s??f,h=p??B,I=()=>{var m;return e?!((m=e[T])!=null&&m.type)||!b[e[T].type]?b.default(e[T]):b[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):M.createElement(M.Fragment,null)},y=e.filter(m=>m.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Er.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Er),M.createElement(je,{onClose:n,visible:r,appearance:l},M.createElement(Hn,null,M.createElement(Pn,null,M.createElement(vn,{appearance:l,className:a("checklistTitle",l)},t),M.createElement(Bn,{appearance:l,className:a("checklistSubtitle",l)},o)),M.createElement(kn,null,e&&e.length>0&&M.createElement(En,{className:a("stepsContainer",l)},M.createElement(An,null,M.createElement("div",{style:{flex:3}},M.createElement(In,{className:a("stepsTitle",l)},i)),M.createElement(_n,null,M.createElement($e,{style:{width:"100%"},count:y,total:e.length,appearance:l}))),M.createElement(Nn,null,M.createElement(On,{className:a("checklistStepListContainer",l),appearance:l},e.map((m,P)=>{let w=T===P;return M.createElement(Un,{selected:w,className:a(`checklistStepListItem${w?"Selected":""}`,l),key:`checklist-guide-step-${m.id??P}`,disabled:m.blocked,onClick:()=>{m.blocked||h(P)},title:m.blocked?"Finish remaining steps to continue":void 0},w&&M.createElement(Wo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),M.createElement(zn,{selected:w,className:a(`checklistStepListStepName${w?"Selected":""}`,l)},m.stepName),M.createElement(Wn,null,M.createElement(Qe,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),M.createElement(jn,null,M.createElement(Gt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),M.createElement(I,null))),g&&g.length>0&&M.createElement(go,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(x&&x(m),!0)}))))):M.createElement(M.Fragment,null)},Ar=Ed;import Ee,{useEffect as us,useState as Ad}from"react";import xe from"react";import rt from"styled-components";var Rn=rt.div`
1109
1105
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1110
1106
  border: 1px solid;
1111
1107
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -1117,19 +1113,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1117
1113
  display: flex;
1118
1114
  flex-direction: column;
1119
1115
  transition: max-height 0.25s;
1120
- `,Rn=rt.div`
1116
+ `,es=rt.div`
1121
1117
  display: flex;
1122
1118
  margin-bottom: 20px;
1123
- `,es=rt.img`
1119
+ `,ts=rt.img`
1124
1120
  border-radius: 4px;
1125
1121
  max-height: 260px;
1126
1122
  min-height: 200px;
1127
- `,ts=rt.div`
1123
+ `,os=rt.div`
1128
1124
  display: flex;
1129
1125
  flex-direction: row;
1130
1126
  justify-content: space-between;
1131
1127
  align-items: center;
1132
- `,os=rt.p`
1128
+ `,rs=rt.p`
1133
1129
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1134
1130
  font-style: normal;
1135
1131
  font-weight: 500;
@@ -1140,23 +1136,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1140
1136
  :hover {
1141
1137
  opacity: 0.8;
1142
1138
  }
1143
- `,rs=rt.div`
1139
+ `,is=rt.div`
1144
1140
  cursor: pointer;
1145
1141
  color: ${e=>e.appearance.theme.colorTextSecondary};
1146
1142
  :hover {
1147
1143
  opacity: 0.8;
1148
1144
  }
1149
- `,my=rt.div``,is=rt.p`
1145
+ `,uy=rt.div``,ns=rt.p`
1150
1146
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1151
1147
  font-weight: 400;
1152
1148
  font-size: 14px;
1153
1149
  line-height: 22px;
1154
- `,ns=rt.div`
1150
+ `,ss=rt.div`
1155
1151
  display: flex;
1156
1152
  flex-direction: row;
1157
1153
  justify-content: flex-start;
1158
1154
  align-items: center;
1159
- `;var ss=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){return Ce.createElement(Ce.Fragment,null,e.imageUri||e.videoUri?Ce.createElement(Rn,{className:a("stepMediaContainer",n)},e.imageUri?Ce.createElement(es,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Ce.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,Ce.createElement(is,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:se(e.subtitle)}),Ce.createElement(Eo,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?Ce.createElement(R,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,Ce.createElement(R,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let x=s[e.type];return x?x(e,n):null}return Ce.createElement(Zn,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},Ce.createElement(ts,{className:a("stepHeader",n)},Ce.createElement(ns,null,Ce.createElement(Uo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),Ce.createElement(os,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:se(e.title),onClick:()=>o()})),Ce.createElement(rs,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},Ce.createElement(Gt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),Ce.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Kt from"styled-components";var ky=Kt.div`
1155
+ `;var ls=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){return xe.createElement(xe.Fragment,null,e.imageUri||e.videoUri?xe.createElement(es,{className:a("stepMediaContainer",n)},e.imageUri?xe.createElement(ts,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?xe.createElement(Ge,{appearance:n,videoUri:e.videoUri}):null):null,xe.createElement(ns,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:ne(e.subtitle)}),xe.createElement(Ao,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?xe.createElement(Z,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,xe.createElement(Z,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let x=s[e.type];return x?x(e,n):null}return xe.createElement(Rn,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},xe.createElement(os,{className:a("stepHeader",n)},xe.createElement(ss,null,xe.createElement(zo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),xe.createElement(rs,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:ne(e.title),onClick:()=>o()})),xe.createElement(is,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},xe.createElement(Gt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),xe.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Kt from"styled-components";var Py=Kt.div`
1160
1156
  background: #ffffff;
1161
1157
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
1162
1158
  border-radius: 6px;
@@ -1170,26 +1166,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1170
1166
 
1171
1167
  max-width: 800px;
1172
1168
  min-width: 350px;
1173
- `,ls=Kt.div`
1169
+ `,as=Kt.div`
1174
1170
  display: flex;
1175
1171
  flex-direction: column;
1176
- `,as=Kt.h1`
1172
+ `,ps=Kt.h1`
1177
1173
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1178
1174
  font-style: normal;
1179
1175
  font-weight: 700;
1180
1176
  font-size: 20px;
1181
1177
  line-height: 24px;
1182
1178
  margin-bottom: 8px;
1183
- `,ps=Kt.h2`
1179
+ `,ds=Kt.h2`
1184
1180
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
1185
1181
  font-weight: 400;
1186
1182
  font-size: 14px;
1187
1183
  line-height: 23px;
1188
1184
  margin: 2px 0 0 0;
1189
- `,ds=Kt.div`
1185
+ `,cs=Kt.div`
1190
1186
  display: block;
1191
1187
  width: 100%;
1192
- `,cs=Kt.div`
1188
+ `,ms=Kt.div`
1193
1189
  display: flex;
1194
1190
  width: 100%;
1195
1191
  flex-direction: column;
@@ -1197,23 +1193,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1197
1193
  padding: 24px;
1198
1194
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1199
1195
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1200
- `;var Ad=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:F,style:y})=>{let S=o.filter(b=>b.complete).length,[f,B]=Ed(Array(o.length).fill(!0));ms(()=>{let b=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){b[m]=!1;break}B(b)}},[]),ms(()=>{T(c)},[c]);let T=b=>{let m=[...f];if(s)for(let P=0;P<f.length;++P)P!==b&&(m[P]=!0);m[b]=!m[b],B(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let h=ve.createElement(ve.Fragment,null,ve.createElement(ls,null,ve.createElement(as,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:se(e)}),ve.createElement(ps,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:se(t)})),ve.createElement(De,{display:"percent",count:S,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(ds,{className:he(a("checklistContainer",g),x)},o.map((b,m)=>{let P=f[m];return ve.createElement(ss,{appearance:g,stepData:b,collapsed:P,key:`modal-checklist-${b.id??m}`,onClick:()=>{if(c===m){T(m);return}l(m)},onPrimaryButtonClick:()=>{b.handlePrimaryButtonClick&&b.handlePrimaryButtonClick(),p&&!b.completionCriteria&&m<f.length-1&&f[m+1]&&l(m+1)},onSecondaryButtonClick:()=>{b.handleSecondaryButtonClick&&b.handleSecondaryButtonClick()},customStepTypes:F})}));return d==="inline"?ve.createElement(cs,{appearance:g,className:he(a("checklistInlineContainer",g),x),style:y},h,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:h},A))},Ar=Ad;import le,{useEffect as Ir,useRef as Ud,useState as Pt}from"react";import{useEffect as Id,useState as Nd}from"react";var us=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=Nd(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,l])=>{if(!window)return[c,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return Id(()=>{s()},[]),o};import qt from"react";import de,{css as fs,keyframes as gs}from"styled-components";var xs=fs`
1196
+ `;var Id=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:F,style:S})=>{let b=o.filter(y=>y.complete).length,[f,B]=Ad(Array(o.length).fill(!0));us(()=>{let y=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){y[m]=!1;break}B(y)}},[]),us(()=>{T(c)},[c]);let T=y=>{let m=[...f];if(s)for(let P=0;P<f.length;++P)P!==y&&(m[P]=!0);m[y]=!m[y],B(m)};if(!r&&d=="modal")return Ee.createElement(Ee.Fragment,null);let h=Ee.createElement(Ee.Fragment,null,Ee.createElement(as,null,Ee.createElement(ps,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:ne(e)}),Ee.createElement(ds,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:ne(t)})),Ee.createElement($e,{display:"percent",count:b,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),I=Ee.createElement(cs,{className:ge(a("checklistContainer",g),x)},o.map((y,m)=>{let P=f[m];return Ee.createElement(ls,{appearance:g,stepData:y,collapsed:P,key:`modal-checklist-${y.id??m}`,onClick:()=>{if(c===m){T(m);return}l(m)},onPrimaryButtonClick:()=>{y.handlePrimaryButtonClick&&y.handlePrimaryButtonClick(),p&&!y.completionCriteria&&m<f.length-1&&f[m+1]&&l(m+1)},onSecondaryButtonClick:()=>{y.handleSecondaryButtonClick&&y.handleSecondaryButtonClick()},customStepTypes:F})}));return d==="inline"?Ee.createElement(ms,{appearance:g,className:ge(a("checklistInlineContainer",g),x),style:S},h,I):Ee.createElement(Ee.Fragment,null,Ee.createElement(je,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:h},I))},Ir=Id;import se,{useEffect as Nr,useRef as zd,useState as kt}from"react";import{useEffect as Nd,useState as Od}from"react";var fs=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=Od(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,l])=>{if(!window)return[c,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return Nd(()=>{s()},[]),o};import qt from"react";import ae,{css as gs,keyframes as xs}from"styled-components";var hs=gs`
1201
1197
  border: 1px solid ${({theme:e})=>e.colorBorder};
1202
- `,Od=fs`
1203
- box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
1204
1198
  `,Ld=gs`
1199
+ box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
1200
+ `,Dd=xs`
1205
1201
  from {
1206
1202
  opacity: 0;
1207
1203
  } to {
1208
1204
  opacity: 1;
1209
1205
  }
1210
- `,Dd=gs`
1206
+ `,$d=xs`
1211
1207
  from {
1212
1208
  opacity: 1;
1213
1209
  } to {
1214
1210
  opacity: 0;
1215
1211
  }
1216
- `,hs=de.div`
1212
+ `,Cs=ae.div`
1217
1213
  margin: 0 -20px;
1218
1214
  overflow-x: auto;
1219
1215
  padding-left: 20px;
@@ -1230,14 +1226,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1230
1226
  ::-webkit-scrollbar {
1231
1227
  display: none;
1232
1228
  }
1233
- `,Cs=de.div`
1229
+ `,ys=ae.div`
1234
1230
  display: flex;
1235
1231
  flex-flow: row nowrap;
1236
1232
  gap: 0 16px;
1237
1233
  scroll-snap-align: center;
1238
1234
  scroll-snap-stop: always;
1239
- `,ys=de.div`
1240
- animation: ${e=>e.reversed?Dd:Ld} 0.25s ease-out;
1235
+ `,Ss=ae.div`
1236
+ animation: ${e=>e.reversed?$d:Dd} 0.25s ease-out;
1241
1237
  background: linear-gradient(
1242
1238
  to right,
1243
1239
  ${({theme:e})=>e.colorBackground}00,
@@ -1246,8 +1242,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1246
1242
  position: absolute;
1247
1243
  width: 64px;
1248
1244
  z-index: 10;
1249
- `,Ss=de.button`
1250
- ${xs}
1245
+ `,bs=ae.button`
1246
+ ${hs}
1251
1247
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
1252
1248
  align-items: center;
1253
1249
  border-radius: 50%;
@@ -1258,11 +1254,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1258
1254
  justify-content: center;
1259
1255
  position: absolute;
1260
1256
  width: 48px;
1261
- `,bs=de.div`
1257
+ `,ws=ae.div`
1262
1258
  border-radius: ${({theme:e})=>e.borderRadius}px;
1263
1259
  padding: 20px;
1264
- `,ws=de(bs)`
1265
- ${xs}
1260
+ `,Ts=ae(ws)`
1261
+ ${hs}
1266
1262
  background: ${({theme:e})=>e.colorBackground};
1267
1263
  position: relative;
1268
1264
 
@@ -1274,86 +1270,86 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1274
1270
  ${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
1275
1271
  ${e=>e.blocked?"cursor: default":"cursor: pointer"}
1276
1272
  }
1277
- `,Ts=de.img`
1273
+ `,Fs=ae.img`
1278
1274
  border-radius: 50%;
1279
1275
  height: 40px;
1280
1276
  margin-bottom: 12px;
1281
1277
  width: 40px;
1282
- `,Fs=de(bs)`
1278
+ `,ks=ae(ws)`
1283
1279
  ${e=>k(e)} {
1284
- ${Od}
1280
+ ${Ld}
1285
1281
 
1286
1282
  background: ${({theme:e})=>e.colorBackground};
1287
1283
  }
1288
- `,Hy=de.div`
1284
+ `,jy=ae.div`
1289
1285
  color: ${({theme:e})=>e.colorPrimary};
1290
1286
  display: flex;
1291
1287
  flex-flow: row nowrap;
1292
1288
  align-items: center;
1293
- `,jy=de.div`
1289
+ `,Vy=ae.div`
1294
1290
  white-space: nowrap;
1295
- `,ks=de.div`
1291
+ `,Ps=ae.div`
1296
1292
  background: #d8fed8;
1297
1293
  border-radius: 6px;
1298
1294
  float: right;
1299
1295
  margin-bottom: 12px;
1300
1296
  padding: 4px 10px;
1301
- `,$d=de.p`
1297
+ `,Md=ae.p`
1302
1298
  font-weight: bold;
1303
1299
  font-size: 18px;
1304
1300
  line-height: 22px;
1305
1301
  letter-spacing: calc(18px * -0.01);
1306
1302
  margin: 0;
1307
- `,Ps=de($d)`
1303
+ `,vs=ae(Md)`
1308
1304
  margin-bottom: 4px;
1309
- `,vs=de.div`
1305
+ `,Bs=ae.div`
1310
1306
  display: flex;
1311
1307
  flex-flow: row nowrap;
1312
1308
  align-items: center;
1313
1309
  min-width: 50%;
1314
- `,Md=de.p`
1310
+ `,Ud=ae.p`
1315
1311
  font-weight: bold;
1316
1312
  font-size: 16px;
1317
1313
  line-height: 20px;
1318
1314
  letter-spacing: calc(16px * -0.01);
1319
1315
  margin: 0;
1320
- `,Bs=de(Md)`
1316
+ `,Es=ae(Ud)`
1321
1317
  margin-bottom: 4px;
1322
1318
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1323
1319
  `}
1324
- `,ct=de.p`
1320
+ `,ct=ae.p`
1325
1321
  color: ${({theme:e})=>e.colorText};
1326
1322
  font-weight: normal;
1327
1323
  font-size: 14px;
1328
1324
  line-height: 22px;
1329
1325
  margin: 0;
1330
- `,Es=de.p`
1326
+ `,As=ae.p`
1331
1327
  color: ${({theme:e})=>e.colorText};
1332
1328
  font-weight: 600;
1333
1329
  font-size: 12px;
1334
1330
  line-height: 16px;
1335
1331
  margin: 0;
1336
- `;ct.Loud=de(ct)`
1332
+ `;ct.Loud=ae(ct)`
1337
1333
  font-weight: 600;
1338
- `;ct.Quiet=de(ct)`
1334
+ `;ct.Quiet=ae(ct)`
1339
1335
  color: ${({theme:e})=>e.colorTextSecondary};
1340
1336
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1341
1337
  `}
1342
- `;var As=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Z(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return qt.createElement(ws,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&qt.createElement(Ts,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&qt.createElement(ks,{className:a("carouselCompletedPill",o)},qt.createElement(Es,{style:{color:"#108E0B"}},"Complete")),p&&qt.createElement(Bs,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&qt.createElement(ct.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var zd=()=>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"})),Is=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=Pt(!1),[n,s]=Pt(!1);Ir(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?le.createElement(ys,{style:c,reversed:n,onAnimationEnd:n?p:null},le.createElement(Ss,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(zd,null))):null},Ns=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Ud(null),[n,s]=Pt(!1),[p,c]=Pt(!1),[l,g]=Pt(null),[d,x]=Pt([]),[F,y]=Pt(0),{isSmall:S}=us(),f=S?1:3,{getFlowMetadata:B,getFlowSteps:T,getNumberOfStepsCompleted:h,updateCustomVariables:A,isLoading:b}=J();Ir(()=>{A(o)},[o,b]),Ir(()=>{if(b)return;let N=B(e),I=h(e),$=T(e);g(N),N.data!==null&&(x($.sort((D,K)=>Number(D.complete)-Number(K.complete))),c($.length>f),y(I))},[b]);let m=[];for(let N=0;N<d.length;N+=f)m.push(d.slice(N,N+f));let P=N=>{let I=N.target,$=I.scrollWidth-I.clientWidth,D=Math.ceil(I.scrollLeft);D>0&&n===!1&&s(!0),D===0&&n===!0&&s(!1),D<$&&p===!1&&c(!0),D===$&&p===!0&&c(!1)},w=(N=!0)=>{let I=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*I,behavior:"smooth"})},E=null,O=N=>{E!==null?clearTimeout(E):P(N),E=setTimeout(()=>{P(N)},16)};return b?null:le.createElement(Fs,{className:he(a("carouselContainer",t),i)},le.createElement("div",{style:{display:"flex",justifyContent:S?"center":"space-between",marginBottom:20,flexWrap:S?"wrap":"nowrap",gap:S?16:20}},le.createElement("div",null,le.createElement(Ps,{className:a("carouselTitle",t)},l==null?void 0:l.title),le.createElement(ct.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),le.createElement(vs,{className:a("progressWrapper",t)},le.createElement(De,{count:F,total:d.length,appearance:t}))),le.createElement("div",{style:{position:"relative"}},le.createElement(Is,{show:n,onClick:()=>w(!1)}),le.createElement(Is,{side:"right",show:p,onClick:w}),le.createElement(hs,{ref:r,onScroll:O},m.map((N,I)=>le.createElement(Cs,{key:I,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},N.map(($,D)=>le.createElement(As,{key:D,stepData:$,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),le.createElement(oe,{appearance:t}))};var Nr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:F,setVisible:y,customStepTypes:S,checklistStyle:f="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:T,...h})=>{let{getFlow:A,getFlowSteps:b,markStepCompleted:m,getStepStatus:P,getNumberOfStepsCompleted:w,isLoading:E,targetingLogicShouldHideFlow:O,updateCustomVariables:N,getFlowMetadata:I,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:K,setHasActiveFullPageFlow:z}=J(),{primaryCTAClickSideEffects:q,secondaryCTAClickSideEffects:ue}=ie(),{getOpenFlowState:fe,setOpenFlowState:W}=be(),[V,re]=Ls(r||0),[Ne,Be]=Ls(!1),xe=c===void 0?fe(e):c,Q=s==="modal",{mergeAppearanceWithDefault:Fe}=Z();if(x=Fe(x),Os(()=>{N(l)},[l,E]),Os(()=>{c!==void 0&&(Q&&c===!0?z(!0):Q&&c===!1&&z(!1))},[c,y,K]),E)return null;let te=A(e);if(!te||O(te))return null;let L=b(e);if(!L||F===!0&&D(e)===X)return null;let M=I(e);if(M!=null&&M.title&&(t=M.title),M!=null&&M.subtitle&&(o=M.subtitle),!Ne&&r===void 0&&w(e)>0){let u=L.findIndex(C=>C.complete===!1);re(u>-1?u:L.length-1),Be(!0)}function j(){if(V+1>=L.length){Q&&W(e,!1);return}$(e,L[V+1].id)||re(V+1)}function ae(u,C,v){let _=V+1<L.length?L[V+1]:null;d&&d(u,V,C,_)===!0&&Q&&$e(),g&&g(u,v,_),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&Q&&$e()}function ne(){return L.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{j(),ue(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ae(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),j()),ae(u,"primary",C),q(u),P(e,u.id)===Ue&&j()}}))}function pe(){return me.createElement(oe,{appearance:x})}let Ye={steps:ne(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:S,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:T};function $e(){W(e,!1),p&&p(),y&&y(!1)}function At(){return me.createElement(me.Fragment,null,me.createElement(pe,null),me.createElement(Ns,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return me.createElement(me.Fragment,null,me.createElement(pe,null),me.createElement(Ar,{visible:xe,onClose:()=>{$e()},selectedStep:V,setSelectedStep:re,autoExpandNextStep:!0,appearance:x,...Ye}))}function It(){let u=h.guideFlowId,C;return u&&A(u)&&(C=b(u)),me.createElement(me.Fragment,null,me.createElement(pe,null),me.createElement(Er,{visible:xe,stepsTitle:M.stepsTitle?M.stepsTitle:"Your quick start guide",onClose:()=>{$e()},selectedStep:V,setSelectedStep:re,guideData:C,guideTitle:h.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{ae(v,"link",0)},customStepTypes:S,...Ye}))}function gt(){let u=me.createElement(vr,{flowId:e,style:i,selectedStep:V,setSelectedStep:re,appearance:x,type:s,...Ye});return Q?me.createElement(He,{onClose:()=>{$e()},visible:xe,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},me.createElement(pe,null),u):me.createElement(me.Fragment,null,me.createElement(pe,null),u)}switch(f){case"condensed":return ft();case"with-guide":return It();case"default":return gt();case"carousel":return At();default:return gt()}};var _d=e=>Wd.createElement(Nr,{type:"inline",...e});import ut,{useEffect as Hd}from"react";import Ke from"react";import Vo from"styled-components";var Ds=Vo.div`
1338
+ `;var Is=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Q(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return qt.createElement(Ts,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&qt.createElement(Fs,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&qt.createElement(Ps,{className:a("carouselCompletedPill",o)},qt.createElement(As,{style:{color:"#108E0B"}},"Complete")),p&&qt.createElement(Es,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&qt.createElement(ct.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var Wd=()=>se.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),se.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),se.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Ns=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=kt(!1),[n,s]=kt(!1);Nr(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?se.createElement(Ss,{style:c,reversed:n,onAnimationEnd:n?p:null},se.createElement(bs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},se.createElement(Wd,null))):null},Os=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=zd(null),[n,s]=kt(!1),[p,c]=kt(!1),[l,g]=kt(null),[d,x]=kt([]),[F,S]=kt(0),{isSmall:b}=fs(),f=b?1:3,{getFlowMetadata:B,getFlowSteps:T,getNumberOfStepsCompleted:h,updateCustomVariables:I,isLoading:y}=J();Nr(()=>{I(o)},[o,y]),Nr(()=>{if(y)return;let N=B(e),A=h(e),D=T(e);g(N),N.data!==null&&(x(D.sort(($,j)=>Number($.complete)-Number(j.complete))),c(D.length>f),S(A))},[y]);let m=[];for(let N=0;N<d.length;N+=f)m.push(d.slice(N,N+f));let P=N=>{let A=N.target,D=A.scrollWidth-A.clientWidth,$=Math.ceil(A.scrollLeft);$>0&&n===!1&&s(!0),$===0&&n===!0&&s(!1),$<D&&p===!1&&c(!0),$===D&&p===!0&&c(!1)},w=(N=!0)=>{let A=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*A,behavior:"smooth"})},E=null,O=N=>{E!==null?clearTimeout(E):P(N),E=setTimeout(()=>{P(N)},16)};return y?null:se.createElement(ks,{className:ge(a("carouselContainer",t),i)},se.createElement("div",{style:{display:"flex",justifyContent:b?"center":"space-between",marginBottom:20,flexWrap:b?"wrap":"nowrap",gap:b?16:20}},se.createElement("div",null,se.createElement(vs,{className:a("carouselTitle",t)},l==null?void 0:l.title),se.createElement(ct.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),se.createElement(Bs,{className:a("progressWrapper",t)},se.createElement($e,{count:F,total:d.length,appearance:t}))),se.createElement("div",{style:{position:"relative"}},se.createElement(Ns,{show:n,onClick:()=>w(!1)}),se.createElement(Ns,{side:"right",show:p,onClick:w}),se.createElement(Cs,{ref:r,onScroll:O},m.map((N,A)=>se.createElement(ys,{key:A,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},N.map((D,$)=>se.createElement(Is,{key:$,stepData:D,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),se.createElement(te,{appearance:t}))};var Or=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:F,setVisible:S,customStepTypes:b,checklistStyle:f="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:T,...h})=>{let{getFlow:I,getFlowSteps:y,markStepCompleted:m,getStepStatus:P,getNumberOfStepsCompleted:w,isLoading:E,targetingLogicShouldHideFlow:O,updateCustomVariables:N,getFlowMetadata:A,isStepBlocked:D,getFlowStatus:$,hasActiveFullPageFlow:j,setHasActiveFullPageFlow:H}=J(),{primaryCTAClickSideEffects:V,secondaryCTAClickSideEffects:we}=ie(),{getOpenFlowState:ce,setOpenFlowState:G}=ke(),[re,Y]=Ds(r||0),[Te,le]=Ds(!1),he=c===void 0?ce(e):c,ee=s==="modal",{mergeAppearanceWithDefault:me}=Q();if(x=me(x),Ls(()=>{N(l)},[l,E]),Ls(()=>{c!==void 0&&(ee&&c===!0?H(!0):ee&&c===!1&&H(!1))},[c,S,j]),E)return null;let Fe=I(e);if(!Fe||O(Fe))return null;let L=y(e);if(!L||F===!0&&$(e)===X)return null;let U=A(e);if(U!=null&&U.title&&(t=U.title),U!=null&&U.subtitle&&(o=U.subtitle),!Te&&r===void 0&&w(e)>0){let u=L.findIndex(C=>C.complete===!1);Y(u>-1?u:L.length-1),le(!0)}function Ce(){if(re+1>=L.length){ee&&G(e,!1);return}D(e,L[re+1].id)||Y(re+1)}function z(u,C,v){let W=re+1<L.length?L[re+1]:null;d&&d(u,re,C,W)===!0&&ee&&Me(),g&&g(u,v,W),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&ee&&Me()}function ye(){return L.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{Ce(),we(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),z(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),Ce()),z(u,"primary",C),V(u),P(e,u.id)===ze&&Ce()}}))}function q(){return de.createElement(te,{appearance:x})}let fe={steps:ye(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:b,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:T};function Me(){G(e,!1),p&&p(),S&&S(!1)}function Et(){return de.createElement(de.Fragment,null,de.createElement(q,null),de.createElement(Os,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return de.createElement(de.Fragment,null,de.createElement(q,null),de.createElement(Ir,{visible:he,onClose:()=>{Me()},selectedStep:re,setSelectedStep:Y,autoExpandNextStep:!0,appearance:x,...fe}))}function At(){let u=h.guideFlowId,C;return u&&I(u)&&(C=y(u)),de.createElement(de.Fragment,null,de.createElement(q,null),de.createElement(Ar,{visible:he,stepsTitle:U.stepsTitle?U.stepsTitle:"Your quick start guide",onClose:()=>{Me()},selectedStep:re,setSelectedStep:Y,guideData:C,guideTitle:h.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{z(v,"link",0)},customStepTypes:b,...fe}))}function gt(){let u=de.createElement(Br,{flowId:e,style:i,selectedStep:re,setSelectedStep:Y,appearance:x,type:s,...fe});return ee?de.createElement(je,{onClose:()=>{Me()},visible:he,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},de.createElement(q,null),u):de.createElement(de.Fragment,null,de.createElement(q,null),u)}switch(f){case"condensed":return ft();case"with-guide":return At();case"default":return gt();case"carousel":return Et();default:return gt()}};var Hd=e=>_d.createElement(Or,{type:"inline",...e});import ut,{useEffect as jd}from"react";import qe from"react";import Go from"styled-components";var $s=Go.div`
1343
1339
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1344
1340
  border-radius: 8px;
1345
1341
  padding: 6px 10px 6px 10px;
1346
1342
  min-width: 160px;
1347
1343
  cursor: pointer;
1348
1344
  background-color: ${e=>e.appearance.theme.colorBackground}};
1349
- `,$s=Vo.div`
1345
+ `,Ms=Go.div`
1350
1346
  display: flex;
1351
1347
  flex-direction: row;
1352
1348
  justify-content: space-between;
1353
1349
  align-items: center;
1354
1350
  margin-bottom: 2px;
1355
1351
  flex-grow: 2;
1356
- `,Ms=Vo.div`
1352
+ `,Us=Go.div`
1357
1353
  text-overflow: ellipsis;
1358
1354
  font-weight: 600;
1359
1355
  font-size: 12px;
@@ -1361,13 +1357,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1361
1357
  margin-right: ${e=>e.type==="condensed"?"8px":"0"};
1362
1358
  text-align: ${e=>e.type==="condensed"?"left":"right"};
1363
1359
  color: ${e=>e.appearance.theme.colorPrimary};
1364
- `,Us=Vo.div`
1360
+ `,zs=Go.div`
1365
1361
  width: 20px;
1366
1362
  margin-right: 8px;
1367
1363
  display: flex;
1368
1364
  height: 100%;
1369
1365
  align-items: center;
1370
- `;var zs=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ke.createElement(Ke.Fragment,null,Ke.createElement(oe,{appearance:s}),Ke.createElement(Ds,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:he(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Us,{className:a("progressRingContainer",s)},Ke.createElement(Mt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement($s,{type:p,className:a("badgeTitleContainer",s)},Ke.createElement(Ms,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Ke.createElement(Gt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ke.createElement(De,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import mt from"react";import fo from"styled-components";var Ws=fo.div`
1366
+ `;var Ws=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>qe.createElement(qe.Fragment,null,qe.createElement(te,{appearance:s}),qe.createElement($s,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:ge(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&qe.createElement(zs,{className:a("progressRingContainer",s)},qe.createElement($t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),qe.createElement(Ms,{type:p,className:a("badgeTitleContainer",s)},qe.createElement(Us,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&qe.createElement(Gt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&qe.createElement($e,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import mt from"react";import xo from"styled-components";var _s=xo.div`
1371
1367
  display: flex;
1372
1368
  flex-direction: row;
1373
1369
  width: 100%;
@@ -1378,25 +1374,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1378
1374
  border-width: 1px;
1379
1375
  border-color: ${e=>e.appearance.theme.colorPrimary};
1380
1376
  border-radius: 12px;
1381
- `,_s=fo.div`
1377
+ `,Hs=xo.div`
1382
1378
  ${e=>k(e)} {
1383
1379
  display: flex;
1384
1380
  justify-content: center;
1385
1381
  align-items: center;
1386
1382
  margin-right: 16px;
1387
1383
  }
1388
- `,Hs=fo.div`
1384
+ `,js=xo.div`
1389
1385
  display: flex;
1390
1386
  flex-direction: column;
1391
1387
  flex: 1;
1392
1388
  margin-top: 0;
1393
- `,js=fo.div`
1389
+ `,Vs=xo.div`
1394
1390
  display: flex;
1395
1391
  flex-direction: column;
1396
1392
  justify-content: center;
1397
1393
  margin-left: 16px;
1398
1394
  min-width: 200px;
1399
- `,W0=fo.div`
1395
+ `,_0=xo.div`
1400
1396
  display: flex;
1401
1397
  justify-content: center;
1402
1398
  align-items: flex-end;
@@ -1405,7 +1401,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1405
1401
  :hover {
1406
1402
  opacity: 0.8;
1407
1403
  }
1408
- `;var Vs=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>mt.createElement(mt.Fragment,null,mt.createElement(Ws,{appearance:i,className:he(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&mt.createElement(_s,{className:a("fullWidthProgressBadgeIcon",i)},o),mt.createElement(Hs,null,mt.createElement(Te,{size:"small",appearance:i,title:e,subtitle:t})),mt.createElement(js,{className:a("fullWidthProgressBadgeProgressContainer",i)},mt.createElement(De,{count:r,total:n,display:"percent",textLocation:"top"}))));var jd=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:l,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:F,getNumberOfStepsCompleted:y,isLoading:S,targetingLogicShouldHideFlow:f,updateCustomVariables:B}=J(),{mergeAppearanceWithDefault:T}=Z();l=T(l);let{setOpenFlowState:h,getOpenFlowState:A}=be();if(Hd(()=>{B(p)},[p,S]),S)return null;let b=d(e);if(!b||f(b)||c===!0&&F(e)===X)return null;let m=x(e),P=y(e);return g==="full-width"?ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:l}),ut.createElement(Vs,{title:t,subtitle:o,count:P,total:m.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:l}),ut.createElement(zs,{count:P,total:m.length,title:t,style:r,onClick:()=>{h(e,!0),n&&n()},type:g,className:s,appearance:l}))};import Vd from"react";var Gd=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=J(),{mergeAppearanceWithDefault:p}=Z();o=p(o);let c=r(e);if(!c||n(c))return null;let l=s(e);return Vd.createElement(uo,{steps:l,style:t,appearance:o,...i})};import vt,{useContext as ic,useEffect as nc}from"react";import H,{useEffect as Go,useLayoutEffect as qs,useRef as Qd,useState as go}from"react";import xo from"styled-components";import{useCallback as Kd,useEffect as qd,useState as Yd}from"react";var Or=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function Gs(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=Yd(o),n=Kd(()=>{e&&r(e.getBoundingClientRect())},[e]);return qd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}import{useContext as Xd,useState as Jd}from"react";function Ks(){let{debug:e}=Xd(G),[t,o]=Jd([]);function i(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.log(n)))}function r(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.warn(n)))}return{logIfDebugMode:i,logErrorIfDebugMode:r}}var Ys=300,Xs=100,Zd=500,Yt=12,Rd=xo.div`
1404
+ `;var Gs=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>mt.createElement(mt.Fragment,null,mt.createElement(_s,{appearance:i,className:ge(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&mt.createElement(Hs,{className:a("fullWidthProgressBadgeIcon",i)},o),mt.createElement(js,null,mt.createElement(ve,{size:"small",appearance:i,title:e,subtitle:t})),mt.createElement(Vs,{className:a("fullWidthProgressBadgeProgressContainer",i)},mt.createElement($e,{count:r,total:n,display:"percent",textLocation:"top"}))));var Vd=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:l,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:F,getNumberOfStepsCompleted:S,isLoading:b,targetingLogicShouldHideFlow:f,updateCustomVariables:B}=J(),{mergeAppearanceWithDefault:T}=Q();l=T(l);let{setOpenFlowState:h,getOpenFlowState:I}=ke();if(jd(()=>{B(p)},[p,b]),b)return null;let y=d(e);if(!y||f(y)||c===!0&&F(e)===X)return null;let m=x(e),P=S(e);return g==="full-width"?ut.createElement(ut.Fragment,null,ut.createElement(te,{appearance:l}),ut.createElement(Gs,{title:t,subtitle:o,count:P,total:m.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):ut.createElement(ut.Fragment,null,ut.createElement(te,{appearance:l}),ut.createElement(Ws,{count:P,total:m.length,title:t,style:r,onClick:()=>{h(e,!0),n&&n()},type:g,className:s,appearance:l}))};import Gd from"react";var Kd=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=J(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let c=r(e);if(!c||n(c))return null;let l=s(e);return Gd.createElement(go,{steps:l,style:t,appearance:o,...i})};import Pt,{useContext as nc,useEffect as sc}from"react";import _,{useEffect as Ko,useLayoutEffect as Ys,useRef as Zd,useState as Yt}from"react";import ho from"styled-components";import{useCallback as qd,useEffect as Yd,useState as Xd}from"react";var Lr=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function Ks(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=Xd(o),n=qd(()=>{e&&r(e.getBoundingClientRect())},[e]);return Yd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}import{useContext as Jd,useState as Qd}from"react";function qs(){let{debug:e}=Jd(K),[t,o]=Qd([]);function i(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.log(n)))}function r(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.warn(n)))}return{logIfDebugMode:i,logErrorIfDebugMode:r}}var Xs=300,Js=100,Rd=500,Xt=12,ec=ho.div`
1409
1405
  width: 100%;
1410
1406
  height: 100%;
1411
1407
  border-radius: 9999px;
@@ -1428,25 +1424,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1428
1424
  opacity: 0;
1429
1425
  }
1430
1426
  }
1431
- `,ec=xo.div`
1432
- width: ${Yt}px;
1433
- height: ${Yt}px;
1427
+ `,tc=ho.div`
1428
+ width: ${Xt}px;
1429
+ height: ${Xt}px;
1434
1430
  border-radius: 100px;
1435
1431
  background-color: ${e=>e.primaryColor};
1436
1432
  z-index: 20;
1437
1433
  opacity: 1;
1438
- `,tc=xo.div`
1434
+ `,oc=ho.div`
1439
1435
  pointer-events: all;
1440
- `,Js=xo.div`
1436
+ `,Qs=ho.div`
1441
1437
  display: flex;
1442
1438
  align-content: center;
1443
1439
  justify-content: center;
1444
1440
  align-items: center;
1445
1441
  z-index: ${e=>e.zIndex?e.zIndex:90};
1446
- `,oc=xo(Js)`
1447
- width: ${Yt+12}px;
1448
- height: ${Yt+12}px;
1449
- `,rc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:F,showStepCount:y=!0,completedStepsCount:S=0,showFrigadeBranding:f=!1,cssPosition:B="absolute"})=>{var pe,Ye,$e,At,ft,It,gt,u,C,v,_,ce;let{logErrorIfDebugMode:T}=Ks(),[h,A]=go(),[b,m]=go(new Date),P=Qd(null),[w,E]=go(document.querySelector(e[l].selector)),O=Gs(w,b),[N,I]=go(),[$,D]=go(!F),K=(Ye=(pe=e[l])==null?void 0:pe.props)!=null&&Ye.position?e[l].props.position:B,z=((At=($e=e[l])==null?void 0:$e.props)==null?void 0:At.zIndex)??90,q=(h==null?void 0:h.width)??Ys,ue=(h==null?void 0:h.height)??Xs,fe=window.location.pathname.split("/").pop();qs(()=>{P.current&&A({width:P.current.clientWidth,height:P.current.clientHeight})},[l,b,K]),Go(()=>{F||D(!0)},[l]);let W=()=>{let Y=document.querySelector(e[l].selector);if(!Y){I(void 0),E(null),T(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}N&&N===JSON.stringify(Y==null?void 0:Y.getBoundingClientRect())||(E(Y),m(new Date),Y&&I(JSON.stringify(Y.getBoundingClientRect())))};if(Go(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0}),()=>Y.disconnect()},[W]),Go(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Y.disconnect()},[W]),Go(()=>{let Y=setInterval(()=>{W()},10);return()=>clearInterval(Y)},[W]),qs(()=>{setTimeout(()=>{W()},Zd),W()},[l,fe]),w===null||!p||O.height===0&&O.width===0&&K!=="fixed"&&B!=="static")return null;let V=i==="auto"?"right":i,re=Or(O,V,q,s,K),Ne=O.right+q>(window.innerWidth||document.documentElement.clientWidth),Be=O.bottom+Xs>(window.innerHeight||document.documentElement.clientHeight);Ne&&i==="auto"&&(re=Or(O,"left",q,s,K),V="left"),(It=(ft=e[l])==null?void 0:ft.props)!=null&&It.tooltipPosition&&((u=(gt=e[l])==null?void 0:gt.props)==null?void 0:u.tooltipPosition)!=="auto"&&(((v=(C=e[l])==null?void 0:C.props)==null?void 0:v.tooltipPosition)==="left"||((ce=(_=e[l])==null?void 0:_.props)==null?void 0:ce.tooltipPosition)==="right")&&(V=e[l].props.tooltipPosition);let xe=()=>{let Y=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),D(!1),setTimeout(()=>{W()},30)),S===e.length-1)return o()},nt=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&!e[l].secondaryButtonUri&&D(!1))};return H.createElement(H.Fragment,null,y&&e.length>1&&H.createElement(ei,null,H.createElement(oi,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&H.createElement(ti,{showStepCount:y,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&H.createElement(R,{title:e[l].secondaryButtonTitle,appearance:d,onClick:nt,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&H.createElement(R,{title:e[l].primaryButtonTitle,appearance:d,onClick:Y,withMargin:!1,size:"small"})))},Q=()=>H.createElement(H.Fragment,null,x&&H.createElement(Xr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},H.createElement(we,null)),e[l].imageUri&&H.createElement(Jr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&H.createElement(Qr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},H.createElement(Ve,{appearance:d,videoUri:e[l].videoUri})),H.createElement(Rr,{className:a("tooltipContentContainer",d)},H.createElement(Te,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),H.createElement(Zr,{className:a("tooltipFooter",d)},H.createElement(xe,null)))),te={...{default:Y=>{var nt;if((nt=e[l])!=null&&nt.StepContent){let Ll=e[l].StepContent;return H.createElement("div",null,Ll)}return H.createElement(Q,null)}},...g},L=()=>{var Y;return e?!((Y=e[l])!=null&&Y.type)||!te[e[l].type]?te.default(e[l]):te[e[l].type]({stepData:e[l],primaryColor:n}):H.createElement(H.Fragment,null)};if(F&&e[l].complete===!0)return null;let M={top:(re==null?void 0:re.y)-Yt,left:(V=="left"?O.x+s.x:(re==null?void 0:re.x)-Yt)??0,cursor:F?"pointer":"default",position:K},j=()=>{let nt=M.left+(V=="left"?-q:24);return Math.min(Math.max(nt,20),window.innerWidth-q-20)},ae=()=>{if(K==="fixed")return M.top;let Y=M.top+ue,nt=20;return Y>window.innerHeight-nt?M.top+-ue:M.top},ne=()=>{F&&(m(new Date),D(!$))};return H.createElement(tc,null,H.createElement(oc,{style:M,zIndex:z,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&B!=="static"&&H.createElement(H.Fragment,null,H.createElement(ec,{style:{position:K},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),H.createElement(Rd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),H.createElement(Js,{style:{...M,left:j(),top:ae()},zIndex:z+1,className:a("tooltipContainerWrapper",d)},$&&H.createElement(H.Fragment,null,H.createElement(yo,{ref:P,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:B!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:Ys,zIndex:z+10},H.createElement(L,null)),f&&H.createElement(ii,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:z+10},H.createElement(So,{appearance:d})))))},Lr=rc;import{Portal as sc}from"react-portal";var lc=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:F="absolute",...y})=>{let{getFlow:S,getFlowSteps:f,isLoading:B,targetingLogicShouldHideFlow:T,markStepCompleted:h,markStepStarted:A,markFlowCompleted:b,updateCustomVariables:m,getCurrentStepIndex:P,getStepStatus:w,isStepBlocked:E,getFlowStatus:O,getNumberOfStepsCompleted:N}=J(),{isLoadingUserFlowStateData:I}=Ee(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:K}=be(),z=P(e),{openFlowStates:q}=ic(G),{mergeAppearanceWithDefault:ue}=Z();if(o=ue(o),nc(()=>{m(t)},[t,B]),I)return null;let fe=S(e);if(!fe||T(fe)||O(e)==X||K())return null;let W=f(e);if(Object.keys(q).length>0){let L=Object.keys(q).find(M=>q[M]===!0);if(L!==void 0&&L!==e)return vt.createElement(vt.Fragment,null)}async function V(L){if(await h(e,L.id),W.map(M=>w(e,M.id)).every(M=>M===Ue)){await b(e);return}if(!l&&z+1<W.length){if(E(e,W[z+1].id))return;await A(e,W[z+1].id)}}function re(L,M,j){let ae=z+1<W.length?W[z+1]:null;r&&r(L,z,M,ae),i&&i(L,j,ae)}function Ne(){return W.map(L=>({...L,handleSecondaryButtonClick:async()=>{D(L),L.skippable===!0&&await h(e,L.id,{skipped:!0}),re(L,"secondary",z)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await V(L),re(L,"primary",z),$(L)}}))}async function Be(L){s&&s(),g==="complete-flow"?await b(e):await h(e,L.id)}function xe(){d&&d()}let Q=!document.querySelector(W[z].selector);function Fe(){let L=W.findIndex(M=>!!document.querySelector(M.selector));return W.map((M,j)=>Q&&!n&&j!==L&&x||!n&&j!==z?null:vt.createElement(Lr,{key:M.id,appearance:o,steps:Ne(),selectedStep:j,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>Be(M),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:N(e),onComplete:xe,cssPosition:F,...y}))}function te(){return vt.createElement(vt.Fragment,null,vt.createElement(oe,{appearance:o}),Fe())}return F==="static"?te():vt.createElement(sc,null,te())};import Ie,{useEffect as ac,useRef as pc,useState as dc}from"react";import{Portal as cc}from"react-portal";import Bt from"styled-components";var Qs=Bt.button`
1442
+ `,rc=ho(Qs)`
1443
+ width: ${Xt+12}px;
1444
+ height: ${Xt+12}px;
1445
+ `,ic=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:F,showStepCount:S=!0,completedStepsCount:b=0,showFrigadeBranding:f=!1,cssPosition:B="absolute"})=>{var Me,Et,ft,At,gt,u,C,v,W,pe,Qt,jr;let{logErrorIfDebugMode:T}=qs(),[h,I]=Yt(),[y,m]=Yt(new Date),P=Zd(null),[w,E]=Yt(document.querySelector(e[l].selector)),O=Ks(w,y),[N,A]=Yt(),[D,$]=Yt(!F),j=(Et=(Me=e[l])==null?void 0:Me.props)!=null&&Et.position?e[l].props.position:B,H=((At=(ft=e[l])==null?void 0:ft.props)==null?void 0:At.zIndex)??90,V=(h==null?void 0:h.width)??Xs,we=(h==null?void 0:h.height)??Js,[ce,G]=Yt(new Date().getTime()),re=window.location.pathname.split("/").pop();Ys(()=>{P.current&&I({width:P.current.clientWidth,height:P.current.clientHeight})},[l,y,j]),Ko(()=>{F||$(!0)},[l]);let Y=()=>{let oe=document.querySelector(e[l].selector);if(!oe){A(void 0),E(null),T(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}N&&N===JSON.stringify(oe==null?void 0:oe.getBoundingClientRect())||(E(oe),m(new Date),oe&&A(JSON.stringify(oe.getBoundingClientRect())))};if(Ko(()=>{let oe=new MutationObserver(Y);return oe.observe(document.body,{subtree:!0,childList:!0}),()=>oe.disconnect()},[Y]),Ko(()=>{let oe=new MutationObserver(Y);return oe.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>oe.disconnect()},[Y]),Ko(()=>{let oe=setInterval(()=>{Y()},10);return()=>clearInterval(oe)},[Y]),Ys(()=>{setTimeout(()=>{Y()},Rd),Y()},[l,re]),w===null||!p||O.height===0&&O.width===0&&j!=="fixed"&&B!=="static")return null;let Te=i==="auto"?"right":i,le=Lr(O,Te,V,s,j),he=O.right+V>(window.innerWidth||document.documentElement.clientWidth),ee=O.bottom+Js>(window.innerHeight||document.documentElement.clientHeight);he&&i==="auto"&&(le=Lr(O,"left",V,s,j),Te="left"),(u=(gt=e[l])==null?void 0:gt.props)!=null&&u.tooltipPosition&&((v=(C=e[l])==null?void 0:C.props)==null?void 0:v.tooltipPosition)!=="auto"&&(((pe=(W=e[l])==null?void 0:W.props)==null?void 0:pe.tooltipPosition)==="left"||((jr=(Qt=e[l])==null?void 0:Qt.props)==null?void 0:jr.tooltipPosition)==="right")&&(Te=e[l].props.tooltipPosition);let me=()=>{let oe=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{Y()},30)),b===e.length-1)return o()},nt=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&!e[l].secondaryButtonUri&&$(!1))};return _.createElement(_.Fragment,null,S&&e.length>1&&_.createElement(oi,null,_.createElement(ii,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&_.createElement(ri,{showStepCount:S,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&_.createElement(Z,{title:e[l].secondaryButtonTitle,appearance:d,onClick:nt,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&_.createElement(Z,{title:e[l].primaryButtonTitle,appearance:d,onClick:oe,withMargin:!1,size:"small"})))},Fe=()=>_.createElement(_.Fragment,null,x&&_.createElement(Qr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},_.createElement(Pe,null)),e[l].imageUri&&_.createElement(Zr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&_.createElement(Rr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},_.createElement(Ge,{appearance:d,videoUri:e[l].videoUri})),_.createElement(ti,{className:a("tooltipContentContainer",d)},_.createElement(ve,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),_.createElement(ei,{className:a("tooltipFooter",d)},_.createElement(me,null)))),U={...{default:oe=>{var nt;if((nt=e[l])!=null&&nt.StepContent){let Dl=e[l].StepContent;return _.createElement("div",null,Dl)}return _.createElement(Fe,null)}},...g},Ce=()=>{var oe;return e?!((oe=e[l])!=null&&oe.type)||!U[e[l].type]?U.default(e[l]):U[e[l].type]({stepData:e[l],primaryColor:n}):_.createElement(_.Fragment,null)};if(F&&e[l].complete===!0||le.x==0&&le.y==0&&new Date().getTime()-ce<100)return null;let z={top:(le==null?void 0:le.y)-Xt,left:(Te=="left"?O.x+s.x:(le==null?void 0:le.x)-Xt)??0,cursor:F?"pointer":"default",position:j},ye=()=>{let nt=z.left+(Te=="left"?-V:24);return Math.min(Math.max(nt,20),window.innerWidth-V-20)},q=()=>{if(j==="fixed")return z.top;let oe=z.top+we,nt=20;return oe>window.innerHeight-nt?z.top+-we:z.top},fe=()=>{F&&(m(new Date),$(!D))};return _.createElement(oc,null,_.createElement(rc,{style:z,zIndex:H,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&B!=="static"&&_.createElement(_.Fragment,null,_.createElement(tc,{style:{position:j},onClick:fe,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),_.createElement(ec,{style:{position:"absolute"},onClick:fe,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),_.createElement(Qs,{style:{...z,left:ye(),top:q()},zIndex:H+1,className:a("tooltipContainerWrapper",d)},D&&_.createElement(_.Fragment,null,_.createElement(So,{ref:P,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:B!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:Xs,zIndex:H+10},_.createElement(Ce,null)),f&&_.createElement(si,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:H+10},_.createElement(bo,{appearance:d})))))},Dr=ic;import{Portal as lc}from"react-portal";var ac=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:F="absolute",...S})=>{let{getFlow:b,getFlowSteps:f,isLoading:B,targetingLogicShouldHideFlow:T,markStepCompleted:h,markStepStarted:I,markFlowCompleted:y,updateCustomVariables:m,getCurrentStepIndex:P,getStepStatus:w,isStepBlocked:E,getFlowStatus:O,getNumberOfStepsCompleted:N}=J(),{isLoadingUserFlowStateData:A}=Ae(),{primaryCTAClickSideEffects:D,secondaryCTAClickSideEffects:$}=ie(),{hasOpenModals:j}=ke(),H=P(e),{openFlowStates:V}=nc(K),{mergeAppearanceWithDefault:we}=Q();if(o=we(o),sc(()=>{m(t)},[t,B]),A)return null;let ce=b(e);if(!ce||T(ce)||O(e)==X||j())return null;let G=f(e);if(Object.keys(V).length>0){let L=Object.keys(V).find(U=>V[U]===!0);if(L!==void 0&&L!==e)return Pt.createElement(Pt.Fragment,null)}async function re(L){if(await h(e,L.id),G.map(U=>w(e,U.id)).every(U=>U===ze)){await y(e);return}if(!l&&H+1<G.length){if(E(e,G[H+1].id))return;await I(e,G[H+1].id)}}function Y(L,U,Ce){let z=H+1<G.length?G[H+1]:null;r&&r(L,H,U,z),i&&i(L,Ce,z)}function Te(){return G.map(L=>({...L,handleSecondaryButtonClick:async()=>{$(L),L.skippable===!0&&await h(e,L.id,{skipped:!0}),Y(L,"secondary",H)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await re(L),Y(L,"primary",H),D(L)}}))}async function le(L){s&&s(),g==="complete-flow"?await y(e):await h(e,L.id)}function he(){d&&d()}let ee=!document.querySelector(G[H].selector);function me(){let L=G.findIndex(U=>!!document.querySelector(U.selector));return G.map((U,Ce)=>ee&&!n&&Ce!==L&&x||!n&&Ce!==H?null:Pt.createElement(Dr,{key:U.id,appearance:o,steps:Te(),selectedStep:Ce,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>le(U),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:N(e),onComplete:he,cssPosition:F,...S}))}function Fe(){return Pt.createElement(Pt.Fragment,null,Pt.createElement(te,{appearance:o}),me())}return F==="static"?Fe():Pt.createElement(lc,null,Fe())};import Oe,{useEffect as pc,useRef as dc,useState as cc}from"react";import{Portal as mc}from"react-portal";import vt from"styled-components";var Zs=vt.button`
1450
1446
  ${e=>k(e)} {
1451
1447
  // Anything inside this block will be ignored if the user provides a custom class
1452
1448
 
@@ -1464,17 +1460,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1464
1460
  opacity: 0.8;
1465
1461
  }
1466
1462
  }
1467
- `,Zs=Bt.span`
1463
+ `,Rs=vt.span`
1468
1464
  ${e=>k(e)} {
1469
1465
  font-size: 12px;
1470
1466
  display: inline-block;
1471
1467
  }
1472
- `,Rs=Bt.span`
1468
+ `,el=vt.span`
1473
1469
  ${e=>k(e)} {
1474
1470
  font-size: 12px;
1475
1471
  display: inline-block;
1476
1472
  }
1477
- `,el=Bt.div`
1473
+ `,tl=vt.div`
1478
1474
  position: fixed;
1479
1475
  right: 0;
1480
1476
  bottom: 0;
@@ -1484,7 +1480,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1484
1480
  flex-direction: column;
1485
1481
  align-items: flex-end;
1486
1482
  z-index: 50;
1487
- `,tl=Bt.button`
1483
+ `,ol=vt.button`
1488
1484
  ${e=>k(e)} {
1489
1485
  // Anything inside this block will be ignored if the user provides a custom class
1490
1486
  background-color: #ffffff;
@@ -1500,7 +1496,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1500
1496
  0px 3px 6px -4px rgba(0, 0, 0, 0.12);
1501
1497
  border-radius: 45px;
1502
1498
  cursor: pointer;
1503
- `,ol=Bt.div`
1499
+ `,rl=vt.div`
1504
1500
  ${e=>k(e)} {
1505
1501
  // Anything inside this block will be ignored if the user provides a custom class
1506
1502
  background: #ffffff;
@@ -1517,7 +1513,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1517
1513
  position: ${e=>e.type=="inline"?"absolute":"relative"};
1518
1514
  top: ${e=>e.type=="inline"?"68px":0};
1519
1515
  margin-left: ${e=>e.type=="inline"?"-127px":0};
1520
- `,rl=Bt.button`
1516
+ `,il=vt.button`
1521
1517
  ${e=>k(e)} {
1522
1518
  // Anything inside this block will be ignored if the user provides a custom class
1523
1519
  color: #434343;
@@ -1534,7 +1530,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1534
1530
  font-size: 14px;
1535
1531
 
1536
1532
  padding: 8px 12px;
1537
- `;import il from"react";var nl=({style:e,className:t})=>il.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},il.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 sl from"react";var ll=({style:e,className:t})=>sl.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"},sl.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 mc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F}=J(),{primaryCTAClickSideEffects:y}=ie(),S=pc(null),[f,B]=dc(!1),{mergeAppearanceWithDefault:T}=Z();s=T(s),ac(()=>(document.addEventListener("click",h,!1),()=>{document.removeEventListener("click",h,!1)}),[]);let h=w=>{S.current&&!S.current.contains(w.target)&&B(!1)};if(x)return null;let A=p(e);if(!A||F(A))return null;let b=c(e);if(!b||!i)return null;function m(w,E){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&l(e,w.id),y(w),o&&o(w,E),B(!1)}function P(){return f&&Ie.createElement(ol,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},b.map((w,E)=>Ie.createElement(rl,{className:a("floatingWidgetMenuItem",s),key:E,onClick:()=>m(w,E)},w.title)))}return r=="inline"?Ie.createElement("span",{ref:S},Ie.createElement(Qs,{style:t,onClick:()=>{B(!f)},className:a("supportButton",s)},Ie.createElement(Rs,{className:a("supportIconContainer",s)},Ie.createElement(ll,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ie.createElement(Zs,{className:a("supportButtonTitle",s)},n)),Ie.createElement(P,null)):Ie.createElement(cc,null,Ie.createElement(el,{style:t,ref:S},Ie.createElement(P,null),Ie.createElement(tl,{onClick:()=>{B(!f)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ie.createElement(nl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as uc}from"react";import Ko from"styled-components";var al=Ko.div`
1533
+ `;import nl from"react";var sl=({style:e,className:t})=>nl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},nl.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 ll from"react";var al=({style:e,className:t})=>ll.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"},ll.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 uc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F}=J(),{primaryCTAClickSideEffects:S}=ie(),b=dc(null),[f,B]=cc(!1),{mergeAppearanceWithDefault:T}=Q();s=T(s),pc(()=>(document.addEventListener("click",h,!1),()=>{document.removeEventListener("click",h,!1)}),[]);let h=w=>{b.current&&!b.current.contains(w.target)&&B(!1)};if(x)return null;let I=p(e);if(!I||F(I))return null;let y=c(e);if(!y||!i)return null;function m(w,E){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&l(e,w.id),S(w),o&&o(w,E),B(!1)}function P(){return f&&Oe.createElement(rl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},y.map((w,E)=>Oe.createElement(il,{className:a("floatingWidgetMenuItem",s),key:E,onClick:()=>m(w,E)},w.title)))}return r=="inline"?Oe.createElement("span",{ref:b},Oe.createElement(Zs,{style:t,onClick:()=>{B(!f)},className:a("supportButton",s)},Oe.createElement(el,{className:a("supportIconContainer",s)},Oe.createElement(al,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Oe.createElement(Rs,{className:a("supportButtonTitle",s)},n)),Oe.createElement(P,null)):Oe.createElement(mc,null,Oe.createElement(tl,{style:t,ref:b},Oe.createElement(P,null),Oe.createElement(ol,{onClick:()=>{B(!f)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Oe.createElement(sl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Ye,{useEffect as fc}from"react";import qo from"styled-components";var pl=qo.div`
1538
1534
  ${e=>k(e)} {
1539
1535
  display: flex;
1540
1536
  flex-direction: column;
@@ -1549,17 +1545,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1549
1545
  border-radius: 12px;
1550
1546
  position: relative;
1551
1547
  }
1552
- `,pl=Ko.div`
1548
+ `,dl=qo.div`
1553
1549
  display: flex;
1554
1550
  flex-direction: column;
1555
1551
  flex: 1;
1556
- `,dl=Ko.div`
1552
+ `,cl=qo.div`
1557
1553
  display: flex;
1558
1554
  flex-direction: column;
1559
1555
  justify-content: center;
1560
1556
  align-items: flex-start;
1561
1557
  margin-top: 16px;
1562
- `,cl=Ko.div`
1558
+ `,ml=qo.div`
1563
1559
  ${e=>k(e)} {
1564
1560
  position: absolute;
1565
1561
  top: 16px;
@@ -1570,7 +1566,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1570
1566
  opacity: 0.8;
1571
1567
  }
1572
1568
  }
1573
- `;var fc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowSteps:y,getFlowStatus:S,getCurrentStepIndex:f}=J(),{primaryCTAClickSideEffects:B}=ie(),{mergeAppearanceWithDefault:T}=Z();if(r=T(r),uc(()=>{F(o)},[o,d]),d)return null;let h=c(e);if(!h||x(h)||S(e)===X)return null;let b=y(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(al,{appearance:r,className:he(a("embeddedTipContainer",r),n),style:s},(p===!0||b.dismissible)&&qe.createElement(cl,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},qe.createElement(we,null)),qe.createElement(pl,null,qe.createElement(Te,{size:"small",appearance:r,title:b.title,subtitle:b.subtitle})),b.primaryButtonTitle&&qe.createElement(dl,{className:a("embeddedTipCallToActionContainer",r)},qe.createElement(R,{classPrefix:"embeddedTip",title:b.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{b.handlePrimaryButtonClick(),B(b),!(i&&i(b,f(e),"primary")===!1)&&(await g(e,b.id),await l(e))}}))))};import ye,{useEffect as gc}from"react";import Xt from"styled-components";var ml=Xt.div`
1569
+ `;var gc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowSteps:S,getFlowStatus:b,getCurrentStepIndex:f}=J(),{primaryCTAClickSideEffects:B}=ie(),{mergeAppearanceWithDefault:T}=Q();if(r=T(r),fc(()=>{F(o)},[o,d]),d)return null;let h=c(e);if(!h||x(h)||b(e)===X)return null;let y=S(e)[f(e)];return Ye.createElement(Ye.Fragment,null,Ye.createElement(te,{appearance:r}),Ye.createElement(pl,{appearance:r,className:ge(a("embeddedTipContainer",r),n),style:s},(p===!0||y.dismissible)&&Ye.createElement(ml,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},Ye.createElement(Pe,null)),Ye.createElement(dl,null,Ye.createElement(ve,{size:"small",appearance:r,title:y.title,subtitle:y.subtitle})),y.primaryButtonTitle&&Ye.createElement(cl,{className:a("embeddedTipCallToActionContainer",r)},Ye.createElement(Z,{classPrefix:"embeddedTip",title:y.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{y.handlePrimaryButtonClick(),B(y),!(i&&i(y,f(e),"primary")===!1)&&(await g(e,y.id),await l(e))}}))))};import Se,{useEffect as xc}from"react";import Jt from"styled-components";var ul=Jt.div`
1574
1570
  // use the :not annotation
1575
1571
  ${e=>k(e)} {
1576
1572
  display: flex;
@@ -1582,24 +1578,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1582
1578
  background-color: ${e=>e.appearance.theme.colorBackground};
1583
1579
  border-radius: 12px;
1584
1580
  }
1585
- `,ul=Xt.div`
1581
+ `,fl=Jt.div`
1586
1582
  ${e=>k(e)} {
1587
1583
  display: flex;
1588
1584
  width: 46px;
1589
1585
  height: 46px;
1590
1586
  }
1591
- `,fl=Xt.div`
1587
+ `,gl=Jt.div`
1592
1588
  display: flex;
1593
1589
  flex-direction: column;
1594
1590
  flex: 1;
1595
1591
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1596
1592
  margin-top: ${e=>e.type==="square"?"12px":"0"};
1597
- `,gl=Xt.div`
1593
+ `,xl=Jt.div`
1598
1594
  display: flex;
1599
1595
  flex-direction: column;
1600
1596
  justify-content: center;
1601
1597
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1602
- `,Dr=Xt.div`
1598
+ `,$r=Jt.div`
1603
1599
  display: flex;
1604
1600
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1605
1601
  align-items: flex-end;
@@ -1607,12 +1603,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1607
1603
  :hover {
1608
1604
  opacity: 0.8;
1609
1605
  }
1610
- `,$r=Xt.div`
1606
+ `,Mr=Jt.div`
1611
1607
  display: flex;
1612
1608
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1613
1609
  align-items: flex-end;
1614
1610
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1615
- `;import Mr from"react";var xl=({style:e,className:t})=>Mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Mr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Mr.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var xc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:l,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowMetadata:y,getFlowStatus:S,getFlowSteps:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T}=ie(),{mergeAppearanceWithDefault:h}=Z();if(s=h(s),gc(()=>{F(r)},[r,d]),d)return null;let A=l(e);if(!A||x(A)||S(e)===X)return null;let b=f(e),m=b.length>0?b[B(e)]:y(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ye.createElement(ye.Fragment,null,ye.createElement(oe,{appearance:s}),ye.createElement(ml,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ye.createElement(ul,{className:a("bannerIconContainer",s)},c||ye.createElement(xl,null)),p==="square"&&m.dismissible&&ye.createElement($r,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Dr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(we,null))),ye.createElement(fl,{type:p},ye.createElement(Te,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&ye.createElement(gl,{type:p,className:a("bannerCallToActionContainer",s)},ye.createElement(R,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{T(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&ye.createElement($r,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Dr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(we,null)))))};import ee,{useEffect as hc}from"react";import{Portal as Cc}from"react-portal";import it from"styled-components";var hl=it.div`
1611
+ `;import Ur from"react";var hl=({style:e,className:t})=>Ur.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Ur.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Ur.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var hc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:l,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowMetadata:S,getFlowStatus:b,getFlowSteps:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T}=ie(),{mergeAppearanceWithDefault:h}=Q();if(s=h(s),xc(()=>{F(r)},[r,d]),d)return null;let I=l(e);if(!I||x(I)||b(e)===X)return null;let y=f(e),m=y.length>0?y[B(e)]:S(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),Se.createElement(Se.Fragment,null,Se.createElement(te,{appearance:s}),Se.createElement(ul,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&Se.createElement(fl,{className:a("bannerIconContainer",s)},c||Se.createElement(hl,null)),p==="square"&&m.dismissible&&Se.createElement(Mr,{type:p,className:a("bannerDismissButtonContainer",s)},Se.createElement($r,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},Se.createElement(Pe,null))),Se.createElement(gl,{type:p},Se.createElement(ve,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&Se.createElement(xl,{type:p,className:a("bannerCallToActionContainer",s)},Se.createElement(Z,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{T(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&Se.createElement(Mr,{type:p,className:a("bannerDismissButtonContainer",s)},Se.createElement($r,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},Se.createElement(Pe,null)))))};import R,{useEffect as Cc}from"react";import{Portal as yc}from"react-portal";import it from"styled-components";var Cl=it.div`
1616
1612
  display: flex;
1617
1613
  flex-direction: column;
1618
1614
  width: 100%;
@@ -1631,7 +1627,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1631
1627
  z-index: 1000;
1632
1628
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
1633
1629
  min-width: 550px;
1634
- `,Cl=it.button`
1630
+ `,yl=it.button`
1635
1631
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1636
1632
  border-radius: 8px;
1637
1633
  // If selected make border color primary and text color color priamry
@@ -1652,33 +1648,33 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1652
1648
  display: flex;
1653
1649
  justify-content: center;
1654
1650
  align-items: center;
1655
- `,Ur=it.div`
1651
+ `,zr=it.div`
1656
1652
  display: flex;
1657
1653
  justify-content: space-between;
1658
1654
  margin-top: 16px;
1659
1655
  gap: 8px;
1660
- `,yl=it.div`
1656
+ `,Sl=it.div`
1661
1657
  display: flex;
1662
1658
  justify-content: space-between;
1663
1659
  margin-top: 8px;
1664
- `,zr=it.div`
1660
+ `,Wr=it.div`
1665
1661
  font-size: 12px;
1666
1662
  line-height: 18px;
1667
1663
  color: ${e=>e.appearance.theme.colorTextDisabled};
1668
1664
  font-style: normal;
1669
1665
  font-weight: 400;
1670
1666
  letter-spacing: 0.24px;
1671
- `,Wr=it.div`
1667
+ `,_r=it.div`
1672
1668
  display: flex;
1673
1669
  flex-direction: column;
1674
1670
  flex: 1;
1675
- `,e1=it.div`
1671
+ `,t1=it.div`
1676
1672
  display: flex;
1677
1673
  flex-direction: column;
1678
1674
  justify-content: center;
1679
1675
  align-items: flex-start;
1680
1676
  margin-top: 16px;
1681
- `,Sl=it.textarea`
1677
+ `,bl=it.textarea`
1682
1678
  ${e=>k(e)} {
1683
1679
  margin-top: 16px;
1684
1680
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
@@ -1689,7 +1685,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1689
1685
  width: 100%;
1690
1686
  height: 100px;
1691
1687
  }
1692
- `,bl=it.div`
1688
+ `,wl=it.div`
1693
1689
  ${e=>k(e)} {
1694
1690
  position: absolute;
1695
1691
  top: 16px;
@@ -1700,7 +1696,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1700
1696
  opacity: 0.8;
1701
1697
  }
1702
1698
  }
1703
- `;var yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:y,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T}=ie(),{mergeAppearanceWithDefault:h}=Z(),[A,b]=ee.useState(null),[m,P]=ee.useState(""),{hasOpenModals:w,setKeepCompletedFlowOpenDuringSession:E,shouldKeepCompletedFlowOpenDuringSession:O}=be();if(r=h(r),hc(()=>{y(o)},[o,x]),x)return null;let N=c(e);if(!N||F(N)||f(e)===X||d(e)===1&&!O(e)||w())return null;let $=S(e)[d(e)];function D(){return ee.createElement(ee.Fragment,null,ee.createElement(Wr,null,ee.createElement(Te,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),ee.createElement(Ur,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(q=>ee.createElement(Cl,{className:a("npsNumberButton",r),selected:A===q+1,key:q,onClick:async()=>{E(e),b(q+1),await g(e,$.id,{score:q+1})},appearance:r},q+1))),ee.createElement(yl,{appearance:r},ee.createElement(zr,{appearance:r},"Not likely at all"),ee.createElement(zr,{appearance:r},"Extremely likely")))}function K(){return ee.createElement(ee.Fragment,null,ee.createElement(Wr,null,ee.createElement(Te,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),ee.createElement(Sl,{appearance:r,value:m,onChange:q=>{P(q.target.value)},placeHolder:"Add your optional fedback here..."}),ee.createElement(Ur,{appearance:r,className:a("npsNumberButtonContainer",r)},ee.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await l(e),i&&i($,1,"primary")},appearance:r,title:$.secondaryButtonTitle||"Skip",secondary:!0}),ee.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await g(e,$.id,{feedbackText:m}),await l(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function z(){return d(e)>=2?null:ee.createElement(ee.Fragment,null,ee.createElement(oe,{appearance:r}),ee.createElement(hl,{appearance:r,className:he(a("npsSurveyContainer",r),n),style:s,type:p},ee.createElement(bl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},ee.createElement(we,null)),d(e)==0&&D(),d(e)==1&&K()))}return p==="inline"?z():ee.createElement(Cc,null,z())};import Se,{useEffect as wc}from"react";import Et from"styled-components";var wl=Et.div`
1699
+ `;var Sc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:S,getFlowSteps:b,getFlowStatus:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T}=ie(),{mergeAppearanceWithDefault:h}=Q(),[I,y]=R.useState(null),[m,P]=R.useState(""),{hasOpenModals:w,setKeepCompletedFlowOpenDuringSession:E,shouldKeepCompletedFlowOpenDuringSession:O}=ke();if(r=h(r),Cc(()=>{S(o)},[o,x]),x)return null;let N=c(e);if(!N||F(N)||f(e)===X||d(e)===1&&!O(e)||w())return null;let D=b(e)[d(e)];function $(){return R.createElement(R.Fragment,null,R.createElement(_r,null,R.createElement(ve,{size:"large",appearance:r,title:D.title,subtitle:D.subtitle})),R.createElement(zr,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(V=>R.createElement(yl,{className:a("npsNumberButton",r),selected:I===V+1,key:V,onClick:async()=>{E(e),y(V+1),await g(e,D.id,{score:V+1})},appearance:r},V+1))),R.createElement(Sl,{appearance:r},R.createElement(Wr,{appearance:r},"Not likely at all"),R.createElement(Wr,{appearance:r},"Extremely likely")))}function j(){return R.createElement(R.Fragment,null,R.createElement(_r,null,R.createElement(ve,{appearance:r,title:D.title??"Why did you choose this score?",size:"large"})),R.createElement(bl,{appearance:r,value:m,onChange:V=>{P(V.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(zr,{appearance:r,className:a("npsNumberButtonContainer",r)},R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await l(e),i&&i(D,1,"primary")},appearance:r,title:D.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await g(e,D.id,{feedbackText:m}),await l(e),i&&i(D,1,"primary")},appearance:r,title:D.primaryButtonTitle||"Submit"})))}function H(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(te,{appearance:r}),R.createElement(Cl,{appearance:r,className:ge(a("npsSurveyContainer",r),n),style:s,type:p},R.createElement(wl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},R.createElement(Pe,null)),d(e)==0&&$(),d(e)==1&&j()))}return p==="inline"?H():R.createElement(yc,null,H())};import be,{useEffect as Tc}from"react";import Bt from"styled-components";var Tl=Bt.div`
1704
1700
  ${e=>k(e)} {
1705
1701
  display: flex;
1706
1702
  flex-direction: column;
@@ -1711,21 +1707,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1711
1707
  background-color: ${e=>e.appearance.theme.colorBackground};
1712
1708
  position: relative;
1713
1709
  }
1714
- `,Tl=Et.div`
1710
+ `,Fl=Bt.div`
1715
1711
  display: flex;
1716
1712
  flex-direction: column;
1717
1713
  flex: 1;
1718
- `,Fl=Et.div`
1714
+ `,kl=Bt.div`
1719
1715
  display: flex;
1720
1716
  flex-direction: row;
1721
1717
  justify-content: center;
1722
1718
  align-items: stretch;
1723
1719
  gap: 16px;
1724
1720
  margin-top: 8px;
1725
- `,kl=Et.div`
1721
+ `,Pl=Bt.div`
1726
1722
  margin-top: 16px;
1727
1723
  margin-bottom: 16px;
1728
- `,Pl=Et.div`
1724
+ `,vl=Bt.div`
1729
1725
  ${e=>k(e)} {
1730
1726
  position: absolute;
1731
1727
  top: -16px;
@@ -1736,7 +1732,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1736
1732
  opacity: 0.8;
1737
1733
  }
1738
1734
  }
1739
- `,vl=Et.h1`
1735
+ `,Bl=Bt.h1`
1740
1736
  ${e=>k(e)} {
1741
1737
  font-style: normal;
1742
1738
  justify-content: center;
@@ -1750,7 +1746,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1750
1746
  color: ${e=>e.appearance.theme.colorText};
1751
1747
  margin-bottom: 8px;
1752
1748
  }
1753
- `,Bl=Et.h2`
1749
+ `,El=Bt.h2`
1754
1750
  ${e=>k(e)} {
1755
1751
  font-style: normal;
1756
1752
  justify-content: center;
@@ -1762,10 +1758,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map
1762
1758
  letter-spacing: 0.28px;
1763
1759
  margin-bottom: 8px;
1764
1760
  }
1765
- `;import El from"react";import Sc from"styled-components";var bc=Sc.img`
1761
+ `;import Al from"react";import bc from"styled-components";var wc=bc.img`
1766
1762
  width: 100%;
1767
1763
  height: 100%;
1768
1764
  min-height: 200px;
1769
1765
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1770
- `;function Al({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?El.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?El.createElement(bc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Tc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:l,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:y,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:h}=ie(),{mergeAppearanceWithDefault:A}=Z(),{setOpenFlowState:b,getOpenFlowState:m,hasOpenModals:P}=be(),[w,E]=[m(e,!0),z=>b(e,z)];if(r=A(r),wc(()=>{y(o)},[o,x]),x)return null;let O=l(e);if(!O||F(O)||f(e)===X||P())return null;let I=S(e)[B(e)],$=()=>{E(!1),t&&t(),g(e)};function D(){return Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:r}),Se.createElement(wl,{appearance:r,className:he(a("announcementContainer",r),n),style:s},(p===!0||I.dismissible)&&c=="inline"&&Se.createElement(Pl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},Se.createElement(we,null)),Se.createElement(Tl,null,Se.createElement(vl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:se(I.title)}),I.subtitle&&Se.createElement(Bl,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:se(I.subtitle)})),(I.imageUri||I.videoUri)&&Se.createElement(kl,{className:a("announcementMediaContainer",r)},Se.createElement(Al,{appearance:r,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&Se.createElement(Fl,{className:a("announcementCTAContainer",r)},I.secondaryButtonTitle&&Se.createElement(R,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handleSecondaryButtonClick(),h(I),i&&i(I,B(e),"secondary")},secondary:!0}),I.primaryButtonTitle&&Se.createElement(R,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handlePrimaryButtonClick(),T(I),!(i&&i(I,B(e),"primary")===!1)&&(await d(e,I.id),await g(e))}}))))}let K={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?Se.createElement(To,{modalPosition:c,onClose:$,visible:w,dismissible:p,appearance:r},D()):Se.createElement(He,{appearance:r,onClose:$,visible:w,style:K,dismissible:p},D())};import*as qo from"react";import Il from"react";var Nl=({as:e="span",children:t,variant:o="Body1",...i})=>Il.createElement(en,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),Fc=Object.fromEntries(Object.keys($o).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Il.createElement(Nl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),_r=Object.assign(Nl,Fc);var Ol=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return qo.createElement(Ri,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},qo.createElement(_r,{color:(s=po[r])==null?void 0:s.color,fontWeight:"semibold"},i))},kc=Object.fromEntries(Object.keys(po).map(e=>{let t=o=>qo.createElement(Ol,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),Pc=Object.assign(Ol,kc);export{ao as Box,Pc as Button,Qe as CheckBox,Jo as FlowType,lt as FormLabel,pr as FormTextField,Tc as FrigadeAnnouncement,xc as FrigadeBanner,Nr as FrigadeChecklist,Je as FrigadeDefaultAppearance,fc as FrigadeEmbeddedTip,Gi as FrigadeForm,Gd as FrigadeGuide,_d as FrigadeHeroChecklist,yc as FrigadeNPSSurvey,jd as FrigadeProgressBadge,Qp as FrigadeProvider,mc as FrigadeSupportWidget,lc as FrigadeTour,Mt as ProgressRing,_r as Text,Tr as tokens,be as useFlowOpens,Jt as useFlowResponses,J as useFlows,Sr as useOrganization,Qt as useUser,Ee as useUserFlowStates};
1766
+ `;function Il({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Al.createElement(Ge,{appearance:t,videoUri:e.videoUri}):e.imageUri?Al.createElement(wc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Fc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:l,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:S,getFlowSteps:b,getFlowStatus:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:h}=ie(),{mergeAppearanceWithDefault:I}=Q(),{setOpenFlowState:y,getOpenFlowState:m,hasOpenModals:P}=ke(),[w,E]=[m(e,!0),H=>y(e,H)];if(r=I(r),Tc(()=>{S(o)},[o,x]),x)return null;let O=l(e);if(!O||F(O)||f(e)===X||P())return null;let A=b(e)[B(e)],D=()=>{E(!1),t&&t(),g(e)};function $(){return be.createElement(be.Fragment,null,be.createElement(te,{appearance:r}),be.createElement(Tl,{appearance:r,className:ge(a("announcementContainer",r),n),style:s},(p===!0||A.dismissible)&&c=="inline"&&be.createElement(vl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},be.createElement(Pe,null)),be.createElement(Fl,null,be.createElement(Bl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:ne(A.title)}),A.subtitle&&be.createElement(El,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:ne(A.subtitle)})),(A.imageUri||A.videoUri)&&be.createElement(Pl,{className:a("announcementMediaContainer",r)},be.createElement(Il,{appearance:r,stepData:A})),(A.primaryButtonTitle||A.secondaryButtonTitle)&&be.createElement(kl,{className:a("announcementCTAContainer",r)},A.secondaryButtonTitle&&be.createElement(Z,{classPrefix:"announcement",title:A.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{A.handleSecondaryButtonClick(),h(A),i&&i(A,B(e),"secondary")},secondary:!0}),A.primaryButtonTitle&&be.createElement(Z,{classPrefix:"announcement",title:A.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{A.handlePrimaryButtonClick(),T(A),!(i&&i(A,B(e),"primary")===!1)&&(await d(e,A.id),await g(e))}}))))}let j={padding:"24px",maxWidth:"400px"};return c==="inline"?$():c!=="center"?be.createElement(Fo,{modalPosition:c,onClose:D,visible:w,dismissible:p,appearance:r},$()):be.createElement(je,{appearance:r,onClose:D,visible:w,style:j,dismissible:p},$())};import*as Yo from"react";import Nl from"react";var Ol=({as:e="span",children:t,variant:o="Body1",...i})=>Nl.createElement(tn,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),kc=Object.fromEntries(Object.keys(Mo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Nl.createElement(Ol,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Hr=Object.assign(Ol,kc);var Ll=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return Yo.createElement(en,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},Yo.createElement(Hr,{color:(s=mo[r])==null?void 0:s.color,fontWeight:"semibold"},i))},Pc=Object.fromEntries(Object.keys(mo).map(e=>{let t=o=>Yo.createElement(Ll,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),vc=Object.assign(Ll,Pc);export{co as Box,vc as Button,Qe as CheckBox,Qo as FlowType,lt as FormLabel,dr as FormTextField,Fc as FrigadeAnnouncement,hc as FrigadeBanner,Or as FrigadeChecklist,Je as FrigadeDefaultAppearance,gc as FrigadeEmbeddedTip,Ki as FrigadeForm,Kd as FrigadeGuide,Hd as FrigadeHeroChecklist,Sc as FrigadeNPSSurvey,Vd as FrigadeProgressBadge,Zp as FrigadeProvider,uc as FrigadeSupportWidget,ac as FrigadeTour,$t as ProgressRing,Hr as Text,Fr as tokens,ke as useFlowOpens,Zt as useFlowResponses,J as useFlows,br as useOrganization,Rt as useUser,Ae as useUserFlowStates};
1771
1767
  //# sourceMappingURL=index.mjs.map