@frigade/react 1.33.21 → 1.34.0
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/README.md +1 -0
- package/lib/index.js +319 -277
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +311 -269
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -2
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import{ThemeProvider as Ep}from"styled-components";import ht,{useContext as rp,useEffect as Bo,useState as pr}from"react";import{useCallback as ft,useContext as kl,useEffect as Pl}from"react";import Vo,{useMemo as Ar}from"react";var Er="1.33.21 ";var Ne="NOT_STARTED_STEP",R="COMPLETED_FLOW",co="ABORTED_FLOW",ut="STARTED_FLOW",$e="NOT_STARTED_FLOW",Me="COMPLETED_STEP",mo="STARTED_STEP";function ze(){let{publicApiKey:e,userId:t,apiUrl:o}=Vo.useContext(G);return{config:Ar(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Er,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Ar(()=>`${o}/v1/public/`,[o])}}var ul="frigade-last-call-at-",fl="frigade-last-call-data-";function kt(){let{shouldGracefullyDegrade:e,readonly:t}=Vo.useContext(G);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Ft();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Ft();let r=ul+o,n=fl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return Ft()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return Ft(p)}return s?s.ok?s:Ft(s.statusText):Ft()}}function Ft(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Pt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Vo.useContext(G);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as wl,useState as Ir}from"react";import{useContext as xl,useEffect as hl,useState as Cl}from"react";import yl from"swr";import{useContext as gl}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=gl(G);function n(d,g=!1){return e[d]??g}function s(d,g){t(C=>({...C,[d]:g}))}function p(d){t(g=>{let{[d]:C,...b}=g;return{...b}})}function c(d){r.includes(d)||i(g=>[...g,d])}function a(d){return r.includes(d)}function h(d){return Object.entries(e).some(([g,C])=>C&&g!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:h,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}import Sl from"swr/immutable";var bl="unknown";function Ee(){let{config:e,apiUrl:t}=ze(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=xl(G),{resetOpenFlowState:c}=Be(),[a,h]=Cl(!1),d={data:n.map(y=>({flowId:y.id,flowState:R,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=y=>fetch(y,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${y}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),d)),C=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:b,isLoading:k,mutate:u,error:B}=p?Sl(C,g):yl(C,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),x=b==null?void 0:b.data;hl(()=>{!a&&!k&&x&&h(!0)},[x,a,k]);async function F(y){if(x&&!p){let P=x.find(O=>O.flowId===y);P&&P.flowState!==R&&(P.flowState=R),await u(Promise.resolve({...b,data:x}),{optimisticData:{...b,data:x},revalidate:!1,rollbackOnError:!1})}}async function N(y,P,O){if(x){let I=x.find(D=>D.flowId===y);I&&(I.stepStates[P]=O,I.flowState=ut),await u(Promise.resolve({...b,data:x}),{optimisticData:{...b,data:x},revalidate:!1,rollbackOnError:!1})}}async function T(y,P,O){if(x){let I=x.find(D=>D.flowId===y);I&&(I.lastStepId=P,I.stepStates[P]=O,I.flowState=ut),await u({...b,data:x},{optimisticData:{...b,data:x},revalidate:!1,rollbackOnError:!1})}}async function m(y){if(x){let P=x.find(O=>O.flowId===y);P&&P.flowState!==$e&&(P.flowState=$e,P.lastStepId=bl,Object.keys(P.stepStates).forEach(O=>{P.stepStates[O].actionType=Ne,P.stepStates[O].createdAt=new Date().toISOString()}),await u({...b,data:x},{optimisticData:{...b,data:x},revalidate:!1,rollbackOnError:!1}),c(y))}}async function w(y,P){if(x){let O=x.find(I=>I.flowId===y);O&&O.stepStates[P]!==Ne&&(O.stepStates[P]=Ne),await u({...b,data:x},{optimisticData:{...b,data:x},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:x,isLoadingUserFlowStateData:!a,mutateUserFlowState:u,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:T,error:B}}function jt(){let{config:e,apiUrl:t}=ze(),{userFlowStatesData:o,mutateUserFlowState:i}=Ee(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=wl(G),[c,a]=Ir(new Set),[h,d]=Ir(new Set),g=kt();function C(u){let B=JSON.stringify(u);if(c.has(B))return null;c.add(B),a(c),h.add(u),d(h);let x=s==null?void 0:s.find(F=>F.flowSlug===u.flowSlug&&F.stepId===u.stepId&&F.actionType===u.actionType&&F.createdAt===u.createdAt);return g(`${t}flowResponses`,{...e,method:"POST",body:B}).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),n([...r,u])):x||p(N=>[...N??[],u])})}async function b(u){u.foreignUserId&&(u.actionType===ut||u.actionType===$e?await C(u):u.actionType===R?await C(u):u.actionType===mo?await C(u):u.actionType===Me?await C(u):u.actionType===co?await C(u):u.actionType===Ne&&await C(u))}function k(){let u=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let x in B.stepStates){let F=B.stepStates[x];u.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...u,...s]}return{addResponse:b,setFlowResponses:p,getFlowResponses:k}}import vl from"swr";var Tl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Nr=e=>{let t=Tl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Fl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Fl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function ee(){let{config:e,apiUrl:t}=ze(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,setFlowResponses:h,setShouldGracefullyDegrade:d,readonly:g}=kl(G),C={data:[]},{verifySDKInitiated:b}=Pt(),{addResponse:k,getFlowResponses:u}=jt(),B=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`),d(!0),C)).catch(S=>(console.log(`Error fetching ${f}: ${S}. Will gracefully degrade and hide Frigade`),d(!0),C)),{userFlowStatesData:x,isLoadingUserFlowStateData:F,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:m,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:y}=Ee(),{data:P,error:O,isLoading:I}=vl(n?`${t}flows${g?"?readonly=true":""}`:null,B,{keepPreviousData:!0});Pl(()=>{if(O){console.error(O);return}P&&P.data&&i(P.data)},[P,O]);function D(f){if(I)return null;let S=o.find(E=>E.slug===f);return!S&&o.length>0&&!F&&!I?(console.log(`Flow with slug ${f} not found`),null):(S==null?void 0:S.active)===!1?null:S}function L(f){var A;if(!D(f))return[];let S=D(f).data;return S?(S=z(S),(((A=JSON.parse(S))==null?void 0:A.data)??[]).map(Z=>{let mt=de(Z);return{handleSecondaryButtonClick:()=>{Z.skippable===!0&&K(f,Z.id,{skipped:!0})},...Z,complete:Q(f,Z.id)===Me||mt>=1,blocked:M(f,Z.id),hidden:$(f,Z.id),handlePrimaryButtonClick:()=>{(!Z.completionCriteria&&(Z.autoMarkCompleted||Z.autoMarkCompleted===void 0)||Z.completionCriteria&&Z.autoMarkCompleted===!0)&&K(f,Z.id)},progress:mt}}).filter(Z=>Z.hidden!==!0)):[]}function z(f){return f.replaceAll(/\${(.*?)}/g,(S,E)=>s[E]===void 0?"":String(s[E]).replace(/[\u00A0-\u9999<>\&]/g,function(A){return"&#"+A.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function H(f){if(!D(f))return[];let S=D(f).data;return S?(S=z(S),JSON.parse(S)??{}):[]}function X(f,S){p(E=>({...E,[f]:S}))}function se(f){!F&&!I&&f&&JSON.stringify(s)!=JSON.stringify({...s,...f})&&Object.keys(f).forEach(S=>{X(S,f[S])})}let q=ft(async(f,S,E)=>{if(!b())return;let A={foreignUserId:r,flowSlug:f,stepId:S,actionType:mo,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};re(A)&&(await y(f,S,A),k(A))},[r,x]),V=ft(async(f,S,E)=>{if(!b())return;let A={foreignUserId:r,flowSlug:f,stepId:S,actionType:Ne,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};re(A)&&(await w(f,S),k(A))},[r,x]),K=ft(async(f,S,E)=>{if(!b())return;let A={foreignUserId:r,flowSlug:f,stepId:S,actionType:Me,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};re(A)&&(await m(f,S,A),k(A))},[r,x]),J=ft(async(f,S)=>{if(!b()||te(f)===$e)return;let E={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:$e,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};await T(f),re(E)&&k(E)},[r,x]),ye=ft(async(f,S)=>{if(!b())return;let E={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:ut,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};re(E)&&k(E)},[r,x]),ve=ft(async(f,S)=>{if(!b())return;let E={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:R,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};re(E)&&(await N(f),k(E))},[r,x]),Se=ft(async(f,S)=>{if(!b())return;let E={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:co,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};re(E)&&(await N(f),k(E))},[r,x]);function re(f){var S;if(!x&&f.actionType===Ne)return!1;if(x){let E=x.find(A=>A.flowId===f.flowSlug);if(f.actionType===Ne&&(!(E!=null&&E.stepStates[f.stepId])||E.stepStates[f.stepId].actionType===Ne)||E&&((S=E.stepStates[f.stepId])==null?void 0:S.actionType)===f.actionType||E&&E.flowState===R&&f.actionType===R)return!1}return!0}function Q(f,S){let E=me(f,S);return F?null:E?E.actionType:Ne}function M(f,S){let E=me(f,S);return E?E.blocked:!1}function $(f,S){let E=me(f,S);return E?E.hidden:!1}function me(f,S){if(F)return null;let E=x==null?void 0:x.find(A=>A.flowId===f);return!E||!E.stepStates[S]?null:E.stepStates[S]??null}function ue(f){var E;if(F||!x)return null;if(te(f)===$e)return L(f)[0]??null;let S=(E=x.find(A=>A.flowId===f))==null?void 0:E.lastStepId;return S?L(f).find(A=>A.id===S):null}function _(f){let S=ue(f);if(!S)return 0;let E=L(f).findIndex(A=>A.id===S.id)??0;return Q(f,S.id)===Me&&E<L(f).length-1?E+1:E}function de(f){if(!f.completionCriteria)return;let S=Nr(f.completionCriteria);if(S===null)return;let E=be(S),A=De(S);return A===0?void 0:E/A}function te(f){let S=x==null?void 0:x.find(E=>E.flowId===f);return S?S.flowState:null}function be(f){let S=L(f);return S.length===0?0:S.filter(A=>Q(f,A.id)===Me).length}function De(f){return L(f).length}function j(f){let S=o.find(E=>E.slug===f);return S?JSON.parse(S.data):null}function he(f){if(g)return!1;if(F)return!0;if(f!=null&&f.targetingLogic&&x){let S=x.find(E=>E.flowId===f.slug);if(S)return S.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&r&&r.startsWith("guest_"))}function Vt(f){return!he(D(f))}return{getFlow:D,getFlowData:j,isLoading:F||I,getStepStatus:Q,getFlowSteps:L,getCurrentStepIndex:_,markStepStarted:q,markStepCompleted:K,markFlowNotStarted:J,markFlowStarted:ye,markFlowCompleted:ve,markFlowAborted:Se,markStepNotStarted:V,getFlowStatus:te,getNumberOfStepsCompleted:be,getNumberOfSteps:De,targetingLogicShouldHideFlow:he,setCustomVariable:X,updateCustomVariables:se,customVariables:s,getStepOptionalProgress:de,getFlowMetadata:H,isStepBlocked:M,isStepHidden:$,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Vt}}import{useCallback as Or,useContext as Bl,useEffect as El}from"react";var vt="guest_";function Gt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Bl(G),{config:n,apiUrl:s}=ze(),{mutateUserFlowState:p}=Ee(),c=kt(),{verifySDKInitiated:a}=Pt();El(()=>{if(e&&!t){if(e.startsWith(vt))return;let g=`frigade-user-registered-${e}`;localStorage.getItem(g)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(g,"true"))}},[e,r,t]);let h=Or(async g=>{if(!a())return;let C={foreignId:e,properties:g};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(C)}),i(b=>({...b,...g})),p()},[e,n,r,p]),d=Or(async(g,C)=>{if(!a())return;let k={foreignId:e,events:[{event:g,properties:C}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(k)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:h,trackEventForUser:d}}import{v4 as ip}from"uuid";import He,{useEffect as Ra,useState as ep}from"react";import Ue,{useEffect as $l}from"react";import go from"styled-components";import Al from"react";import Il from"styled-components";var Lr="fr-",Kt="cfr-";function l(e,t){let o=`${Lr}${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+" "+Kt+e}return o}function v(e){if(!e.className||e.className.indexOf(Kt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Lr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function jo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ge(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${jo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function we(...e){return e.filter(Boolean).join(" ")}function qt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Nl=Il.div`
|
|
2
|
+
import St,{createContext as Fp,useEffect as Io,useState as Oe}from"react";import{ThemeProvider as kp}from"styled-components";import Ct,{useContext as Ra,useEffect as Eo,useState as dr}from"react";import{useCallback as ft,useContext as Pl,useEffect as vl}from"react";import jo,{useMemo as Ir}from"react";var Ar="1.34.0 ";var Ne="NOT_STARTED_STEP",R="COMPLETED_FLOW",mo="ABORTED_FLOW",ut="STARTED_FLOW",$e="NOT_STARTED_FLOW",Me="COMPLETED_STEP",uo="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=jo.useContext(G);return{config:Ir(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Ar,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Ir(()=>`${o}/v1/public/`,[o])}}var fl="frigade-last-call-at-",gl="frigade-last-call-data-";function Pt(){let{shouldGracefullyDegrade:e,readonly:t}=jo.useContext(G);return async(o,r)=>{if(t&&(r.method==="POST"||r.method==="PUT"||r.method==="DELETE"))return kt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),kt();let i=fl+o,n=gl+o;if(window&&window.localStorage&&r&&r.body&&r.method==="POST"){let p=window.localStorage.getItem(i),c=window.localStorage.getItem(n);if(p&&c&&c==r.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return kt()}window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(n,r.body)}let s;try{s=await fetch(o,r)}catch(p){return kt(p)}return s?s.ok?s:kt(s.statusText):kt()}}function kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function vt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=jo.useContext(G);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Tl,useState as Nr}from"react";import{useContext as hl,useEffect as Cl,useState as Sl}from"react";import yl from"swr";import{useContext as xl}from"react";function ve(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:r,completedFlowsToKeepOpenDuringSession:i}=xl(G);function n(d,h=!1){return e[d]??h}function s(d,h){t(S=>({...S,[d]:h}))}function p(d){t(h=>{let{[d]:S,...w}=h;return{...w}})}function c(d){i.includes(d)||r(h=>[...h,d])}function a(d){return i.includes(d)}function x(d){return Object.entries(e).some(([h,S])=>S&&h!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:x,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}import bl from"swr/immutable";var wl="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:r,organizationId:i,flows:n,setShouldGracefullyDegrade:s,readonly:p}=hl(G),{resetOpenFlowState:c}=ve(),[a,x]=Sl(!1),d={data:n.map(b=>({flowId:b.id,flowState:R,lastStepId:null,userId:r,foreignUserId:r,stepStates:{},shouldTrigger:!1}))},h=b=>fetch(b,e).then(F=>{if(F.ok)return F.json();throw new Error("Failed to fetch user flow states")}).catch(F=>(console.log(`Error fetching ${b}: ${F}. Will gracefully degrade and hide Frigade`),s(!0),d)),S=o&&n&&r?`${t}userFlowStates?foreignUserId=${encodeURIComponent(r)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,{data:w,isLoading:P,mutate:u,error:E}=p?bl(S,h):yl(S,h,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),g=w==null?void 0:w.data;Cl(()=>{!a&&!P&&g&&x(!0)},[g,a,P]);async function T(b){if(g&&!p){let F=g.find(O=>O.flowId===b);F&&F.flowState!==R&&(F.flowState=R),await u(Promise.resolve({...w,data:g}),{optimisticData:{...w,data:g},revalidate:!1,rollbackOnError:!1})}}async function N(b,F,O){if(g){let I=g.find(D=>D.flowId===b);I&&(I.stepStates[F]=O,I.flowState=ut),await u(Promise.resolve({...w,data:g}),{optimisticData:{...w,data:g},revalidate:!1,rollbackOnError:!1})}}async function C(b,F,O){if(g){let I=g.find(D=>D.flowId===b);I&&(I.lastStepId=F,I.stepStates[F]=O,I.flowState=ut),await u({...w,data:g},{optimisticData:{...w,data:g},revalidate:!1,rollbackOnError:!1})}}async function m(b){if(g){let F=g.find(O=>O.flowId===b);F&&F.flowState!==$e&&(F.flowState=$e,F.lastStepId=wl,Object.keys(F.stepStates).forEach(O=>{F.stepStates[O].actionType=Ne,F.stepStates[O].createdAt=new Date().toISOString()}),await u({...w,data:g},{optimisticData:{...w,data:g},revalidate:!1,rollbackOnError:!1}),c(b))}}async function B(b,F){if(g){let O=g.find(I=>I.flowId===b);O&&O.stepStates[F]!==Ne&&(O.stepStates[F]=Ne),await u({...w,data:g},{optimisticData:{...w,data:g},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:g,isLoadingUserFlowStateData:!a,mutateUserFlowState:u,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:C,error:E}}function Gt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:r}=Be(),{failedFlowResponses:i,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Tl(G),[c,a]=Nr(new Set),[x,d]=Nr(new Set),h=Pt();function S(u){let E=JSON.stringify(u);if(c.has(E))return null;c.add(E),a(c),x.add(u),d(x);let g=s==null?void 0:s.find(T=>T.flowSlug===u.flowSlug&&T.stepId===u.stepId&&T.actionType===u.actionType&&T.createdAt===u.createdAt);return h(`${t}flowResponses`,{...e,method:"POST",body:E}).then(T=>{T.status!==200&&T.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),n([...i,u])):g||p(N=>[...N??[],u])})}async function w(u){u.foreignUserId&&(u.actionType===ut||u.actionType===$e?await S(u):u.actionType===R?await S(u):u.actionType===uo?await S(u):u.actionType===Me?await S(u):u.actionType===mo?await S(u):u.actionType===Ne&&await S(u))}function P(){let u=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let g in E.stepStates){let T=E.stepStates[g];u.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:T.stepId,actionType:T.actionType,data:{},createdAt:new Date(T.createdAt),blocked:T.blocked,hidden:T.hidden})}}),[...u,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:P}}import Bl from"swr";var Fl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Or=e=>{let t=Fl.exec(e);if(t===null)return null;let o=null;return t.forEach((r,i)=>{let n=kl(r,"'","");n.startsWith("flow_")&&(o=n)}),o},kl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function ee(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:r,userId:i,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,setFlowResponses:x,setShouldGracefullyDegrade:d,readonly:h}=Pl(G),S={data:[]},{verifySDKInitiated:w}=vt(),{addResponse:P,getFlowResponses:u}=Gt(),E=f=>fetch(f,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${f} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),S)).catch(y=>(console.log(`Error fetching ${f}: ${y}. Will gracefully degrade and hide Frigade`),d(!0),S)),{userFlowStatesData:g,isLoadingUserFlowStateData:T,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowNotStarted:C,optimisticallyMarkStepCompleted:m,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:b}=Be(),{data:F,error:O,isLoading:I}=Bl(n?`${t}flows${h?"?readonly=true":""}`:null,E,{keepPreviousData:!0});vl(()=>{if(O){console.error(O);return}F&&F.data&&r(F.data)},[F,O]);function D(f){if(I)return null;let y=o.find(v=>v.slug===f);return!y&&o.length>0&&!T&&!I?(console.log(`Flow with slug ${f} not found`),null):(y==null?void 0:y.active)===!1?null:y}function L(f){var A;if(!D(f))return[];let y=D(f).data;return y?(y=_(y),(((A=JSON.parse(y))==null?void 0:A.data)??[]).map(Z=>{let mt=de(Z);return{handleSecondaryButtonClick:()=>{Z.skippable===!0&&K(f,Z.id,{skipped:!0})},...Z,complete:Q(f,Z.id)===Me||mt>=1,blocked:M(f,Z.id),hidden:$(f,Z.id),handlePrimaryButtonClick:()=>{(!Z.completionCriteria&&(Z.autoMarkCompleted||Z.autoMarkCompleted===void 0)||Z.completionCriteria&&Z.autoMarkCompleted===!0)&&K(f,Z.id)},progress:mt}}).filter(Z=>Z.hidden!==!0)):[]}function _(f){return f.replaceAll(/\${(.*?)}/g,(y,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(A){return"&#"+A.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function H(f){if(!D(f))return[];let y=D(f).data;return y?(y=_(y),JSON.parse(y)??{}):[]}function X(f,y){p(v=>({...v,[f]:y}))}function se(f){!T&&!I&&f&&JSON.stringify(s)!=JSON.stringify({...s,...f})&&Object.keys(f).forEach(y=>{X(y,f[y])})}let q=ft(async(f,y,v)=>{if(!w())return;let A={foreignUserId:i,flowSlug:f,stepId:y,actionType:uo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};re(A)&&(await b(f,y,A),P(A))},[i,g]),V=ft(async(f,y,v)=>{if(!w())return;let A={foreignUserId:i,flowSlug:f,stepId:y,actionType:Ne,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};re(A)&&(await B(f,y),P(A))},[i,g]),K=ft(async(f,y,v)=>{if(!w())return;let A={foreignUserId:i,flowSlug:f,stepId:y,actionType:Me,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};re(A)&&(await m(f,y,A),P(A))},[i,g]),J=ft(async(f,y)=>{if(!w()||te(f)===$e)return;let v={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:$e,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await C(f),re(v)&&P(v)},[i,g]),Se=ft(async(f,y)=>{if(!w())return;let v={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:ut,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(v)&&P(v)},[i,g]),Pe=ft(async(f,y)=>{if(!w())return;let v={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:R,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(v)&&(await N(f),P(v))},[i,g]),ye=ft(async(f,y)=>{if(!w())return;let v={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:mo,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(v)&&(await N(f),P(v))},[i,g]);function re(f){var y;if(!g&&f.actionType===Ne)return!1;if(g){let v=g.find(A=>A.flowId===f.flowSlug);if(f.actionType===Ne&&(!(v!=null&&v.stepStates[f.stepId])||v.stepStates[f.stepId].actionType===Ne)||v&&((y=v.stepStates[f.stepId])==null?void 0:y.actionType)===f.actionType||v&&v.flowState===R&&f.actionType===R)return!1}return!0}function Q(f,y){let v=me(f,y);return T?null:v?v.actionType:Ne}function M(f,y){let v=me(f,y);return v?v.blocked:!1}function $(f,y){let v=me(f,y);return v?v.hidden:!1}function me(f,y){if(T)return null;let v=g==null?void 0:g.find(A=>A.flowId===f);return!v||!v.stepStates[y]?null:v.stepStates[y]??null}function ue(f){var v;if(T||!g)return null;if(te(f)===$e)return L(f)[0]??null;let y=(v=g.find(A=>A.flowId===f))==null?void 0:v.lastStepId;return y?L(f).find(A=>A.id===y):null}function z(f){let y=ue(f);if(!y)return 0;let v=L(f).findIndex(A=>A.id===y.id)??0;return Q(f,y.id)===Me&&v<L(f).length-1?v+1:v}function de(f){if(!f.completionCriteria)return;let y=Or(f.completionCriteria);if(y===null)return;let v=be(y),A=De(y);return A===0?void 0:v/A}function te(f){let y=g==null?void 0:g.find(v=>v.flowId===f);return y?y.flowState:null}function be(f){let y=L(f);return y.length===0?0:y.filter(A=>Q(f,A.id)===Me).length}function De(f){return L(f).length}function j(f){let y=o.find(v=>v.slug===f);return y?JSON.parse(y.data):null}function xe(f){if(h)return!1;if(T)return!0;if(f!=null&&f.targetingLogic&&g){let y=g.find(v=>v.flowId===f.slug);if(y)return y.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&i&&i.startsWith("guest_"))}function jt(f){return!xe(D(f))}return{getFlow:D,getFlowData:j,isLoading:T||I,getStepStatus:Q,getFlowSteps:L,getCurrentStepIndex:z,markStepStarted:q,markStepCompleted:K,markFlowNotStarted:J,markFlowStarted:Se,markFlowCompleted:Pe,markFlowAborted:ye,markStepNotStarted:V,getFlowStatus:te,getNumberOfStepsCompleted:be,getNumberOfSteps:De,targetingLogicShouldHideFlow:xe,setCustomVariable:X,updateCustomVariables:se,customVariables:s,getStepOptionalProgress:de,getFlowMetadata:H,isStepBlocked:M,isStepHidden:$,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,isFlowAvailableToUser:jt}}import{useCallback as Lr,useContext as El,useEffect as Al}from"react";var Bt="guest_";function Kt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:r,shouldGracefullyDegrade:i}=El(G),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=Pt(),{verifySDKInitiated:a}=vt();Al(()=>{if(e&&!t){if(e.startsWith(Bt))return;let h=`frigade-user-registered-${e}`;localStorage.getItem(h)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(h,"true"))}},[e,i,t]);let x=Lr(async h=>{if(!a())return;let S={foreignId:e,properties:h};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),r(w=>({...w,...h})),p()},[e,n,i,p]),d=Lr(async(h,S)=>{if(!a())return;let P={foreignId:e,events:[{event:h,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(P)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:x,trackEventForUser:d}}import{v4 as ep}from"uuid";import He,{useEffect as Xa,useState as Ja}from"react";import Ue,{useEffect as Ml}from"react";import xo from"styled-components";import Il from"react";import Nl from"styled-components";var Dr="fr-",qt="cfr-";function l(e,t){let o=`${Dr}${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+" "+qt+e}return o}function k(e){if(!e.className||e.className.indexOf(qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Dr)?"":`:not(${o.map(r=>`.${r}`).join(", ")})`}function Go(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ge(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Go(t)}: ${e.styleOverrides[t]};`).join(" "):""}function we(...e){return e.filter(Boolean).join(" ")}function Yt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ol=Nl.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>k(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
`,$r=({onClose:e,appearance:t})=>Il.createElement(Ol,{className:l("modalBackground",t),onClick:()=>e()});import Ko from"react";import Ll from"styled-components";var Dl=Ll.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
31
|
-
${e=>
|
|
30
|
+
`,Ee=()=>Ko.createElement(Dl,null,Ko.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Ko.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Ul}from"react-portal";import Yr from"react";import qo from"react";function $l({style:e,className:t}){return qo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},qo.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),qo.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var Mr=$l;import Yo from"styled-components";import tt from"styled-components";var fo=tt.div`
|
|
31
|
+
${e=>k(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -38,14 +38,14 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
padding: 22px 22px 12px;
|
|
40
40
|
z-index: ${e=>e.zIndex};
|
|
41
|
-
`,
|
|
41
|
+
`,Ur=tt.div`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
45
45
|
top: 12px;
|
|
46
46
|
right: 12px;
|
|
47
|
-
`,
|
|
48
|
-
${e=>
|
|
47
|
+
`,zr=tt.img`
|
|
48
|
+
${e=>k(e)} {
|
|
49
49
|
display: block;
|
|
50
50
|
width: 100%;
|
|
51
51
|
height: auto;
|
|
@@ -53,38 +53,38 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
53
53
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
54
54
|
margin-bottom: 16px;
|
|
55
55
|
}
|
|
56
|
-
`,_r=
|
|
57
|
-
${e=>
|
|
56
|
+
`,_r=tt.div`
|
|
57
|
+
${e=>k(e)} {
|
|
58
58
|
display: block;
|
|
59
59
|
width: 100%;
|
|
60
60
|
height: auto;
|
|
61
61
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
62
62
|
margin-bottom: 16px;
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,Wr=tt.div`
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: row;
|
|
67
67
|
justify-content: space-between;
|
|
68
68
|
align-content: center;
|
|
69
|
-
`,
|
|
69
|
+
`,Hr=tt.div`
|
|
70
70
|
display: flex;
|
|
71
71
|
flex: 1;
|
|
72
72
|
flex-direction: column;
|
|
73
73
|
justify-content: center;
|
|
74
|
-
`,
|
|
74
|
+
`,Vr=tt.div`
|
|
75
75
|
display: flex;
|
|
76
76
|
flex: 2;
|
|
77
77
|
flex-shrink: 1;
|
|
78
78
|
gap: 8px;
|
|
79
79
|
height: 64px;
|
|
80
|
-
${e=>
|
|
80
|
+
${e=>k(e)} {
|
|
81
81
|
flex-direction: row;
|
|
82
82
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
83
83
|
align-content: center;
|
|
84
84
|
align-items: center;
|
|
85
85
|
}
|
|
86
|
-
`,
|
|
87
|
-
${e=>
|
|
86
|
+
`,jr=tt.p`
|
|
87
|
+
${e=>k(e)} {
|
|
88
88
|
font-style: normal;
|
|
89
89
|
font-weight: 600;
|
|
90
90
|
font-size: 15px;
|
|
@@ -92,7 +92,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
92
92
|
color: #808080;
|
|
93
93
|
}
|
|
94
94
|
margin: 0;
|
|
95
|
-
`;var
|
|
95
|
+
`;var Gr=Yo.div`
|
|
96
96
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
97
97
|
position: absolute;
|
|
98
98
|
bottom: -47px;
|
|
@@ -103,7 +103,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
103
103
|
align-items: center;
|
|
104
104
|
justify-content: center;
|
|
105
105
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
106
|
-
`,
|
|
106
|
+
`,Kr=Yo(fo)`
|
|
107
107
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
108
108
|
position: absolute;
|
|
109
109
|
bottom: -60px;
|
|
@@ -116,7 +116,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
116
116
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
117
117
|
padding: 0;
|
|
118
118
|
z-index: ${e=>e.zIndex};
|
|
119
|
-
`,
|
|
119
|
+
`,qr=Yo.div`
|
|
120
120
|
display: flex;
|
|
121
121
|
justify-content: center;
|
|
122
122
|
align-items: center;
|
|
@@ -125,8 +125,8 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
125
125
|
font-size: 12px;
|
|
126
126
|
line-height: 18px;
|
|
127
127
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
128
|
-
`;function
|
|
129
|
-
${e=>
|
|
128
|
+
`;function go({appearance:e}){return Yr.createElement(qr,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Yr.createElement(Mr,null))}var zl=xo.div`
|
|
129
|
+
${e=>k(e)} {
|
|
130
130
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
131
131
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
132
132
|
/* Mobile */
|
|
@@ -167,28 +167,28 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
167
167
|
opacity: 1;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
`,_l=
|
|
170
|
+
`,_l=xo.div`
|
|
171
171
|
position: relative;
|
|
172
172
|
flex: 0 1 auto;
|
|
173
|
-
`,
|
|
173
|
+
`,Wl=xo.div`
|
|
174
174
|
position: absolute;
|
|
175
175
|
top: 24px;
|
|
176
176
|
right: 24px;
|
|
177
177
|
cursor: pointer;
|
|
178
178
|
z-index: 1501;
|
|
179
|
-
${e=>
|
|
179
|
+
${e=>k(e)} {
|
|
180
180
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
181
181
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
182
182
|
}
|
|
183
|
-
`,
|
|
183
|
+
`,Hl=xo.div`
|
|
184
184
|
overflow: scroll;
|
|
185
185
|
flex: 1 1;
|
|
186
186
|
display: flex;
|
|
187
187
|
::-webkit-scrollbar {
|
|
188
188
|
display: none;
|
|
189
189
|
}
|
|
190
|
-
`,
|
|
191
|
-
${e=>
|
|
190
|
+
`,ot=({onClose:e,visible:t,headerContent:o=null,style:r=null,children:i,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>(Ml(()=>{let c=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",c),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",c)}},[e,t]),t?Ue.createElement(Ul,null,Ue.createElement($r,{appearance:n,onClose:()=>{s&&e()}}),Ue.createElement(zl,{appearance:n,className:l("modalContainer",n),styleOverrides:r},s&&Ue.createElement(Wl,{className:l("modalClose",n),onClick:()=>e(),appearance:n},Ue.createElement(Ee,null)),o&&Ue.createElement(_l,null,o),Ue.createElement(Hl,null,i),p&&Ue.createElement(Gr,{appearance:n,className:l("poweredByFrigadeRibbon",n)},Ue.createElement(go,{appearance:n})))):Ue.createElement(Ue.Fragment,null));import rt,{useEffect as Vl}from"react";import ho from"styled-components";import{Portal as jl}from"react-portal";var Gl=ho.div`
|
|
191
|
+
${e=>k(e)} {
|
|
192
192
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
193
193
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
194
194
|
position: fixed;
|
|
@@ -205,41 +205,41 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
205
205
|
bottom: 0;
|
|
206
206
|
margin-right: 28px;
|
|
207
207
|
margin-bottom: 28px;
|
|
208
|
-
`,
|
|
208
|
+
`,Kl=ho.div`
|
|
209
209
|
position: relative;
|
|
210
210
|
flex: 1;
|
|
211
|
-
`,
|
|
211
|
+
`,ql=ho.div`
|
|
212
212
|
position: absolute;
|
|
213
213
|
top: 24px;
|
|
214
214
|
right: 24px;
|
|
215
215
|
cursor: pointer;
|
|
216
216
|
z-index: 1501;
|
|
217
|
-
${e=>
|
|
217
|
+
${e=>k(e)} {
|
|
218
218
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
219
219
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
220
220
|
}
|
|
221
|
-
`,
|
|
221
|
+
`,Yl=ho.div`
|
|
222
222
|
overflow: scroll;
|
|
223
223
|
flex: 5;
|
|
224
224
|
::-webkit-scrollbar {
|
|
225
225
|
display: none;
|
|
226
226
|
}
|
|
227
|
-
`,
|
|
228
|
-
${e=>
|
|
227
|
+
`,Xr=({onClose:e,visible:t,headerContent:o=null,children:r,appearance:i})=>(Vl(()=>{let n=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",n),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",n)}},[e,t]),t?rt.createElement(jl,null,rt.createElement(Gl,{appearance:i,className:l("cornerModalContainer",i)},rt.createElement(ql,{className:l("cornerModalClose",i),onClick:()=>e()},rt.createElement(Ee,null)),o&&rt.createElement(Kl,null,o),rt.createElement(Yl,null,r))):rt.createElement(rt.Fragment,null));import{useContext as Xl}from"react";function oe(){let{defaultAppearance:e}=Xl(G);function t(o){let r=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(r.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(r.theme,o.theme??{})}:r}return{mergeAppearanceWithDefault:t}}import gt,{useContext as Ca,useEffect as Sa,useState as rr}from"react";import wo from"styled-components";import yo,{useEffect as Jl,useState as ti}from"react";import Qo from"styled-components";import Co from"styled-components";var Jr=Co.label`
|
|
228
|
+
${e=>k(e)} {
|
|
229
229
|
font-size: 14px;
|
|
230
230
|
line-height: 20px;
|
|
231
231
|
margin-bottom: 5px;
|
|
232
232
|
margin-top: 10px;
|
|
233
233
|
}
|
|
234
234
|
display: flex;
|
|
235
|
-
`,
|
|
236
|
-
${e=>
|
|
235
|
+
`,Qr=Co.label`
|
|
236
|
+
${e=>k(e)} {
|
|
237
237
|
font-size: 12px;
|
|
238
238
|
line-height: 20px;
|
|
239
239
|
margin-bottom: 5px;
|
|
240
240
|
}
|
|
241
241
|
display: flex;
|
|
242
|
-
`,
|
|
242
|
+
`,Zr=Co.span`
|
|
243
243
|
font-weight: 400;
|
|
244
244
|
font-size: 14px;
|
|
245
245
|
line-height: 22px;
|
|
@@ -247,17 +247,17 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
247
247
|
display: flex;
|
|
248
248
|
margin-right: 5px;
|
|
249
249
|
margin-top: 10px;
|
|
250
|
-
`,Co
|
|
250
|
+
`,So=Co.div`
|
|
251
251
|
display: flex;
|
|
252
252
|
align-items: flex-start;
|
|
253
253
|
justify-content: left;
|
|
254
254
|
margin-bottom: 10px;
|
|
255
|
-
`;import
|
|
255
|
+
`;import Xo from"react";var Ke={theme:{colorPrimary:"#000000",colorSecondary:"#EEEEEE",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#C7C7C7",colorBorder:"#E5E5E5",colorTextError:"#c00000",borderRadius:20}};function it({title:e,required:t,appearance:o=Ke}){return e?Xo.createElement(So,null,t?Xo.createElement(Zr,{className:l("formLabelRequired",o),appearance:o},"*"):null,Xo.createElement(Jr,{className:l("formLabel",o)},e)):null}import Rr from"react";function Et({title:e,appearance:t}){return e?Rr.createElement(So,null,Rr.createElement(Qr,{className:l("formSubLabel",t)},e)):null}import{z as Jo}from"zod";function ei(e,t){try{if(t){if(t.type=="number"){let o=Jo.number();if(t.props)for(let r of t.props)r.requirement=="min"?o=o.min(Number(r.value),r.message??"Value is too small"):r.requirement=="max"?o=o.max(Number(r.value),r.message??"Value is too large"):r.requirement=="positive"?o=o.positive(r.message??"Value must be positive"):r.requirement=="negative"&&(o=o.nonpositive(r.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=Jo.string();if(t.props)for(let r of t.props)r.requirement=="min"?o=o.min(Number(r.value),r.message??"Value is too short"):r.requirement=="max"?o=o.max(Number(r.value),r.message??"Value is too long"):r.requirement=="regex"&&(o=o.regex(new RegExp(String(r.value)),r.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof Jo.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var Ql=Qo.div`
|
|
256
256
|
display: flex;
|
|
257
257
|
flex-direction: column;
|
|
258
258
|
width: 100%;
|
|
259
|
-
`,Qo
|
|
260
|
-
${e=>
|
|
259
|
+
`,Zo=Qo.input`
|
|
260
|
+
${e=>k(e)} {
|
|
261
261
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
262
262
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
263
263
|
font-size: 14px;
|
|
@@ -272,8 +272,8 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
272
272
|
box-sizing: border-box;
|
|
273
273
|
padding: 0 10px;
|
|
274
274
|
margin-bottom: 10px;
|
|
275
|
-
`,
|
|
276
|
-
${e=>
|
|
275
|
+
`,Zl=Qo.textarea`
|
|
276
|
+
${e=>k(e)} {
|
|
277
277
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
278
278
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
279
279
|
font-size: 14px;
|
|
@@ -288,14 +288,14 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
288
288
|
min-height: 70px;
|
|
289
289
|
box-sizing: border-box;
|
|
290
290
|
margin-bottom: 10px;
|
|
291
|
-
`;function
|
|
291
|
+
`;function Ro({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:r,inputData:i}){let n=e,[s,p]=ti((i==null?void 0:i.text)||""),[c,a]=ti(!1),x=Zo;Jl(()=>{s===""&&!c&&(a(!0),d(""))},[]);function d(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){r([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let w=ei(S,n.validation);if(w){r([{id:n.id,message:w}]);return}r([])}n.multiline&&(x=Zl);function h(){var S;switch((S=n==null?void 0:n.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return yo.createElement(Ql,null,yo.createElement(it,{title:n.title,required:n.required,appearance:t.appearance}),yo.createElement(x,{className:l("inputComponent",t.appearance),value:s,onChange:S=>{d(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:h()}),yo.createElement(Et,{title:n.subtitle,appearance:t.appearance}))}import We,{useEffect as oi,useState as ri}from"react";import ii from"styled-components";var er="",Rl=ii.div`
|
|
292
292
|
display: flex;
|
|
293
293
|
flex-direction: column;
|
|
294
294
|
width: 100%;
|
|
295
295
|
-webkit-appearance: none;
|
|
296
296
|
appearance: none;
|
|
297
|
-
`,
|
|
298
|
-
${e=>
|
|
297
|
+
`,ea=ii.select`
|
|
298
|
+
${e=>k(e)} {
|
|
299
299
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
300
300
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
301
301
|
font-size: 14px;
|
|
@@ -307,7 +307,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
307
307
|
|
|
308
308
|
padding: 0 10px;
|
|
309
309
|
margin-bottom: 10px;
|
|
310
|
-
color: ${e=>{var t,o,i
|
|
310
|
+
color: ${e=>{var t,o,r,i;return e.value==""?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextDisabled:(i=(r=e.appearance)==null?void 0:r.theme)==null?void 0:i.colorText}};
|
|
311
311
|
|
|
312
312
|
appearance: none;
|
|
313
313
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'><path stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/></svg>");
|
|
@@ -315,16 +315,16 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
315
315
|
background-repeat: no-repeat;
|
|
316
316
|
background-size: 1.5em 1.5em;
|
|
317
317
|
-webkit-print-color-adjust: exact;
|
|
318
|
-
`;function
|
|
318
|
+
`;function ni({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:i}){var x,d,h,S,w,P;let n=e,[s,p]=ri(((x=r==null?void 0:r.choice)==null?void 0:x[0])||""),[c,a]=ri(!1);return oi(()=>{var u,E,g,T;if(s===""&&!c){if(a(!0),n.requireSelection){p(er);return}if(n.defaultValue&&((u=n.props.options)!=null&&u.find(N=>N.id===n.defaultValue))){let N=(E=n.props.options)==null?void 0:E.find(C=>C.id===n.defaultValue);p(N.id),o({choice:[N.id]})}else p(((g=n.props.options)==null?void 0:g[0].id)||""),o({choice:[((T=n.props.options)==null?void 0:T[0].id)||""]})}},[]),oi(()=>{n.requireSelection&&s===er?i([{message:"Please select an option",id:n.id}]):i([])},[s]),We.createElement(Rl,null,We.createElement(it,{title:n.title,required:!1,appearance:t.appearance}),We.createElement(ea,{value:s,onChange:u=>{p(u.target.value),o({choice:[u.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},n.requireSelection&&We.createElement("option",{key:"null-value",value:er,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(u=>We.createElement("option",{key:u.id,value:u.id},u.title))),((S=(h=n.props.options)==null?void 0:h.find(u=>u.id===s))==null?void 0:S.isOpenEnded)&&We.createElement(We.Fragment,null,We.createElement(it,{title:((P=(w=n.props.options)==null?void 0:w.find(u=>u.id===s))==null?void 0:P.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),We.createElement(Zo,{type:"text",placeholder:"Enter your answer here",onChange:u=>{o({choice:[u.target.value]})},appearance:t.appearance})),We.createElement(Et,{title:n.subtitle,appearance:t.appearance}))}import Qt,{useEffect as tr,useState as li}from"react";import ai from"styled-components";import Jt from"react";import Xt from"react";var si=({color:e,percentage:t,size:o})=>{let r=o*.5-2,i=2*Math.PI*r,n=(1-t)*i;return Xt.createElement("circle",{r,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==i?e:"",strokeWidth:"3px",strokeDasharray:i,strokeDashoffset:t?n:0})},ta=({fillColor:e,size:t,percentage:o,children:r,bgColor:i="#D9D9D9",className:n,style:s})=>Xt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Xt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Xt.createElement(si,{color:i,size:t}),Xt.createElement(si,{color:e,percentage:o,size:t})),r),At=ta;import oa from"styled-components";var ra=({color:e="#FFFFFF"})=>Jt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ia={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},na={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},sa={border:"1px solid #000000",color:"#FFFFFF"},la={border:"1px solid #E6E6E6"},aa={color:"#FFFFFF"},pa={border:"3px solid #D9D9D9"},da=e=>e==="square"?ia:na,ca=(e,t)=>e==="square"?t?sa:la:t?aa:pa,ma=oa.div`
|
|
319
319
|
${e=>Ge(e)}
|
|
320
|
-
`,qe=({value:e,type:t="square",primaryColor:o="#000000",progress:
|
|
320
|
+
`,qe=({value:e,type:t="square",primaryColor:o="#000000",progress:r,appearance:i=Ke,style:n,className:s})=>{let p=da(t),c=ca(t,e);return e===!0?p={...p,...c,backgroundColor:o,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&r!==void 0&&r!==1?Jt.createElement(At,{fillColor:o,percentage:r,size:22}):Jt.createElement(ma,{styleOverrides:p,style:n,role:"checkbox",className:we(l("checkIconContainer",i),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",i),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Jt.createElement(ra,{color:"#FFFFFF"}))};var ua=ai.div`
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
width: 100%;
|
|
324
324
|
-webkit-appearance: none;
|
|
325
325
|
appearance: none;
|
|
326
|
-
`,fa=
|
|
327
|
-
${e=>
|
|
326
|
+
`,fa=ai.button`
|
|
327
|
+
${e=>k(e)} {
|
|
328
328
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
329
329
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
330
330
|
font-size: 14px;
|
|
@@ -348,8 +348,8 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
348
348
|
height: 60px;
|
|
349
349
|
padding: 0 18px;
|
|
350
350
|
margin-bottom: 10px;
|
|
351
|
-
`;function
|
|
352
|
-
${e=>
|
|
351
|
+
`;function pi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:i}){var x;let n=e,[s,p]=li((r==null?void 0:r.choice)||[]),[c,a]=li(!1);return tr(()=>{s.length==0&&!c&&(a(!0),o({choice:[]}))},[]),tr(()=>{o({choice:s})},[s]),tr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?i([{message:"",id:n.id}]):i([])},[s]),Qt.createElement(ua,null,Qt.createElement(it,{title:n.title,required:n.required,appearance:t.appearance}),(x=n.props.options)==null?void 0:x.map(d=>Qt.createElement(fa,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(h=>h!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,Qt.createElement(qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),Qt.createElement(Et,{title:n.subtitle,appearance:t.appearance}))}import bo from"react";import di from"styled-components";import ga from"dompurify";function fe(e){return{__html:ga.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var xa=di.h1`
|
|
352
|
+
${e=>k(e)} {
|
|
353
353
|
font-style: normal;
|
|
354
354
|
font-weight: 600;
|
|
355
355
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -359,48 +359,48 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
359
359
|
margin-bottom: 4px;
|
|
360
360
|
color: ${e=>e.appearance.theme.colorText};
|
|
361
361
|
}
|
|
362
|
-
`,ha=
|
|
363
|
-
${e=>
|
|
362
|
+
`,ha=di.h2`
|
|
363
|
+
${e=>k(e)} {
|
|
364
364
|
font-style: normal;
|
|
365
365
|
font-weight: 400;
|
|
366
366
|
font-size: 15px;
|
|
367
367
|
line-height: 20px;
|
|
368
368
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
369
369
|
}
|
|
370
|
-
`;function Te({appearance:e,title:t,subtitle:o,size:
|
|
370
|
+
`;function Te({appearance:e,title:t,subtitle:o,size:r="medium",classPrefix:i=""}){return bo.createElement(bo.Fragment,null,bo.createElement(xa,{appearance:e,className:l(`${i}${i?Yt(r):r}Title`,e),dangerouslySetInnerHTML:fe(t),size:r}),o&&bo.createElement(ha,{appearance:e,className:l(`${i}${i?Yt(r):r}Subtitle`,e),dangerouslySetInnerHTML:fe(o),size:r}))}import*as or from"react";var ci=e=>or.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},or.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var ya=wo.div`
|
|
371
371
|
display: flex;
|
|
372
372
|
flex-direction: column;
|
|
373
373
|
justify-content: flex-end;
|
|
374
374
|
padding-bottom: 14px;
|
|
375
375
|
overflow: visible;
|
|
376
|
-
`,
|
|
376
|
+
`,ba=wo.div`
|
|
377
377
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
378
378
|
font-size: 12px;
|
|
379
379
|
margin-bottom: 12px;
|
|
380
380
|
display: flex;
|
|
381
381
|
align-items: center;
|
|
382
|
-
`,
|
|
382
|
+
`,wa=wo.div`
|
|
383
383
|
margin-right: 4px;
|
|
384
384
|
display: inline-flex;
|
|
385
|
-
`,
|
|
385
|
+
`,Ta=wo.div`
|
|
386
386
|
padding-left: 1px;
|
|
387
387
|
padding-right: 1px;
|
|
388
|
-
`,
|
|
388
|
+
`,Fa={text:Ro,multipleChoice:ni,multipleChoiceList:pi},ir="frigade-multiInputStepTypeData";function mi({flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:i,appearance:n,customFormElements:s,prefillData:p}){var C;let c=t.props,[a,x]=rr([]),[d,h]=rr([]),{userId:S}=Kt(),[w,P]=rr(T()||(p?p[t.id]:null)||{}),{readonly:u}=Ca(G),E={...Fa,...s};Sa(()=>{r(a.length===0)},[a,r]);function g(m,B){let b={...w,[m.id]:B};P(b),i(b),window&&window.localStorage&&!u&&window.localStorage.setItem(N(),JSON.stringify(b))}function T(){if(window&&window.localStorage){let m=window.localStorage.getItem(N());if(m)return JSON.parse(m)}return null}function N(){return`${ir}-${e}-${t.id}-${S}`}return gt.createElement(Ta,{className:l("multiInput",n)},gt.createElement(Te,{appearance:n,title:t.title,subtitle:t.subtitle}),gt.createElement(ya,{className:l("multiInputContainer",n)},(C=c.data)==null?void 0:C.map(m=>{var b;let B=(b=a.reverse().find(F=>F.id===m.id))==null?void 0:b.message;return E[m.type]?gt.createElement("span",{key:m.id,"data-field-id":m.id,className:l("multiInputField",n)},E[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:i,appearance:n},onSaveInputData:F=>{!d.includes(m.id)&&F&&(F==null?void 0:F.text)!==""&&h(O=>[...O,m.id]),g(m,F)},inputData:w[m.id],setFormValidationErrors:F=>{x(O=>F.length===0?O.filter(I=>I.id!==m.id):[...O,...F])}}),B&&d.includes(m.id)&>.createElement(ba,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:m.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:l("multiInputValidationError",n)},gt.createElement(wa,{appearance:n,className:l("multiInputValidationErrorIcon",n)},gt.createElement(ci,null)),B)):null})))}import xt from"styled-components";var ui=xt.div`
|
|
389
389
|
align-items: center;
|
|
390
390
|
display: flex;
|
|
391
391
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
392
392
|
padding-top: 14px;
|
|
393
|
-
`,
|
|
393
|
+
`,fi=xt.div`
|
|
394
394
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
395
395
|
font-size: 12px;
|
|
396
|
-
`,
|
|
396
|
+
`,gi=xt.div`
|
|
397
397
|
display: flex;
|
|
398
398
|
gap: 12px;
|
|
399
|
-
`,
|
|
399
|
+
`,xi=xt.div`
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: row;
|
|
402
402
|
flex: 1 1;
|
|
403
|
-
`,
|
|
403
|
+
`,hi=xt.div`
|
|
404
404
|
display: flex;
|
|
405
405
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
406
406
|
// Otherwise, use 4px padding
|
|
@@ -408,11 +408,11 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
408
408
|
flex-grow: 1;
|
|
409
409
|
flex-basis: 0;
|
|
410
410
|
position: relative;
|
|
411
|
-
`,
|
|
411
|
+
`,Ci=xt.div`
|
|
412
412
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
413
413
|
position: relative;
|
|
414
414
|
overflow-y: auto;
|
|
415
|
-
`,
|
|
415
|
+
`,Si=xt.div`
|
|
416
416
|
display: flex;
|
|
417
417
|
align-self: stretch;
|
|
418
418
|
flex-grow: 1;
|
|
@@ -424,10 +424,10 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
424
424
|
background-position: center;
|
|
425
425
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
426
426
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
427
|
-
`;import nt from"react";import
|
|
427
|
+
`;import nt from"react";import ka from"react";import yi from"styled-components";var Pa=yi.button`
|
|
428
428
|
justify-content: center;
|
|
429
429
|
align-content: center;
|
|
430
|
-
${e=>
|
|
430
|
+
${e=>k(e)} {
|
|
431
431
|
display: flex;
|
|
432
432
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
433
433
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -435,8 +435,8 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
435
435
|
${e=>e.withMargin?"margin: 16px 0px 16px 0px;":""}
|
|
436
436
|
|
|
437
437
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary}};
|
|
438
|
-
color: ${e=>{var t,o,i
|
|
439
|
-
background-color: ${e=>{var t,o,i
|
|
438
|
+
color: ${e=>{var t,o,r,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary:(i=(r=e.appearance)==null?void 0:r.theme)==null?void 0:i.colorTextOnPrimaryBackground}};
|
|
439
|
+
background-color: ${e=>{var t,o,r,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground:(i=(r=e==null?void 0:e.appearance)==null?void 0:r.theme)==null?void 0:i.colorPrimary}};
|
|
440
440
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
441
441
|
padding: ${e=>e.size=="small"?"6px 14px 6px 14px":"8px 20px 8px 20px"};
|
|
442
442
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
@@ -455,8 +455,8 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
455
455
|
opacity: 0.3;
|
|
456
456
|
cursor: not-allowed;
|
|
457
457
|
}
|
|
458
|
-
`,
|
|
459
|
-
${e=>
|
|
458
|
+
`,To=yi.div`
|
|
459
|
+
${e=>k(e)} {
|
|
460
460
|
display: flex;
|
|
461
461
|
flex-direction: row;
|
|
462
462
|
justify-content: flex-start;
|
|
@@ -466,14 +466,14 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
466
466
|
margin-right: 8px;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
`,ie=({onClick:e,title:t,style:o,disabled:
|
|
469
|
+
`,ie=({onClick:e,title:t,style:o,disabled:r,type:i="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:a=""})=>{function x(){let d=s?"buttonSecondary":"button";return a===""?d:`${a}${Yt(d)}`}return ka.createElement(Pa,{secondary:s,appearance:p,disabled:r,onClick:e,styleOverrides:o,type:i,withMargin:c,size:n,className:l(x(),p)},t??"Continue")};var bi=({step:e,canContinue:t,appearance:o,onPrimaryClick:r,onSecondaryClick:i,formType:n,selectedStep:s,steps:p,onBack:c,allowBackNavigation:a,errorMessage:x})=>{let d=n==="inline"?"inline":"full-width",h=p.length>1&&s!=0&&a;return nt.createElement(nt.Fragment,null,x!==null&&x!=null&&nt.createElement(fi,{appearance:o,className:l("formCTAError",o)},x),nt.createElement(ui,{showBackButton:h,className:l("formCTAContainer",o)},h&&nt.createElement(ie,{title:e.backButtonTitle??"\u2190",onClick:c,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),nt.createElement(gi,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?nt.createElement(ie,{title:e.secondaryButtonTitle,onClick:i,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?nt.createElement(ie,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:r,type:d,appearance:o}):null)))};import nr from"react";import va from"styled-components";var Ba=va.div`
|
|
470
470
|
text-align: center;
|
|
471
|
-
`,
|
|
471
|
+
`,wi=({stepCount:e=0,currentStep:t=0,className:o,appearance:r})=>{let{theme:i}=oe().mergeAppearanceWithDefault(r);return nr.createElement(Ba,{className:o},nr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>nr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?i.colorPrimary:"#E6E6E6"}))))};import ht from"react";import It from"styled-components";import{useContext as Ea}from"react";function ae(){let e=Ea(G);function t(i){r(i.primaryButtonUri,i.primaryButtonUriTarget)}function o(i){r(i.secondaryButtonUri,i.secondaryButtonUriTarget)}function r(i,n){if(!i)return;let s=i.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(i,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:r}}var Aa=It.div`
|
|
472
472
|
display: flex;
|
|
473
473
|
flex-wrap: wrap;
|
|
474
474
|
align-content: center;
|
|
475
475
|
justify-content: center;
|
|
476
|
-
`,
|
|
476
|
+
`,Ia=It.div`
|
|
477
477
|
align-content: center;
|
|
478
478
|
align-items: center;
|
|
479
479
|
display: flex;
|
|
@@ -487,10 +487,10 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
487
487
|
flex-basis: 255px;
|
|
488
488
|
flex-grow: 0;
|
|
489
489
|
flex-shrink: 0;
|
|
490
|
-
`,
|
|
490
|
+
`,Na=It.img`
|
|
491
491
|
width: 78px;
|
|
492
492
|
height: auto;
|
|
493
|
-
`,
|
|
493
|
+
`,Oa=It.button`
|
|
494
494
|
font-style: normal;
|
|
495
495
|
font-weight: 600;
|
|
496
496
|
font-size: 13px;
|
|
@@ -503,11 +503,11 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
503
503
|
border-radius: 100px;
|
|
504
504
|
padding: 8px 12px;
|
|
505
505
|
margin-top: 16px;
|
|
506
|
-
|
|
506
|
+
`,La=It.h1`
|
|
507
507
|
font-weight: 700;
|
|
508
508
|
font-size: 28px;
|
|
509
509
|
line-height: 34px;
|
|
510
|
-
`,
|
|
510
|
+
`,Da=It.h2`
|
|
511
511
|
font-style: normal;
|
|
512
512
|
font-weight: 400;
|
|
513
513
|
font-size: 16px;
|
|
@@ -516,7 +516,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
516
516
|
margin-top: 12px;
|
|
517
517
|
margin-bottom: 16px;
|
|
518
518
|
max-width: 70%;
|
|
519
|
-
`;function
|
|
519
|
+
`;function Ti({stepData:e,appearance:t}){var r,i;let{handleUrl:o}=ae();return ht.createElement("div",null,ht.createElement(La,null,e.title),ht.createElement(Da,null,e.subtitle),ht.createElement(Aa,null,(i=(r=e.props)==null?void 0:r.links)==null?void 0:i.map(n=>ht.createElement(Ia,{key:n.title},ht.createElement(Na,{src:n.imageUri}),ht.createElement(Oa,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Nt,{useEffect as Ha}from"react";import Po from"styled-components";import sr from"react";var Fo=({style:e,className:t})=>sr.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},sr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),sr.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 Zt,{useRef as $a,useState as Ma}from"react";import ko from"styled-components";var Ua=ko.div`
|
|
520
520
|
display: flex;
|
|
521
521
|
align-items: center;
|
|
522
522
|
justify-content: flex-start;
|
|
@@ -524,7 +524,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
524
524
|
width: 100%;
|
|
525
525
|
height: 100%;
|
|
526
526
|
position: relative;
|
|
527
|
-
`,
|
|
527
|
+
`,za=ko.div`
|
|
528
528
|
position: absolute;
|
|
529
529
|
display: flex;
|
|
530
530
|
align-items: center;
|
|
@@ -543,56 +543,56 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
543
543
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
544
544
|
border-radius: 50%;
|
|
545
545
|
}
|
|
546
|
-
`,
|
|
546
|
+
`,_a=ko.video`
|
|
547
547
|
width: 100%;
|
|
548
548
|
height: 100%;
|
|
549
549
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
550
|
-
`,
|
|
550
|
+
`,Wa=ko.iframe`
|
|
551
551
|
width: 100%;
|
|
552
552
|
height: 100%;
|
|
553
553
|
min-height: 260px;
|
|
554
554
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
555
|
-
`;function st({appearance:e,videoUri:t}){let o
|
|
556
|
-
${e=>
|
|
555
|
+
`;function st({appearance:e,videoUri:t}){let o=$a(),[r,i]=Ma(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),Zt.createElement(Wa,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Zt.createElement(Ua,{className:l("videoPlayerWrapper",e),appearance:e},!r&&Zt.createElement(za,{onClick:()=>{i(!0),o.current.play()},appearance:e},Zt.createElement(Fo,null)),Zt.createElement(_a,{appearance:e,controls:r,ref:o,play:r,src:t}))}var Va=Po.div`
|
|
556
|
+
${e=>k(e)} {
|
|
557
557
|
display: flex;
|
|
558
558
|
flex-direction: column;
|
|
559
559
|
justify-content: center;
|
|
560
560
|
}
|
|
561
|
-
`,
|
|
562
|
-
${e=>
|
|
561
|
+
`,ja=Po.img`
|
|
562
|
+
${e=>k(e)} {
|
|
563
563
|
width: 100%;
|
|
564
564
|
height: auto;
|
|
565
565
|
max-height: 250px;
|
|
566
566
|
margin-bottom: 24px;
|
|
567
567
|
}
|
|
568
|
-
`,
|
|
569
|
-
${e=>
|
|
568
|
+
`,Ga=Po.div`
|
|
569
|
+
${e=>k(e)} {
|
|
570
570
|
margin-bottom: 24px;
|
|
571
571
|
}
|
|
572
|
-
`,
|
|
573
|
-
${e=>
|
|
572
|
+
`,Ka=Po.div`
|
|
573
|
+
${e=>k(e)} {
|
|
574
574
|
width: 100%;
|
|
575
575
|
height: auto;
|
|
576
576
|
max-height: 250px;
|
|
577
577
|
margin-bottom: 24px;
|
|
578
578
|
}
|
|
579
|
-
`;function
|
|
579
|
+
`;function Fi({stepData:e,appearance:t,setCanContinue:o}){return Ha(()=>{o(!0)},[]),Nt.createElement(Va,{className:l("callToActionContainer",t)},Nt.createElement(Ga,{className:l("callToActionTextContainer",t)},Nt.createElement(Te,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Nt.createElement(ja,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Nt.createElement(Ka,{appearance:t,className:l("callToActionVideo",t)},Nt.createElement(st,{appearance:t,videoUri:e.videoUri})))}import Ye,{useEffect as lr,useState as ar}from"react";import lt from"styled-components";var ki=lt.div`
|
|
580
580
|
width: auto;
|
|
581
581
|
display: flex;
|
|
582
582
|
flex-direction: column;
|
|
583
583
|
justify-content: center;
|
|
584
584
|
align-items: center;
|
|
585
585
|
padding: 4px;
|
|
586
|
-
`,
|
|
586
|
+
`,Pi=lt.div`
|
|
587
587
|
width: 100%;
|
|
588
588
|
text-align: left;
|
|
589
|
-
`,
|
|
589
|
+
`,vi=lt.h1`
|
|
590
590
|
font-style: normal;
|
|
591
591
|
font-weight: 700;
|
|
592
592
|
font-size: 32px;
|
|
593
593
|
line-height: 38px;
|
|
594
594
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
595
|
-
`,
|
|
595
|
+
`,Bi=lt.h1`
|
|
596
596
|
font-style: normal;
|
|
597
597
|
font-weight: 400;
|
|
598
598
|
font-size: 16px;
|
|
@@ -600,7 +600,7 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
600
600
|
margin-top: 16px;
|
|
601
601
|
margin-bottom: 16px;
|
|
602
602
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
603
|
-
`,
|
|
603
|
+
`,Ei=lt.div`
|
|
604
604
|
padding-top: 12px;
|
|
605
605
|
padding-bottom: 12px;
|
|
606
606
|
flex-direction: row;
|
|
@@ -611,17 +611,17 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
611
611
|
cursor: pointer;
|
|
612
612
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
613
613
|
width: 100%;
|
|
614
|
-
`,
|
|
614
|
+
`,Ai=lt.div`
|
|
615
615
|
padding-top: 10px;
|
|
616
616
|
padding-bottom: 10px;
|
|
617
617
|
flex-direction: row;
|
|
618
618
|
display: flex;
|
|
619
619
|
justify-content: flex-start;
|
|
620
|
-
`,
|
|
620
|
+
`,Ii=lt.img`
|
|
621
621
|
width: 42px;
|
|
622
622
|
height: 42px;
|
|
623
623
|
margin-right: 12px;
|
|
624
|
-
`,
|
|
624
|
+
`,Ni=lt.p`
|
|
625
625
|
font-style: normal;
|
|
626
626
|
font-weight: 500;
|
|
627
627
|
font-size: 17px;
|
|
@@ -629,8 +629,8 @@ import Ct,{createContext as Bp,useEffect as Ao,useState as Oe}from"react";import
|
|
|
629
629
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
630
630
|
display: flex;
|
|
631
631
|
align-self: center;
|
|
632
|
-
`;var
|
|
633
|
-
${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map(([s,p])=>`${jo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Rt.createElement(o,{inlineStyles:t})}var Oi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:h,onButtonClick:d,dismissible:g=!0,endFlowOnDismiss:C=!1,modalPosition:b="center",repeatable:k=!1,onDismiss:u,showPagination:B=!1,allowBackNavigation:x=!1,validationHandler:F,showFrigadeBranding:N=!1,onFormDataChange:T,showFooter:m=!0,prefillData:w={}})=>{let{getFlow:y,getFlowSteps:P,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:D,getCurrentStepIndex:L,markFlowCompleted:z,markFlowNotStarted:H}=ee(),X=L(e),{mergeAppearanceWithDefault:se}=oe(),[q,V]=ep(!1),{setOpenFlowState:K,getOpenFlowState:J,hasOpenModals:ye}=Be();c=se(c);let[ve,Se]=i!==void 0&&r!==void 0?[i,r]:[J(e,!0),$=>K(e,$)];if(Ra(()=>{!q&&!O&&(V(!0),D(e)===R&&k&&(H(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(me=>{me.startsWith(rr)&&window.localStorage.removeItem(me)})),V(!0))},[q,V,O]),O)return null;let re=y(e);if(!re||I(re))return null;let Q=P(e);if(!Q||i!==void 0&&i===!1||D(e)===R&&a||(o=="modal"||o=="corner-modal")&&ye(e))return null;let M=()=>{Se(!1),u&&u(),C===!0&&z(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",He.createElement(tt,{appearance:c,onClose:M,visible:ve,style:$,dismissible:g,showFrigadeBranding:N},He.createElement(ne,{appearance:c}),He.createElement(vo,{appearance:c,steps:Q,selectedStep:X,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:Se,onDismiss:u,showPagination:B,customFormElements:s,allowBackNavigation:x,validationHandler:F,onFormDataChange:T,showFooter:m,prefillData:w}))}return o==="modal"&&b!=="center"?He.createElement(Yr,{appearance:c,onClose:M,visible:ve},He.createElement(ne,{appearance:c}),He.createElement(vo,{appearance:c,steps:Q,selectedStep:X,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:Se,onDismiss:u,showPagination:B,customFormElements:s,allowBackNavigation:x,validationHandler:F,onFormDataChange:T,showFooter:m,prefillData:w})):He.createElement(He.Fragment,null,He.createElement(ne,{appearance:c}),He.createElement(vo,{appearance:c,steps:Q,selectedStep:X,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:Se,onDismiss:u,showPagination:B,customFormElements:s,allowBackNavigation:x,validationHandler:F,onFormDataChange:T,showFooter:m,prefillData:w}))},Li=Oi;import{useCallback as Di,useContext as tp,useEffect as op}from"react";function ar(){let{organizationId:e,userId:t,setOrganizationId:o}=tp(G),{mutateUserFlowState:i}=Ee(),{config:r,apiUrl:n}=ze(),s=kt(),{verifySDKInitiated:p}=Pt();op(()=>{if(t&&e){if(t.startsWith(vt))return;let h=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(h)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(h,"true"))}},[t,e]);let c=Di(async h=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let d={foreignUserId:t,foreignUserGroupId:e,properties:h};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(d)}),i()},[e,t,r,i]),a=Di(async(h,d)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let C={foreignUserId:t,foreignUserGroupId:e,events:[{event:h,properties:d}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(C)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:c,trackEventForOrganization:a}}var $i="frigade-xFrigade_guestUserId",eo="frigade-xFrigade_userId",Mi=({})=>{let{setFlowResponses:e}=jt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ee(),{userId:r,setUserId:n}=Gt(),[s,p]=pr(null),{getFlowStatus:c}=ee(),{flows:a,userProperties:h,setIsNewGuestUser:d,flowResponses:g}=rp(G),[C,b]=pr([]),[k,u]=pr([]),{organizationId:B}=ar();Bo(()=>{if(!o&&t)for(let T=0;T<t.length;T++){let m=t[T],w=a.find(y=>y.slug===(m==null?void 0:m.flowId));if(w&&m&&m.shouldTrigger===!0&&w.type=="FORM"&&w.triggerType==="AUTOMATIC"&&!k.includes(w.slug)){setTimeout(()=>{x(m.flowId)},500);break}}},[o,t]),Bo(()=>{g.length>0&&i()},[g]);function x(T){let m=a.find(w=>w.slug===T);m&&m.triggerType==="AUTOMATIC"&&!k.includes(m.slug)&&(u([...k,m.slug]),b([m]))}function F(){if(!r){let T=localStorage.getItem(eo);if(T){n(T);return}let m=localStorage.getItem($i);if(m){n(m);return}d(!0);let w=vt+ip();try{localStorage.setItem($i,w)}catch(y){console.log("Failed to save guest user id locally: Local storage unavailable",y)}n(y=>y||w)}}Bo(()=>{try{if(a){let T=[];a.forEach(m=>{if(m.data){let w=m.data.match(/"imageUri":"(.*?)"/g);w&&w.forEach(y=>{let P=y.replace('"imageUri":"',"").replace('"',"");if(T.includes(P))return;let O=new Image;O.src=P,T.push(P)})}})}}catch{}},[a]),Bo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(vt))try{localStorage.setItem(eo,r)}catch(T){console.log("Failed to save user id locally: Local storage available",T)}r===null&&setTimeout(()=>{r===null&&F()},50)},[r,a,h]);function N(){return ht.createElement(ht.Fragment,null,C.map(T=>c(T.slug)!==$e?null:ht.createElement("span",{key:T.slug},ht.createElement(Li,{flowId:T.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return ht.createElement(ht.Fragment,null,ht.createElement(N,null))};import{ErrorBoundary as Ap}from"react-error-boundary";import to from"core-js-pure/actual/structured-clone";function dr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function at(...e){let t=e.shift(),o=e.length===1?e[0]:at(...e);if(!dr(t)||!dr(o))throw new Error("deepmerge can only merge Objects");let i=to(t);return Object.entries(o).forEach(([r,n])=>{dr(n)?i[r]!==void 0?Object.assign(i,{[r]:at(i[r],to(n))}):Object.assign(i,{[r]:to(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...to(n)]}):Object.assign(i,{[r]:to(n)}):Object.assign(i,{[r]:n})}),i}var Ui={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function np(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Ui[o]){let r=Ui[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function sp(e){if(!e)return;let t=at({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function _i(e){let{theme:t,styleOverrides:o}=e,i=np(t),r=sp(o);return{overrides:i,css:r}}import Sp from"styled-components";import{compose as bp,variant as Wi}from"styled-system";import zi from"react";import lp,{ThemeProvider as ap,useTheme as pp}from"styled-components";import{border as dp,color as cp,compose as mp,get as up,shadow as fp,space as gp,system as xp,typography as hp}from"styled-system";var Cp={width:{property:"width",scale:"sizes",transform:(e,t)=>up(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},yp=lp("div")(({css:e})=>e,mp(dp,cp,fp,gp,hp,xp(Cp))),oo=({as:e,children:t,overrides:o,...i})=>{let r=pp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>zi.createElement(yp,{as:e,...n,...i},t);if(o!==void 0){let p=at(r,o);return zi.createElement(ap,{theme:p},s())}return s()};var ro={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},wp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Hi=Sp(oo)(()=>({whiteSpace:"nowrap"}),bp(Wi({scale:"components.Button",variants:"components.Button"}),Wi({prop:"size",variants:wp})));import Tp from"styled-components";import{variant as Fp,system as kp}from"styled-system";var Eo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Vi=Tp(oo)(Fp({scale:"components.Text",variants:"components.Text"}),kp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var ji=4,Gi="px",Pp=20,vp=Object.fromEntries(Array.from(Array(Pp+1),(e,t)=>t===0?[.5,`${.5*ji}${Gi}`]:[t,`${t*ji}${Gi}`])),Nt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},cr={colors:{...Nt,neutral:{foreground:Nt.gray300},primary:{background:Nt.blue500,foreground:Nt.white,inverted:Nt.blue500},negative:{foreground:Nt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:vp,components:{Button:ro,Text:Eo}};var Ki="https://api.frigade.com",G=Bp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Ke,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Ki,readonly:!1});function Ip(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Np=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var q,V;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[a,h]=Oe([]),[d,g]=Oe([]),[C,b]=Oe([]),[k,u]=Oe({}),[B,x]=Oe({}),[F,N]=Oe([]),[T,m]=Oe({}),[w,y]=Oe(!1),[P,O]=Oe(!1),[I,D]=Oe(!H(e)),L=(K,J)=>{if(J==="_blank"){window.open(K,"_blank");return}setTimeout(()=>{window.location.href=K},50)},z={theme:{...Ke.theme,...((q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)??{}},styleOverrides:{...Ke.styleOverrides,...((V=i==null?void 0:i.defaultAppearance)==null?void 0:V.styleOverrides)??{}}};function H(K){return!!(K&&K.length>10&&K.substring(0,10)==="api_public")}Ao(()=>{t&&s(t)},[t]),Ao(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(eo)&&window.localStorage.getItem(eo)!==n&&Ip()},[n]),Ao(()=>{o&&c(o)},[o]),Ao(()=>{if(H(e))D(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),D(!0);return}},[e,D]);let X={publicApiKey:e,userId:n,setUserId:s,setFlows:h,flows:a,failedFlowResponses:d,setFailedFlowResponses:g,flowResponses:C,setFlowResponses:b,userProperties:k,setUserProperties:u,openFlowStates:B,setOpenFlowStates:x,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:N,customVariables:T,setCustomVariables:m,isNewGuestUser:w,setIsNewGuestUser:y,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:L,defaultAppearance:z,shouldGracefullyDegrade:I,setShouldGracefullyDegrade:D,apiUrl:i&&i.apiUrl?i.apiUrl:Ki,readonly:i&&i.readonly?i.readonly:!1};if(I)return Ct.createElement(G.Provider,{value:X},r);let{overrides:se}=_i(z);return Ct.createElement(Ap,{fallback:Ct.createElement(Ct.Fragment,null,r)},Ct.createElement(G.Provider,{value:X},Ct.createElement(Ep,{theme:at(z.theme,cr,se??{},(i==null?void 0:i.theme)??{})},r,Ct.createElement(Mi,null))))};import Ad from"react";import ce,{useEffect as ys,useState as Ss}from"react";import _e,{useState as td}from"react";import bt from"styled-components";import Oo from"react";import yt from"react";import Yi from"styled-components";var qi=Yi.span`
|
|
632
|
+
`;var Oi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:r})=>{let i=e.props,[n,s]=ar([]),[p,c]=ar(!1),[a,x]=ar(e.id);return lr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),lr(()=>{a!==e.id&&(x(e.id),s([]))},[e]),lr(()=>{o({choice:n}),n.length>=i.minChoices?t(!0):t(!1)},[n]),Ye.createElement(ki,{className:l("selectListContainer",r)},Ye.createElement(Pi,null,Ye.createElement(vi,{className:l("selectListTitle",r)},e.title),Ye.createElement(Bi,{appearance:r,className:l("selectListSubtitle",r)},e.subtitle)),i.options.map((d,h)=>{let S=n.includes(d.id);return Ye.createElement(Ei,{key:`select-item-${h}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(w=>w!==d.id));return}n.length<i.maxChoices?s([...n,d.id]):n.length==1&&i.maxChoices==1&&s([d.id])},hideBottomBorder:h===i.options.length-1,className:l("selectListSelectItem",r)},Ye.createElement(Ai,{className:l("selectListItemImage",r)},d.imageUri&&Ye.createElement(Ii,{src:d.imageUri,alt:`select-icon-${h}`}),Ye.createElement(Ni,{appearance:r,className:l("selectListSelectItemText",r)},d.title)),Ye.createElement(qe,{appearance:r,value:S,primaryColor:r.theme.colorPrimary}))}))};import Fe,{useEffect as vo,useState as Rt}from"react";var qa=({children:e,id:t,shouldWrap:o=!1})=>Fe.createElement(Fe.Fragment,null,o?Fe.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Bo=({appearance:e,steps:t,selectedStep:o,customStepTypes:r,customVariables:i,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:a,onComplete:x,setVisible:d,setShowModal:h,onDismiss:S,showPagination:w=!1,customFormElements:P,allowBackNavigation:u,validationHandler:E,onFormDataChange:g,showFooter:T,prefillData:N})=>{var ue;let m={...{linkCollection:Ti,multiInput:mi,callToAction:Fi,selectList:Oi},...r},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:b}=ae(),[F,O]=Rt(!1),[I,D]=Rt({}),[L,_]=Rt(!1),[H,X]=Rt(!1),[se,q]=Rt(null),V=t[o]??null,{markStepCompleted:K,markStepStarted:J,isLoading:Se,updateCustomVariables:Pe,markFlowCompleted:ye}=ee();vo(()=>{Pe(i)},[i,Se]),vo(()=>{g&&g(I,re(),t[o],o)},[I]),vo(()=>{window&&u&&!H&&(window.location.hash=t[o].id,X(!0))},[u,H,X]),vo(()=>{var z;if(window&&((z=window==null?void 0:window.location)!=null&&z.hash)&&window.location.hash.replace("#","")!==t[o].id){let de=window.location.hash.replace("#",""),te=t.findIndex(be=>be.id===de);te!==-1&&J(p,t[te].id)}},[(ue=window==null?void 0:window.location)==null?void 0:ue.hash,J,o,t]);function re(){return{data:I[t[o].id]??{},stepId:t[o].id,customVariables:i}}function Q(z,de,te){let be=o+1<t.length?t[o+1]:null;return s&&s(z,te,be,I,re()),n?n(z,o,de,be):!0}function M(z,de){D(te=>{let be={};return be[z.id]=de,{...te,...be}})}function $(z){return z.selectedStep.imageUri?Fe.createElement(Si,{image:z.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let me=T&&Fe.createElement(bi,{step:t[o],canContinue:F&&!L,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(_(!0),E){let te=await E(t[o],o,t[o+1],I,re());if(te||te===!1){q(typeof te=="string"?te:null),_(!1);return}else q(null)}let z={...re()};await K(p,t[o].id,z),o+1<t.length&&await J(p,t[o+1].id);let de=Q(t[o],"primary",o);o+1>=t.length&&(x&&x(),S&&S(),a&&de&&(d&&d(!1),h(!1)),await ye(p)),B(t[o]),_(!1),window&&u&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{Q(t[o],"secondary",o),b(t[o])},onBack:async()=>{o-1>=0&&(_(!0),await J(p,t[o-1].id),_(!1))},steps:t,allowBackNavigation:u,errorMessage:se});return Fe.createElement(Fe.Fragment,null,Fe.createElement(xi,{className:l("formContainer",e)},Fe.createElement(hi,null,Fe.createElement(qa,{id:o,shouldWrap:c==="large-modal"},Fe.createElement(Ci,{key:V.id,type:c,className:l("formContent",e)},t.map(z=>{let de=m[z.type];return V.id!==z.id?null:Fe.createElement(de,{key:z.id,stepData:z,canContinue:F,setCanContinue:O,onSaveData:te=>{M(z,te)},appearance:e,customFormElements:P,flowId:p,prefillData:N})}),w&&Fe.createElement(wi,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),me))),c=="large-modal"&&Fe.createElement($,{selectedStep:t[o]})))};import eo from"react";import{createGlobalStyle as Ya}from"styled-components";function ne({appearance:e}){if(!e||!e.styleOverrides)return eo.createElement(eo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([r,i])=>typeof i=="object");if(t.length===0)return eo.createElement(eo.Fragment,null);let o=Ya`
|
|
633
|
+
${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map(([s,p])=>`${Go(s)}: ${p};`).join(" ")} }`).join(" ")}`;return eo.createElement(o,{inlineStyles:t})}var Li=({flowId:e,customStepTypes:t={},type:o="inline",visible:r,setVisible:i,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:x,onButtonClick:d,dismissible:h=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:P=!1,onDismiss:u,showPagination:E=!1,allowBackNavigation:g=!1,validationHandler:T,showFrigadeBranding:N=!1,onFormDataChange:C,showFooter:m=!0,prefillData:B={}})=>{let{getFlow:b,getFlowSteps:F,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:D,getCurrentStepIndex:L,markFlowCompleted:_,markFlowNotStarted:H}=ee(),X=L(e),{mergeAppearanceWithDefault:se}=oe(),[q,V]=Ja(!1),{setOpenFlowState:K,getOpenFlowState:J,hasOpenModals:Se}=ve();c=se(c);let[Pe,ye]=r!==void 0&&i!==void 0?[r,i]:[J(e,!0),$=>K(e,$)];if(Xa(()=>{!q&&!O&&(V(!0),D(e)===R&&P&&(H(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(me=>{me.startsWith(ir)&&window.localStorage.removeItem(me)})),V(!0))},[q,V,O]),O)return null;let re=b(e);if(!re||I(re))return null;let Q=F(e);if(!Q||r!==void 0&&r===!1||D(e)===R&&a||(o=="modal"||o=="corner-modal")&&Se(e))return null;let M=()=>{ye(!1),u&&u(),S===!0&&_(e)};if(w=="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",He.createElement(ot,{appearance:c,onClose:M,visible:Pe,style:$,dismissible:h,showFrigadeBranding:N},He.createElement(ne,{appearance:c}),He.createElement(Bo,{appearance:c,steps:Q,selectedStep:X,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:ye,onDismiss:u,showPagination:E,customFormElements:s,allowBackNavigation:g,validationHandler:T,onFormDataChange:C,showFooter:m,prefillData:B}))}return o==="modal"&&w!=="center"?He.createElement(Xr,{appearance:c,onClose:M,visible:Pe},He.createElement(ne,{appearance:c}),He.createElement(Bo,{appearance:c,steps:Q,selectedStep:X,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:ye,onDismiss:u,showPagination:E,customFormElements:s,allowBackNavigation:g,validationHandler:T,onFormDataChange:C,showFooter:m,prefillData:B})):He.createElement(He.Fragment,null,He.createElement(ne,{appearance:c}),He.createElement(Bo,{appearance:c,steps:Q,selectedStep:X,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:x,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:ye,onDismiss:u,showPagination:E,customFormElements:s,allowBackNavigation:g,validationHandler:T,onFormDataChange:C,showFooter:m,prefillData:B}))},Di=Li;import{useCallback as $i,useContext as Qa,useEffect as Za}from"react";function pr(){let{organizationId:e,userId:t,setOrganizationId:o}=Qa(G),{mutateUserFlowState:r}=Be(),{config:i,apiUrl:n}=_e(),s=Pt(),{verifySDKInitiated:p}=vt();Za(()=>{if(t&&e){if(t.startsWith(Bt))return;let x=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(x)||(s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let c=$i(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let d={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify(d)}),r()},[e,t,i,r]),a=$i(async(x,d)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:d}]};await s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify(S)}),r()},[e,t,i,r]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:c,trackEventForOrganization:a}}var Mi="frigade-xFrigade_guestUserId",to="frigade-xFrigade_userId",Ui=({})=>{let{setFlowResponses:e}=Gt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:r}=Be(),{userId:i,setUserId:n}=Kt(),[s,p]=dr(null),{getFlowStatus:c}=ee(),{flows:a,userProperties:x,setIsNewGuestUser:d,flowResponses:h}=Ra(G),[S,w]=dr([]),[P,u]=dr([]),{organizationId:E}=pr();Eo(()=>{if(!o&&t)for(let C=0;C<t.length;C++){let m=t[C],B=a.find(b=>b.slug===(m==null?void 0:m.flowId));if(B&&m&&m.shouldTrigger===!0&&B.type=="FORM"&&B.triggerType==="AUTOMATIC"&&!P.includes(B.slug)){setTimeout(()=>{g(m.flowId)},500);break}}},[o,t]),Eo(()=>{h.length>0&&r()},[h]);function g(C){let m=a.find(B=>B.slug===C);m&&m.triggerType==="AUTOMATIC"&&!P.includes(m.slug)&&(u([...P,m.slug]),w([m]))}function T(){if(!i){let C=localStorage.getItem(to);if(C){n(C);return}let m=localStorage.getItem(Mi);if(m){n(m);return}d(!0);let B=Bt+ep();try{localStorage.setItem(Mi,B)}catch(b){console.log("Failed to save guest user id locally: Local storage unavailable",b)}n(b=>b||B)}}Eo(()=>{try{if(a){let C=[];a.forEach(m=>{if(m.data){let B=m.data.match(/"imageUri":"(.*?)"/g);B&&B.forEach(b=>{let F=b.replace('"imageUri":"',"").replace('"',"");if(C.includes(F))return;let O=new Image;O.src=F,C.push(F)})}})}}catch{}},[a]),Eo(()=>{if(i!==s&&e([]),p(i),i&&!i.startsWith(Bt))try{localStorage.setItem(to,i)}catch(C){console.log("Failed to save user id locally: Local storage available",C)}i===null&&setTimeout(()=>{i===null&&T()},50)},[i,a,x]);function N(){return Ct.createElement(Ct.Fragment,null,S.map(C=>c(C.slug)!==$e?null:Ct.createElement("span",{key:C.slug},Ct.createElement(Di,{flowId:C.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Ct.createElement(Ct.Fragment,null,Ct.createElement(N,null))};import{ErrorBoundary as Pp}from"react-error-boundary";import oo from"core-js-pure/actual/structured-clone";function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function at(...e){let t=e.shift(),o=e.length===1?e[0]:at(...e);if(!cr(t)||!cr(o))throw new Error("deepmerge can only merge Objects");let r=oo(t);return Object.entries(o).forEach(([i,n])=>{cr(n)?r[i]!==void 0?Object.assign(r,{[i]:at(r[i],oo(n))}):Object.assign(r,{[i]:oo(n)}):Array.isArray(n)?r[i]!==void 0?Object.assign(r,{[i]:[...r[i],...oo(n)]}):Object.assign(r,{[i]:oo(n)}):Object.assign(r,{[i]:n})}),r}var zi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function tp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,r])=>{if(zi[o]){let i=zi[o].split("."),n=t;i.forEach((s,p)=>{n[s]||(n[s]=p===i.length-1?r:{}),n=n[s]})}}),t}function op(e){if(!e)return;let t=at({},e),o={};return Object.keys(t).forEach(r=>{let i=`.fr-${r}`;o[i]=t[r]}),o}function _i(e){let{theme:t,styleOverrides:o}=e,r=tp(t),i=op(o);return{overrides:r,css:i}}import xp from"styled-components";import{compose as hp,variant as Hi}from"styled-system";import Wi from"react";import rp,{ThemeProvider as ip,useTheme as np}from"styled-components";import{border as sp,color as lp,compose as ap,get as pp,shadow as dp,space as cp,system as mp,typography as up}from"styled-system";var fp={width:{property:"width",scale:"sizes",transform:(e,t)=>pp(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},gp=rp("div")(({css:e})=>e,ap(sp,lp,dp,cp,up,mp(fp))),ro=({as:e,children:t,overrides:o,...r})=>{let i=np(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Wi.createElement(gp,{as:e,...n,...r},t);if(o!==void 0){let p=at(i,o);return Wi.createElement(ip,{theme:p},s())}return s()};var io={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Cp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Vi=xp(ro)(()=>({whiteSpace:"nowrap"}),hp(Hi({scale:"components.Button",variants:"components.Button"}),Hi({prop:"size",variants:Cp})));import Sp from"styled-components";import{variant as yp,system as bp}from"styled-system";var Ao={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var ji=Sp(ro)(yp({scale:"components.Text",variants:"components.Text"}),bp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Gi=4,Ki="px",wp=20,Tp=Object.fromEntries(Array.from(Array(wp+1),(e,t)=>t===0?[.5,`${.5*Gi}${Ki}`]:[t,`${t*Gi}${Ki}`])),Ot={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},mr={colors:{...Ot,neutral:{foreground:Ot.gray300},primary:{background:Ot.blue500,foreground:Ot.white,inverted:Ot.blue500},negative:{foreground:Ot.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Tp,components:{Button:io,Text:Ao}};var qi="https://api.frigade.com",G=Fp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Ke,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:qi,readonly:!1});function vp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Bp=({publicApiKey:e,userId:t,organizationId:o,config:r,children:i})=>{var q,V;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[a,x]=Oe([]),[d,h]=Oe([]),[S,w]=Oe([]),[P,u]=Oe({}),[E,g]=Oe({}),[T,N]=Oe([]),[C,m]=Oe({}),[B,b]=Oe(!1),[F,O]=Oe(!1),[I,D]=Oe(!H(e)),L=(K,J)=>{if(J==="_blank"){window.open(K,"_blank");return}setTimeout(()=>{window.location.href=K},50)},_={theme:{...Ke.theme,...((q=r==null?void 0:r.defaultAppearance)==null?void 0:q.theme)??{}},styleOverrides:{...Ke.styleOverrides,...((V=r==null?void 0:r.defaultAppearance)==null?void 0:V.styleOverrides)??{}}};function H(K){return!!(K&&K.length>10&&K.substring(0,10)==="api_public")}Io(()=>{t&&s(t)},[t]),Io(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(to)&&window.localStorage.getItem(to)!==n&&vp()},[n]),Io(()=>{o&&c(o)},[o]),Io(()=>{if(H(e))D(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),D(!0);return}},[e,D]);let X={publicApiKey:e,userId:n,setUserId:s,setFlows:x,flows:a,failedFlowResponses:d,setFailedFlowResponses:h,flowResponses:S,setFlowResponses:w,userProperties:P,setUserProperties:u,openFlowStates:E,setOpenFlowStates:g,completedFlowsToKeepOpenDuringSession:T,setCompletedFlowsToKeepOpenDuringSession:N,customVariables:C,setCustomVariables:m,isNewGuestUser:B,setIsNewGuestUser:b,hasActiveFullPageFlow:F,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:r&&r.navigate?r.navigate:L,defaultAppearance:_,shouldGracefullyDegrade:I,setShouldGracefullyDegrade:D,apiUrl:r&&r.apiUrl?r.apiUrl:qi,readonly:r&&r.readonly?r.readonly:!1};if(I)return St.createElement(G.Provider,{value:X},i);let{overrides:se}=_i(_);return St.createElement(Pp,{fallback:St.createElement(St.Fragment,null,i)},St.createElement(G.Provider,{value:X},St.createElement(kp,{theme:at(_.theme,mr,se??{},(r==null?void 0:r.theme)??{})},i,St.createElement(Ui,null))))};import hd from"react";import ce,{useEffect as ws,useState as Ts}from"react";import ze,{useState as Kp}from"react";import wt from"styled-components";import Lo from"react";import yt from"react";import Xi from"styled-components";var Yi=Xi.span`
|
|
634
634
|
font-weight: 400;
|
|
635
635
|
font-size: 15px;
|
|
636
636
|
line-height: 20px;
|
|
@@ -639,7 +639,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
639
639
|
vertical-align: middle;
|
|
640
640
|
margin-left: 12px;
|
|
641
641
|
padding-right: 12px;
|
|
642
|
-
`,
|
|
642
|
+
`,Ep=Xi.div`
|
|
643
643
|
flex-direction: row;
|
|
644
644
|
justify-content: space-between;
|
|
645
645
|
display: flex;
|
|
@@ -647,24 +647,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
647
647
|
padding-bottom: 20px;
|
|
648
648
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
649
649
|
width: 100%;
|
|
650
|
-
`,
|
|
650
|
+
`,No=({label:e,value:t,labelStyle:o={},labelPosition:r="right",style:i,primaryColor:n="#000000",checkBoxType:s="square",appearance:p})=>yt.createElement(yt.Fragment,null,yt.createElement(Ep,{className:l("checklistStepsContainer",p),appearance:p,style:{...i}},r==="left"&&e&&yt.createElement(Yi,{className:l("checklistStepLabel",p),style:o},e),yt.createElement(qe,{appearance:p,value:t,type:s,primaryColor:n}),r==="right"&&e&&yt.createElement(Yi,{className:l("checklistStepLabel",p),style:o},e)),yt.createElement(ne,{appearance:p}));import no from"styled-components";var Ji=no.div`
|
|
651
651
|
font-weight: 700;
|
|
652
652
|
font-size: 18px;
|
|
653
653
|
line-height: 22px;
|
|
654
|
-
`,
|
|
654
|
+
`,Qi=no.p`
|
|
655
655
|
font-weight: 700;
|
|
656
656
|
font-size: 18px;
|
|
657
657
|
line-height: 30px;
|
|
658
658
|
margin: 20px 0px 0px 0px;
|
|
659
659
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
660
|
-
`,
|
|
660
|
+
`,Zi=no.p`
|
|
661
661
|
font-weight: 400;
|
|
662
662
|
font-size: 15px;
|
|
663
663
|
line-height: 28px;
|
|
664
664
|
max-width: 540px;
|
|
665
665
|
margin: 8px 0px 0px 0px;
|
|
666
666
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
667
|
-
`,
|
|
667
|
+
`,Oo=no.div`
|
|
668
668
|
width: 4px;
|
|
669
669
|
position: absolute;
|
|
670
670
|
left: 0;
|
|
@@ -672,10 +672,53 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
672
672
|
height: 80%;
|
|
673
673
|
border-top-right-radius: 8px;
|
|
674
674
|
border-bottom-right-radius: 8px;
|
|
675
|
-
`,
|
|
675
|
+
`,Ri=no.div`
|
|
676
676
|
flex-direction: row;
|
|
677
677
|
justify-content: flex-start;
|
|
678
|
-
`;var
|
|
678
|
+
`;var en=({data:e,index:t,isSelected:o,primaryColor:r,style:i,onClick:n,appearance:s})=>{var p,c;return Lo.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{n()}},o&&Lo.createElement(Oo,{className:l("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??r}}),Lo.createElement(Ri,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},Lo.createElement(No,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:i,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??r,appearance:s})))};import bt from"react";import ur from"styled-components";import Xe from"styled-components";var Ux=Xe.div`
|
|
679
|
+
background: #ffffff;
|
|
680
|
+
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
681
|
+
border-radius: 20px;
|
|
682
|
+
width: 385px;
|
|
683
|
+
padding: 24px 16px 16px 16px;
|
|
684
|
+
`,zx=Xe.div`
|
|
685
|
+
/* Border bottom only on collapsable */
|
|
686
|
+
`,_x=Xe.div`
|
|
687
|
+
display: flex;
|
|
688
|
+
flex-direction: row;
|
|
689
|
+
justify-content: space-between;
|
|
690
|
+
align-content: flex-start;
|
|
691
|
+
`,Wx=Xe.h1`
|
|
692
|
+
display: flex;
|
|
693
|
+
margin: 0;
|
|
694
|
+
font-size: 18px;
|
|
695
|
+
`,Hx=Xe.h2`
|
|
696
|
+
font-size: 15px;
|
|
697
|
+
color: #4d4d4d;
|
|
698
|
+
`,Vx=Xe.ul`
|
|
699
|
+
list-style: none;
|
|
700
|
+
`,jx=Xe.li`
|
|
701
|
+
display: flex;
|
|
702
|
+
justify-content: flex-start;
|
|
703
|
+
flex-direction: row;
|
|
704
|
+
`,tn=Xe.div`
|
|
705
|
+
position: absolute;
|
|
706
|
+
left: 0;
|
|
707
|
+
top: 0;
|
|
708
|
+
height: ${e=>e.barHeight};
|
|
709
|
+
width: ${e=>e.fgWidth};
|
|
710
|
+
border-radius: 20px;
|
|
711
|
+
background-color: ${e=>e.theme.colorPrimary};
|
|
712
|
+
`,on=Xe.div`
|
|
713
|
+
position: relative;
|
|
714
|
+
left: 0;
|
|
715
|
+
top: 0;
|
|
716
|
+
width: 100%;
|
|
717
|
+
min-width: 40px;
|
|
718
|
+
height: ${e=>e.barHeight};
|
|
719
|
+
border-radius: 20px;
|
|
720
|
+
background-color: ${e=>e.theme.colorSecondary};
|
|
721
|
+
`;var Ap=ur.div`
|
|
679
722
|
display: flex;
|
|
680
723
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
681
724
|
justify-content: flex-start;
|
|
@@ -683,11 +726,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
683
726
|
width: 100%;
|
|
684
727
|
|
|
685
728
|
${e=>Ge(e)}
|
|
686
|
-
`,
|
|
729
|
+
`,Ip=ur.div`
|
|
687
730
|
flex-grow: 1;
|
|
688
731
|
position: relative;
|
|
689
732
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
690
|
-
`,
|
|
733
|
+
`,Np=ur.span`
|
|
691
734
|
font-weight: 500;
|
|
692
735
|
font-size: 15px;
|
|
693
736
|
line-height: 18px;
|
|
@@ -695,13 +738,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
695
738
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
696
739
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
697
740
|
${e=>Ge(e)}
|
|
698
|
-
|
|
741
|
+
`;var Le=({count:e,total:t,display:o="count",textLocation:r="left",style:i={},textStyle:n={},appearance:s})=>{if(t===0)return bt.createElement(bt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",a=Math.round(e/t*100),x=o==="compact"?"5px":"20px",d;return o==="count"?d=`${e} of ${t}`:o==="compact"?d=`${a}%`:o==="percent"&&(d=`${a}% complete`),r==="top"&&(x="0px"),bt.createElement(Ap,{className:l("progressBarContainer",s),textLocation:r,styleOverrides:i},bt.createElement(Np,{className:l("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:15,fontWeight:o==="compact"?400:500},appearance:s,padding:x,textLocation:r},d),bt.createElement(Ip,{textLocation:r,className:l("progressBar",s)},bt.createElement(tn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:l("progressBarFill",s)}),bt.createElement(on,{className:l("progressBarBackground",s),barHeight:c,appearance:s})))};import so from"react";import Lp from"styled-components";import $o from"react";import Do from"react";var Lt=({stepData:e,appearance:t})=>Do.createElement(Do.Fragment,null,Do.createElement(Qi,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:fe(e.title)}),Do.createElement(Zi,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:fe(e.subtitle)}));import fr from"react";var Dt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},r=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return fr.createElement(To,{className:l("ctaContainer",t)},e.secondaryButtonTitle&&fr.createElement(ie,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:r,style:{width:"auto",marginRight:"12px"}}),fr.createElement(ie,{appearance:t,title:e.primaryButtonTitle,onClick:o}))};var $t=({stepData:e,appearance:t})=>$o.createElement($o.Fragment,null,$o.createElement(Lt,{stepData:e,appearance:t}),$o.createElement(Dt,{stepData:e,appearance:t}));import Op from"react";function rn(e){return Op.createElement(st,{appearance:e.appearance,videoUri:e.videoUri})}var gr="default",Dp=Lp.img`
|
|
699
742
|
border-radius: 4px;
|
|
700
743
|
max-height: 260px;
|
|
701
744
|
min-height: 200px;
|
|
702
|
-
`,
|
|
745
|
+
`,nn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return so.createElement("div",null,o)}return so.createElement(Ji,{className:l("checklistStepContent",t)},e.imageUri?so.createElement(Dp,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?so.createElement(rn,{videoUri:e.videoUri,appearance:t}):null,so.createElement($t,{stepData:e,appearance:t}))};import Ae,{useRef as $p,useState as Mp}from"react";import Mt from"styled-components";var sn=Mt.div`
|
|
703
746
|
display: block;
|
|
704
|
-
`,
|
|
747
|
+
`,Up=Mt.div`
|
|
705
748
|
display: flex;
|
|
706
749
|
flex-direction: row;
|
|
707
750
|
flex-wrap: wrap;
|
|
@@ -711,20 +754,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
711
754
|
align-content: center;
|
|
712
755
|
margin-top: 24px;
|
|
713
756
|
margin-bottom: 24px;
|
|
714
|
-
`,
|
|
757
|
+
`,zp=Mt.div`
|
|
715
758
|
display: flex;
|
|
716
759
|
align-items: center;
|
|
717
760
|
justify-content: flex-start;
|
|
718
761
|
flex-direction: column;
|
|
719
762
|
margin-right: 16px;
|
|
720
|
-
`,
|
|
763
|
+
`,_p=Mt.video`
|
|
721
764
|
width: 200px;
|
|
722
765
|
height: 120px;
|
|
723
|
-
`,
|
|
766
|
+
`,Wp=Mt.div`
|
|
724
767
|
font-size: 14px;
|
|
725
768
|
line-height: 20px;
|
|
726
769
|
text-align: center;
|
|
727
|
-
`,
|
|
770
|
+
`,Hp=Mt.div`
|
|
728
771
|
position: absolute;
|
|
729
772
|
width: 200px;
|
|
730
773
|
height: 120px;
|
|
@@ -744,9 +787,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
744
787
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
745
788
|
border-radius: 50%;
|
|
746
789
|
}
|
|
747
|
-
`,
|
|
790
|
+
`,ln="videoCarousel",an=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.videos))return Ae.createElement(sn,null,Ae.createElement($t,{stepData:e,appearance:t}));function o({video:n}){let s=$p(),[p,c]=Mp(!1);return Ae.createElement(zp,null,!p&&Ae.createElement(Hp,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ae.createElement(Fo,null)),Ae.createElement(_p,{controls:p,ref:s,play:p,src:n.uri}),Ae.createElement(Wp,null,n.title))}let r=e.props;return r.videos?Ae.createElement(sn,null,Ae.createElement(Lt,{stepData:e,appearance:t}),Ae.createElement(Up,null,r.videos.map((n,s)=>Ae.createElement("span",{key:`${n.uri}-${s}`},Ae.createElement(o,{video:n})))),Ae.createElement(Dt,{stepData:e,appearance:t})):null};import Je from"react";import Mo from"styled-components";var pn=Mo.div`
|
|
748
791
|
display: block;
|
|
749
|
-
`,
|
|
792
|
+
`,Vp=Mo.pre`
|
|
750
793
|
display: block;
|
|
751
794
|
background-color: #2a2a2a;
|
|
752
795
|
color: #f8f8f8;
|
|
@@ -762,69 +805,69 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
762
805
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
763
806
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
764
807
|
margin-bottom: 24px;
|
|
765
|
-
`,
|
|
808
|
+
`,jp=Mo.div`
|
|
766
809
|
font-size: 15px;
|
|
767
810
|
line-height: 20px;
|
|
768
811
|
margin-bottom: 12px;
|
|
769
812
|
margin-top: 12px;
|
|
770
|
-
`,
|
|
813
|
+
`,Gp=Mo.div`
|
|
771
814
|
margin-top: 24px;
|
|
772
|
-
`,
|
|
815
|
+
`,dn="codeSnippet",cn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.codeSnippets))return Je.createElement(pn,null,Je.createElement($t,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Je.createElement(pn,null,Je.createElement(Lt,{stepData:e,appearance:t}),Je.createElement(Gp,null,o.codeSnippets.map((i,n)=>Je.createElement("div",{key:n},i.title?Je.createElement(jp,null,i.title):null,i.code?Je.createElement(Vp,null,i.code):null))),Je.createElement(Dt,{stepData:e,appearance:t})):null};var qp=wt.div`
|
|
773
816
|
display: flex;
|
|
774
817
|
flex-direction: row;
|
|
775
818
|
min-width: ${e=>e.type!="modal"?"1000px":"100%"};
|
|
776
819
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
777
820
|
box-shadow: ${e=>e.type!="modal"?"0px 6px 25px rgba(0, 0, 0, 0.06)":"none"};
|
|
778
821
|
border-radius: 8px;
|
|
779
|
-
`,
|
|
822
|
+
`,Yp=wt.h1`
|
|
780
823
|
font-size: 24px;
|
|
781
824
|
font-weight: 600;
|
|
782
825
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
783
|
-
`,
|
|
826
|
+
`,Xp=wt.h2`
|
|
784
827
|
font-size: 15px;
|
|
785
828
|
line-height: 28px;
|
|
786
829
|
color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary)??"#4d4d4d"}};
|
|
787
830
|
margin: 10px 0px 0px 0px;
|
|
788
|
-
`,
|
|
831
|
+
`,mn=wt.div`
|
|
789
832
|
padding-bottom: 16px;
|
|
790
|
-
`,
|
|
833
|
+
`,Jp=wt.div`
|
|
791
834
|
list-style: none;
|
|
792
835
|
padding: 0;
|
|
793
836
|
margin: 0;
|
|
794
837
|
cursor: pointer;
|
|
795
838
|
width: 300px;
|
|
796
|
-
`,
|
|
839
|
+
`,Qp=wt.div`
|
|
797
840
|
width: 1px;
|
|
798
841
|
margin: 40px;
|
|
799
842
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
800
|
-
`,
|
|
843
|
+
`,Zp=wt.div`
|
|
801
844
|
flex: 2;
|
|
802
845
|
padding: 2rem;
|
|
803
|
-
`,
|
|
846
|
+
`,Rp=({title:e,subtitle:t,steps:o=[],style:r={},selectedStep:i,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:a})=>{let{mergeAppearanceWithDefault:x}=oe();c=x(c);let h={...{[gr]:nn,[ln]:an,[dn]:cn},...p},[S,w]=Kp(0),P=i??S,u=n??w,E=o.filter(T=>T.complete===!0).length,g=()=>{var T;return!((T=o[P])!=null&&T.type)||!h[o[P].type]?h[gr]({stepData:o[P],appearance:c}):h[o[P].type]({stepData:o[P],appearance:c})};return ze.createElement(qp,{type:a,style:r,className:s,appearance:c},ze.createElement(mn,{style:{flex:1}},ze.createElement(mn,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},ze.createElement(Yp,{className:l("checklistTitle",c),appearance:c},e),ze.createElement(Xp,{className:l("checklistSubtitle",c),appearance:c},t),ze.createElement(Le,{total:o.length,count:E,style:{marginTop:"24px"},appearance:c})),ze.createElement(Jp,{className:l("checklistStepsContainer",c)},o.map((T,N)=>ze.createElement(en,{data:T,index:N,key:N,listLength:o.length,isSelected:N===P,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{u(N)}})))),ze.createElement(Qp,{appearance:c,className:l("checklistDivider",c)}),ze.createElement(Zp,null,ze.createElement(g,null)))},xr=Rp;import U,{useState as id}from"react";import un from"react";import ed from"styled-components";var td=ed.svg`
|
|
804
847
|
transition: 'transform 0.35s ease-in-out';
|
|
805
|
-
`,
|
|
848
|
+
`,Ut=({color:e="#323232",style:t,className:o})=>un.createElement(td,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},un.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ge from"styled-components";var hr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},fn=ge.div`
|
|
806
849
|
max-height: 350px;
|
|
807
850
|
padding-bottom: 40px;
|
|
808
|
-
`,
|
|
851
|
+
`,gn=ge.div`
|
|
809
852
|
display: flex;
|
|
810
853
|
flex-direction: column;
|
|
811
854
|
margin-top: 20px;
|
|
812
|
-
`,
|
|
855
|
+
`,xn=ge.h1`
|
|
813
856
|
font-style: normal;
|
|
814
857
|
font-weight: 600;
|
|
815
858
|
font-size: 30px;
|
|
816
859
|
line-height: 36px;
|
|
817
860
|
margin-bottom: 16px;
|
|
818
861
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
819
|
-
`,
|
|
862
|
+
`,hn=ge.h2`
|
|
820
863
|
font-weight: 400;
|
|
821
864
|
font-size: 16px;
|
|
822
865
|
line-height: 20px;
|
|
823
866
|
margin-bottom: 16px;
|
|
824
867
|
padding-left: 1px;
|
|
825
868
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
826
|
-
`,
|
|
827
|
-
${e=>
|
|
869
|
+
`,Cn=ge.div`
|
|
870
|
+
${e=>k(e)} {
|
|
828
871
|
border: 1px solid #fafafa;
|
|
829
872
|
}
|
|
830
873
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -833,12 +876,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
833
876
|
flex-direction: column;
|
|
834
877
|
min-height: 240px;
|
|
835
878
|
overflow: hidden;
|
|
836
|
-
`,
|
|
879
|
+
`,Sn=ge.div`
|
|
837
880
|
display: flex;
|
|
838
881
|
flex-direction: row;
|
|
839
882
|
justify-content: space-between;
|
|
840
|
-
`,
|
|
841
|
-
${e=>
|
|
883
|
+
`,yn=ge.p`
|
|
884
|
+
${e=>k(e)} {
|
|
842
885
|
font-weight: 400;
|
|
843
886
|
font-size: 10px;
|
|
844
887
|
line-height: 12px;
|
|
@@ -846,13 +889,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
846
889
|
color: #8c8c8c;
|
|
847
890
|
margin: 20px;
|
|
848
891
|
}
|
|
849
|
-
`,
|
|
892
|
+
`,bn=ge.div`
|
|
850
893
|
display: flex;
|
|
851
894
|
flex-direction: row;
|
|
852
|
-
`,
|
|
895
|
+
`,wn=ge.div`
|
|
853
896
|
flex: 1;
|
|
854
|
-
`,
|
|
855
|
-
${e=>
|
|
897
|
+
`,Tn=ge.div`
|
|
898
|
+
${e=>k(e)} {
|
|
856
899
|
display: flex;
|
|
857
900
|
justify-content: center;
|
|
858
901
|
align-content: center;
|
|
@@ -861,8 +904,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
861
904
|
padding-left: 8px;
|
|
862
905
|
padding-right: 8px;
|
|
863
906
|
}
|
|
864
|
-
`,
|
|
865
|
-
${e=>
|
|
907
|
+
`,Fn=ge.p`
|
|
908
|
+
${e=>k(e)} {
|
|
866
909
|
font-style: normal;
|
|
867
910
|
font-weight: 600;
|
|
868
911
|
font-size: 22px;
|
|
@@ -873,8 +916,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
873
916
|
margin-top: 20px;
|
|
874
917
|
margin-bottom: 16px;
|
|
875
918
|
}
|
|
876
|
-
`,
|
|
877
|
-
${e=>
|
|
919
|
+
`,kn=ge.p`
|
|
920
|
+
${e=>k(e)} {
|
|
878
921
|
font-weight: 400;
|
|
879
922
|
font-size: 14px;
|
|
880
923
|
line-height: 18px;
|
|
@@ -882,15 +925,15 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
882
925
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
883
926
|
margin-bottom: 8px;
|
|
884
927
|
}
|
|
885
|
-
`,
|
|
886
|
-
${e=>
|
|
928
|
+
`,Pn=ge.div`
|
|
929
|
+
${e=>k(e)} {
|
|
887
930
|
display: flex;
|
|
888
931
|
flex-direction: row;
|
|
889
932
|
justify-content: center;
|
|
890
933
|
gap: 8px;
|
|
891
934
|
}
|
|
892
|
-
`,
|
|
893
|
-
${e=>
|
|
935
|
+
`,vn=ge.div`
|
|
936
|
+
${e=>k(e)} {
|
|
894
937
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
895
938
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
896
939
|
:hover {
|
|
@@ -909,8 +952,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
909
952
|
justify-content: space-between;
|
|
910
953
|
position: relative;
|
|
911
954
|
cursor: pointer;
|
|
912
|
-
`,
|
|
913
|
-
${e=>
|
|
955
|
+
`,Bn=ge.p`
|
|
956
|
+
${e=>k(e)} {
|
|
914
957
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
915
958
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
916
959
|
}
|
|
@@ -918,12 +961,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
918
961
|
font-size: 14px;
|
|
919
962
|
line-height: 22px;
|
|
920
963
|
margin: 0;
|
|
921
|
-
`,
|
|
964
|
+
`,En=ge.div`
|
|
922
965
|
display: flex;
|
|
923
966
|
flex-direction: row;
|
|
924
967
|
justify-content: flex-end;
|
|
925
968
|
align-content: center;
|
|
926
|
-
`,
|
|
969
|
+
`,An=ge.div`
|
|
927
970
|
display: flex;
|
|
928
971
|
flex: 1;
|
|
929
972
|
flex-direction: row;
|
|
@@ -931,14 +974,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
931
974
|
align-content: center;
|
|
932
975
|
align-items: center;
|
|
933
976
|
margin-right: 20px;
|
|
934
|
-
`,
|
|
977
|
+
`,In=ge.div`
|
|
935
978
|
display: block;
|
|
936
979
|
width: 100%;
|
|
937
|
-
`;import
|
|
980
|
+
`;import od from"styled-components";var Nn=od.div`
|
|
938
981
|
flex-direction: column;
|
|
939
982
|
justify-content: center;
|
|
940
983
|
display: flex;
|
|
941
|
-
`;import
|
|
984
|
+
`;import Ze from"react";import Qe from"styled-components";var On=Qe.div`
|
|
942
985
|
border: 1px solid #fafafa;
|
|
943
986
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
944
987
|
border-radius: 14px;
|
|
@@ -946,14 +989,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
946
989
|
display: flex;
|
|
947
990
|
flex-direction: column;
|
|
948
991
|
overflow: hidden;
|
|
949
|
-
`,
|
|
992
|
+
`,Ln=Qe.div`
|
|
950
993
|
display: flex;
|
|
951
994
|
flex-wrap: wrap;
|
|
952
995
|
justify-content: space-between;
|
|
953
996
|
overflow: hidden;
|
|
954
997
|
row-gap: 10px;
|
|
955
|
-
`,
|
|
956
|
-
${e=>
|
|
998
|
+
`,Dn=Qe.div`
|
|
999
|
+
${e=>k(e)} {
|
|
957
1000
|
color: #595959;
|
|
958
1001
|
}
|
|
959
1002
|
text-transform: uppercase;
|
|
@@ -962,8 +1005,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
962
1005
|
line-height: 12px;
|
|
963
1006
|
letter-spacing: 0.09em;
|
|
964
1007
|
margin-bottom: 12px;
|
|
965
|
-
|
|
966
|
-
${e=>
|
|
1008
|
+
`,$n=Qe.div`
|
|
1009
|
+
${e=>k(e)} {
|
|
967
1010
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
968
1011
|
background: #ffffff;
|
|
969
1012
|
border: 1px solid #fafafa;
|
|
@@ -975,8 +1018,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
975
1018
|
|
|
976
1019
|
max-width: 150px;
|
|
977
1020
|
min-width: 200px;
|
|
978
|
-
`,
|
|
979
|
-
${e=>
|
|
1021
|
+
`,Mn=Qe.div`
|
|
1022
|
+
${e=>k(e)} {
|
|
980
1023
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
981
1024
|
}
|
|
982
1025
|
width: 40px;
|
|
@@ -987,14 +1030,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
987
1030
|
justify-content: center;
|
|
988
1031
|
align-content: center;
|
|
989
1032
|
align-items: center;
|
|
990
|
-
`,
|
|
1033
|
+
`,Un=Qe.div`
|
|
991
1034
|
font-weight: 600;
|
|
992
1035
|
font-size: 20px;
|
|
993
1036
|
line-height: 24px;
|
|
994
1037
|
width: 20px;
|
|
995
1038
|
height: 20px;
|
|
996
|
-
|
|
997
|
-
${e=>
|
|
1039
|
+
`,zn=Qe.div`
|
|
1040
|
+
${e=>k(e)} {
|
|
998
1041
|
color: #434343;
|
|
999
1042
|
}
|
|
1000
1043
|
font-weight: 600;
|
|
@@ -1002,20 +1045,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1002
1045
|
line-height: 17px;
|
|
1003
1046
|
margin-top: 12px;
|
|
1004
1047
|
margin-bottom: 8px;
|
|
1005
|
-
`,
|
|
1006
|
-
${e=>
|
|
1048
|
+
`,_n=Qe.div`
|
|
1049
|
+
${e=>k(e)} {
|
|
1007
1050
|
color: #8c8c8c;
|
|
1008
1051
|
}
|
|
1009
1052
|
font-weight: 400;
|
|
1010
1053
|
font-size: 12px;
|
|
1011
1054
|
line-height: 14px;
|
|
1012
|
-
`,
|
|
1055
|
+
`,Wn=Qe.a`
|
|
1013
1056
|
color: ${e=>e.color};
|
|
1014
1057
|
font-size: 12px;
|
|
1015
1058
|
line-height: 14px;
|
|
1016
1059
|
font-weight: 400;
|
|
1017
1060
|
cursor: pointer;
|
|
1018
|
-
`;var
|
|
1061
|
+
`;var rd=({steps:e,style:t,title:o,primaryColor:r,appearance:i,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ae();return Ze.createElement(On,{style:t,className:l("guideContainer",i)},Ze.createElement(Dn,{className:l("guideTitle",i)},o),Ze.createElement(Ln,{className:l("guideItemContainer",i)},e.map((p,c)=>Ze.createElement($n,{key:`guide-${p.id??c}`,className:l("guideItem",i)},p.icon&&Ze.createElement(Mn,{className:l("guideIcon",i)},Ze.createElement(Un,null,p.icon)),Ze.createElement(zn,{className:l("guideItemTitle",i),dangerouslySetInnerHTML:fe(p.title)}),Ze.createElement(_n,{className:l("guideItemSubtitle",i),dangerouslySetInnerHTML:fe(p.subtitle)}),Ze.createElement(Wn,{className:l("guideItemLink",i),color:r,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},lo=rd;var nd=({steps:e,title:t,subtitle:o,stepsTitle:r,visible:i,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:a,guideData:x,guideTitle:d,onGuideButtonClick:h})=>{let S=({stepData:m,handleSecondaryCTAClick:B,handleCTAClick:b})=>m?U.createElement(Tn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},U.createElement(Fn,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:fe(m.title)}),U.createElement(kn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:fe(m.subtitle)}),U.createElement(Pn,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&U.createElement(ie,{title:m.secondaryButtonTitle,onClick:B,appearance:a,secondary:!0}),U.createElement(ie,{title:m.primaryButtonTitle,onClick:b,appearance:a}))):U.createElement(U.Fragment,null),P={...{default:m=>{var O;if((O=e[g])!=null&&O.StepContent){let I=e[g].StepContent;return U.createElement("div",null,I)}let B=e[g];return U.createElement(S,{stepData:m,handleCTAClick:()=>{B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()}})}},...c},[u,E]=id(0),g=s??u,T=p??E,N=()=>{var m;return e?!((m=e[g])!=null&&m.type)||!P[e[g].type]?P.default(e[g]):P[e[g].type]({stepData:e[g],primaryColor:a.theme.colorPrimary}):U.createElement(U.Fragment,null)},C=e.filter(m=>m.complete).length;return i?(a.theme.modalContainer||(a.theme.borderRadius&&(hr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=hr),U.createElement(ot,{onClose:n,visible:i,appearance:a},U.createElement(In,null,U.createElement(gn,null,U.createElement(xn,{appearance:a,className:l("checklistTitle",a)},t),U.createElement(hn,{appearance:a,className:l("checklistSubtitle",a)},o)),U.createElement(fn,null,e&&e.length>0&&U.createElement(Cn,{className:l("stepsContainer",a)},U.createElement(Sn,null,U.createElement("div",{style:{flex:3}},U.createElement(yn,{className:l("stepsTitle",a)},r)),U.createElement(An,null,U.createElement(Le,{style:{width:"100%"},count:C,total:e.length,appearance:a}))),U.createElement(bn,null,U.createElement(wn,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,B)=>{let b=g===B;return U.createElement(vn,{selected:b,className:l(`checklistStepListItem${b?"Selected":""}`,a),key:`checklist-guide-step-${m.id??B}`,disabled:m.blocked,onClick:()=>{m.blocked||T(B)},title:m.blocked?"Finish remaining steps to continue":void 0},b&&U.createElement(Oo,{className:l("checklistStepItemSelectedIndicator",a),layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),U.createElement(Bn,{selected:b,className:l(`checklistStepListStepName${b?"Selected":""}`,a)},m.stepName),U.createElement(En,null,U.createElement(qe,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),U.createElement(Nn,null,U.createElement(Ut,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),U.createElement(N,null))),x&&x.length>0&&U.createElement(lo,{steps:x,title:d,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(h&&h(m),!0)}))))):U.createElement(U.Fragment,null)},Cr=nd;import{useEffect as sd,useState as ld}from"react";var Uo=()=>{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,r]=ld(t),i=null,n=()=>{i!==null?clearTimeout(i):s(),i=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,a])=>{if(!window)return[c,!1];let x=window.matchMedia(a);return x.addEventListener("change",n),[c,x.matches]}));r(p)};return sd(()=>{s()},[]),o};import ke,{useEffect as os,useState as ad}from"react";import he from"react";import Re from"styled-components";var Hn=Re.div`
|
|
1019
1062
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1020
1063
|
border: 1px solid;
|
|
1021
1064
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1027,42 +1070,41 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1027
1070
|
display: flex;
|
|
1028
1071
|
flex-direction: column;
|
|
1029
1072
|
transition: max-height 0.25s;
|
|
1030
|
-
`,
|
|
1073
|
+
`,Vn=Re.div`
|
|
1031
1074
|
display: flex;
|
|
1032
1075
|
margin-bottom: 20px;
|
|
1033
|
-
`,
|
|
1076
|
+
`,jn=Re.img`
|
|
1034
1077
|
border-radius: 4px;
|
|
1035
1078
|
max-height: 260px;
|
|
1036
1079
|
min-height: 200px;
|
|
1037
|
-
`,
|
|
1080
|
+
`,Gn=Re.div`
|
|
1038
1081
|
display: flex;
|
|
1039
1082
|
flex-direction: row;
|
|
1040
1083
|
justify-content: space-between;
|
|
1041
1084
|
align-items: center;
|
|
1042
|
-
`,
|
|
1085
|
+
`,Kn=Re.p`
|
|
1043
1086
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1044
1087
|
font-style: normal;
|
|
1045
1088
|
font-weight: 500;
|
|
1046
1089
|
font-size: 16px;
|
|
1047
1090
|
line-height: 18px;
|
|
1048
1091
|
margin-left: 8px;
|
|
1049
|
-
`,
|
|
1050
|
-
padding: 20px;
|
|
1092
|
+
`,qn=Re.div`
|
|
1051
1093
|
cursor: pointer;
|
|
1052
1094
|
:hover {
|
|
1053
1095
|
opacity: 0.8;
|
|
1054
1096
|
}
|
|
1055
|
-
`,
|
|
1097
|
+
`,zC=Re.div``,Yn=Re.p`
|
|
1056
1098
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1057
1099
|
font-weight: 400;
|
|
1058
1100
|
font-size: 14px;
|
|
1059
1101
|
line-height: 22px;
|
|
1060
|
-
`,
|
|
1102
|
+
`,Xn=Re.div`
|
|
1061
1103
|
display: flex;
|
|
1062
1104
|
flex-direction: row;
|
|
1063
1105
|
justify-content: flex-start;
|
|
1064
1106
|
align-items: center;
|
|
1065
|
-
`;var
|
|
1107
|
+
`;var Jn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:r,onSecondaryButtonClick:i,appearance:n,customStepTypes:s})=>{var d,h;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.1s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.1s ease-in"};function a(){return he.createElement(he.Fragment,null,e.imageUri||e.videoUri?he.createElement(Vn,{className:l("stepMediaContainer",n)},e.imageUri?he.createElement(jn,{className:l("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?he.createElement(st,{appearance:n,videoUri:e.videoUri}):null):null,he.createElement(Yn,{className:l("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:fe(e.subtitle)}),he.createElement(To,{className:l("checklistCTAContainer",n)},e.secondaryButtonTitle?he.createElement(ie,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>i(),appearance:n}):null,he.createElement(ie,{title:e.primaryButtonTitle??"Continue",onClick:()=>r(),appearance:n})))}function x(){if(!s)return null;let S=s[e.type];return S?S(e,n):null}return he.createElement(Hn,{"data-testid":`step-${e.id}`,className:l("checklistStepContainer",n),appearance:n},he.createElement(Gn,{className:l("stepHeader",n)},he.createElement(Xn,null,he.createElement(No,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),he.createElement(Kn,{appearance:n,className:l("stepTitle",n),dangerouslySetInnerHTML:fe(e.title),onClick:()=>o()})),he.createElement(qn,{className:l("stepChevronContainer",n),onClick:()=>o()},he.createElement(Ut,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(h=n==null?void 0:n.theme)==null?void 0:h.colorTextSecondary}))),he.createElement("div",{key:e.id,style:{...c}},x()??a()))};import zt from"styled-components";var ZC=zt.div`
|
|
1066
1108
|
background: #ffffff;
|
|
1067
1109
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1068
1110
|
border-radius: 6px;
|
|
@@ -1076,48 +1118,48 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1076
1118
|
|
|
1077
1119
|
max-width: 800px;
|
|
1078
1120
|
min-width: 350px;
|
|
1079
|
-
`,
|
|
1121
|
+
`,Qn=zt.div`
|
|
1080
1122
|
display: flex;
|
|
1081
1123
|
flex-direction: column;
|
|
1082
|
-
`,
|
|
1124
|
+
`,Zn=zt.h1`
|
|
1083
1125
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1084
1126
|
font-style: normal;
|
|
1085
1127
|
font-weight: 700;
|
|
1086
1128
|
font-size: 20px;
|
|
1087
1129
|
line-height: 24px;
|
|
1088
1130
|
margin-bottom: 8px;
|
|
1089
|
-
`,
|
|
1131
|
+
`,Rn=zt.h2`
|
|
1090
1132
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1091
1133
|
font-weight: 400;
|
|
1092
1134
|
font-size: 14px;
|
|
1093
1135
|
line-height: 23px;
|
|
1094
1136
|
margin: 2px 0 0 0;
|
|
1095
|
-
`,
|
|
1137
|
+
`,es=zt.div`
|
|
1096
1138
|
display: block;
|
|
1097
1139
|
width: 100%;
|
|
1098
|
-
`,
|
|
1140
|
+
`,ts=zt.div`
|
|
1099
1141
|
display: flex;
|
|
1100
1142
|
width: 100%;
|
|
1101
1143
|
flex-direction: column;
|
|
1102
1144
|
justify-content: space-between;
|
|
1103
1145
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1104
|
-
`;var
|
|
1146
|
+
`;var pd=({title:e,subtitle:t,steps:o,onClose:r,visible:i,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:a,appearance:x,type:d,className:h,customStepTypes:S,style:w})=>{let P=o.filter(C=>C.complete).length,[u,E]=ad(Array(o.length).fill(!0));os(()=>{let C=[...u];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){C[m]=!1;break}E(C)}},[]),os(()=>{g(c)},[c]);let g=C=>{let m=[...u];if(s)for(let B=0;B<u.length;++B)B!==C&&(m[B]=!0);m[C]=!m[C],E(m)};if(!i&&d=="modal")return ke.createElement(ke.Fragment,null);let T=ke.createElement(ke.Fragment,null,ke.createElement(Qn,null,ke.createElement(Zn,{appearance:x,className:l("checklistTitle",x),dangerouslySetInnerHTML:fe(e)}),ke.createElement(Rn,{appearance:x,className:l("checklistSubtitle",x),dangerouslySetInnerHTML:fe(t)})),ke.createElement(Le,{display:"percent",count:P,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:x})),N=ke.createElement(es,{className:we(l("checklistContainer",x),h)},o.map((C,m)=>{let B=u[m];return ke.createElement(Jn,{appearance:x,stepData:C,collapsed:B,key:`modal-checklist-${C.id??m}`,onClick:()=>{if(c===m){g(m);return}a(m)},onPrimaryButtonClick:()=>{C.handlePrimaryButtonClick&&C.handlePrimaryButtonClick(),p&&!C.completionCriteria&&m<u.length-1&&u[m+1]&&a(m+1)},onSecondaryButtonClick:()=>{C.handleSecondaryButtonClick&&C.handleSecondaryButtonClick()},customStepTypes:S})}));return d==="inline"?ke.createElement(ts,{appearance:x,className:we(l("checklistInlineContainer",x),h),style:w},T,N):ke.createElement(ke.Fragment,null,ke.createElement(ot,{onClose:r,visible:i,appearance:x,style:{maxWidth:"600px"},headerContent:T},N))},Sr=pd;import le,{useEffect as yr,useRef as gd,useState as Tt}from"react";import _t from"react";import pe,{css as rs,keyframes as is}from"styled-components";var ns=rs`
|
|
1105
1147
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1106
|
-
`,
|
|
1148
|
+
`,dd=rs`
|
|
1107
1149
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1108
|
-
`,
|
|
1150
|
+
`,cd=is`
|
|
1109
1151
|
from {
|
|
1110
1152
|
opacity: 0;
|
|
1111
1153
|
} to {
|
|
1112
1154
|
opacity: 1;
|
|
1113
1155
|
}
|
|
1114
|
-
`,
|
|
1156
|
+
`,md=is`
|
|
1115
1157
|
from {
|
|
1116
1158
|
opacity: 1;
|
|
1117
1159
|
} to {
|
|
1118
1160
|
opacity: 0;
|
|
1119
1161
|
}
|
|
1120
|
-
`,
|
|
1162
|
+
`,ss=pe.div`
|
|
1121
1163
|
margin: 0 -20px;
|
|
1122
1164
|
overflow-x: auto;
|
|
1123
1165
|
padding-left: 20px;
|
|
@@ -1134,14 +1176,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1134
1176
|
::-webkit-scrollbar {
|
|
1135
1177
|
display: none;
|
|
1136
1178
|
}
|
|
1137
|
-
`,
|
|
1179
|
+
`,ls=pe.div`
|
|
1138
1180
|
display: flex;
|
|
1139
1181
|
flex-flow: row nowrap;
|
|
1140
1182
|
gap: 0 16px;
|
|
1141
1183
|
scroll-snap-align: center;
|
|
1142
1184
|
scroll-snap-stop: always;
|
|
1143
|
-
`,
|
|
1144
|
-
animation: ${e=>e.reversed?
|
|
1185
|
+
`,as=pe.div`
|
|
1186
|
+
animation: ${e=>e.reversed?md:cd} 0.25s ease-out;
|
|
1145
1187
|
background: linear-gradient(
|
|
1146
1188
|
to right,
|
|
1147
1189
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1150,8 +1192,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1150
1192
|
position: absolute;
|
|
1151
1193
|
width: 64px;
|
|
1152
1194
|
z-index: 10;
|
|
1153
|
-
`,
|
|
1154
|
-
${
|
|
1195
|
+
`,ps=pe.button`
|
|
1196
|
+
${ns}
|
|
1155
1197
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1156
1198
|
align-items: center;
|
|
1157
1199
|
border-radius: 50%;
|
|
@@ -1162,11 +1204,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1162
1204
|
justify-content: center;
|
|
1163
1205
|
position: absolute;
|
|
1164
1206
|
width: 48px;
|
|
1165
|
-
`,
|
|
1207
|
+
`,ds=pe.div`
|
|
1166
1208
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1167
1209
|
padding: 20px;
|
|
1168
|
-
`,
|
|
1169
|
-
${
|
|
1210
|
+
`,cs=pe(ds)`
|
|
1211
|
+
${ns}
|
|
1170
1212
|
background: ${({theme:e})=>e.colorBackground};
|
|
1171
1213
|
position: relative;
|
|
1172
1214
|
|
|
@@ -1178,50 +1220,50 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1178
1220
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1179
1221
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1180
1222
|
}
|
|
1181
|
-
`,
|
|
1223
|
+
`,ms=pe.img`
|
|
1182
1224
|
border-radius: 50%;
|
|
1183
1225
|
height: 40px;
|
|
1184
1226
|
margin-bottom: 12px;
|
|
1185
1227
|
width: 40px;
|
|
1186
|
-
`,
|
|
1187
|
-
${e=>
|
|
1188
|
-
${
|
|
1228
|
+
`,us=pe(ds)`
|
|
1229
|
+
${e=>k(e)} {
|
|
1230
|
+
${dd}
|
|
1189
1231
|
|
|
1190
1232
|
background: ${({theme:e})=>e.colorBackground};
|
|
1191
1233
|
}
|
|
1192
|
-
`,
|
|
1234
|
+
`,u0=pe.div`
|
|
1193
1235
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1194
1236
|
display: flex;
|
|
1195
1237
|
flex-flow: row nowrap;
|
|
1196
1238
|
align-items: center;
|
|
1197
|
-
`,
|
|
1239
|
+
`,f0=pe.div`
|
|
1198
1240
|
white-space: nowrap;
|
|
1199
|
-
`,
|
|
1241
|
+
`,fs=pe.div`
|
|
1200
1242
|
background: #d8fed8;
|
|
1201
1243
|
border-radius: 6px;
|
|
1202
1244
|
float: right;
|
|
1203
1245
|
margin-bottom: 12px;
|
|
1204
1246
|
padding: 4px 10px;
|
|
1205
|
-
`,
|
|
1247
|
+
`,ud=pe.p`
|
|
1206
1248
|
font-weight: bold;
|
|
1207
1249
|
font-size: 18px;
|
|
1208
1250
|
line-height: 22px;
|
|
1209
1251
|
letter-spacing: calc(18px * -0.01);
|
|
1210
1252
|
margin: 0;
|
|
1211
|
-
`,
|
|
1253
|
+
`,gs=pe(ud)`
|
|
1212
1254
|
margin-bottom: 4px;
|
|
1213
|
-
`,
|
|
1255
|
+
`,xs=pe.div`
|
|
1214
1256
|
display: flex;
|
|
1215
1257
|
flex-flow: row nowrap;
|
|
1216
1258
|
align-items: center;
|
|
1217
1259
|
min-width: 50%;
|
|
1218
|
-
`,
|
|
1260
|
+
`,fd=pe.p`
|
|
1219
1261
|
font-weight: bold;
|
|
1220
1262
|
font-size: 16px;
|
|
1221
1263
|
line-height: 20px;
|
|
1222
1264
|
letter-spacing: calc(16px * -0.01);
|
|
1223
1265
|
margin: 0;
|
|
1224
|
-
`,
|
|
1266
|
+
`,hs=pe(fd)`
|
|
1225
1267
|
margin-bottom: 4px;
|
|
1226
1268
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1227
1269
|
`}
|
|
@@ -1231,7 +1273,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1231
1273
|
font-size: 14px;
|
|
1232
1274
|
line-height: 22px;
|
|
1233
1275
|
margin: 0;
|
|
1234
|
-
`,
|
|
1276
|
+
`,Cs=pe.p`
|
|
1235
1277
|
color: ${({theme:e})=>e.colorText};
|
|
1236
1278
|
font-weight: 600;
|
|
1237
1279
|
font-size: 12px;
|
|
@@ -1243,21 +1285,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1243
1285
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1244
1286
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1245
1287
|
`}
|
|
1246
|
-
`;var
|
|
1288
|
+
`;var Ss=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:r}=oe(),{primaryCTAClickSideEffects:i}=ae();o=r(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:a=!1}=e,x=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{i(e)};return _t.createElement(cs,{className:l("carouselCard",o),onClick:a?null:d,style:t,blocked:a,complete:c},n&&_t.createElement(ms,{className:l("carouselCardImage",o),src:n,alt:p,style:{opacity:c||a?.4:1}}),c&&_t.createElement(fs,{className:l("carouselCompletedPill",o)},_t.createElement(Cs,{style:{color:"#108E0B"}},"Complete")),p&&_t.createElement(hs,{blocked:a,complete:c,className:l("carouselCardTitle",o)},p),s&&_t.createElement(pt.Quiet,{blocked:a,complete:c,className:l("carouselCardSubtitle",o)},s))};var xd=()=>le.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},le.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ys=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[r,i]=Tt(!1),[n,s]=Tt(!1);yr(()=>{t===!0&&r===!1?i(!0):t===!1&&r===!0&&s(!0)},[t]);let p=()=>{i(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return r?le.createElement(as,{style:c,reversed:n,onAnimationEnd:n?p:null},le.createElement(ps,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(xd,null))):null},bs=({flowId:e,appearance:t,customVariables:o,className:r})=>{let i=gd(null),[n,s]=Tt(!1),[p,c]=Tt(!1),[a,x]=Tt(null),[d,h]=Tt([]),[S,w]=Tt(0),{isSmall:P}=Uo(),u=P?1:3,{getFlowMetadata:E,getFlowSteps:g,getNumberOfStepsCompleted:T,updateCustomVariables:N,isLoading:C}=ee();yr(()=>{N(o)},[o,C]),yr(()=>{if(C)return;let I=E(e),D=T(e),L=g(e);x(I),I.data!==null&&(h(L.sort((_,H)=>Number(_.complete)-Number(H.complete))),c(L.length>u),w(D))},[C]);let m=[];for(let I=0;I<d.length;I+=u)m.push(d.slice(I,I+u));let B=I=>{let D=I.target,L=D.scrollWidth-D.clientWidth,_=Math.ceil(D.scrollLeft);_>0&&n===!1&&s(!0),_===0&&n===!0&&s(!1),_<L&&p===!1&&c(!0),_===L&&p===!0&&c(!1)},b=(I=!0)=>{let D=I?1:-1;i.current!==null&&i.current.scrollBy({left:i.current.clientWidth*D,behavior:"smooth"})},F=null,O=I=>{F!==null?clearTimeout(F):B(I),F=setTimeout(()=>{B(I)},16)};return C?null:le.createElement(us,{className:we(l("carouselContainer",t),r)},le.createElement("div",{style:{display:"flex",justifyContent:P?"center":"space-between",marginBottom:20,flexWrap:P?"wrap":"nowrap",gap:P?16:20}},le.createElement("div",null,le.createElement(gs,{className:l("carouselTitle",t)},a==null?void 0:a.title),le.createElement(pt.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),le.createElement(xs,{className:l("progressWrapper",t)},le.createElement(Le,{count:S,total:d.length,appearance:t}))),le.createElement("div",{style:{position:"relative"}},le.createElement(ys,{show:n,onClick:()=>b(!1)}),le.createElement(ys,{side:"right",show:p,onClick:b}),le.createElement(ss,{ref:i,onScroll:O},m.map((I,D)=>le.createElement(ls,{key:D,style:{flex:`0 0 calc(100% - ${d.length>u?36:0}px)`}},I.map((L,_)=>le.createElement(Ss,{key:_,stepData:L,style:{flex:d.length>u?`0 1 calc(100% / ${u} - 16px * 2 / ${u})`:1},appearance:t})))))),le.createElement(ne,{appearance:t}))};var br=({flowId:e,title:t,subtitle:o,style:r,initialSelectedStep:i,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:a,onStepCompletion:x,onButtonClick:d,appearance:h,hideOnFlowCompletion:S,setVisible:w,customStepTypes:P,checklistStyle:u="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:g,...T})=>{let{getFlow:N,getFlowSteps:C,markStepCompleted:m,getStepStatus:B,getNumberOfStepsCompleted:b,isLoading:F,targetingLogicShouldHideFlow:O,updateCustomVariables:I,getFlowMetadata:D,isStepBlocked:L,getFlowStatus:_,hasActiveFullPageFlow:H,setHasActiveFullPageFlow:X}=ee(),{primaryCTAClickSideEffects:se,secondaryCTAClickSideEffects:q}=ae(),{getOpenFlowState:V,setOpenFlowState:K}=ve(),[J,Se]=Ts(i||0),[Pe,ye]=Ts(!1),re=c===void 0?V(e):c,Q=s==="modal",{mergeAppearanceWithDefault:M}=oe(),{isLarge:$}=Uo();if(h=M(h),ws(()=>{I(a)},[a,F]),ws(()=>{c!==void 0&&(Q&&c===!0?X(!0):Q&&c===!1&&X(!1))},[c,w,H]),F)return null;let me=N(e);if(!me||O(me))return null;let ue=C(e);if(!ue||S===!0&&_(e)===R)return null;let z=D(e);if(z!=null&&z.title&&(t=z.title),z!=null&&z.subtitle&&(o=z.subtitle),!Pe&&i===void 0&&b(e)>0){let A=ue.findIndex(Z=>Z.complete===!1);Se(A>-1?A:ue.length-1),ye(!0)}function de(){if(J+1>=ue.length){Q&&K(e,!1);return}L(e,ue[J+1].id)||Se(J+1)}function te(A,Z,mt){let Er=J+1<ue.length?ue[J+1]:null;d&&d(A,J,Z,Er)===!0&&Q&&xe(),x&&x(A,mt,Er),!x&&!d&&(A.primaryButtonUri||A.secondaryButtonUri)&&Q&&xe()}function be(){return ue.map((A,Z)=>({...A,handleSecondaryButtonClick:()=>{de(),q(A),A.skippable===!0&&m(e,A.id,{skipped:!0}),te(A,"secondary",Z)},handlePrimaryButtonClick:()=>{(!A.completionCriteria&&(A.autoMarkCompleted||A.autoMarkCompleted===void 0)||A.completionCriteria&&A.autoMarkCompleted===!0)&&(m(e,A.id),de()),te(A,"primary",Z),se(A),B(e,A.id)===Me&&de()}}))}function De(){return ce.createElement(ne,{appearance:h})}let j={steps:be(),title:t,subtitle:o,primaryColor:h.theme.colorPrimary,appearance:h,customStepTypes:P,type:s,className:n,autoExpandFirstIncompleteStep:E,autoExpandNextStep:g};function xe(){K(e,!1),p&&p(),w&&w(!1)}function jt(){return ce.createElement(ce.Fragment,null,ce.createElement(De,null),ce.createElement(bs,{flowId:e,appearance:h,customVariables:a,className:n}))}function f(){return ce.createElement(ce.Fragment,null,ce.createElement(De,null),ce.createElement(Sr,{visible:re,onClose:()=>{xe()},selectedStep:J,setSelectedStep:Se,autoExpandNextStep:!0,appearance:h,...j}))}function y(){if(!$)return f();let A=T.guideFlowId,Z;return A&&N(A)&&(Z=C(A)),ce.createElement(ce.Fragment,null,ce.createElement(De,null),ce.createElement(Cr,{visible:re,stepsTitle:z.stepsTitle?z.stepsTitle:"Your quick start guide",onClose:()=>{xe()},selectedStep:J,setSelectedStep:Se,guideData:Z,guideTitle:T.guideTitle??"Guide",appearance:h,title:t,subtitle:o,onGuideButtonClick:mt=>{te(mt,"link",0)},customStepTypes:P,...j}))}function v(){if(!$)return f();let A=ce.createElement(xr,{flowId:e,style:r,selectedStep:J,setSelectedStep:Se,appearance:h,type:s,...j});return Q?ce.createElement(ot,{onClose:()=>{xe()},visible:re,appearance:h,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ce.createElement(De,null),A):ce.createElement(ce.Fragment,null,ce.createElement(De,null),A)}switch(u){case"condensed":return f();case"with-guide":return y();case"default":return v();case"carousel":return jt();default:return v()}};var Cd=e=>hd.createElement(br,{type:"inline",...e});import ct,{useEffect as Sd}from"react";import Ve from"react";import zo from"styled-components";var Fs=zo.div`
|
|
1247
1289
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1248
1290
|
border-radius: 8px;
|
|
1249
1291
|
padding: 6px 10px 6px 10px;
|
|
1250
1292
|
min-width: 160px;
|
|
1251
1293
|
cursor: pointer;
|
|
1252
1294
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1253
|
-
`,
|
|
1295
|
+
`,ks=zo.div`
|
|
1254
1296
|
display: flex;
|
|
1255
1297
|
flex-direction: row;
|
|
1256
1298
|
justify-content: space-between;
|
|
1257
1299
|
align-items: center;
|
|
1258
1300
|
margin-bottom: 2px;
|
|
1259
1301
|
flex-grow: 2;
|
|
1260
|
-
`,
|
|
1302
|
+
`,Ps=zo.div`
|
|
1261
1303
|
text-overflow: ellipsis;
|
|
1262
1304
|
font-weight: 600;
|
|
1263
1305
|
font-size: 12px;
|
|
@@ -1265,13 +1307,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1265
1307
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1266
1308
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1267
1309
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1268
|
-
`,
|
|
1310
|
+
`,vs=zo.div`
|
|
1269
1311
|
width: 20px;
|
|
1270
1312
|
margin-right: 8px;
|
|
1271
1313
|
display: flex;
|
|
1272
1314
|
height: 100%;
|
|
1273
1315
|
align-items: center;
|
|
1274
|
-
`;
|
|
1316
|
+
`;var Bs=({title:e,count:t,total:o,onClick:r,style:i={},className:n,appearance:s,type:p="default"})=>Ve.createElement(Ve.Fragment,null,Ve.createElement(ne,{appearance:s}),Ve.createElement(Fs,{onClick:()=>r!==void 0&&r(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...i},className:we(n??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ve.createElement(vs,{className:l("progressRingContainer",s)},Ve.createElement(At,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ve.createElement(ks,{type:p,className:l("badgeTitleContainer",s)},Ve.createElement(Ps,{type:p,appearance:s,className:l("badgeTitle",s)},e),r!==void 0&&Ve.createElement(Ut,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ve.createElement(Le,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import dt from"react";import ao from"styled-components";var Es=ao.div`
|
|
1275
1317
|
display: flex;
|
|
1276
1318
|
flex-direction: row;
|
|
1277
1319
|
width: 100%;
|
|
@@ -1282,25 +1324,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1282
1324
|
border-width: 1px;
|
|
1283
1325
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1284
1326
|
border-radius: 12px;
|
|
1285
|
-
`,
|
|
1286
|
-
${e=>
|
|
1327
|
+
`,As=ao.div`
|
|
1328
|
+
${e=>k(e)} {
|
|
1287
1329
|
display: flex;
|
|
1288
1330
|
justify-content: center;
|
|
1289
1331
|
align-items: center;
|
|
1290
1332
|
margin-right: 16px;
|
|
1291
1333
|
}
|
|
1292
|
-
`,
|
|
1334
|
+
`,Is=ao.div`
|
|
1293
1335
|
display: flex;
|
|
1294
1336
|
flex-direction: column;
|
|
1295
1337
|
flex: 1;
|
|
1296
1338
|
margin-top: 0;
|
|
1297
|
-
`,
|
|
1339
|
+
`,Ns=ao.div`
|
|
1298
1340
|
display: flex;
|
|
1299
1341
|
flex-direction: column;
|
|
1300
1342
|
justify-content: center;
|
|
1301
1343
|
margin-left: 16px;
|
|
1302
1344
|
min-width: 200px;
|
|
1303
|
-
`,
|
|
1345
|
+
`,mS=ao.div`
|
|
1304
1346
|
display: flex;
|
|
1305
1347
|
justify-content: center;
|
|
1306
1348
|
align-items: flex-end;
|
|
@@ -1309,7 +1351,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1309
1351
|
:hover {
|
|
1310
1352
|
opacity: 0.8;
|
|
1311
1353
|
}
|
|
1312
|
-
`;var
|
|
1354
|
+
`;var Os=({title:e,subtitle:t,icon:o,appearance:r,count:i,total:n,className:s,style:p})=>dt.createElement(dt.Fragment,null,dt.createElement(Es,{appearance:r,className:we(l("fullWidthProgressBadgeContainer",r),s??""),style:p},o&&dt.createElement(As,{className:l("fullWidthProgressBadgeIcon",r)},o),dt.createElement(Is,null,dt.createElement(Te,{size:"small",appearance:r,title:e,subtitle:t})),dt.createElement(Ns,{className:l("fullWidthProgressBadgeProgressContainer",r)},dt.createElement(Le,{count:i,total:n,display:"percent",textLocation:"top"}))));var yd=({flowId:e,title:t,subtitle:o,icon:r,style:i,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:a,type:x="default"})=>{let{getFlow:d,getFlowSteps:h,getFlowStatus:S,getNumberOfStepsCompleted:w,isLoading:P,targetingLogicShouldHideFlow:u,updateCustomVariables:E}=ee(),{mergeAppearanceWithDefault:g}=oe();a=g(a);let{setOpenFlowState:T,getOpenFlowState:N}=ve();if(Sd(()=>{E(p)},[p,P]),P)return null;let C=d(e);if(!C||u(C)||c===!0&&S(e)===R)return null;let m=h(e),B=w(e);return x==="full-width"?ct.createElement(ct.Fragment,null,ct.createElement(ne,{appearance:a}),ct.createElement(Os,{title:t,subtitle:o,count:B,total:m.length,style:i,className:s,appearance:a,icon:r,onClick:()=>{}})):ct.createElement(ct.Fragment,null,ct.createElement(ne,{appearance:a}),ct.createElement(Bs,{count:B,total:m.length,title:t,style:i,onClick:()=>{T(e,!0),n&&n()},type:x,className:s,appearance:a}))};import bd from"react";var wd=({flowId:e,style:t,appearance:o,...r})=>{let{getFlow:i,targetingLogicShouldHideFlow:n,getFlowSteps:s}=ee(),{mergeAppearanceWithDefault:p}=oe();o=p(o);let c=i(e);if(!c||n(c))return null;let a=s(e);return bd.createElement(lo,{steps:a,style:t,appearance:o,...r})};import Ht,{useContext as Od,useEffect as Ld}from"react";import W,{useEffect as _o,useLayoutEffect as Ds,useRef as Pd,useState as po}from"react";import co from"styled-components";import{useCallback as Td,useEffect as Fd,useState as kd}from"react";var wr=(e,t,o,r={x:20,y:20},i)=>{let n=i=="fixed"?0:window.scrollY,s=i=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+r.x+s,y:e.top-r.y+n}:t==="right"?{x:e.left+e.width+r.x+s,y:e.top-r.y+n}:{x:0,y:0}};function Ls(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[r,i]=kd(o),n=Td(()=>{e&&i(e.getBoundingClientRect())},[e]);return Fd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),r}var $s=300,Ms=100,vd=500,Wt=12,Bd=co.div`
|
|
1313
1355
|
width: 100%;
|
|
1314
1356
|
height: 100%;
|
|
1315
1357
|
border-radius: 9999px;
|
|
@@ -1332,26 +1374,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1332
1374
|
opacity: 0;
|
|
1333
1375
|
}
|
|
1334
1376
|
}
|
|
1335
|
-
`,
|
|
1336
|
-
width: ${
|
|
1337
|
-
height: ${
|
|
1377
|
+
`,Ed=co.div`
|
|
1378
|
+
width: ${Wt}px;
|
|
1379
|
+
height: ${Wt}px;
|
|
1338
1380
|
border-radius: 100px;
|
|
1339
1381
|
background-color: ${e=>e.primaryColor};
|
|
1340
1382
|
z-index: 20;
|
|
1341
1383
|
opacity: 1;
|
|
1342
|
-
`,
|
|
1384
|
+
`,Ad=co.div`
|
|
1343
1385
|
pointer-events: all;
|
|
1344
|
-
`,
|
|
1386
|
+
`,Us=co.div`
|
|
1345
1387
|
display: flex;
|
|
1346
1388
|
align-content: center;
|
|
1347
1389
|
justify-content: center;
|
|
1348
1390
|
align-items: center;
|
|
1349
1391
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1350
|
-
`,
|
|
1351
|
-
width: ${
|
|
1352
|
-
height: ${
|
|
1353
|
-
`,
|
|
1354
|
-
${e=>
|
|
1392
|
+
`,Id=co(Us)`
|
|
1393
|
+
width: ${Wt+12}px;
|
|
1394
|
+
height: ${Wt+12}px;
|
|
1395
|
+
`,Nd=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:r="auto",showHighlight:i=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:a=0,customStepTypes:x,appearance:d,dismissible:h=!1,showHighlightOnly:S,showStepCount:w=!0,completedStepsCount:P=0,showFrigadeBranding:u=!1})=>{var de,te,be,De;let[E,g]=po(),[T,N]=po(new Date),C=Pd(null),[m,B]=po(document.querySelector(e[a].selector)),b=Ls(m,T),[F,O]=po(),[I,D]=po(!S),L=(te=(de=e[a])==null?void 0:de.props)!=null&&te.position?e[a].props.position:"absolute",_=((De=(be=e[a])==null?void 0:be.props)==null?void 0:De.zIndex)??90,H=(E==null?void 0:E.width)??$s,X=(E==null?void 0:E.height)??Ms,se=window.location.pathname.split("/").pop();Ds(()=>{C.current&&g({width:C.current.clientWidth,height:C.current.clientHeight})},[a,T,L]),_o(()=>{S||D(!0)},[a]);let q=()=>{let j=document.querySelector(e[a].selector);if(!j){O(void 0),B(null);return}F&&F===JSON.stringify(j==null?void 0:j.getBoundingClientRect())||(B(j),N(new Date),j&&O(JSON.stringify(j.getBoundingClientRect())))};if(_o(()=>{let j=new MutationObserver(q);return j.observe(document.body,{subtree:!0,childList:!0}),()=>j.disconnect()},[q]),_o(()=>{let j=new MutationObserver(q);return j.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>j.disconnect()},[q]),_o(()=>{let j=setInterval(()=>{q()},10);return()=>clearInterval(j)},[q]),Ds(()=>{setTimeout(()=>{q()},vd),q()},[a,se]),m===null||!p||b.height===0&&b.width===0&&L!=="fixed")return null;let V=r==="auto"?"right":r,K=wr(b,V,H,s,L),J=b.right+H>(window.innerWidth||document.documentElement.clientWidth),Se=b.bottom+Ms>(window.innerHeight||document.documentElement.clientHeight);J&&r==="auto"&&(K=wr(b,"left",H,s,L),V="left");let Pe=()=>{let j=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),D(!1),setTimeout(()=>{q()},30)),P===e.length-1)return o()},xe=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),S&&!e[a].secondaryButtonUri&&D(!1))};return W.createElement(W.Fragment,null,w&&e.length>1&&W.createElement(Hr,null,W.createElement(jr,{className:l("tooltipStepCounter",d)},a+1," of ",e.length)),W.createElement(Vr,{showStepCount:w,className:l("tooltipCTAContainer",d)},e[a].secondaryButtonTitle&&W.createElement(ie,{title:e[a].secondaryButtonTitle,appearance:d,onClick:xe,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&W.createElement(ie,{title:e[a].primaryButtonTitle,appearance:d,onClick:j,withMargin:!1,size:"small"})))},ye=()=>W.createElement(W.Fragment,null,h&&W.createElement(Ur,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",d)},W.createElement(Ee,null)),e[a].imageUri&&W.createElement(zr,{dismissible:h,appearance:d,src:e[a].imageUri,className:l("tooltipImageContainer",d)}),e[a].videoUri&&!e[a].imageUri&&W.createElement(_r,{dismissible:h,appearance:d,className:l("tooltipVideoContainer",d)},W.createElement(st,{appearance:d,videoUri:e[a].videoUri})),W.createElement(Te,{appearance:d,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),W.createElement(Wr,{className:l("tooltipFooter",d)},W.createElement(Pe,null))),Q={...{default:j=>{var xe;if((xe=e[a])!=null&&xe.StepContent){let jt=e[a].StepContent;return W.createElement("div",null,jt)}return W.createElement(ye,null)}},...x},M=()=>{var j;return e?!((j=e[a])!=null&&j.type)||!Q[e[a].type]?Q.default(e[a]):Q[e[a].type]({stepData:e[a],primaryColor:n}):W.createElement(W.Fragment,null)};if(S&&e[a].complete===!0)return null;let $={top:(K==null?void 0:K.y)-Wt,left:(V=="left"?b.x+s.x:(K==null?void 0:K.x)-Wt)??0,cursor:S?"pointer":"default",position:L},me=()=>{let xe=$.left+(V=="left"?-H:24);return Math.min(Math.max(xe,20),window.innerWidth-H-20)},ue=()=>{if(L==="fixed")return $.top;let j=$.top+X,xe=20;return j>window.innerHeight-xe?$.top+-X:$.top},z=()=>{S&&(N(new Date),D(!I))};return W.createElement(Ad,null,W.createElement(Id,{style:$,zIndex:_,className:l("tourHighlightContainer",d)},i&&e[a].showHighlight!==!1&&W.createElement(W.Fragment,null,W.createElement(Ed,{style:{position:L},onClick:z,primaryColor:d.theme.colorPrimary,className:l("tourHighlightInnerCircle",d)}),W.createElement(Bd,{style:{position:"absolute"},onClick:z,primaryColor:d.theme.colorPrimary,className:l("tourHighlightOuterCircle",d)}))),W.createElement(Us,{style:{...$,left:me(),top:ue()},zIndex:_+1,className:l("tooltipContainerWrapper",d)},I&&W.createElement(W.Fragment,null,W.createElement(fo,{ref:C,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...c},appearance:d,className:l("tooltipContainer",d),maxWidth:$s,zIndex:_+10},W.createElement(M,null)),u&&W.createElement(Kr,{className:l("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:_+10},W.createElement(go,{appearance:d})))))},Wo=Nd;import{Portal as Dd}from"react-portal";var $d=({flowId:e,customVariables:t,appearance:o,onStepCompletion:r,onButtonClick:i,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:a=!1,dismissBehavior:x="complete-flow",onComplete:d,skipIfNotFound:h=!1,...S})=>{let{getFlow:w,getFlowSteps:P,isLoading:u,targetingLogicShouldHideFlow:E,markStepCompleted:g,markStepStarted:T,markFlowCompleted:N,updateCustomVariables:C,getCurrentStepIndex:m,getStepStatus:B,isStepBlocked:b,getFlowStatus:F,getNumberOfStepsCompleted:O}=ee(),{isLoadingUserFlowStateData:I}=Be(),{primaryCTAClickSideEffects:D,secondaryCTAClickSideEffects:L}=ae(),{hasOpenModals:_}=ve(),H=m(e),{openFlowStates:X}=Od(G),{mergeAppearanceWithDefault:se}=oe();if(o=se(o),Ld(()=>{C(t)},[t,u]),I)return null;let q=w(e);if(!q||E(q)||F(e)==R||_())return null;let V=P(e);if(Object.keys(X).length>0){let M=Object.keys(X).find($=>X[$]===!0);if(M!==void 0&&M!==e)return Ht.createElement(Ht.Fragment,null)}async function K(M){if(await g(e,M.id),V.map($=>B(e,$.id)).every($=>$===Me)){await N(e);return}if(!a&&H+1<V.length){if(b(e,V[H+1].id))return;await T(e,V[H+1].id)}}function J(M,$,me){let ue=H+1<V.length?V[H+1]:null;i&&i(M,H,$,ue),r&&r(M,me,ue)}function Se(){return V.map(M=>({...M,handleSecondaryButtonClick:async()=>{L(M),M.skippable===!0&&await g(e,M.id,{skipped:!0}),J(M,"secondary",H)},handlePrimaryButtonClick:async()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&await K(M),J(M,"primary",H),D(M)}}))}async function Pe(M){s&&s(),x==="complete-flow"?await N(e):await g(e,M.id)}function ye(){d&&d()}let re=!document.querySelector(V[H].selector);function Q(){let M=V.findIndex($=>!!document.querySelector($.selector));return V.map(($,me)=>re&&!n&&me!==M&&h?null:Ht.createElement(Wo,{key:$.id,appearance:o,steps:Se(),selectedStep:me,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>Pe($),tooltipPosition:c,showHighlightOnly:a,completedStepsCount:O(e),onComplete:ye,...S}))}return Ht.createElement(Dd,null,Ht.createElement(ne,{appearance:o}),n||re&&h?Q():Ht.createElement(Wo,{appearance:o,steps:Se(),selectedStep:H,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>Pe(V[H]),tooltipPosition:c,completedStepsCount:O(e),showHighlightOnly:a,onComplete:ye,...S}))};import Ie,{useEffect as Md,useRef as Ud,useState as zd}from"react";import{Portal as _d}from"react-portal";import Ft from"styled-components";var zs=Ft.button`
|
|
1396
|
+
${e=>k(e)} {
|
|
1355
1397
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1356
1398
|
|
|
1357
1399
|
display: flex;
|
|
@@ -1368,17 +1410,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1368
1410
|
opacity: 0.8;
|
|
1369
1411
|
}
|
|
1370
1412
|
}
|
|
1371
|
-
`,
|
|
1372
|
-
${e=>
|
|
1413
|
+
`,_s=Ft.span`
|
|
1414
|
+
${e=>k(e)} {
|
|
1373
1415
|
font-size: 12px;
|
|
1374
1416
|
display: inline-block;
|
|
1375
1417
|
}
|
|
1376
|
-
`,
|
|
1377
|
-
${e=>
|
|
1418
|
+
`,Ws=Ft.span`
|
|
1419
|
+
${e=>k(e)} {
|
|
1378
1420
|
font-size: 12px;
|
|
1379
1421
|
display: inline-block;
|
|
1380
1422
|
}
|
|
1381
|
-
`,
|
|
1423
|
+
`,Hs=Ft.div`
|
|
1382
1424
|
position: fixed;
|
|
1383
1425
|
right: 0;
|
|
1384
1426
|
bottom: 0;
|
|
@@ -1388,8 +1430,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1388
1430
|
flex-direction: column;
|
|
1389
1431
|
align-items: flex-end;
|
|
1390
1432
|
z-index: 50;
|
|
1391
|
-
`,
|
|
1392
|
-
${e=>
|
|
1433
|
+
`,Vs=Ft.button`
|
|
1434
|
+
${e=>k(e)} {
|
|
1393
1435
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1394
1436
|
background-color: #ffffff;
|
|
1395
1437
|
border: 1px solid #f5f5f5;
|
|
@@ -1404,8 +1446,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1404
1446
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1405
1447
|
border-radius: 45px;
|
|
1406
1448
|
cursor: pointer;
|
|
1407
|
-
`,
|
|
1408
|
-
${e=>
|
|
1449
|
+
`,js=Ft.div`
|
|
1450
|
+
${e=>k(e)} {
|
|
1409
1451
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1410
1452
|
background: #ffffff;
|
|
1411
1453
|
}
|
|
@@ -1421,8 +1463,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1421
1463
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1422
1464
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1423
1465
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1424
|
-
`,
|
|
1425
|
-
${e=>
|
|
1466
|
+
`,Gs=Ft.button`
|
|
1467
|
+
${e=>k(e)} {
|
|
1426
1468
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1427
1469
|
color: #434343;
|
|
1428
1470
|
:hover {
|
|
@@ -1438,8 +1480,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1438
1480
|
font-size: 14px;
|
|
1439
1481
|
|
|
1440
1482
|
padding: 8px 12px;
|
|
1441
|
-
`;import
|
|
1442
|
-
${e=>
|
|
1483
|
+
`;import Ks from"react";var qs=({style:e,className:t})=>Ks.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Ks.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 Ys from"react";var Xs=({style:e,className:t})=>Ys.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"},Ys.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 Wd=({flowId:e,style:t,onStepCompletion:o,visible:r=!0,type:i="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:a,getStepStatus:x,getNumberOfStepsCompleted:d,isLoading:h,targetingLogicShouldHideFlow:S}=ee(),{primaryCTAClickSideEffects:w}=ae(),P=Ud(null),[u,E]=zd(!1),{mergeAppearanceWithDefault:g}=oe();s=g(s),Md(()=>(document.addEventListener("click",T,!1),()=>{document.removeEventListener("click",T,!1)}),[]);let T=b=>{P.current&&!P.current.contains(b.target)&&E(!1)};if(h)return null;let N=p(e);if(!N||S(N))return null;let C=c(e);if(!C||!r)return null;function m(b,F){!b.completionCriteria&&(b.autoMarkCompleted||b.autoMarkCompleted===void 0)&&a(e,b.id),w(b),o&&o(b,F),E(!1)}function B(){return u&&Ie.createElement(js,{className:l("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:i},C.map((b,F)=>Ie.createElement(Gs,{className:l("floatingWidgetMenuItem",s),key:F,onClick:()=>m(b,F)},b.title)))}return i=="inline"?Ie.createElement("span",{ref:P},Ie.createElement(zs,{style:t,onClick:()=>{E(!u)},className:l("supportButton",s)},Ie.createElement(Ws,{className:l("supportIconContainer",s)},Ie.createElement(Xs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),Ie.createElement(_s,{className:l("supportButtonTitle",s)},n)),Ie.createElement(B,null)):Ie.createElement(_d,null,Ie.createElement(Hs,{style:t,ref:P},Ie.createElement(B,null),Ie.createElement(Vs,{onClick:()=>{E(!u)},whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},Ie.createElement(qs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import je,{useEffect as Hd}from"react";import Ho from"styled-components";var Js=Ho.div`
|
|
1484
|
+
${e=>k(e)} {
|
|
1443
1485
|
display: flex;
|
|
1444
1486
|
flex-direction: column;
|
|
1445
1487
|
width: 100%;
|
|
@@ -1453,18 +1495,18 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1453
1495
|
border-radius: 12px;
|
|
1454
1496
|
position: relative;
|
|
1455
1497
|
}
|
|
1456
|
-
`,
|
|
1498
|
+
`,Qs=Ho.div`
|
|
1457
1499
|
display: flex;
|
|
1458
1500
|
flex-direction: column;
|
|
1459
1501
|
flex: 1;
|
|
1460
|
-
`,
|
|
1502
|
+
`,Zs=Ho.div`
|
|
1461
1503
|
display: flex;
|
|
1462
1504
|
flex-direction: column;
|
|
1463
1505
|
justify-content: center;
|
|
1464
1506
|
align-items: flex-start;
|
|
1465
1507
|
margin-top: 16px;
|
|
1466
|
-
`,
|
|
1467
|
-
${e=>
|
|
1508
|
+
`,Rs=Ho.div`
|
|
1509
|
+
${e=>k(e)} {
|
|
1468
1510
|
position: absolute;
|
|
1469
1511
|
top: 16px;
|
|
1470
1512
|
right: 16px;
|
|
@@ -1474,9 +1516,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1474
1516
|
opacity: 0.8;
|
|
1475
1517
|
}
|
|
1476
1518
|
}
|
|
1477
|
-
`;var
|
|
1519
|
+
`;var Vd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:i,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:x,isLoading:d,targetingLogicShouldHideFlow:h,updateCustomVariables:S,getFlowSteps:w,getFlowStatus:P,getCurrentStepIndex:u}=ee(),{primaryCTAClickSideEffects:E}=ae(),{mergeAppearanceWithDefault:g}=oe();if(i=g(i),Hd(()=>{S(o)},[o,d]),d)return null;let T=c(e);if(!T||h(T)||P(e)===R)return null;let C=w(e)[u(e)];return je.createElement(je.Fragment,null,je.createElement(ne,{appearance:i}),je.createElement(Js,{appearance:i,className:we(l("embeddedTipContainer",i),n),style:s},(p===!0||C.dismissible)&&je.createElement(Rs,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",i)},je.createElement(Ee,null)),je.createElement(Qs,null,je.createElement(Te,{size:"small",appearance:i,title:C.title,subtitle:C.subtitle})),C.primaryButtonTitle&&je.createElement(Zs,{className:l("embeddedTipCallToActionContainer",i)},je.createElement(ie,{classPrefix:"embeddedTip",title:C.primaryButtonTitle,appearance:i,withMargin:!1,size:"small",type:"inline",onClick:async()=>{C.handlePrimaryButtonClick(),E(C),!(r&&r(C,u(e),"primary")===!1)&&(await x(e,C.id),await a(e))}}))))};import Ce,{useEffect as jd}from"react";import Vt from"styled-components";var el=Vt.div`
|
|
1478
1520
|
// use the :not annotation
|
|
1479
|
-
${e=>
|
|
1521
|
+
${e=>k(e)} {
|
|
1480
1522
|
display: flex;
|
|
1481
1523
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1482
1524
|
width: 100%;
|
|
@@ -1488,24 +1530,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1488
1530
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1489
1531
|
border-radius: 12px;
|
|
1490
1532
|
}
|
|
1491
|
-
`,
|
|
1492
|
-
${e=>
|
|
1533
|
+
`,tl=Vt.div`
|
|
1534
|
+
${e=>k(e)} {
|
|
1493
1535
|
display: flex;
|
|
1494
1536
|
width: 36px;
|
|
1495
1537
|
height: 36px;
|
|
1496
1538
|
}
|
|
1497
|
-
`,
|
|
1539
|
+
`,ol=Vt.div`
|
|
1498
1540
|
display: flex;
|
|
1499
1541
|
flex-direction: column;
|
|
1500
1542
|
flex: 1;
|
|
1501
1543
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1502
1544
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1503
|
-
`,
|
|
1545
|
+
`,rl=Vt.div`
|
|
1504
1546
|
display: flex;
|
|
1505
1547
|
flex-direction: column;
|
|
1506
1548
|
justify-content: center;
|
|
1507
1549
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1508
|
-
`,
|
|
1550
|
+
`,Tr=Vt.div`
|
|
1509
1551
|
display: flex;
|
|
1510
1552
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1511
1553
|
align-items: flex-end;
|
|
@@ -1514,13 +1556,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1514
1556
|
:hover {
|
|
1515
1557
|
opacity: 0.8;
|
|
1516
1558
|
}
|
|
1517
|
-
`,
|
|
1559
|
+
`,Fr=Vt.div`
|
|
1518
1560
|
display: flex;
|
|
1519
1561
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1520
1562
|
align-items: flex-end;
|
|
1521
1563
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1522
|
-
`;import
|
|
1523
|
-
${e=>
|
|
1564
|
+
`;import il from"react";var nl=({style:e,className:t})=>il.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"},il.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 Gd=({flowId:e,title:t,subtitle:o,onDismiss:r,customVariables:i,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:a,markFlowCompleted:x,isLoading:d,targetingLogicShouldHideFlow:h,updateCustomVariables:S,getFlowMetadata:w,getFlowStatus:P,getFlowSteps:u,getCurrentStepIndex:E}=ee(),{primaryCTAClickSideEffects:g}=ae(),{mergeAppearanceWithDefault:T}=oe();if(s=T(s),jd(()=>{S(i)},[i,d]),d)return null;let N=a(e);if(!N||h(N)||P(e)===R)return null;let C=u(e),m=C.length>0?C[E(e)]:w(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),Ce.createElement(Ce.Fragment,null,Ce.createElement(ne,{appearance:s}),Ce.createElement(el,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&Ce.createElement(tl,{className:l("bannerIconContainer",s)},c||Ce.createElement(nl,null)),p==="square"&&m.dismissible&&Ce.createElement(Fr,{type:p,className:l("bannerDismissButtonContainer",s)},Ce.createElement(Tr,{type:p,onClick:async()=>{await x(e),r&&r()},className:l("bannerDismissButton",s)},Ce.createElement(Ee,null))),Ce.createElement(ol,{type:p},Ce.createElement(Te,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),Ce.createElement(rl,{type:p,className:l("bannerCallToActionContainer",s)},Ce.createElement(ie,{title:(m==null?void 0:m.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{g(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&Ce.createElement(Fr,{type:p,className:l("bannerDismissButtonContainer",s)},Ce.createElement(Tr,{type:p,onClick:async()=>{await x(e),r&&r()},className:l("bannerDismissButton",s)},Ce.createElement(Ee,null)))))};import Y,{useEffect as Kd}from"react";import{Portal as qd}from"react-portal";import et from"styled-components";var sl=et.div`
|
|
1565
|
+
${e=>k(e)} {
|
|
1524
1566
|
display: flex;
|
|
1525
1567
|
flex-direction: column;
|
|
1526
1568
|
width: 100%;
|
|
@@ -1540,7 +1582,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1540
1582
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1541
1583
|
min-width: 550px;
|
|
1542
1584
|
}
|
|
1543
|
-
`,
|
|
1585
|
+
`,ll=et.button`
|
|
1544
1586
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1545
1587
|
border-radius: 8px;
|
|
1546
1588
|
// If selected make border color primary and text color color priamry
|
|
@@ -1561,31 +1603,31 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1561
1603
|
display: flex;
|
|
1562
1604
|
justify-content: center;
|
|
1563
1605
|
align-items: center;
|
|
1564
|
-
`,
|
|
1606
|
+
`,kr=et.div`
|
|
1565
1607
|
display: flex;
|
|
1566
1608
|
justify-content: flex-end;
|
|
1567
1609
|
margin-top: 16px;
|
|
1568
1610
|
gap: 8px;
|
|
1569
|
-
`,
|
|
1611
|
+
`,al=et.div`
|
|
1570
1612
|
display: flex;
|
|
1571
1613
|
justify-content: space-between;
|
|
1572
1614
|
margin-top: 8px;
|
|
1573
|
-
`,
|
|
1615
|
+
`,Pr=et.div`
|
|
1574
1616
|
font-size: 12px;
|
|
1575
1617
|
line-height: 16px;
|
|
1576
1618
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1577
|
-
`,
|
|
1619
|
+
`,vr=et.div`
|
|
1578
1620
|
display: flex;
|
|
1579
1621
|
flex-direction: column;
|
|
1580
1622
|
flex: 1;
|
|
1581
|
-
|
|
1623
|
+
`,wb=et.div`
|
|
1582
1624
|
display: flex;
|
|
1583
1625
|
flex-direction: column;
|
|
1584
1626
|
justify-content: center;
|
|
1585
1627
|
align-items: flex-start;
|
|
1586
1628
|
margin-top: 16px;
|
|
1587
|
-
`,
|
|
1588
|
-
${e=>
|
|
1629
|
+
`,pl=et.textarea`
|
|
1630
|
+
${e=>k(e)} {
|
|
1589
1631
|
margin-top: 16px;
|
|
1590
1632
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1591
1633
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1595,8 +1637,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1595
1637
|
width: 100%;
|
|
1596
1638
|
height: 100px;
|
|
1597
1639
|
}
|
|
1598
|
-
`,
|
|
1599
|
-
${e=>
|
|
1640
|
+
`,dl=et.div`
|
|
1641
|
+
${e=>k(e)} {
|
|
1600
1642
|
position: absolute;
|
|
1601
1643
|
top: 16px;
|
|
1602
1644
|
right: 16px;
|
|
@@ -1606,5 +1648,5 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Kt}${r}.${Kt}${r} { ${Object.entries(n).map
|
|
|
1606
1648
|
opacity: 0.8;
|
|
1607
1649
|
}
|
|
1608
1650
|
}
|
|
1609
|
-
`;var
|
|
1651
|
+
`;var Yd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:i,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:x,getNumberOfStepsCompleted:d,isLoading:h,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:u,getCurrentStepIndex:E}=ee(),{primaryCTAClickSideEffects:g}=ae(),{mergeAppearanceWithDefault:T}=oe(),[N,C]=Y.useState(null),[m,B]=Y.useState(""),{hasOpenModals:b,setKeepCompletedFlowOpenDuringSession:F,shouldKeepCompletedFlowOpenDuringSession:O}=ve();if(i=T(i),Kd(()=>{w(o)},[o,h]),h)return null;let I=c(e);if(!I||S(I)||u(e)===R||d(e)===1&&!O(e)||b())return null;let L=P(e)[E(e)];function _(){return Y.createElement(Y.Fragment,null,Y.createElement(vr,null,Y.createElement(Te,{size:"large",appearance:i,title:L.title,subtitle:L.subtitle})),Y.createElement(kr,{className:l("npsNumberButtonContainer",i),appearance:i},Array.from(Array(10).keys()).map(se=>Y.createElement(ll,{className:l("npsNumberButton",i),selected:N===se+1,key:se,onClick:async()=>{F(e),C(se+1),await x(e,L.id,{score:se+1})},appearance:i},se+1))),Y.createElement(al,{appearance:i},Y.createElement(Pr,{appearance:i},"Not likely at all"),Y.createElement(Pr,{appearance:i},"Extremely likely")))}function H(){return Y.createElement(Y.Fragment,null,Y.createElement(vr,null,Y.createElement(Te,{appearance:i,title:"Why did you choose this score?",size:"large"})),Y.createElement(pl,{appearance:i,value:m,onChange:se=>{B(se.target.value)},placeHolder:"Add your optional fedback here..."}),Y.createElement(kr,{appearance:i,className:l("npsNumberButtonContainer",i)},Y.createElement(ie,{size:"large",withMargin:!1,onClick:async()=>{await a(e),r&&r(L,1,"primary")},appearance:i,title:L.secondaryButtonTitle||"Skip",secondary:!0}),Y.createElement(ie,{size:"large",withMargin:!1,onClick:async()=>{await x(e,L.id,{feedbackText:m}),await a(e),r&&r(L,1,"primary")},appearance:i,title:L.primaryButtonTitle||"Submit"})))}function X(){return Y.createElement(Y.Fragment,null,Y.createElement(ne,{appearance:i}),Y.createElement(sl,{appearance:i,className:we(l("npsSurveyContainer",i),n),style:s,type:p},Y.createElement(dl,{onClick:async()=>{await a(e),t&&t()},className:l("npsSurveyDismissButton",i)},Y.createElement(Ee,null)),d(e)==0&&_(),d(e)==1&&H()))}return p==="inline"?X():Y.createElement(qd,null,X())};import*as Vo from"react";import cl from"react";var ml=({as:e="span",children:t,variant:o="Body1",...r})=>cl.createElement(ji,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...r},t),Xd=Object.fromEntries(Object.keys(Ao).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>cl.createElement(ml,{as:t,...r,variant:e},r.children);return o.displayName=`Text.${e}`,[e,o]})),Br=Object.assign(ml,Xd);var ul=({as:e="button",className:t,size:o="md",title:r,variant:i="Primary",...n})=>{var s;return Vo.createElement(Vi,{className:`fr-button-${i.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:i,size:o,borderRadius:"md",...n},Vo.createElement(Br,{color:(s=io[i])==null?void 0:s.color,fontWeight:"semibold"},r))},Jd=Object.fromEntries(Object.keys(io).map(e=>{let t=o=>Vo.createElement(ul,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),Qd=Object.assign(ul,Jd);export{ro as Box,Qd as Button,qe as CheckBox,it as FormLabel,Ro as FormTextField,Gd as FrigadeBanner,br as FrigadeChecklist,Ke as FrigadeDefaultAppearance,Vd as FrigadeEmbeddedTip,Li as FrigadeForm,wd as FrigadeGuide,Cd as FrigadeHeroChecklist,Yd as FrigadeNPSSurvey,yd as FrigadeProgressBadge,Bp as FrigadeProvider,Wd as FrigadeSupportWidget,$d as FrigadeTour,At as ProgressRing,Br as Text,mr as tokens,ve as useFlowOpens,Gt as useFlowResponses,ee as useFlows,pr as useOrganization,Kt as useUser,Be as useUserFlowStates};
|
|
1610
1652
|
//# sourceMappingURL=index.mjs.map
|