@frigade/react 1.35.13 → 1.35.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +9 -2
- package/lib/index.js +221 -221
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +219 -219
- 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 wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import{ThemeProvider as Vp}from"styled-components";import bt,{useContext as Cp,useEffect as Lo,useState as Cr}from"react";import{useCallback as ht,useContext as Hl,useEffect as jl}from"react";import Yo,{useMemo as zr}from"react";var Ur="1.35.13 ";var Ne="NOT_STARTED_STEP",q="COMPLETED_FLOW",xo="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",ho="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(K);return{config:zr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Ur,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:zr(()=>`${o}/v1/public/`,[o])}}var Al="frigade-last-call-at-",Il="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=Al+o,n=Il+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as zl,useState as Wr}from"react";import{useContext as Ol,useEffect as Ll,useState as Dl}from"react";import $l from"swr";import{useContext as Nl}from"react";function we(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Nl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(b=>({...b,[d]:x}))}function p(d){t(x=>{let{[d]:b,...h}=x;return{...h}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,b])=>b&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Ml from"swr/immutable";var Ul="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Ol(K),{resetOpenFlowState:c}=we(),[l,g]=Dl(!1),d={data:n.map(k=>({flowId:k.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=k=>fetch(k,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${k}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),d)),b=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:h,isLoading:T,mutate:f,error:B}=p?Ml(b,x):$l(b,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=h==null?void 0:h.data;Ll(()=>{!l&&!T&&w&&g(!0)},[w,l,T]);async function S(k){if(w&&!p){let P=w.find(O=>O.flowId===k);P&&P.flowState!==q&&(P.flowState=q),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function A(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.stepStates[P]=O,I.flowState=xt),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function y(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.lastStepId=P,I.stepStates[P]=O,I.flowState=xt),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function m(k){if(w){let P=w.find(O=>O.flowId===k);P&&P.flowState!==Me&&(P.flowState=Me,P.lastStepId=Ul,Object.keys(P.stepStates).forEach(O=>{P.stepStates[O].actionType=Ne,P.stepStates[O].createdAt=new Date().toISOString()}),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1}),c(k))}}async function E(k,P){if(w){let O=w.find(I=>I.flowId===k);O&&O.stepStates[P]!==Ne&&(O.stepStates[P]=Ne),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:y,error:B}}function Xt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=zl(K),[c,l]=Wr(new Set),[g,d]=Wr(new Set),x=Nt();function b(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),l(c),g.add(f),d(g);let w=s==null?void 0:s.find(S=>S.flowSlug===f.flowSlug&&S.stepId===f.stepId&&S.actionType===f.actionType&&S.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(S=>{S.status!==200&&S.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):w||p(A=>[...A??[],f])})}async function h(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await b(f):f.actionType===q?await b(f):f.actionType===ho?await b(f):f.actionType===Ue?await b(f):f.actionType===xo?await b(f):f.actionType===Ne&&await b(f))}function T(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let w in B.stepStates){let S=B.stepStates[w];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:S.stepId,actionType:S.actionType,data:{},createdAt:new Date(S.createdAt),blocked:S.blocked,hidden:S.hidden})}}),[...f,...s]}return{addResponse:h,setFlowResponses:p,getFlowResponses:T}}import Vl from"swr";var Wl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,_r=e=>{let t=Wl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=_l(i,"'","");n.startsWith("flow_")&&(o=n)}),o},_l=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Hl(K),b={data:[]},{verifySDKInitiated:h}=Ot(),{addResponse:T,getFlowResponses:f}=Xt(),B=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),b)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),b)),{mutateUserFlowState:w,userFlowStatesData:S,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:P}=Be(),{data:O,error:I,isLoading:N}=Vl(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});jl(()=>{if(I){console.error(I);return}O&&O.data&&i(O.data)},[O,I]);function $(u){if(N)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!A&&!N?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function D(u){var W;if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),(((W=JSON.parse(C))==null?void 0:W.data)??[]).map(M=>{let $e=se(M);return{handleSecondaryButtonClick:()=>{M.skippable===!0&&j(u,M.id,{skipped:!0})},...M,complete:ge(u,M.id)===Ue||$e>=1,blocked:re(u,M.id),hidden:L(u,M.id),handlePrimaryButtonClick:()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&j(u,M.id)},progress:$e}}).filter(M=>M.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function U(u){if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),JSON.parse(C)??{}):[]}function te(u,C){p(v=>({...v,[u]:C}))}function fe(u){!A&&!N&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{te(C,u[C])})}let X=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:ho,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await P(u,C,W),T(W))},[r,S]),H=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ne,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await k(u,C),T(W))},[r,S]),j=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await E(u,C,W),T(W))},[r,S]),Ce=ht(async(u,C)=>{if(!h()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(v)&&T(v)},[r,S]),Ie=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&T(v)},[r,S]),be=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]),me=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xo,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]);function J(u){var C;if(!S&&u.actionType===Ne)return!1;if(S){let v=S.find(W=>W.flowId===u.flowSlug);if(u.actionType===Ne&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Ne)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,C){let v=V(u,C);return A?null:v?v.actionType:Ne}function re(u,C){let v=V(u,C);return v?v.blocked:!1}function L(u,C){let v=V(u,C);return v?v.hidden:!1}function V(u,C){if(A)return null;let v=S==null?void 0:S.find(W=>W.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function G(u){var v;if(A||!S)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=S.find(W=>W.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(W=>W.id===C):null}function ne(u){let C=G(u);if(!C)return 0;let v=D(u).findIndex(W=>W.id===C.id)??0;return ge(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function se(u){if(!u.completionCriteria)return;let C=_r(u.completionCriteria);if(C===null)return;let v=Ye(C),W=De(C);return W===0?void 0:v/W}function pe(u){let C=S==null?void 0:S.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(W=>ge(u,W.id)===Ue).length}function De(u){return D(u).length}function Et(u){let C=o.find(v=>v.slug===u);return C?JSON.parse(C.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&S){let C=S.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft($(u))}function gt(){r&&w()}return{getFlow:$,getFlowData:Et,isLoading:A||N,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:j,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:be,markFlowAborted:me,markStepNotStarted:H,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:De,targetingLogicShouldHideFlow:ft,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Xo,useContext as Gl,useEffect as Kl}from"react";var Lt="guest_";function Jt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Gl(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(h){return`frigade-user-registered-${h}`}Kl(()=>{if(e&&!t){if(e.startsWith(Lt))return;let h=g(e);localStorage.getItem(h)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(h,"true"))}},[e,r,t]);let d=Xo(async h=>{if(!l())return;let T={foreignId:e,properties:h};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(T)}),i(f=>({...f,...h})),p()},[e,n,r,p]),x=Xo(async(h,T)=>{if(!l())return;let B={foreignId:e,events:[{event:h,properties:T}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),b=Xo(async(h,T)=>{if(l())if(T){let f=g(h);localStorage.setItem(f,"true"),o(h);let B={foreignId:h,properties:T};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(w=>({...w,...T})),p()}else o(h)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:b,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as yp}from"uuid";import Ge,{useEffect as fp,useState as gp}from"react";import ze,{useEffect as er,useState as ta}from"react";import So from"styled-components";import ql from"react";import Yl from"styled-components";var Hr="fr-",Qt="cfr-";function a(e,t){let o=`${Hr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Qt+e}return o}function F(e){if(!e.className||e.className.indexOf(Qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Hr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Jo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Jo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Zt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Xl=Yl.div`
|
|
2
|
+
import wt,{createContext as Vp,useEffect as $o,useState as Oe}from"react";import{ThemeProvider as Gp}from"styled-components";import bt,{useContext as yp,useEffect as Lo,useState as yr}from"react";import{useCallback as ht,useContext as jl,useEffect as Vl}from"react";import Yo,{useMemo as Wr}from"react";var zr="1.35.15 ";var Ne="NOT_STARTED_STEP",q="COMPLETED_FLOW",xo="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",ho="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(K);return{config:Wr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":zr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Wr(()=>`${o}/v1/public/`,[o])}}var Il="frigade-last-call-at-",Nl="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=Il+o,n=Nl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Wl,useState as _r}from"react";import{useContext as Ll,useEffect as Dl,useState as $l}from"react";import Ml from"swr";import{useContext as Ol}from"react";function we(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Ol(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(b=>({...b,[d]:x}))}function p(d){t(x=>{let{[d]:b,...h}=x;return{...h}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,b])=>b&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Ul from"swr/immutable";var zl="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Ll(K),{resetOpenFlowState:c}=we(),[l,g]=$l(!1),d={data:n.map(k=>({flowId:k.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=k=>fetch(k,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${k}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),d)),b=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:h,isLoading:T,mutate:f,error:B}=p?Ul(b,x):Ml(b,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=h==null?void 0:h.data;Dl(()=>{!l&&!T&&w&&g(!0)},[w,l,T]);async function S(k){if(w&&!p){let P=w.find(O=>O.flowId===k);P&&P.flowState!==q&&(P.flowState=q),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function A(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.stepStates[P]=O,I.flowState=xt),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function y(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.lastStepId=P,I.stepStates[P]=O,I.flowState=xt),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function m(k){if(w){let P=w.find(O=>O.flowId===k);P&&P.flowState!==Me&&(P.flowState=Me,P.lastStepId=zl,Object.keys(P.stepStates).forEach(O=>{P.stepStates[O].actionType=Ne,P.stepStates[O].createdAt=new Date().toISOString()}),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1}),c(k))}}async function E(k,P){if(w){let O=w.find(I=>I.flowId===k);O&&O.stepStates[P]!==Ne&&(O.stepStates[P]=Ne),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:y,error:B}}function Xt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Wl(K),[c,l]=_r(new Set),[g,d]=_r(new Set),x=Nt();function b(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),l(c),g.add(f),d(g);let w=s==null?void 0:s.find(S=>S.flowSlug===f.flowSlug&&S.stepId===f.stepId&&S.actionType===f.actionType&&S.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(S=>{S.status!==200&&S.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):w||p(A=>[...A??[],f])})}async function h(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await b(f):f.actionType===q?await b(f):f.actionType===ho?await b(f):f.actionType===Ue?await b(f):f.actionType===xo?await b(f):f.actionType===Ne&&await b(f))}function T(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let w in B.stepStates){let S=B.stepStates[w];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:S.stepId,actionType:S.actionType,data:{},createdAt:new Date(S.createdAt),blocked:S.blocked,hidden:S.hidden})}}),[...f,...s]}return{addResponse:h,setFlowResponses:p,getFlowResponses:T}}import Gl from"swr";var _l=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Hr=e=>{let t=_l.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Hl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Hl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};var Xo=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Xo||{});function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=jl(K),b={data:[]},{verifySDKInitiated:h}=Ot(),{addResponse:T,getFlowResponses:f}=Xt(),B=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),b)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),b)),{mutateUserFlowState:w,userFlowStatesData:S,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:P}=Be(),{data:O,error:I,isLoading:N}=Gl(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});Vl(()=>{if(I){console.error(I);return}O&&O.data&&i(O.data)},[O,I]);function $(u){if(N)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!A&&!N?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function D(u){var W;if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),(((W=JSON.parse(C))==null?void 0:W.data)??[]).map(M=>{let $e=se(M);return{handleSecondaryButtonClick:()=>{M.skippable===!0&&j(u,M.id,{skipped:!0})},...M,complete:ge(u,M.id)===Ue||$e>=1,blocked:re(u,M.id),hidden:L(u,M.id),handlePrimaryButtonClick:()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&j(u,M.id)},progress:$e}}).filter(M=>M.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function U(u){if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),JSON.parse(C)??{}):[]}function te(u,C){p(v=>({...v,[u]:C}))}function fe(u){!A&&!N&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{te(C,u[C])})}let X=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:ho,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await P(u,C,W),T(W))},[r,S]),H=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ne,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await k(u,C),T(W))},[r,S]),j=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await E(u,C,W),T(W))},[r,S]),Ce=ht(async(u,C)=>{if(!h()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(v)&&T(v)},[r,S]),Ie=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&T(v)},[r,S]),be=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]),me=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xo,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]);function J(u){var C;if(!S&&u.actionType===Ne)return!1;if(S){let v=S.find(W=>W.flowId===u.flowSlug);if(u.actionType===Ne&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Ne)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,C){let v=V(u,C);return A?null:v?v.actionType:Ne}function re(u,C){let v=V(u,C);return v?v.blocked:!1}function L(u,C){let v=V(u,C);return v?v.hidden:!1}function V(u,C){if(A)return null;let v=S==null?void 0:S.find(W=>W.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function G(u){var v;if(A||!S)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=S.find(W=>W.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(W=>W.id===C):null}function ne(u){let C=G(u);if(!C)return 0;let v=D(u).findIndex(W=>W.id===C.id)??0;return ge(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function se(u){if(!u.completionCriteria)return;let C=Hr(u.completionCriteria);if(C===null)return;let v=Ye(C),W=De(C);return W===0?void 0:v/W}function pe(u){let C=S==null?void 0:S.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(W=>ge(u,W.id)===Ue).length}function De(u){return D(u).length}function Et(u){let C=o.find(v=>v.slug===u);return C?JSON.parse(C.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&S){let C=S.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft($(u))}function gt(){r&&w()}return{getFlow:$,getFlowData:Et,isLoading:A||N,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:j,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:be,markFlowAborted:me,markStepNotStarted:H,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:De,targetingLogicShouldHideFlow:ft,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Jo,useContext as Kl,useEffect as ql}from"react";var Lt="guest_";function Jt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Kl(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(h){return`frigade-user-registered-${h}`}ql(()=>{if(e&&!t){if(e.startsWith(Lt))return;let h=g(e);localStorage.getItem(h)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(h,"true"))}},[e,r,t]);let d=Jo(async h=>{if(!l())return;let T={foreignId:e,properties:h};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(T)}),i(f=>({...f,...h})),p()},[e,n,r,p]),x=Jo(async(h,T)=>{if(!l())return;let B={foreignId:e,events:[{event:h,properties:T}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),b=Jo(async(h,T)=>{if(l())if(T){let f=g(h);localStorage.setItem(f,"true"),o(h);let B={foreignId:h,properties:T};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(w=>({...w,...T})),p()}else o(h)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:b,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as Sp}from"uuid";import Ge,{useEffect as gp,useState as xp}from"react";import ze,{useEffect as tr,useState as oa}from"react";import So from"styled-components";import Yl from"react";import Xl from"styled-components";var jr="fr-",Qt="cfr-";function a(e,t){let o=`${jr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Qt+e}return o}function F(e){if(!e.className||e.className.indexOf(Qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(jr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Qo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Qo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Zt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Jl=Xl.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,Vr=({onClose:e,appearance:t})=>Yl.createElement(Jl,{className:a("modalBackground",t),onClick:()=>e()});import Zo from"react";import Ql from"styled-components";var Zl=Ql.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Te=()=>
|
|
30
|
+
`,Te=()=>Zo.createElement(Zl,null,Zo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Zo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as ra}from"react-portal";import ri from"react";import Ro from"react";function Rl({style:e,className:t}){return Ro.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Ro.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"}),Ro.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 Gr=Rl;import er from"styled-components";import Xe from"styled-components";var Co=Xe.div`
|
|
31
31
|
${e=>F(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -38,7 +38,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,ea=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -50,17 +50,17 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
50
50
|
right: 12px;
|
|
51
51
|
:hover {
|
|
52
52
|
opacity: 0.8;
|
|
53
|
-
}`,
|
|
53
|
+
}`,ta=`
|
|
54
54
|
display: block;
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
position: absolute;
|
|
57
57
|
top: 12px;
|
|
58
58
|
right: 12px;
|
|
59
|
-
`,
|
|
59
|
+
`,Kr=Xe.div`
|
|
60
60
|
${e=>F(e)} {
|
|
61
|
-
${e=>e.hasImage?
|
|
61
|
+
${e=>e.hasImage?ea:ta};
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
63
|
+
`,qr=Xe.img`
|
|
64
64
|
${e=>F(e)} {
|
|
65
65
|
display: block;
|
|
66
66
|
width: 100%;
|
|
@@ -68,7 +68,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
68
68
|
min-height: 200px;
|
|
69
69
|
object-fit: cover;
|
|
70
70
|
}
|
|
71
|
-
`,
|
|
71
|
+
`,Yr=Xe.div`
|
|
72
72
|
${e=>F(e)} {
|
|
73
73
|
display: block;
|
|
74
74
|
width: 100%;
|
|
@@ -76,19 +76,19 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
76
76
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
77
77
|
object-fit: cover;
|
|
78
78
|
}
|
|
79
|
-
`,
|
|
79
|
+
`,Xr=Xe.div`
|
|
80
80
|
display: flex;
|
|
81
81
|
flex-direction: row;
|
|
82
82
|
justify-content: space-between;
|
|
83
83
|
align-content: center;
|
|
84
|
-
`,Xr=Xe.div`
|
|
85
|
-
padding: 22px 22px 12px;
|
|
86
84
|
`,Jr=Xe.div`
|
|
85
|
+
padding: 22px 22px 12px;
|
|
86
|
+
`,Qr=Xe.div`
|
|
87
87
|
display: flex;
|
|
88
88
|
flex: 1;
|
|
89
89
|
flex-direction: column;
|
|
90
90
|
justify-content: center;
|
|
91
|
-
`,
|
|
91
|
+
`,Zr=Xe.div`
|
|
92
92
|
display: flex;
|
|
93
93
|
flex: 2;
|
|
94
94
|
flex-shrink: 1;
|
|
@@ -100,7 +100,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
100
100
|
align-content: center;
|
|
101
101
|
align-items: center;
|
|
102
102
|
}
|
|
103
|
-
`,
|
|
103
|
+
`,Rr=Xe.p`
|
|
104
104
|
${e=>F(e)} {
|
|
105
105
|
font-style: normal;
|
|
106
106
|
font-weight: 600;
|
|
@@ -109,7 +109,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
109
109
|
color: #808080;
|
|
110
110
|
}
|
|
111
111
|
margin: 0;
|
|
112
|
-
`;var
|
|
112
|
+
`;var ei=er.div`
|
|
113
113
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
114
114
|
position: absolute;
|
|
115
115
|
bottom: -47px;
|
|
@@ -120,7 +120,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
120
120
|
align-items: center;
|
|
121
121
|
justify-content: center;
|
|
122
122
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
123
|
-
`,
|
|
123
|
+
`,ti=er(Co)`
|
|
124
124
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
125
125
|
position: absolute;
|
|
126
126
|
bottom: -60px;
|
|
@@ -133,7 +133,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
133
133
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
134
134
|
padding: 0;
|
|
135
135
|
z-index: ${e=>e.zIndex};
|
|
136
|
-
`,
|
|
136
|
+
`,oi=er.div`
|
|
137
137
|
display: flex;
|
|
138
138
|
justify-content: center;
|
|
139
139
|
align-items: center;
|
|
@@ -142,7 +142,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
142
142
|
font-size: 12px;
|
|
143
143
|
line-height: 18px;
|
|
144
144
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
145
|
-
`;function yo({appearance:e}){return
|
|
145
|
+
`;function yo({appearance:e}){return ri.createElement(oi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",ri.createElement(Gr,null))}var ia=So.div`
|
|
146
146
|
${e=>F(e)} {
|
|
147
147
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
148
148
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -184,10 +184,10 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
184
184
|
opacity: 1;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
`,
|
|
187
|
+
`,na=So.div`
|
|
188
188
|
position: relative;
|
|
189
189
|
flex: 0 1 auto;
|
|
190
|
-
`,
|
|
190
|
+
`,sa=So.div`
|
|
191
191
|
position: absolute;
|
|
192
192
|
top: 16px;
|
|
193
193
|
right: 16px;
|
|
@@ -197,14 +197,14 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
197
197
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
198
198
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
199
199
|
}
|
|
200
|
-
`,
|
|
200
|
+
`,la=So.div`
|
|
201
201
|
overflow: scroll;
|
|
202
202
|
flex: 1 1;
|
|
203
203
|
display: flex;
|
|
204
204
|
::-webkit-scrollbar {
|
|
205
205
|
display: none;
|
|
206
206
|
}
|
|
207
|
-
`,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=
|
|
207
|
+
`,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=oa("");return tr(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),tr(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),tr(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?ze.createElement(ra,null,ze.createElement(Vr,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(ia,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&ze.createElement(sa,{className:a("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(Te,null)),o&&ze.createElement(na,null,o),ze.createElement(la,null,r),p&&ze.createElement(ei,{appearance:n,className:a("poweredByFrigadeRibbon",n)},ze.createElement(yo,{appearance:n})))):ze.createElement(ze.Fragment,null)};import nt,{useEffect as or,useState as aa}from"react";import bo from"styled-components";import{Portal as pa}from"react-portal";function da(e){switch(e){case"top-left":return`
|
|
208
208
|
top: 0;
|
|
209
209
|
left: 0;
|
|
210
210
|
`;case"top-right":return`
|
|
@@ -213,7 +213,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
213
213
|
`;case"bottom-left":return`
|
|
214
214
|
bottom: 0;
|
|
215
215
|
left: 0;
|
|
216
|
-
`}return"right: 0; bottom: 0;"}var
|
|
216
|
+
`}return"right: 0; bottom: 0;"}var ca=bo.div`
|
|
217
217
|
${e=>F(e)} {
|
|
218
218
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
219
219
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -227,12 +227,12 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
227
227
|
width: 350px;
|
|
228
228
|
padding: 24px;
|
|
229
229
|
}
|
|
230
|
-
${e=>
|
|
230
|
+
${e=>da(e.modalPosition)}
|
|
231
231
|
margin: 28px;
|
|
232
|
-
`,
|
|
232
|
+
`,ma=bo.div`
|
|
233
233
|
position: relative;
|
|
234
234
|
flex: 1;
|
|
235
|
-
`,
|
|
235
|
+
`,ua=bo.div`
|
|
236
236
|
position: absolute;
|
|
237
237
|
top: 16px;
|
|
238
238
|
right: 16px;
|
|
@@ -242,13 +242,13 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
242
242
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
243
243
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
244
244
|
}
|
|
245
|
-
`,
|
|
245
|
+
`,fa=bo.div`
|
|
246
246
|
overflow: scroll;
|
|
247
247
|
flex: 5;
|
|
248
248
|
::-webkit-scrollbar {
|
|
249
249
|
display: none;
|
|
250
250
|
}
|
|
251
|
-
`,wo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=
|
|
251
|
+
`,wo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=aa("");return or(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),or(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),or(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?nt.createElement(pa,null,nt.createElement(ca,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&nt.createElement(ua,{className:a("cornerModalClose",r),onClick:()=>e()},nt.createElement(Te,null)),o&&nt.createElement(ma,null,o),nt.createElement(fa,null,i))):nt.createElement(nt.Fragment,null)};import{useContext as ga}from"react";function Q(){let{defaultAppearance:e}=ga(K);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Ct,{useContext as Ua,useEffect as za,useState as cr}from"react";import vo from"styled-components";import ko,{useEffect as xa,useState as pi}from"react";import nr from"styled-components";import To from"styled-components";var ii=To.label`
|
|
252
252
|
${e=>F(e)} {
|
|
253
253
|
font-size: 12px;
|
|
254
254
|
line-height: 18px;
|
|
@@ -259,14 +259,14 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
259
259
|
letter-spacing: 0.24px;
|
|
260
260
|
}
|
|
261
261
|
display: flex;
|
|
262
|
-
`,
|
|
262
|
+
`,ni=To.label`
|
|
263
263
|
${e=>F(e)} {
|
|
264
264
|
font-size: 12px;
|
|
265
265
|
line-height: 20px;
|
|
266
266
|
margin-bottom: 5px;
|
|
267
267
|
}
|
|
268
268
|
display: flex;
|
|
269
|
-
`,
|
|
269
|
+
`,si=To.span`
|
|
270
270
|
font-weight: 400;
|
|
271
271
|
font-size: 14px;
|
|
272
272
|
line-height: 22px;
|
|
@@ -279,11 +279,11 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
279
279
|
align-items: flex-start;
|
|
280
280
|
justify-content: left;
|
|
281
281
|
margin-bottom: 10px;
|
|
282
|
-
`;import
|
|
282
|
+
`;import rr from"react";var Je={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function st({title:e,required:t,appearance:o=Je}){return e?rr.createElement(Fo,null,t?rr.createElement(si,{className:a("formLabelRequired",o),appearance:o},"*"):null,rr.createElement(ii,{className:a("formLabel",o)},e)):null}import li from"react";function Dt({title:e,appearance:t}){return e?li.createElement(Fo,null,li.createElement(ni,{className:a("formSubLabel",t)},e)):null}import{z as ir}from"zod";function ai(e,t){try{if(t){if(t.type=="number"){let o=ir.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=ir.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 ir.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 ha=nr.div`
|
|
283
283
|
display: flex;
|
|
284
284
|
flex-direction: column;
|
|
285
285
|
width: 100%;
|
|
286
|
-
`,nr
|
|
286
|
+
`,sr=nr.input`
|
|
287
287
|
${e=>F(e)} {
|
|
288
288
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
289
289
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -299,7 +299,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
299
299
|
box-sizing: border-box;
|
|
300
300
|
padding: 0 10px;
|
|
301
301
|
margin-bottom: 10px;
|
|
302
|
-
`,
|
|
302
|
+
`,Ca=nr.textarea`
|
|
303
303
|
${e=>F(e)} {
|
|
304
304
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
305
305
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -315,13 +315,13 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
315
315
|
min-height: 70px;
|
|
316
316
|
box-sizing: border-box;
|
|
317
317
|
margin-bottom: 10px;
|
|
318
|
-
`;function
|
|
318
|
+
`;function lr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=pi((r==null?void 0:r.text)||""),[c,l]=pi(!1),g=sr;xa(()=>{s===""&&!c&&(l(!0),d(""))},[]);function d(b){if(p(b),o({text:b}),n.required===!0&&b.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let h=ai(b,n.validation);if(h){i([{id:n.id,message:h}]);return}i([])}n.multiline&&(g=Ca);function x(){var b;switch((b=n==null?void 0:n.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return ko.createElement(ha,null,ko.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),ko.createElement(g,{className:a("inputComponent",t.appearance),value:s,onChange:b=>{d(b.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:x()}),ko.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as di,useState as ci}from"react";import mi from"styled-components";var ar="",ya=mi.div`
|
|
319
319
|
display: flex;
|
|
320
320
|
flex-direction: column;
|
|
321
321
|
width: 100%;
|
|
322
322
|
-webkit-appearance: none;
|
|
323
323
|
appearance: none;
|
|
324
|
-
`,
|
|
324
|
+
`,Sa=mi.select`
|
|
325
325
|
${e=>F(e)} {
|
|
326
326
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
327
327
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -342,15 +342,15 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
342
342
|
background-repeat: no-repeat;
|
|
343
343
|
background-size: 1.5em 1.5em;
|
|
344
344
|
-webkit-print-color-adjust: exact;
|
|
345
|
-
`;function
|
|
345
|
+
`;function ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,b,h,T;let n=e,[s,p]=ci(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=ci(!1);return di(()=>{var f,B,w,S;if(s===""&&!c){if(l(!0),n.requireSelection){p(ar);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(B=n.props.options)==null?void 0:B.find(y=>y.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((w=n.props.options)==null?void 0:w[0].id)||""),o({choice:[((S=n.props.options)==null?void 0:S[0].id)||""]})}},[]),di(()=>{n.requireSelection&&s===ar?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(ya,null,je.createElement(st,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(Sa,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:ar,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>je.createElement("option",{key:f.id,value:f.id},f.title))),((b=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:b.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(st,{title:((T=(h=n.props.options)==null?void 0:h.find(f=>f.id===s))==null?void 0:T.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(sr,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import to,{useEffect as pr,useState as gi}from"react";import xi from"styled-components";import eo from"react";import Rt from"react";var fi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return Rt.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},ba=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>Rt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Rt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Rt.createElement(fi,{color:r,size:t}),Rt.createElement(fi,{color:e,percentage:o,size:t})),i),$t=ba;import wa from"styled-components";var Ta=({color:e="#FFFFFF"})=>eo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Fa={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ka={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Pa={border:"1px solid #000000",color:"#FFFFFF"},va={border:"1px solid #C5CBD3"},Ba={color:"#FFFFFF"},Ea={border:"1px solid #C5CBD3"},Aa=e=>e==="square"?Fa:ka,Ia=(e,t)=>e==="square"?t?Pa:va:t?Ba:Ea,Na=wa.div`
|
|
346
346
|
${e=>ke(e)}
|
|
347
|
-
`,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=
|
|
347
|
+
`,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Aa(t),c=Ia(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?eo.createElement($t,{fillColor:o,percentage:i,size:22}):eo.createElement(Na,{styleOverrides:p,style:n,role:"checkbox",className:xe(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&eo.createElement(Ta,{color:"#FFFFFF"}))};var Oa=xi.div`
|
|
348
348
|
display: flex;
|
|
349
349
|
flex-direction: column;
|
|
350
350
|
width: 100%;
|
|
351
351
|
-webkit-appearance: none;
|
|
352
352
|
appearance: none;
|
|
353
|
-
`,
|
|
353
|
+
`,La=xi.button`
|
|
354
354
|
${e=>F(e)} {
|
|
355
355
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
356
356
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -375,7 +375,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
375
375
|
height: 48px;
|
|
376
376
|
padding: 0 18px;
|
|
377
377
|
margin-bottom: 10px;
|
|
378
|
-
`;function
|
|
378
|
+
`;function hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=gi((i==null?void 0:i.choice)||[]),[c,l]=gi(!1);return pr(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),pr(()=>{o({choice:s})},[s]),pr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),to.createElement(Oa,null,to.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>to.createElement(La,{appearance:t.appearance,className:a("multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,to.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),to.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Po from"react";import Ci from"styled-components";import Da from"dompurify";function le(e){return{__html:Da.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var $a=Ci.h1`
|
|
379
379
|
${e=>F(e)} {
|
|
380
380
|
font-style: normal;
|
|
381
381
|
font-weight: 700;
|
|
@@ -387,7 +387,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
387
387
|
margin-bottom: 4px;
|
|
388
388
|
color: ${e=>e.appearance.theme.colorText};
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
`,Ma=Ci.h2`
|
|
391
391
|
${e=>F(e)} {
|
|
392
392
|
font-style: normal;
|
|
393
393
|
font-weight: 400;
|
|
@@ -396,42 +396,42 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
396
396
|
letter-spacing: 0.28px;
|
|
397
397
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
398
398
|
}
|
|
399
|
-
`;function Fe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Po.createElement(Po.Fragment,null,Po.createElement(
|
|
399
|
+
`;function Fe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Po.createElement(Po.Fragment,null,Po.createElement($a,{appearance:e,className:a(`${r}${r?Zt(i):i}Title`,e),dangerouslySetInnerHTML:le(t),size:i}),o&&Po.createElement(Ma,{appearance:e,className:a(`${r}${r?Zt(i):i}Subtitle`,e),dangerouslySetInnerHTML:le(o),size:i}))}import*as dr from"react";var yi=e=>dr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},dr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var Wa=vo.div`
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: column;
|
|
402
402
|
justify-content: flex-end;
|
|
403
403
|
overflow: visible;
|
|
404
404
|
padding-top: 14px;
|
|
405
|
-
`,
|
|
405
|
+
`,_a=vo.div`
|
|
406
406
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
407
407
|
font-size: 12px;
|
|
408
408
|
margin-bottom: 12px;
|
|
409
409
|
display: flex;
|
|
410
410
|
align-items: center;
|
|
411
|
-
`,
|
|
411
|
+
`,Ha=vo.div`
|
|
412
412
|
margin-right: 4px;
|
|
413
413
|
display: inline-flex;
|
|
414
|
-
`,
|
|
414
|
+
`,ja=vo.div`
|
|
415
415
|
padding-left: 1px;
|
|
416
416
|
padding-right: 1px;
|
|
417
|
-
`,
|
|
417
|
+
`,Va={text:lr,multipleChoice:ui,multipleChoiceList:hi},mr="frigade-multiInputStepTypeData";function Si({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var y;let c=t.props,[l,g]=cr([]),[d,x]=cr([]),{userId:b}=Jt(),[h,T]=cr(S()||(p?p[t.id]:null)||{}),{readonly:f}=Ua(K),B={...Va,...s};za(()=>{i(l.length===0)},[l,i]);function w(m,E){let k={...h,[m.id]:E};T(k),r(k),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(k))}function S(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${mr}-${e}-${t.id}-${b}`}return Ct.createElement(ja,{className:a("multiInput",n)},Ct.createElement(Fe,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(Wa,{className:a("multiInputContainer",n)},(y=c.data)==null?void 0:y.map(m=>{var k;let E=(k=l.reverse().find(P=>P.id===m.id))==null?void 0:k.message;return B[m.type]?Ct.createElement("span",{key:m.id,"data-field-id":m.id,className:a("multiInputField",n)},B[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:P=>{!d.includes(m.id)&&P&&(P==null?void 0:P.text)!==""&&x(O=>[...O,m.id]),w(m,P)},inputData:h[m.id],setFormValidationErrors:P=>{g(O=>P.length===0?O.filter(I=>I.id!==m.id):[...O,...P])}}),E&&d.includes(m.id)&&Ct.createElement(_a,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:m.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(Ha,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(yi,null)),E)):null})))}import yt from"styled-components";var bi=yt.div`
|
|
418
418
|
align-items: center;
|
|
419
419
|
display: flex;
|
|
420
420
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
421
421
|
padding-top: 14px;
|
|
422
|
-
`,
|
|
422
|
+
`,wi=yt.div`
|
|
423
423
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
424
424
|
font-size: 12px;
|
|
425
|
-
`,
|
|
425
|
+
`,Ti=yt.div`
|
|
426
426
|
display: flex;
|
|
427
427
|
gap: 12px;
|
|
428
428
|
width: 100%;
|
|
429
429
|
justify-content: flex-end;
|
|
430
|
-
`,
|
|
430
|
+
`,Fi=yt.div`
|
|
431
431
|
display: flex;
|
|
432
432
|
flex-direction: row;
|
|
433
433
|
flex: 1 1;
|
|
434
|
-
`,
|
|
434
|
+
`,ki=yt.div`
|
|
435
435
|
display: flex;
|
|
436
436
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
437
437
|
// Otherwise, use 4px padding
|
|
@@ -439,11 +439,11 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
439
439
|
flex-grow: 1;
|
|
440
440
|
flex-basis: 0;
|
|
441
441
|
position: relative;
|
|
442
|
-
`,
|
|
442
|
+
`,Pi=yt.div`
|
|
443
443
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
444
444
|
position: relative;
|
|
445
445
|
overflow-y: auto;
|
|
446
|
-
`,
|
|
446
|
+
`,vi=yt.div`
|
|
447
447
|
display: flex;
|
|
448
448
|
align-self: stretch;
|
|
449
449
|
flex-grow: 1;
|
|
@@ -455,7 +455,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
455
455
|
background-position: center;
|
|
456
456
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
457
457
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
|
-
`;import lt from"react";import
|
|
458
|
+
`;import lt from"react";import Ga from"react";import Bi from"styled-components";var Ka=Bi.button`
|
|
459
459
|
justify-content: center;
|
|
460
460
|
align-content: center;
|
|
461
461
|
${e=>F(e)} {
|
|
@@ -486,7 +486,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
486
486
|
opacity: 0.3;
|
|
487
487
|
cursor: not-allowed;
|
|
488
488
|
}
|
|
489
|
-
`,Bo=
|
|
489
|
+
`,Bo=Bi.div`
|
|
490
490
|
${e=>F(e)} {
|
|
491
491
|
display: flex;
|
|
492
492
|
flex-direction: row;
|
|
@@ -497,14 +497,14 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
497
497
|
margin-right: 8px;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
`,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Zt(d)}`}return
|
|
500
|
+
`,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Zt(d)}`}return Ga.createElement(Ka,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var Ei=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return lt.createElement(lt.Fragment,null,l!==null&&l!=null&<.createElement(wi,{appearance:o,className:a("formCTAError",o)},l),lt.createElement(bi,{showBackButton:g,className:a("formCTAContainer",o)},g&<.createElement(Z,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),lt.createElement(Ti,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?lt.createElement(Z,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?lt.createElement(Z,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import ur from"react";import qa from"styled-components";var Ya=qa.div`
|
|
501
501
|
text-align: center;
|
|
502
|
-
`,
|
|
502
|
+
`,Ai=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return ur.createElement(Ya,{className:o},ur.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>ur.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import St from"react";import Mt from"styled-components";import{useContext as Xa}from"react";function ie(){let e=Xa(K);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Ja=Mt.div`
|
|
503
503
|
display: flex;
|
|
504
504
|
flex-wrap: wrap;
|
|
505
505
|
align-content: center;
|
|
506
506
|
justify-content: center;
|
|
507
|
-
`,
|
|
507
|
+
`,Qa=Mt.div`
|
|
508
508
|
align-content: center;
|
|
509
509
|
align-items: center;
|
|
510
510
|
display: flex;
|
|
@@ -518,10 +518,10 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
518
518
|
flex-basis: 255px;
|
|
519
519
|
flex-grow: 0;
|
|
520
520
|
flex-shrink: 0;
|
|
521
|
-
`,
|
|
521
|
+
`,Za=Mt.img`
|
|
522
522
|
width: 78px;
|
|
523
523
|
height: auto;
|
|
524
|
-
`,
|
|
524
|
+
`,Ra=Mt.button`
|
|
525
525
|
font-style: normal;
|
|
526
526
|
font-weight: 600;
|
|
527
527
|
font-size: 13px;
|
|
@@ -534,11 +534,11 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
534
534
|
border-radius: 100px;
|
|
535
535
|
padding: 8px 12px;
|
|
536
536
|
margin-top: 16px;
|
|
537
|
-
`,
|
|
537
|
+
`,ep=Mt.h1`
|
|
538
538
|
font-weight: 700;
|
|
539
539
|
font-size: 28px;
|
|
540
540
|
line-height: 34px;
|
|
541
|
-
`,
|
|
541
|
+
`,tp=Mt.h2`
|
|
542
542
|
font-style: normal;
|
|
543
543
|
font-weight: 400;
|
|
544
544
|
font-size: 16px;
|
|
@@ -547,7 +547,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
547
547
|
margin-top: 12px;
|
|
548
548
|
margin-bottom: 16px;
|
|
549
549
|
max-width: 70%;
|
|
550
|
-
`;function
|
|
550
|
+
`;function Ii({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return St.createElement("div",null,St.createElement(ep,null,e.title),St.createElement(tp,null,e.subtitle),St.createElement(Ja,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>St.createElement(Qa,{key:n.title},St.createElement(Za,{src:n.imageUri}),St.createElement(Ra,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Ut,{useEffect as ap}from"react";import Io from"styled-components";import fr from"react";var Eo=({style:e,className:t})=>fr.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},fr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),fr.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 oo,{useRef as op,useState as rp}from"react";import Ao from"styled-components";var ip=Ao.div`
|
|
551
551
|
display: flex;
|
|
552
552
|
align-items: center;
|
|
553
553
|
justify-content: flex-start;
|
|
@@ -555,7 +555,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
555
555
|
width: 100%;
|
|
556
556
|
height: 100%;
|
|
557
557
|
position: relative;
|
|
558
|
-
`,
|
|
558
|
+
`,np=Ao.div`
|
|
559
559
|
position: absolute;
|
|
560
560
|
display: flex;
|
|
561
561
|
align-items: center;
|
|
@@ -574,56 +574,56 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
574
574
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
575
575
|
border-radius: 50%;
|
|
576
576
|
}
|
|
577
|
-
`,
|
|
577
|
+
`,sp=Ao.video`
|
|
578
578
|
width: 100%;
|
|
579
579
|
height: 100%;
|
|
580
580
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
581
|
-
`,
|
|
581
|
+
`,lp=Ao.iframe`
|
|
582
582
|
width: 100%;
|
|
583
583
|
height: 100%;
|
|
584
584
|
min-height: 260px;
|
|
585
585
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
586
|
-
`;function Ve({appearance:e,videoUri:t}){let o=
|
|
586
|
+
`;function Ve({appearance:e,videoUri:t}){let o=op(),[i,r]=rp(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),oo.createElement(lp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return oo.createElement(ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&oo.createElement(np,{onClick:()=>{r(!0),o.current.play()},appearance:e},oo.createElement(Eo,null)),oo.createElement(sp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var pp=Io.div`
|
|
587
587
|
${e=>F(e)} {
|
|
588
588
|
display: flex;
|
|
589
589
|
flex-direction: column;
|
|
590
590
|
justify-content: center;
|
|
591
591
|
}
|
|
592
|
-
`,
|
|
592
|
+
`,dp=Io.img`
|
|
593
593
|
${e=>F(e)} {
|
|
594
594
|
width: 100%;
|
|
595
595
|
height: auto;
|
|
596
596
|
max-height: 250px;
|
|
597
597
|
margin-bottom: 24px;
|
|
598
598
|
}
|
|
599
|
-
`,
|
|
599
|
+
`,cp=Io.div`
|
|
600
600
|
${e=>F(e)} {
|
|
601
601
|
margin-bottom: 24px;
|
|
602
602
|
}
|
|
603
|
-
`,
|
|
603
|
+
`,mp=Io.div`
|
|
604
604
|
${e=>F(e)} {
|
|
605
605
|
width: 100%;
|
|
606
606
|
height: auto;
|
|
607
607
|
max-height: 250px;
|
|
608
608
|
margin-bottom: 24px;
|
|
609
609
|
}
|
|
610
|
-
`;function
|
|
610
|
+
`;function Ni({stepData:e,appearance:t,setCanContinue:o}){return ap(()=>{o(!0)},[]),Ut.createElement(pp,{className:a("callToActionContainer",t)},Ut.createElement(cp,{className:a("callToActionTextContainer",t)},Ut.createElement(Fe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Ut.createElement(dp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Ut.createElement(mp,{appearance:t,className:a("callToActionVideo",t)},Ut.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as gr,useState as xr}from"react";import at from"styled-components";var Oi=at.div`
|
|
611
611
|
width: auto;
|
|
612
612
|
display: flex;
|
|
613
613
|
flex-direction: column;
|
|
614
614
|
justify-content: center;
|
|
615
615
|
align-items: center;
|
|
616
616
|
padding: 4px;
|
|
617
|
-
`,
|
|
617
|
+
`,Li=at.div`
|
|
618
618
|
width: 100%;
|
|
619
619
|
text-align: left;
|
|
620
|
-
`,
|
|
620
|
+
`,Di=at.h1`
|
|
621
621
|
font-style: normal;
|
|
622
622
|
font-weight: 700;
|
|
623
623
|
font-size: 32px;
|
|
624
624
|
line-height: 38px;
|
|
625
625
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
626
|
-
|
|
626
|
+
`,$i=at.h1`
|
|
627
627
|
font-style: normal;
|
|
628
628
|
font-weight: 400;
|
|
629
629
|
font-size: 16px;
|
|
@@ -631,7 +631,7 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
631
631
|
margin-top: 16px;
|
|
632
632
|
margin-bottom: 16px;
|
|
633
633
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
634
|
-
|
|
634
|
+
`,Mi=at.div`
|
|
635
635
|
padding-top: 12px;
|
|
636
636
|
padding-bottom: 12px;
|
|
637
637
|
flex-direction: row;
|
|
@@ -642,17 +642,17 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
642
642
|
cursor: pointer;
|
|
643
643
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
644
644
|
width: 100%;
|
|
645
|
-
`,
|
|
645
|
+
`,Ui=at.div`
|
|
646
646
|
padding-top: 10px;
|
|
647
647
|
padding-bottom: 10px;
|
|
648
648
|
flex-direction: row;
|
|
649
649
|
display: flex;
|
|
650
650
|
justify-content: flex-start;
|
|
651
|
-
`,
|
|
651
|
+
`,zi=at.img`
|
|
652
652
|
width: 42px;
|
|
653
653
|
height: 42px;
|
|
654
654
|
margin-right: 12px;
|
|
655
|
-
`,
|
|
655
|
+
`,Wi=at.p`
|
|
656
656
|
font-style: normal;
|
|
657
657
|
font-weight: 500;
|
|
658
658
|
font-size: 17px;
|
|
@@ -660,8 +660,8 @@ import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import
|
|
|
660
660
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
661
661
|
display: flex;
|
|
662
662
|
align-self: center;
|
|
663
|
-
`;var
|
|
664
|
-
${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map(([s,p])=>`${Jo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return io.createElement(o,{inlineStyles:t})}var _i=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:b=!1,modalPosition:h="center",repeatable:T=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:w=!1,validationHandler:S,showFrigadeBranding:A=!1,onFormDataChange:y,showFooter:m=!0,prefillData:E={}})=>{let{getFlow:k,getFlowSteps:P,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:N,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),U=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=gp(!1),{setOpenFlowState:H,getOpenFlowState:j,hasOpenModals:Ce}=we();c=te(c);let[Ie,be]=i!==void 0&&r!==void 0?[i,r]:[j(e,!0),re=>H(e,re)];if(fp(()=>{!fe&&!O&&(X(!0),N(e)===q&&T&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(cr)&&window.localStorage.removeItem(L)})),X(!0))},[fe,X,O]),O)return null;let me=k(e);if(!me||I(me))return null;let J=P(e);if(!J||i!==void 0&&i===!1||N(e)===q&&l||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{be(!1),f&&f(),b===!0&&D(e)};if(h=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ie,style:re,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))}return o==="modal"&&h!=="center"?Ge.createElement(wo,{appearance:c,onClose:ge,visible:Ie,modalPosition:h},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))},Hi=_i;import{useCallback as xr,useContext as xp,useEffect as hp}from"react";function hr(){let{organizationId:e,userId:t,setOrganizationId:o}=xp(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=_e(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,b){return`frigade-user-group-registered-${x}-${b}`}hp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=xr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()},[e,t,r,i]),g=xr(async(x,b)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let T={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:b}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()},[e,t,r,i]),d=xr(async(x,b)=>{if(p())if(b){let h=c(t,x);localStorage.setItem(h,"true"),o(x);let T={foreignUserId:t,foreignUserGroupId:x,properties:b};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var ji="frigade-xFrigade_guestUserId",no="frigade-xFrigade_userId",Vi=({})=>{let{setFlowResponses:e}=Xt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=Jt(),[s,p]=Cr(null),{getFlowStatus:c}=Y(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Cp(K),[b,h]=Cr([]),[T,f]=Cr([]),{organizationId:B}=hr();Lo(()=>{if(!o&&t)for(let y=0;y<t.length;y++){let m=t[y],E=l.find(k=>k.slug===(m==null?void 0:m.flowId));if(E&&m&&m.shouldTrigger===!0&&E.type=="FORM"&&E.triggerType==="AUTOMATIC"&&!T.includes(E.slug)){setTimeout(()=>{w(m.flowId)},500);break}}},[o,t]),Lo(()=>{x.length>0&&i()},[x]);function w(y){let m=l.find(E=>E.slug===y);m&&m.triggerType==="AUTOMATIC"&&!T.includes(m.slug)&&(f([...T,m.slug]),h([m]))}function S(){if(!r){let y=localStorage.getItem(no);if(y){n(y);return}let m=localStorage.getItem(ji);if(m){n(m);return}d(!0);let E=Lt+yp();try{localStorage.setItem(ji,E)}catch(k){console.log("Failed to save guest user id locally: Local storage unavailable",k)}n(k=>k||E)}}Lo(()=>{try{if(l){let y=[];l.forEach(m=>{if(m.data){let E=m.data.match(/"imageUri":"(.*?)"/g);E&&E.forEach(k=>{let P=k.replace('"imageUri":"',"").replace('"',"");if(y.includes(P))return;let O=new Image;O.src=P,y.push(P)})}})}}catch{}},[l]),Lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(no,r)}catch(y){console.log("Failed to save user id locally: Local storage available",y)}r===null&&setTimeout(()=>{r===null&&S()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,b.map(y=>c(y.slug)!==Me?null:bt.createElement("span",{key:y.slug},bt.createElement(Hi,{flowId:y.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as Gp}from"react-error-boundary";import so from"core-js-pure/actual/structured-clone";function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!yr(t)||!yr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([r,n])=>{yr(n)?i[r]!==void 0?Object.assign(i,{[r]:pt(i[r],so(n))}):Object.assign(i,{[r]:so(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...so(n)]}):Object.assign(i,{[r]:so(n)}):Object.assign(i,{[r]:n})}),i}var Gi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function Sp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Gi[o]){let r=Gi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function bp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Ki(e){let{theme:t,styleOverrides:o}=e,i=Sp(t),r=bp(o);return{overrides:i,css:r}}import Dp from"styled-components";import{compose as $p,variant as Yi}from"styled-system";import qi from"react";import wp,{ThemeProvider as Tp,useTheme as Fp}from"styled-components";import{border as kp,color as Pp,compose as vp,get as Bp,shadow as Ep,space as Ap,system as Ip,typography as Np}from"styled-system";var Op={width:{property:"width",scale:"sizes",transform:(e,t)=>Bp(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},Lp=wp("div")(({css:e})=>e,vp(kp,Pp,Ep,Ap,Np,Ip(Op))),lo=({as:e,children:t,overrides:o,...i})=>{let r=Fp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>qi.createElement(Lp,{as:e,...n,...i},t);if(o!==void 0){let p=pt(r,o);return qi.createElement(Tp,{theme:p},s())}return s()};var ao={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Mp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Xi=Dp(lo)(()=>({whiteSpace:"nowrap"}),$p(Yi({scale:"components.Button",variants:"components.Button"}),Yi({prop:"size",variants:Mp})));import Up from"styled-components";import{variant as zp,system as Wp}from"styled-system";var Do={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Ji=Up(lo)(zp({scale:"components.Text",variants:"components.Text"}),Wp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Qi=4,Zi="px",_p=20,Hp=Object.fromEntries(Array.from(Array(_p+1),(e,t)=>t===0?[.5,`${.5*Qi}${Zi}`]:[t,`${t*Qi}${Zi}`])),zt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Sr={colors:{...zt,neutral:{foreground:zt.gray300},primary:{background:zt.blue500,foreground:zt.white,inverted:zt.blue500},negative:{foreground:zt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Hp,components:{Button:ao,Text:Do}};var Ri="https://api.frigade.com",K=jp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Ri,readonly:!1});function Kp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var qp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[l,g]=Oe([]),[d,x]=Oe([]),[b,h]=Oe([]),[T,f]=Oe({}),[B,w]=Oe({}),[S,A]=Oe([]),[y,m]=Oe({}),[E,k]=Oe(!1),[P,O]=Oe(!1),[I,N]=Oe(!ee(e)),$=(H,j)=>{if(j==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},50)},D={theme:{...Je.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Je.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}$o(()=>{t&&s(t)},[t]),$o(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(no)&&window.localStorage.getItem(no)!==n&&Kp()},[n]),$o(()=>{o&&c(o)},[o]),$o(()=>{if(ee(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:b,setFlowResponses:h,userProperties:T,setUserProperties:f,openFlowStates:B,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:S,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:y,setCustomVariables:m,isNewGuestUser:E,setIsNewGuestUser:k,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:I,setShouldGracefullyDegrade:N,apiUrl:i&&i.apiUrl?i.apiUrl:Ri,readonly:i&&i.readonly?i.readonly:!1};if(I)return wt.createElement(K.Provider,{value:U},r);let{overrides:te}=Ki(D);return wt.createElement(Gp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(K.Provider,{value:U},wt.createElement(Vp,{theme:pt(D.theme,Sr,te??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(Vi,null))))};import $d from"react";import ce,{useEffect as Es,useState as As}from"react";import We,{useState as cd}from"react";import kt from"styled-components";import zo from"react";import Tt from"react";import tn from"styled-components";var en=tn.span`
|
|
663
|
+
`;var _i=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=xr([]),[p,c]=xr(!1),[l,g]=xr(e.id);return gr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),gr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),gr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement(Oi,{className:a("selectListContainer",i)},Ze.createElement(Li,null,Ze.createElement(Di,{className:a("selectListTitle",i)},e.title),Ze.createElement($i,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let b=n.includes(d.id);return Ze.createElement(Mi,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(h=>h!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:a("selectListSelectItem",i)},Ze.createElement(Ui,{className:a("selectListItemImage",i)},d.imageUri&&Ze.createElement(zi,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(Wi,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:b,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as No,useState as ro}from"react";var up=({children:e,id:t,shouldWrap:o=!1})=>Pe.createElement(Pe.Fragment,null,o?Pe.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Oo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:l,onComplete:g,setVisible:d,setShowModal:x,onDismiss:b,showPagination:h=!1,customFormElements:T,allowBackNavigation:f,validationHandler:B,onFormDataChange:w,showFooter:S,prefillData:A})=>{var V;let m={...{linkCollection:Ii,multiInput:Si,callToAction:Ni,selectList:_i},...i},{primaryCTAClickSideEffects:E,secondaryCTAClickSideEffects:k}=ie(),[P,O]=ro(!1),[I,N]=ro({}),[$,D]=ro(!1),[ee,U]=ro(!1),[te,fe]=ro(null),X=t[o]??null,{markStepCompleted:H,markStepStarted:j,isLoading:Ce,updateCustomVariables:Ie,markFlowCompleted:be}=Y();No(()=>{Ie(r)},[r,Ce]),No(()=>{w&&w(I,me(),t[o],o)},[I]),No(()=>{window&&f&&!ee&&(window.location.hash=t[o].id,U(!0))},[f,ee,U]),No(()=>{var G;if(window&&((G=window==null?void 0:window.location)!=null&&G.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),se=t.findIndex(pe=>pe.id===ne);se!==-1&&j(p,t[se].id)}},[(V=window==null?void 0:window.location)==null?void 0:V.hash,j,o,t]);function me(){return{data:I[t[o].id]??{},stepId:t[o].id,customVariables:r}}function J(G,ne,se){let pe=o+1<t.length?t[o+1]:null;return s&&s(G,se,pe,I,me()),n?n(G,o,ne,pe):!0}function ge(G,ne){N(se=>{let pe={};return pe[G.id]=ne,{...se,...pe}})}function re(G){return G.selectedStep.imageUri?Pe.createElement(vi,{image:G.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let L=S&&Pe.createElement(Ei,{step:t[o],canContinue:P&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),B){let se=await B(t[o],o,t[o+1],I,me());if(se||se===!1){fe(typeof se=="string"?se:null),D(!1);return}else fe(null)}let G={...me()};await H(p,t[o].id,G),o+1<t.length&&await j(p,t[o+1].id);let ne=J(t[o],"primary",o);o+1>=t.length&&(g&&g(),b&&b(),l&&ne&&(d&&d(!1),x(!1)),await be(p)),E(t[o]),D(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{J(t[o],"secondary",o),k(t[o])},onBack:async()=>{o-1>=0&&(D(!0),await j(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:te});return Pe.createElement(Pe.Fragment,null,Pe.createElement(Fi,{className:a("formContainer",e)},Pe.createElement(ki,null,Pe.createElement(up,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(Pi,{key:X.id,type:c,className:a("formContent",e)},t.map(G=>{let ne=m[G.type];return X.id!==G.id?null:Pe.createElement(ne,{key:G.id,stepData:G,canContinue:P,setCanContinue:O,onSaveData:se=>{ge(G,se)},appearance:e,customFormElements:T,flowId:p,prefillData:A})}),h&&Pe.createElement(Ai,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),L))),c=="large-modal"&&Pe.createElement(re,{selectedStep:t[o]})))};import io from"react";import{createGlobalStyle as fp}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return io.createElement(io.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return io.createElement(io.Fragment,null);let o=fp`
|
|
664
|
+
${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map(([s,p])=>`${Qo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return io.createElement(o,{inlineStyles:t})}var Hi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:b=!1,modalPosition:h="center",repeatable:T=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:w=!1,validationHandler:S,showFrigadeBranding:A=!1,onFormDataChange:y,showFooter:m=!0,prefillData:E={}})=>{let{getFlow:k,getFlowSteps:P,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:N,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),U=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=xp(!1),{setOpenFlowState:H,getOpenFlowState:j,hasOpenModals:Ce}=we();c=te(c);let[Ie,be]=i!==void 0&&r!==void 0?[i,r]:[j(e,!0),re=>H(e,re)];if(gp(()=>{!fe&&!O&&(X(!0),N(e)===q&&T&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(mr)&&window.localStorage.removeItem(L)})),X(!0))},[fe,X,O]),O)return null;let me=k(e);if(!me||I(me))return null;let J=P(e);if(!J||i!==void 0&&i===!1||N(e)===q&&l||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{be(!1),f&&f(),b===!0&&D(e)};if(h=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ie,style:re,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))}return o==="modal"&&h!=="center"?Ge.createElement(wo,{appearance:c,onClose:ge,visible:Ie,modalPosition:h},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))},ji=Hi;import{useCallback as hr,useContext as hp,useEffect as Cp}from"react";function Cr(){let{organizationId:e,userId:t,setOrganizationId:o}=hp(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=_e(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,b){return`frigade-user-group-registered-${x}-${b}`}Cp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=hr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()},[e,t,r,i]),g=hr(async(x,b)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let T={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:b}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()},[e,t,r,i]),d=hr(async(x,b)=>{if(p())if(b){let h=c(t,x);localStorage.setItem(h,"true"),o(x);let T={foreignUserId:t,foreignUserGroupId:x,properties:b};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var Vi="frigade-xFrigade_guestUserId",no="frigade-xFrigade_userId",Gi=({})=>{let{setFlowResponses:e}=Xt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=Jt(),[s,p]=yr(null),{getFlowStatus:c}=Y(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=yp(K),[b,h]=yr([]),[T,f]=yr([]),{organizationId:B}=Cr();Lo(()=>{if(!o&&t)for(let y=0;y<t.length;y++){let m=t[y],E=l.find(k=>k.slug===(m==null?void 0:m.flowId));if(E&&m&&m.shouldTrigger===!0&&E.type=="FORM"&&E.triggerType==="AUTOMATIC"&&!T.includes(E.slug)){setTimeout(()=>{w(m.flowId)},500);break}}},[o,t]),Lo(()=>{x.length>0&&i()},[x]);function w(y){let m=l.find(E=>E.slug===y);m&&m.triggerType==="AUTOMATIC"&&!T.includes(m.slug)&&(f([...T,m.slug]),h([m]))}function S(){if(!r){let y=localStorage.getItem(no);if(y){n(y);return}let m=localStorage.getItem(Vi);if(m){n(m);return}d(!0);let E=Lt+Sp();try{localStorage.setItem(Vi,E)}catch(k){console.log("Failed to save guest user id locally: Local storage unavailable",k)}n(k=>k||E)}}Lo(()=>{try{if(l){let y=[];l.forEach(m=>{if(m.data){let E=m.data.match(/"imageUri":"(.*?)"/g);E&&E.forEach(k=>{let P=k.replace('"imageUri":"',"").replace('"',"");if(y.includes(P))return;let O=new Image;O.src=P,y.push(P)})}})}}catch{}},[l]),Lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(no,r)}catch(y){console.log("Failed to save user id locally: Local storage available",y)}r===null&&setTimeout(()=>{r===null&&S()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,b.map(y=>c(y.slug)!==Me?null:bt.createElement("span",{key:y.slug},bt.createElement(ji,{flowId:y.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as Kp}from"react-error-boundary";import so from"core-js-pure/actual/structured-clone";function Sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!Sr(t)||!Sr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([r,n])=>{Sr(n)?i[r]!==void 0?Object.assign(i,{[r]:pt(i[r],so(n))}):Object.assign(i,{[r]:so(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...so(n)]}):Object.assign(i,{[r]:so(n)}):Object.assign(i,{[r]:n})}),i}var Ki={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function bp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Ki[o]){let r=Ki[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function wp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function qi(e){let{theme:t,styleOverrides:o}=e,i=bp(t),r=wp(o);return{overrides:i,css:r}}import $p from"styled-components";import{compose as Mp,variant as Xi}from"styled-system";import Yi from"react";import Tp,{ThemeProvider as Fp,useTheme as kp}from"styled-components";import{border as Pp,color as vp,compose as Bp,get as Ep,shadow as Ap,space as Ip,system as Np,typography as Op}from"styled-system";var Lp={width:{property:"width",scale:"sizes",transform:(e,t)=>Ep(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},Dp=Tp("div")(({css:e})=>e,Bp(Pp,vp,Ap,Ip,Op,Np(Lp))),lo=({as:e,children:t,overrides:o,...i})=>{let r=kp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Yi.createElement(Dp,{as:e,...n,...i},t);if(o!==void 0){let p=pt(r,o);return Yi.createElement(Fp,{theme:p},s())}return s()};var ao={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Up={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Ji=$p(lo)(()=>({whiteSpace:"nowrap"}),Mp(Xi({scale:"components.Button",variants:"components.Button"}),Xi({prop:"size",variants:Up})));import zp from"styled-components";import{variant as Wp,system as _p}from"styled-system";var Do={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Qi=zp(lo)(Wp({scale:"components.Text",variants:"components.Text"}),_p({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Zi=4,Ri="px",Hp=20,jp=Object.fromEntries(Array.from(Array(Hp+1),(e,t)=>t===0?[.5,`${.5*Zi}${Ri}`]:[t,`${t*Zi}${Ri}`])),zt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},br={colors:{...zt,neutral:{foreground:zt.gray300},primary:{background:zt.blue500,foreground:zt.white,inverted:zt.blue500},negative:{foreground:zt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:jp,components:{Button:ao,Text:Do}};var en="https://api.frigade.com",K=Vp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:en,readonly:!1});function qp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Yp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[l,g]=Oe([]),[d,x]=Oe([]),[b,h]=Oe([]),[T,f]=Oe({}),[B,w]=Oe({}),[S,A]=Oe([]),[y,m]=Oe({}),[E,k]=Oe(!1),[P,O]=Oe(!1),[I,N]=Oe(!ee(e)),$=(H,j)=>{if(j==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},50)},D={theme:{...Je.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Je.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}$o(()=>{t&&s(t)},[t]),$o(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(no)&&window.localStorage.getItem(no)!==n&&qp()},[n]),$o(()=>{o&&c(o)},[o]),$o(()=>{if(ee(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:b,setFlowResponses:h,userProperties:T,setUserProperties:f,openFlowStates:B,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:S,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:y,setCustomVariables:m,isNewGuestUser:E,setIsNewGuestUser:k,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:I,setShouldGracefullyDegrade:N,apiUrl:i&&i.apiUrl?i.apiUrl:en,readonly:i&&i.readonly?i.readonly:!1};if(I)return wt.createElement(K.Provider,{value:U},r);let{overrides:te}=qi(D);return wt.createElement(Kp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(K.Provider,{value:U},wt.createElement(Gp,{theme:pt(D.theme,br,te??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(Gi,null))))};import Md from"react";import ce,{useEffect as As,useState as Is}from"react";import We,{useState as md}from"react";import kt from"styled-components";import zo from"react";import Tt from"react";import on from"styled-components";var tn=on.span`
|
|
665
665
|
font-weight: 600;
|
|
666
666
|
font-size: 14px;
|
|
667
667
|
font-style: normal;
|
|
@@ -673,7 +673,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
673
673
|
margin-left: 32px;
|
|
674
674
|
padding-right: 12px;
|
|
675
675
|
${e=>ke(e)}
|
|
676
|
-
`,
|
|
676
|
+
`,Xp=on.div`
|
|
677
677
|
flex-direction: row;
|
|
678
678
|
justify-content: space-between;
|
|
679
679
|
display: flex;
|
|
@@ -682,11 +682,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
682
682
|
padding-right: 8px;
|
|
683
683
|
width: 100%;
|
|
684
684
|
${e=>ke(e)}
|
|
685
|
-
`,Mo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(
|
|
685
|
+
`,Mo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(Xp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&Tt.createElement(tn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Tt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&Tt.createElement(tn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Tt.createElement(oe,{appearance:p}));import po from"styled-components";var rn=po.div`
|
|
686
686
|
font-weight: 700;
|
|
687
687
|
font-size: 18px;
|
|
688
688
|
line-height: 22px;
|
|
689
|
-
`,
|
|
689
|
+
`,nn=po.p`
|
|
690
690
|
font-weight: 600;
|
|
691
691
|
font-size: 16px;
|
|
692
692
|
line-height: 24px;
|
|
@@ -694,7 +694,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
694
694
|
letter-spacing: 0.32px;
|
|
695
695
|
font-style: normal;
|
|
696
696
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
697
|
-
`,
|
|
697
|
+
`,sn=po.p`
|
|
698
698
|
font-weight: 400;
|
|
699
699
|
font-size: 14px;
|
|
700
700
|
font-style: normal;
|
|
@@ -710,12 +710,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
710
710
|
height: 100%;
|
|
711
711
|
border-top-right-radius: 4px;
|
|
712
712
|
border-bottom-right-radius: 4px;
|
|
713
|
-
`,
|
|
713
|
+
`,ln=po.div`
|
|
714
714
|
flex-direction: row;
|
|
715
715
|
justify-content: flex-start;
|
|
716
716
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
717
717
|
padding-right: 16px;
|
|
718
|
-
`;var
|
|
718
|
+
`;var an=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return zo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&zo.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),zo.createElement(ln,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},zo.createElement(Mo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Ft from"react";import wr from"styled-components";import Re from"styled-components";var sh=Re.div`
|
|
719
719
|
background: #ffffff;
|
|
720
720
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
721
721
|
border-radius: 20px;
|
|
@@ -741,7 +741,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
741
741
|
display: flex;
|
|
742
742
|
justify-content: flex-start;
|
|
743
743
|
flex-direction: row;
|
|
744
|
-
`,
|
|
744
|
+
`,pn=Re.div`
|
|
745
745
|
position: absolute;
|
|
746
746
|
left: 0;
|
|
747
747
|
top: 0;
|
|
@@ -749,7 +749,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
749
749
|
width: ${e=>e.fgWidth};
|
|
750
750
|
border-radius: 20px;
|
|
751
751
|
background-color: ${e=>e.theme.colorPrimary};
|
|
752
|
-
`,
|
|
752
|
+
`,dn=Re.div`
|
|
753
753
|
position: relative;
|
|
754
754
|
left: 0;
|
|
755
755
|
top: 0;
|
|
@@ -759,7 +759,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
759
759
|
border-radius: 20px;
|
|
760
760
|
background-color: ${e=>e.theme.colorPrimary};
|
|
761
761
|
opacity: 0.12;
|
|
762
|
-
`;var
|
|
762
|
+
`;var Jp=wr.div`
|
|
763
763
|
display: flex;
|
|
764
764
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
765
765
|
justify-content: flex-start;
|
|
@@ -767,11 +767,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
767
767
|
width: 100%;
|
|
768
768
|
|
|
769
769
|
${e=>ke(e)}
|
|
770
|
-
`,
|
|
770
|
+
`,Qp=wr.div`
|
|
771
771
|
flex-grow: 1;
|
|
772
772
|
position: relative;
|
|
773
773
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
774
|
-
`,
|
|
774
|
+
`,Zp=wr.span`
|
|
775
775
|
font-weight: 600;
|
|
776
776
|
font-size: 14px;
|
|
777
777
|
line-height: 18px;
|
|
@@ -779,13 +779,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
779
779
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
780
780
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
781
781
|
${e=>ke(e)}
|
|
782
|
-
`;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(
|
|
782
|
+
`;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(Jp,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Ft.createElement(Zp,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Ft.createElement(Qp,{textLocation:i,className:a("progressBar",s)},Ft.createElement(pn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Ft.createElement(dn,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import co from"react";import ed from"styled-components";import _o from"react";import Wo from"react";var Wt=({stepData:e,appearance:t})=>Wo.createElement(Wo.Fragment,null,Wo.createElement(nn,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:le(e.title)}),Wo.createElement(sn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:le(e.subtitle)}));import Tr from"react";var _t=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Tr.createElement(Bo,{className:a("ctaContainer",t)},Tr.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Tr.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Ht=({stepData:e,appearance:t})=>_o.createElement(_o.Fragment,null,_o.createElement(Wt,{stepData:e,appearance:t}),_o.createElement(_t,{stepData:e,appearance:t}));import Rp from"react";function cn(e){return Rp.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Fr="default",td=ed.img`
|
|
783
783
|
border-radius: 4px;
|
|
784
784
|
max-height: 260px;
|
|
785
785
|
min-height: 200px;
|
|
786
|
-
`,
|
|
786
|
+
`,mn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return co.createElement("div",null,o)}return co.createElement(rn,{className:a("checklistStepContent",t)},e.imageUri?co.createElement(td,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?co.createElement(cn,{videoUri:e.videoUri,appearance:t}):null,co.createElement(Ht,{stepData:e,appearance:t}))};import Ee,{useRef as od,useState as rd}from"react";import jt from"styled-components";var un=jt.div`
|
|
787
787
|
display: block;
|
|
788
|
-
`,
|
|
788
|
+
`,id=jt.div`
|
|
789
789
|
display: flex;
|
|
790
790
|
flex-direction: row;
|
|
791
791
|
flex-wrap: wrap;
|
|
@@ -795,20 +795,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
795
795
|
align-content: center;
|
|
796
796
|
margin-top: 24px;
|
|
797
797
|
margin-bottom: 24px;
|
|
798
|
-
`,
|
|
798
|
+
`,nd=jt.div`
|
|
799
799
|
display: flex;
|
|
800
800
|
align-items: center;
|
|
801
801
|
justify-content: flex-start;
|
|
802
802
|
flex-direction: column;
|
|
803
803
|
margin-right: 16px;
|
|
804
|
-
`,
|
|
804
|
+
`,sd=jt.video`
|
|
805
805
|
width: 200px;
|
|
806
806
|
height: 120px;
|
|
807
|
-
`,
|
|
807
|
+
`,ld=jt.div`
|
|
808
808
|
font-size: 14px;
|
|
809
809
|
line-height: 20px;
|
|
810
810
|
text-align: center;
|
|
811
|
-
`,
|
|
811
|
+
`,ad=jt.div`
|
|
812
812
|
position: absolute;
|
|
813
813
|
width: 200px;
|
|
814
814
|
height: 120px;
|
|
@@ -828,9 +828,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
828
828
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
829
829
|
border-radius: 50%;
|
|
830
830
|
}
|
|
831
|
-
`,
|
|
831
|
+
`,fn="videoCarousel",gn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ee.createElement(un,null,Ee.createElement(Ht,{stepData:e,appearance:t}));function o({video:n}){let s=od(),[p,c]=rd(!1);return Ee.createElement(nd,null,!p&&Ee.createElement(ad,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(Eo,null)),Ee.createElement(sd,{controls:p,ref:s,play:p,src:n.uri}),Ee.createElement(ld,null,n.title))}let i=e.props;return i.videos?Ee.createElement(un,null,Ee.createElement(Wt,{stepData:e,appearance:t}),Ee.createElement(id,null,i.videos.map((n,s)=>Ee.createElement("span",{key:`${n.uri}-${s}`},Ee.createElement(o,{video:n})))),Ee.createElement(_t,{stepData:e,appearance:t})):null};import et from"react";import Ho from"styled-components";var xn=Ho.div`
|
|
832
832
|
display: block;
|
|
833
|
-
`,
|
|
833
|
+
`,pd=Ho.pre`
|
|
834
834
|
display: block;
|
|
835
835
|
background-color: #2a2a2a;
|
|
836
836
|
color: #f8f8f8;
|
|
@@ -846,14 +846,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
846
846
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
847
847
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
848
848
|
margin-bottom: 24px;
|
|
849
|
-
`,
|
|
849
|
+
`,dd=Ho.div`
|
|
850
850
|
font-size: 15px;
|
|
851
851
|
line-height: 20px;
|
|
852
852
|
margin-bottom: 12px;
|
|
853
853
|
margin-top: 12px;
|
|
854
|
-
`,
|
|
854
|
+
`,cd=Ho.div`
|
|
855
855
|
margin-top: 24px;
|
|
856
|
-
`,
|
|
856
|
+
`,hn="codeSnippet",Cn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(xn,null,et.createElement(Ht,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(xn,null,et.createElement(Wt,{stepData:e,appearance:t}),et.createElement(cd,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(dd,null,r.title):null,r.code?et.createElement(pd,null,r.code):null))),et.createElement(_t,{stepData:e,appearance:t})):null};var ud=kt.div`
|
|
857
857
|
display: flex;
|
|
858
858
|
flex-direction: row;
|
|
859
859
|
overflow: hidden;
|
|
@@ -861,14 +861,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
861
861
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
862
862
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
863
863
|
${e=>ke(e)}
|
|
864
|
-
`,
|
|
864
|
+
`,fd=kt.h1`
|
|
865
865
|
font-size: 18px;
|
|
866
866
|
font-style: normal;
|
|
867
867
|
font-weight: 700;
|
|
868
868
|
line-height: 24px;
|
|
869
869
|
letter-spacing: 0.36px;
|
|
870
870
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
871
|
-
`,
|
|
871
|
+
`,gd=kt.h2`
|
|
872
872
|
font-size: 14px;
|
|
873
873
|
font-style: normal;
|
|
874
874
|
font-weight: 400;
|
|
@@ -876,43 +876,43 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
876
876
|
letter-spacing: 0.28px;
|
|
877
877
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
878
878
|
margin: 10px 0px 0px 0px;
|
|
879
|
-
`,
|
|
879
|
+
`,yn=kt.div``,xd=kt.div`
|
|
880
880
|
list-style: none;
|
|
881
881
|
padding: 0;
|
|
882
882
|
margin: 0;
|
|
883
883
|
cursor: pointer;
|
|
884
884
|
width: 300px;
|
|
885
|
-
`,
|
|
885
|
+
`,hd=kt.div`
|
|
886
886
|
width: 1px;
|
|
887
887
|
margin-right: 40px;
|
|
888
888
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
889
|
-
`,
|
|
889
|
+
`,Cd=kt.div`
|
|
890
890
|
flex: 2;
|
|
891
891
|
padding: 2rem 2rem 2rem 0rem;
|
|
892
|
-
`,
|
|
892
|
+
`,yd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[Fr]:mn,[fn]:gn,[hn]:Cn},...p},[b,h]=md(0),T=r??b,f=n??h,B=o.filter(S=>S.complete===!0).length,w=()=>{var S;return!((S=o[T])!=null&&S.type)||!x[o[T].type]?x[Fr]({stepData:o[T],appearance:c}):x[o[T].type]({stepData:o[T],appearance:c})};return We.createElement(ud,{type:l,styleOverrides:i,className:s,appearance:c},We.createElement(yn,{style:{flex:1}},We.createElement(yn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},We.createElement(fd,{className:a("checklistTitle",c),appearance:c},e),We.createElement(gd,{className:a("checklistSubtitle",c),appearance:c},t),We.createElement(Le,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),We.createElement(xd,{className:a("checklistStepsContainer",c)},o.map((S,A)=>We.createElement(an,{data:S,index:A,key:A,listLength:o.length,isSelected:A===T,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)},appearance:c})))),We.createElement(hd,{appearance:c,className:a("checklistDivider",c)}),We.createElement(Cd,null,We.createElement(w,null)))},kr=yd;import z,{useState as Fd}from"react";import Sn from"react";import Sd from"styled-components";var bd=Sd.svg`
|
|
893
893
|
transition: 'transform 0.35s ease-in-out';
|
|
894
|
-
`,Vt=({style:e,className:t})=>
|
|
894
|
+
`,Vt=({style:e,className:t})=>Sn.createElement(bd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Sn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var Pr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},bn=ue.div`
|
|
895
895
|
max-height: 350px;
|
|
896
896
|
padding-bottom: 40px;
|
|
897
|
-
`,
|
|
897
|
+
`,wn=ue.div`
|
|
898
898
|
display: flex;
|
|
899
899
|
flex-direction: column;
|
|
900
900
|
margin-top: 20px;
|
|
901
|
-
`,
|
|
901
|
+
`,Tn=ue.h1`
|
|
902
902
|
font-style: normal;
|
|
903
903
|
font-weight: 600;
|
|
904
904
|
font-size: 30px;
|
|
905
905
|
line-height: 36px;
|
|
906
906
|
margin-bottom: 16px;
|
|
907
907
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
908
|
-
`,
|
|
908
|
+
`,Fn=ue.h2`
|
|
909
909
|
font-weight: 400;
|
|
910
910
|
font-size: 16px;
|
|
911
911
|
line-height: 20px;
|
|
912
912
|
margin-bottom: 16px;
|
|
913
913
|
padding-left: 1px;
|
|
914
914
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
915
|
-
`,
|
|
915
|
+
`,kn=ue.div`
|
|
916
916
|
${e=>F(e)} {
|
|
917
917
|
border: 1px solid #fafafa;
|
|
918
918
|
}
|
|
@@ -922,11 +922,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
922
922
|
flex-direction: column;
|
|
923
923
|
min-height: 240px;
|
|
924
924
|
overflow: hidden;
|
|
925
|
-
`,
|
|
925
|
+
`,Pn=ue.div`
|
|
926
926
|
display: flex;
|
|
927
927
|
flex-direction: row;
|
|
928
928
|
justify-content: space-between;
|
|
929
|
-
`,
|
|
929
|
+
`,vn=ue.p`
|
|
930
930
|
${e=>F(e)} {
|
|
931
931
|
font-weight: 400;
|
|
932
932
|
font-size: 10px;
|
|
@@ -935,12 +935,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
935
935
|
color: #8c8c8c;
|
|
936
936
|
margin: 20px;
|
|
937
937
|
}
|
|
938
|
-
`,
|
|
938
|
+
`,Bn=ue.div`
|
|
939
939
|
display: flex;
|
|
940
940
|
flex-direction: row;
|
|
941
|
-
`,Bn=ue.div`
|
|
942
|
-
flex: 1;
|
|
943
941
|
`,En=ue.div`
|
|
942
|
+
flex: 1;
|
|
943
|
+
`,An=ue.div`
|
|
944
944
|
${e=>F(e)} {
|
|
945
945
|
display: flex;
|
|
946
946
|
justify-content: center;
|
|
@@ -950,7 +950,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
950
950
|
padding-left: 8px;
|
|
951
951
|
padding-right: 8px;
|
|
952
952
|
}
|
|
953
|
-
`,
|
|
953
|
+
`,In=ue.p`
|
|
954
954
|
${e=>F(e)} {
|
|
955
955
|
font-style: normal;
|
|
956
956
|
font-weight: 600;
|
|
@@ -962,7 +962,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
962
962
|
margin-top: 20px;
|
|
963
963
|
margin-bottom: 16px;
|
|
964
964
|
}
|
|
965
|
-
`,
|
|
965
|
+
`,Nn=ue.p`
|
|
966
966
|
${e=>F(e)} {
|
|
967
967
|
font-weight: 400;
|
|
968
968
|
font-size: 14px;
|
|
@@ -971,14 +971,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
971
971
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
972
972
|
margin-bottom: 8px;
|
|
973
973
|
}
|
|
974
|
-
`,
|
|
974
|
+
`,On=ue.div`
|
|
975
975
|
${e=>F(e)} {
|
|
976
976
|
display: flex;
|
|
977
977
|
flex-direction: row;
|
|
978
978
|
justify-content: center;
|
|
979
979
|
gap: 8px;
|
|
980
980
|
}
|
|
981
|
-
`,
|
|
981
|
+
`,Ln=ue.div`
|
|
982
982
|
${e=>F(e)} {
|
|
983
983
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
984
984
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -998,7 +998,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
998
998
|
justify-content: space-between;
|
|
999
999
|
position: relative;
|
|
1000
1000
|
cursor: pointer;
|
|
1001
|
-
`,
|
|
1001
|
+
`,Dn=ue.p`
|
|
1002
1002
|
${e=>F(e)} {
|
|
1003
1003
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1004
1004
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -1007,12 +1007,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1007
1007
|
font-size: 14px;
|
|
1008
1008
|
line-height: 22px;
|
|
1009
1009
|
margin: 0;
|
|
1010
|
-
|
|
1010
|
+
`,$n=ue.div`
|
|
1011
1011
|
display: flex;
|
|
1012
1012
|
flex-direction: row;
|
|
1013
1013
|
justify-content: flex-end;
|
|
1014
1014
|
align-content: center;
|
|
1015
|
-
|
|
1015
|
+
`,Mn=ue.div`
|
|
1016
1016
|
display: flex;
|
|
1017
1017
|
flex: 1;
|
|
1018
1018
|
flex-direction: row;
|
|
@@ -1020,14 +1020,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1020
1020
|
align-content: center;
|
|
1021
1021
|
align-items: center;
|
|
1022
1022
|
margin-right: 20px;
|
|
1023
|
-
`,
|
|
1023
|
+
`,Un=ue.div`
|
|
1024
1024
|
display: block;
|
|
1025
1025
|
width: 100%;
|
|
1026
|
-
`;import
|
|
1026
|
+
`;import wd from"styled-components";var zn=wd.div`
|
|
1027
1027
|
flex-direction: column;
|
|
1028
1028
|
justify-content: center;
|
|
1029
1029
|
display: flex;
|
|
1030
|
-
`;import ot from"react";import tt from"styled-components";var
|
|
1030
|
+
`;import ot from"react";import tt from"styled-components";var Wn=tt.div`
|
|
1031
1031
|
border: 1px solid #fafafa;
|
|
1032
1032
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1033
1033
|
border-radius: 14px;
|
|
@@ -1035,13 +1035,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1035
1035
|
display: flex;
|
|
1036
1036
|
flex-direction: column;
|
|
1037
1037
|
overflow: hidden;
|
|
1038
|
-
`,
|
|
1038
|
+
`,_n=tt.div`
|
|
1039
1039
|
display: flex;
|
|
1040
1040
|
flex-wrap: wrap;
|
|
1041
1041
|
justify-content: space-between;
|
|
1042
1042
|
overflow: hidden;
|
|
1043
1043
|
row-gap: 10px;
|
|
1044
|
-
`,
|
|
1044
|
+
`,Hn=tt.div`
|
|
1045
1045
|
${e=>F(e)} {
|
|
1046
1046
|
color: #595959;
|
|
1047
1047
|
}
|
|
@@ -1051,7 +1051,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1051
1051
|
line-height: 12px;
|
|
1052
1052
|
letter-spacing: 0.09em;
|
|
1053
1053
|
margin-bottom: 12px;
|
|
1054
|
-
`,
|
|
1054
|
+
`,jn=tt.div`
|
|
1055
1055
|
${e=>F(e)} {
|
|
1056
1056
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1057
1057
|
background: #ffffff;
|
|
@@ -1064,7 +1064,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1064
1064
|
|
|
1065
1065
|
max-width: 150px;
|
|
1066
1066
|
min-width: 200px;
|
|
1067
|
-
`,
|
|
1067
|
+
`,Vn=tt.div`
|
|
1068
1068
|
${e=>F(e)} {
|
|
1069
1069
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1070
1070
|
}
|
|
@@ -1076,13 +1076,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1076
1076
|
justify-content: center;
|
|
1077
1077
|
align-content: center;
|
|
1078
1078
|
align-items: center;
|
|
1079
|
-
`,
|
|
1079
|
+
`,Gn=tt.div`
|
|
1080
1080
|
font-weight: 600;
|
|
1081
1081
|
font-size: 20px;
|
|
1082
1082
|
line-height: 24px;
|
|
1083
1083
|
width: 20px;
|
|
1084
1084
|
height: 20px;
|
|
1085
|
-
`,
|
|
1085
|
+
`,Kn=tt.div`
|
|
1086
1086
|
${e=>F(e)} {
|
|
1087
1087
|
color: #434343;
|
|
1088
1088
|
}
|
|
@@ -1091,20 +1091,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1091
1091
|
line-height: 17px;
|
|
1092
1092
|
margin-top: 12px;
|
|
1093
1093
|
margin-bottom: 8px;
|
|
1094
|
-
`,
|
|
1094
|
+
`,qn=tt.div`
|
|
1095
1095
|
${e=>F(e)} {
|
|
1096
1096
|
color: #8c8c8c;
|
|
1097
1097
|
}
|
|
1098
1098
|
font-weight: 400;
|
|
1099
1099
|
font-size: 12px;
|
|
1100
1100
|
line-height: 14px;
|
|
1101
|
-
`,
|
|
1101
|
+
`,Yn=tt.a`
|
|
1102
1102
|
color: ${e=>e.color};
|
|
1103
1103
|
font-size: 12px;
|
|
1104
1104
|
line-height: 14px;
|
|
1105
1105
|
font-weight: 400;
|
|
1106
1106
|
cursor: pointer;
|
|
1107
|
-
`;var
|
|
1107
|
+
`;var Td=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(Wn,{style:t,className:a("guideContainer",r)},ot.createElement(Hn,{className:a("guideTitle",r)},o),ot.createElement(_n,{className:a("guideItemContainer",r)},e.map((p,c)=>ot.createElement(jn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&ot.createElement(Vn,{className:a("guideIcon",r)},ot.createElement(Gn,null,p.icon)),ot.createElement(Kn,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:le(p.title)}),ot.createElement(qn,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:le(p.subtitle)}),ot.createElement(Yn,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},mo=Td;var kd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:l,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let b=({stepData:m,handleSecondaryCTAClick:E,handleCTAClick:k})=>m?z.createElement(An,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},z.createElement(In,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:le(m.title)}),z.createElement(Nn,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:le(m.subtitle)}),z.createElement(On,{className:a("checklistCTAContainer",l)},m.secondaryButtonTitle&&z.createElement(Z,{title:m.secondaryButtonTitle,onClick:E,appearance:l,secondary:!0}),z.createElement(Z,{title:m.primaryButtonTitle,onClick:k,appearance:l}))):z.createElement(z.Fragment,null),T={...{default:m=>{var O;if((O=e[w])!=null&&O.StepContent){let I=e[w].StepContent;return z.createElement("div",null,I)}let E=e[w];return z.createElement(b,{stepData:m,handleCTAClick:()=>{E.handlePrimaryButtonClick&&E.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{E.handleSecondaryButtonClick&&E.handleSecondaryButtonClick()}})}},...c},[f,B]=Fd(0),w=s??f,S=p??B,A=()=>{var m;return e?!((m=e[w])!=null&&m.type)||!T[e[w].type]?T.default(e[w]):T[e[w].type]({stepData:e[w],primaryColor:l.theme.colorPrimary}):z.createElement(z.Fragment,null)},y=e.filter(m=>m.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Pr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Pr),z.createElement(He,{onClose:n,visible:r,appearance:l},z.createElement(Un,null,z.createElement(wn,null,z.createElement(Tn,{appearance:l,className:a("checklistTitle",l)},t),z.createElement(Fn,{appearance:l,className:a("checklistSubtitle",l)},o)),z.createElement(bn,null,e&&e.length>0&&z.createElement(kn,{className:a("stepsContainer",l)},z.createElement(Pn,null,z.createElement("div",{style:{flex:3}},z.createElement(vn,{className:a("stepsTitle",l)},i)),z.createElement(Mn,null,z.createElement(Le,{style:{width:"100%"},count:y,total:e.length,appearance:l}))),z.createElement(Bn,null,z.createElement(En,{className:a("checklistStepListContainer",l),appearance:l},e.map((m,E)=>{let k=w===E;return z.createElement(Ln,{selected:k,className:a(`checklistStepListItem${k?"Selected":""}`,l),key:`checklist-guide-step-${m.id??E}`,disabled:m.blocked,onClick:()=>{m.blocked||S(E)},title:m.blocked?"Finish remaining steps to continue":void 0},k&&z.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),z.createElement(Dn,{selected:k,className:a(`checklistStepListStepName${k?"Selected":""}`,l)},m.stepName),z.createElement($n,null,z.createElement(Qe,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),z.createElement(zn,null,z.createElement(Vt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),z.createElement(A,null))),g&&g.length>0&&z.createElement(mo,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(x&&x(m),!0)}))))):z.createElement(z.Fragment,null)},vr=kd;import ve,{useEffect as ps,useState as Pd}from"react";import he from"react";import rt from"styled-components";var Xn=rt.div`
|
|
1108
1108
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1109
1109
|
border: 1px solid;
|
|
1110
1110
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1116,19 +1116,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1116
1116
|
display: flex;
|
|
1117
1117
|
flex-direction: column;
|
|
1118
1118
|
transition: max-height 0.25s;
|
|
1119
|
-
`,
|
|
1119
|
+
`,Jn=rt.div`
|
|
1120
1120
|
display: flex;
|
|
1121
1121
|
margin-bottom: 20px;
|
|
1122
|
-
`,
|
|
1122
|
+
`,Qn=rt.img`
|
|
1123
1123
|
border-radius: 4px;
|
|
1124
1124
|
max-height: 260px;
|
|
1125
1125
|
min-height: 200px;
|
|
1126
|
-
`,
|
|
1126
|
+
`,Zn=rt.div`
|
|
1127
1127
|
display: flex;
|
|
1128
1128
|
flex-direction: row;
|
|
1129
1129
|
justify-content: space-between;
|
|
1130
1130
|
align-items: center;
|
|
1131
|
-
`,
|
|
1131
|
+
`,Rn=rt.p`
|
|
1132
1132
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1133
1133
|
font-style: normal;
|
|
1134
1134
|
font-weight: 500;
|
|
@@ -1139,23 +1139,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1139
1139
|
:hover {
|
|
1140
1140
|
opacity: 0.8;
|
|
1141
1141
|
}
|
|
1142
|
-
`,
|
|
1142
|
+
`,es=rt.div`
|
|
1143
1143
|
cursor: pointer;
|
|
1144
1144
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1145
1145
|
:hover {
|
|
1146
1146
|
opacity: 0.8;
|
|
1147
1147
|
}
|
|
1148
|
-
`,ny=rt.div``,
|
|
1148
|
+
`,ny=rt.div``,ts=rt.p`
|
|
1149
1149
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1150
1150
|
font-weight: 400;
|
|
1151
1151
|
font-size: 14px;
|
|
1152
1152
|
line-height: 22px;
|
|
1153
|
-
`,
|
|
1153
|
+
`,os=rt.div`
|
|
1154
1154
|
display: flex;
|
|
1155
1155
|
flex-direction: row;
|
|
1156
1156
|
justify-content: flex-start;
|
|
1157
1157
|
align-items: center;
|
|
1158
|
-
`;var
|
|
1158
|
+
`;var rs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){return he.createElement(he.Fragment,null,e.imageUri||e.videoUri?he.createElement(Jn,{className:a("stepMediaContainer",n)},e.imageUri?he.createElement(Qn,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?he.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,he.createElement(ts,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:le(e.subtitle)}),he.createElement(Bo,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?he.createElement(Z,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,he.createElement(Z,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let x=s[e.type];return x?x(e,n):null}return he.createElement(Xn,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},he.createElement(Zn,{className:a("stepHeader",n)},he.createElement(os,null,he.createElement(Mo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),he.createElement(Rn,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:le(e.title),onClick:()=>o()})),he.createElement(es,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},he.createElement(Vt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),he.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Gt from"styled-components";var Cy=Gt.div`
|
|
1159
1159
|
background: #ffffff;
|
|
1160
1160
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1161
1161
|
border-radius: 6px;
|
|
@@ -1169,26 +1169,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1169
1169
|
|
|
1170
1170
|
max-width: 800px;
|
|
1171
1171
|
min-width: 350px;
|
|
1172
|
-
`,
|
|
1172
|
+
`,is=Gt.div`
|
|
1173
1173
|
display: flex;
|
|
1174
1174
|
flex-direction: column;
|
|
1175
|
-
`,
|
|
1175
|
+
`,ns=Gt.h1`
|
|
1176
1176
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1177
1177
|
font-style: normal;
|
|
1178
1178
|
font-weight: 700;
|
|
1179
1179
|
font-size: 20px;
|
|
1180
1180
|
line-height: 24px;
|
|
1181
1181
|
margin-bottom: 8px;
|
|
1182
|
-
`,
|
|
1182
|
+
`,ss=Gt.h2`
|
|
1183
1183
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1184
1184
|
font-weight: 400;
|
|
1185
1185
|
font-size: 14px;
|
|
1186
1186
|
line-height: 23px;
|
|
1187
1187
|
margin: 2px 0 0 0;
|
|
1188
|
-
`,
|
|
1188
|
+
`,ls=Gt.div`
|
|
1189
1189
|
display: block;
|
|
1190
1190
|
width: 100%;
|
|
1191
|
-
`,
|
|
1191
|
+
`,as=Gt.div`
|
|
1192
1192
|
display: flex;
|
|
1193
1193
|
width: 100%;
|
|
1194
1194
|
flex-direction: column;
|
|
@@ -1196,23 +1196,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1196
1196
|
padding: 24px;
|
|
1197
1197
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1198
1198
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1199
|
-
`;var
|
|
1199
|
+
`;var vd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:b,style:h})=>{let T=o.filter(y=>y.complete).length,[f,B]=Pd(Array(o.length).fill(!0));ps(()=>{let y=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){y[m]=!1;break}B(y)}},[]),ps(()=>{w(c)},[c]);let w=y=>{let m=[...f];if(s)for(let E=0;E<f.length;++E)E!==y&&(m[E]=!0);m[y]=!m[y],B(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let S=ve.createElement(ve.Fragment,null,ve.createElement(is,null,ve.createElement(ns,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:le(e)}),ve.createElement(ss,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:le(t)})),ve.createElement(Le,{display:"percent",count:T,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(ls,{className:xe(a("checklistContainer",g),x)},o.map((y,m)=>{let E=f[m];return ve.createElement(rs,{appearance:g,stepData:y,collapsed:E,key:`modal-checklist-${y.id??m}`,onClick:()=>{if(c===m){w(m);return}l(m)},onPrimaryButtonClick:()=>{y.handlePrimaryButtonClick&&y.handlePrimaryButtonClick(),p&&!y.completionCriteria&&m<f.length-1&&f[m+1]&&l(m+1)},onSecondaryButtonClick:()=>{y.handleSecondaryButtonClick&&y.handleSecondaryButtonClick()},customStepTypes:b})}));return d==="inline"?ve.createElement(as,{appearance:g,className:xe(a("checklistInlineContainer",g),x),style:h},S,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:S},A))},Br=vd;import ae,{useEffect as Er,useRef as Dd,useState as Pt}from"react";import{useEffect as Bd,useState as Ed}from"react";var ds=()=>{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]=Ed(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,l])=>{if(!window)return[c,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return Bd(()=>{s()},[]),o};import Kt from"react";import de,{css as cs,keyframes as ms}from"styled-components";var us=cs`
|
|
1200
1200
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1201
|
-
`,Ed=ds`
|
|
1202
|
-
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1203
1201
|
`,Ad=cs`
|
|
1202
|
+
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1203
|
+
`,Id=ms`
|
|
1204
1204
|
from {
|
|
1205
1205
|
opacity: 0;
|
|
1206
1206
|
} to {
|
|
1207
1207
|
opacity: 1;
|
|
1208
1208
|
}
|
|
1209
|
-
`,
|
|
1209
|
+
`,Nd=ms`
|
|
1210
1210
|
from {
|
|
1211
1211
|
opacity: 1;
|
|
1212
1212
|
} to {
|
|
1213
1213
|
opacity: 0;
|
|
1214
1214
|
}
|
|
1215
|
-
`,
|
|
1215
|
+
`,fs=de.div`
|
|
1216
1216
|
margin: 0 -20px;
|
|
1217
1217
|
overflow-x: auto;
|
|
1218
1218
|
padding-left: 20px;
|
|
@@ -1229,14 +1229,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1229
1229
|
::-webkit-scrollbar {
|
|
1230
1230
|
display: none;
|
|
1231
1231
|
}
|
|
1232
|
-
`,
|
|
1232
|
+
`,gs=de.div`
|
|
1233
1233
|
display: flex;
|
|
1234
1234
|
flex-flow: row nowrap;
|
|
1235
1235
|
gap: 0 16px;
|
|
1236
1236
|
scroll-snap-align: center;
|
|
1237
1237
|
scroll-snap-stop: always;
|
|
1238
|
-
`,
|
|
1239
|
-
animation: ${e=>e.reversed?Id
|
|
1238
|
+
`,xs=de.div`
|
|
1239
|
+
animation: ${e=>e.reversed?Nd:Id} 0.25s ease-out;
|
|
1240
1240
|
background: linear-gradient(
|
|
1241
1241
|
to right,
|
|
1242
1242
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1245,8 +1245,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1245
1245
|
position: absolute;
|
|
1246
1246
|
width: 64px;
|
|
1247
1247
|
z-index: 10;
|
|
1248
|
-
`,
|
|
1249
|
-
${
|
|
1248
|
+
`,hs=de.button`
|
|
1249
|
+
${us}
|
|
1250
1250
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1251
1251
|
align-items: center;
|
|
1252
1252
|
border-radius: 50%;
|
|
@@ -1257,11 +1257,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1257
1257
|
justify-content: center;
|
|
1258
1258
|
position: absolute;
|
|
1259
1259
|
width: 48px;
|
|
1260
|
-
`,
|
|
1260
|
+
`,Cs=de.div`
|
|
1261
1261
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1262
1262
|
padding: 20px;
|
|
1263
|
-
`,
|
|
1264
|
-
${
|
|
1263
|
+
`,ys=de(Cs)`
|
|
1264
|
+
${us}
|
|
1265
1265
|
background: ${({theme:e})=>e.colorBackground};
|
|
1266
1266
|
position: relative;
|
|
1267
1267
|
|
|
@@ -1273,14 +1273,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1273
1273
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1274
1274
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1275
1275
|
}
|
|
1276
|
-
`,
|
|
1276
|
+
`,Ss=de.img`
|
|
1277
1277
|
border-radius: 50%;
|
|
1278
1278
|
height: 40px;
|
|
1279
1279
|
margin-bottom: 12px;
|
|
1280
1280
|
width: 40px;
|
|
1281
|
-
`,
|
|
1281
|
+
`,bs=de(Cs)`
|
|
1282
1282
|
${e=>F(e)} {
|
|
1283
|
-
${
|
|
1283
|
+
${Ad}
|
|
1284
1284
|
|
|
1285
1285
|
background: ${({theme:e})=>e.colorBackground};
|
|
1286
1286
|
}
|
|
@@ -1291,32 +1291,32 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1291
1291
|
align-items: center;
|
|
1292
1292
|
`,$y=de.div`
|
|
1293
1293
|
white-space: nowrap;
|
|
1294
|
-
`,
|
|
1294
|
+
`,ws=de.div`
|
|
1295
1295
|
background: #d8fed8;
|
|
1296
1296
|
border-radius: 6px;
|
|
1297
1297
|
float: right;
|
|
1298
1298
|
margin-bottom: 12px;
|
|
1299
1299
|
padding: 4px 10px;
|
|
1300
|
-
`,
|
|
1300
|
+
`,Od=de.p`
|
|
1301
1301
|
font-weight: bold;
|
|
1302
1302
|
font-size: 18px;
|
|
1303
1303
|
line-height: 22px;
|
|
1304
1304
|
letter-spacing: calc(18px * -0.01);
|
|
1305
1305
|
margin: 0;
|
|
1306
|
-
`,
|
|
1306
|
+
`,Ts=de(Od)`
|
|
1307
1307
|
margin-bottom: 4px;
|
|
1308
|
-
`,
|
|
1308
|
+
`,Fs=de.div`
|
|
1309
1309
|
display: flex;
|
|
1310
1310
|
flex-flow: row nowrap;
|
|
1311
1311
|
align-items: center;
|
|
1312
1312
|
min-width: 50%;
|
|
1313
|
-
`,
|
|
1313
|
+
`,Ld=de.p`
|
|
1314
1314
|
font-weight: bold;
|
|
1315
1315
|
font-size: 16px;
|
|
1316
1316
|
line-height: 20px;
|
|
1317
1317
|
letter-spacing: calc(16px * -0.01);
|
|
1318
1318
|
margin: 0;
|
|
1319
|
-
`,
|
|
1319
|
+
`,ks=de(Ld)`
|
|
1320
1320
|
margin-bottom: 4px;
|
|
1321
1321
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1322
1322
|
`}
|
|
@@ -1326,7 +1326,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1326
1326
|
font-size: 14px;
|
|
1327
1327
|
line-height: 22px;
|
|
1328
1328
|
margin: 0;
|
|
1329
|
-
`,
|
|
1329
|
+
`,Ps=de.p`
|
|
1330
1330
|
color: ${({theme:e})=>e.colorText};
|
|
1331
1331
|
font-weight: 600;
|
|
1332
1332
|
font-size: 12px;
|
|
@@ -1338,21 +1338,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1338
1338
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1339
1339
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1340
1340
|
`}
|
|
1341
|
-
`;var
|
|
1341
|
+
`;var vs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Q(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return Kt.createElement(ys,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&Kt.createElement(Ss,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&Kt.createElement(ws,{className:a("carouselCompletedPill",o)},Kt.createElement(Ps,{style:{color:"#108E0B"}},"Complete")),p&&Kt.createElement(ks,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&Kt.createElement(dt.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var $d=()=>ae.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Bs=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=Pt(!1),[n,s]=Pt(!1);Er(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ae.createElement(xs,{style:c,reversed:n,onAnimationEnd:n?p:null},ae.createElement(hs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement($d,null))):null},Es=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Dd(null),[n,s]=Pt(!1),[p,c]=Pt(!1),[l,g]=Pt(null),[d,x]=Pt([]),[b,h]=Pt(0),{isSmall:T}=ds(),f=T?1:3,{getFlowMetadata:B,getFlowSteps:w,getNumberOfStepsCompleted:S,updateCustomVariables:A,isLoading:y}=Y();Er(()=>{A(o)},[o,y]),Er(()=>{if(y)return;let I=B(e),N=S(e),$=w(e);g(I),I.data!==null&&(x($.sort((D,ee)=>Number(D.complete)-Number(ee.complete))),c($.length>f),h(N))},[y]);let m=[];for(let I=0;I<d.length;I+=f)m.push(d.slice(I,I+f));let E=I=>{let N=I.target,$=N.scrollWidth-N.clientWidth,D=Math.ceil(N.scrollLeft);D>0&&n===!1&&s(!0),D===0&&n===!0&&s(!1),D<$&&p===!1&&c(!0),D===$&&p===!0&&c(!1)},k=(I=!0)=>{let N=I?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*N,behavior:"smooth"})},P=null,O=I=>{P!==null?clearTimeout(P):E(I),P=setTimeout(()=>{E(I)},16)};return y?null:ae.createElement(bs,{className:xe(a("carouselContainer",t),i)},ae.createElement("div",{style:{display:"flex",justifyContent:T?"center":"space-between",marginBottom:20,flexWrap:T?"wrap":"nowrap",gap:T?16:20}},ae.createElement("div",null,ae.createElement(Ts,{className:a("carouselTitle",t)},l==null?void 0:l.title),ae.createElement(dt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ae.createElement(Fs,{className:a("progressWrapper",t)},ae.createElement(Le,{count:b,total:d.length,appearance:t}))),ae.createElement("div",{style:{position:"relative"}},ae.createElement(Bs,{show:n,onClick:()=>k(!1)}),ae.createElement(Bs,{side:"right",show:p,onClick:k}),ae.createElement(fs,{ref:r,onScroll:O},m.map((I,N)=>ae.createElement(gs,{key:N,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},I.map(($,D)=>ae.createElement(vs,{key:D,stepData:$,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),ae.createElement(oe,{appearance:t}))};var Ar=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:b,setVisible:h,customStepTypes:T,checklistStyle:f="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:w,...S})=>{let{getFlow:A,getFlowSteps:y,markStepCompleted:m,getStepStatus:E,getNumberOfStepsCompleted:k,isLoading:P,targetingLogicShouldHideFlow:O,updateCustomVariables:I,getFlowMetadata:N,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:U}=Y(),{primaryCTAClickSideEffects:te,secondaryCTAClickSideEffects:fe}=ie(),{getOpenFlowState:X,setOpenFlowState:H}=we(),[j,Ce]=Is(r||0),[Ie,be]=Is(!1),me=c===void 0?X(e):c,J=s==="modal",{mergeAppearanceWithDefault:ge}=Q();if(x=ge(x),As(()=>{I(l)},[l,P]),As(()=>{c!==void 0&&(J&&c===!0?U(!0):J&&c===!1&&U(!1))},[c,h,ee]),P)return null;let re=A(e);if(!re||O(re))return null;let L=y(e);if(!L||b===!0&&D(e)===q)return null;let V=N(e);if(V!=null&&V.title&&(t=V.title),V!=null&&V.subtitle&&(o=V.subtitle),!Ie&&r===void 0&&k(e)>0){let u=L.findIndex(C=>C.complete===!1);Ce(u>-1?u:L.length-1),be(!0)}function G(){if(j+1>=L.length){J&&H(e,!1);return}$(e,L[j+1].id)||Ce(j+1)}function ne(u,C,v){let W=j+1<L.length?L[j+1]:null;d&&d(u,j,C,W)===!0&&J&&De(),g&&g(u,v,W),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&J&&De()}function se(){return L.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{G(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ne(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),G()),ne(u,"primary",C),te(u),E(e,u.id)===Ue&&G()}}))}function pe(){return ce.createElement(oe,{appearance:x})}let Ye={steps:se(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:T,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:w};function De(){H(e,!1),p&&p(),h&&h(!1)}function Et(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Es,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Br,{visible:me,onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,autoExpandNextStep:!0,appearance:x,...Ye}))}function At(){let u=S.guideFlowId,C;return u&&A(u)&&(C=y(u)),ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(vr,{visible:me,stepsTitle:V.stepsTitle?V.stepsTitle:"Your quick start guide",onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,guideData:C,guideTitle:S.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{ne(v,"link",0)},customStepTypes:T,...Ye}))}function gt(){let u=ce.createElement(kr,{flowId:e,style:i,selectedStep:j,setSelectedStep:Ce,appearance:x,type:s,...Ye});return J?ce.createElement(He,{onClose:()=>{De()},visible:me,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ce.createElement(pe,null),u):ce.createElement(ce.Fragment,null,ce.createElement(pe,null),u)}switch(f){case"condensed":return ft();case"with-guide":return At();case"default":return gt();case"carousel":return Et();default:return gt()}};var Ud=e=>Md.createElement(Ar,{type:"inline",...e});import mt,{useEffect as zd}from"react";import Ke from"react";import jo from"styled-components";var Ns=jo.div`
|
|
1342
1342
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1343
1343
|
border-radius: 8px;
|
|
1344
1344
|
padding: 6px 10px 6px 10px;
|
|
1345
1345
|
min-width: 160px;
|
|
1346
1346
|
cursor: pointer;
|
|
1347
1347
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1348
|
-
`,
|
|
1348
|
+
`,Os=jo.div`
|
|
1349
1349
|
display: flex;
|
|
1350
1350
|
flex-direction: row;
|
|
1351
1351
|
justify-content: space-between;
|
|
1352
1352
|
align-items: center;
|
|
1353
1353
|
margin-bottom: 2px;
|
|
1354
1354
|
flex-grow: 2;
|
|
1355
|
-
`,
|
|
1355
|
+
`,Ls=jo.div`
|
|
1356
1356
|
text-overflow: ellipsis;
|
|
1357
1357
|
font-weight: 600;
|
|
1358
1358
|
font-size: 12px;
|
|
@@ -1360,13 +1360,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1360
1360
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1361
1361
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1362
1362
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1363
|
-
`,
|
|
1363
|
+
`,Ds=jo.div`
|
|
1364
1364
|
width: 20px;
|
|
1365
1365
|
margin-right: 8px;
|
|
1366
1366
|
display: flex;
|
|
1367
1367
|
height: 100%;
|
|
1368
1368
|
align-items: center;
|
|
1369
|
-
`;var
|
|
1369
|
+
`;var $s=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ke.createElement(Ke.Fragment,null,Ke.createElement(oe,{appearance:s}),Ke.createElement(Ns,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Ds,{className:a("progressRingContainer",s)},Ke.createElement($t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement(Os,{type:p,className:a("badgeTitleContainer",s)},Ke.createElement(Ls,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Ke.createElement(Vt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ke.createElement(Le,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import ct from"react";import uo from"styled-components";var Ms=uo.div`
|
|
1370
1370
|
display: flex;
|
|
1371
1371
|
flex-direction: row;
|
|
1372
1372
|
width: 100%;
|
|
@@ -1377,19 +1377,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1377
1377
|
border-width: 1px;
|
|
1378
1378
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1379
1379
|
border-radius: 12px;
|
|
1380
|
-
`,
|
|
1380
|
+
`,Us=uo.div`
|
|
1381
1381
|
${e=>F(e)} {
|
|
1382
1382
|
display: flex;
|
|
1383
1383
|
justify-content: center;
|
|
1384
1384
|
align-items: center;
|
|
1385
1385
|
margin-right: 16px;
|
|
1386
1386
|
}
|
|
1387
|
-
`,
|
|
1387
|
+
`,zs=uo.div`
|
|
1388
1388
|
display: flex;
|
|
1389
1389
|
flex-direction: column;
|
|
1390
1390
|
flex: 1;
|
|
1391
1391
|
margin-top: 0;
|
|
1392
|
-
`,
|
|
1392
|
+
`,Ws=uo.div`
|
|
1393
1393
|
display: flex;
|
|
1394
1394
|
flex-direction: column;
|
|
1395
1395
|
justify-content: center;
|
|
@@ -1404,7 +1404,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1404
1404
|
:hover {
|
|
1405
1405
|
opacity: 0.8;
|
|
1406
1406
|
}
|
|
1407
|
-
`;var
|
|
1407
|
+
`;var _s=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>ct.createElement(ct.Fragment,null,ct.createElement(Ms,{appearance:i,className:xe(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&ct.createElement(Us,{className:a("fullWidthProgressBadgeIcon",i)},o),ct.createElement(zs,null,ct.createElement(Fe,{size:"small",appearance:i,title:e,subtitle:t})),ct.createElement(Ws,{className:a("fullWidthProgressBadgeProgressContainer",i)},ct.createElement(Le,{count:r,total:n,display:"percent",textLocation:"top"}))));var Wd=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:l,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:b,getNumberOfStepsCompleted:h,isLoading:T,targetingLogicShouldHideFlow:f,updateCustomVariables:B}=Y(),{mergeAppearanceWithDefault:w}=Q();l=w(l);let{setOpenFlowState:S,getOpenFlowState:A}=we();if(zd(()=>{B(p)},[p,T]),T)return null;let y=d(e);if(!y||f(y)||c===!0&&b(e)===q)return null;let m=x(e),E=h(e);return g==="full-width"?mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement(_s,{title:t,subtitle:o,count:E,total:m.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement($s,{count:E,total:m.length,title:t,style:r,onClick:()=>{S(e,!0),n&&n()},type:g,className:s,appearance:l}))};import _d from"react";var Hd=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let c=r(e);if(!c||n(c))return null;let l=s(e);return _d.createElement(mo,{steps:l,style:t,appearance:o,...i})};import ut,{useContext as Rd,useEffect as ec}from"react";import _,{useEffect as Vo,useLayoutEffect as js,useRef as Kd,useState as fo}from"react";import go from"styled-components";import{useCallback as jd,useEffect as Vd,useState as Gd}from"react";var Ir=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function Hs(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=Gd(o),n=jd(()=>{e&&r(e.getBoundingClientRect())},[e]);return Vd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}var Vs=300,Gs=100,qd=500,qt=12,Yd=go.div`
|
|
1408
1408
|
width: 100%;
|
|
1409
1409
|
height: 100%;
|
|
1410
1410
|
border-radius: 9999px;
|
|
@@ -1427,25 +1427,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1427
1427
|
opacity: 0;
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
|
-
`,
|
|
1430
|
+
`,Xd=go.div`
|
|
1431
1431
|
width: ${qt}px;
|
|
1432
1432
|
height: ${qt}px;
|
|
1433
1433
|
border-radius: 100px;
|
|
1434
1434
|
background-color: ${e=>e.primaryColor};
|
|
1435
1435
|
z-index: 20;
|
|
1436
1436
|
opacity: 1;
|
|
1437
|
-
`,
|
|
1437
|
+
`,Jd=go.div`
|
|
1438
1438
|
pointer-events: all;
|
|
1439
|
-
`,
|
|
1439
|
+
`,Ks=go.div`
|
|
1440
1440
|
display: flex;
|
|
1441
1441
|
align-content: center;
|
|
1442
1442
|
justify-content: center;
|
|
1443
1443
|
align-items: center;
|
|
1444
1444
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1445
|
-
`,
|
|
1445
|
+
`,Qd=go(Ks)`
|
|
1446
1446
|
width: ${qt+12}px;
|
|
1447
1447
|
height: ${qt+12}px;
|
|
1448
|
-
`,
|
|
1448
|
+
`,Zd=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:b,showStepCount:h=!0,completedStepsCount:T=0,showFrigadeBranding:f=!1,cssPosition:B="absolute"})=>{var se,pe,Ye,De,Et,ft,At,gt,u,C,v,W;let[w,S]=fo(),[A,y]=fo(new Date),m=Kd(null),[E,k]=fo(document.querySelector(e[l].selector)),P=Hs(E,A),[O,I]=fo(),[N,$]=fo(!b),D=(pe=(se=e[l])==null?void 0:se.props)!=null&&pe.position?e[l].props.position:B,ee=((De=(Ye=e[l])==null?void 0:Ye.props)==null?void 0:De.zIndex)??90,U=(w==null?void 0:w.width)??Vs,te=(w==null?void 0:w.height)??Gs,fe=window.location.pathname.split("/").pop();js(()=>{m.current&&S({width:m.current.clientWidth,height:m.current.clientHeight})},[l,A,D]),Vo(()=>{b||$(!0)},[l]);let X=()=>{let M=document.querySelector(e[l].selector);if(!M){I(void 0),k(null);return}O&&O===JSON.stringify(M==null?void 0:M.getBoundingClientRect())||(k(M),y(new Date),M&&I(JSON.stringify(M.getBoundingClientRect())))};if(Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0}),()=>M.disconnect()},[X]),Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>M.disconnect()},[X]),Vo(()=>{let M=setInterval(()=>{X()},10);return()=>clearInterval(M)},[X]),js(()=>{setTimeout(()=>{X()},qd),X()},[l,fe]),E===null||!p||P.height===0&&P.width===0&&D!=="fixed"&&B!=="static")return null;let H=i==="auto"?"right":i,j=Ir(P,H,U,s,D),Ce=P.right+U>(window.innerWidth||document.documentElement.clientWidth),Ie=P.bottom+Gs>(window.innerHeight||document.documentElement.clientHeight);Ce&&i==="auto"&&(j=Ir(P,"left",U,s,D),H="left"),(ft=(Et=e[l])==null?void 0:Et.props)!=null&&ft.tooltipPosition&&((gt=(At=e[l])==null?void 0:At.props)==null?void 0:gt.tooltipPosition)!=="auto"&&(((C=(u=e[l])==null?void 0:u.props)==null?void 0:C.tooltipPosition)==="left"||((W=(v=e[l])==null?void 0:v.props)==null?void 0:W.tooltipPosition)==="right")&&(H=e[l].props.tooltipPosition);let be=()=>{let M=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{X()},30)),T===e.length-1)return o()},$e=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),b&&!e[l].secondaryButtonUri&&$(!1))};return _.createElement(_.Fragment,null,h&&e.length>1&&_.createElement(Qr,null,_.createElement(Rr,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),_.createElement(Zr,{showStepCount:h,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&_.createElement(Z,{title:e[l].secondaryButtonTitle,appearance:d,onClick:$e,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&_.createElement(Z,{title:e[l].primaryButtonTitle,appearance:d,onClick:M,withMargin:!1,size:"small"})))},me=()=>_.createElement(_.Fragment,null,x&&_.createElement(Kr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},_.createElement(Te,null)),e[l].imageUri&&_.createElement(qr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&_.createElement(Yr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},_.createElement(Ve,{appearance:d,videoUri:e[l].videoUri})),_.createElement(Jr,{className:a("tooltipContentContainer",d)},_.createElement(Fe,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),_.createElement(Xr,{className:a("tooltipFooter",d)},_.createElement(be,null)))),ge={...{default:M=>{var $e;if(($e=e[l])!=null&&$e.StepContent){let Al=e[l].StepContent;return _.createElement("div",null,Al)}return _.createElement(me,null)}},...g},re=()=>{var M;return e?!((M=e[l])!=null&&M.type)||!ge[e[l].type]?ge.default(e[l]):ge[e[l].type]({stepData:e[l],primaryColor:n}):_.createElement(_.Fragment,null)};if(b&&e[l].complete===!0)return null;let L={top:(j==null?void 0:j.y)-qt,left:(H=="left"?P.x+s.x:(j==null?void 0:j.x)-qt)??0,cursor:b?"pointer":"default",position:D},V=()=>{let $e=L.left+(H=="left"?-U:24);return Math.min(Math.max($e,20),window.innerWidth-U-20)},G=()=>{if(D==="fixed")return L.top;let M=L.top+te,$e=20;return M>window.innerHeight-$e?L.top+-te:L.top},ne=()=>{b&&(y(new Date),$(!N))};return _.createElement(Jd,null,_.createElement(Qd,{style:L,zIndex:ee,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&B!=="static"&&_.createElement(_.Fragment,null,_.createElement(Xd,{style:{position:D},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),_.createElement(Yd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),_.createElement(Ks,{style:{...L,left:V(),top:G()},zIndex:ee+1,className:a("tooltipContainerWrapper",d)},N&&_.createElement(_.Fragment,null,_.createElement(Co,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:B!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:Vs,zIndex:ee+10},_.createElement(re,null)),f&&_.createElement(ti,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:ee+10},_.createElement(yo,{appearance:d})))))},Go=Zd;import{Portal as tc}from"react-portal";var oc=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:b="absolute",...h})=>{let{getFlow:T,getFlowSteps:f,isLoading:B,targetingLogicShouldHideFlow:w,markStepCompleted:S,markStepStarted:A,markFlowCompleted:y,updateCustomVariables:m,getCurrentStepIndex:E,getStepStatus:k,isStepBlocked:P,getFlowStatus:O,getNumberOfStepsCompleted:I}=Y(),{isLoadingUserFlowStateData:N}=Be(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:ee}=we(),U=E(e),{openFlowStates:te}=Rd(K),{mergeAppearanceWithDefault:fe}=Q();if(o=fe(o),ec(()=>{m(t)},[t,B]),N)return null;let X=T(e);if(!X||w(X)||O(e)==q||ee())return null;let H=f(e);if(Object.keys(te).length>0){let L=Object.keys(te).find(V=>te[V]===!0);if(L!==void 0&&L!==e)return ut.createElement(ut.Fragment,null)}async function j(L){if(await S(e,L.id),H.map(V=>k(e,V.id)).every(V=>V===Ue)){await y(e);return}if(!l&&U+1<H.length){if(P(e,H[U+1].id))return;await A(e,H[U+1].id)}}function Ce(L,V,G){let ne=U+1<H.length?H[U+1]:null;r&&r(L,U,V,ne),i&&i(L,G,ne)}function Ie(){return H.map(L=>({...L,handleSecondaryButtonClick:async()=>{D(L),L.skippable===!0&&await S(e,L.id,{skipped:!0}),Ce(L,"secondary",U)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await j(L),Ce(L,"primary",U),$(L)}}))}async function be(L){s&&s(),g==="complete-flow"?await y(e):await S(e,L.id)}function me(){d&&d()}let J=!document.querySelector(H[U].selector);function ge(){let L=H.findIndex(V=>!!document.querySelector(V.selector));return H.map((V,G)=>J&&!n&&G!==L&&x?null:ut.createElement(Go,{key:V.id,appearance:o,steps:Ie(),selectedStep:G,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(V),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:I(e),onComplete:me,cssPosition:b,...h}))}function re(){return ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:o}),n||J&&x?ge():ut.createElement(Go,{appearance:o,steps:Ie(),selectedStep:U,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(H[U]),tooltipPosition:c,completedStepsCount:I(e),showHighlightOnly:l,onComplete:me,cssPosition:b,...h}))}return b==="static"?re():ut.createElement(tc,null,re())};import Ae,{useEffect as rc,useRef as ic,useState as nc}from"react";import{Portal as sc}from"react-portal";import vt from"styled-components";var qs=vt.button`
|
|
1449
1449
|
${e=>F(e)} {
|
|
1450
1450
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1451
1451
|
|
|
@@ -1463,17 +1463,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1463
1463
|
opacity: 0.8;
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
1466
|
-
`,
|
|
1466
|
+
`,Ys=vt.span`
|
|
1467
1467
|
${e=>F(e)} {
|
|
1468
1468
|
font-size: 12px;
|
|
1469
1469
|
display: inline-block;
|
|
1470
1470
|
}
|
|
1471
|
-
`,
|
|
1471
|
+
`,Xs=vt.span`
|
|
1472
1472
|
${e=>F(e)} {
|
|
1473
1473
|
font-size: 12px;
|
|
1474
1474
|
display: inline-block;
|
|
1475
1475
|
}
|
|
1476
|
-
`,
|
|
1476
|
+
`,Js=vt.div`
|
|
1477
1477
|
position: fixed;
|
|
1478
1478
|
right: 0;
|
|
1479
1479
|
bottom: 0;
|
|
@@ -1483,7 +1483,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1483
1483
|
flex-direction: column;
|
|
1484
1484
|
align-items: flex-end;
|
|
1485
1485
|
z-index: 50;
|
|
1486
|
-
`,
|
|
1486
|
+
`,Qs=vt.button`
|
|
1487
1487
|
${e=>F(e)} {
|
|
1488
1488
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1489
1489
|
background-color: #ffffff;
|
|
@@ -1499,7 +1499,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1499
1499
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1500
1500
|
border-radius: 45px;
|
|
1501
1501
|
cursor: pointer;
|
|
1502
|
-
`,
|
|
1502
|
+
`,Zs=vt.div`
|
|
1503
1503
|
${e=>F(e)} {
|
|
1504
1504
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1505
1505
|
background: #ffffff;
|
|
@@ -1516,7 +1516,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1516
1516
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1517
1517
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1518
1518
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1519
|
-
`,
|
|
1519
|
+
`,Rs=vt.button`
|
|
1520
1520
|
${e=>F(e)} {
|
|
1521
1521
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1522
1522
|
color: #434343;
|
|
@@ -1533,7 +1533,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1533
1533
|
font-size: 14px;
|
|
1534
1534
|
|
|
1535
1535
|
padding: 8px 12px;
|
|
1536
|
-
`;import
|
|
1536
|
+
`;import el from"react";var tl=({style:e,className:t})=>el.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},el.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 ol from"react";var rl=({style:e,className:t})=>ol.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"},ol.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 lc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:b}=Y(),{primaryCTAClickSideEffects:h}=ie(),T=ic(null),[f,B]=nc(!1),{mergeAppearanceWithDefault:w}=Q();s=w(s),rc(()=>(document.addEventListener("click",S,!1),()=>{document.removeEventListener("click",S,!1)}),[]);let S=k=>{T.current&&!T.current.contains(k.target)&&B(!1)};if(x)return null;let A=p(e);if(!A||b(A))return null;let y=c(e);if(!y||!i)return null;function m(k,P){!k.completionCriteria&&(k.autoMarkCompleted||k.autoMarkCompleted===void 0)&&l(e,k.id),h(k),o&&o(k,P),B(!1)}function E(){return f&&Ae.createElement(Zs,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},y.map((k,P)=>Ae.createElement(Rs,{className:a("floatingWidgetMenuItem",s),key:P,onClick:()=>m(k,P)},k.title)))}return r=="inline"?Ae.createElement("span",{ref:T},Ae.createElement(qs,{style:t,onClick:()=>{B(!f)},className:a("supportButton",s)},Ae.createElement(Xs,{className:a("supportIconContainer",s)},Ae.createElement(rl,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ae.createElement(Ys,{className:a("supportButtonTitle",s)},n)),Ae.createElement(E,null)):Ae.createElement(sc,null,Ae.createElement(Js,{style:t,ref:T},Ae.createElement(E,null),Ae.createElement(Qs,{onClick:()=>{B(!f)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ae.createElement(tl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as ac}from"react";import Ko from"styled-components";var il=Ko.div`
|
|
1537
1537
|
${e=>F(e)} {
|
|
1538
1538
|
display: flex;
|
|
1539
1539
|
flex-direction: column;
|
|
@@ -1548,17 +1548,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1548
1548
|
border-radius: 12px;
|
|
1549
1549
|
position: relative;
|
|
1550
1550
|
}
|
|
1551
|
-
`,
|
|
1551
|
+
`,nl=Ko.div`
|
|
1552
1552
|
display: flex;
|
|
1553
1553
|
flex-direction: column;
|
|
1554
1554
|
flex: 1;
|
|
1555
|
-
`,
|
|
1555
|
+
`,sl=Ko.div`
|
|
1556
1556
|
display: flex;
|
|
1557
1557
|
flex-direction: column;
|
|
1558
1558
|
justify-content: center;
|
|
1559
1559
|
align-items: flex-start;
|
|
1560
1560
|
margin-top: 16px;
|
|
1561
|
-
`,
|
|
1561
|
+
`,ll=Ko.div`
|
|
1562
1562
|
${e=>F(e)} {
|
|
1563
1563
|
position: absolute;
|
|
1564
1564
|
top: 16px;
|
|
@@ -1569,7 +1569,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1569
1569
|
opacity: 0.8;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
`;var
|
|
1572
|
+
`;var pc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:b,getFlowSteps:h,getFlowStatus:T,getCurrentStepIndex:f}=Y(),{primaryCTAClickSideEffects:B}=ie(),{mergeAppearanceWithDefault:w}=Q();if(r=w(r),ac(()=>{b(o)},[o,d]),d)return null;let S=c(e);if(!S||x(S)||T(e)===q)return null;let y=h(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(il,{appearance:r,className:xe(a("embeddedTipContainer",r),n),style:s},(p===!0||y.dismissible)&&qe.createElement(ll,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},qe.createElement(Te,null)),qe.createElement(nl,null,qe.createElement(Fe,{size:"small",appearance:r,title:y.title,subtitle:y.subtitle})),y.primaryButtonTitle&&qe.createElement(sl,{className:a("embeddedTipCallToActionContainer",r)},qe.createElement(Z,{classPrefix:"embeddedTip",title:y.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{y.handlePrimaryButtonClick(),B(y),!(i&&i(y,f(e),"primary")===!1)&&(await g(e,y.id),await l(e))}}))))};import ye,{useEffect as dc}from"react";import Yt from"styled-components";var al=Yt.div`
|
|
1573
1573
|
// use the :not annotation
|
|
1574
1574
|
${e=>F(e)} {
|
|
1575
1575
|
display: flex;
|
|
@@ -1581,24 +1581,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1581
1581
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1582
1582
|
border-radius: 12px;
|
|
1583
1583
|
}
|
|
1584
|
-
`,
|
|
1584
|
+
`,pl=Yt.div`
|
|
1585
1585
|
${e=>F(e)} {
|
|
1586
1586
|
display: flex;
|
|
1587
1587
|
width: 46px;
|
|
1588
1588
|
height: 46px;
|
|
1589
1589
|
}
|
|
1590
|
-
`,
|
|
1590
|
+
`,dl=Yt.div`
|
|
1591
1591
|
display: flex;
|
|
1592
1592
|
flex-direction: column;
|
|
1593
1593
|
flex: 1;
|
|
1594
1594
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1595
1595
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1596
|
-
`,
|
|
1596
|
+
`,cl=Yt.div`
|
|
1597
1597
|
display: flex;
|
|
1598
1598
|
flex-direction: column;
|
|
1599
1599
|
justify-content: center;
|
|
1600
1600
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1601
|
-
`,
|
|
1601
|
+
`,Nr=Yt.div`
|
|
1602
1602
|
display: flex;
|
|
1603
1603
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1604
1604
|
align-items: flex-end;
|
|
@@ -1606,12 +1606,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1606
1606
|
:hover {
|
|
1607
1607
|
opacity: 0.8;
|
|
1608
1608
|
}
|
|
1609
|
-
`,
|
|
1609
|
+
`,Or=Yt.div`
|
|
1610
1610
|
display: flex;
|
|
1611
1611
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1612
1612
|
align-items: flex-end;
|
|
1613
1613
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1614
|
-
`;import
|
|
1614
|
+
`;import Lr from"react";var ml=({style:e,className:t})=>Lr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Lr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Lr.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var cc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:l,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:b,getFlowMetadata:h,getFlowStatus:T,getFlowSteps:f,getCurrentStepIndex:B}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:S}=Q();if(s=S(s),dc(()=>{b(r)},[r,d]),d)return null;let A=l(e);if(!A||x(A)||T(e)===q)return null;let y=f(e),m=y.length>0?y[B(e)]:h(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ye.createElement(ye.Fragment,null,ye.createElement(oe,{appearance:s}),ye.createElement(al,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ye.createElement(pl,{className:a("bannerIconContainer",s)},c||ye.createElement(ml,null)),p==="square"&&m.dismissible&&ye.createElement(Or,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Nr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null))),ye.createElement(dl,{type:p},ye.createElement(Fe,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&ye.createElement(cl,{type:p,className:a("bannerCallToActionContainer",s)},ye.createElement(Z,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{w(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&ye.createElement(Or,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Nr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null)))))};import R,{useEffect as mc}from"react";import{Portal as uc}from"react-portal";import it from"styled-components";var ul=it.div`
|
|
1615
1615
|
display: flex;
|
|
1616
1616
|
flex-direction: column;
|
|
1617
1617
|
width: 100%;
|
|
@@ -1630,7 +1630,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1630
1630
|
z-index: 1000;
|
|
1631
1631
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1632
1632
|
min-width: 550px;
|
|
1633
|
-
`,
|
|
1633
|
+
`,fl=it.button`
|
|
1634
1634
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1635
1635
|
border-radius: 8px;
|
|
1636
1636
|
// If selected make border color primary and text color color priamry
|
|
@@ -1651,23 +1651,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1651
1651
|
display: flex;
|
|
1652
1652
|
justify-content: center;
|
|
1653
1653
|
align-items: center;
|
|
1654
|
-
`,
|
|
1654
|
+
`,Dr=it.div`
|
|
1655
1655
|
display: flex;
|
|
1656
1656
|
justify-content: space-between;
|
|
1657
1657
|
margin-top: 16px;
|
|
1658
1658
|
gap: 8px;
|
|
1659
|
-
`,
|
|
1659
|
+
`,gl=it.div`
|
|
1660
1660
|
display: flex;
|
|
1661
1661
|
justify-content: space-between;
|
|
1662
1662
|
margin-top: 8px;
|
|
1663
|
-
|
|
1663
|
+
`,$r=it.div`
|
|
1664
1664
|
font-size: 12px;
|
|
1665
1665
|
line-height: 18px;
|
|
1666
1666
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1667
1667
|
font-style: normal;
|
|
1668
1668
|
font-weight: 400;
|
|
1669
1669
|
letter-spacing: 0.24px;
|
|
1670
|
-
|
|
1670
|
+
`,Mr=it.div`
|
|
1671
1671
|
display: flex;
|
|
1672
1672
|
flex-direction: column;
|
|
1673
1673
|
flex: 1;
|
|
@@ -1677,7 +1677,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1677
1677
|
justify-content: center;
|
|
1678
1678
|
align-items: flex-start;
|
|
1679
1679
|
margin-top: 16px;
|
|
1680
|
-
`,
|
|
1680
|
+
`,xl=it.textarea`
|
|
1681
1681
|
${e=>F(e)} {
|
|
1682
1682
|
margin-top: 16px;
|
|
1683
1683
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1688,7 +1688,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1688
1688
|
width: 100%;
|
|
1689
1689
|
height: 100px;
|
|
1690
1690
|
}
|
|
1691
|
-
`,
|
|
1691
|
+
`,hl=it.div`
|
|
1692
1692
|
${e=>F(e)} {
|
|
1693
1693
|
position: absolute;
|
|
1694
1694
|
top: 16px;
|
|
@@ -1699,7 +1699,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1699
1699
|
opacity: 0.8;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
`;var
|
|
1702
|
+
`;var fc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:b,updateCustomVariables:h,getFlowSteps:T,getFlowStatus:f,getCurrentStepIndex:B}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:S}=Q(),[A,y]=R.useState(null),[m,E]=R.useState(""),{hasOpenModals:k,setKeepCompletedFlowOpenDuringSession:P,shouldKeepCompletedFlowOpenDuringSession:O}=we();if(r=S(r),mc(()=>{h(o)},[o,x]),x)return null;let I=c(e);if(!I||b(I)||f(e)===q||d(e)===1&&!O(e)||k())return null;let $=T(e)[d(e)];function D(){return R.createElement(R.Fragment,null,R.createElement(Mr,null,R.createElement(Fe,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),R.createElement(Dr,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(te=>R.createElement(fl,{className:a("npsNumberButton",r),selected:A===te+1,key:te,onClick:async()=>{P(e),y(te+1),await g(e,$.id,{score:te+1})},appearance:r},te+1))),R.createElement(gl,{appearance:r},R.createElement($r,{appearance:r},"Not likely at all"),R.createElement($r,{appearance:r},"Extremely likely")))}function ee(){return R.createElement(R.Fragment,null,R.createElement(Mr,null,R.createElement(Fe,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),R.createElement(xl,{appearance:r,value:m,onChange:te=>{E(te.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(Dr,{appearance:r,className:a("npsNumberButtonContainer",r)},R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await l(e),i&&i($,1,"primary")},appearance:r,title:$.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await g(e,$.id,{feedbackText:m}),await l(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function U(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(oe,{appearance:r}),R.createElement(ul,{appearance:r,className:xe(a("npsSurveyContainer",r),n),style:s,type:p},R.createElement(hl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},R.createElement(Te,null)),d(e)==0&&D(),d(e)==1&&ee()))}return p==="inline"?U():R.createElement(uc,null,U())};import Se,{useEffect as hc}from"react";import Bt from"styled-components";var Cl=Bt.div`
|
|
1703
1703
|
${e=>F(e)} {
|
|
1704
1704
|
display: flex;
|
|
1705
1705
|
flex-direction: column;
|
|
@@ -1710,21 +1710,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1710
1710
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1711
1711
|
position: relative;
|
|
1712
1712
|
}
|
|
1713
|
-
`,
|
|
1713
|
+
`,yl=Bt.div`
|
|
1714
1714
|
display: flex;
|
|
1715
1715
|
flex-direction: column;
|
|
1716
1716
|
flex: 1;
|
|
1717
|
-
`,
|
|
1717
|
+
`,Sl=Bt.div`
|
|
1718
1718
|
display: flex;
|
|
1719
1719
|
flex-direction: row;
|
|
1720
1720
|
justify-content: center;
|
|
1721
1721
|
align-items: stretch;
|
|
1722
1722
|
gap: 16px;
|
|
1723
1723
|
margin-top: 8px;
|
|
1724
|
-
`,
|
|
1724
|
+
`,bl=Bt.div`
|
|
1725
1725
|
margin-top: 16px;
|
|
1726
1726
|
margin-bottom: 16px;
|
|
1727
|
-
`,
|
|
1727
|
+
`,wl=Bt.div`
|
|
1728
1728
|
${e=>F(e)} {
|
|
1729
1729
|
position: absolute;
|
|
1730
1730
|
top: -16px;
|
|
@@ -1735,7 +1735,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1735
1735
|
opacity: 0.8;
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
|
-
`,
|
|
1738
|
+
`,Tl=Bt.h1`
|
|
1739
1739
|
${e=>F(e)} {
|
|
1740
1740
|
font-style: normal;
|
|
1741
1741
|
justify-content: center;
|
|
@@ -1749,7 +1749,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1749
1749
|
color: ${e=>e.appearance.theme.colorText};
|
|
1750
1750
|
margin-bottom: 8px;
|
|
1751
1751
|
}
|
|
1752
|
-
`,
|
|
1752
|
+
`,Fl=Bt.h2`
|
|
1753
1753
|
${e=>F(e)} {
|
|
1754
1754
|
font-style: normal;
|
|
1755
1755
|
justify-content: center;
|
|
@@ -1761,10 +1761,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1761
1761
|
letter-spacing: 0.28px;
|
|
1762
1762
|
margin-bottom: 8px;
|
|
1763
1763
|
}
|
|
1764
|
-
`;import
|
|
1764
|
+
`;import kl from"react";import gc from"styled-components";var xc=gc.img`
|
|
1765
1765
|
width: 100%;
|
|
1766
1766
|
height: 100%;
|
|
1767
1767
|
min-height: 200px;
|
|
1768
1768
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1769
|
-
`;function
|
|
1769
|
+
`;function Pl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?kl.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?kl.createElement(xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Cc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:l,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:b,updateCustomVariables:h,getFlowSteps:T,getFlowStatus:f,getCurrentStepIndex:B}=Y(),{primaryCTAClickSideEffects:w,secondaryCTAClickSideEffects:S}=ie(),{mergeAppearanceWithDefault:A}=Q(),{setOpenFlowState:y,getOpenFlowState:m,hasOpenModals:E}=we(),[k,P]=[m(e,!0),U=>y(e,U)];if(r=A(r),hc(()=>{h(o)},[o,x]),x)return null;let O=l(e);if(!O||b(O)||f(e)===q||E())return null;let N=T(e)[B(e)],$=()=>{P(!1),t&&t(),g(e)};function D(){return Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:r}),Se.createElement(Cl,{appearance:r,className:xe(a("announcementContainer",r),n),style:s},(p===!0||N.dismissible)&&c=="inline"&&Se.createElement(wl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},Se.createElement(Te,null)),Se.createElement(yl,null,Se.createElement(Tl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:le(N.title)}),N.subtitle&&Se.createElement(Fl,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:le(N.subtitle)})),(N.imageUri||N.videoUri)&&Se.createElement(bl,{className:a("announcementMediaContainer",r)},Se.createElement(Pl,{appearance:r,stepData:N})),(N.primaryButtonTitle||N.secondaryButtonTitle)&&Se.createElement(Sl,{className:a("announcementCTAContainer",r)},N.secondaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:N.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{N.handleSecondaryButtonClick(),S(N),i&&i(N,B(e),"secondary")},secondary:!0}),N.primaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:N.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{N.handlePrimaryButtonClick(),w(N),!(i&&i(N,B(e),"primary")===!1)&&(await d(e,N.id),await g(e))}}))))}let ee={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?Se.createElement(wo,{modalPosition:c,onClose:$,visible:k,dismissible:p,appearance:r},D()):Se.createElement(He,{appearance:r,onClose:$,visible:k,style:ee,dismissible:p},D())};import*as qo from"react";import vl from"react";var Bl=({as:e="span",children:t,variant:o="Body1",...i})=>vl.createElement(Qi,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),yc=Object.fromEntries(Object.keys(Do).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>vl.createElement(Bl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Ur=Object.assign(Bl,yc);var El=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return qo.createElement(Ji,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},qo.createElement(Ur,{color:(s=ao[r])==null?void 0:s.color,fontWeight:"semibold"},i))},Sc=Object.fromEntries(Object.keys(ao).map(e=>{let t=o=>qo.createElement(El,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),bc=Object.assign(El,Sc);export{lo as Box,bc as Button,Qe as CheckBox,Xo as FlowType,st as FormLabel,lr as FormTextField,Cc as FrigadeAnnouncement,cc as FrigadeBanner,Ar as FrigadeChecklist,Je as FrigadeDefaultAppearance,pc as FrigadeEmbeddedTip,Hi as FrigadeForm,Hd as FrigadeGuide,Ud as FrigadeHeroChecklist,fc as FrigadeNPSSurvey,Wd as FrigadeProgressBadge,Yp as FrigadeProvider,lc as FrigadeSupportWidget,oc as FrigadeTour,$t as ProgressRing,Ur as Text,br as tokens,we as useFlowOpens,Xt as useFlowResponses,Y as useFlows,Cr as useOrganization,Jt as useUser,Be as useUserFlowStates};
|
|
1770
1770
|
//# sourceMappingURL=index.mjs.map
|