@frigade/react 1.32.22 → 1.32.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +68 -68
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +120 -120
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import{ThemeProvider as sa}from"styled-components";import lt,{useContext as ra,useEffect as lo,useState as $o}from"react";import{useCallback as rt,useContext as Bs,useEffect as As}from"react";import To,{useMemo as Ss}from"react";var Qo="1.32.22 ";var ge="https://api.frigade.com/v1/public/",be="NOT_STARTED_STEP",R="COMPLETED_FLOW",Yt="ABORTED_FLOW",ot="STARTED_FLOW",Ae="NOT_STARTED_FLOW",Fe="COMPLETED_STEP",Xt="STARTED_STEP";function Ne(){let{publicApiKey:e,userId:t}=To.useContext(G);return{config:Ss(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Qo,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function ft(){let{shouldGracefullyDegrade:e}=To.useContext(G);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),Kt();let i;try{i=await fetch(t,o)}catch(r){return Kt(r)}return i?i.ok?i:Kt(i.statusText):Kt()}}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=To.useContext(G);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as vs,useState as Zo}from"react";import{useContext as Ts,useEffect as ws,useState as Fs}from"react";import ks from"swr";import{useContext as bs}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o}=bs(G);function i(p,d=!1){return e[p]??d}function r(p,d){t(l=>({...l,[p]:d}))}function n(p){t(d=>{let{[p]:l,...g}=d;return{...g}})}function s(){return Object.values(e).some(p=>p)||o}return{getOpenFlowState:i,setOpenFlowState:r,resetOpenFlowState:n,hasOpenModals:s}}var Ps="unknown";function Te(){let{config:e}=Ne(),{publicApiKey:t,userId:o,flows:i,setShouldGracefullyDegrade:r}=Ts(G),{resetOpenFlowState:n}=ke(),[s,p]=Fs(!1),d={data:i.map(P=>({flowId:P.id,flowState:R,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=P=>fetch(P,e).then(c=>{if(c.ok)return c.json();throw new Error("Failed to fetch user flow states")}).catch(c=>(console.log(`Error fetching ${P}: ${c}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:g,isLoading:m,mutate:h,error:F}=ks(t&&i&&o?`${ge}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),x=g==null?void 0:g.data;ws(()=>{!s&&!m&&x&&p(!0)},[x,s,m]);async function y(P){if(x){let c=x.find(u=>u.flowId===P);c&&c.flowState!==R&&(c.flowState=R),await h(Promise.resolve({...g,data:x}),{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}async function C(P,c,u){if(x){let b=x.find(I=>I.flowId===P);b&&(b.stepStates[c]=u,b.flowState=ot),await h(Promise.resolve({...g,data:x}),{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}async function E(P,c,u){if(x){let b=x.find(I=>I.flowId===P);b&&(b.lastStepId=c,b.stepStates[c]=u,b.flowState=ot),await h({...g,data:x},{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}async function T(P){if(x){let c=x.find(u=>u.flowId===P);c&&c.flowState!==Ae&&(c.flowState=Ae,c.lastStepId=Ps,Object.keys(c.stepStates).forEach(u=>{c.stepStates[u].actionType=be,c.stepStates[u].createdAt=new Date().toISOString()}),await h({...g,data:x},{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1}),n(P))}}async function B(P,c){if(x){let u=x.find(b=>b.flowId===P);u&&u.stepStates[c]!==be&&(u.stepStates[c]=be),await h({...g,data:x},{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:x,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:C,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:E,error:F}}function At(){let{config:e}=Ne(),{userFlowStatesData:t,mutateUserFlowState:o}=Te(),{failedFlowResponses:i,setFailedFlowResponses:r,flowResponses:n,setFlowResponses:s}=vs(G),[p,d]=Zo(new Set),[l,g]=Zo(new Set),m=ft();function h(y){let C=JSON.stringify(y);if(p.has(C))return null;p.add(C),d(p),l.add(y),g(l);let E=n==null?void 0:n.find(T=>T.flowSlug===y.flowSlug&&T.stepId===y.stepId&&T.actionType===y.actionType&&T.createdAt===y.createdAt);return m(`${ge}flowResponses`,{...e,method:"POST",body:C}).then(T=>{T.status!==200&&T.status!==201?(console.log("Failed to send flow response for step "+y.stepId+". Will retry again later."),r([...i,y])):E||s(B=>[...B??[],y])})}async function F(y){y.foreignUserId&&(y.actionType===ot||y.actionType===Ae?await h(y):y.actionType===R?await h(y):y.actionType===Xt?await h(y):y.actionType===Fe?await h(y):y.actionType===Yt?await h(y):y.actionType===be&&await h(y))}function x(){let y=[];return t==null||t.forEach(C=>{if(C&&C.stepStates&&Object.keys(C.stepStates).length!==0)for(let E in C.stepStates){let T=C.stepStates[E];y.push({foreignUserId:C.foreignUserId,flowSlug:C.flowId,stepId:T.stepId,actionType:T.actionType,data:{},createdAt:new Date(T.createdAt),blocked:T.blocked,hidden:T.hidden})}}),[...y,...n]}return{addResponse:F,setFlowResponses:s,getFlowResponses:x}}import Ns from"swr";var Es=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Ro=e=>{let t=Es.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Is(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Is=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Ne(),{flows:t,setFlows:o,userId:i,publicApiKey:r,customVariables:n,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:g}=Bs(G),m={data:[]},{verifySDKInitiated:h}=gt(),{addResponse:F,getFlowResponses:x}=At(),y=f=>fetch(f,e).then(S=>S.ok?S.json():(console.log(`Error fetching ${f} (${S.status}): ${S.statusText}. .Will gracefully degrade and hide Frigade`),g(!0),m)).catch(S=>(console.log(`Error fetching ${f}: ${S}. Will gracefully degrade and hide Frigade`),g(!0),m)),{userFlowStatesData:C,isLoadingUserFlowStateData:E,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:c,optimisticallyMarkStepStarted:u}=Te(),{data:b,error:I,isLoading:U}=Ns(r?`${ge}flows`:null,y,{keepPreviousData:!0});As(()=>{if(I){console.error(I);return}b&&b.data&&(b.data=o(b.data))},[b,I]);function M(f){if(U)return null;let S=t.find(k=>k.slug===f);return!S&&t.length>0&&!E&&!U?(console.log(`Flow with slug ${f} not found`),null):(S==null?void 0:S.active)===!1?null:S}function _(f){var v;if(!M(f))return[];let S=M(f).data;return S?(S=O(S),(((v=JSON.parse(S))==null?void 0:v.data)??[]).map(Y=>{let tt=_e(Y);return{handleSecondaryButtonClick:()=>{Y.skippable===!0&&z(f,Y.id,{skipped:!0})},...Y,complete:A(f,Y.id)===Fe||tt>=1,blocked:q(f,Y.id),hidden:Ue(f,Y.id),handlePrimaryButtonClick:()=>{(!Y.completionCriteria&&(Y.autoMarkCompleted||Y.autoMarkCompleted===void 0)||Y.completionCriteria&&Y.autoMarkCompleted===!0)&&z(f,Y.id)},progress:tt}}).filter(Y=>Y.hidden!==!0)):[]}function O(f){return f.replace(/\${(.*?)}/g,(S,k)=>n[k]!==void 0?String(n[k]):"")}function H(f){if(!M(f))return[];let S=M(f).data;return S?(S=O(S),JSON.parse(S)??{}):[]}function N(f,S){s(k=>({...k,[f]:S}))}function j(f){!E&&!U&&f&&JSON.stringify(n)!=JSON.stringify({...n,...f})&&Object.keys(f).forEach(S=>{N(S,f[S])})}let K=rt(async(f,S,k)=>{h();let v={foreignUserId:i,flowSlug:f,stepId:S,actionType:Xt,data:k??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await u(f,S,v),F(v))},[i,C]),V=rt(async(f,S,k)=>{h();let v={foreignUserId:i,flowSlug:f,stepId:S,actionType:be,data:k??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await c(f,S),F(v))},[i,C]),z=rt(async(f,S,k)=>{h();let v={foreignUserId:i,flowSlug:f,stepId:S,actionType:Fe,data:k??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await P(f,S,v),F(v))},[i,C]),te=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Ae,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};await B(f),J(k)&&F(k)},[i,C]),oe=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:ot,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(k)&&F(k)},[i,C]),Z=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:R,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(k)&&(await T(f),F(k))},[i,C]),$=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Yt,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(k)&&(await T(f),F(k))},[i,C]);function J(f){var S;if(!C&&f.actionType===be)return!1;if(C){let k=C.find(v=>v.flowId===f.flowSlug);if(f.actionType===be&&(!(k!=null&&k.stepStates[f.stepId])||k.stepStates[f.stepId].actionType===be)||k&&((S=k.stepStates[f.stepId])==null?void 0:S.actionType)===f.actionType)return!1}return!0}function A(f,S){let k=xe(f,S);return E?null:k?k.actionType:be}function q(f,S){let k=xe(f,S);return k?k.blocked:!1}function Ue(f,S){let k=xe(f,S);return k?k.hidden:!1}function xe(f,S){if(E)return null;let k=C==null?void 0:C.find(v=>v.flowId===f);return!k||!k.stepStates[S]?null:k.stepStates[S]??null}function Se(f){var k;if(E||!C)return null;if(We(f)===Ae)return _(f)[0]??null;let S=(k=C.find(v=>v.flowId===f))==null?void 0:k.lastStepId;return S?_(f).find(v=>v.id===S):null}function me(f){let S=Se(f);if(!S)return 0;let k=_(f).findIndex(v=>v.id===S.id)??0;return A(f,S.id)===Fe&&k<_(f).length-1?k+1:k}function _e(f){if(!f.completionCriteria)return;let S=Ro(f.completionCriteria);if(S===null)return;let k=et(S),v=W(S);return v===0?void 0:k/v}function We(f){let S=C==null?void 0:C.find(k=>k.flowId===f);return S?S.flowState:null}function et(f){let S=_(f);return S.length===0?0:S.filter(v=>A(f,v.id)===Fe).length}function W(f){return _(f).length}function Ie(f){return JSON.parse(t.find(S=>S.slug===f).data)}function Be(f){if(E)return!0;if(f!=null&&f.targetingLogic&&C){let S=C.find(k=>k.flowId===f.slug);if(S)return S.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&i&&i.startsWith("guest_"))}function bo(f){return!Be(M(f))}return{getFlow:M,getFlowData:Ie,isLoading:E||U,getStepStatus:A,getFlowSteps:_,getCurrentStepIndex:me,markStepStarted:K,markStepCompleted:z,markFlowNotStarted:te,markFlowStarted:oe,markFlowCompleted:Z,markFlowAborted:$,markStepNotStarted:V,getFlowStatus:We,getNumberOfStepsCompleted:et,getNumberOfSteps:W,targetingLogicShouldHideFlow:Be,setCustomVariable:N,updateCustomVariables:j,customVariables:n,getStepOptionalProgress:_e,getFlowMetadata:H,isStepBlocked:q,isStepHidden:Ue,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:bo}}import{useCallback as er,useContext as Os,useEffect as Ls}from"react";var ht="guest_";function wo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Os(G),{config:n}=Ne(),{mutateUserFlowState:s}=Te(),p=ft(),{verifySDKInitiated:d}=gt();Ls(()=>{if(e&&!t){if(e.startsWith(ht))return;let m=`frigade-user-registered-${e}`;localStorage.getItem(m)||(p(`${ge}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(m,"true"))}},[e,r,t]);let l=er(async m=>{d();let h={foreignId:e,properties:m};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(h)}),i(F=>({...F,...m})),s()},[e,n,r,s]),g=er(async(m,h)=>{d();let x={foreignId:e,events:[{event:m,properties:h}]};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(x)}),s()},[e,n,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:g}}import{v4 as ia}from"uuid";import Oe,{useEffect as Rl,useState as ea}from"react";import He,{useEffect as Ws}from"react";import Qt from"styled-components";import Ds from"react";import Ms from"styled-components";var tr="fr-",Nt="cfr-";function a(e,t){let o=`${tr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Nt+e}return o}function w(e){if(!e.className||e.className.indexOf(Nt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(tr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Fo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function it(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Fo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function or(e){return e.charAt(0).toUpperCase()+e.slice(1)}var $s=Ms.div`
|
|
2
|
+
import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import{ThemeProvider as sa}from"styled-components";import lt,{useContext as ra,useEffect as lo,useState as $o}from"react";import{useCallback as rt,useContext as Bs,useEffect as As}from"react";import wo,{useMemo as ys}from"react";var Qo="1.32.23 ";var ge="https://api.frigade.com/v1/public/",be="NOT_STARTED_STEP",R="COMPLETED_FLOW",Yt="ABORTED_FLOW",ot="STARTED_FLOW",Ae="NOT_STARTED_FLOW",Fe="COMPLETED_STEP",Xt="STARTED_STEP";function Ne(){let{publicApiKey:e,userId:t}=wo.useContext(G);return{config:ys(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Qo,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function ft(){let{shouldGracefullyDegrade:e}=wo.useContext(G);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),Kt();let n;try{n=await fetch(t,o)}catch(i){return Kt(i)}return n?n.ok?n:Kt(n.statusText):Kt()}}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=wo.useContext(G);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as vs,useState as Zo}from"react";import{useContext as ws,useEffect as Ts,useState as Fs}from"react";import ks from"swr";import{useContext as bs}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o}=bs(G);function n(p,d=!1){return e[p]??d}function i(p,d){t(l=>({...l,[p]:d}))}function r(p){t(d=>{let{[p]:l,...f}=d;return{...f}})}function s(){return Object.values(e).some(p=>p)||o}return{getOpenFlowState:n,setOpenFlowState:i,resetOpenFlowState:r,hasOpenModals:s}}var Ps="unknown";function we(){let{config:e}=Ne(),{publicApiKey:t,userId:o,flows:n,setShouldGracefullyDegrade:i}=ws(G),{resetOpenFlowState:r}=ke(),[s,p]=Fs(!1),d={data:n.map(k=>({flowId:k.id,flowState:R,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=k=>fetch(k,e).then(c=>{if(c.ok)return c.json();throw new Error("Failed to fetch user flow states")}).catch(c=>(console.log(`Error fetching ${k}: ${c}. Will gracefully degrade and hide Frigade`),i(!0),d)),{data:f,isLoading:u,mutate:g,error:F}=ks(t&&n&&o?`${ge}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),b=f==null?void 0:f.data;Ts(()=>{!s&&!u&&b&&p(!0)},[b,s,u]);async function C(k){if(b){let c=b.find(h=>h.flowId===k);c&&c.flowState!==R&&(c.flowState=R),await g(Promise.resolve({...f,data:b}),{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}async function m(k,c,h){if(b){let y=b.find(E=>E.flowId===k);y&&(y.stepStates[c]=h,y.flowState=ot),await g(Promise.resolve({...f,data:b}),{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}async function v(k,c,h){if(b){let y=b.find(E=>E.flowId===k);y&&(y.lastStepId=c,y.stepStates[c]=h,y.flowState=ot),await g({...f,data:b},{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}async function w(k){if(b){let c=b.find(h=>h.flowId===k);c&&c.flowState!==Ae&&(c.flowState=Ae,c.lastStepId=Ps,Object.keys(c.stepStates).forEach(h=>{c.stepStates[h].actionType=be,c.stepStates[h].createdAt=new Date().toISOString()}),await g({...f,data:b},{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1}),r(k))}}async function B(k,c){if(b){let h=b.find(y=>y.flowId===k);h&&h.stepStates[c]!==be&&(h.stepStates[c]=be),await g({...f,data:b},{optimisticData:{...f,data:b},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:b,isLoadingUserFlowStateData:!s,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowNotStarted:w,optimisticallyMarkStepCompleted:m,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:v,error:F}}function At(){let{config:e}=Ne(),{userFlowStatesData:t,mutateUserFlowState:o}=we(),{failedFlowResponses:n,setFailedFlowResponses:i,flowResponses:r,setFlowResponses:s}=vs(G),[p,d]=Zo(new Set),[l,f]=Zo(new Set),u=ft();function g(C){let m=JSON.stringify(C);if(p.has(m))return null;p.add(m),d(p),l.add(C),f(l);let v=r==null?void 0:r.find(w=>w.flowSlug===C.flowSlug&&w.stepId===C.stepId&&w.actionType===C.actionType&&w.createdAt===C.createdAt);return u(`${ge}flowResponses`,{...e,method:"POST",body:m}).then(w=>{w.status!==200&&w.status!==201?(console.log("Failed to send flow response for step "+C.stepId+". Will retry again later."),i([...n,C])):v||s(B=>[...B??[],C])})}async function F(C){C.foreignUserId&&(C.actionType===ot||C.actionType===Ae?await g(C):C.actionType===R?await g(C):C.actionType===Xt?await g(C):C.actionType===Fe?await g(C):C.actionType===Yt?await g(C):C.actionType===be&&await g(C))}function b(){let C=[];return t==null||t.forEach(m=>{if(m&&m.stepStates&&Object.keys(m.stepStates).length!==0)for(let v in m.stepStates){let w=m.stepStates[v];C.push({foreignUserId:m.foreignUserId,flowSlug:m.flowId,stepId:w.stepId,actionType:w.actionType,data:{},createdAt:new Date(w.createdAt),blocked:w.blocked,hidden:w.hidden})}}),[...C,...r]}return{addResponse:F,setFlowResponses:s,getFlowResponses:b}}import Ns from"swr";var Is=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Ro=e=>{let t=Is.exec(e);if(t===null)return null;let o=null;return t.forEach((n,i)=>{let r=Es(n,"'","");r.startsWith("flow_")&&(o=r)}),o},Es=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Ne(),{flows:t,setFlows:o,userId:n,publicApiKey:i,customVariables:r,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:f}=Bs(G),u={data:[]},{verifySDKInitiated:g}=gt(),{addResponse:F,getFlowResponses:b}=At(),C=x=>fetch(x,e).then(S=>S.ok?S.json():(console.log(`Error fetching ${x} (${S.status}): ${S.statusText}. .Will gracefully degrade and hide Frigade`),f(!0),u)).catch(S=>(console.log(`Error fetching ${x}: ${S}. Will gracefully degrade and hide Frigade`),f(!0),u)),{userFlowStatesData:m,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:c,optimisticallyMarkStepStarted:h}=we(),{data:y,error:E,isLoading:U}=Ns(i?`${ge}flows`:null,C,{keepPreviousData:!0});As(()=>{if(E){console.error(E);return}y&&y.data&&(y.data=o(y.data))},[y,E]);function M(x){if(U)return null;let S=t.find(P=>P.slug===x);return!S&&t.length>0&&!v&&!U?(console.log(`Flow with slug ${x} not found`),null):(S==null?void 0:S.active)===!1?null:S}function _(x){var I;if(!M(x))return[];let S=M(x).data;return S?(S=O(S),(((I=JSON.parse(S))==null?void 0:I.data)??[]).map(Y=>{let tt=_e(Y);return{handleSecondaryButtonClick:()=>{Y.skippable===!0&&z(x,Y.id,{skipped:!0})},...Y,complete:A(x,Y.id)===Fe||tt>=1,blocked:q(x,Y.id),hidden:Ue(x,Y.id),handlePrimaryButtonClick:()=>{(!Y.completionCriteria&&(Y.autoMarkCompleted||Y.autoMarkCompleted===void 0)||Y.completionCriteria&&Y.autoMarkCompleted===!0)&&z(x,Y.id)},progress:tt}}).filter(Y=>Y.hidden!==!0)):[]}function O(x){return x.replace(/\${(.*?)}/g,(S,P)=>r[P]!==void 0?String(r[P]):"")}function H(x){if(!M(x))return[];let S=M(x).data;return S?(S=O(S),JSON.parse(S)??{}):[]}function N(x,S){s(P=>({...P,[x]:S}))}function j(x){!v&&!U&&x&&JSON.stringify(r)!=JSON.stringify({...r,...x})&&Object.keys(x).forEach(S=>{N(S,x[S])})}let K=rt(async(x,S,P)=>{g();let I={foreignUserId:n,flowSlug:x,stepId:S,actionType:Xt,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(I)&&(await h(x,S,I),F(I))},[n,m]),V=rt(async(x,S,P)=>{g();let I={foreignUserId:n,flowSlug:x,stepId:S,actionType:be,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(I)&&(await c(x,S),F(I))},[n,m]),z=rt(async(x,S,P)=>{g();let I={foreignUserId:n,flowSlug:x,stepId:S,actionType:Fe,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(I)&&(await k(x,S,I),F(I))},[n,m]),te=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:Ae,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};await B(x),J(P)&&F(P)},[n,m]),oe=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:ot,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&F(P)},[n,m]),Z=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:R,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await w(x),F(P))},[n,m]),$=rt(async(x,S)=>{g();let P={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:Yt,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await w(x),F(P))},[n,m]);function J(x){var S;if(!m&&x.actionType===be)return!1;if(m){let P=m.find(I=>I.flowId===x.flowSlug);if(x.actionType===be&&(!(P!=null&&P.stepStates[x.stepId])||P.stepStates[x.stepId].actionType===be)||P&&((S=P.stepStates[x.stepId])==null?void 0:S.actionType)===x.actionType)return!1}return!0}function A(x,S){let P=xe(x,S);return v?null:P?P.actionType:be}function q(x,S){let P=xe(x,S);return P?P.blocked:!1}function Ue(x,S){let P=xe(x,S);return P?P.hidden:!1}function xe(x,S){if(v)return null;let P=m==null?void 0:m.find(I=>I.flowId===x);return!P||!P.stepStates[S]?null:P.stepStates[S]??null}function ye(x){var P;if(v||!m)return null;if(We(x)===Ae)return _(x)[0]??null;let S=(P=m.find(I=>I.flowId===x))==null?void 0:P.lastStepId;return S?_(x).find(I=>I.id===S):null}function me(x){let S=ye(x);if(!S)return 0;let P=_(x).findIndex(I=>I.id===S.id)??0;return A(x,S.id)===Fe&&P<_(x).length-1?P+1:P}function _e(x){if(!x.completionCriteria)return;let S=Ro(x.completionCriteria);if(S===null)return;let P=et(S),I=W(S);return I===0?void 0:P/I}function We(x){let S=m==null?void 0:m.find(P=>P.flowId===x);return S?S.flowState:null}function et(x){let S=_(x);return S.length===0?0:S.filter(I=>A(x,I.id)===Fe).length}function W(x){return _(x).length}function Ee(x){return JSON.parse(t.find(S=>S.slug===x).data)}function Be(x){if(v)return!0;if(x!=null&&x.targetingLogic&&m){let S=m.find(P=>P.flowId===x.slug);if(S)return S.shouldTrigger===!1}return!!(x!=null&&x.targetingLogic&&n&&n.startsWith("guest_"))}function bo(x){return!Be(M(x))}return{getFlow:M,getFlowData:Ee,isLoading:v||U,getStepStatus:A,getFlowSteps:_,getCurrentStepIndex:me,markStepStarted:K,markStepCompleted:z,markFlowNotStarted:te,markFlowStarted:oe,markFlowCompleted:Z,markFlowAborted:$,markStepNotStarted:V,getFlowStatus:We,getNumberOfStepsCompleted:et,getNumberOfSteps:W,targetingLogicShouldHideFlow:Be,setCustomVariable:N,updateCustomVariables:j,customVariables:r,getStepOptionalProgress:_e,getFlowMetadata:H,isStepBlocked:q,isStepHidden:Ue,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:bo}}import{useCallback as er,useContext as Os,useEffect as Ls}from"react";var ht="guest_";function To(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:i}=Os(G),{config:r}=Ne(),{mutateUserFlowState:s}=we(),p=ft(),{verifySDKInitiated:d}=gt();Ls(()=>{if(e&&!t){if(e.startsWith(ht))return;let u=`frigade-user-registered-${e}`;localStorage.getItem(u)||(p(`${ge}users`,{...r,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(u,"true"))}},[e,i,t]);let l=er(async u=>{d();let g={foreignId:e,properties:u};await p(`${ge}users`,{...r,method:"POST",body:JSON.stringify(g)}),n(F=>({...F,...u})),s()},[e,r,i,s]),f=er(async(u,g)=>{d();let b={foreignId:e,events:[{event:u,properties:g}]};await p(`${ge}users`,{...r,method:"POST",body:JSON.stringify(b)}),s()},[e,r,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:f}}import{v4 as ia}from"uuid";import Oe,{useEffect as Rl,useState as ea}from"react";import He,{useEffect as Ws}from"react";import Qt from"styled-components";import Ds from"react";import Ms from"styled-components";var tr="fr-",Nt="cfr-";function a(e,t){let o=`${tr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Nt+e}return o}function T(e){if(!e.className||e.className.indexOf(Nt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(tr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Fo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function it(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Fo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function or(e){return e.charAt(0).toUpperCase()+e.slice(1)}var $s=Ms.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>T(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -28,7 +28,7 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
30
|
`,Pe=()=>Jt.createElement(_s,null,Jt.createElement("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jt.createElement("rect",{y:"1.39844",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(-45 0 1.39844)",fill:"currentColor"}),Jt.createElement("rect",{x:"12.6023",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(45 12.6023 0)",fill:"currentColor"})));import{Portal as Hs}from"react-portal";var zs=Qt.div`
|
|
31
|
-
${e=>
|
|
31
|
+
${e=>T(e)} {
|
|
32
32
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
33
33
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
34
34
|
/* Mobile */
|
|
@@ -80,7 +80,7 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
80
80
|
right: 24px;
|
|
81
81
|
cursor: pointer;
|
|
82
82
|
z-index: 1501;
|
|
83
|
-
${e=>
|
|
83
|
+
${e=>T(e)} {
|
|
84
84
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
85
85
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
86
86
|
}
|
|
@@ -91,8 +91,8 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
91
91
|
::-webkit-scrollbar {
|
|
92
92
|
display: none;
|
|
93
93
|
}
|
|
94
|
-
`,Ye=({onClose:e,visible:t,headerContent:o=null,style:
|
|
95
|
-
${e=>
|
|
94
|
+
`,Ye=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:i,appearance:r,dismissible:s=!0})=>(Ws(()=>{let p=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?He.createElement(Hs,null,He.createElement(rr,{appearance:r,onClose:()=>{s&&e()}}),He.createElement(zs,{appearance:r,className:a("modalContainer",r),styleOverrides:n},s&&He.createElement(js,{className:a("modalClose",r),onClick:()=>e(),appearance:r},He.createElement(Pe,null)),o&&He.createElement(Gs,null,o),He.createElement(Vs,null,i))):He.createElement(He.Fragment,null));import Xe,{useEffect as qs}from"react";import Zt from"styled-components";import{Portal as Ks}from"react-portal";var Ys=Zt.div`
|
|
95
|
+
${e=>T(e)} {
|
|
96
96
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
97
97
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
98
98
|
position: fixed;
|
|
@@ -118,7 +118,7 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
118
118
|
right: 24px;
|
|
119
119
|
cursor: pointer;
|
|
120
120
|
z-index: 1501;
|
|
121
|
-
${e=>
|
|
121
|
+
${e=>T(e)} {
|
|
122
122
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
123
123
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
124
124
|
}
|
|
@@ -128,8 +128,8 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
128
128
|
::-webkit-scrollbar {
|
|
129
129
|
display: none;
|
|
130
130
|
}
|
|
131
|
-
`,ir=({onClose:e,visible:t,headerContent:o=null,children:
|
|
132
|
-
${e=>
|
|
131
|
+
`,ir=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:i})=>(qs(()=>{let r=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",r),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",r)}},[e,t]),t?Xe.createElement(Ks,null,Xe.createElement(Ys,{appearance:i,className:a("cornerModalContainer",i)},Xe.createElement(Js,{className:a("cornerModalClose",i),onClick:()=>e()},Xe.createElement(Pe,null)),o&&Xe.createElement(Xs,null,o),Xe.createElement(Qs,null,n))):Xe.createElement(Xe.Fragment,null));import{useContext as Zs}from"react";function Q(){let{defaultAppearance:e}=Zs(G);function t(o){let n=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(n.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(n.theme,o.theme??{})}:n}return{mergeAppearanceWithDefault:t}}import to,{useEffect as pl,useState as Sr}from"react";import yr from"styled-components";import vo,{useEffect as Rs,useState as ar}from"react";import Io from"styled-components";import ko from"styled-components";var nr=ko.label`
|
|
132
|
+
${e=>T(e)} {
|
|
133
133
|
font-size: 14px;
|
|
134
134
|
line-height: 20px;
|
|
135
135
|
margin-bottom: 5px;
|
|
@@ -149,12 +149,12 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
149
149
|
align-items: flex-start;
|
|
150
150
|
justify-content: left;
|
|
151
151
|
margin-bottom: 10px;
|
|
152
|
-
`;import Po from"react";function nt({title:e,required:t,appearance:o}){return Po.createElement(lr,null,t?Po.createElement(sr,null,"*"):null,Po.createElement(nr,{className:a("formLabel",o)},e))}var el=
|
|
152
|
+
`;import Po from"react";function nt({title:e,required:t,appearance:o}){return Po.createElement(lr,null,t?Po.createElement(sr,null,"*"):null,Po.createElement(nr,{className:a("formLabel",o)},e))}var el=Io.div`
|
|
153
153
|
display: flex;
|
|
154
154
|
flex-direction: column;
|
|
155
155
|
width: 100%;
|
|
156
|
-
`,Io
|
|
157
|
-
${e=>
|
|
156
|
+
`,Eo=Io.input`
|
|
157
|
+
${e=>T(e)} {
|
|
158
158
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
159
159
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
160
160
|
font-size: 14px;
|
|
@@ -169,8 +169,8 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
169
169
|
box-sizing: border-box;
|
|
170
170
|
padding: 0 10px;
|
|
171
171
|
margin-bottom: 10px;
|
|
172
|
-
`,tl=
|
|
173
|
-
${e=>
|
|
172
|
+
`,tl=Io.textarea`
|
|
173
|
+
${e=>T(e)} {
|
|
174
174
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
175
175
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
176
176
|
font-size: 14px;
|
|
@@ -185,14 +185,14 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
185
185
|
min-height: 70px;
|
|
186
186
|
box-sizing: border-box;
|
|
187
187
|
margin-bottom: 10px;
|
|
188
|
-
`;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i}){let r=e,[
|
|
188
|
+
`;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:i}){let r=e,[s,p]=ar((i==null?void 0:i.text)||""),[d,l]=ar(!1),f=Eo;Rs(()=>{s===""&&!d&&(l(!0),u(""))},[]);function u(g){if(p(g),r.required===!0&&g.trim()===""){n([{id:r.id,message:`${r.title} is required`}]);return}n([]),o({text:g})}return r.multiline&&(f=tl),vo.createElement(el,null,vo.createElement(nt,{title:r.title,required:r.required,appearance:t.appearance}),vo.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:g=>{u(g.target.value)},appearance:t.appearance,placeholder:r.placeholder}))}import ze,{useEffect as dr,useState as cr}from"react";import mr from"styled-components";var ol=mr.div`
|
|
189
189
|
display: flex;
|
|
190
190
|
flex-direction: column;
|
|
191
191
|
width: 100%;
|
|
192
192
|
-webkit-appearance: none;
|
|
193
193
|
appearance: none;
|
|
194
194
|
`,rl=mr.select`
|
|
195
|
-
${e=>
|
|
195
|
+
${e=>T(e)} {
|
|
196
196
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
197
197
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
198
198
|
font-size: 14px;
|
|
@@ -215,14 +215,14 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
215
215
|
background-repeat: no-repeat;
|
|
216
216
|
background-size: 1.5em 1.5em;
|
|
217
217
|
-webkit-print-color-adjust: exact;
|
|
218
|
-
`,Rt="null";function ur({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i}){var
|
|
218
|
+
`,Rt="null";function ur({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:i}){var f,u,g,F,b,C;let r=e,[s,p]=cr(((f=n==null?void 0:n.choice)==null?void 0:f[0])||""),[d,l]=cr(!1);return dr(()=>{var m,v,w,B;if(s===""&&!d){if(l(!0),r.requireSelection){p(Rt);return}if(r.defaultValue&&((m=r.props.options)!=null&&m.find(k=>k.id===r.defaultValue))){let k=(v=r.props.options)==null?void 0:v.find(c=>c.id===r.defaultValue);p(k.id),o({choice:[k.id]})}else p(((w=r.props.options)==null?void 0:w[0].id)||""),o({choice:[((B=r.props.options)==null?void 0:B[0].id)||""]})}},[]),dr(()=>{r.requireSelection&&s===Rt?i([{message:"Please select an option",id:r.id}]):i([])},[s]),ze.createElement(ol,null,ze.createElement(nt,{title:r.title,required:!1,appearance:t.appearance}),ze.createElement(rl,{value:s,onChange:m=>{p(m.target.value),o({choice:[m.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&ze.createElement("option",{key:Rt,value:Rt},"Select an option"),(u=r.props.options)==null?void 0:u.map(m=>ze.createElement("option",{key:m.id,value:m.id},m.title))),((F=(g=r.props.options)==null?void 0:g.find(m=>m.id===s))==null?void 0:F.isOpenEnded)&&ze.createElement(ze.Fragment,null,ze.createElement(nt,{title:((C=(b=r.props.options)==null?void 0:b.find(m=>m.id===s))==null?void 0:C.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),ze.createElement(Eo,{type:"text",placeholder:"Enter your answer here",onChange:m=>{o({choice:[m.target.value]})},appearance:t.appearance})))}import Bo,{useEffect as fr,useState as gr}from"react";import hr from"styled-components";var il=hr.div`
|
|
219
219
|
display: flex;
|
|
220
220
|
flex-direction: column;
|
|
221
221
|
width: 100%;
|
|
222
222
|
-webkit-appearance: none;
|
|
223
223
|
appearance: none;
|
|
224
224
|
`,nl=hr.button`
|
|
225
|
-
${e=>
|
|
225
|
+
${e=>T(e)} {
|
|
226
226
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
227
227
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
228
228
|
font-size: 14px;
|
|
@@ -243,8 +243,8 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
243
243
|
height: 60px;
|
|
244
244
|
padding: 0 18px;
|
|
245
245
|
margin-bottom: 10px;
|
|
246
|
-
`;function xr({formInput:e,customFormTypeProps:t,onSaveInputData:o}){var
|
|
247
|
-
${e=>
|
|
246
|
+
`;function xr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n}){var l;let i=e,[r,s]=gr(n.choice||[]),[p,d]=gr(!1);return fr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[]),fr(()=>{o({choice:r})},[r]),Bo.createElement(il,null,Bo.createElement(nt,{title:i.title,required:i.required,appearance:t.appearance}),(l=i.props.options)==null?void 0:l.map(f=>Bo.createElement(nl,{appearance:t.appearance,key:f.id,value:f.id,"data-selected":r.includes(f.id),onClick:()=>{if(r.includes(f.id)){s(r.filter(u=>u!==f.id));return}r.length<i.props.maxChoices?s([...r,f.id]):r.length==1&&i.props.maxChoices==1&&s([f.id])}},f.title)))}import eo from"react";import Cr from"styled-components";import sl from"dompurify";function se(e){return{__html:sl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var ll=Cr.h1`
|
|
247
|
+
${e=>T(e)} {
|
|
248
248
|
font-style: normal;
|
|
249
249
|
font-weight: 600;
|
|
250
250
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -255,28 +255,28 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
255
255
|
color: ${e=>e.appearance.theme.colorText};
|
|
256
256
|
}
|
|
257
257
|
`,al=Cr.h2`
|
|
258
|
-
${e=>
|
|
258
|
+
${e=>T(e)} {
|
|
259
259
|
font-style: normal;
|
|
260
260
|
font-weight: 400;
|
|
261
261
|
font-size: 15px;
|
|
262
262
|
line-height: 20px;
|
|
263
263
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
264
264
|
}
|
|
265
|
-
`;function
|
|
265
|
+
`;function Te({appearance:e,title:t,subtitle:o,size:n="medium"}){return eo.createElement(eo.Fragment,null,eo.createElement(ll,{appearance:e,className:a(`${n}Title`,e),dangerouslySetInnerHTML:se(t),size:n}),eo.createElement(al,{appearance:e,className:a(`${n}Subtitle`,e),dangerouslySetInnerHTML:se(o),size:n}))}var dl=yr.div`
|
|
266
266
|
display: flex;
|
|
267
267
|
flex-direction: column;
|
|
268
268
|
justify-content: flex-end;
|
|
269
269
|
padding-bottom: 14px;
|
|
270
270
|
overflow: visible;
|
|
271
|
-
`,cl=
|
|
271
|
+
`,cl=yr.div`
|
|
272
272
|
padding-left: 1px;
|
|
273
273
|
padding-right: 1px;
|
|
274
|
-
`,ml={text:pr,multipleChoice:ur,multipleChoiceList:xr};function br({stepData:e,canContinue:t,setCanContinue:o,onSaveData:
|
|
274
|
+
`,ml={text:pr,multipleChoice:ur,multipleChoiceList:xr};function br({stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:i,customFormElements:r}){var C;let s=e.props,[p,d]=Sr(F()||{}),[l,f]=Sr([]),u={...ml,...r};pl(()=>{o(l.length===0)},[l,o]);function g(m,v){let w={...p,[m.id]:v};d(w),n(w),window&&window.localStorage&&window.localStorage.setItem(b(),JSON.stringify(w))}function F(){if(window&&window.localStorage){let m=window.localStorage.getItem(b());if(m)return JSON.parse(m)}return{}}function b(){return`frigade-multiInputStepTypeData-${e.id}`}return to.createElement(cl,{className:a("multiInput",i)},to.createElement(Te,{appearance:i,title:e.title,subtitle:e.subtitle}),to.createElement(dl,{className:a("multiInputContainer",i)},(C=s.data)==null?void 0:C.map(m=>u[m.type]?to.createElement("span",{key:m.id},u[m.type]({formInput:m,customFormTypeProps:{stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:i},onSaveInputData:v=>{g(m,v)},inputData:p[m.id],setFormValidationErrors:v=>{f(w=>v.length===0?w.filter(B=>B.id!==m.id):[...w,...v])}})):null)))}import xt from"styled-components";var wr=xt.div`
|
|
275
275
|
align-items: center;
|
|
276
276
|
display: flex;
|
|
277
277
|
justify-content: space-between;
|
|
278
278
|
padding-top: 14px;
|
|
279
|
-
`,
|
|
279
|
+
`,Tr=xt.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
gap: 12px;
|
|
282
282
|
`,Fr=xt.div`
|
|
@@ -307,10 +307,10 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
307
307
|
background-position: center;
|
|
308
308
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
309
309
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
310
|
-
`;import Ot from"react";import ul from"react";import
|
|
310
|
+
`;import Ot from"react";import ul from"react";import Ir from"styled-components";var fl=Ir.button`
|
|
311
311
|
justify-content: center;
|
|
312
312
|
align-content: center;
|
|
313
|
-
${e=>
|
|
313
|
+
${e=>T(e)} {
|
|
314
314
|
display: flex;
|
|
315
315
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
316
316
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -318,8 +318,8 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
318
318
|
${e=>e.withMargin?"margin: 16px 0px 16px 0px;":""}
|
|
319
319
|
|
|
320
320
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary}};
|
|
321
|
-
color: ${e=>{var t,o,i
|
|
322
|
-
background-color: ${e=>{var t,o,i
|
|
321
|
+
color: ${e=>{var t,o,n,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary:(i=(n=e.appearance)==null?void 0:n.theme)==null?void 0:i.colorTextOnPrimaryBackground}};
|
|
322
|
+
background-color: ${e=>{var t,o,n,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground:(i=(n=e==null?void 0:e.appearance)==null?void 0:n.theme)==null?void 0:i.colorPrimary}};
|
|
323
323
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
324
324
|
padding: ${e=>e.size=="small"?"6px 14px 6px 14px":"8px 20px 8px 20px"};
|
|
325
325
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
@@ -337,8 +337,8 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
337
337
|
opacity: 0.3;
|
|
338
338
|
cursor: not-allowed;
|
|
339
339
|
}
|
|
340
|
-
`,oo=
|
|
341
|
-
${e=>
|
|
340
|
+
`,oo=Ir.div`
|
|
341
|
+
${e=>T(e)} {
|
|
342
342
|
display: flex;
|
|
343
343
|
flex-direction: row;
|
|
344
344
|
justify-content: flex-start;
|
|
@@ -347,14 +347,14 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
347
347
|
margin-right: 8px;
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
`,ee=({onClick:e,title:t,style:o,disabled:
|
|
350
|
+
`,ee=({onClick:e,title:t,style:o,disabled:n,type:i="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l=""})=>{function f(){let u=s?"buttonSecondary":"button";return l===""?u:`${l}${or(u)}`}return ul.createElement(fl,{secondary:s,appearance:p,disabled:n,onClick:e,style:o,type:i,withMargin:d,size:r,className:a(f(),p)},t)};var Er=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:i,formType:r,selectedStep:s,steps:p,onBack:d,allowBackNavigation:l})=>{let f=r==="inline"?"inline":"full-width";return Ot.createElement(wr,{className:a("formCTAContainer",o)},p.length>1&&s!=0&&l&&Ot.createElement(ee,{title:"\u2190",onClick:d,secondary:!0,withMargin:!1,type:f,appearance:o}),Ot.createElement(Tr,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?Ot.createElement(ee,{title:e.secondaryButtonTitle,onClick:i,secondary:!0,withMargin:!1,type:f,appearance:o}):null," ",e.primaryButtonTitle?Ot.createElement(ee,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:f,appearance:o}):null))};import Ao from"react";import gl from"styled-components";var hl=gl.div`
|
|
351
351
|
text-align: center;
|
|
352
|
-
`,Br=({stepCount:e=0,currentStep:t=0,className:o,appearance:
|
|
352
|
+
`,Br=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:i}=Q().mergeAppearanceWithDefault(n);return Ao.createElement(hl,{className:o},Ao.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Ao.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?i.colorPrimary:"#E6E6E6"}))))};import st from"react";import Ct from"styled-components";import{useContext as xl}from"react";function le(){let e=xl(G);function t(i){n(i.primaryButtonUri,i.primaryButtonUriTarget)}function o(i){n(i.secondaryButtonUri,i.secondaryButtonUriTarget)}function n(i,r){if(!i)return;let s=i.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(i,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:n}}var Cl=Ct.div`
|
|
353
353
|
display: flex;
|
|
354
354
|
flex-wrap: wrap;
|
|
355
355
|
align-content: center;
|
|
356
356
|
justify-content: center;
|
|
357
|
-
`,
|
|
357
|
+
`,Sl=Ct.div`
|
|
358
358
|
align-content: center;
|
|
359
359
|
align-items: center;
|
|
360
360
|
display: flex;
|
|
@@ -368,7 +368,7 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
368
368
|
flex-basis: 255px;
|
|
369
369
|
flex-grow: 0;
|
|
370
370
|
flex-shrink: 0;
|
|
371
|
-
`,
|
|
371
|
+
`,yl=Ct.img`
|
|
372
372
|
width: 78px;
|
|
373
373
|
height: auto;
|
|
374
374
|
`,bl=Ct.button`
|
|
@@ -384,11 +384,11 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
384
384
|
border-radius: 100px;
|
|
385
385
|
padding: 8px 12px;
|
|
386
386
|
margin-top: 16px;
|
|
387
|
-
`,
|
|
387
|
+
`,wl=Ct.h1`
|
|
388
388
|
font-weight: 700;
|
|
389
389
|
font-size: 28px;
|
|
390
390
|
line-height: 34px;
|
|
391
|
-
`,
|
|
391
|
+
`,Tl=Ct.h2`
|
|
392
392
|
font-style: normal;
|
|
393
393
|
font-weight: 400;
|
|
394
394
|
font-size: 16px;
|
|
@@ -397,7 +397,7 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
397
397
|
margin-top: 12px;
|
|
398
398
|
margin-bottom: 16px;
|
|
399
399
|
max-width: 70%;
|
|
400
|
-
`;function Ar({stepData:e,appearance:t}){var i
|
|
400
|
+
`;function Ar({stepData:e,appearance:t}){var n,i;let{handleUrl:o}=le();return st.createElement("div",null,st.createElement(wl,null,e.title),st.createElement(Tl,null,e.subtitle),st.createElement(Cl,null,(i=(n=e.props)==null?void 0:n.links)==null?void 0:i.map(r=>st.createElement(Sl,{key:r.title},st.createElement(yl,{src:r.imageUri}),st.createElement(bl,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{r.uri&&o(r.uri,r.uriTarget??"_blank")}},r.title)))))}import yt,{useEffect as Bl}from"react";import no from"styled-components";import No from"react";var ro=({style:e,className:t})=>No.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},No.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),No.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Lt,{useRef as Fl,useState as kl}from"react";import io from"styled-components";var Pl=io.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
align-items: center;
|
|
403
403
|
justify-content: flex-start;
|
|
@@ -424,43 +424,43 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
424
424
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
425
425
|
border-radius: 50%;
|
|
426
426
|
}
|
|
427
|
-
`,
|
|
427
|
+
`,Il=io.video`
|
|
428
428
|
width: 100%;
|
|
429
429
|
height: 100%;
|
|
430
430
|
min-height: 200px;
|
|
431
431
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
432
|
-
`,
|
|
432
|
+
`,El=io.iframe`
|
|
433
433
|
width: 100%;
|
|
434
434
|
height: 100%;
|
|
435
435
|
min-height: 200px;
|
|
436
436
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
437
|
-
`;function
|
|
438
|
-
${e=>
|
|
437
|
+
`;function St({appearance:e,videoUri:t}){let o=Fl(),[n,i]=kl(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Lt.createElement(El,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Lt.createElement(Pl,{appearance:e},!n&&Lt.createElement(vl,{onClick:()=>{i(!0),o.current.play()},appearance:e},Lt.createElement(ro,null)),Lt.createElement(Il,{appearance:e,controls:n,ref:o,play:n,src:t}))}var Al=no.div`
|
|
438
|
+
${e=>T(e)} {
|
|
439
439
|
display: flex;
|
|
440
440
|
flex-direction: column;
|
|
441
441
|
justify-content: center;
|
|
442
442
|
}
|
|
443
443
|
`,Nl=no.img`
|
|
444
|
-
${e=>
|
|
444
|
+
${e=>T(e)} {
|
|
445
445
|
width: 100%;
|
|
446
446
|
height: auto;
|
|
447
447
|
max-height: 250px;
|
|
448
448
|
margin-bottom: 24px;
|
|
449
449
|
}
|
|
450
450
|
`,Ol=no.div`
|
|
451
|
-
${e=>
|
|
451
|
+
${e=>T(e)} {
|
|
452
452
|
margin-bottom: 24px;
|
|
453
453
|
}
|
|
454
454
|
`,Ll=no.div`
|
|
455
|
-
${e=>
|
|
455
|
+
${e=>T(e)} {
|
|
456
456
|
width: 100%;
|
|
457
457
|
height: auto;
|
|
458
458
|
max-height: 250px;
|
|
459
459
|
margin-bottom: 24px;
|
|
460
460
|
}
|
|
461
|
-
`;function Nr({stepData:e,appearance:t,setCanContinue:o}){return Bl(()=>{o(!0)},[]),
|
|
461
|
+
`;function Nr({stepData:e,appearance:t,setCanContinue:o}){return Bl(()=>{o(!0)},[]),yt.createElement(Al,{className:a("callToActionContainer",t)},yt.createElement(Ol,{className:a("callToActionTextContainer",t)},yt.createElement(Te,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&yt.createElement(Nl,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&yt.createElement(Ll,{appearance:t,className:a("callToActionVideo",t)},yt.createElement(St,{appearance:t,videoUri:e.videoUri})))}import Ge,{useEffect as Oo,useState as Lo}from"react";import $t from"react";import Dt from"react";import{motion as Dl}from"framer-motion";var Or=({color:e,percentage:t,size:o})=>{let n=o*.5-2,i=2*Math.PI*n,r=(1-t)*i,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:i,transition:s},show:{strokeDashoffset:r,transition:s}};return Dt.createElement(Dl.circle,{r:n,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==i?e:"",strokeWidth:"3px",strokeDasharray:i,strokeDashoffset:t?r:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Ml=({fillColor:e,size:t,percentage:o,children:n,bgColor:i="#D9D9D9"})=>Dt.createElement("svg",{width:t,height:t,overflow:"visible"},Dt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Dt.createElement(Or,{color:i,size:t}),Dt.createElement(Or,{color:e,percentage:o,size:t})),n),Mt=Ml;import $l from"styled-components";var Ul=({color:e="#FFFFFF"})=>$t.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$t.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),_l={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Wl={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Hl={border:"1px solid #000000",color:"#FFFFFF"},zl={border:"1px solid #E6E6E6"},Gl={color:"#FFFFFF"},jl={border:"3px solid #D9D9D9"},Vl=e=>e==="square"?_l:Wl,ql=(e,t)=>e==="square"?t?Hl:zl:t?Gl:jl,Kl=$l.div`
|
|
462
462
|
${e=>it(e)}
|
|
463
|
-
`,bt=({value:e,type:t="square",primaryColor:o="#000000",progress:
|
|
463
|
+
`,bt=({value:e,type:t="square",primaryColor:o="#000000",progress:n,appearance:i})=>{let r=Vl(t),s=ql(t,e);return e===!0?r={...r,...s,backgroundColor:o,borderColor:t==="square"?o:"none"}:r={...r,...s},e!==!0&&t==="round"&&n!==void 0&&n!==1?$t.createElement(Mt,{fillColor:o,percentage:n,size:22}):$t.createElement(Kl,{styleOverrides:r,role:"checkbox",className:Ce(a("checkIconContainer",i),e?"checkIconContainerChecked":"checkIconContainerUnchecked")},e&&$t.createElement(Ul,{color:"#FFFFFF"}))};import Je from"styled-components";var Lr=Je.div`
|
|
464
464
|
width: auto;
|
|
465
465
|
display: flex;
|
|
466
466
|
flex-direction: column;
|
|
@@ -513,8 +513,8 @@ import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import
|
|
|
513
513
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
514
514
|
display: flex;
|
|
515
515
|
align-self: center;
|
|
516
|
-
`;var zr=({stepData:e,setCanContinue:t,onSaveData:o,appearance:
|
|
517
|
-
${
|
|
516
|
+
`;var zr=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let i=e.props,[r,s]=Lo([]),[p,d]=Lo(!1),[l,f]=Lo(e.id);return Oo(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Oo(()=>{l!==e.id&&(f(e.id),s([]))},[e]),Oo(()=>{o({choice:r}),r.length>=i.minChoices?t(!0):t(!1)},[r]),Ge.createElement(Lr,{className:a("selectListContainer",n)},Ge.createElement(Dr,null,Ge.createElement(Mr,{className:a("selectListTitle",n)},e.title),Ge.createElement($r,{appearance:n,className:a("selectListSubtitle",n)},e.subtitle)),i.options.map((u,g)=>{let F=r.includes(u.id);return Ge.createElement(Ur,{key:`select-item-${g}`,onClick:()=>{if(r.includes(u.id)){s(r.filter(b=>b!==u.id));return}r.length<i.maxChoices?s([...r,u.id]):r.length==1&&i.maxChoices==1&&s([u.id])},hideBottomBorder:g===i.options.length-1,className:a("selectListSelectItem",n)},Ge.createElement(_r,{className:a("selectListItemImage",n)},u.imageUri&&Ge.createElement(Wr,{src:u.imageUri,alt:`select-icon-${g}`}),Ge.createElement(Hr,{appearance:n,className:a("selectListSelectItemText",n)},u.title)),Ge.createElement(bt,{appearance:n,value:F,primaryColor:n.theme.colorPrimary}))}))};import ue,{useEffect as Yl,useState as Do}from"react";import{AnimatePresence as Xl,motion as Jl}from"framer-motion";var Ql=({children:e,id:t,shouldWrap:o=!1})=>ue.createElement(ue.Fragment,null,o?ue.createElement(Xl,{initial:!1},ue.createElement(Jl.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),so=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:i,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:f,setVisible:u,setShowModal:g,onDismiss:F,showPagination:b=!1,customFormElements:C,allowBackNavigation:m})=>{let w={...{linkCollection:Ar,multiInput:br,callToAction:Nr,selectList:zr},...n},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:k}=le(),[c,h]=Do(!1),[y,E]=Do({}),[U,M]=Do(!1),_=t[o]??null,{markStepCompleted:O,markStepStarted:H,isLoading:N,updateCustomVariables:j,markFlowCompleted:K}=X();Yl(()=>{j(i)},[i,N]);function V(){return{data:y[t[o].id]??{},stepId:t[o].id,customVariables:i}}function z($,J,A){let q=o+1<t.length?t[o+1]:null;r&&r($,o,J,q),s&&s($,A,q,y,V())}function te($,J){E(A=>{let q={};return q[$.id]=J,{...A,...q}})}function oe($){return $.selectedStep.imageUri?ue.createElement(vr,{image:$.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Z=ue.createElement(Er,{step:t[o],canContinue:c||!U,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{M(!0);let $={...V()};await O(p,t[o].id,$),o+1<t.length&&await H(p,t[o+1].id),z(t[o],"primary",o),o+1>=t.length&&(f&&f(),F&&F(),l&&(u&&u(!1),g(!1)),await K(p)),B(t[o]),M(!1)},onSecondaryClick:()=>{z(t[o],"secondary",o),k(t[o])},onBack:async()=>{o-1>=0&&(M(!0),await H(p,t[o-1].id),M(!1))},steps:t,allowBackNavigation:m});return ue.createElement(ue.Fragment,null,ue.createElement(Fr,{className:a("formContainer",e)},ue.createElement(kr,null,ue.createElement(Ql,{id:o,shouldWrap:d==="large-modal"},ue.createElement(Pr,{key:_.id,type:d,className:a("formContent",e)},t.map($=>{let J=w[$.type];return _.id!==$.id?null:ue.createElement(J,{key:$.id,stepData:$,canContinue:c,setCanContinue:h,onSaveData:A=>{te($,A)},appearance:e,customFormElements:C})}),b&&ue.createElement(Br,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Z))),d=="large-modal"&&ue.createElement(oe,{selectedStep:t[o]})))};import Ut from"react";import{createGlobalStyle as Zl}from"styled-components";function pe({appearance:e}){if(!e||!e.styleOverrides)return Ut.createElement(Ut.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([n,i])=>typeof i=="object");if(t.length===0)return Ut.createElement(Ut.Fragment,null);let o=Zl`
|
|
517
|
+
${n=>n.inlineStyles.map(([i,r])=>`.${Nt}${i}.${Nt}${i} { ${Object.entries(r).map(([s,p])=>`${Fo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Ut.createElement(o,{inlineStyles:t})}var Gr=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:i,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:f,onButtonClick:u,dismissible:g=!0,endFlowOnDismiss:F=!1,modalPosition:b="center",repeatable:C=!1,onDismiss:m,showPagination:v=!1,allowBackNavigation:w=!1})=>{let{getFlow:B,getFlowSteps:k,isLoading:c,targetingLogicShouldHideFlow:h,getFlowStatus:y,getCurrentStepIndex:E,markFlowCompleted:U,markFlowNotStarted:M}=X(),_=E(e),{mergeAppearanceWithDefault:O}=Q(),[H,N]=ea(!1),{setOpenFlowState:j,getOpenFlowState:K}=ke();d=O(d);let[V,z]=n!==void 0&&i!==void 0?[n,i]:[K(e,!0),$=>j(e,$)];if(Rl(()=>{!H&&!c&&(N(!0),y(e)===R&&C&&M(e),N(!0))},[H,N,c]),c)return null;let te=B(e);if(!te||h(te))return null;let oe=k(e);if(!oe||n!==void 0&&n===!1||y(e)===R&&l)return null;let Z=()=>{z(!1),m&&m(),F===!0&&U(e)};if(b=="center"&&o==="modal"||o==="large-modal"){let $={padding:"24px"};return o==="large-modal"?($.width="85%",$.height="90%",$.maxHeight="800px",$.minHeight="500px",$.padding="0"):$.width="400px",Oe.createElement(Ye,{appearance:d,onClose:Z,visible:V,style:$,dismissible:g},Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:u,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:z,onDismiss:m,showPagination:v,customFormElements:s,allowBackNavigation:w}))}return o==="modal"&&b!=="center"?Oe.createElement(ir,{appearance:d,onClose:Z,visible:V},Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:u,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:z,onDismiss:m,showPagination:v,customFormElements:s,allowBackNavigation:w})):Oe.createElement(Oe.Fragment,null,Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:u,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:z,onDismiss:m,showPagination:v,customFormElements:s,allowBackNavigation:w}))},jr=Gr;import{useCallback as Vr,useContext as ta,useEffect as oa}from"react";function Mo(){let{organizationId:e,userId:t,setOrganizationId:o}=ta(G),{mutateUserFlowState:n}=we(),{config:i}=Ne(),r=ft(),{verifySDKInitiated:s}=gt();oa(()=>{if(t&&e){if(t.startsWith(ht))return;let l=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(l)||(r(`${ge}userGroups`,{...i,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(l,"true"))}},[t,e]);let p=Vr(async l=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let f={foreignUserId:t,foreignUserGroupId:e,properties:l};await r(`${ge}userGroups`,{...i,method:"POST",body:JSON.stringify(f)}),n()},[e,t,i,n]),d=Vr(async(l,f)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let g={foreignUserId:t,foreignUserGroupId:e,events:[{event:l,properties:f}]};await r(`${ge}userGroups`,{...i,method:"POST",body:JSON.stringify(g)}),n()},[e,t,i,n]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var qr="xFrigade_guestUserId",Kr="xFrigade_userId",Yr=({})=>{let{setFlowResponses:e}=At(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=we(),{userId:i,setUserId:r}=To(),[s,p]=$o(null),{getFlowStatus:d}=X(),{flows:l,userProperties:f,setIsNewGuestUser:u,flowResponses:g}=ra(G),[F,b]=$o([]),[C,m]=$o([]),{organizationId:v}=Mo();lo(()=>{if(!o&&t)for(let c=0;c<t.length;c++){let h=t[c],y=l.find(E=>E.slug===(h==null?void 0:h.flowId));if(y&&h&&h.shouldTrigger===!0&&y.type=="FORM"&&y.triggerType==="AUTOMATIC"&&!C.includes(y.slug)){setTimeout(()=>{w(h.flowId)},500);break}}},[o,t]),lo(()=>{g.length>0&&n()},[g]);function w(c){let h=l.find(y=>y.slug===c);h&&h.triggerType==="AUTOMATIC"&&!C.includes(h.slug)&&(m([...C,h.slug]),b([h]))}function B(){if(!i){let c=localStorage.getItem(Kr);if(c){r(c);return}let h=localStorage.getItem(qr);if(h){r(h);return}u(!0);let y=ht+ia();try{localStorage.setItem(qr,y)}catch(E){console.log("Failed to save guest user id locally: Local storage unavailable",E)}r(E=>E||y)}}lo(()=>{try{if(l){let c=[];l.forEach(h=>{if(h.data){let y=h.data.match(/"imageUri":"(.*?)"/g);y&&y.forEach(E=>{let U=E.replace('"imageUri":"',"").replace('"',"");if(c.includes(U))return;let M=new Image;M.src=U,c.push(U)})}})}}catch{}},[l]),lo(()=>{if(i!==s&&e([]),p(i),i&&!i.startsWith(ht))try{localStorage.setItem(Kr,i)}catch(c){console.log("Failed to save user id locally: Local storage available",c)}i===null&&setTimeout(()=>{i===null&&B()},50)},[i,l,f]);function k(){return lt.createElement(lt.Fragment,null,F.map(c=>d(c.slug)!==Ae?null:lt.createElement("span",{key:c.slug},lt.createElement(jr,{flowId:c.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return lt.createElement(lt.Fragment,null,lt.createElement(k,null))};var ao={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",borderRadius:20}};import{ErrorBoundary as la}from"react-error-boundary";var G=na({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:ao,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),aa=({publicApiKey:e,userId:t,organizationId:o,config:n,children:i})=>{var N,j;let[r,s]=ve(t||null),[p,d]=ve(o||null),[l,f]=ve([]),[u,g]=ve([]),[F,b]=ve([]),[C,m]=ve({}),[v,w]=ve({}),[B,k]=ve({}),[c,h]=ve(!1),[y,E]=ve(!1),[U,M]=ve(!H(e)),_=(K,V)=>{if(V==="_blank"){window.open(K,"_blank");return}setTimeout(()=>{window.location.href=K},50)},O={theme:{...ao.theme,...((N=n==null?void 0:n.defaultAppearance)==null?void 0:N.theme)??{}},styleOverrides:{...ao.styleOverrides,...((j=n==null?void 0:n.defaultAppearance)==null?void 0:j.styleOverrides)??{}}};function H(K){return!!(K&&K.length>10&&K.substring(0,10)==="api_public")}return Uo(()=>{t&&s(t)},[t]),Uo(()=>{o&&d(o)},[o]),Uo(()=>{if(H(e))M(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),M(!0);return}},[e,M]),U?at.createElement(G.Provider,{value:{publicApiKey:e,userId:r,setUserId:s,setFlows:f,flows:l,failedFlowResponses:u,setFailedFlowResponses:g,flowResponses:F,setFlowResponses:b,userProperties:C,setUserProperties:m,openFlowStates:v,setOpenFlowStates:w,customVariables:B,setCustomVariables:k,isNewGuestUser:c,setIsNewGuestUser:h,hasActiveFullPageFlow:y,setHasActiveFullPageFlow:E,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:_,defaultAppearance:O,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:M}},i):at.createElement(la,{fallback:at.createElement(at.Fragment,null,i)},at.createElement(G.Provider,{value:{publicApiKey:e,userId:r,setUserId:s,setFlows:f,flows:l,failedFlowResponses:u,setFailedFlowResponses:g,flowResponses:F,setFlowResponses:b,userProperties:C,setUserProperties:m,openFlowStates:v,setOpenFlowStates:w,customVariables:B,setCustomVariables:k,isNewGuestUser:c,setIsNewGuestUser:h,hasActiveFullPageFlow:y,setHasActiveFullPageFlow:E,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:_,defaultAppearance:O,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:M}},at.createElement(sa,{theme:O.theme},i,at.createElement(Yr,null))))};import np from"react";import ne,{useEffect as kn,useState as Pn}from"react";import Ie,{useState as Ba}from"react";import dt from"styled-components";import uo from"react";import po from"react";import Jr from"styled-components";var Xr=Jr.span`
|
|
518
518
|
font-weight: 400;
|
|
519
519
|
font-size: 15px;
|
|
520
520
|
line-height: 20px;
|
|
@@ -531,7 +531,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
531
531
|
padding-bottom: 20px;
|
|
532
532
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
533
533
|
width: 100%;
|
|
534
|
-
`,co=({label:e,value:t,labelStyle:o={},labelPosition:
|
|
534
|
+
`,co=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:i,primaryColor:r="#000000",checkBoxType:s="square",appearance:p})=>po.createElement(pa,{className:a("checklistStepsContainer",p),appearance:p,style:{...i}},n==="left"&&e&&po.createElement(Xr,{className:a("checklistStepLabel",p),style:o},e),po.createElement(bt,{appearance:p,value:t,type:s,primaryColor:r}),n==="right"&&e&&po.createElement(Xr,{className:a("checklistStepLabel",p),style:o},e));import{motion as da}from"framer-motion";import _t from"styled-components";var Qr=_t.div`
|
|
535
535
|
font-weight: 700;
|
|
536
536
|
font-size: 18px;
|
|
537
537
|
line-height: 22px;
|
|
@@ -559,7 +559,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
559
559
|
`,ei=_t.div`
|
|
560
560
|
flex-direction: row;
|
|
561
561
|
justify-content: flex-start;
|
|
562
|
-
`;var ti=({data:e,index:t,isSelected:o,primaryColor:
|
|
562
|
+
`;var ti=({data:e,index:t,isSelected:o,primaryColor:n,style:i,onClick:r,appearance:s})=>{var p,d;return uo.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{r()}},o&&uo.createElement(mo,{className:a("checklistStepItemSelectedIndicator",s),as:da.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??n}}),uo.createElement(ei,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},uo.createElement(co,{value:e.complete,labelPosition:"left",label:e.stepName,style:i,primaryColor:((d=s==null?void 0:s.theme)==null?void 0:d.colorPrimary)??n,appearance:s})))};import pt from"react";import{motion as ca}from"framer-motion";import _o from"styled-components";var ma={backgroundColor:"#E6E6E6"},ua=_o.div`
|
|
563
563
|
display: flex;
|
|
564
564
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
565
565
|
justify-content: flex-start;
|
|
@@ -578,13 +578,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
578
578
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
579
579
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
580
580
|
${e=>it(e)}
|
|
581
|
-
`,ha={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},xa={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},Le=({count:e,total:t,fillColor:o,bgColor:
|
|
581
|
+
`,ha={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},xa={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},Le=({count:e,total:t,fillColor:o,bgColor:n=ma.backgroundColor,display:i="count",textLocation:r="left",style:s={},textStyle:p={},appearance:d})=>{var b,C;if(t===0)return pt.createElement(pt.Fragment,null);let l=e===0?"10px":`${e/t*100}%`,f=i==="compact"?"5px":"10px",u=Math.round(e/t*100),g=i==="compact"?"5px":"20px",F;return i==="count"?F=`${e} of ${t}`:i==="compact"?F=`${u}%`:i==="percent"&&(F=`${u}% complete`),r==="top"&&(g="0px"),pt.createElement(ua,{className:a("progressBarContainer",d),textLocation:r,styleOverrides:s},pt.createElement(ga,{className:a("progressBarStepText",d),style:{...p,fontSize:i==="compact"?12:15,fontWeight:i==="compact"?400:500},appearance:d,padding:g,textLocation:r},F),pt.createElement(fa,{textLocation:r,className:a("progressBar",d)},pt.createElement(ca.div,{style:{...xa,width:l,height:f,backgroundColor:((b=d==null?void 0:d.theme)==null?void 0:b.colorPrimary)??o,zIndex:i=="compact"?1:5},className:a("progressBarFill",d)}),pt.createElement("div",{className:a("progressBarBackground",d),style:{...ha,height:f,backgroundColor:((C=d==null?void 0:d.theme)==null?void 0:C.colorSecondary)??n}})))};import Ht from"react";import Ca from"styled-components";import go from"react";import fo from"react";var wt=({stepData:e,appearance:t})=>fo.createElement(fo.Fragment,null,fo.createElement(Zr,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:se(e.title)}),fo.createElement(Rr,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:se(e.subtitle)}));import Wt from"react";var Tt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Wt.createElement(Wt.Fragment,null,Wt.createElement(oo,null,e.secondaryButtonTitle&&Wt.createElement(ee,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}),Wt.createElement(ee,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Ft=({stepData:e,appearance:t})=>go.createElement(go.Fragment,null,go.createElement(wt,{stepData:e,appearance:t}),go.createElement(Tt,{stepData:e,appearance:t}));import oi from"react";function ri(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),oi.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:a("checklistStepVideo",e.appearance)})}else return oi.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var Wo="default",Sa=Ca.img`
|
|
582
582
|
border-radius: 4px;
|
|
583
583
|
max-height: 260px;
|
|
584
584
|
min-height: 200px;
|
|
585
|
-
`,ii=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Ht.createElement("div",null,o)}return Ht.createElement(Qr,{className:a("checklistStepContent",t)},e.imageUri?Ht.createElement(
|
|
585
|
+
`,ii=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Ht.createElement("div",null,o)}return Ht.createElement(Qr,{className:a("checklistStepContent",t)},e.imageUri?Ht.createElement(Sa,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Ht.createElement(ri,{videoUri:e.videoUri,appearance:t}):null,Ht.createElement(Ft,{stepData:e,appearance:t}))};import Se,{useRef as ya,useState as ba}from"react";import kt from"styled-components";var ni=kt.div`
|
|
586
586
|
display: block;
|
|
587
|
-
`,
|
|
587
|
+
`,wa=kt.div`
|
|
588
588
|
display: flex;
|
|
589
589
|
flex-direction: row;
|
|
590
590
|
flex-wrap: wrap;
|
|
@@ -594,7 +594,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
594
594
|
align-content: center;
|
|
595
595
|
margin-top: 24px;
|
|
596
596
|
margin-bottom: 24px;
|
|
597
|
-
`,
|
|
597
|
+
`,Ta=kt.div`
|
|
598
598
|
display: flex;
|
|
599
599
|
align-items: center;
|
|
600
600
|
justify-content: flex-start;
|
|
@@ -627,7 +627,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
627
627
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
628
628
|
border-radius: 50%;
|
|
629
629
|
}
|
|
630
|
-
`,si="videoCarousel",li=({stepData:e,appearance:t})=>{var
|
|
630
|
+
`,si="videoCarousel",li=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.videos))return Se.createElement(ni,null,Se.createElement(Ft,{stepData:e,appearance:t}));function o({video:r}){let s=ya(),[p,d]=ba(!1);return Se.createElement(Ta,null,!p&&Se.createElement(Pa,{onClick:()=>{d(!0),s.current.play()},appearance:t},Se.createElement(ro,null)),Se.createElement(Fa,{controls:p,ref:s,play:p,src:r.uri}),Se.createElement(ka,null,r.title))}let n=e.props;return n.videos?Se.createElement(ni,null,Se.createElement(wt,{stepData:e,appearance:t}),Se.createElement(wa,null,n.videos.map((r,s)=>Se.createElement("span",{key:`${r.uri}-${s}`},Se.createElement(o,{video:r})))),Se.createElement(Tt,{stepData:e,appearance:t})):null};import je from"react";import ho from"styled-components";var ai=ho.div`
|
|
631
631
|
display: block;
|
|
632
632
|
`,va=ho.pre`
|
|
633
633
|
display: block;
|
|
@@ -645,14 +645,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
645
645
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
646
646
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
647
647
|
margin-bottom: 24px;
|
|
648
|
-
`,
|
|
648
|
+
`,Ia=ho.div`
|
|
649
649
|
font-size: 15px;
|
|
650
650
|
line-height: 20px;
|
|
651
651
|
margin-bottom: 12px;
|
|
652
652
|
margin-top: 12px;
|
|
653
|
-
`,
|
|
653
|
+
`,Ea=ho.div`
|
|
654
654
|
margin-top: 24px;
|
|
655
|
-
`,pi="codeSnippet",di=({stepData:e,appearance:t})=>{var
|
|
655
|
+
`,pi="codeSnippet",di=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.codeSnippets))return je.createElement(ai,null,je.createElement(Ft,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?je.createElement(ai,null,je.createElement(wt,{stepData:e,appearance:t}),je.createElement(Ea,null,o.codeSnippets.map((i,r)=>je.createElement("div",{key:r},i.title?je.createElement(Ia,null,i.title):null,i.code?je.createElement(va,null,i.code):null))),je.createElement(Tt,{stepData:e,appearance:t})):null};var Aa=dt.div`
|
|
656
656
|
display: flex;
|
|
657
657
|
flex-direction: row;
|
|
658
658
|
min-width: ${e=>e.type!="modal"?"1000px":"100%"};
|
|
@@ -683,7 +683,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
683
683
|
`,Ma=dt.div`
|
|
684
684
|
flex: 2;
|
|
685
685
|
padding: 2rem;
|
|
686
|
-
`,$a=({title:e,subtitle:t,steps:o=[],style:
|
|
686
|
+
`,$a=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:i,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:f}=Q();d=f(d);let g={...{[Wo]:ii,[si]:li,[pi]:di},...p},[F,b]=Ba(0),C=i??F,m=r??b,v=o.filter(B=>B.complete===!0).length,w=()=>{var B;return!((B=o[C])!=null&&B.type)||!g[o[C].type]?g[Wo]({stepData:o[C],appearance:d}):g[o[C].type]({stepData:o[C],appearance:d})};return Ie.createElement(Aa,{type:l,style:n,className:s,appearance:d},Ie.createElement(ci,{style:{flex:1}},Ie.createElement(ci,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Ie.createElement(Na,{className:a("checklistTitle",d),appearance:d},e),Ie.createElement(Oa,{className:a("checklistSubtitle",d),appearance:d},t),Ie.createElement(Le,{total:o.length,count:v,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Ie.createElement(La,{className:a("checklistStepsContainer",d)},o.map((B,k)=>Ie.createElement(ti,{data:B,index:k,key:k,listLength:o.length,isSelected:k===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{m(k)}})))),Ie.createElement(Da,{appearance:d,className:a("checklistDivider",d)}),Ie.createElement(Ma,null,Ie.createElement(w,null)))},Ho=$a;import L,{useState as Ga}from"react";import mi from"react";import Ua from"styled-components";var _a=Ua.svg`
|
|
687
687
|
transition: 'transform 0.35s ease-in-out';
|
|
688
688
|
`,Pt=({color:e="#323232",style:t,className:o})=>mi.createElement(_a,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},mi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as ja}from"framer-motion";import ae from"styled-components";var zo={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},ui=ae.div`
|
|
689
689
|
max-height: 350px;
|
|
@@ -707,7 +707,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
707
707
|
padding-left: 1px;
|
|
708
708
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
709
709
|
`,xi=ae.div`
|
|
710
|
-
${e=>
|
|
710
|
+
${e=>T(e)} {
|
|
711
711
|
border: 1px solid #fafafa;
|
|
712
712
|
}
|
|
713
713
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -720,8 +720,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
720
720
|
display: flex;
|
|
721
721
|
flex-direction: row;
|
|
722
722
|
justify-content: space-between;
|
|
723
|
-
`,
|
|
724
|
-
${e=>
|
|
723
|
+
`,Si=ae.p`
|
|
724
|
+
${e=>T(e)} {
|
|
725
725
|
font-weight: 400;
|
|
726
726
|
font-size: 10px;
|
|
727
727
|
line-height: 12px;
|
|
@@ -729,13 +729,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
729
729
|
color: #8c8c8c;
|
|
730
730
|
margin: 20px;
|
|
731
731
|
}
|
|
732
|
-
`,
|
|
732
|
+
`,yi=ae.div`
|
|
733
733
|
display: flex;
|
|
734
734
|
flex-direction: row;
|
|
735
735
|
`,bi=ae.div`
|
|
736
736
|
flex: 1;
|
|
737
|
-
`,
|
|
738
|
-
${e=>
|
|
737
|
+
`,wi=ae.div`
|
|
738
|
+
${e=>T(e)} {
|
|
739
739
|
display: flex;
|
|
740
740
|
justify-content: center;
|
|
741
741
|
align-content: center;
|
|
@@ -744,8 +744,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
744
744
|
padding-left: 8px;
|
|
745
745
|
padding-right: 8px;
|
|
746
746
|
}
|
|
747
|
-
`,
|
|
748
|
-
${e=>
|
|
747
|
+
`,Ti=ae.p`
|
|
748
|
+
${e=>T(e)} {
|
|
749
749
|
font-style: normal;
|
|
750
750
|
font-weight: 600;
|
|
751
751
|
font-size: 22px;
|
|
@@ -757,7 +757,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
757
757
|
margin-bottom: 16px;
|
|
758
758
|
}
|
|
759
759
|
`,Fi=ae.p`
|
|
760
|
-
${e=>
|
|
760
|
+
${e=>T(e)} {
|
|
761
761
|
font-weight: 400;
|
|
762
762
|
font-size: 14px;
|
|
763
763
|
line-height: 18px;
|
|
@@ -766,14 +766,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
766
766
|
margin-bottom: 8px;
|
|
767
767
|
}
|
|
768
768
|
`,ki=ae.div`
|
|
769
|
-
${e=>
|
|
769
|
+
${e=>T(e)} {
|
|
770
770
|
display: flex;
|
|
771
771
|
flex-direction: row;
|
|
772
772
|
justify-content: center;
|
|
773
773
|
gap: 8px;
|
|
774
774
|
}
|
|
775
775
|
`,Pi=ae.div`
|
|
776
|
-
${e=>
|
|
776
|
+
${e=>T(e)} {
|
|
777
777
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
778
778
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
779
779
|
:hover {
|
|
@@ -793,7 +793,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
793
793
|
position: relative;
|
|
794
794
|
cursor: pointer;
|
|
795
795
|
`,vi=ae.p`
|
|
796
|
-
${e=>
|
|
796
|
+
${e=>T(e)} {
|
|
797
797
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
798
798
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
799
799
|
}
|
|
@@ -801,12 +801,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
801
801
|
font-size: 14px;
|
|
802
802
|
line-height: 22px;
|
|
803
803
|
margin: 0;
|
|
804
|
-
`,
|
|
804
|
+
`,Ii=ae.div`
|
|
805
805
|
display: flex;
|
|
806
806
|
flex-direction: row;
|
|
807
807
|
justify-content: flex-end;
|
|
808
808
|
align-content: center;
|
|
809
|
-
`,
|
|
809
|
+
`,Ei=ae.div`
|
|
810
810
|
display: flex;
|
|
811
811
|
flex: 1;
|
|
812
812
|
flex-direction: row;
|
|
@@ -836,7 +836,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
836
836
|
overflow: hidden;
|
|
837
837
|
row-gap: 10px;
|
|
838
838
|
`,Li=Ve.div`
|
|
839
|
-
${e=>
|
|
839
|
+
${e=>T(e)} {
|
|
840
840
|
color: #595959;
|
|
841
841
|
}
|
|
842
842
|
text-transform: uppercase;
|
|
@@ -846,7 +846,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
846
846
|
letter-spacing: 0.09em;
|
|
847
847
|
margin-bottom: 12px;
|
|
848
848
|
`,Di=Ve.div`
|
|
849
|
-
${e=>
|
|
849
|
+
${e=>T(e)} {
|
|
850
850
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
851
851
|
background: #ffffff;
|
|
852
852
|
border: 1px solid #fafafa;
|
|
@@ -859,7 +859,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
859
859
|
max-width: 150px;
|
|
860
860
|
min-width: 200px;
|
|
861
861
|
`,Mi=Ve.div`
|
|
862
|
-
${e=>
|
|
862
|
+
${e=>T(e)} {
|
|
863
863
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
864
864
|
}
|
|
865
865
|
width: 40px;
|
|
@@ -877,7 +877,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
877
877
|
width: 20px;
|
|
878
878
|
height: 20px;
|
|
879
879
|
`,Ui=Ve.div`
|
|
880
|
-
${e=>
|
|
880
|
+
${e=>T(e)} {
|
|
881
881
|
color: #434343;
|
|
882
882
|
}
|
|
883
883
|
font-weight: 600;
|
|
@@ -886,7 +886,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
886
886
|
margin-top: 12px;
|
|
887
887
|
margin-bottom: 8px;
|
|
888
888
|
`,_i=Ve.div`
|
|
889
|
-
${e=>
|
|
889
|
+
${e=>T(e)} {
|
|
890
890
|
color: #8c8c8c;
|
|
891
891
|
}
|
|
892
892
|
font-weight: 400;
|
|
@@ -898,7 +898,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
898
898
|
line-height: 14px;
|
|
899
899
|
font-weight: 400;
|
|
900
900
|
cursor: pointer;
|
|
901
|
-
`;var za=({steps:e,style:t,title:o,primaryColor:
|
|
901
|
+
`;var za=({steps:e,style:t,title:o,primaryColor:n,appearance:i,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=le();return qe.createElement(Ni,{style:t,className:a("guideContainer",i)},qe.createElement(Li,{className:a("guideTitle",i)},o),qe.createElement(Oi,{className:a("guideItemContainer",i)},e.map((p,d)=>qe.createElement(Di,{key:`guide-${p.id??d}`,as:Ha.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:a("guideItem",i)},p.icon&&qe.createElement(Mi,{className:a("guideIcon",i)},qe.createElement($i,null,p.icon)),qe.createElement(Ui,{className:a("guideItemTitle",i),dangerouslySetInnerHTML:se(p.title)}),qe.createElement(_i,{className:a("guideItemSubtitle",i),dangerouslySetInnerHTML:se(p.subtitle)}),qe.createElement(Wi,{className:a("guideItemLink",i),color:n,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle)))))},zt=za;var Va=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:i,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:f,guideTitle:u,onGuideButtonClick:g})=>{let F=({stepData:h,handleSecondaryCTAClick:y,handleCTAClick:E})=>h?L.createElement(wi,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},L.createElement(Ti,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:se(h.title)}),L.createElement(Fi,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:se(h.subtitle)}),L.createElement(ki,{className:a("checklistCTAContainer",l)},h.secondaryButtonTitle&&L.createElement(ee,{title:h.secondaryButtonTitle,onClick:y,appearance:l,secondary:!0}),L.createElement(ee,{title:h.primaryButtonTitle,onClick:E,appearance:l}))):L.createElement(L.Fragment,null),C={...{default:h=>{var M;if((M=e[w])!=null&&M.StepContent){let _=e[w].StepContent;return L.createElement("div",null,_)}let y=e[w];return L.createElement(F,{stepData:h,handleCTAClick:()=>{y.handlePrimaryButtonClick&&y.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{y.handleSecondaryButtonClick&&y.handleSecondaryButtonClick()}})}},...d},[m,v]=Ga(0),w=s??m,B=p??v,k=()=>{var h;return e?!((h=e[w])!=null&&h.type)||!C[e[w].type]?C.default(e[w]):C[e[w].type]({stepData:e[w],primaryColor:l.theme.colorPrimary}):L.createElement(L.Fragment,null)},c=e.filter(h=>h.complete).length;return i?(l.theme.modalContainer||(l.theme.borderRadius&&(zo.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=zo),L.createElement(Ye,{onClose:r,visible:i,appearance:l},L.createElement(Bi,null,L.createElement(fi,null,L.createElement(gi,{appearance:l,className:a("checklistTitle",l)},t),L.createElement(hi,{appearance:l,className:a("checklistSubtitle",l)},o)),L.createElement(ui,null,e&&e.length>0&&L.createElement(xi,{className:a("stepsContainer",l)},L.createElement(Ci,null,L.createElement("div",{style:{flex:3}},L.createElement(Si,{className:a("stepsTitle",l)},n)),L.createElement(Ei,null,L.createElement(Le,{fillColor:l.theme.colorPrimary,style:{width:"100%"},count:c,total:e.length,appearance:l}))),L.createElement(yi,null,L.createElement(bi,{className:a("checklistStepListContainer",l),appearance:l},e.map((h,y)=>{let E=w===y;return L.createElement(Pi,{selected:E,className:a(`checklistStepListItem${E?"Selected":""}`,l),key:`checklist-guide-step-${h.id??y}`,disabled:h.blocked,onClick:()=>{h.blocked||B(y)},title:h.blocked?"Finish remaining steps to continue":void 0},E&&L.createElement(mo,{className:a("checklistStepItemSelectedIndicator",l),as:ja.div,layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),L.createElement(vi,{selected:E,className:a(`checklistStepListStepName${E?"Selected":""}`,l)},h.stepName),L.createElement(Ii,null,L.createElement(bt,{value:h.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:h.progress,appearance:l}),L.createElement(Ai,null,L.createElement(Pt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),L.createElement(k,null))),f&&f.length>0&&L.createElement(zt,{steps:f,title:u,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:h=>(g&&g(h),!0)}))))):L.createElement(L.Fragment,null)},Go=Va;import{useEffect as qa,useState as Ka}from"react";var Hi=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,n]=Ka(t),i=null,r=()=>{i!==null?clearTimeout(i):s(),i=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let f=window.matchMedia(l);return f.addEventListener("change",r),[d,f.matches]}));n(p)};return qa(()=>{s()},[]),o};import he,{useEffect as on,useState as Ja}from"react";import de from"react";import{AnimatePresence as Ya,motion as Xa}from"framer-motion";import Ke from"styled-components";var zi=Ke.div`
|
|
902
902
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
903
903
|
border: 1px solid;
|
|
904
904
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -945,7 +945,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
945
945
|
flex-direction: row;
|
|
946
946
|
justify-content: flex-start;
|
|
947
947
|
align-items: center;
|
|
948
|
-
`;var Ji=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:
|
|
948
|
+
`;var Ji=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:i,appearance:r})=>{var p,d;let s=t?{}:{transform:"rotate(90deg)"};return de.createElement(zi,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},de.createElement(Vi,{className:a("stepHeader",r)},de.createElement(Xi,null,de.createElement(co,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(p=r==null?void 0:r.theme)==null?void 0:p.colorPrimary,appearance:r}),de.createElement(qi,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:se(e.title)})),de.createElement(Ki,{className:a("stepChevronContainer",r),onClick:()=>o()},de.createElement(Pt,{style:{...s,transition:"transform 0.1s ease-in-out"},color:(d=r==null?void 0:r.theme)==null?void 0:d.colorTextSecondary}))),de.createElement(Ya,null,!t&&de.createElement(Xa.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},e.imageUri||e.videoUri&&de.createElement(Gi,{className:a("stepMediaContainer",r)},e.imageUri?de.createElement(ji,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?de.createElement(St,{appearance:r,videoUri:e.videoUri}):null),de.createElement(Yi,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:se(e.subtitle)}),de.createElement(oo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?de.createElement(ee,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>i(),appearance:r}):null,de.createElement(ee,{title:e.primaryButtonTitle??"Continue",onClick:()=>n(),appearance:r})))))};import vt from"styled-components";var gh=vt.div`
|
|
949
949
|
background: #ffffff;
|
|
950
950
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
951
951
|
border-radius: 6px;
|
|
@@ -985,7 +985,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
985
985
|
justify-content: space-between;
|
|
986
986
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
987
987
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
988
|
-
`;var Qa=({title:e,subtitle:t,steps:o,onClose:
|
|
988
|
+
`;var Qa=({title:e,subtitle:t,steps:o,onClose:n,visible:i,onCompleteStep:r,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:l="#000000",selectedStep:f,setSelectedStep:u,appearance:g,type:F,className:b})=>{let C=o.filter(c=>c.complete).length,[m,v]=Ja(Array(o.length).fill(!0));on(()=>{let c=[...m];if(s){for(let h=0;h<o.length;h++)if(!o[h].complete){c[h]=!1;break}v(c)}},[]),on(()=>{w(f)},[f]);let w=c=>{let h=[...m];if(p)for(let y=0;y<m.length;++y)y!==c&&(h[y]=!0);h[c]=!h[c],v(h)};if(!i&&F=="modal")return he.createElement(he.Fragment,null);let B=he.createElement(he.Fragment,null,he.createElement(Qi,null,he.createElement(Zi,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:se(e)}),he.createElement(Ri,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:se(t)})),he.createElement(Le,{display:"percent",count:C,total:o.length,fillColor:l,style:{margin:"14px 0px 8px 0px"},appearance:g})),k=he.createElement(en,{className:Ce(a("checklistContainer",g),b)},o.map((c,h)=>{let y=m[h];return he.createElement(Ji,{appearance:g,stepData:c,collapsed:y,key:`modal-checklist-${c.id??h}`,onClick:()=>{if(f===h){w(h);return}u(h)},onPrimaryButtonClick:()=>{r&&r(h,c),c.handlePrimaryButtonClick&&c.handlePrimaryButtonClick(),d&&!c.completionCriteria&&h<m.length-1&&m[h+1]&&u(h+1)},onSecondaryButtonClick:()=>{c.handleSecondaryButtonClick&&c.handleSecondaryButtonClick()}})}));return F==="inline"?he.createElement(tn,{appearance:g,className:Ce(a("checklistInlineContainer",g),b)},B,k):he.createElement(he.Fragment,null,he.createElement(Ye,{onClose:n,visible:i,appearance:g,style:{maxWidth:"600px"},headerContent:B},k))},jo=Qa;import ie,{useEffect as Vo,useRef as rp,useState as mt}from"react";import ct from"react";import re,{css as rn,keyframes as nn}from"styled-components";var sn=rn`
|
|
989
989
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
990
990
|
`,Za=rn`
|
|
991
991
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -1066,7 +1066,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1066
1066
|
margin-bottom: 12px;
|
|
1067
1067
|
width: 40px;
|
|
1068
1068
|
`,fn=re(cn)`
|
|
1069
|
-
${e=>
|
|
1069
|
+
${e=>T(e)} {
|
|
1070
1070
|
${Za}
|
|
1071
1071
|
|
|
1072
1072
|
background: ${({theme:e})=>e.colorBackground};
|
|
@@ -1098,7 +1098,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1098
1098
|
line-height: 20px;
|
|
1099
1099
|
letter-spacing: calc(16px * -0.01);
|
|
1100
1100
|
margin: 0;
|
|
1101
|
-
`,
|
|
1101
|
+
`,Sn=re(op)`
|
|
1102
1102
|
margin-bottom: 4px;
|
|
1103
1103
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1104
1104
|
`}
|
|
@@ -1108,7 +1108,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1108
1108
|
font-size: 14px;
|
|
1109
1109
|
line-height: 22px;
|
|
1110
1110
|
margin: 0;
|
|
1111
|
-
`,
|
|
1111
|
+
`,yn=re.p`
|
|
1112
1112
|
color: ${({theme:e})=>e.colorText};
|
|
1113
1113
|
font-weight: 600;
|
|
1114
1114
|
font-size: 12px;
|
|
@@ -1120,21 +1120,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1120
1120
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1121
1121
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1122
1122
|
`}
|
|
1123
|
-
`;var bn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:
|
|
1123
|
+
`;var bn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=Q(),{primaryCTAClickSideEffects:i}=le(),{theme:r,styleOverrides:s}=n(o),{imageUri:p=null,subtitle:d=null,title:l=null,complete:f=!1,blocked:u=!1}=e,g=()=>{i(e)};return ct.createElement(mn,{className:a("carouselCard",o),onClick:u?null:g,style:t,blocked:u,complete:f},ct.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&ct.createElement(un,{className:a("carouselCardImage",o),src:p,alt:l,style:{opacity:f||u?.4:1}}),f&&ct.createElement(xn,{className:a("carouselCompletedPill",o)},ct.createElement(yn,{style:{color:"#108E0B"}},"Complete"))),l&&ct.createElement(Sn,{blocked:u,complete:f,className:a("carouselCardTitle",o)},l),d&&ct.createElement(De.Quiet,{blocked:u,complete:f,className:a("carouselCardSubtitle",o)},d))};import Gt from"react";var wn=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let n=t>0?e/t:0,i=200,r=Math.min(i,Math.max(10,Math.round(i*n)));return Gt.createElement(gn,{className:a("carouselProgressBar",o)},Gt.createElement(hn,{as:De.Loud,style:{marginRight:8}},e," of ",t),Gt.createElement("svg",{height:10,width:i},Gt.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"#E6E6E6"}),Gt.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"currentColor"})))};var ip=()=>ie.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ie.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ie.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ie.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Tn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,i]=mt(!1),[r,s]=mt(!1);Vo(()=>{t===!0&&n===!1?i(!0):t===!1&&n===!0&&s(!0)},[t]);let p=()=>{i(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return n?ie.createElement(pn,{style:d,reversed:r,onAnimationEnd:r?p:null},ie.createElement(dn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ie.createElement(ip,null))):null},Fn=({flowId:e,appearance:t,customVariables:o,className:n})=>{let i=rp(null),[r,s]=mt(!1),[p,d]=mt(!1),[l,f]=mt(null),[u,g]=mt([]),[F,b]=mt(0),{getFlowMetadata:C,getFlowSteps:m,getNumberOfStepsCompleted:v,updateCustomVariables:w,getFlowStatus:B,isLoading:k,targetingLogicShouldHideFlow:c,getFlow:h}=X();Vo(()=>{w(o)},[o,k]),Vo(()=>{if(k)return;let O=C(e),H=v(e),N=m(e);f(O),O.data!==null&&(g(N.sort((j,K)=>Number(j.complete)-Number(K.complete))),d(N.length>3),b(H))},[k]);let y=[];for(let O=0;O<u.length;O+=3)y.push(u.slice(O,O+3));let E=O=>{let H=O.target,N=H.scrollWidth-H.clientWidth,j=Math.ceil(H.scrollLeft);j>0&&r===!1&&s(!0),j===0&&r===!0&&s(!1),j<N&&p===!1&&d(!0),j===N&&p===!0&&d(!1)},U=(O=!0)=>{let H=O?1:-1;i.current!==null&&i.current.scrollBy({left:i.current.clientWidth*H,behavior:"smooth"})},M=null,_=O=>{M!==null?clearTimeout(M):E(O),M=setTimeout(()=>{E(O)},16)};return k?null:ie.createElement(fn,{className:Ce(a("carouselContainer",t),n)},ie.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},ie.createElement("div",null,ie.createElement(Cn,{className:a("carouselTitle",t)},l==null?void 0:l.title),ie.createElement(De.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ie.createElement(wn,{numberOfStepsCompleted:F,numberOfSteps:u.length})),ie.createElement("div",{style:{position:"relative"}},ie.createElement(Tn,{show:r,onClick:()=>U(!1)}),ie.createElement(Tn,{side:"right",show:p,onClick:U}),ie.createElement(ln,{ref:i,onScroll:_},y.map((O,H)=>ie.createElement(an,{key:H,style:{flex:`0 0 calc(100% - ${u.length>3?36:0}px)`}},O.map((N,j)=>ie.createElement(bn,{key:j,stepData:N,style:{flex:u.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var qo=({flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:i,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:f,onButtonClick:u,appearance:g,hideOnFlowCompletion:F,setVisible:b,customStepTypes:C,checklistStyle:m="default",...v})=>{let{getFlow:w,getFlowSteps:B,markStepCompleted:k,getStepStatus:c,getNumberOfStepsCompleted:h,isLoading:y,targetingLogicShouldHideFlow:E,updateCustomVariables:U,getFlowMetadata:M,isStepBlocked:_,getFlowStatus:O,hasActiveFullPageFlow:H,setHasActiveFullPageFlow:N}=X(),{primaryCTAClickSideEffects:j,secondaryCTAClickSideEffects:K}=le(),{getOpenFlowState:V,setOpenFlowState:z}=ke(),[te,oe]=Pn(i||0),[Z,$]=Pn(!1),J=d===void 0?V(e):d,A=s==="modal",{mergeAppearanceWithDefault:q}=Q(),{isLarge:Ue}=Hi();if(g=q(g),kn(()=>{U(l)},[l,y]),kn(()=>{d!==void 0&&(A&&d===!0?N(!0):A&&d===!1&&N(!1))},[d,b,H]),y)return null;let xe=w(e);if(!xe||E(xe))return null;let ye=B(e);if(!ye||F===!0&&O(e)===R)return null;let me=M(e);if(me!=null&&me.title&&(t=me.title),me!=null&&me.subtitle&&(o=me.subtitle),!Z&&i===void 0&&h(e)>0){let I=Math.min(h(e),ye.length-1);oe(I),$(!0)}function _e(){if(te+1>=ye.length){A&&z(e,!1);return}_(e,ye[te+1].id)||oe(te+1)}function We(I,Y,tt){let Jo=te+1<ye.length?ye[te+1]:null;u&&u(I,te,Y,Jo)===!0&&A&&Be(),f&&f(I,tt,Jo),!f&&!u&&(I.primaryButtonUri||I.secondaryButtonUri)&&A&&Be()}function et(){return ye.map((I,Y)=>({...I,handleSecondaryButtonClick:()=>{_e(),K(I),I.skippable===!0&&k(e,I.id,{skipped:!0}),We(I,"secondary",Y)},handlePrimaryButtonClick:()=>{(!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)||I.completionCriteria&&I.autoMarkCompleted===!0)&&(k(e,I.id),_e()),We(I,"primary",Y),j(I),c(e,I.id)===Fe&&_e()}}))}function W(){return ne.createElement(pe,{appearance:g})}let Ee={steps:et(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:C,type:s,className:r};function Be(){z(e,!1),p&&p(),b&&b(!1)}function bo(){return ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(Fn,{flowId:e,appearance:g,customVariables:l,className:r}))}function x(){return ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(jo,{visible:J,onClose:()=>{Be()},selectedStep:te,setSelectedStep:oe,autoExpandNextStep:!0,appearance:g,...Ee}))}function S(){if(!Ue)return x();let I=v.guideFlowId,Y;return I&&w(I)&&(Y=B(I)),ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(Go,{visible:J,stepsTitle:me.stepsTitle?me.stepsTitle:"Your quick start guide",onClose:()=>{Be()},selectedStep:te,setSelectedStep:oe,guideData:Y,guideTitle:v.guideTitle??"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:tt=>{We(tt,"link",0)},...Ee}))}function P(){if(!Ue)return x();let I=ne.createElement(Ho,{flowId:e,style:n,selectedStep:te,setSelectedStep:oe,appearance:g,type:s,...Ee});return A?ne.createElement(Ye,{onClose:()=>{Be()},visible:J,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ne.createElement(W,null),I):ne.createElement(ne.Fragment,null,ne.createElement(W,null),I)}switch(m){case"condensed":return x();case"with-guide":return S();case"default":return P();case"carousel":return bo();default:return P()}};var sp=e=>np.createElement(qo,{type:"inline",...e});import Ze,{useEffect as ap}from"react";import Me from"react";import xo from"styled-components";var vn=xo.div`
|
|
1124
1124
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1125
1125
|
border-radius: 8px;
|
|
1126
1126
|
padding: 6px 10px 6px 10px;
|
|
1127
1127
|
min-width: 160px;
|
|
1128
1128
|
cursor: pointer;
|
|
1129
1129
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1130
|
-
`,
|
|
1130
|
+
`,In=xo.div`
|
|
1131
1131
|
display: flex;
|
|
1132
1132
|
flex-direction: row;
|
|
1133
1133
|
justify-content: space-between;
|
|
1134
1134
|
align-items: center;
|
|
1135
1135
|
margin-bottom: 2px;
|
|
1136
1136
|
flex-grow: 2;
|
|
1137
|
-
`,
|
|
1137
|
+
`,En=xo.div`
|
|
1138
1138
|
text-overflow: ellipsis;
|
|
1139
1139
|
font-weight: 600;
|
|
1140
1140
|
font-size: 12px;
|
|
@@ -1147,7 +1147,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1147
1147
|
display: flex;
|
|
1148
1148
|
height: 100%;
|
|
1149
1149
|
align-items: center;
|
|
1150
|
-
`;import{motion as lp}from"framer-motion";var An=({title:e,count:t,total:o,onClick:
|
|
1150
|
+
`;import{motion as lp}from"framer-motion";var An=({title:e,count:t,total:o,onClick:n,style:i={},className:r,appearance:s,type:p="default"})=>Me.createElement(Me.Fragment,null,Me.createElement(pe,{appearance:s}),Me.createElement(vn,{as:lp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>n!==void 0&&n(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...i},className:Ce(r??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Me.createElement(Bn,{className:a("progressRingContainer",s)},Me.createElement(Mt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Me.createElement(In,{type:p,className:a("badgeTitleContainer",s)},Me.createElement(En,{type:p,appearance:s,className:a("badgeTitle",s)},e),n!==void 0&&Me.createElement(Pt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Me.createElement(Le,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import Qe from"react";import jt from"styled-components";var Nn=jt.div`
|
|
1151
1151
|
display: flex;
|
|
1152
1152
|
flex-direction: row;
|
|
1153
1153
|
width: 100%;
|
|
@@ -1159,7 +1159,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1159
1159
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1160
1160
|
border-radius: 12px;
|
|
1161
1161
|
`,On=jt.div`
|
|
1162
|
-
${e=>
|
|
1162
|
+
${e=>T(e)} {
|
|
1163
1163
|
display: flex;
|
|
1164
1164
|
justify-content: center;
|
|
1165
1165
|
align-items: center;
|
|
@@ -1185,8 +1185,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1185
1185
|
:hover {
|
|
1186
1186
|
opacity: 0.8;
|
|
1187
1187
|
}
|
|
1188
|
-
`;var Mn=({title:e,subtitle:t,icon:o,appearance:
|
|
1189
|
-
${e=>
|
|
1188
|
+
`;var Mn=({title:e,subtitle:t,icon:o,appearance:n,count:i,total:r,className:s,style:p})=>Qe.createElement(Qe.Fragment,null,Qe.createElement(Nn,{appearance:n,className:Ce(a("fullWidthProgressBadgeContainer",n),s??""),style:p},o&&Qe.createElement(On,{className:a("fullWidthProgressBadgeIcon",n)},o),Qe.createElement(Ln,null,Qe.createElement(Te,{size:"small",appearance:n,title:e,subtitle:t})),Qe.createElement(Dn,{className:a("fullWidthProgressBadgeProgressContainer",n)},Qe.createElement(Le,{count:i,total:r,display:"percent",textLocation:"top",fillColor:n.theme.colorPrimary}))));var pp=({flowId:e,title:t,subtitle:o,icon:n,style:i,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:f="default"})=>{let{getFlow:u,getFlowSteps:g,getFlowStatus:F,getNumberOfStepsCompleted:b,isLoading:C,targetingLogicShouldHideFlow:m,updateCustomVariables:v}=X(),{mergeAppearanceWithDefault:w}=Q();l=w(l);let{setOpenFlowState:B,getOpenFlowState:k}=ke();if(ap(()=>{v(p)},[p,C]),C)return null;let c=u(e);if(!c||m(c)||d===!0&&F(e)===R)return null;let h=g(e),y=b(e);return f==="full-width"?Ze.createElement(Ze.Fragment,null,Ze.createElement(pe,{appearance:l}),Ze.createElement(Mn,{title:t,subtitle:o,count:y,total:h.length,style:i,className:s,appearance:l,icon:n,onClick:()=>{}})):Ze.createElement(Ze.Fragment,null,Ze.createElement(pe,{appearance:l}),Ze.createElement(An,{count:y,total:h.length,title:t,style:i,onClick:()=>{B(e,!0),r&&r()},type:f,className:s,appearance:l}))};import dp from"react";var cp=({flowId:e,style:t,appearance:o,...n})=>{let{getFlow:i,targetingLogicShouldHideFlow:r,getFlowSteps:s}=X(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let d=i(e);if(!d||r(d))return null;let l=s(e);return dp.createElement(zt,{steps:l,style:t,appearance:o,...n})};import Et,{useContext as Tp,useEffect as Fp}from"react";import D,{useEffect as Co,useLayoutEffect as Kn,useRef as hp,useState as Vt}from"react";import qt from"styled-components";import{useCallback as mp,useEffect as up,useState as fp}from"react";var Ko=(e,t,o,n={x:20,y:20},i)=>{let r=i=="fixed"?0:window.scrollY,s=i=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+n.x+s,y:e.top-n.y+r}:t==="right"?{x:e.left+e.width+n.x+s,y:e.top-n.y+r}:{x:0,y:0}},$n={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function gp(e){let t=$n;return e&&(t=e.getBoundingClientRect()),t}function Un(e,t){let[o,n]=fp($n),i=mp(()=>{e&&n(gp(e))},[e]);return up(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[e,t]),o}import Re from"styled-components";var _n=Re.div`
|
|
1189
|
+
${e=>T(e)} {
|
|
1190
1190
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
1191
1191
|
}
|
|
1192
1192
|
|
|
@@ -1203,7 +1203,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1203
1203
|
top: 25px;
|
|
1204
1204
|
right: 22px;
|
|
1205
1205
|
`,Hn=Re.img`
|
|
1206
|
-
${e=>
|
|
1206
|
+
${e=>T(e)} {
|
|
1207
1207
|
display: block;
|
|
1208
1208
|
width: 100%;
|
|
1209
1209
|
height: auto;
|
|
@@ -1212,7 +1212,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1212
1212
|
margin-bottom: 16px;
|
|
1213
1213
|
}
|
|
1214
1214
|
`,zn=Re.div`
|
|
1215
|
-
${e=>
|
|
1215
|
+
${e=>T(e)} {
|
|
1216
1216
|
display: block;
|
|
1217
1217
|
width: 100%;
|
|
1218
1218
|
height: auto;
|
|
@@ -1236,14 +1236,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1236
1236
|
flex-shrink: 1;
|
|
1237
1237
|
gap: 8px;
|
|
1238
1238
|
height: 64px;
|
|
1239
|
-
${e=>
|
|
1239
|
+
${e=>T(e)} {
|
|
1240
1240
|
flex-direction: row;
|
|
1241
1241
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
1242
1242
|
align-content: center;
|
|
1243
1243
|
align-items: center;
|
|
1244
1244
|
}
|
|
1245
1245
|
`,qn=Re.p`
|
|
1246
|
-
${e=>
|
|
1246
|
+
${e=>T(e)} {
|
|
1247
1247
|
font-style: normal;
|
|
1248
1248
|
font-weight: 600;
|
|
1249
1249
|
font-size: 15px;
|
|
@@ -1251,7 +1251,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1251
1251
|
color: #808080;
|
|
1252
1252
|
}
|
|
1253
1253
|
margin: 0;
|
|
1254
|
-
`;var Yn=300,Xn=100,xp=500,
|
|
1254
|
+
`;var Yn=300,Xn=100,xp=500,It=12,Cp=qt.div`
|
|
1255
1255
|
width: 100%;
|
|
1256
1256
|
height: 100%;
|
|
1257
1257
|
border-radius: 9999px;
|
|
@@ -1274,14 +1274,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1274
1274
|
opacity: 0;
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
`,
|
|
1278
|
-
width: ${
|
|
1279
|
-
height: ${
|
|
1277
|
+
`,Sp=qt.div`
|
|
1278
|
+
width: ${It}px;
|
|
1279
|
+
height: ${It}px;
|
|
1280
1280
|
border-radius: 100px;
|
|
1281
1281
|
background-color: ${e=>e.primaryColor};
|
|
1282
1282
|
z-index: 20;
|
|
1283
1283
|
opacity: 1;
|
|
1284
|
-
`,
|
|
1284
|
+
`,yp=qt.div`
|
|
1285
1285
|
pointer-events: all;
|
|
1286
1286
|
`,Jn=qt.div`
|
|
1287
1287
|
display: flex;
|
|
@@ -1290,10 +1290,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1290
1290
|
align-items: center;
|
|
1291
1291
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1292
1292
|
`,bp=qt(Jn)`
|
|
1293
|
-
width: ${
|
|
1294
|
-
height: ${
|
|
1295
|
-
`,
|
|
1296
|
-
${e=>
|
|
1293
|
+
width: ${It+12}px;
|
|
1294
|
+
height: ${It+12}px;
|
|
1295
|
+
`,wp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:i=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:f,appearance:u,dismissible:g=!1,showHighlightOnly:F,showStepCount:b=!0,completedStepsCount:C=0})=>{var me,_e,We,et;let[m,v]=Vt(),[w,B]=Vt(new Date),k=hp(null),[c,h]=Vt(document.querySelector(e[l].selector)),y=Un(c,w),[E,U]=Vt(),[M,_]=Vt(!F),O=(_e=(me=e[l])==null?void 0:me.props)!=null&&_e.position?e[l].props.position:"absolute",H=((et=(We=e[l])==null?void 0:We.props)==null?void 0:et.zIndex)??90,N=(m==null?void 0:m.width)??Yn,j=(m==null?void 0:m.height)??Xn;Kn(()=>{k.current&&v({width:k.current.clientWidth,height:k.current.clientHeight})},[l,w,O]),Co(()=>{F||_(!0)},[l]);let K=n==="auto"?"right":n,V=Ko(y,K,N,s,O),z=y.right+N>(window.innerWidth||document.documentElement.clientWidth),te=y.bottom+Xn>(window.innerHeight||document.documentElement.clientHeight);z&&n==="auto"&&(V=Ko(y,"left",N,s,O),K="left");let oe=window.location.pathname.split("/").pop(),Z=()=>{let W=document.querySelector(e[l].selector);E&&E===JSON.stringify(W==null?void 0:W.getBoundingClientRect())||(h(W),B(new Date),W&&U(JSON.stringify(W.getBoundingClientRect())))};if(Co(()=>{let W=new MutationObserver(Z);return W.observe(document.body,{subtree:!0,childList:!0}),()=>W.disconnect()},[Z]),Co(()=>{let W=new MutationObserver(Z);return W.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>W.disconnect()},[Z]),Co(()=>{let W=setInterval(()=>{Z()},10);return()=>clearInterval(W)},[Z]),Kn(()=>{setTimeout(()=>{Z()},xp),Z()},[l,oe]),c===null)return D.createElement(D.Fragment,null);if(V.x==0&&V.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let $=()=>{let W=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),_(!1),setTimeout(()=>{Z()},30)),C===e.length-1)return o()},Ee=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&_(!1))};return D.createElement(D.Fragment,null,b&&D.createElement(jn,null,D.createElement(qn,{className:a("tooltipStepCounter",u)},l+1," of ",e.length)),D.createElement(Vn,{showStepCount:b,className:a("tooltipCTAContainer",u)},e[l].secondaryButtonTitle&&D.createElement(ee,{title:e[l].secondaryButtonTitle,appearance:u,onClick:Ee,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&D.createElement(ee,{title:e[l].primaryButtonTitle,appearance:u,onClick:W,withMargin:!1,size:"small"})))},J=()=>D.createElement(D.Fragment,null,g&&D.createElement(Wn,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",u)},D.createElement(Pe,null)),e[l].imageUri&&D.createElement(Hn,{dismissible:g,appearance:u,src:e[l].imageUri,className:a("tooltipImageContainer",u)}),e[l].videoUri&&!e[l].imageUri&&D.createElement(zn,{dismissible:g,appearance:u,className:a("tooltipVideoContainer",u)},D.createElement(St,{appearance:u,videoUri:e[l].videoUri})),D.createElement(Te,{appearance:u,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),D.createElement(Gn,{className:a("tooltipFooter",u)},D.createElement($,null))),q={...{default:W=>{var Ee;if((Ee=e[l])!=null&&Ee.StepContent){let Be=e[l].StepContent;return D.createElement("div",null,Be)}return D.createElement(J,null)}},...f},Ue=()=>{var W;return e?!((W=e[l])!=null&&W.type)||!q[e[l].type]?q.default(e[l]):q[e[l].type]({stepData:e[l],primaryColor:r}):D.createElement(D.Fragment,null)};if(F&&e[l].complete===!0)return null;let xe={top:(V==null?void 0:V.y)-It,left:(K=="left"?y.x+s.x:(V==null?void 0:V.x)-It)??0,cursor:F?"pointer":"default",position:O},ye=()=>{F&&(B(new Date),_(!M))};return D.createElement(yp,null,D.createElement(bp,{style:xe,zIndex:H,className:a("tourHighlightContainer",u)},i&&e[l].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(Sp,{style:{position:O},onClick:ye,primaryColor:u.theme.colorPrimary}),D.createElement(Cp,{style:{position:"absolute"},onClick:ye,primaryColor:u.theme.colorPrimary}))),D.createElement(Jn,{style:{...xe,left:xe.left+(K=="left"?-N:24)},zIndex:H+1,className:a("tooltipContainerWrapper",u)},M&&D.createElement(_n,{ref:k,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:u,className:a("tooltipContainer",u),maxWidth:Yn,zIndex:H+10},D.createElement(Ue,null))))},So=wp;import{Portal as kp}from"react-portal";var Pp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:i,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:f="complete-flow",onComplete:u,...g})=>{let{getFlow:F,getFlowSteps:b,isLoading:C,targetingLogicShouldHideFlow:m,markStepCompleted:v,markStepStarted:w,markFlowCompleted:B,updateCustomVariables:k,getCurrentStepIndex:c,getStepStatus:h,isStepBlocked:y,getFlowStatus:E,getNumberOfStepsCompleted:U}=X(),{isLoadingUserFlowStateData:M}=we(),{primaryCTAClickSideEffects:_,secondaryCTAClickSideEffects:O}=le(),{hasOpenModals:H}=ke(),N=c(e),{openFlowStates:j}=Tp(G),{mergeAppearanceWithDefault:K}=Q();if(o=K(o),Fp(()=>{k(t)},[t,C]),M)return null;let V=F(e);if(!V||m(V)||E(e)==R||H())return null;let z=b(e);if(Object.keys(j).length>0){let A=Object.keys(j).find(q=>j[q]===!0);if(A!==void 0&&A!==e)return Et.createElement(Et.Fragment,null)}async function te(A){if(await v(e,A.id),z.map(q=>h(e,q.id)).every(q=>q===Fe)){await B(e);return}if(!l&&N+1<z.length){if(y(e,z[N+1].id))return;await w(e,z[N+1].id)}}function oe(A,q,Ue){let xe=N+1<z.length?z[N+1]:null;i&&i(A,N,q,xe),n&&n(A,Ue,xe)}function Z(){return z.map(A=>({...A,handleSecondaryButtonClick:async()=>{O(A),A.skippable===!0&&await v(e,A.id,{skipped:!0}),oe(A,"secondary",N)},handlePrimaryButtonClick:async()=>{(!A.completionCriteria&&(A.autoMarkCompleted||A.autoMarkCompleted===void 0)||A.completionCriteria&&A.autoMarkCompleted===!0)&&await te(A),oe(A,"primary",N),_(A)}}))}async function $(A){s&&s(),f==="complete-flow"?await B(e):await v(e,A.id)}function J(){u&&u()}return Et.createElement(kp,null,Et.createElement(pe,{appearance:o}),r?z.map((A,q)=>Et.createElement(So,{key:A.id,appearance:o,steps:Z(),selectedStep:q,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>$(A),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:U(e),onComplete:J,...g})):Et.createElement(So,{appearance:o,steps:Z(),selectedStep:N,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>$(z[N]),tooltipPosition:d,completedStepsCount:U(e),showHighlightOnly:l,onComplete:J,...g}))};import fe,{useEffect as vp,useRef as Ip,useState as Ep}from"react";import{Portal as Bp}from"react-portal";import ut from"styled-components";var Qn=ut.button`
|
|
1296
|
+
${e=>T(e)} {
|
|
1297
1297
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1298
1298
|
|
|
1299
1299
|
display: flex;
|
|
@@ -1311,12 +1311,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
1313
|
`,Zn=ut.span`
|
|
1314
|
-
${e=>
|
|
1314
|
+
${e=>T(e)} {
|
|
1315
1315
|
font-size: 12px;
|
|
1316
1316
|
display: inline-block;
|
|
1317
1317
|
}
|
|
1318
1318
|
`,Rn=ut.span`
|
|
1319
|
-
${e=>
|
|
1319
|
+
${e=>T(e)} {
|
|
1320
1320
|
font-size: 12px;
|
|
1321
1321
|
display: inline-block;
|
|
1322
1322
|
}
|
|
@@ -1331,7 +1331,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1331
1331
|
align-items: flex-end;
|
|
1332
1332
|
z-index: 50;
|
|
1333
1333
|
`,ts=ut.button`
|
|
1334
|
-
${e=>
|
|
1334
|
+
${e=>T(e)} {
|
|
1335
1335
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1336
1336
|
background-color: #ffffff;
|
|
1337
1337
|
border: 1px solid #f5f5f5;
|
|
@@ -1347,7 +1347,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1347
1347
|
border-radius: 45px;
|
|
1348
1348
|
cursor: pointer;
|
|
1349
1349
|
`,os=ut.div`
|
|
1350
|
-
${e=>
|
|
1350
|
+
${e=>T(e)} {
|
|
1351
1351
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1352
1352
|
background: #ffffff;
|
|
1353
1353
|
}
|
|
@@ -1364,7 +1364,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1364
1364
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1365
1365
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1366
1366
|
`,rs=ut.button`
|
|
1367
|
-
${e=>
|
|
1367
|
+
${e=>T(e)} {
|
|
1368
1368
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1369
1369
|
color: #434343;
|
|
1370
1370
|
:hover {
|
|
@@ -1380,8 +1380,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1380
1380
|
font-size: 14px;
|
|
1381
1381
|
|
|
1382
1382
|
padding: 8px 12px;
|
|
1383
|
-
`;import{AnimatePresence as as,motion as ps}from"framer-motion";import is from"react";var ns=({style:e,className:t})=>is.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},is.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import ss from"react";var ls=({style:e,className:t})=>ss.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},ss.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Ap=({flowId:e,style:t,onStepCompletion:o,visible:
|
|
1384
|
-
${e=>
|
|
1383
|
+
`;import{AnimatePresence as as,motion as ps}from"framer-motion";import is from"react";var ns=({style:e,className:t})=>is.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},is.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import ss from"react";var ls=({style:e,className:t})=>ss.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},ss.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Ap=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:i="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:f,getNumberOfStepsCompleted:u,isLoading:g,targetingLogicShouldHideFlow:F}=X(),{primaryCTAClickSideEffects:b}=le(),C=Ip(null),[m,v]=Ep(!1),{mergeAppearanceWithDefault:w}=Q();s=w(s),vp(()=>(document.addEventListener("click",B,!1),()=>{document.removeEventListener("click",B,!1)}),[]);let B=E=>{C.current&&!C.current.contains(E.target)&&v(!1)};if(g)return null;let k=p(e);if(!k||F(k))return null;let c=d(e);if(!c||!n)return null;function h(E,U){!E.completionCriteria&&(E.autoMarkCompleted||E.autoMarkCompleted===void 0)&&l(e,E.id),b(E),o&&o(E,U),v(!1)}function y(){return m&&fe.createElement(os,{className:a("floatingWidgetMenu",s),as:ps.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:i},c.map((E,U)=>fe.createElement(rs,{className:a("floatingWidgetMenuItem",s),key:U,onClick:()=>h(E,U)},E.title)))}return i=="inline"?fe.createElement("span",{ref:C},fe.createElement(Qn,{style:t,onClick:()=>{v(!m)},className:a("supportButton",s)},fe.createElement(Rn,{className:a("supportIconContainer",s)},fe.createElement(ls,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),fe.createElement(Zn,{className:a("supportButtonTitle",s)},r)),fe.createElement(as,null,fe.createElement(y,null))):fe.createElement(Bp,null,fe.createElement(es,{style:t,ref:C},fe.createElement(as,null,fe.createElement(y,null)),fe.createElement(ts,{onClick:()=>{v(!m)},as:ps.button,whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},fe.createElement(ns,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import $e,{useEffect as Np}from"react";import yo from"styled-components";var ds=yo.div`
|
|
1384
|
+
${e=>T(e)} {
|
|
1385
1385
|
display: flex;
|
|
1386
1386
|
flex-direction: column;
|
|
1387
1387
|
width: 100%;
|
|
@@ -1395,18 +1395,18 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1395
1395
|
border-radius: 12px;
|
|
1396
1396
|
position: relative;
|
|
1397
1397
|
}
|
|
1398
|
-
`,cs=
|
|
1398
|
+
`,cs=yo.div`
|
|
1399
1399
|
display: flex;
|
|
1400
1400
|
flex-direction: column;
|
|
1401
1401
|
flex: 1;
|
|
1402
|
-
`,ms=
|
|
1402
|
+
`,ms=yo.div`
|
|
1403
1403
|
display: flex;
|
|
1404
1404
|
flex-direction: column;
|
|
1405
1405
|
justify-content: center;
|
|
1406
1406
|
align-items: flex-start;
|
|
1407
1407
|
margin-top: 16px;
|
|
1408
|
-
`,us=
|
|
1409
|
-
${e=>
|
|
1408
|
+
`,us=yo.div`
|
|
1409
|
+
${e=>T(e)} {
|
|
1410
1410
|
position: absolute;
|
|
1411
1411
|
top: 16px;
|
|
1412
1412
|
right: 16px;
|
|
@@ -1416,9 +1416,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1416
1416
|
opacity: 0.8;
|
|
1417
1417
|
}
|
|
1418
1418
|
}
|
|
1419
|
-
`;var Op=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:
|
|
1419
|
+
`;var Op=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:f,isLoading:u,targetingLogicShouldHideFlow:g,updateCustomVariables:F,getFlowSteps:b,getFlowStatus:C,getCurrentStepIndex:m}=X(),{primaryCTAClickSideEffects:v}=le(),{mergeAppearanceWithDefault:w}=Q();if(i=w(i),Np(()=>{F(o)},[o,u]),u)return null;let B=d(e);if(!B||g(B)||C(e)===R)return null;let c=b(e)[m(e)];return $e.createElement($e.Fragment,null,$e.createElement(pe,{appearance:i}),$e.createElement(ds,{appearance:i,className:Ce(a("embeddedTipContainer",i),r),style:s},(p===!0||c.dismissible)&&$e.createElement(us,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",i)},$e.createElement(Pe,null)),$e.createElement(cs,null,$e.createElement(Te,{size:"small",appearance:i,title:c.title,subtitle:c.subtitle})),c.primaryButtonTitle&&$e.createElement(ms,{className:a("embeddedTipCallToActionContainer",i)},$e.createElement(ee,{classPrefix:"embeddedTip",title:c.primaryButtonTitle,appearance:i,withMargin:!1,size:"small",type:"inline",onClick:async()=>{c.handlePrimaryButtonClick(),v(c),!(n&&n(c,m(e),"primary")===!1)&&(await f(e,c.id),await l(e))}}))))};import ce,{useEffect as Lp}from"react";import Bt from"styled-components";var fs=Bt.div`
|
|
1420
1420
|
// use the :not annotation
|
|
1421
|
-
${e=>
|
|
1421
|
+
${e=>T(e)} {
|
|
1422
1422
|
display: flex;
|
|
1423
1423
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1424
1424
|
width: 100%;
|
|
@@ -1431,7 +1431,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1431
1431
|
border-radius: 12px;
|
|
1432
1432
|
}
|
|
1433
1433
|
`,gs=Bt.div`
|
|
1434
|
-
${e=>
|
|
1434
|
+
${e=>T(e)} {
|
|
1435
1435
|
display: flex;
|
|
1436
1436
|
width: 36px;
|
|
1437
1437
|
height: 36px;
|
|
@@ -1461,5 +1461,5 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map
|
|
|
1461
1461
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1462
1462
|
align-items: flex-end;
|
|
1463
1463
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1464
|
-
`;import Cs from"react";var
|
|
1464
|
+
`;import Cs from"react";var Ss=({style:e,className:t})=>Cs.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor"},Cs.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var Dp=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:i,onButtonClick:r,appearance:s,type:p="full-width"})=>{let{getFlow:d,markFlowCompleted:l,isLoading:f,targetingLogicShouldHideFlow:u,updateCustomVariables:g,getFlowMetadata:F,getFlowStatus:b,getFlowSteps:C,getCurrentStepIndex:m}=X(),{primaryCTAClickSideEffects:v}=le(),{mergeAppearanceWithDefault:w}=Q();if(s=w(s),Lp(()=>{g(i)},[i,f]),f)return null;let B=d(e);if(!B||u(B)||b(e)===R)return null;let k=C(e),c=k.length>0?k[m(e)]:F(e);return c!=null&&c.title&&(t=c.title),c!=null&&c.subtitle&&(o=c.subtitle),ce.createElement(ce.Fragment,null,ce.createElement(pe,{appearance:s}),ce.createElement(fs,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ce.createElement(gs,null,ce.createElement(Ss,null)),p==="square"&&c.dismissible&&ce.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},ce.createElement(Yo,{type:p,onClick:async()=>{await l(e),n&&n()},className:a("bannerDismissButton",s)},ce.createElement(Pe,null))),ce.createElement(hs,{type:p},ce.createElement(Te,{appearance:s,title:t,subtitle:o})),ce.createElement(xs,{type:p,className:a("bannerCallToActionContainer",s)},ce.createElement(ee,{title:(c==null?void 0:c.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{v(c),r&&r(c,0,"primary")}})),p!=="square"&&c.dismissible&&ce.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},ce.createElement(Yo,{type:p,onClick:async()=>{await l(e),n&&n()},className:a("bannerDismissButton",s)},ce.createElement(Pe,null)))))};export{Dp as FrigadeBanner,qo as FrigadeChecklist,Op as FrigadeEmbeddedTip,Gr as FrigadeForm,cp as FrigadeGuide,sp as FrigadeHeroChecklist,pp as FrigadeProgressBadge,aa as FrigadeProvider,Ap as FrigadeSupportWidget,Pp as FrigadeTour,ke as useFlowOpens,At as useFlowResponses,X as useFlows,Mo as useOrganization,To as useUser};
|
|
1465
1465
|
//# sourceMappingURL=index.mjs.map
|