@frigade/react 1.32.56 → 1.32.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +44 -44
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +54 -54
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import{ThemeProvider as $a}from"styled-components";import ft,{useContext as La,useEffect as Fo,useState as Zo}from"react";import{useCallback as ct,useContext as nl,useEffect as sl}from"react";import Do,{useMemo as Ks}from"react";var gr="1.32.56 ";var Te="https://api.frigade.com/v1/public/",Ae="NOT_STARTED_STEP",Y="COMPLETED_FLOW",so="ABORTED_FLOW",dt="STARTED_FLOW",Le="NOT_STARTED_FLOW",Oe="COMPLETED_STEP",lo="STARTED_STEP";function Me(){let{publicApiKey:e,userId:t}=Do.useContext(q);return{config:Ks(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":gr,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}var Ys="frigade-last-call-at-",Xs="frigade-last-call-data-";function Tt(){let{shouldGracefullyDegrade:e}=Do.useContext(q);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),zt();let i=Ys+t,n=Xs+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(i),p=window.localStorage.getItem(n);if(s&&p&&p==o.body){let c=new Date(s);if(new Date().getTime()-c.getTime()<1e3)return zt()}window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(n,o.body)}let r;try{r=await fetch(t,o)}catch(s){return zt(s)}return r?r.ok?r:zt(r.statusText):zt()}}function zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ft(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Do.useContext(q);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as ol,useState as hr}from"react";import{useContext as Qs,useEffect as Zs,useState as Rs}from"react";import el from"swr";import{useContext as Js}from"react";function Pe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=Js(q);function r(d,u=!1){return e[d]??u}function s(d,u){t(y=>({...y,[d]:u}))}function p(d){t(u=>{let{[d]:y,...E}=u;return{...E}})}function c(d){n.includes(d)||i(u=>[...u,d])}function a(d){return n.includes(d)}function h(){return Object.values(e).some(d=>d)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:h,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}var tl="unknown";function Ie(){let{config:e}=Me(),{publicApiKey:t,userId:o,organizationId:i,flows:n,setShouldGracefullyDegrade:r}=Qs(q),{resetOpenFlowState:s}=Pe(),[p,c]=Rs(!1),a={data:n.map(S=>({flowId:S.id,flowState:Y,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},h=S=>fetch(S,e).then(m=>{if(m.ok)return m.json();throw new Error("Failed to fetch user flow states")}).catch(m=>(console.log(`Error fetching ${S}: ${m}. Will gracefully degrade and hide Frigade`),r(!0),a)),{data:d,isLoading:u,mutate:y,error:E}=el(t&&n&&o?`${Te}userFlowStates?foreignUserId=${encodeURIComponent(o)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,h,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>a,onLoadingSlow:()=>a}),f=d==null?void 0:d.data;Zs(()=>{!p&&!u&&f&&c(!0)},[f,p,u]);async function C(S){if(f){let m=f.find(x=>x.flowId===S);m&&m.flowState!==Y&&(m.flowState=Y),await y(Promise.resolve({...d,data:f}),{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}async function F(S,m,x){if(f){let b=f.find(N=>N.flowId===S);b&&(b.stepStates[m]=x,b.flowState=dt),await y(Promise.resolve({...d,data:f}),{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}async function k(S,m,x){if(f){let b=f.find(N=>N.flowId===S);b&&(b.lastStepId=m,b.stepStates[m]=x,b.flowState=dt),await y({...d,data:f},{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}async function B(S){if(f){let m=f.find(x=>x.flowId===S);m&&m.flowState!==Le&&(m.flowState=Le,m.lastStepId=tl,Object.keys(m.stepStates).forEach(x=>{m.stepStates[x].actionType=Ae,m.stepStates[x].createdAt=new Date().toISOString()}),await y({...d,data:f},{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1}),s(S))}}async function P(S,m){if(f){let x=f.find(b=>b.flowId===S);x&&x.stepStates[m]!==Ae&&(x.stepStates[m]=Ae),await y({...d,data:f},{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:f,isLoadingUserFlowStateData:!p,mutateUserFlowState:y,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:F,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:k,error:E}}function Wt(){let{config:e}=Me(),{userFlowStatesData:t,mutateUserFlowState:o}=Ie(),{failedFlowResponses:i,setFailedFlowResponses:n,flowResponses:r,setFlowResponses:s}=ol(q),[p,c]=hr(new Set),[a,h]=hr(new Set),d=Tt();function u(f){let C=JSON.stringify(f);if(p.has(C))return null;p.add(C),c(p),a.add(f),h(a);let F=r==null?void 0:r.find(k=>k.flowSlug===f.flowSlug&&k.stepId===f.stepId&&k.actionType===f.actionType&&k.createdAt===f.createdAt);return d(`${Te}flowResponses`,{...e,method:"POST",body:C}).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...i,f])):F||s(B=>[...B??[],f])})}async function y(f){f.foreignUserId&&(f.actionType===dt||f.actionType===Le?await u(f):f.actionType===Y?await u(f):f.actionType===lo?await u(f):f.actionType===Oe?await u(f):f.actionType===so?await u(f):f.actionType===Ae&&await u(f))}function E(){let f=[];return t==null||t.forEach(C=>{if(C&&C.stepStates&&Object.keys(C.stepStates).length!==0)for(let F in C.stepStates){let k=C.stepStates[F];f.push({foreignUserId:C.foreignUserId,flowSlug:C.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...f,...r]}return{addResponse:y,setFlowResponses:s,getFlowResponses:E}}import ll from"swr";var rl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,xr=e=>{let t=rl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=il(i,"'","");r.startsWith("flow_")&&(o=r)}),o},il=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Me(),{flows:t,setFlows:o,userId:i,publicApiKey:n,customVariables:r,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:c,setFlowResponses:a,setShouldGracefullyDegrade:h}=nl(q),d={data:[]},{verifySDKInitiated:u}=Ft(),{addResponse:y,getFlowResponses:E}=Wt(),f=g=>fetch(g,e).then(w=>w.ok?w.json():(console.log(`Error fetching ${g} (${w.status}): ${w.statusText}. .Will gracefully degrade and hide Frigade`),h(!0),d)).catch(w=>(console.log(`Error fetching ${g}: ${w}. Will gracefully degrade and hide Frigade`),h(!0),d)),{userFlowStatesData:C,isLoadingUserFlowStateData:F,optimisticallyMarkFlowCompleted:k,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:S,optimisticallyMarkStepStarted:m}=Ie(),{data:x,error:b,isLoading:N}=ll(n?`${Te}flows`:null,f,{keepPreviousData:!0});sl(()=>{if(b){console.error(b);return}x&&x.data&&(x.data=o(x.data))},[x,b]);function _(g){if(N)return null;let w=t.find(v=>v.slug===g);return!w&&t.length>0&&!F&&!N?(console.log(`Flow with slug ${g} not found`),null):(w==null?void 0:w.active)===!1?null:w}function z(g){var V;if(!_(g))return[];let w=_(g).data;return w?(w=A(w),(((V=JSON.parse(w))==null?void 0:V.data)??[]).map(de=>{let W=R(de);return{handleSecondaryButtonClick:()=>{de.skippable===!0&&D(g,de.id,{skipped:!0})},...de,complete:I(g,de.id)===Oe||W>=1,blocked:ne(g,de.id),hidden:fe(g,de.id),handlePrimaryButtonClick:()=>{(!de.completionCriteria&&(de.autoMarkCompleted||de.autoMarkCompleted===void 0)||de.completionCriteria&&de.autoMarkCompleted===!0)&&D(g,de.id)},progress:W}}).filter(de=>de.hidden!==!0)):[]}function A(g){return g.replace(/\${(.*?)}/g,(w,v)=>r[v]!==void 0?String(r[v]):"")}function U(g){if(!_(g))return[];let w=_(g).data;return w?(w=A(w),JSON.parse(w)??{}):[]}function $(g,w){s(v=>({...v,[g]:w}))}function O(g){!F&&!N&&g&&JSON.stringify(r)!=JSON.stringify({...r,...g})&&Object.keys(g).forEach(w=>{$(w,g[w])})}let ie=ct(async(g,w,v)=>{u();let V={foreignUserId:i,flowSlug:g,stepId:w,actionType:lo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(V)&&(await m(g,w,V),y(V))},[i,C]),pe=ct(async(g,w,v)=>{u();let V={foreignUserId:i,flowSlug:g,stepId:w,actionType:Ae,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(V)&&(await S(g,w),y(V))},[i,C]),D=ct(async(g,w,v)=>{u();let V={foreignUserId:i,flowSlug:g,stepId:w,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(V)&&(await P(g,w,V),y(V))},[i,C]),we=ct(async(g,w)=>{if(u(),K(g)===Le)return;let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:Le,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};await B(g),oe(v)&&y(v)},[i,C]),xe=ct(async(g,w)=>{u();let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:dt,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&y(v)},[i,C]),ee=ct(async(g,w)=>{u();let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:Y,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&(await k(g),y(v))},[i,C]),j=ct(async(g,w)=>{u();let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:so,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&(await k(g),y(v))},[i,C]);function oe(g){var w;if(!C&&g.actionType===Ae)return!1;if(C){let v=C.find(V=>V.flowId===g.flowSlug);if(g.actionType===Ae&&(!(v!=null&&v.stepStates[g.stepId])||v.stepStates[g.stepId].actionType===Ae)||v&&((w=v.stepStates[g.stepId])==null?void 0:w.actionType)===g.actionType||v&&v.flowState===Y&&g.actionType===Y)return!1}return!0}function I(g,w){let v=ke(g,w);return F?null:v?v.actionType:Ae}function ne(g,w){let v=ke(g,w);return v?v.blocked:!1}function fe(g,w){let v=ke(g,w);return v?v.hidden:!1}function ke(g,w){if(F)return null;let v=C==null?void 0:C.find(V=>V.flowId===g);return!v||!v.stepStates[w]?null:v.stepStates[w]??null}function G(g){var v;if(F||!C)return null;if(K(g)===Le)return z(g)[0]??null;let w=(v=C.find(V=>V.flowId===g))==null?void 0:v.lastStepId;return w?z(g).find(V=>V.id===w):null}function ge(g){let w=G(g);if(!w)return 0;let v=z(g).findIndex(V=>V.id===w.id)??0;return I(g,w.id)===Oe&&v<z(g).length-1?v+1:v}function R(g){if(!g.completionCriteria)return;let w=xr(g.completionCriteria);if(w===null)return;let v=je(w),V=Ge(w);return V===0?void 0:v/V}function K(g){let w=C==null?void 0:C.find(v=>v.flowId===g);return w?w.flowState:null}function je(g){let w=z(g);return w.length===0?0:w.filter(V=>I(g,V.id)===Oe).length}function Ge(g){return z(g).length}function wt(g){return JSON.parse(t.find(w=>w.slug===g).data)}function H(g){if(F)return!0;if(g!=null&&g.targetingLogic&&C){let w=C.find(v=>v.flowId===g.slug);if(w)return w.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&i&&i.startsWith("guest_"))}function Be(g){return!H(_(g))}return{getFlow:_,getFlowData:wt,isLoading:F||N,getStepStatus:I,getFlowSteps:z,getCurrentStepIndex:ge,markStepStarted:ie,markStepCompleted:D,markFlowNotStarted:we,markFlowStarted:xe,markFlowCompleted:ee,markFlowAborted:j,markStepNotStarted:pe,getFlowStatus:K,getNumberOfStepsCompleted:je,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:H,setCustomVariable:$,updateCustomVariables:O,customVariables:r,getStepOptionalProgress:R,getFlowMetadata:U,isStepBlocked:ne,isStepHidden:fe,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:c,isFlowAvailableToUser:Be}}import{useCallback as Cr,useContext as al,useEffect as pl}from"react";var kt="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=al(q),{config:r}=Me(),{mutateUserFlowState:s}=Ie(),p=Tt(),{verifySDKInitiated:c}=Ft();pl(()=>{if(e&&!t){if(e.startsWith(kt))return;let d=`frigade-user-registered-${e}`;localStorage.getItem(d)||(p(`${Te}users`,{...r,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(d,"true"))}},[e,n,t]);let a=Cr(async d=>{c();let u={foreignId:e,properties:d};await p(`${Te}users`,{...r,method:"POST",body:JSON.stringify(u)}),i(y=>({...y,...d})),s()},[e,r,n,s]),h=Cr(async(d,u)=>{c();let E={foreignId:e,events:[{event:d,properties:u}]};await p(`${Te}users`,{...r,method:"POST",body:JSON.stringify(E)}),s()},[e,r,s]);return{userId:e,setUserId:o,addPropertiesToUser:a,trackEventForUser:h}}import{v4 as Oa}from"uuid";import _e,{useEffect as Ba,useState as Aa}from"react";import De,{useEffect as hl}from"react";import mo from"styled-components";import dl from"react";import cl from"styled-components";var Sr="fr-",Vt="cfr-";function l(e,t){let o=`${Sr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Vt+e}return o}function T(e){if(!e.className||e.className.indexOf(Vt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Sr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function $o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function qe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${$o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function yr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ml=cl.div`
|
|
2
|
+
import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import{ThemeProvider as $a}from"styled-components";import ft,{useContext as La,useEffect as To,useState as Zo}from"react";import{useCallback as ct,useContext as nl,useEffect as sl}from"react";import Oo,{useMemo as Ks}from"react";var gr="1.32.57 ";var Te="https://api.frigade.com/v1/public/",Ae="NOT_STARTED_STEP",Y="COMPLETED_FLOW",so="ABORTED_FLOW",dt="STARTED_FLOW",Le="NOT_STARTED_FLOW",Oe="COMPLETED_STEP",lo="STARTED_STEP";function Me(){let{publicApiKey:e,userId:t}=Oo.useContext(q);return{config:Ks(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":gr,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}var Ys="frigade-last-call-at-",Xs="frigade-last-call-data-";function Tt(){let{shouldGracefullyDegrade:e}=Oo.useContext(q);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),zt();let i=Ys+t,n=Xs+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(i),p=window.localStorage.getItem(n);if(s&&p&&p==o.body){let c=new Date(s);if(new Date().getTime()-c.getTime()<1e3)return zt()}window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(n,o.body)}let r;try{r=await fetch(t,o)}catch(s){return zt(s)}return r?r.ok?r:zt(r.statusText):zt()}}function zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ft(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Oo.useContext(q);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as ol,useState as hr}from"react";import{useContext as Qs,useEffect as Zs,useState as Rs}from"react";import el from"swr";import{useContext as Js}from"react";function Pe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=Js(q);function r(d,u=!1){return e[d]??u}function s(d,u){t(y=>({...y,[d]:u}))}function p(d){t(u=>{let{[d]:y,...E}=u;return{...E}})}function c(d){n.includes(d)||i(u=>[...u,d])}function a(d){return n.includes(d)}function h(){return Object.values(e).some(d=>d)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:h,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}var tl="unknown";function Ie(){let{config:e}=Me(),{publicApiKey:t,userId:o,organizationId:i,flows:n,setShouldGracefullyDegrade:r}=Qs(q),{resetOpenFlowState:s}=Pe(),[p,c]=Rs(!1),a={data:n.map(S=>({flowId:S.id,flowState:Y,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},h=S=>fetch(S,e).then(m=>{if(m.ok)return m.json();throw new Error("Failed to fetch user flow states")}).catch(m=>(console.log(`Error fetching ${S}: ${m}. Will gracefully degrade and hide Frigade`),r(!0),a)),{data:d,isLoading:u,mutate:y,error:E}=el(t&&n&&o?`${Te}userFlowStates?foreignUserId=${encodeURIComponent(o)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,h,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>a,onLoadingSlow:()=>a}),f=d==null?void 0:d.data;Zs(()=>{!p&&!u&&f&&c(!0)},[f,p,u]);async function C(S){if(f){let m=f.find(x=>x.flowId===S);m&&m.flowState!==Y&&(m.flowState=Y),await y(Promise.resolve({...d,data:f}),{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}async function F(S,m,x){if(f){let b=f.find(N=>N.flowId===S);b&&(b.stepStates[m]=x,b.flowState=dt),await y(Promise.resolve({...d,data:f}),{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}async function k(S,m,x){if(f){let b=f.find(N=>N.flowId===S);b&&(b.lastStepId=m,b.stepStates[m]=x,b.flowState=dt),await y({...d,data:f},{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}async function B(S){if(f){let m=f.find(x=>x.flowId===S);m&&m.flowState!==Le&&(m.flowState=Le,m.lastStepId=tl,Object.keys(m.stepStates).forEach(x=>{m.stepStates[x].actionType=Ae,m.stepStates[x].createdAt=new Date().toISOString()}),await y({...d,data:f},{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1}),s(S))}}async function P(S,m){if(f){let x=f.find(b=>b.flowId===S);x&&x.stepStates[m]!==Ae&&(x.stepStates[m]=Ae),await y({...d,data:f},{optimisticData:{...d,data:f},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:f,isLoadingUserFlowStateData:!p,mutateUserFlowState:y,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:F,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:k,error:E}}function Wt(){let{config:e}=Me(),{userFlowStatesData:t,mutateUserFlowState:o}=Ie(),{failedFlowResponses:i,setFailedFlowResponses:n,flowResponses:r,setFlowResponses:s}=ol(q),[p,c]=hr(new Set),[a,h]=hr(new Set),d=Tt();function u(f){let C=JSON.stringify(f);if(p.has(C))return null;p.add(C),c(p),a.add(f),h(a);let F=r==null?void 0:r.find(k=>k.flowSlug===f.flowSlug&&k.stepId===f.stepId&&k.actionType===f.actionType&&k.createdAt===f.createdAt);return d(`${Te}flowResponses`,{...e,method:"POST",body:C}).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...i,f])):F||s(B=>[...B??[],f])})}async function y(f){f.foreignUserId&&(f.actionType===dt||f.actionType===Le?await u(f):f.actionType===Y?await u(f):f.actionType===lo?await u(f):f.actionType===Oe?await u(f):f.actionType===so?await u(f):f.actionType===Ae&&await u(f))}function E(){let f=[];return t==null||t.forEach(C=>{if(C&&C.stepStates&&Object.keys(C.stepStates).length!==0)for(let F in C.stepStates){let k=C.stepStates[F];f.push({foreignUserId:C.foreignUserId,flowSlug:C.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...f,...r]}return{addResponse:y,setFlowResponses:s,getFlowResponses:E}}import ll from"swr";var rl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,xr=e=>{let t=rl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=il(i,"'","");r.startsWith("flow_")&&(o=r)}),o},il=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Me(),{flows:t,setFlows:o,userId:i,publicApiKey:n,customVariables:r,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:c,setFlowResponses:a,setShouldGracefullyDegrade:h}=nl(q),d={data:[]},{verifySDKInitiated:u}=Ft(),{addResponse:y,getFlowResponses:E}=Wt(),f=g=>fetch(g,e).then(w=>w.ok?w.json():(console.log(`Error fetching ${g} (${w.status}): ${w.statusText}. .Will gracefully degrade and hide Frigade`),h(!0),d)).catch(w=>(console.log(`Error fetching ${g}: ${w}. Will gracefully degrade and hide Frigade`),h(!0),d)),{userFlowStatesData:C,isLoadingUserFlowStateData:F,optimisticallyMarkFlowCompleted:k,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:S,optimisticallyMarkStepStarted:m}=Ie(),{data:x,error:b,isLoading:N}=ll(n?`${Te}flows`:null,f,{keepPreviousData:!0});sl(()=>{if(b){console.error(b);return}x&&x.data&&(x.data=o(x.data))},[x,b]);function _(g){if(N)return null;let w=t.find(v=>v.slug===g);return!w&&t.length>0&&!F&&!N?(console.log(`Flow with slug ${g} not found`),null):(w==null?void 0:w.active)===!1?null:w}function z(g){var V;if(!_(g))return[];let w=_(g).data;return w?(w=A(w),(((V=JSON.parse(w))==null?void 0:V.data)??[]).map(de=>{let W=R(de);return{handleSecondaryButtonClick:()=>{de.skippable===!0&&D(g,de.id,{skipped:!0})},...de,complete:I(g,de.id)===Oe||W>=1,blocked:ne(g,de.id),hidden:fe(g,de.id),handlePrimaryButtonClick:()=>{(!de.completionCriteria&&(de.autoMarkCompleted||de.autoMarkCompleted===void 0)||de.completionCriteria&&de.autoMarkCompleted===!0)&&D(g,de.id)},progress:W}}).filter(de=>de.hidden!==!0)):[]}function A(g){return g.replace(/\${(.*?)}/g,(w,v)=>r[v]!==void 0?String(r[v]):"")}function U(g){if(!_(g))return[];let w=_(g).data;return w?(w=A(w),JSON.parse(w)??{}):[]}function $(g,w){s(v=>({...v,[g]:w}))}function O(g){!F&&!N&&g&&JSON.stringify(r)!=JSON.stringify({...r,...g})&&Object.keys(g).forEach(w=>{$(w,g[w])})}let ie=ct(async(g,w,v)=>{u();let V={foreignUserId:i,flowSlug:g,stepId:w,actionType:lo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(V)&&(await m(g,w,V),y(V))},[i,C]),pe=ct(async(g,w,v)=>{u();let V={foreignUserId:i,flowSlug:g,stepId:w,actionType:Ae,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(V)&&(await S(g,w),y(V))},[i,C]),D=ct(async(g,w,v)=>{u();let V={foreignUserId:i,flowSlug:g,stepId:w,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(V)&&(await P(g,w,V),y(V))},[i,C]),we=ct(async(g,w)=>{if(u(),K(g)===Le)return;let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:Le,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};await B(g),oe(v)&&y(v)},[i,C]),xe=ct(async(g,w)=>{u();let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:dt,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&y(v)},[i,C]),ee=ct(async(g,w)=>{u();let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:Y,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&(await k(g),y(v))},[i,C]),j=ct(async(g,w)=>{u();let v={foreignUserId:i,flowSlug:g,stepId:"unknown",actionType:so,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&(await k(g),y(v))},[i,C]);function oe(g){var w;if(!C&&g.actionType===Ae)return!1;if(C){let v=C.find(V=>V.flowId===g.flowSlug);if(g.actionType===Ae&&(!(v!=null&&v.stepStates[g.stepId])||v.stepStates[g.stepId].actionType===Ae)||v&&((w=v.stepStates[g.stepId])==null?void 0:w.actionType)===g.actionType||v&&v.flowState===Y&&g.actionType===Y)return!1}return!0}function I(g,w){let v=ke(g,w);return F?null:v?v.actionType:Ae}function ne(g,w){let v=ke(g,w);return v?v.blocked:!1}function fe(g,w){let v=ke(g,w);return v?v.hidden:!1}function ke(g,w){if(F)return null;let v=C==null?void 0:C.find(V=>V.flowId===g);return!v||!v.stepStates[w]?null:v.stepStates[w]??null}function G(g){var v;if(F||!C)return null;if(K(g)===Le)return z(g)[0]??null;let w=(v=C.find(V=>V.flowId===g))==null?void 0:v.lastStepId;return w?z(g).find(V=>V.id===w):null}function ge(g){let w=G(g);if(!w)return 0;let v=z(g).findIndex(V=>V.id===w.id)??0;return I(g,w.id)===Oe&&v<z(g).length-1?v+1:v}function R(g){if(!g.completionCriteria)return;let w=xr(g.completionCriteria);if(w===null)return;let v=je(w),V=Ge(w);return V===0?void 0:v/V}function K(g){let w=C==null?void 0:C.find(v=>v.flowId===g);return w?w.flowState:null}function je(g){let w=z(g);return w.length===0?0:w.filter(V=>I(g,V.id)===Oe).length}function Ge(g){return z(g).length}function wt(g){return JSON.parse(t.find(w=>w.slug===g).data)}function H(g){if(F)return!0;if(g!=null&&g.targetingLogic&&C){let w=C.find(v=>v.flowId===g.slug);if(w)return w.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&i&&i.startsWith("guest_"))}function Be(g){return!H(_(g))}return{getFlow:_,getFlowData:wt,isLoading:F||N,getStepStatus:I,getFlowSteps:z,getCurrentStepIndex:ge,markStepStarted:ie,markStepCompleted:D,markFlowNotStarted:we,markFlowStarted:xe,markFlowCompleted:ee,markFlowAborted:j,markStepNotStarted:pe,getFlowStatus:K,getNumberOfStepsCompleted:je,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:H,setCustomVariable:$,updateCustomVariables:O,customVariables:r,getStepOptionalProgress:R,getFlowMetadata:U,isStepBlocked:ne,isStepHidden:fe,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:c,isFlowAvailableToUser:Be}}import{useCallback as Cr,useContext as al,useEffect as pl}from"react";var kt="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=al(q),{config:r}=Me(),{mutateUserFlowState:s}=Ie(),p=Tt(),{verifySDKInitiated:c}=Ft();pl(()=>{if(e&&!t){if(e.startsWith(kt))return;let d=`frigade-user-registered-${e}`;localStorage.getItem(d)||(p(`${Te}users`,{...r,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(d,"true"))}},[e,n,t]);let a=Cr(async d=>{c();let u={foreignId:e,properties:d};await p(`${Te}users`,{...r,method:"POST",body:JSON.stringify(u)}),i(y=>({...y,...d})),s()},[e,r,n,s]),h=Cr(async(d,u)=>{c();let E={foreignId:e,events:[{event:d,properties:u}]};await p(`${Te}users`,{...r,method:"POST",body:JSON.stringify(E)}),s()},[e,r,s]);return{userId:e,setUserId:o,addPropertiesToUser:a,trackEventForUser:h}}import{v4 as Oa}from"uuid";import _e,{useEffect as Ba,useState as Aa}from"react";import De,{useEffect as hl}from"react";import co from"styled-components";import dl from"react";import cl from"styled-components";var Sr="fr-",Vt="cfr-";function l(e,t){let o=`${Sr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Vt+e}return o}function T(e){if(!e.className||e.className.indexOf(Vt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Sr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Do(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function qe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Do(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function yr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ml=cl.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,br=({onClose:e,appearance:t})=>dl.createElement(ml,{className:l("modalBackground",t),onClick:()=>e()});import
|
|
26
|
+
`,br=({onClose:e,appearance:t})=>dl.createElement(ml,{className:l("modalBackground",t),onClick:()=>e()});import $o from"react";import ul from"styled-components";var fl=ul.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,ve=()
|
|
30
|
+
`,ve=()=>$o.createElement(fl,null,$o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},$o.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as xl}from"react-portal";import Lr from"react";import Mo from"react";function gl({style:e,className:t}){return Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Mo.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"}),Mo.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 wr=gl;import Uo from"styled-components";import tt from"styled-components";var ao=tt.div`
|
|
31
31
|
${e=>T(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -42,8 +42,8 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
45
|
-
top:
|
|
46
|
-
right:
|
|
45
|
+
top: 12px;
|
|
46
|
+
right: 12px;
|
|
47
47
|
`,Fr=tt.img`
|
|
48
48
|
${e=>T(e)} {
|
|
49
49
|
display: block;
|
|
@@ -104,7 +104,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
104
104
|
align-items: center;
|
|
105
105
|
justify-content: center;
|
|
106
106
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
107
|
-
`,Ir=Uo(
|
|
107
|
+
`,Ir=Uo(ao)`
|
|
108
108
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
109
109
|
position: absolute;
|
|
110
110
|
bottom: -60px;
|
|
@@ -126,7 +126,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
126
126
|
font-size: 12px;
|
|
127
127
|
line-height: 18px;
|
|
128
128
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
129
|
-
`;function
|
|
129
|
+
`;function po({appearance:e}){return Lr.createElement(Nr,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Lr.createElement(wr,null))}var Cl=co.div`
|
|
130
130
|
${e=>T(e)} {
|
|
131
131
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
132
132
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -168,10 +168,10 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
168
168
|
opacity: 1;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
`,Sl=
|
|
171
|
+
`,Sl=co.div`
|
|
172
172
|
position: relative;
|
|
173
173
|
flex: 0 1 auto;
|
|
174
|
-
`,yl=
|
|
174
|
+
`,yl=co.div`
|
|
175
175
|
position: absolute;
|
|
176
176
|
top: 24px;
|
|
177
177
|
right: 24px;
|
|
@@ -181,14 +181,14 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
181
181
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
182
182
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
183
183
|
}
|
|
184
|
-
`,bl=
|
|
184
|
+
`,bl=co.div`
|
|
185
185
|
overflow: scroll;
|
|
186
186
|
flex: 1 1;
|
|
187
187
|
display: flex;
|
|
188
188
|
::-webkit-scrollbar {
|
|
189
189
|
display: none;
|
|
190
190
|
}
|
|
191
|
-
`,ot=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>(hl(()=>{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?De.createElement(xl,null,De.createElement(br,{appearance:r,onClose:()=>{s&&e()}}),De.createElement(Cl,{appearance:r,className:l("modalContainer",r),styleOverrides:i},s&&De.createElement(yl,{className:l("modalClose",r),onClick:()=>e(),appearance:r},De.createElement(ve,null)),o&&De.createElement(Sl,null,o),De.createElement(bl,null,n),p&&De.createElement(Ar,{appearance:r,className:l("poweredByFrigadeRibbon",r)},De.createElement(
|
|
191
|
+
`,ot=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>(hl(()=>{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?De.createElement(xl,null,De.createElement(br,{appearance:r,onClose:()=>{s&&e()}}),De.createElement(Cl,{appearance:r,className:l("modalContainer",r),styleOverrides:i},s&&De.createElement(yl,{className:l("modalClose",r),onClick:()=>e(),appearance:r},De.createElement(ve,null)),o&&De.createElement(Sl,null,o),De.createElement(bl,null,n),p&&De.createElement(Ar,{appearance:r,className:l("poweredByFrigadeRibbon",r)},De.createElement(po,{appearance:r})))):De.createElement(De.Fragment,null));import rt,{useEffect as wl}from"react";import mo from"styled-components";import{Portal as Tl}from"react-portal";var Fl=mo.div`
|
|
192
192
|
${e=>T(e)} {
|
|
193
193
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
194
194
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -206,10 +206,10 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
206
206
|
bottom: 0;
|
|
207
207
|
margin-right: 28px;
|
|
208
208
|
margin-bottom: 28px;
|
|
209
|
-
`,kl=
|
|
209
|
+
`,kl=mo.div`
|
|
210
210
|
position: relative;
|
|
211
211
|
flex: 1;
|
|
212
|
-
`,Pl=
|
|
212
|
+
`,Pl=mo.div`
|
|
213
213
|
position: absolute;
|
|
214
214
|
top: 24px;
|
|
215
215
|
right: 24px;
|
|
@@ -219,13 +219,13 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
221
221
|
}
|
|
222
|
-
`,vl=
|
|
222
|
+
`,vl=mo.div`
|
|
223
223
|
overflow: scroll;
|
|
224
224
|
flex: 5;
|
|
225
225
|
::-webkit-scrollbar {
|
|
226
226
|
display: none;
|
|
227
227
|
}
|
|
228
|
-
`,Or=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n})=>(wl(()=>{let r=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",r),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",r)}},[e,t]),t?rt.createElement(Tl,null,rt.createElement(Fl,{appearance:n,className:l("cornerModalContainer",n)},rt.createElement(Pl,{className:l("cornerModalClose",n),onClick:()=>e()},rt.createElement(ve,null)),o&&rt.createElement(kl,null,o),rt.createElement(vl,null,i))):rt.createElement(rt.Fragment,null));import{useContext as El}from"react";function J(){let{defaultAppearance:e}=El(q);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Kt,{useEffect as Zl,useState as jo}from"react";import Go from"styled-components";import
|
|
228
|
+
`,Or=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n})=>(wl(()=>{let r=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",r),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",r)}},[e,t]),t?rt.createElement(Tl,null,rt.createElement(Fl,{appearance:n,className:l("cornerModalContainer",n)},rt.createElement(Pl,{className:l("cornerModalClose",n),onClick:()=>e()},rt.createElement(ve,null)),o&&rt.createElement(kl,null,o),rt.createElement(vl,null,i))):rt.createElement(rt.Fragment,null));import{useContext as El}from"react";function J(){let{defaultAppearance:e}=El(q);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Kt,{useEffect as Zl,useState as jo}from"react";import Go from"styled-components";import go,{useEffect as Bl,useState as zr}from"react";import Wo from"styled-components";import uo from"styled-components";var Dr=uo.label`
|
|
229
229
|
${e=>T(e)} {
|
|
230
230
|
font-size: 14px;
|
|
231
231
|
line-height: 20px;
|
|
@@ -233,14 +233,14 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
233
233
|
margin-top: 10px;
|
|
234
234
|
}
|
|
235
235
|
display: flex;
|
|
236
|
-
`,$r=
|
|
236
|
+
`,$r=uo.label`
|
|
237
237
|
${e=>T(e)} {
|
|
238
238
|
font-size: 12px;
|
|
239
239
|
line-height: 20px;
|
|
240
240
|
margin-bottom: 5px;
|
|
241
241
|
}
|
|
242
242
|
display: flex;
|
|
243
|
-
`,Mr=
|
|
243
|
+
`,Mr=uo.span`
|
|
244
244
|
font-weight: 400;
|
|
245
245
|
font-size: 14px;
|
|
246
246
|
line-height: 22px;
|
|
@@ -248,12 +248,12 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
248
248
|
display: flex;
|
|
249
249
|
margin-right: 5px;
|
|
250
250
|
margin-top: 10px;
|
|
251
|
-
`,
|
|
251
|
+
`,fo=uo.div`
|
|
252
252
|
display: flex;
|
|
253
253
|
align-items: flex-start;
|
|
254
254
|
justify-content: left;
|
|
255
255
|
margin-bottom: 10px;
|
|
256
|
-
`;import _o from"react";var Ke={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",colorTextError:"#c00000",borderRadius:20}};function it({title:e,required:t,appearance:o=Ke}){return e?_o.createElement(
|
|
256
|
+
`;import _o from"react";var Ke={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",colorTextError:"#c00000",borderRadius:20}};function it({title:e,required:t,appearance:o=Ke}){return e?_o.createElement(fo,null,t?_o.createElement(Mr,{className:l("formLabelRequired",o),appearance:o},"*"):null,_o.createElement(Dr,{className:l("formLabel",o)},e)):null}import Ur from"react";function Pt({title:e,appearance:t}){return e?Ur.createElement(fo,null,Ur.createElement($r,{className:l("formSubLabel",t)},e)):null}import{z as zo}from"zod";function _r(e,t){try{if(t){if(t.type=="number"){let o=zo.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=zo.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof zo.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 Al=Wo.div`
|
|
257
257
|
display: flex;
|
|
258
258
|
flex-direction: column;
|
|
259
259
|
width: 100%;
|
|
@@ -289,7 +289,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
289
289
|
min-height: 70px;
|
|
290
290
|
box-sizing: border-box;
|
|
291
291
|
margin-bottom: 10px;
|
|
292
|
-
`;function Vo({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,p]=zr((n==null?void 0:n.text)||""),[c,a]=zr(!1),h=Ho;Bl(()=>{s===""&&!c&&(a(!0),d(""))},[]);function d(y){if(p(y),o({text:y}),r.required===!0&&y.trim()===""){i([{id:r.id,message:`${r.title} is required`}]);return}let E=_r(y,r.validation);if(E){i([{id:r.id,message:E}]);return}i([])}r.multiline&&(h=Il);function u(){var y;switch((y=r==null?void 0:r.validation)==null?void 0:y.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return
|
|
292
|
+
`;function Vo({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,p]=zr((n==null?void 0:n.text)||""),[c,a]=zr(!1),h=Ho;Bl(()=>{s===""&&!c&&(a(!0),d(""))},[]);function d(y){if(p(y),o({text:y}),r.required===!0&&y.trim()===""){i([{id:r.id,message:`${r.title} is required`}]);return}let E=_r(y,r.validation);if(E){i([{id:r.id,message:E}]);return}i([])}r.multiline&&(h=Il);function u(){var y;switch((y=r==null?void 0:r.validation)==null?void 0:y.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return go.createElement(Al,null,go.createElement(it,{title:r.title,required:r.required,appearance:t.appearance}),go.createElement(h,{className:l("inputComponent",t.appearance),value:s,onChange:y=>{d(y.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:u()}),go.createElement(Pt,{title:r.subtitle,appearance:t.appearance}))}import Ue,{useEffect as Wr,useState as Hr}from"react";import Vr from"styled-components";var Nl=Vr.div`
|
|
293
293
|
display: flex;
|
|
294
294
|
flex-direction: column;
|
|
295
295
|
width: 100%;
|
|
@@ -319,7 +319,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
319
319
|
background-repeat: no-repeat;
|
|
320
320
|
background-size: 1.5em 1.5em;
|
|
321
321
|
-webkit-print-color-adjust: exact;
|
|
322
|
-
`,
|
|
322
|
+
`,ho="null";function jr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var h,d,u,y,E,f;let r=e,[s,p]=Hr(((h=i==null?void 0:i.choice)==null?void 0:h[0])||""),[c,a]=Hr(!1);return Wr(()=>{var C,F,k,B;if(s===""&&!c){if(a(!0),r.requireSelection){p(ho);return}if(r.defaultValue&&((C=r.props.options)!=null&&C.find(P=>P.id===r.defaultValue))){let P=(F=r.props.options)==null?void 0:F.find(S=>S.id===r.defaultValue);p(P.id),o({choice:[P.id]})}else p(((k=r.props.options)==null?void 0:k[0].id)||""),o({choice:[((B=r.props.options)==null?void 0:B[0].id)||""]})}},[]),Wr(()=>{r.requireSelection&&s===ho?n([{message:"Please select an option",id:r.id}]):n([])},[s]),Ue.createElement(Nl,null,Ue.createElement(it,{title:r.title,required:!1,appearance:t.appearance}),Ue.createElement(Ll,{value:s,onChange:C=>{p(C.target.value),o({choice:[C.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},r.requireSelection&&Ue.createElement("option",{key:ho,value:ho},"Select an option"),(d=r.props.options)==null?void 0:d.map(C=>Ue.createElement("option",{key:C.id,value:C.id},C.title))),((y=(u=r.props.options)==null?void 0:u.find(C=>C.id===s))==null?void 0:y.isOpenEnded)&&Ue.createElement(Ue.Fragment,null,Ue.createElement(it,{title:((f=(E=r.props.options)==null?void 0:E.find(C=>C.id===s))==null?void 0:f.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Ue.createElement(Ho,{type:"text",placeholder:"Enter your answer here",onChange:C=>{o({choice:[C.target.value]})},appearance:t.appearance})),Ue.createElement(Pt,{title:r.subtitle,appearance:t.appearance}))}import qt,{useEffect as qr,useState as Kr}from"react";import Yr from"styled-components";import Gt from"react";import jt from"react";import{motion as Ol}from"framer-motion";var Gr=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:n,transition:s},show:{strokeDashoffset:r,transition:s}};return jt.createElement(Ol.circle,{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Dl=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>jt.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},jt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},jt.createElement(Gr,{color:n,size:t}),jt.createElement(Gr,{color:e,percentage:o,size:t})),i),vt=Dl;import $l from"styled-components";var Ml=({color:e="#FFFFFF"})=>Gt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ul={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},_l={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},zl={border:"1px solid #000000",color:"#FFFFFF"},Wl={border:"1px solid #E6E6E6"},Hl={color:"#FFFFFF"},Vl={border:"3px solid #D9D9D9"},jl=e=>e==="square"?Ul:_l,Gl=(e,t)=>e==="square"?t?zl:Wl:t?Hl:Vl,ql=$l.div`
|
|
323
323
|
${e=>qe(e)}
|
|
324
324
|
`,Ye=({value:e,type:t="square",primaryColor:o="#000000",progress:i,appearance:n=Ke,style:r,className:s})=>{let p=jl(t),c=Gl(t,e);return e===!0?p={...p,...c,backgroundColor:o,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?Gt.createElement(vt,{fillColor:o,percentage:i,size:22}):Gt.createElement(ql,{styleOverrides:p,style:r,role:"checkbox",className:Ce(l("checkIconContainer",n),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Gt.createElement(Ml,{color:"#FFFFFF"}))};var Kl=Yr.div`
|
|
325
325
|
display: flex;
|
|
@@ -352,7 +352,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
352
352
|
height: 60px;
|
|
353
353
|
padding: 0 18px;
|
|
354
354
|
margin-bottom: 10px;
|
|
355
|
-
`;function Xr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i}){var a;let n=e,[r,s]=Kr((i==null?void 0:i.choice)||[]),[p,c]=Kr(!1);return qr(()=>{r.length==0&&!p&&(c(!0),o({choice:[]}))},[]),qr(()=>{o({choice:r})},[r]),qt.createElement(Kl,null,qt.createElement(it,{title:n.title,required:n.required,appearance:t.appearance}),(a=n.props.options)==null?void 0:a.map(h=>qt.createElement(Yl,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:h.id,value:h.id,"data-selected":r.includes(h.id),onClick:()=>{if(r.includes(h.id)){s(r.filter(d=>d!==h.id));return}r.length<n.props.maxChoices?s([...r,h.id]):r.length==1&&n.props.maxChoices==1&&s([h.id])}},h.title,qt.createElement(Ye,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:r.includes(h.id),appearance:t.appearance}))),qt.createElement(Pt,{title:n.subtitle,appearance:t.appearance}))}import
|
|
355
|
+
`;function Xr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i}){var a;let n=e,[r,s]=Kr((i==null?void 0:i.choice)||[]),[p,c]=Kr(!1);return qr(()=>{r.length==0&&!p&&(c(!0),o({choice:[]}))},[]),qr(()=>{o({choice:r})},[r]),qt.createElement(Kl,null,qt.createElement(it,{title:n.title,required:n.required,appearance:t.appearance}),(a=n.props.options)==null?void 0:a.map(h=>qt.createElement(Yl,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:h.id,value:h.id,"data-selected":r.includes(h.id),onClick:()=>{if(r.includes(h.id)){s(r.filter(d=>d!==h.id));return}r.length<n.props.maxChoices?s([...r,h.id]):r.length==1&&n.props.maxChoices==1&&s([h.id])}},h.title,qt.createElement(Ye,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:r.includes(h.id),appearance:t.appearance}))),qt.createElement(Pt,{title:n.subtitle,appearance:t.appearance}))}import xo from"react";import Jr from"styled-components";import Xl from"dompurify";function ce(e){return{__html:Xl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Jl=Jr.h1`
|
|
356
356
|
${e=>T(e)} {
|
|
357
357
|
font-style: normal;
|
|
358
358
|
font-weight: 600;
|
|
@@ -371,7 +371,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
371
371
|
line-height: 20px;
|
|
372
372
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
373
373
|
}
|
|
374
|
-
`;function Se({appearance:e,title:t,subtitle:o,size:i="medium"}){return
|
|
374
|
+
`;function Se({appearance:e,title:t,subtitle:o,size:i="medium"}){return xo.createElement(xo.Fragment,null,xo.createElement(Jl,{appearance:e,className:l(`${i}Title`,e),dangerouslySetInnerHTML:ce(t),size:i}),o&&xo.createElement(Ql,{appearance:e,className:l(`${i}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:i}))}var Rl=Go.div`
|
|
375
375
|
display: flex;
|
|
376
376
|
flex-direction: column;
|
|
377
377
|
justify-content: flex-end;
|
|
@@ -454,7 +454,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
454
454
|
opacity: 0.3;
|
|
455
455
|
cursor: not-allowed;
|
|
456
456
|
}
|
|
457
|
-
`,
|
|
457
|
+
`,Co=ni.div`
|
|
458
458
|
${e=>T(e)} {
|
|
459
459
|
display: flex;
|
|
460
460
|
flex-direction: row;
|
|
@@ -514,7 +514,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
514
514
|
margin-top: 12px;
|
|
515
515
|
margin-bottom: 16px;
|
|
516
516
|
max-width: 70%;
|
|
517
|
-
`;function ai({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=re();return ut.createElement("div",null,ut.createElement(ma,null,e.title),ut.createElement(ua,null,e.subtitle),ut.createElement(aa,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>ut.createElement(pa,{key:r.title},ut.createElement(da,{src:r.imageUri}),ut.createElement(ca,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{r.uri&&o(r.uri,r.uriTarget??"_blank")}},r.title)))))}import At,{useEffect as ya}from"react";import
|
|
517
|
+
`;function ai({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=re();return ut.createElement("div",null,ut.createElement(ma,null,e.title),ut.createElement(ua,null,e.subtitle),ut.createElement(aa,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>ut.createElement(pa,{key:r.title},ut.createElement(da,{src:r.imageUri}),ut.createElement(ca,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{r.uri&&o(r.uri,r.uriTarget??"_blank")}},r.title)))))}import At,{useEffect as ya}from"react";import bo from"styled-components";import Ko from"react";var So=({style:e,className:t})=>Ko.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},Ko.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Ko.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Yt,{useRef as fa,useState as ga}from"react";import yo from"styled-components";var ha=yo.div`
|
|
518
518
|
display: flex;
|
|
519
519
|
align-items: center;
|
|
520
520
|
justify-content: flex-start;
|
|
@@ -522,7 +522,7 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
522
522
|
width: 100%;
|
|
523
523
|
height: 100%;
|
|
524
524
|
position: relative;
|
|
525
|
-
`,xa=
|
|
525
|
+
`,xa=yo.div`
|
|
526
526
|
position: absolute;
|
|
527
527
|
display: flex;
|
|
528
528
|
align-items: center;
|
|
@@ -541,34 +541,34 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
541
541
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
542
542
|
border-radius: 50%;
|
|
543
543
|
}
|
|
544
|
-
`,Ca=
|
|
544
|
+
`,Ca=yo.video`
|
|
545
545
|
width: 100%;
|
|
546
546
|
height: 100%;
|
|
547
547
|
min-height: 200px;
|
|
548
548
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
549
|
-
`,Sa=
|
|
549
|
+
`,Sa=yo.iframe`
|
|
550
550
|
width: 100%;
|
|
551
551
|
height: 100%;
|
|
552
552
|
min-height: 200px;
|
|
553
553
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
554
|
-
`;function Bt({appearance:e,videoUri:t}){let o=fa(),[i,n]=ga(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Yt.createElement(Sa,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Yt.createElement(ha,{appearance:e},!i&&Yt.createElement(xa,{onClick:()=>{n(!0),o.current.play()},appearance:e},Yt.createElement(
|
|
554
|
+
`;function Bt({appearance:e,videoUri:t}){let o=fa(),[i,n]=ga(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Yt.createElement(Sa,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Yt.createElement(ha,{appearance:e},!i&&Yt.createElement(xa,{onClick:()=>{n(!0),o.current.play()},appearance:e},Yt.createElement(So,null)),Yt.createElement(Ca,{appearance:e,controls:i,ref:o,play:i,src:t}))}var ba=bo.div`
|
|
555
555
|
${e=>T(e)} {
|
|
556
556
|
display: flex;
|
|
557
557
|
flex-direction: column;
|
|
558
558
|
justify-content: center;
|
|
559
559
|
}
|
|
560
|
-
`,wa=
|
|
560
|
+
`,wa=bo.img`
|
|
561
561
|
${e=>T(e)} {
|
|
562
562
|
width: 100%;
|
|
563
563
|
height: auto;
|
|
564
564
|
max-height: 250px;
|
|
565
565
|
margin-bottom: 24px;
|
|
566
566
|
}
|
|
567
|
-
`,Ta=
|
|
567
|
+
`,Ta=bo.div`
|
|
568
568
|
${e=>T(e)} {
|
|
569
569
|
margin-bottom: 24px;
|
|
570
570
|
}
|
|
571
|
-
`,Fa=
|
|
571
|
+
`,Fa=bo.div`
|
|
572
572
|
${e=>T(e)} {
|
|
573
573
|
width: 100%;
|
|
574
574
|
height: auto;
|
|
@@ -628,8 +628,8 @@ import gt,{createContext as Da,useEffect as Ro,useState as Ne}from"react";import
|
|
|
628
628
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
629
629
|
display: flex;
|
|
630
630
|
align-self: center;
|
|
631
|
-
`;var Ci=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=Xo([]),[p,c]=Xo(!1),[a,h]=Xo(e.id);return Yo(()=>{r.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),Yo(()=>{a!==e.id&&(h(e.id),s([]))},[e]),Yo(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),Xe.createElement(di,{className:l("selectListContainer",i)},Xe.createElement(ci,null,Xe.createElement(mi,{className:l("selectListTitle",i)},e.title),Xe.createElement(ui,{appearance:i,className:l("selectListSubtitle",i)},e.subtitle)),n.options.map((d,u)=>{let y=r.includes(d.id);return Xe.createElement(fi,{key:`select-item-${u}`,onClick:()=>{if(r.includes(d.id)){s(r.filter(E=>E!==d.id));return}r.length<n.maxChoices?s([...r,d.id]):r.length==1&&n.maxChoices==1&&s([d.id])},hideBottomBorder:u===n.options.length-1,className:l("selectListSelectItem",i)},Xe.createElement(gi,{className:l("selectListItemImage",i)},d.imageUri&&Xe.createElement(hi,{src:d.imageUri,alt:`select-icon-${u}`}),Xe.createElement(xi,{appearance:i,className:l("selectListSelectItemText",i)},d.title)),Xe.createElement(Ye,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import ye,{useEffect as Jo,useState as Xt}from"react";import{AnimatePresence as ka,motion as Pa}from"framer-motion";var va=({children:e,id:t,shouldWrap:o=!1})=>ye.createElement(ye.Fragment,null,o?ye.createElement(ka,{initial:!1},ye.createElement(Pa.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),
|
|
632
|
-
${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map(([s,p])=>`${
|
|
631
|
+
`;var Ci=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=Xo([]),[p,c]=Xo(!1),[a,h]=Xo(e.id);return Yo(()=>{r.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),Yo(()=>{a!==e.id&&(h(e.id),s([]))},[e]),Yo(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),Xe.createElement(di,{className:l("selectListContainer",i)},Xe.createElement(ci,null,Xe.createElement(mi,{className:l("selectListTitle",i)},e.title),Xe.createElement(ui,{appearance:i,className:l("selectListSubtitle",i)},e.subtitle)),n.options.map((d,u)=>{let y=r.includes(d.id);return Xe.createElement(fi,{key:`select-item-${u}`,onClick:()=>{if(r.includes(d.id)){s(r.filter(E=>E!==d.id));return}r.length<n.maxChoices?s([...r,d.id]):r.length==1&&n.maxChoices==1&&s([d.id])},hideBottomBorder:u===n.options.length-1,className:l("selectListSelectItem",i)},Xe.createElement(gi,{className:l("selectListItemImage",i)},d.imageUri&&Xe.createElement(hi,{src:d.imageUri,alt:`select-icon-${u}`}),Xe.createElement(xi,{appearance:i,className:l("selectListSelectItemText",i)},d.title)),Xe.createElement(Ye,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import ye,{useEffect as Jo,useState as Xt}from"react";import{AnimatePresence as ka,motion as Pa}from"framer-motion";var va=({children:e,id:t,shouldWrap:o=!1})=>ye.createElement(ye.Fragment,null,o?ye.createElement(ka,{initial:!1},ye.createElement(Pa.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),wo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:a,onComplete:h,setVisible:d,setShowModal:u,onDismiss:y,showPagination:E=!1,customFormElements:f,allowBackNavigation:C,validationHandler:F})=>{var ke;let B={...{linkCollection:ai,multiInput:Qr,callToAction:pi,selectList:Ci},...i},{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:S}=re(),[m,x]=Xt(!1),[b,N]=Xt({}),[_,z]=Xt(!1),[A,U]=Xt(!1),[$,O]=Xt(null),ie=t[o]??null,{markStepCompleted:pe,markStepStarted:D,isLoading:we,updateCustomVariables:xe,markFlowCompleted:ee}=X();Jo(()=>{xe(n)},[n,we]),Jo(()=>{window&&C&&!A&&(window.location.hash=t[o].id,U(!0))},[C,A,U]),Jo(()=>{var G;if(window&&((G=window==null?void 0:window.location)!=null&&G.hash)&&window.location.hash.replace("#","")!==t[o].id){let ge=window.location.hash.replace("#",""),R=t.findIndex(K=>K.id===ge);R!==-1&&D(p,t[R].id)}},[(ke=window==null?void 0:window.location)==null?void 0:ke.hash,D,o,t]);function j(){return{data:b[t[o].id]??{},stepId:t[o].id,customVariables:n}}function oe(G,ge,R){let K=o+1<t.length?t[o+1]:null;r&&r(G,o,ge,K),s&&s(G,R,K,b,j())}function I(G,ge){N(R=>{let K={};return K[G.id]=ge,{...R,...K}})}function ne(G){return G.selectedStep.imageUri?ye.createElement(ii,{image:G.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let fe=ye.createElement(si,{step:t[o],canContinue:m&&!_,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(z(!0),F){let ge=await F(t[o],o,t[o+1],b,j());if(ge){O(ge),z(!1);return}else O(null)}let G={...j()};await pe(p,t[o].id,G),o+1<t.length&&await D(p,t[o+1].id),oe(t[o],"primary",o),o+1>=t.length&&(h&&h(),y&&y(),a&&(d&&d(!1),u(!1)),await ee(p)),P(t[o]),z(!1),window&&C&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{oe(t[o],"secondary",o),S(t[o])},onBack:async()=>{o-1>=0&&(z(!0),await D(p,t[o-1].id),z(!1))},steps:t,allowBackNavigation:C,errorMessage:$});return ye.createElement(ye.Fragment,null,ye.createElement(ti,{className:l("formContainer",e)},ye.createElement(oi,null,ye.createElement(va,{id:o,shouldWrap:c==="large-modal"},ye.createElement(ri,{key:ie.id,type:c,className:l("formContent",e)},t.map(G=>{let ge=B[G.type];return ie.id!==G.id?null:ye.createElement(ge,{key:G.id,stepData:G,canContinue:m,setCanContinue:x,onSaveData:R=>{I(G,R)},appearance:e,customFormElements:f,flowId:p})}),E&&ye.createElement(li,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),fe))),c=="large-modal"&&ye.createElement(ne,{selectedStep:t[o]})))};import Jt from"react";import{createGlobalStyle as Ea}from"styled-components";function te({appearance:e}){if(!e||!e.styleOverrides)return Jt.createElement(Jt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,n])=>typeof n=="object");if(t.length===0)return Jt.createElement(Jt.Fragment,null);let o=Ea`
|
|
632
|
+
${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map(([s,p])=>`${Do(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Jt.createElement(o,{inlineStyles:t})}var Si=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:h,onButtonClick:d,dismissible:u=!0,endFlowOnDismiss:y=!1,modalPosition:E="center",repeatable:f=!1,onDismiss:C,showPagination:F=!1,allowBackNavigation:k=!1,validationHandler:B,showFrigadeBranding:P=!1})=>{let{getFlow:S,getFlowSteps:m,isLoading:x,targetingLogicShouldHideFlow:b,getFlowStatus:N,getCurrentStepIndex:_,markFlowCompleted:z,markFlowNotStarted:A}=X(),U=_(e),{mergeAppearanceWithDefault:$}=J(),[O,ie]=Aa(!1),{setOpenFlowState:pe,getOpenFlowState:D}=Pe();c=$(c);let[we,xe]=i!==void 0&&n!==void 0?[i,n]:[D(e,!0),I=>pe(e,I)];if(Ba(()=>{!O&&!x&&(ie(!0),N(e)===Y&&f&&A(e),ie(!0))},[O,ie,x]),x)return null;let ee=S(e);if(!ee||b(ee))return null;let j=m(e);if(!j||i!==void 0&&i===!1||N(e)===Y&&a)return null;let oe=()=>{xe(!1),C&&C(),y===!0&&z(e)};if(E=="center"&&o==="modal"||o==="large-modal"){let I={padding:"24px"};return o==="large-modal"?(I.width="85%",I.height="90%",I.maxHeight="800px",I.minHeight="500px",I.padding="0"):I.width="400px",_e.createElement(ot,{appearance:c,onClose:oe,visible:we,style:I,dismissible:u,showFrigadeBranding:P},_e.createElement(te,{appearance:c}),_e.createElement(wo,{appearance:c,steps:j,selectedStep:U,customStepTypes:t,customVariables:r,onButtonClick:d,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:k,validationHandler:B}))}return o==="modal"&&E!=="center"?_e.createElement(Or,{appearance:c,onClose:oe,visible:we},_e.createElement(te,{appearance:c}),_e.createElement(wo,{appearance:c,steps:j,selectedStep:U,customStepTypes:t,customVariables:r,onButtonClick:d,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:k,validationHandler:B})):_e.createElement(_e.Fragment,null,_e.createElement(te,{appearance:c}),_e.createElement(wo,{appearance:c,steps:j,selectedStep:U,customStepTypes:t,customVariables:r,onButtonClick:d,onStepCompletion:h,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:k,validationHandler:B}))},yi=Si;import{useCallback as bi,useContext as Ia,useEffect as Na}from"react";function Qo(){let{organizationId:e,userId:t,setOrganizationId:o}=Ia(q),{mutateUserFlowState:i}=Ie(),{config:n}=Me(),r=Tt(),{verifySDKInitiated:s}=Ft();Na(()=>{if(t&&e){if(t.startsWith(kt))return;let a=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(a)||(r(`${Te}userGroups`,{...n,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(a,"true"))}},[t,e]);let p=bi(async a=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let h={foreignUserId:t,foreignUserGroupId:e,properties:a};await r(`${Te}userGroups`,{...n,method:"POST",body:JSON.stringify(h)}),i()},[e,t,n,i]),c=bi(async(a,h)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let u={foreignUserId:t,foreignUserGroupId:e,events:[{event:a,properties:h}]};await r(`${Te}userGroups`,{...n,method:"POST",body:JSON.stringify(u)}),i()},[e,t,n,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:c}}var wi="xFrigade_guestUserId",Ti="xFrigade_userId",Fi=({})=>{let{setFlowResponses:e}=Wt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ie(),{userId:n,setUserId:r}=Ht(),[s,p]=Zo(null),{getFlowStatus:c}=X(),{flows:a,userProperties:h,setIsNewGuestUser:d,flowResponses:u}=La(q),[y,E]=Zo([]),[f,C]=Zo([]),{organizationId:F}=Qo();To(()=>{if(!o&&t)for(let S=0;S<t.length;S++){let m=t[S],x=a.find(b=>b.slug===(m==null?void 0:m.flowId));if(x&&m&&m.shouldTrigger===!0&&x.type=="FORM"&&x.triggerType==="AUTOMATIC"&&!f.includes(x.slug)){setTimeout(()=>{k(m.flowId)},500);break}}},[o,t]),To(()=>{u.length>0&&i()},[u]);function k(S){let m=a.find(x=>x.slug===S);m&&m.triggerType==="AUTOMATIC"&&!f.includes(m.slug)&&(C([...f,m.slug]),E([m]))}function B(){if(!n){let S=localStorage.getItem(Ti);if(S){r(S);return}let m=localStorage.getItem(wi);if(m){r(m);return}d(!0);let x=kt+Oa();try{localStorage.setItem(wi,x)}catch(b){console.log("Failed to save guest user id locally: Local storage unavailable",b)}r(b=>b||x)}}To(()=>{try{if(a){let S=[];a.forEach(m=>{if(m.data){let x=m.data.match(/"imageUri":"(.*?)"/g);x&&x.forEach(b=>{let N=b.replace('"imageUri":"',"").replace('"',"");if(S.includes(N))return;let _=new Image;_.src=N,S.push(N)})}})}}catch{}},[a]),To(()=>{if(n!==s&&e([]),p(n),n&&!n.startsWith(kt))try{localStorage.setItem(Ti,n)}catch(S){console.log("Failed to save user id locally: Local storage available",S)}n===null&&setTimeout(()=>{n===null&&B()},50)},[n,a,h]);function P(){return ft.createElement(ft.Fragment,null,y.map(S=>c(S.slug)!==Le?null:ft.createElement("span",{key:S.slug},ft.createElement(yi,{flowId:S.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return ft.createElement(ft.Fragment,null,ft.createElement(P,null))};import{ErrorBoundary as Ma}from"react-error-boundary";var q=Da({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:()=>{}}),Ua=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var ie,pe;let[r,s]=Ne(t||null),[p,c]=Ne(o||null),[a,h]=Ne([]),[d,u]=Ne([]),[y,E]=Ne([]),[f,C]=Ne({}),[F,k]=Ne({}),[B,P]=Ne([]),[S,m]=Ne({}),[x,b]=Ne(!1),[N,_]=Ne(!1),[z,A]=Ne(!O(e)),U=(D,we)=>{if(we==="_blank"){window.open(D,"_blank");return}setTimeout(()=>{window.location.href=D},50)},$={theme:{...Ke.theme,...((ie=i==null?void 0:i.defaultAppearance)==null?void 0:ie.theme)??{}},styleOverrides:{...Ke.styleOverrides,...((pe=i==null?void 0:i.defaultAppearance)==null?void 0:pe.styleOverrides)??{}}};function O(D){return!!(D&&D.length>10&&D.substring(0,10)==="api_public")}return Ro(()=>{t&&s(t)},[t]),Ro(()=>{o&&c(o)},[o]),Ro(()=>{if(O(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]),z?gt.createElement(q.Provider,{value:{publicApiKey:e,userId:r,setUserId:s,setFlows:h,flows:a,failedFlowResponses:d,setFailedFlowResponses:u,flowResponses:y,setFlowResponses:E,userProperties:f,setUserProperties:C,openFlowStates:F,setOpenFlowStates:k,completedFlowsToKeepOpenDuringSession:B,setCompletedFlowsToKeepOpenDuringSession:P,customVariables:S,setCustomVariables:m,isNewGuestUser:x,setIsNewGuestUser:b,hasActiveFullPageFlow:N,setHasActiveFullPageFlow:_,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:U,defaultAppearance:$,shouldGracefullyDegrade:z,setShouldGracefullyDegrade:A}},n):gt.createElement(Ma,{fallback:gt.createElement(gt.Fragment,null,n)},gt.createElement(q.Provider,{value:{publicApiKey:e,userId:r,setUserId:s,setFlows:h,flows:a,failedFlowResponses:d,setFailedFlowResponses:u,flowResponses:y,setFlowResponses:E,userProperties:f,setUserProperties:C,openFlowStates:F,setOpenFlowStates:k,completedFlowsToKeepOpenDuringSession:B,setCompletedFlowsToKeepOpenDuringSession:P,customVariables:S,setCustomVariables:m,isNewGuestUser:x,setIsNewGuestUser:b,hasActiveFullPageFlow:N,setHasActiveFullPageFlow:_,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:U,defaultAppearance:$,shouldGracefullyDegrade:z,setShouldGracefullyDegrade:A}},gt.createElement($a,{theme:$.theme},n,gt.createElement(Fi,null))))};import Dp from"react";import ae,{useEffect as ts,useState as os}from"react";import $e,{useState as sp}from"react";import Ct from"styled-components";import Po from"react";import ht from"react";import Pi from"styled-components";var ki=Pi.span`
|
|
633
633
|
font-weight: 400;
|
|
634
634
|
font-size: 15px;
|
|
635
635
|
line-height: 20px;
|
|
@@ -646,7 +646,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
646
646
|
padding-bottom: 20px;
|
|
647
647
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
648
648
|
width: 100%;
|
|
649
|
-
`,
|
|
649
|
+
`,Fo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="square",appearance:p})=>ht.createElement(ht.Fragment,null,ht.createElement(_a,{className:l("checklistStepsContainer",p),appearance:p,style:{...n}},i==="left"&&e&&ht.createElement(ki,{className:l("checklistStepLabel",p),style:o},e),ht.createElement(Ye,{appearance:p,value:t,type:s,primaryColor:r}),i==="right"&&e&&ht.createElement(ki,{className:l("checklistStepLabel",p),style:o},e)),ht.createElement(te,{appearance:p}));import{motion as za}from"framer-motion";import Qt from"styled-components";var vi=Qt.div`
|
|
650
650
|
font-weight: 700;
|
|
651
651
|
font-size: 18px;
|
|
652
652
|
line-height: 22px;
|
|
@@ -663,7 +663,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
663
663
|
max-width: 540px;
|
|
664
664
|
margin: 8px 0px 0px 0px;
|
|
665
665
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
666
|
-
`,
|
|
666
|
+
`,ko=Qt.div`
|
|
667
667
|
width: 4px;
|
|
668
668
|
position: absolute;
|
|
669
669
|
left: 0;
|
|
@@ -674,7 +674,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
674
674
|
`,Ai=Qt.div`
|
|
675
675
|
flex-direction: row;
|
|
676
676
|
justify-content: flex-start;
|
|
677
|
-
`;var Ii=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,c;return
|
|
677
|
+
`;var Ii=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,c;return Po.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{r()}},o&&Po.createElement(ko,{className:l("checklistStepItemSelectedIndicator",s),as:za.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),Po.createElement(Ai,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},Po.createElement(Fo,{value:e.complete,labelPosition:"left",label:e.stepName,style:n,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import xt from"react";import{motion as Wa}from"framer-motion";import er from"styled-components";var Ha={backgroundColor:"#E6E6E6"},Va=er.div`
|
|
678
678
|
display: flex;
|
|
679
679
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
680
680
|
justify-content: flex-start;
|
|
@@ -693,7 +693,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
693
693
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
694
694
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
695
695
|
${e=>qe(e)}
|
|
696
|
-
`,qa={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Ka={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},ze=({count:e,total:t,fillColor:o,bgColor:i=Ha.backgroundColor,display:n="count",textLocation:r="left",style:s={},textStyle:p={},appearance:c})=>{var E,f;if(t===0)return xt.createElement(xt.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,h=n==="compact"?"5px":"10px",d=Math.round(e/t*100),u=n==="compact"?"5px":"20px",y;return n==="count"?y=`${e} of ${t}`:n==="compact"?y=`${d}%`:n==="percent"&&(y=`${d}% complete`),r==="top"&&(u="0px"),xt.createElement(Va,{className:l("progressBarContainer",c),textLocation:r,styleOverrides:s},xt.createElement(Ga,{className:l("progressBarStepText",c),style:{...p,fontSize:n==="compact"?12:15,fontWeight:n==="compact"?400:500},appearance:c,padding:u,textLocation:r},y),xt.createElement(ja,{textLocation:r,className:l("progressBar",c)},xt.createElement(Wa.div,{style:{...Ka,width:a,height:h,backgroundColor:((E=c==null?void 0:c.theme)==null?void 0:E.colorPrimary)??o,zIndex:n=="compact"?1:5},className:l("progressBarFill",c)}),xt.createElement("div",{className:l("progressBarBackground",c),style:{...qa,height:h,backgroundColor:((f=c==null?void 0:c.theme)==null?void 0:f.colorSecondary)??i}})))};import Rt from"react";import Ya from"styled-components";import
|
|
696
|
+
`,qa={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Ka={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},ze=({count:e,total:t,fillColor:o,bgColor:i=Ha.backgroundColor,display:n="count",textLocation:r="left",style:s={},textStyle:p={},appearance:c})=>{var E,f;if(t===0)return xt.createElement(xt.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,h=n==="compact"?"5px":"10px",d=Math.round(e/t*100),u=n==="compact"?"5px":"20px",y;return n==="count"?y=`${e} of ${t}`:n==="compact"?y=`${d}%`:n==="percent"&&(y=`${d}% complete`),r==="top"&&(u="0px"),xt.createElement(Va,{className:l("progressBarContainer",c),textLocation:r,styleOverrides:s},xt.createElement(Ga,{className:l("progressBarStepText",c),style:{...p,fontSize:n==="compact"?12:15,fontWeight:n==="compact"?400:500},appearance:c,padding:u,textLocation:r},y),xt.createElement(ja,{textLocation:r,className:l("progressBar",c)},xt.createElement(Wa.div,{style:{...Ka,width:a,height:h,backgroundColor:((E=c==null?void 0:c.theme)==null?void 0:E.colorPrimary)??o,zIndex:n=="compact"?1:5},className:l("progressBarFill",c)}),xt.createElement("div",{className:l("progressBarBackground",c),style:{...qa,height:h,backgroundColor:((f=c==null?void 0:c.theme)==null?void 0:f.colorSecondary)??i}})))};import Rt from"react";import Ya from"styled-components";import Eo from"react";import vo from"react";var It=({stepData:e,appearance:t})=>vo.createElement(vo.Fragment,null,vo.createElement(Ei,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),vo.createElement(Bi,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import Zt from"react";var Nt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Zt.createElement(Zt.Fragment,null,Zt.createElement(Co,null,e.secondaryButtonTitle&&Zt.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}),Zt.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Lt=({stepData:e,appearance:t})=>Eo.createElement(Eo.Fragment,null,Eo.createElement(It,{stepData:e,appearance:t}),Eo.createElement(Nt,{stepData:e,appearance:t}));import Ni from"react";function Li(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),Ni.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:l("checklistStepVideo",e.appearance)})}else return Ni.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var tr="default",Xa=Ya.img`
|
|
697
697
|
border-radius: 4px;
|
|
698
698
|
max-height: 260px;
|
|
699
699
|
min-height: 200px;
|
|
@@ -742,9 +742,9 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
742
742
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
743
743
|
border-radius: 50%;
|
|
744
744
|
}
|
|
745
|
-
`,$i="videoCarousel",Mi=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return Ee.createElement(Di,null,Ee.createElement(Lt,{stepData:e,appearance:t}));function o({video:r}){let s=Ja(),[p,c]=Qa(!1);return Ee.createElement(Ra,null,!p&&Ee.createElement(op,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(
|
|
745
|
+
`,$i="videoCarousel",Mi=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return Ee.createElement(Di,null,Ee.createElement(Lt,{stepData:e,appearance:t}));function o({video:r}){let s=Ja(),[p,c]=Qa(!1);return Ee.createElement(Ra,null,!p&&Ee.createElement(op,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(So,null)),Ee.createElement(ep,{controls:p,ref:s,play:p,src:r.uri}),Ee.createElement(tp,null,r.title))}let i=e.props;return i.videos?Ee.createElement(Di,null,Ee.createElement(It,{stepData:e,appearance:t}),Ee.createElement(Za,null,i.videos.map((r,s)=>Ee.createElement("span",{key:`${r.uri}-${s}`},Ee.createElement(o,{video:r})))),Ee.createElement(Nt,{stepData:e,appearance:t})):null};import Je from"react";import Bo from"styled-components";var Ui=Bo.div`
|
|
746
746
|
display: block;
|
|
747
|
-
`,rp=
|
|
747
|
+
`,rp=Bo.pre`
|
|
748
748
|
display: block;
|
|
749
749
|
background-color: #2a2a2a;
|
|
750
750
|
color: #f8f8f8;
|
|
@@ -760,12 +760,12 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
760
760
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
761
761
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
762
762
|
margin-bottom: 24px;
|
|
763
|
-
`,ip=
|
|
763
|
+
`,ip=Bo.div`
|
|
764
764
|
font-size: 15px;
|
|
765
765
|
line-height: 20px;
|
|
766
766
|
margin-bottom: 12px;
|
|
767
767
|
margin-top: 12px;
|
|
768
|
-
`,np=
|
|
768
|
+
`,np=Bo.div`
|
|
769
769
|
margin-top: 24px;
|
|
770
770
|
`,_i="codeSnippet",zi=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return Je.createElement(Ui,null,Je.createElement(Lt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Je.createElement(Ui,null,Je.createElement(It,{stepData:e,appearance:t}),Je.createElement(np,null,o.codeSnippets.map((n,r)=>Je.createElement("div",{key:r},n.title?Je.createElement(ip,null,n.title):null,n.code?Je.createElement(rp,null,n.code):null))),Je.createElement(Nt,{stepData:e,appearance:t})):null};var lp=Ct.div`
|
|
771
771
|
display: flex;
|
|
@@ -1013,7 +1013,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
1013
1013
|
line-height: 14px;
|
|
1014
1014
|
font-weight: 400;
|
|
1015
1015
|
cursor: pointer;
|
|
1016
|
-
`;var Cp=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=re();return Ze.createElement(pn,{style:t,className:l("guideContainer",n)},Ze.createElement(cn,{className:l("guideTitle",n)},o),Ze.createElement(dn,{className:l("guideItemContainer",n)},e.map((p,c)=>Ze.createElement(mn,{key:`guide-${p.id??c}`,as:xp.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",n)},p.icon&&Ze.createElement(un,{className:l("guideIcon",n)},Ze.createElement(fn,null,p.icon)),Ze.createElement(gn,{className:l("guideItemTitle",n),dangerouslySetInnerHTML:ce(p.title)}),Ze.createElement(hn,{className:l("guideItemSubtitle",n),dangerouslySetInnerHTML:ce(p.subtitle)}),Ze.createElement(xn,{className:l("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle)))))},eo=Cp;var bp=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:a,guideData:h,guideTitle:d,onGuideButtonClick:u})=>{let y=({stepData:m,handleSecondaryCTAClick:x,handleCTAClick:b})=>m?M.createElement(Zi,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},M.createElement(Ri,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:ce(m.title)}),M.createElement(en,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:ce(m.subtitle)}),M.createElement(tn,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&M.createElement(Z,{title:m.secondaryButtonTitle,onClick:x,appearance:a,secondary:!0}),M.createElement(Z,{title:m.primaryButtonTitle,onClick:b,appearance:a}))):M.createElement(M.Fragment,null),f={...{default:m=>{var _;if((_=e[k])!=null&&_.StepContent){let z=e[k].StepContent;return M.createElement("div",null,z)}let x=e[k];return M.createElement(y,{stepData:m,handleCTAClick:()=>{x.handlePrimaryButtonClick&&x.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{x.handleSecondaryButtonClick&&x.handleSecondaryButtonClick()}})}},...c},[C,F]=Sp(0),k=s??C,B=p??F,P=()=>{var m;return e?!((m=e[k])!=null&&m.type)||!f[e[k].type]?f.default(e[k]):f[e[k].type]({stepData:e[k],primaryColor:a.theme.colorPrimary}):M.createElement(M.Fragment,null)},S=e.filter(m=>m.complete).length;return n?(a.theme.modalContainer||(a.theme.borderRadius&&(rr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=rr),M.createElement(ot,{onClose:r,visible:n,appearance:a},M.createElement(ln,null,M.createElement(ji,null,M.createElement(Gi,{appearance:a,className:l("checklistTitle",a)},t),M.createElement(qi,{appearance:a,className:l("checklistSubtitle",a)},o)),M.createElement(Vi,null,e&&e.length>0&&M.createElement(Ki,{className:l("stepsContainer",a)},M.createElement(Yi,null,M.createElement("div",{style:{flex:3}},M.createElement(Xi,{className:l("stepsTitle",a)},i)),M.createElement(sn,null,M.createElement(ze,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:S,total:e.length,appearance:a}))),M.createElement(Ji,null,M.createElement(Qi,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,x)=>{let b=k===x;return M.createElement(on,{selected:b,className:l(`checklistStepListItem${b?"Selected":""}`,a),key:`checklist-guide-step-${m.id??x}`,disabled:m.blocked,onClick:()=>{m.blocked||B(x)},title:m.blocked?"Finish remaining steps to continue":void 0},b&&M.createElement(
|
|
1016
|
+
`;var Cp=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=re();return Ze.createElement(pn,{style:t,className:l("guideContainer",n)},Ze.createElement(cn,{className:l("guideTitle",n)},o),Ze.createElement(dn,{className:l("guideItemContainer",n)},e.map((p,c)=>Ze.createElement(mn,{key:`guide-${p.id??c}`,as:xp.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",n)},p.icon&&Ze.createElement(un,{className:l("guideIcon",n)},Ze.createElement(fn,null,p.icon)),Ze.createElement(gn,{className:l("guideItemTitle",n),dangerouslySetInnerHTML:ce(p.title)}),Ze.createElement(hn,{className:l("guideItemSubtitle",n),dangerouslySetInnerHTML:ce(p.subtitle)}),Ze.createElement(xn,{className:l("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle)))))},eo=Cp;var bp=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:a,guideData:h,guideTitle:d,onGuideButtonClick:u})=>{let y=({stepData:m,handleSecondaryCTAClick:x,handleCTAClick:b})=>m?M.createElement(Zi,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},M.createElement(Ri,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:ce(m.title)}),M.createElement(en,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:ce(m.subtitle)}),M.createElement(tn,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&M.createElement(Z,{title:m.secondaryButtonTitle,onClick:x,appearance:a,secondary:!0}),M.createElement(Z,{title:m.primaryButtonTitle,onClick:b,appearance:a}))):M.createElement(M.Fragment,null),f={...{default:m=>{var _;if((_=e[k])!=null&&_.StepContent){let z=e[k].StepContent;return M.createElement("div",null,z)}let x=e[k];return M.createElement(y,{stepData:m,handleCTAClick:()=>{x.handlePrimaryButtonClick&&x.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{x.handleSecondaryButtonClick&&x.handleSecondaryButtonClick()}})}},...c},[C,F]=Sp(0),k=s??C,B=p??F,P=()=>{var m;return e?!((m=e[k])!=null&&m.type)||!f[e[k].type]?f.default(e[k]):f[e[k].type]({stepData:e[k],primaryColor:a.theme.colorPrimary}):M.createElement(M.Fragment,null)},S=e.filter(m=>m.complete).length;return n?(a.theme.modalContainer||(a.theme.borderRadius&&(rr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=rr),M.createElement(ot,{onClose:r,visible:n,appearance:a},M.createElement(ln,null,M.createElement(ji,null,M.createElement(Gi,{appearance:a,className:l("checklistTitle",a)},t),M.createElement(qi,{appearance:a,className:l("checklistSubtitle",a)},o)),M.createElement(Vi,null,e&&e.length>0&&M.createElement(Ki,{className:l("stepsContainer",a)},M.createElement(Yi,null,M.createElement("div",{style:{flex:3}},M.createElement(Xi,{className:l("stepsTitle",a)},i)),M.createElement(sn,null,M.createElement(ze,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:S,total:e.length,appearance:a}))),M.createElement(Ji,null,M.createElement(Qi,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,x)=>{let b=k===x;return M.createElement(on,{selected:b,className:l(`checklistStepListItem${b?"Selected":""}`,a),key:`checklist-guide-step-${m.id??x}`,disabled:m.blocked,onClick:()=>{m.blocked||B(x)},title:m.blocked?"Finish remaining steps to continue":void 0},b&&M.createElement(ko,{className:l("checklistStepItemSelectedIndicator",a),as:yp.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),M.createElement(rn,{selected:b,className:l(`checklistStepListStepName${b?"Selected":""}`,a)},m.stepName),M.createElement(nn,null,M.createElement(Ye,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),M.createElement(an,null,M.createElement(Dt,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),M.createElement(P,null))),h&&h.length>0&&M.createElement(eo,{steps:h,title:d,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(u&&u(m),!0)}))))):M.createElement(M.Fragment,null)},ir=bp;import{useEffect as wp,useState as Tp}from"react";var Cn=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=Tp(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,a])=>{if(!window)return[c,!1];let h=window.matchMedia(a);return h.addEventListener("change",r),[c,h.matches]}));i(p)};return wp(()=>{s()},[]),o};import Fe,{useEffect as Ln,useState as Pp}from"react";import ue from"react";import{AnimatePresence as Fp,motion as kp}from"framer-motion";import Re from"styled-components";var Sn=Re.div`
|
|
1017
1017
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1018
1018
|
border: 1px solid;
|
|
1019
1019
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1060,7 +1060,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
1060
1060
|
flex-direction: row;
|
|
1061
1061
|
justify-content: flex-start;
|
|
1062
1062
|
align-items: center;
|
|
1063
|
-
`;var vn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var h,d;let p=t?{}:{transform:"rotate(90deg)"};function c(){return ue.createElement(ue.Fragment,null,e.imageUri||e.videoUri?ue.createElement(yn,{className:l("stepMediaContainer",r)},e.imageUri?ue.createElement(bn,{className:l("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ue.createElement(Bt,{appearance:r,videoUri:e.videoUri}):null):null,ue.createElement(kn,{className:l("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ce(e.subtitle)}),ue.createElement(
|
|
1063
|
+
`;var vn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var h,d;let p=t?{}:{transform:"rotate(90deg)"};function c(){return ue.createElement(ue.Fragment,null,e.imageUri||e.videoUri?ue.createElement(yn,{className:l("stepMediaContainer",r)},e.imageUri?ue.createElement(bn,{className:l("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ue.createElement(Bt,{appearance:r,videoUri:e.videoUri}):null):null,ue.createElement(kn,{className:l("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ce(e.subtitle)}),ue.createElement(Co,{className:l("checklistCTAContainer",r)},e.secondaryButtonTitle?ue.createElement(Z,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,ue.createElement(Z,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:r})))}function a(){if(!s)return null;let u=s[e.type];return u?u(e,r):null}return ue.createElement(Sn,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",r),appearance:r},ue.createElement(wn,{className:l("stepHeader",r)},ue.createElement(Pn,null,ue.createElement(Fo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(h=r==null?void 0:r.theme)==null?void 0:h.colorPrimary,appearance:r}),ue.createElement(Tn,{appearance:r,className:l("stepTitle",r),dangerouslySetInnerHTML:ce(e.title)})),ue.createElement(Fn,{className:l("stepChevronContainer",r),onClick:()=>o()},ue.createElement(Dt,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(d=r==null?void 0:r.theme)==null?void 0:d.colorTextSecondary}))),ue.createElement(Fp,null,!t&&ue.createElement(kp.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??c())))};import $t from"styled-components";var vx=$t.div`
|
|
1064
1064
|
background: #ffffff;
|
|
1065
1065
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1066
1066
|
border-radius: 6px;
|
|
@@ -1235,28 +1235,28 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
1235
1235
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1236
1236
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1237
1237
|
`}
|
|
1238
|
-
`;var Qn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=J(),{primaryCTAClickSideEffects:n}=re(),{theme:r,styleOverrides:s}=i(o),{imageUri:p=null,subtitle:c=null,title:a=null,complete:h=!1,blocked:d=!1}=e,u=()=>{n(e)};return St.createElement(Hn,{className:l("carouselCard",o),onClick:d?null:u,style:t,blocked:d,complete:h},St.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&St.createElement(Vn,{className:l("carouselCardImage",o),src:p,alt:a,style:{opacity:h||d?.4:1}}),h&&St.createElement(Kn,{className:l("carouselCompletedPill",o)},St.createElement(Jn,{style:{color:"#108E0B"}},"Complete"))),a&&St.createElement(Xn,{blocked:d,complete:h,className:l("carouselCardTitle",o)},a),c&&St.createElement(We.Quiet,{blocked:d,complete:h,className:l("carouselCardSubtitle",o)},c))};import to from"react";var Zn=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let i=t>0?e/t:0,n=200,r=Math.min(n,Math.max(10,Math.round(n*i)));return to.createElement(Gn,{className:l("carouselProgressBar",o)},to.createElement(qn,{as:We.Loud,style:{marginRight:8}},e," of ",t),to.createElement("svg",{height:10,width:n},to.createElement("rect",{x:0,y:0,rx:5,width:n,height:10,fill:"#E6E6E6"}),to.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"currentColor"})))};var Op=()=>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"})),Rn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=yt(!1),[r,s]=yt(!1);sr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?le.createElement(_n,{style:c,reversed:r,onAnimationEnd:r?p:null},le.createElement(zn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(Op,null))):null},es=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=Lp(null),[r,s]=yt(!1),[p,c]=yt(!1),[a,h]=yt(null),[d,u]=yt([]),[y,E]=yt(0),{getFlowMetadata:f,getFlowSteps:C,getNumberOfStepsCompleted:F,updateCustomVariables:k,getFlowStatus:B,isLoading:P,targetingLogicShouldHideFlow:S,getFlow:m}=X();sr(()=>{k(o)},[o,P]),sr(()=>{if(P)return;let A=f(e),U=F(e),$=C(e);h(A),A.data!==null&&(u($.sort((O,ie)=>Number(O.complete)-Number(ie.complete))),c($.length>3),E(U))},[P]);let x=[];for(let A=0;A<d.length;A+=3)x.push(d.slice(A,A+3));let b=A=>{let U=A.target,$=U.scrollWidth-U.clientWidth,O=Math.ceil(U.scrollLeft);O>0&&r===!1&&s(!0),O===0&&r===!0&&s(!1),O<$&&p===!1&&c(!0),O===$&&p===!0&&c(!1)},N=(A=!0)=>{let U=A?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*U,behavior:"smooth"})},_=null,z=A=>{_!==null?clearTimeout(_):b(A),_=setTimeout(()=>{b(A)},16)};return P?null:le.createElement(jn,{className:Ce(l("carouselContainer",t),i)},le.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},le.createElement("div",null,le.createElement(Yn,{className:l("carouselTitle",t)},a==null?void 0:a.title),le.createElement(We.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),le.createElement(Zn,{numberOfStepsCompleted:y,numberOfSteps:d.length})),le.createElement("div",{style:{position:"relative"}},le.createElement(Rn,{show:r,onClick:()=>N(!1)}),le.createElement(Rn,{side:"right",show:p,onClick:N}),le.createElement(Mn,{ref:n,onScroll:z},x.map((A,U)=>le.createElement(Un,{key:U,style:{flex:`0 0 calc(100% - ${d.length>3?36:0}px)`}},A.map(($,O)=>le.createElement(Qn,{key:O,stepData:$,style:{flex:d.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var lr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:p,visible:c,customVariables:a,onStepCompletion:h,onButtonClick:d,appearance:u,hideOnFlowCompletion:y,setVisible:E,customStepTypes:f,checklistStyle:C="default",autoExpandFirstIncompleteStep:F,autoExpandNextStep:k,...B})=>{let{getFlow:P,getFlowSteps:S,markStepCompleted:m,getStepStatus:x,getNumberOfStepsCompleted:b,isLoading:N,targetingLogicShouldHideFlow:_,updateCustomVariables:z,getFlowMetadata:A,isStepBlocked:U,getFlowStatus:$,hasActiveFullPageFlow:O,setHasActiveFullPageFlow:ie}=X(),{primaryCTAClickSideEffects:pe,secondaryCTAClickSideEffects:D}=re(),{getOpenFlowState:we,setOpenFlowState:xe}=Pe(),[ee,j]=os(n||0),[oe,I]=os(!1),ne=c===void 0?we(e):c,fe=s==="modal",{mergeAppearanceWithDefault:ke}=J(),{isLarge:G}=Cn();if(u=ke(u),ts(()=>{z(a)},[a,N]),ts(()=>{c!==void 0&&(fe&&c===!0?ie(!0):fe&&c===!1&&ie(!1))},[c,E,O]),N)return null;let ge=P(e);if(!ge||_(ge))return null;let R=S(e);if(!R||y===!0&&$(e)===Y)return null;let K=A(e);if(K!=null&&K.title&&(t=K.title),K!=null&&K.subtitle&&(o=K.subtitle),!oe&&n===void 0&&b(e)>0){let W=Math.min(b(e),R.length-1);j(W),I(!0)}function je(){if(ee+1>=R.length){fe&&xe(e,!1);return}U(e,R[ee+1].id)||j(ee+1)}function Ge(W,pt,no){let fr=ee+1<R.length?R[ee+1]:null;d&&d(W,ee,pt,fr)===!0&&fe&&g(),h&&h(W,no,fr),!h&&!d&&(W.primaryButtonUri||W.secondaryButtonUri)&&fe&&g()}function wt(){return R.map((W,pt)=>({...W,handleSecondaryButtonClick:()=>{je(),D(W),W.skippable===!0&&m(e,W.id,{skipped:!0}),Ge(W,"secondary",pt)},handlePrimaryButtonClick:()=>{(!W.completionCriteria&&(W.autoMarkCompleted||W.autoMarkCompleted===void 0)||W.completionCriteria&&W.autoMarkCompleted===!0)&&(m(e,W.id),je()),Ge(W,"primary",pt),pe(W),x(e,W.id)===Oe&&je()}}))}function H(){return ae.createElement(te,{appearance:u})}let Be={steps:wt(),title:t,subtitle:o,primaryColor:u.theme.colorPrimary,appearance:u,customStepTypes:f,type:s,className:r,autoExpandFirstIncompleteStep:F,autoExpandNextStep:k};function g(){xe(e,!1),p&&p(),E&&E(!1)}function w(){return ae.createElement(ae.Fragment,null,ae.createElement(H,null),ae.createElement(es,{flowId:e,appearance:u,customVariables:a,className:r}))}function v(){return ae.createElement(ae.Fragment,null,ae.createElement(H,null),ae.createElement(nr,{visible:ne,onClose:()=>{g()},selectedStep:ee,setSelectedStep:j,autoExpandNextStep:!0,appearance:u,...Be}))}function V(){if(!G)return v();let W=B.guideFlowId,pt;return W&&P(W)&&(pt=S(W)),ae.createElement(ae.Fragment,null,ae.createElement(H,null),ae.createElement(ir,{visible:ne,stepsTitle:K.stepsTitle?K.stepsTitle:"Your quick start guide",onClose:()=>{g()},selectedStep:ee,setSelectedStep:j,guideData:pt,guideTitle:B.guideTitle??"Guide",appearance:u,title:t,subtitle:o,onGuideButtonClick:no=>{Ge(no,"link",0)},customStepTypes:f,...Be}))}function de(){if(!G)return v();let W=ae.createElement(or,{flowId:e,style:i,selectedStep:ee,setSelectedStep:j,appearance:u,type:s,...Be});return fe?ae.createElement(ot,{onClose:()=>{g()},visible:ne,appearance:u,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ae.createElement(H,null),W):ae.createElement(ae.Fragment,null,ae.createElement(H,null),W)}switch(C){case"condensed":return v();case"with-guide":return V();case"default":return de();case"carousel":return w();default:return de()}};var $p=e=>Dp.createElement(lr,{type:"inline",...e});import at,{useEffect as Up}from"react";import He from"react";import
|
|
1238
|
+
`;var Qn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=J(),{primaryCTAClickSideEffects:n}=re(),{theme:r,styleOverrides:s}=i(o),{imageUri:p=null,subtitle:c=null,title:a=null,complete:h=!1,blocked:d=!1}=e,u=()=>{n(e)};return St.createElement(Hn,{className:l("carouselCard",o),onClick:d?null:u,style:t,blocked:d,complete:h},St.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&St.createElement(Vn,{className:l("carouselCardImage",o),src:p,alt:a,style:{opacity:h||d?.4:1}}),h&&St.createElement(Kn,{className:l("carouselCompletedPill",o)},St.createElement(Jn,{style:{color:"#108E0B"}},"Complete"))),a&&St.createElement(Xn,{blocked:d,complete:h,className:l("carouselCardTitle",o)},a),c&&St.createElement(We.Quiet,{blocked:d,complete:h,className:l("carouselCardSubtitle",o)},c))};import to from"react";var Zn=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let i=t>0?e/t:0,n=200,r=Math.min(n,Math.max(10,Math.round(n*i)));return to.createElement(Gn,{className:l("carouselProgressBar",o)},to.createElement(qn,{as:We.Loud,style:{marginRight:8}},e," of ",t),to.createElement("svg",{height:10,width:n},to.createElement("rect",{x:0,y:0,rx:5,width:n,height:10,fill:"#E6E6E6"}),to.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"currentColor"})))};var Op=()=>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"})),Rn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=yt(!1),[r,s]=yt(!1);sr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?le.createElement(_n,{style:c,reversed:r,onAnimationEnd:r?p:null},le.createElement(zn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(Op,null))):null},es=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=Lp(null),[r,s]=yt(!1),[p,c]=yt(!1),[a,h]=yt(null),[d,u]=yt([]),[y,E]=yt(0),{getFlowMetadata:f,getFlowSteps:C,getNumberOfStepsCompleted:F,updateCustomVariables:k,getFlowStatus:B,isLoading:P,targetingLogicShouldHideFlow:S,getFlow:m}=X();sr(()=>{k(o)},[o,P]),sr(()=>{if(P)return;let A=f(e),U=F(e),$=C(e);h(A),A.data!==null&&(u($.sort((O,ie)=>Number(O.complete)-Number(ie.complete))),c($.length>3),E(U))},[P]);let x=[];for(let A=0;A<d.length;A+=3)x.push(d.slice(A,A+3));let b=A=>{let U=A.target,$=U.scrollWidth-U.clientWidth,O=Math.ceil(U.scrollLeft);O>0&&r===!1&&s(!0),O===0&&r===!0&&s(!1),O<$&&p===!1&&c(!0),O===$&&p===!0&&c(!1)},N=(A=!0)=>{let U=A?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*U,behavior:"smooth"})},_=null,z=A=>{_!==null?clearTimeout(_):b(A),_=setTimeout(()=>{b(A)},16)};return P?null:le.createElement(jn,{className:Ce(l("carouselContainer",t),i)},le.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},le.createElement("div",null,le.createElement(Yn,{className:l("carouselTitle",t)},a==null?void 0:a.title),le.createElement(We.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),le.createElement(Zn,{numberOfStepsCompleted:y,numberOfSteps:d.length})),le.createElement("div",{style:{position:"relative"}},le.createElement(Rn,{show:r,onClick:()=>N(!1)}),le.createElement(Rn,{side:"right",show:p,onClick:N}),le.createElement(Mn,{ref:n,onScroll:z},x.map((A,U)=>le.createElement(Un,{key:U,style:{flex:`0 0 calc(100% - ${d.length>3?36:0}px)`}},A.map(($,O)=>le.createElement(Qn,{key:O,stepData:$,style:{flex:d.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var lr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:p,visible:c,customVariables:a,onStepCompletion:h,onButtonClick:d,appearance:u,hideOnFlowCompletion:y,setVisible:E,customStepTypes:f,checklistStyle:C="default",autoExpandFirstIncompleteStep:F,autoExpandNextStep:k,...B})=>{let{getFlow:P,getFlowSteps:S,markStepCompleted:m,getStepStatus:x,getNumberOfStepsCompleted:b,isLoading:N,targetingLogicShouldHideFlow:_,updateCustomVariables:z,getFlowMetadata:A,isStepBlocked:U,getFlowStatus:$,hasActiveFullPageFlow:O,setHasActiveFullPageFlow:ie}=X(),{primaryCTAClickSideEffects:pe,secondaryCTAClickSideEffects:D}=re(),{getOpenFlowState:we,setOpenFlowState:xe}=Pe(),[ee,j]=os(n||0),[oe,I]=os(!1),ne=c===void 0?we(e):c,fe=s==="modal",{mergeAppearanceWithDefault:ke}=J(),{isLarge:G}=Cn();if(u=ke(u),ts(()=>{z(a)},[a,N]),ts(()=>{c!==void 0&&(fe&&c===!0?ie(!0):fe&&c===!1&&ie(!1))},[c,E,O]),N)return null;let ge=P(e);if(!ge||_(ge))return null;let R=S(e);if(!R||y===!0&&$(e)===Y)return null;let K=A(e);if(K!=null&&K.title&&(t=K.title),K!=null&&K.subtitle&&(o=K.subtitle),!oe&&n===void 0&&b(e)>0){let W=Math.min(b(e),R.length-1);j(W),I(!0)}function je(){if(ee+1>=R.length){fe&&xe(e,!1);return}U(e,R[ee+1].id)||j(ee+1)}function Ge(W,pt,no){let fr=ee+1<R.length?R[ee+1]:null;d&&d(W,ee,pt,fr)===!0&&fe&&g(),h&&h(W,no,fr),!h&&!d&&(W.primaryButtonUri||W.secondaryButtonUri)&&fe&&g()}function wt(){return R.map((W,pt)=>({...W,handleSecondaryButtonClick:()=>{je(),D(W),W.skippable===!0&&m(e,W.id,{skipped:!0}),Ge(W,"secondary",pt)},handlePrimaryButtonClick:()=>{(!W.completionCriteria&&(W.autoMarkCompleted||W.autoMarkCompleted===void 0)||W.completionCriteria&&W.autoMarkCompleted===!0)&&(m(e,W.id),je()),Ge(W,"primary",pt),pe(W),x(e,W.id)===Oe&&je()}}))}function H(){return ae.createElement(te,{appearance:u})}let Be={steps:wt(),title:t,subtitle:o,primaryColor:u.theme.colorPrimary,appearance:u,customStepTypes:f,type:s,className:r,autoExpandFirstIncompleteStep:F,autoExpandNextStep:k};function g(){xe(e,!1),p&&p(),E&&E(!1)}function w(){return ae.createElement(ae.Fragment,null,ae.createElement(H,null),ae.createElement(es,{flowId:e,appearance:u,customVariables:a,className:r}))}function v(){return ae.createElement(ae.Fragment,null,ae.createElement(H,null),ae.createElement(nr,{visible:ne,onClose:()=>{g()},selectedStep:ee,setSelectedStep:j,autoExpandNextStep:!0,appearance:u,...Be}))}function V(){if(!G)return v();let W=B.guideFlowId,pt;return W&&P(W)&&(pt=S(W)),ae.createElement(ae.Fragment,null,ae.createElement(H,null),ae.createElement(ir,{visible:ne,stepsTitle:K.stepsTitle?K.stepsTitle:"Your quick start guide",onClose:()=>{g()},selectedStep:ee,setSelectedStep:j,guideData:pt,guideTitle:B.guideTitle??"Guide",appearance:u,title:t,subtitle:o,onGuideButtonClick:no=>{Ge(no,"link",0)},customStepTypes:f,...Be}))}function de(){if(!G)return v();let W=ae.createElement(or,{flowId:e,style:i,selectedStep:ee,setSelectedStep:j,appearance:u,type:s,...Be});return fe?ae.createElement(ot,{onClose:()=>{g()},visible:ne,appearance:u,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ae.createElement(H,null),W):ae.createElement(ae.Fragment,null,ae.createElement(H,null),W)}switch(C){case"condensed":return v();case"with-guide":return V();case"default":return de();case"carousel":return w();default:return de()}};var $p=e=>Dp.createElement(lr,{type:"inline",...e});import at,{useEffect as Up}from"react";import He from"react";import Ao from"styled-components";var rs=Ao.div`
|
|
1239
1239
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1240
1240
|
border-radius: 8px;
|
|
1241
1241
|
padding: 6px 10px 6px 10px;
|
|
1242
1242
|
min-width: 160px;
|
|
1243
1243
|
cursor: pointer;
|
|
1244
1244
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1245
|
-
`,is=
|
|
1245
|
+
`,is=Ao.div`
|
|
1246
1246
|
display: flex;
|
|
1247
1247
|
flex-direction: row;
|
|
1248
1248
|
justify-content: space-between;
|
|
1249
1249
|
align-items: center;
|
|
1250
1250
|
margin-bottom: 2px;
|
|
1251
1251
|
flex-grow: 2;
|
|
1252
|
-
`,ns=
|
|
1252
|
+
`,ns=Ao.div`
|
|
1253
1253
|
text-overflow: ellipsis;
|
|
1254
1254
|
font-weight: 600;
|
|
1255
1255
|
font-size: 12px;
|
|
1256
1256
|
line-height: 15px;
|
|
1257
1257
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1258
1258
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1259
|
-
`,ss=
|
|
1259
|
+
`,ss=Ao.div`
|
|
1260
1260
|
width: 20px;
|
|
1261
1261
|
margin-right: 8px;
|
|
1262
1262
|
display: flex;
|
|
@@ -1300,7 +1300,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
1300
1300
|
:hover {
|
|
1301
1301
|
opacity: 0.8;
|
|
1302
1302
|
}
|
|
1303
|
-
`;var ms=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>lt.createElement(lt.Fragment,null,lt.createElement(as,{appearance:i,className:Ce(l("fullWidthProgressBadgeContainer",i),s??""),style:p},o&<.createElement(ps,{className:l("fullWidthProgressBadgeIcon",i)},o),lt.createElement(ds,null,lt.createElement(Se,{size:"small",appearance:i,title:e,subtitle:t})),lt.createElement(cs,{className:l("fullWidthProgressBadgeProgressContainer",i)},lt.createElement(ze,{count:n,total:r,display:"percent",textLocation:"top",fillColor:i.theme.colorPrimary}))));var _p=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:a,type:h="default"})=>{let{getFlow:d,getFlowSteps:u,getFlowStatus:y,getNumberOfStepsCompleted:E,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:F}=X(),{mergeAppearanceWithDefault:k}=J();a=k(a);let{setOpenFlowState:B,getOpenFlowState:P}=Pe();if(Up(()=>{F(p)},[p,f]),f)return null;let S=d(e);if(!S||C(S)||c===!0&&y(e)===Y)return null;let m=u(e),x=E(e);return h==="full-width"?at.createElement(at.Fragment,null,at.createElement(te,{appearance:a}),at.createElement(ms,{title:t,subtitle:o,count:x,total:m.length,style:n,className:s,appearance:a,icon:i,onClick:()=>{}})):at.createElement(at.Fragment,null,at.createElement(te,{appearance:a}),at.createElement(ls,{count:x,total:m.length,title:t,style:n,onClick:()=>{B(e,!0),r&&r()},type:h,className:s,appearance:a}))};import zp from"react";var Wp=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:n,targetingLogicShouldHideFlow:r,getFlowSteps:s}=X(),{mergeAppearanceWithDefault:p}=J();o=p(o);let c=n(e);if(!c||r(c))return null;let a=s(e);return zp.createElement(eo,{steps:a,style:t,appearance:o,...i})};import Ut,{useContext as Rp,useEffect as ed}from"react";import L,{useEffect as
|
|
1303
|
+
`;var ms=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>lt.createElement(lt.Fragment,null,lt.createElement(as,{appearance:i,className:Ce(l("fullWidthProgressBadgeContainer",i),s??""),style:p},o&<.createElement(ps,{className:l("fullWidthProgressBadgeIcon",i)},o),lt.createElement(ds,null,lt.createElement(Se,{size:"small",appearance:i,title:e,subtitle:t})),lt.createElement(cs,{className:l("fullWidthProgressBadgeProgressContainer",i)},lt.createElement(ze,{count:n,total:r,display:"percent",textLocation:"top",fillColor:i.theme.colorPrimary}))));var _p=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:a,type:h="default"})=>{let{getFlow:d,getFlowSteps:u,getFlowStatus:y,getNumberOfStepsCompleted:E,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:F}=X(),{mergeAppearanceWithDefault:k}=J();a=k(a);let{setOpenFlowState:B,getOpenFlowState:P}=Pe();if(Up(()=>{F(p)},[p,f]),f)return null;let S=d(e);if(!S||C(S)||c===!0&&y(e)===Y)return null;let m=u(e),x=E(e);return h==="full-width"?at.createElement(at.Fragment,null,at.createElement(te,{appearance:a}),at.createElement(ms,{title:t,subtitle:o,count:x,total:m.length,style:n,className:s,appearance:a,icon:i,onClick:()=>{}})):at.createElement(at.Fragment,null,at.createElement(te,{appearance:a}),at.createElement(ls,{count:x,total:m.length,title:t,style:n,onClick:()=>{B(e,!0),r&&r()},type:h,className:s,appearance:a}))};import zp from"react";var Wp=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:n,targetingLogicShouldHideFlow:r,getFlowSteps:s}=X(),{mergeAppearanceWithDefault:p}=J();o=p(o);let c=n(e);if(!c||r(c))return null;let a=s(e);return zp.createElement(eo,{steps:a,style:t,appearance:o,...i})};import Ut,{useContext as Rp,useEffect as ed}from"react";import L,{useEffect as Io,useLayoutEffect as gs,useRef as qp,useState as ro}from"react";import io from"styled-components";import{useCallback as Hp,useEffect as Vp,useState as jp}from"react";var ar=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}},us={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Gp(e){let t=us;return e&&(t=e.getBoundingClientRect()),t}function fs(e,t){let[o,i]=jp(us),n=Hp(()=>{e&&i(Gp(e))},[e]);return Vp(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),o}var hs=300,xs=100,Kp=500,Mt=12,Yp=io.div`
|
|
1304
1304
|
width: 100%;
|
|
1305
1305
|
height: 100%;
|
|
1306
1306
|
border-radius: 9999px;
|
|
@@ -1341,7 +1341,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
1341
1341
|
`,Qp=io(Cs)`
|
|
1342
1342
|
width: ${Mt+12}px;
|
|
1343
1343
|
height: ${Mt+12}px;
|
|
1344
|
-
`,Zp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:a=0,customStepTypes:h,appearance:d,dismissible:u=!1,showHighlightOnly:y,showStepCount:E=!0,completedStepsCount:f=0,showFrigadeBranding:C=!1})=>{var K,je,Ge,wt;let[F,k]=ro(),[B,P]=ro(new Date),S=qp(null),[m,x]=ro(document.querySelector(e[a].selector)),b=fs(m,B),[N,_]=ro(),[z,A]=ro(!y),U=(je=(K=e[a])==null?void 0:K.props)!=null&&je.position?e[a].props.position:"absolute",$=((wt=(Ge=e[a])==null?void 0:Ge.props)==null?void 0:wt.zIndex)??90,O=(F==null?void 0:F.width)??hs,ie=(F==null?void 0:F.height)??xs;gs(()=>{S.current&&k({width:S.current.clientWidth,height:S.current.clientHeight})},[a,B,U]),
|
|
1344
|
+
`,Zp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:a=0,customStepTypes:h,appearance:d,dismissible:u=!1,showHighlightOnly:y,showStepCount:E=!0,completedStepsCount:f=0,showFrigadeBranding:C=!1})=>{var K,je,Ge,wt;let[F,k]=ro(),[B,P]=ro(new Date),S=qp(null),[m,x]=ro(document.querySelector(e[a].selector)),b=fs(m,B),[N,_]=ro(),[z,A]=ro(!y),U=(je=(K=e[a])==null?void 0:K.props)!=null&&je.position?e[a].props.position:"absolute",$=((wt=(Ge=e[a])==null?void 0:Ge.props)==null?void 0:wt.zIndex)??90,O=(F==null?void 0:F.width)??hs,ie=(F==null?void 0:F.height)??xs;gs(()=>{S.current&&k({width:S.current.clientWidth,height:S.current.clientHeight})},[a,B,U]),Io(()=>{y||A(!0)},[a]);let pe=i==="auto"?"right":i,D=ar(b,pe,O,s,U),we=b.right+O>(window.innerWidth||document.documentElement.clientWidth),xe=b.bottom+xs>(window.innerHeight||document.documentElement.clientHeight);we&&i==="auto"&&(D=ar(b,"left",O,s,U),pe="left");let ee=window.location.pathname.split("/").pop(),j=()=>{let H=document.querySelector(e[a].selector);N&&N===JSON.stringify(H==null?void 0:H.getBoundingClientRect())||(x(H),P(new Date),H&&_(JSON.stringify(H.getBoundingClientRect())))};if(Io(()=>{let H=new MutationObserver(j);return H.observe(document.body,{subtree:!0,childList:!0}),()=>H.disconnect()},[j]),Io(()=>{let H=new MutationObserver(j);return H.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>H.disconnect()},[j]),Io(()=>{let H=setInterval(()=>{j()},10);return()=>clearInterval(H)},[j]),gs(()=>{setTimeout(()=>{j()},Kp),j()},[a,ee]),m===null)return L.createElement(L.Fragment,null);if(D.x==0&&D.y==0)return L.createElement(L.Fragment,null);if(!p)return L.createElement(L.Fragment,null);let oe=()=>{let H=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),A(!1),setTimeout(()=>{j()},30)),f===e.length-1)return o()},Be=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),y&&A(!1))};return L.createElement(L.Fragment,null,E&&L.createElement(vr,null,L.createElement(Br,{className:l("tooltipStepCounter",d)},a+1," of ",e.length)),L.createElement(Er,{showStepCount:E,className:l("tooltipCTAContainer",d)},e[a].secondaryButtonTitle&&L.createElement(Z,{title:e[a].secondaryButtonTitle,appearance:d,onClick:Be,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&L.createElement(Z,{title:e[a].primaryButtonTitle,appearance:d,onClick:H,withMargin:!1,size:"small"})))},I=()=>L.createElement(L.Fragment,null,u&&L.createElement(Tr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",d)},L.createElement(ve,null)),e[a].imageUri&&L.createElement(Fr,{dismissible:u,appearance:d,src:e[a].imageUri,className:l("tooltipImageContainer",d)}),e[a].videoUri&&!e[a].imageUri&&L.createElement(kr,{dismissible:u,appearance:d,className:l("tooltipVideoContainer",d)},L.createElement(Bt,{appearance:d,videoUri:e[a].videoUri})),L.createElement(Se,{appearance:d,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),L.createElement(Pr,{className:l("tooltipFooter",d)},L.createElement(oe,null))),fe={...{default:H=>{var Be;if((Be=e[a])!=null&&Be.StepContent){let g=e[a].StepContent;return L.createElement("div",null,g)}return L.createElement(I,null)}},...h},ke=()=>{var H;return e?!((H=e[a])!=null&&H.type)||!fe[e[a].type]?fe.default(e[a]):fe[e[a].type]({stepData:e[a],primaryColor:r}):L.createElement(L.Fragment,null)};if(y&&e[a].complete===!0)return null;let G={top:(D==null?void 0:D.y)-Mt,left:(pe=="left"?b.x+s.x:(D==null?void 0:D.x)-Mt)??0,cursor:y?"pointer":"default",position:U},ge=()=>{let Be=G.left+(pe=="left"?-O:24);return Math.min(Math.max(Be,20),window.innerWidth-O-20)},R=()=>{y&&(P(new Date),A(!z))};return L.createElement(Jp,null,L.createElement(Qp,{style:G,zIndex:$,className:l("tourHighlightContainer",d)},n&&e[a].showHighlight!==!1&&L.createElement(L.Fragment,null,L.createElement(Xp,{style:{position:U},onClick:R,primaryColor:d.theme.colorPrimary}),L.createElement(Yp,{style:{position:"absolute"},onClick:R,primaryColor:d.theme.colorPrimary}))),L.createElement(Cs,{style:{...G,left:ge()},zIndex:$+1,className:l("tooltipContainerWrapper",d)},z&&L.createElement(L.Fragment,null,L.createElement(ao,{ref:S,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...c},appearance:d,className:l("tooltipContainer",d),maxWidth:hs,zIndex:$+10},L.createElement(ke,null)),C&&L.createElement(Ir,{className:l("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:$+10},L.createElement(po,{appearance:d})))))},No=Zp;import{Portal as td}from"react-portal";var od=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:a=!1,dismissBehavior:h="complete-flow",onComplete:d,...u})=>{let{getFlow:y,getFlowSteps:E,isLoading:f,targetingLogicShouldHideFlow:C,markStepCompleted:F,markStepStarted:k,markFlowCompleted:B,updateCustomVariables:P,getCurrentStepIndex:S,getStepStatus:m,isStepBlocked:x,getFlowStatus:b,getNumberOfStepsCompleted:N}=X(),{isLoadingUserFlowStateData:_}=Ie(),{primaryCTAClickSideEffects:z,secondaryCTAClickSideEffects:A}=re(),{hasOpenModals:U}=Pe(),$=S(e),{openFlowStates:O}=Rp(q),{mergeAppearanceWithDefault:ie}=J();if(o=ie(o),ed(()=>{P(t)},[t,f]),_)return null;let pe=y(e);if(!pe||C(pe)||b(e)==Y||U())return null;let D=E(e);if(Object.keys(O).length>0){let I=Object.keys(O).find(ne=>O[ne]===!0);if(I!==void 0&&I!==e)return Ut.createElement(Ut.Fragment,null)}async function we(I){if(await F(e,I.id),D.map(ne=>m(e,ne.id)).every(ne=>ne===Oe)){await B(e);return}if(!a&&$+1<D.length){if(x(e,D[$+1].id))return;await k(e,D[$+1].id)}}function xe(I,ne,fe){let ke=$+1<D.length?D[$+1]:null;n&&n(I,$,ne,ke),i&&i(I,fe,ke)}function ee(){return D.map(I=>({...I,handleSecondaryButtonClick:async()=>{A(I),I.skippable===!0&&await F(e,I.id,{skipped:!0}),xe(I,"secondary",$)},handlePrimaryButtonClick:async()=>{(!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)||I.completionCriteria&&I.autoMarkCompleted===!0)&&await we(I),xe(I,"primary",$),z(I)}}))}async function j(I){s&&s(),h==="complete-flow"?await B(e):await F(e,I.id)}function oe(){d&&d()}return Ut.createElement(td,null,Ut.createElement(te,{appearance:o}),r?D.map((I,ne)=>Ut.createElement(No,{key:I.id,appearance:o,steps:ee(),selectedStep:ne,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>j(I),tooltipPosition:c,showHighlightOnly:a,completedStepsCount:N(e),onComplete:oe,...u})):Ut.createElement(No,{appearance:o,steps:ee(),selectedStep:$,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>j(D[$]),tooltipPosition:c,completedStepsCount:N(e),showHighlightOnly:a,onComplete:oe,...u}))};import be,{useEffect as rd,useRef as id,useState as nd}from"react";import{Portal as sd}from"react-portal";import bt from"styled-components";var Ss=bt.button`
|
|
1345
1345
|
${e=>T(e)} {
|
|
1346
1346
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1347
1347
|
|
|
@@ -1429,7 +1429,7 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
1429
1429
|
font-size: 14px;
|
|
1430
1430
|
|
|
1431
1431
|
padding: 8px 12px;
|
|
1432
|
-
`;import{AnimatePresence as As,motion as Is}from"framer-motion";import Ps from"react";var vs=({style:e,className:t})=>Ps.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Ps.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 Es from"react";var Bs=({style:e,className:t})=>Es.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"},Es.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 ld=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:a,getStepStatus:h,getNumberOfStepsCompleted:d,isLoading:u,targetingLogicShouldHideFlow:y}=X(),{primaryCTAClickSideEffects:E}=re(),f=id(null),[C,F]=nd(!1),{mergeAppearanceWithDefault:k}=J();s=k(s),rd(()=>(document.addEventListener("click",B,!1),()=>{document.removeEventListener("click",B,!1)}),[]);let B=b=>{f.current&&!f.current.contains(b.target)&&F(!1)};if(u)return null;let P=p(e);if(!P||y(P))return null;let S=c(e);if(!S||!i)return null;function m(b,N){!b.completionCriteria&&(b.autoMarkCompleted||b.autoMarkCompleted===void 0)&&a(e,b.id),E(b),o&&o(b,N),F(!1)}function x(){return C&&be.createElement(Fs,{className:l("floatingWidgetMenu",s),as:Is.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},S.map((b,N)=>be.createElement(ks,{className:l("floatingWidgetMenuItem",s),key:N,onClick:()=>m(b,N)},b.title)))}return n=="inline"?be.createElement("span",{ref:f},be.createElement(Ss,{style:t,onClick:()=>{F(!C)},className:l("supportButton",s)},be.createElement(bs,{className:l("supportIconContainer",s)},be.createElement(Bs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),be.createElement(ys,{className:l("supportButtonTitle",s)},r)),be.createElement(As,null,be.createElement(x,null))):be.createElement(sd,null,be.createElement(ws,{style:t,ref:f},be.createElement(As,null,be.createElement(x,null)),be.createElement(Ts,{onClick:()=>{F(!C)},as:Is.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},be.createElement(vs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Ve,{useEffect as ad}from"react";import
|
|
1432
|
+
`;import{AnimatePresence as As,motion as Is}from"framer-motion";import Ps from"react";var vs=({style:e,className:t})=>Ps.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Ps.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 Es from"react";var Bs=({style:e,className:t})=>Es.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"},Es.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 ld=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:a,getStepStatus:h,getNumberOfStepsCompleted:d,isLoading:u,targetingLogicShouldHideFlow:y}=X(),{primaryCTAClickSideEffects:E}=re(),f=id(null),[C,F]=nd(!1),{mergeAppearanceWithDefault:k}=J();s=k(s),rd(()=>(document.addEventListener("click",B,!1),()=>{document.removeEventListener("click",B,!1)}),[]);let B=b=>{f.current&&!f.current.contains(b.target)&&F(!1)};if(u)return null;let P=p(e);if(!P||y(P))return null;let S=c(e);if(!S||!i)return null;function m(b,N){!b.completionCriteria&&(b.autoMarkCompleted||b.autoMarkCompleted===void 0)&&a(e,b.id),E(b),o&&o(b,N),F(!1)}function x(){return C&&be.createElement(Fs,{className:l("floatingWidgetMenu",s),as:Is.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},S.map((b,N)=>be.createElement(ks,{className:l("floatingWidgetMenuItem",s),key:N,onClick:()=>m(b,N)},b.title)))}return n=="inline"?be.createElement("span",{ref:f},be.createElement(Ss,{style:t,onClick:()=>{F(!C)},className:l("supportButton",s)},be.createElement(bs,{className:l("supportIconContainer",s)},be.createElement(Bs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),be.createElement(ys,{className:l("supportButtonTitle",s)},r)),be.createElement(As,null,be.createElement(x,null))):be.createElement(sd,null,be.createElement(ws,{style:t,ref:f},be.createElement(As,null,be.createElement(x,null)),be.createElement(Ts,{onClick:()=>{F(!C)},as:Is.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},be.createElement(vs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Ve,{useEffect as ad}from"react";import Lo from"styled-components";var Ns=Lo.div`
|
|
1433
1433
|
${e=>T(e)} {
|
|
1434
1434
|
display: flex;
|
|
1435
1435
|
flex-direction: column;
|
|
@@ -1444,17 +1444,17 @@ ${i=>i.inlineStyles.map(([n,r])=>`.${Vt}${n}.${Vt}${n} { ${Object.entries(r).map
|
|
|
1444
1444
|
border-radius: 12px;
|
|
1445
1445
|
position: relative;
|
|
1446
1446
|
}
|
|
1447
|
-
`,Ls=
|
|
1447
|
+
`,Ls=Lo.div`
|
|
1448
1448
|
display: flex;
|
|
1449
1449
|
flex-direction: column;
|
|
1450
1450
|
flex: 1;
|
|
1451
|
-
`,Os=
|
|
1451
|
+
`,Os=Lo.div`
|
|
1452
1452
|
display: flex;
|
|
1453
1453
|
flex-direction: column;
|
|
1454
1454
|
justify-content: center;
|
|
1455
1455
|
align-items: flex-start;
|
|
1456
1456
|
margin-top: 16px;
|
|
1457
|
-
`,Ds=
|
|
1457
|
+
`,Ds=Lo.div`
|
|
1458
1458
|
${e=>T(e)} {
|
|
1459
1459
|
position: absolute;
|
|
1460
1460
|
top: 16px;
|