@frigade/react 1.35.29 → 1.35.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +121 -121
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +217 -217
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import{ThemeProvider as Zp}from"styled-components";import St,{useContext as Pp,useEffect as ao,useState as Uo}from"react";import{useCallback as ht,useContext as Jl,useEffect as Ql}from"react";import Qo,{useMemo as Gr}from"react";var Vr="1.35.29 ";var $e="NOT_STARTED_STEP",q="COMPLETED_FLOW",yo="ABORTED_FLOW",xt="STARTED_FLOW",Ae="NOT_STARTED_FLOW",ze="COMPLETED_STEP",So="STARTED_STEP";function He(){let{publicApiKey:e,userId:t,apiUrl:o}=Qo.useContext(K);return{config:Gr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Vr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Gr(()=>`${o}/v1/public/`,[o])}}var Ul="frigade-last-call-at-",zl="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Qo.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=Ul+o,n=zl+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}=Qo.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 ql,useState as Kr}from"react";import{useContext as _l,useEffect as Hl,useState as jl}from"react";import Vl from"swr";import{useContext as Wl}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Wl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(T=>({...T,[d]:x}))}function p(d){t(x=>{let{[d]:T,...b}=x;return{...b}})}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,T])=>T&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Gl from"swr/immutable";var Kl="unknown";function Ie(){let{config:e,apiUrl:t}=He(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=_l(K),{resetOpenFlowState:c}=ke(),[l,g]=jl(!1),d={data:n.map(h=>({flowId:h.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=h=>fetch(h,e).then(B=>{if(B.ok)return B.json();throw new Error("Failed to fetch user flow states")}).catch(B=>(console.log(`Error fetching ${h}: ${B}. Will gracefully degrade and hide Frigade`),s(!0),d)),T=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:b,isLoading:S,mutate:u,error:v}=p?Gl(T,x):Vl(T,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=b==null?void 0:b.data;Hl(()=>{!l&&!S&&w&&g(!0)},[w,l,S]);async function C(h){if(w&&!p){let B=w.find(I=>I.flowId===h);B&&B.flowState!==q&&(B.flowState=q),await u(Promise.resolve({...b,data:w}),{optimisticData:{...b,data:w},revalidate:!1,rollbackOnError:!1})}}async function N(h,B,I){if(w){let O=w.find(A=>A.flowId===h);O&&(O.stepStates[B]=I,O.flowState=xt),await u(Promise.resolve({...b,data:w}),{optimisticData:{...b,data:w},revalidate:!1,rollbackOnError:!1})}}async function P(h,B,I){if(w){let O=w.find(A=>A.flowId===h);O&&(O.lastStepId=B,O.stepStates[B]=I,O.flowState=xt),await u({...b,data:w},{optimisticData:{...b,data:w},revalidate:!1,rollbackOnError:!1})}}async function f(h){if(w){let B=w.find(I=>I.flowId===h);B&&B.flowState!==Ae&&(B.flowState=Ae,B.lastStepId=Kl,Object.keys(B.stepStates).forEach(I=>{B.stepStates[I].actionType=$e,B.stepStates[I].createdAt=new Date().toISOString()}),await u({...b,data:w},{optimisticData:{...b,data:w},revalidate:!1,rollbackOnError:!1}),c(h))}}async function F(h,B){if(w){let I=w.find(O=>O.flowId===h);I&&I.stepStates[B]!==$e&&(I.stepStates[B]=$e),await u({...b,data:w},{optimisticData:{...b,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:u,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:P,error:v}}function Zt(){let{config:e,apiUrl:t}=He(),{userFlowStatesData:o,mutateUserFlowState:i}=Ie(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=ql(K),[c,l]=Kr(new Set),[g,d]=Kr(new Set),x=Nt();function T(u){let v=JSON.stringify(u);if(c.has(v))return null;c.add(v),l(c),g.add(u),d(g);let w=s==null?void 0:s.find(C=>C.flowSlug===u.flowSlug&&C.stepId===u.stepId&&C.actionType===u.actionType&&C.createdAt===u.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:v}).then(C=>{C.status!==200&&C.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),n([...r,u])):w||p(N=>[...N??[],u])})}async function b(u){u.foreignUserId&&(u.actionType===xt||u.actionType===Ae?await T(u):u.actionType===q?await T(u):u.actionType===So?await T(u):u.actionType===ze?await T(u):u.actionType===yo?await T(u):u.actionType===$e&&await T(u))}function S(){let u=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let w in v.stepStates){let C=v.stepStates[w];u.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:C.stepId,actionType:C.actionType,data:{},createdAt:new Date(C.createdAt),blocked:C.blocked,hidden:C.hidden})}}),[...u,...s]}return{addResponse:b,setFlowResponses:p,getFlowResponses:S}}import Zl from"swr";var Yl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,qr=e=>{let t=Yl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Xl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Xl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Zo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Ro=(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))(Ro||{});function J(){let{config:e,apiUrl:t}=He(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Jl(K),T={data:[]},{verifySDKInitiated:b}=Ot(),{addResponse:S,getFlowResponses:u}=Zt(),v=m=>fetch(m,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${m} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),T)).catch(y=>(console.log(`Error fetching ${m}: ${y}. Will gracefully degrade and hide Frigade`),d(!0),T)),{mutateUserFlowState:w,userFlowStatesData:C,isLoadingUserFlowStateData:N,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:F,optimisticallyMarkStepNotStarted:h,optimisticallyMarkStepStarted:B}=Ie(),{data:I,error:O,isLoading:A}=Zl(n?`${t}flows${x?"?readonly=true":""}`:null,v,{keepPreviousData:!0});Ql(()=>{if(O){console.error(O);return}I&&I.data&&i(I.data)},[I,O]);function D(m){if(A)return null;let y=o.find(E=>E.slug===m);return!y&&o.length>0&&!N&&!A?(console.log(`Flow with id ${m} not found`),null):(y==null?void 0:y.active)===!1?null:y}function $(m){var W;if(!D(m))return[];let y=D(m).data;return y?(y=j(y),(((W=Zo(y))==null?void 0:W.data)??[]).map(pe=>{let Qt=ye(pe);return{handleSecondaryButtonClick:()=>{pe.skippable===!0&&re(m,pe.id,{skipped:!0})},...pe,complete:me(m,pe.id)===ze||Qt>=1,blocked:Fe(m,pe.id),hidden:L(m,pe.id),handlePrimaryButtonClick:()=>{(!pe.completionCriteria&&(pe.autoMarkCompleted||pe.autoMarkCompleted===void 0)||pe.completionCriteria&&pe.autoMarkCompleted===!0)&&re(m,pe.id)},progress:Qt}}).filter(pe=>pe.hidden!==!0)):[]}function j(m){return m.replaceAll(/\${(.*?)}/g,(y,E)=>s[E]===void 0?"":String(s[E]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function H(m){if(!D(m))return[];let y=D(m).data;return y?(y=j(y),JSON.parse(y)??{}):[]}function V(m,y){p(E=>({...E,[m]:y}))}function we(m){!N&&!A&&m&&JSON.stringify(s)!=JSON.stringify({...s,...m})&&Object.keys(m).forEach(y=>{V(y,m[y])})}let ce=ht(async(m,y,E)=>{if(!b())return;let W={foreignUserId:r,flowSlug:m,stepId:y,actionType:So,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};ee(W)&&(await B(m,y,W),S(W))},[r,C]),G=ht(async(m,y,E)=>{if(!b())return;let W={foreignUserId:r,flowSlug:m,stepId:y,actionType:$e,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};ee(W)&&(await h(m,y),S(W))},[r,C]),re=ht(async(m,y,E)=>{if(!b())return;let W={foreignUserId:r,flowSlug:m,stepId:y,actionType:ze,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};ee(W)&&(await F(m,y,W),S(W))},[r,C]),Y=ht(async(m,y)=>{if(!b()||X(m)===Ae)return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:Ae,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await f(m),ee(E)&&S(E)},[r,C]),Te=ht(async(m,y)=>{if(!b())return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:xt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ee(E)&&S(E)},[r,C]),le=ht(async(m,y)=>{if(!b())return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:q,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ee(E)&&(await P(m),S(E))},[r,C]),he=ht(async(m,y)=>{if(!b())return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:yo,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ee(E)&&(await P(m),S(E))},[r,C]);function ee(m){var y;if(!C&&m.actionType===$e)return!1;if(C){let E=C.find(W=>W.flowId===m.flowSlug);if(m.actionType===$e&&(!(E!=null&&E.stepStates[m.stepId])||E.stepStates[m.stepId].actionType===$e)||E&&((y=E.stepStates[m.stepId])==null?void 0:y.actionType)===m.actionType||E&&E.flowState===q&&m.actionType===q)return!1}return!0}function me(m,y){let E=U(m,y);return N?null:E?E.actionType:$e}function Fe(m,y){let E=U(m,y);return E?E.blocked:!1}function L(m,y){let E=U(m,y);return E?E.hidden:!1}function U(m,y){if(N)return null;let E=C==null?void 0:C.find(W=>W.flowId===m);return!E||!E.stepStates[y]?null:E.stepStates[y]??null}function Ce(m){var E;if(N||!C)return null;if(X(m)===Ae)return $(m)[0]??null;let y=(E=C.find(W=>W.flowId===m))==null?void 0:E.lastStepId;return y?$(m).find(W=>W.id===y):null}function z(m){let y=Ce(m);if(!y)return 0;let E=$(m).findIndex(W=>W.id===y.id)??0;return me(m,y.id)===ze&&E<$(m).length-1?E+1:E}function ye(m){if(!m.completionCriteria)return;let y=qr(m.completionCriteria);if(y===null)return;let E=fe(y),W=Ue(y);return W===0?void 0:E/W}function X(m){let y=C==null?void 0:C.find(E=>E.flowId===m);return y?y.flowState:null}function fe(m){let y=$(m);return y.length===0?0:y.filter(W=>me(m,W.id)===ze).length}function Ue(m){return $(m).length}function Et(m){let y=o.find(E=>E.slug===m);return y?Zo(y.data):null}function ft(m){if(x)return!1;if(N)return!0;if(m!=null&&m.targetingLogic&&C){let y=C.find(E=>E.flowId===m.slug);if(y)return y.shouldTrigger===!1}return!!(m!=null&&m.targetingLogic&&r&&r.startsWith("guest_"))}function At(m){return!ft(D(m))}function gt(){r&&w()}return{getFlow:D,getFlowData:Et,isLoading:N||A,getStepStatus:me,getFlowSteps:$,getCurrentStepIndex:z,markStepStarted:ce,markStepCompleted:re,markFlowNotStarted:Y,markFlowStarted:Te,markFlowCompleted:le,markFlowAborted:he,markStepNotStarted:G,getFlowStatus:X,getNumberOfStepsCompleted:fe,getNumberOfSteps:Ue,targetingLogicShouldHideFlow:ft,setCustomVariable:V,updateCustomVariables:we,customVariables:s,getStepOptionalProgress:ye,getFlowMetadata:H,isStepBlocked:Fe,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as er,useContext as Rl,useEffect as ea}from"react";var Lt="guest_";function Rt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Rl(K),{config:n,apiUrl:s}=He(),{mutateUserFlowState:p}=Ie(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(b){return`frigade-user-registered-${b}`}ea(()=>{if(e&&!t){if(e.startsWith(Lt))return;let b=g(e);localStorage.getItem(b)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(b,"true"))}},[e,r,t]);let d=er(async b=>{if(!l())return;let S={foreignId:e,properties:b};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(u=>({...u,...b})),p()},[e,n,r,p]),x=er(async(b,S)=>{if(!l())return;let v={foreignId:e,events:[{event:b,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),p()},[e,n,p]),T=er(async(b,S)=>{if(l())if(S){let u=g(b);localStorage.setItem(u,"true"),o(b);let v={foreignId:b,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),i(w=>({...w,...S})),p()}else o(b)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:T,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as vp}from"uuid";import Ke,{useEffect as wp,useState as Tp}from"react";import We,{useEffect as ir,useState as pa}from"react";import Fo from"styled-components";import ta from"react";import oa from"styled-components";var Yr="fr-",eo="cfr-";function a(e,t){let o=`${Yr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+eo+e}return o}function k(e){if(!e.className||e.className.indexOf(eo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Yr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function bo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Be(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${bo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function ge(...e){return e.filter(Boolean).join(" ")}function to(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ra=oa.div`
|
|
2
|
+
import bt,{createContext as Qp,useEffect as zo,useState as ze}from"react";import{ThemeProvider as Zp}from"styled-components";import St,{useContext as Pp,useEffect as po,useState as Mo}from"react";import{useCallback as ht,useContext as Rl,useEffect as ea}from"react";import Jo,{useMemo as Gr}from"react";var Vr="1.35.31 ";var Ue="NOT_STARTED_STEP",q="COMPLETED_FLOW",yo="ABORTED_FLOW",xt="STARTED_FLOW",Ne="NOT_STARTED_FLOW",We="COMPLETED_STEP",So="STARTED_STEP";function je(){let{publicApiKey:e,userId:t,apiUrl:o}=Jo.useContext(G);return{config:Gr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Vr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Gr(()=>`${o}/v1/public/`,[o])}}var _l="frigade-last-call-at-",Hl="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Jo.useContext(G);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=_l+o,n=Hl+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}=Jo.useContext(G);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Jl,useState as Kr}from"react";import{useContext as Vl,useEffect as Gl,useState as Kl}from"react";import ql from"swr";import{useContext as jl}from"react";function Fe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=jl(G);function n(d,x=!1){return e[d]??x}function s(d,x){t(T=>({...T,[d]:x}))}function p(d){t(x=>{let{[d]:T,...S}=x;return{...S}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,T])=>T&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Yl from"swr/immutable";import Zt from"core-js-pure/actual/structured-clone";function Qo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fe(...e){let t=e.shift(),o=e.length===1?e[0]:fe(...e);if(!Qo(t)||!Qo(o))throw new Error("deepmerge can only merge Objects");let i=Zt(t);return Object.entries(o).forEach(([r,n])=>{Qo(n)?i[r]!==void 0?Object.assign(i,{[r]:fe(i[r],Zt(n))}):Object.assign(i,{[r]:Zt(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...Zt(n)]}):Object.assign(i,{[r]:Zt(n)}):Object.assign(i,{[r]:n})}),i}var Xl="unknown";function Oe(){let{config:e,apiUrl:t}=je(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Vl(G),{resetOpenFlowState:c}=Fe(),[l,g]=Kl(!1),d={data:n.map(C=>({flowId:C.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=C=>fetch(C,e).then(v=>{if(v.ok)return v.json();throw new Error("Failed to fetch user flow states")}).catch(v=>(console.log(`Error fetching ${C}: ${v}. Will gracefully degrade and hide Frigade`),s(!0),d)),T=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:S,isLoading:b,mutate:u,error:B}=p?Yl(T,x):ql(T,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=S==null?void 0:S.data;Gl(()=>{!l&&!b&&w&&g(!0)},[w,l,b]);async function h(C){if(w&&!p){let v=w.find(I=>I.flowId===C);v&&v.flowState!==q&&(v.flowState=q),await u(Promise.resolve(fe(S,{data:w})),{optimisticData:fe(S,{data:w}),revalidate:!1,rollbackOnError:!1})}}async function N(C,v,I){if(w){let O=w.find(A=>A.flowId===C);O&&(O.stepStates[v]=I,O.flowState=xt),await u(Promise.resolve(fe(S,{data:w})),{optimisticData:fe(S,{data:w}),revalidate:!1,rollbackOnError:!1})}}async function P(C,v,I){if(w){let O=w.find(A=>A.flowId===C);O&&(O.lastStepId=v,O.stepStates[v]=I,O.flowState=xt),await u(fe(S,{data:w}),{optimisticData:fe(S,{data:w}),revalidate:!1,rollbackOnError:!1})}}async function f(C){if(w){let v=w.find(I=>I.flowId===C);v&&v.flowState!==Ne&&(v.flowState=Ne,v.lastStepId=Xl,Object.keys(v.stepStates).forEach(I=>{v.stepStates[I].actionType=Ue,v.stepStates[I].createdAt=new Date().toISOString()}),await u(fe(S,{data:w}),{optimisticData:fe(S,{data:w}),revalidate:!1,rollbackOnError:!1}),c(C))}}async function F(C,v){if(w){let I=w.find(O=>O.flowId===C);I&&I.stepStates[v]!==Ue&&(I.stepStates[v]=Ue),await u(fe(S,{data:w}),{optimisticData:fe(S,{data:w}),revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:u,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:P,error:B}}function Rt(){let{config:e,apiUrl:t}=je(),{userFlowStatesData:o,mutateUserFlowState:i}=Oe(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Jl(G),[c,l]=Kr(new Set),[g,d]=Kr(new Set),x=Nt();function T(u){let B=JSON.stringify(u);if(c.has(B))return null;c.add(B),l(c),g.add(u),d(g);let w=s==null?void 0:s.find(h=>h.flowSlug===u.flowSlug&&h.stepId===u.stepId&&h.actionType===u.actionType&&h.createdAt===u.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(h=>{h.status!==200&&h.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),n([...r,u])):w||p(N=>[...N??[],u])})}async function S(u){u.foreignUserId&&(u.actionType===xt||u.actionType===Ne?await T(u):u.actionType===q?await T(u):u.actionType===So?await T(u):u.actionType===We?await T(u):u.actionType===yo?await T(u):u.actionType===Ue&&await T(u))}function b(){let u=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let w in B.stepStates){let h=B.stepStates[w];u.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:h.stepId,actionType:h.actionType,data:{},createdAt:new Date(h.createdAt),blocked:h.blocked,hidden:h.hidden})}}),[...u,...s]}return{addResponse:S,setFlowResponses:p,getFlowResponses:b}}import ta from"swr";var Ql=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,qr=e=>{let t=Ql.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Zl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Zl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Zo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Ro=(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))(Ro||{});function J(){let{config:e,apiUrl:t}=je(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Rl(G),T={data:[]},{verifySDKInitiated:S}=Ot(),{addResponse:b,getFlowResponses:u}=Rt(),B=m=>fetch(m,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${m} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),T)).catch(y=>(console.log(`Error fetching ${m}: ${y}. Will gracefully degrade and hide Frigade`),d(!0),T)),{mutateUserFlowState:w,userFlowStatesData:h,isLoadingUserFlowStateData:N,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:F,optimisticallyMarkStepNotStarted:C,optimisticallyMarkStepStarted:v}=Oe(),{data:I,error:O,isLoading:A}=ta(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});ea(()=>{if(O){console.error(O);return}I&&I.data&&i(I.data)},[I,O]);function D(m){if(A)return null;let y=o.find(E=>E.slug===m);return!y&&o.length>0&&!N&&!A?(console.log(`Flow with id ${m} not found`),null):(y==null?void 0:y.active)===!1?null:y}function $(m){var z;if(!D(m))return[];let y=D(m).data;return y?(y=V(y),(((z=Zo(y))==null?void 0:z.data)??[]).map(ue=>{let Qt=H(ue);return{handleSecondaryButtonClick:()=>{ue.skippable===!0&&te(m,ue.id,{skipped:!0})},...ue,complete:ne(m,ue.id)===We||Qt>=1,blocked:Te(m,ue.id),hidden:L(m,ue.id),handlePrimaryButtonClick:()=>{(!ue.completionCriteria&&(ue.autoMarkCompleted||ue.autoMarkCompleted===void 0)||ue.completionCriteria&&ue.autoMarkCompleted===!0)&&te(m,ue.id)},progress:Qt}}).filter(ue=>ue.hidden!==!0)):[]}function V(m){return m.replaceAll(/\${(.*?)}/g,(y,E)=>s[E]===void 0?"":String(s[E]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.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 j(m){if(!D(m))return[];let y=D(m).data;return y?(y=V(y),JSON.parse(y)??{}):[]}function Y(m,y){p(E=>({...E,[m]:y}))}function de(m){!N&&!A&&m&&JSON.stringify(s)!=JSON.stringify({...s,...m})&&Object.keys(m).forEach(y=>{Y(y,m[y])})}let he=ht(async(m,y,E)=>{if(!S())return;let z={foreignUserId:r,flowSlug:m,stepId:y,actionType:So,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};re(z)&&(await v(m,y,z),b(z))},[r,h]),K=ht(async(m,y,E)=>{if(!S())return;let z={foreignUserId:r,flowSlug:m,stepId:y,actionType:Ue,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};re(z)&&(await C(m,y),b(z))},[r,h]),te=ht(async(m,y,E)=>{if(!S())return;let z={foreignUserId:r,flowSlug:m,stepId:y,actionType:We,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};re(z)&&(await F(m,y,z),b(z))},[r,h]),Q=ht(async(m,y)=>{if(!S()||se(m)===Ne)return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:Ne,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await f(m),re(E)&&b(E)},[r,h]),Se=ht(async(m,y)=>{if(!S())return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:xt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(E)&&b(E)},[r,h]),me=ht(async(m,y)=>{if(!S())return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:q,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(E)&&(await P(m),b(E))},[r,h]),Ee=ht(async(m,y)=>{if(!S())return;let E={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:yo,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(E)&&(await P(m),b(E))},[r,h]);function re(m){var y;if(!h&&m.actionType===Ue)return!1;if(h){let E=h.find(z=>z.flowId===m.flowSlug);if(m.actionType===Ue&&(!(E!=null&&E.stepStates[m.stepId])||E.stepStates[m.stepId].actionType===Ue)||E&&((y=E.stepStates[m.stepId])==null?void 0:y.actionType)===m.actionType||E&&E.flowState===q&&m.actionType===q)return!1}return!0}function ne(m,y){let E=U(m,y);return N?null:E?E.actionType:Ue}function Te(m,y){let E=U(m,y);return E?E.blocked:!1}function L(m,y){let E=U(m,y);return E?E.hidden:!1}function U(m,y){if(N)return null;let E=h==null?void 0:h.find(z=>z.flowId===m);return!E||!E.stepStates[y]?null:E.stepStates[y]??null}function _(m){var E;if(N||!h)return null;if(se(m)===Ne)return $(m)[0]??null;let y=(E=h.find(z=>z.flowId===m))==null?void 0:E.lastStepId;return y?$(m).find(z=>z.id===y):null}function X(m){let y=_(m);if(!y)return 0;let E=$(m).findIndex(z=>z.id===y.id)??0;return ne(m,y.id)===We&&E<$(m).length-1?E+1:E}function H(m){if(!m.completionCriteria)return;let y=qr(m.completionCriteria);if(y===null)return;let E=Ae(y),z=Ie(y);return z===0?void 0:E/z}function se(m){let y=h==null?void 0:h.find(E=>E.flowId===m);return y?y.flowState:null}function Ae(m){let y=$(m);return y.length===0?0:y.filter(z=>ne(m,z.id)===We).length}function Ie(m){return $(m).length}function Et(m){let y=o.find(E=>E.slug===m);return y?Zo(y.data):null}function ft(m){if(x)return!1;if(N)return!0;if(m!=null&&m.targetingLogic&&h){let y=h.find(E=>E.flowId===m.slug);if(y)return y.shouldTrigger===!1}return!!(m!=null&&m.targetingLogic&&r&&r.startsWith("guest_"))}function At(m){return!ft(D(m))}function gt(){r&&w()}return{getFlow:D,getFlowData:Et,isLoading:N||A,getStepStatus:ne,getFlowSteps:$,getCurrentStepIndex:X,markStepStarted:he,markStepCompleted:te,markFlowNotStarted:Q,markFlowStarted:Se,markFlowCompleted:me,markFlowAborted:Ee,markStepNotStarted:K,getFlowStatus:se,getNumberOfStepsCompleted:Ae,getNumberOfSteps:Ie,targetingLogicShouldHideFlow:ft,setCustomVariable:Y,updateCustomVariables:de,customVariables:s,getStepOptionalProgress:H,getFlowMetadata:j,isStepBlocked:Te,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as er,useContext as oa,useEffect as ra}from"react";var Lt="guest_";function eo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=oa(G),{config:n,apiUrl:s}=je(),{mutateUserFlowState:p}=Oe(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(S){return`frigade-user-registered-${S}`}ra(()=>{if(e&&!t){if(e.startsWith(Lt))return;let S=g(e);localStorage.getItem(S)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(S,"true"))}},[e,r,t]);let d=er(async S=>{if(!l())return;let b={foreignId:e,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(b)}),i(u=>({...u,...S})),p()},[e,n,r,p]),x=er(async(S,b)=>{if(!l())return;let B={foreignId:e,events:[{event:S,properties:b}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),T=er(async(S,b)=>{if(l())if(b){let u=g(S);localStorage.setItem(u,"true"),o(S);let B={foreignId:S,properties:b};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(w=>({...w,...b})),p()}else o(S)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:T,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as vp}from"uuid";import qe,{useEffect as br,useState as Ji}from"react";import _e,{useEffect as ir,useState as ma}from"react";import Fo from"styled-components";import ia from"react";import na from"styled-components";var Yr="fr-",to="cfr-";function a(e,t){let o=`${Yr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+to+e}return o}function k(e){if(!e.className||e.className.indexOf(to)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Yr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function bo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ve(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${bo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function oo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var sa=na.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,Xr=({onClose:e,appearance:t})=>
|
|
26
|
+
`,Xr=({onClose:e,appearance:t})=>ia.createElement(sa,{className:a("modalBackground",t),onClick:()=>e()});import tr from"react";import la from"styled-components";var aa=la.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,ke=()=>tr.createElement(aa,null,tr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},tr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as ua}from"react-portal";import ai from"react";import or from"react";function pa({style:e,className:t}){return or.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},or.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"}),or.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var Jr=pa;import rr from"styled-components";import Je from"styled-components";var wo=Je.div`
|
|
31
31
|
${e=>k(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -38,7 +38,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,da=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -51,17 +51,17 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
51
51
|
box-sizing: border-box;
|
|
52
52
|
:hover {
|
|
53
53
|
opacity: 0.8;
|
|
54
|
-
}`,
|
|
54
|
+
}`,ca=`
|
|
55
55
|
display: block;
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
|
-
`,Qr=
|
|
60
|
+
`,Qr=Je.div`
|
|
61
61
|
${e=>k(e)} {
|
|
62
|
-
${e=>e.hasImage?
|
|
62
|
+
${e=>e.hasImage?da:ca};
|
|
63
63
|
}
|
|
64
|
-
`,Zr=
|
|
64
|
+
`,Zr=Je.img`
|
|
65
65
|
${e=>k(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
@@ -69,7 +69,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
69
69
|
min-height: 200px;
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
|
-
`,Rr=
|
|
72
|
+
`,Rr=Je.div`
|
|
73
73
|
${e=>k(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
@@ -77,19 +77,19 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
77
77
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
78
78
|
object-fit: cover;
|
|
79
79
|
}
|
|
80
|
-
`,ei=
|
|
80
|
+
`,ei=Je.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
align-content: center;
|
|
85
|
-
`,ti=
|
|
85
|
+
`,ti=Je.div`
|
|
86
86
|
padding: 22px 22px 12px;
|
|
87
|
-
`,oi=
|
|
87
|
+
`,oi=Je.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
justify-content: center;
|
|
92
|
-
`,ri=
|
|
92
|
+
`,ri=Je.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
flex: 2;
|
|
95
95
|
flex-shrink: 1;
|
|
@@ -101,7 +101,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
|
-
`,ii=
|
|
104
|
+
`,ii=Je.p`
|
|
105
105
|
${e=>k(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
@@ -143,7 +143,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
143
143
|
font-size: 12px;
|
|
144
144
|
line-height: 18px;
|
|
145
145
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
146
|
-
`;function To({appearance:e}){return ai.createElement(li,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",ai.createElement(Jr,null))}var
|
|
146
|
+
`;function To({appearance:e}){return ai.createElement(li,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",ai.createElement(Jr,null))}var fa=Fo.div`
|
|
147
147
|
${e=>k(e)} {
|
|
148
148
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
149
149
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -158,7 +158,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
158
158
|
width: ${e=>e.width??"1000px"};
|
|
159
159
|
z-index: 1500;
|
|
160
160
|
border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)??8}}px;
|
|
161
|
-
${e=>
|
|
161
|
+
${e=>ve(e)}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
padding: 32px;
|
|
@@ -185,10 +185,10 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,
|
|
188
|
+
`,ga=Fo.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
`,
|
|
191
|
+
`,xa=Fo.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
@@ -198,14 +198,14 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
198
198
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
200
|
}
|
|
201
|
-
`,
|
|
201
|
+
`,ha=Fo.div`
|
|
202
202
|
overflow: scroll;
|
|
203
203
|
flex: 1 1;
|
|
204
204
|
display: flex;
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Ve=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=ma("");return ir(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),ir(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),ir(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?_e.createElement(ua,null,_e.createElement(Xr,{appearance:n,onClose:()=>{s&&e()}}),_e.createElement(fa,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&_e.createElement(xa,{className:a("modalClose",n),onClick:()=>e(),appearance:n},_e.createElement(ke,null)),o&&_e.createElement(ga,null,o),_e.createElement(ha,null,r),p&&_e.createElement(ni,{appearance:n,className:a("poweredByFrigadeRibbon",n)},_e.createElement(To,{appearance:n})))):_e.createElement(_e.Fragment,null)};import lt,{useEffect as nr,useState as Ca}from"react";import ko from"styled-components";import{Portal as ya}from"react-portal";function Sa(e){switch(e){case"top-left":return`
|
|
209
209
|
top: 0;
|
|
210
210
|
left: 0;
|
|
211
211
|
`;case"top-right":return`
|
|
@@ -214,7 +214,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
214
214
|
`;case"bottom-left":return`
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var
|
|
217
|
+
`}return"right: 0; bottom: 0;"}var ba=ko.div`
|
|
218
218
|
${e=>k(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -228,12 +228,12 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
228
228
|
width: 350px;
|
|
229
229
|
padding: 24px;
|
|
230
230
|
}
|
|
231
|
-
${e=>
|
|
231
|
+
${e=>Sa(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
|
-
`,
|
|
233
|
+
`,wa=ko.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,
|
|
236
|
+
`,Ta=ko.div`
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 16px;
|
|
239
239
|
right: 16px;
|
|
@@ -243,13 +243,13 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
243
243
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
244
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
245
|
}
|
|
246
|
-
`,
|
|
246
|
+
`,Fa=ko.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,Po=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=
|
|
252
|
+
`,Po=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=Ca("");return nr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),nr(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),nr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?lt.createElement(ya,null,lt.createElement(ba,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&<.createElement(Ta,{className:a("cornerModalClose",r),onClick:()=>e()},lt.createElement(ke,null)),o&<.createElement(wa,null,o),lt.createElement(Fa,null,i))):lt.createElement(lt.Fragment,null)};import{useContext as ka}from"react";function Z(){let{defaultAppearance:e}=ka(G);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Ct,{useContext as qa,useEffect as ki,useState as gr}from"react";import Io from"styled-components";import Eo,{useEffect as fi,useState as ar}from"react";import pr from"styled-components";import vo from"styled-components";var pi=vo.label`
|
|
253
253
|
${e=>k(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
@@ -280,7 +280,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import sr from"react";var
|
|
283
|
+
`;import sr from"react";var Qe={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 at({title:e,required:t,appearance:o=Qe}){return e?sr.createElement(Bo,{className:a("formLabelWrapper",o)},t?sr.createElement(ci,{className:a("formLabelRequired",o),appearance:o},"*"):null,sr.createElement(pi,{className:a("formLabel",o)},e)):null}import mi from"react";function Dt({title:e,appearance:t}){return e?mi.createElement(Bo,null,mi.createElement(di,{className:a("formSubLabel",t)},e)):null}import{z as lr}from"zod";function ui(e,t){try{if(t){if(t.type=="number"){let o=lr.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=lr.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 lr.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 Pa=pr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
@@ -300,7 +300,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
|
-
`,
|
|
303
|
+
`,va=pr.textarea`
|
|
304
304
|
${e=>k(e)} {
|
|
305
305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
306
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -316,13 +316,13 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
316
316
|
min-height: 70px;
|
|
317
317
|
box-sizing: border-box;
|
|
318
318
|
margin-bottom: 10px;
|
|
319
|
-
`;function cr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=ar((r==null?void 0:r.text)||""),[c,l]=ar(!1),[g,d]=ar(!1),x=dr;fi(()=>{s===""&&!c&&(l(!0),T(""))},[]),fi(()=>{if(g){T(s);return}},[g]);function T(
|
|
319
|
+
`;function cr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=ar((r==null?void 0:r.text)||""),[c,l]=ar(!1),[g,d]=ar(!1),x=dr;fi(()=>{s===""&&!c&&(l(!0),T(""))},[]),fi(()=>{if(g){T(s);return}},[g]);function T(b){if(p(b),o({text:b}),n.required===!0&&b.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`,hidden:!g}]);return}let u=ui(b,n.validation);if(u&&(b.trim()!==""||n.required===!0)){i([{id:n.id,message:u,hidden:!g}]);return}i([])}n.multiline&&(x=va);function S(){var b;switch((b=n==null?void 0:n.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Eo.createElement(Pa,null,Eo.createElement(at,{title:n.title,required:n.required,appearance:t.appearance}),Eo.createElement(x,{className:a("inputComponent",t.appearance),value:s,onChange:b=>{T(b.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:S(),onBlur:()=>{d(!0)}}),Eo.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Ge,{useEffect as gi,useState as xi}from"react";import hi from"styled-components";var mr="",Ba=hi.div`
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: column;
|
|
322
322
|
width: 100%;
|
|
323
323
|
-webkit-appearance: none;
|
|
324
324
|
appearance: none;
|
|
325
|
-
`,
|
|
325
|
+
`,Ea=hi.select`
|
|
326
326
|
${e=>k(e)} {
|
|
327
327
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
328
328
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -343,15 +343,15 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
343
343
|
background-repeat: no-repeat;
|
|
344
344
|
background-size: 1.5em 1.5em;
|
|
345
345
|
-webkit-print-color-adjust: exact;
|
|
346
|
-
`;function Ci({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,T,b
|
|
347
|
-
${e=>
|
|
348
|
-
`,
|
|
346
|
+
`;function Ci({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,T,S,b;let n=e,[s,p]=xi(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=xi(!1);return gi(()=>{var u,B,w,h;if(s===""&&!c){if(l(!0),n.requireSelection){p(mr);return}if(n.defaultValue&&((u=n.props.options)!=null&&u.find(N=>N.id===n.defaultValue))){let N=(B=n.props.options)==null?void 0:B.find(P=>P.id===n.defaultValue);p(N.id),o({choice:[N.id]})}else p(((w=n.props.options)==null?void 0:w[0].id)||""),o({choice:[((h=n.props.options)==null?void 0:h[0].id)||""]})}},[]),gi(()=>{n.requireSelection&&s===mr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),Ge.createElement(Ba,null,Ge.createElement(at,{title:n.title,required:!1,appearance:t.appearance}),Ge.createElement(Ea,{value:s,onChange:u=>{p(u.target.value),o({choice:[u.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&Ge.createElement("option",{key:"null-value",value:mr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(u=>Ge.createElement("option",{key:u.id,value:u.id},u.title))),((T=(x=n.props.options)==null?void 0:x.find(u=>u.id===s))==null?void 0:T.isOpenEnded)&&Ge.createElement(Ge.Fragment,null,Ge.createElement(at,{title:((b=(S=n.props.options)==null?void 0:S.find(u=>u.id===s))==null?void 0:b.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Ge.createElement(dr,{type:"text",placeholder:"Enter your answer here",onChange:u=>{o({choice:[u.target.value]})},appearance:t.appearance})),Ge.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import no,{useEffect as ur,useState as Si}from"react";import bi from"styled-components";import io from"react";import ro from"react";var yi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return ro.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},Aa=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>ro.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},ro.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},ro.createElement(yi,{color:r,size:t}),ro.createElement(yi,{color:e,percentage:o,size:t})),i),$t=Aa;import Ia from"styled-components";var Na=({color:e="#FFFFFF"})=>io.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Oa={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},La={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Da={border:"1px solid #000000",color:"#FFFFFF"},$a={border:"1px solid #C5CBD3"},Ma={color:"#FFFFFF"},Ua={border:"1px solid #C5CBD3"},za=e=>e==="square"?Oa:La,Wa=(e,t)=>e==="square"?t?Da:$a:t?Ma:Ua,_a=Ia.div`
|
|
347
|
+
${e=>ve(e)}
|
|
348
|
+
`,Ze=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Qe,style:n,className:s})=>{let p=za(t),c=Wa(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?io.createElement($t,{fillColor:o,percentage:i,size:22}):io.createElement(_a,{styleOverrides:p,style:n,role:"checkbox",className:Ce(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&io.createElement(Na,{color:"#FFFFFF"}))};var Ha=bi.div`
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
351
351
|
width: 100%;
|
|
352
352
|
-webkit-appearance: none;
|
|
353
353
|
appearance: none;
|
|
354
|
-
`,
|
|
354
|
+
`,ja=bi.button`
|
|
355
355
|
${e=>k(e)} {
|
|
356
356
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
357
357
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -376,7 +376,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
376
376
|
height: 48px;
|
|
377
377
|
padding: 0 18px;
|
|
378
378
|
margin-bottom: 10px;
|
|
379
|
-
`;function wi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=Si((i==null?void 0:i.choice)||[]),[c,l]=Si(!1);return ur(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),ur(()=>{o({choice:s})},[s]),ur(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),
|
|
379
|
+
`;function wi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=Si((i==null?void 0:i.choice)||[]),[c,l]=Si(!1);return ur(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),ur(()=>{o({choice:s})},[s]),ur(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),no.createElement(Ha,null,no.createElement(at,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>no.createElement(ja,{appearance:t.appearance,className:a(s.includes(d.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,no.createElement(Ze,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),no.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Ao from"react";import Ti from"styled-components";import Va from"dompurify";function ae(e){return{__html:Va.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Ga=Ti.h1`
|
|
380
380
|
${e=>k(e)} {
|
|
381
381
|
font-style: normal;
|
|
382
382
|
font-weight: 700;
|
|
@@ -388,7 +388,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
388
388
|
margin-bottom: 4px;
|
|
389
389
|
color: ${e=>e.appearance.theme.colorText};
|
|
390
390
|
}
|
|
391
|
-
`,
|
|
391
|
+
`,Ka=Ti.h2`
|
|
392
392
|
${e=>k(e)} {
|
|
393
393
|
font-style: normal;
|
|
394
394
|
font-weight: 400;
|
|
@@ -397,38 +397,38 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
397
397
|
letter-spacing: 0.28px;
|
|
398
398
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
399
399
|
}
|
|
400
|
-
`;function
|
|
400
|
+
`;function Pe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Ao.createElement(Ao.Fragment,null,Ao.createElement(Ga,{appearance:e,className:a(`${r}${r?oo(i):i}Title`,e),dangerouslySetInnerHTML:ae(t),size:i}),o&&Ao.createElement(Ka,{appearance:e,className:a(`${r}${r?oo(i):i}Subtitle`,e),dangerouslySetInnerHTML:ae(o),size:i}))}import*as fr from"react";var Fi=e=>fr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},fr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var Ya=Io.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: column;
|
|
403
403
|
justify-content: flex-end;
|
|
404
404
|
overflow: visible;
|
|
405
405
|
padding-top: 14px;
|
|
406
|
-
`,
|
|
406
|
+
`,Xa=Io.div`
|
|
407
407
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
408
408
|
font-size: 12px;
|
|
409
409
|
margin-bottom: 12px;
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: center;
|
|
412
|
-
`,
|
|
412
|
+
`,Ja=Io.div`
|
|
413
413
|
margin-right: 4px;
|
|
414
414
|
display: inline-flex;
|
|
415
|
-
`,
|
|
415
|
+
`,Qa=Io.div`
|
|
416
416
|
padding-left: 1px;
|
|
417
417
|
padding-right: 1px;
|
|
418
|
-
`,
|
|
418
|
+
`,Za={text:cr,multipleChoice:Ci,multipleChoiceList:wi},xr="frigade-multiInputStepTypeData";function Pi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var P;let c=t.props,[l,g]=gr([]),[d,x]=gr([]),{userId:T}=eo(),[S,b]=gr(h()||(p?p[t.id]:null)||{}),{readonly:u}=qa(G),B={...Za,...s};ki(()=>{i(l.length===0)},[l,i]),ki(()=>{r(S)},[S]);function w(f,F){b(C=>{let v={...C,[f.id]:F};return window&&window.localStorage&&!u&&window.localStorage.setItem(N(),JSON.stringify(v)),v})}function h(){if(window&&window.localStorage){let f=window.localStorage.getItem(N());if(f)return JSON.parse(f)}return null}function N(){return`${xr}-${e}-${t.id}-${T}`}return Ct.createElement(Qa,{className:a("multiInput",n)},Ct.createElement(Pe,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(Ya,{className:a("multiInputContainer",n)},(P=c.data)==null?void 0:P.map(f=>{let F=l.reverse().find(C=>C.id===f.id);return B[f.type]?Ct.createElement("span",{key:f.id,"data-field-id":f.id,className:a("multiInputField",n)},B[f.type]({formInput:f,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:C=>{!d.includes(f.id)&&C&&(C==null?void 0:C.text)!==""&&x(v=>[...v,f.id]),w(f,C)},inputData:S[f.id],setFormValidationErrors:C=>{g(v=>C.length===0?v.filter(I=>I.id!==f.id):[...v,...C])}}),F&&F.message&&d.includes(f.id)&&F.hidden!==!0&&Ct.createElement(Xa,{key:f.id,style:{overflow:"hidden"},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(Ja,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(Fi,null)),F.message)):null})))}import Mt from"styled-components";var vi=Mt.div`
|
|
419
419
|
align-items: center;
|
|
420
420
|
display: flex;
|
|
421
421
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
422
422
|
padding-top: 14px;
|
|
423
|
-
`,
|
|
423
|
+
`,Bi=Mt.div`
|
|
424
424
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
425
425
|
font-size: 12px;
|
|
426
|
-
`,
|
|
426
|
+
`,Ei=Mt.div`
|
|
427
427
|
display: flex;
|
|
428
428
|
gap: 12px;
|
|
429
429
|
width: 100%;
|
|
430
430
|
justify-content: flex-end;
|
|
431
|
-
`,
|
|
431
|
+
`,Ai=Mt.div`
|
|
432
432
|
display: flex;
|
|
433
433
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
434
434
|
// Otherwise, use 4px padding
|
|
@@ -436,11 +436,11 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
436
436
|
flex-grow: 1;
|
|
437
437
|
flex-basis: 0;
|
|
438
438
|
position: relative;
|
|
439
|
-
`,
|
|
439
|
+
`,Ii=Mt.div`
|
|
440
440
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
441
441
|
position: relative;
|
|
442
442
|
overflow-y: auto;
|
|
443
|
-
`,
|
|
443
|
+
`,Ni=Mt.div`
|
|
444
444
|
display: flex;
|
|
445
445
|
align-self: stretch;
|
|
446
446
|
flex-grow: 1;
|
|
@@ -452,7 +452,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
452
452
|
background-position: center;
|
|
453
453
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
454
454
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
455
|
-
`;import
|
|
455
|
+
`;import pt from"react";import Li from"react";import Di from"styled-components";import Ra from"styled-components";var Oi=Ra.div`
|
|
456
456
|
width: 24px;
|
|
457
457
|
height: 24px;
|
|
458
458
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -470,7 +470,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
470
470
|
transform: rotate(360deg);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
`;var
|
|
473
|
+
`;var ep=Di.button`
|
|
474
474
|
justify-content: center;
|
|
475
475
|
align-content: center;
|
|
476
476
|
${e=>k(e)} {
|
|
@@ -488,7 +488,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
488
488
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
489
489
|
line-height: 20px;
|
|
490
490
|
font-weight: 500;
|
|
491
|
-
${e=>
|
|
491
|
+
${e=>ve(e)}
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
font-family: inherit;
|
|
@@ -502,7 +502,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
502
502
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
503
503
|
cursor: not-allowed;
|
|
504
504
|
}
|
|
505
|
-
`,No=
|
|
505
|
+
`,No=Di.div`
|
|
506
506
|
${e=>k(e)} {
|
|
507
507
|
display: flex;
|
|
508
508
|
flex-direction: row;
|
|
@@ -513,14 +513,14 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
513
513
|
margin-right: 8px;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
`,
|
|
516
|
+
`,R=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l="",loading:g=!1})=>{function d(){let x=s?"buttonSecondary":"button";return l===""?x:`${l}${oo(x)}`}return Li.createElement(ep,{secondary:s,appearance:p,disabled:i||g,loading:(g==null?void 0:g.toString())??"",onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(d(),p)},g?Li.createElement(Oi,{className:a("buttonLoader",p)}):t??"Continue")};var $i=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l,isSaving:g})=>{let d=s.length>1&&n!=0&&c,x=e.primaryButtonTitle&&e.secondaryButtonTitle||d?"inline":"full-width";return pt.createElement(pt.Fragment,null,l!==null&&l!=null&&pt.createElement(Bi,{appearance:o,className:a("formCTAError",o)},l),pt.createElement(vi,{showBackButton:d,className:a("formCTAContainer",o)},d&&pt.createElement(R,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:x,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),pt.createElement(Ei,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?pt.createElement(R,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:x,appearance:o,disabled:g}):null," ",e.primaryButtonTitle?pt.createElement(R,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:x,appearance:o,loading:g}):null)))};import hr from"react";import tp from"styled-components";var op=tp.div`
|
|
517
517
|
text-align: center;
|
|
518
|
-
|
|
518
|
+
`,Mi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Z().mergeAppearanceWithDefault(i);return hr.createElement(op,{className:o},hr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>hr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import yt from"react";import Ut from"styled-components";import{useContext as rp}from"react";function le(){let e=rp(G);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var ip=Ut.div`
|
|
519
519
|
display: flex;
|
|
520
520
|
flex-wrap: wrap;
|
|
521
521
|
align-content: center;
|
|
522
522
|
justify-content: center;
|
|
523
|
-
`,
|
|
523
|
+
`,np=Ut.div`
|
|
524
524
|
align-content: center;
|
|
525
525
|
align-items: center;
|
|
526
526
|
display: flex;
|
|
@@ -534,10 +534,10 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
534
534
|
flex-basis: 255px;
|
|
535
535
|
flex-grow: 0;
|
|
536
536
|
flex-shrink: 0;
|
|
537
|
-
`,
|
|
537
|
+
`,sp=Ut.img`
|
|
538
538
|
width: 78px;
|
|
539
539
|
height: auto;
|
|
540
|
-
`,
|
|
540
|
+
`,lp=Ut.button`
|
|
541
541
|
font-style: normal;
|
|
542
542
|
font-weight: 600;
|
|
543
543
|
font-size: 13px;
|
|
@@ -550,11 +550,11 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
550
550
|
border-radius: 100px;
|
|
551
551
|
padding: 8px 12px;
|
|
552
552
|
margin-top: 16px;
|
|
553
|
-
`,
|
|
553
|
+
`,ap=Ut.h1`
|
|
554
554
|
font-weight: 700;
|
|
555
555
|
font-size: 28px;
|
|
556
556
|
line-height: 34px;
|
|
557
|
-
`,
|
|
557
|
+
`,pp=Ut.h2`
|
|
558
558
|
font-style: normal;
|
|
559
559
|
font-weight: 400;
|
|
560
560
|
font-size: 16px;
|
|
@@ -563,7 +563,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
563
563
|
margin-top: 12px;
|
|
564
564
|
margin-bottom: 16px;
|
|
565
565
|
max-width: 70%;
|
|
566
|
-
`;function
|
|
566
|
+
`;function Ui({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=le();return yt.createElement("div",null,yt.createElement(ap,null,e.title),yt.createElement(pp,null,e.subtitle),yt.createElement(ip,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>yt.createElement(np,{key:n.title},yt.createElement(sp,{src:n.imageUri}),yt.createElement(lp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import zt,{useEffect as xp}from"react";import Do from"styled-components";import Cr from"react";var Oo=({style:e,className:t})=>Cr.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},Cr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Cr.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 so,{useRef as dp,useState as cp}from"react";import Lo from"styled-components";var mp=Lo.div`
|
|
567
567
|
display: flex;
|
|
568
568
|
align-items: center;
|
|
569
569
|
justify-content: flex-start;
|
|
@@ -571,7 +571,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
571
571
|
width: 100%;
|
|
572
572
|
height: 100%;
|
|
573
573
|
position: relative;
|
|
574
|
-
`,
|
|
574
|
+
`,up=Lo.div`
|
|
575
575
|
position: absolute;
|
|
576
576
|
display: flex;
|
|
577
577
|
align-items: center;
|
|
@@ -590,56 +590,56 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
590
590
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
591
591
|
border-radius: 50%;
|
|
592
592
|
}
|
|
593
|
-
`,
|
|
593
|
+
`,fp=Lo.video`
|
|
594
594
|
width: 100%;
|
|
595
595
|
height: 100%;
|
|
596
596
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
597
|
-
`,
|
|
597
|
+
`,gp=Lo.iframe`
|
|
598
598
|
width: 100%;
|
|
599
599
|
height: 100%;
|
|
600
600
|
min-height: 260px;
|
|
601
601
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
602
|
-
`;function
|
|
602
|
+
`;function Ke({appearance:e,videoUri:t}){let o=dp(),[i,r]=cp(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),so.createElement(gp,{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 so.createElement(mp,{className:a("videoPlayerWrapper",e),appearance:e},!i&&so.createElement(up,{onClick:()=>{r(!0),o.current.play()},appearance:e},so.createElement(Oo,null)),so.createElement(fp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var hp=Do.div`
|
|
603
603
|
${e=>k(e)} {
|
|
604
604
|
display: flex;
|
|
605
605
|
flex-direction: column;
|
|
606
606
|
justify-content: center;
|
|
607
607
|
}
|
|
608
|
-
`,
|
|
608
|
+
`,Cp=Do.img`
|
|
609
609
|
${e=>k(e)} {
|
|
610
610
|
width: 100%;
|
|
611
611
|
height: auto;
|
|
612
612
|
max-height: 250px;
|
|
613
613
|
margin-bottom: 24px;
|
|
614
614
|
}
|
|
615
|
-
`,
|
|
615
|
+
`,yp=Do.div`
|
|
616
616
|
${e=>k(e)} {
|
|
617
617
|
margin-bottom: 24px;
|
|
618
618
|
}
|
|
619
|
-
`,
|
|
619
|
+
`,Sp=Do.div`
|
|
620
620
|
${e=>k(e)} {
|
|
621
621
|
width: 100%;
|
|
622
622
|
height: auto;
|
|
623
623
|
max-height: 250px;
|
|
624
624
|
margin-bottom: 24px;
|
|
625
625
|
}
|
|
626
|
-
`;function
|
|
626
|
+
`;function zi({stepData:e,appearance:t,setCanContinue:o}){return xp(()=>{o(!0)},[]),zt.createElement(hp,{className:a("callToActionContainer",t)},zt.createElement(yp,{className:a("callToActionTextContainer",t)},zt.createElement(Pe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&zt.createElement(Cp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&zt.createElement(Sp,{appearance:t,className:a("callToActionVideo",t)},zt.createElement(Ke,{appearance:t,videoUri:e.videoUri})))}import Re,{useEffect as yr,useState as Sr}from"react";import dt from"styled-components";var Wi=dt.div`
|
|
627
627
|
width: auto;
|
|
628
628
|
display: flex;
|
|
629
629
|
flex-direction: column;
|
|
630
630
|
justify-content: center;
|
|
631
631
|
align-items: center;
|
|
632
632
|
padding: 4px;
|
|
633
|
-
`,
|
|
633
|
+
`,_i=dt.div`
|
|
634
634
|
width: 100%;
|
|
635
635
|
text-align: left;
|
|
636
|
-
`,
|
|
636
|
+
`,Hi=dt.h1`
|
|
637
637
|
font-style: normal;
|
|
638
638
|
font-weight: 700;
|
|
639
639
|
font-size: 32px;
|
|
640
640
|
line-height: 38px;
|
|
641
641
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
642
|
-
`,
|
|
642
|
+
`,ji=dt.h1`
|
|
643
643
|
font-style: normal;
|
|
644
644
|
font-weight: 400;
|
|
645
645
|
font-size: 16px;
|
|
@@ -647,7 +647,7 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
647
647
|
margin-top: 16px;
|
|
648
648
|
margin-bottom: 16px;
|
|
649
649
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
650
|
-
`,
|
|
650
|
+
`,Vi=dt.div`
|
|
651
651
|
padding-top: 12px;
|
|
652
652
|
padding-bottom: 12px;
|
|
653
653
|
flex-direction: row;
|
|
@@ -658,17 +658,17 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
658
658
|
cursor: pointer;
|
|
659
659
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
660
660
|
width: 100%;
|
|
661
|
-
`,
|
|
661
|
+
`,Gi=dt.div`
|
|
662
662
|
padding-top: 10px;
|
|
663
663
|
padding-bottom: 10px;
|
|
664
664
|
flex-direction: row;
|
|
665
665
|
display: flex;
|
|
666
666
|
justify-content: flex-start;
|
|
667
|
-
`,
|
|
667
|
+
`,Ki=dt.img`
|
|
668
668
|
width: 42px;
|
|
669
669
|
height: 42px;
|
|
670
670
|
margin-right: 12px;
|
|
671
|
-
`,
|
|
671
|
+
`,qi=dt.p`
|
|
672
672
|
font-style: normal;
|
|
673
673
|
font-weight: 500;
|
|
674
674
|
font-size: 17px;
|
|
@@ -676,8 +676,8 @@ import bt,{createContext as Qp,useEffect as Wo,useState as Me}from"react";import
|
|
|
676
676
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
677
677
|
display: flex;
|
|
678
678
|
align-self: center;
|
|
679
|
-
`;var
|
|
680
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map(([i,r])=>typeof r=="object"?`${i} { ${Object.entries(r).map(([s,p])=>`${bo(s)}: ${p};`).join(" ")} }`:`${bo(i)}: ${r};`).join(" ")} }`).join(" ")}`;function te({appearance:e}){if(!e||!e.styleOverrides)return lo.createElement(lo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?lo.createElement(lo.Fragment,null):lo.createElement(bp,{inlineStyles:t})}var Yi=({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:T=!1,modalPosition:b="center",repeatable:S=!1,onDismiss:u,showPagination:v=!1,allowBackNavigation:w=!1,validationHandler:C,showFrigadeBranding:N=!1,onFormDataChange:P,showFooter:f=!0,prefillData:F={},updateUrlOnPageChange:h=!1})=>{let{getFlow:B,getFlowSteps:I,isLoading:O,targetingLogicShouldHideFlow:A,getFlowStatus:D,getCurrentStepIndex:$,markFlowCompleted:j,markFlowNotStarted:H}=J(),V=$(e),{mergeAppearanceWithDefault:we}=Q(),[ce,G]=Tp(!1),{setOpenFlowState:re,getOpenFlowState:Y,hasOpenModals:Te}=ke();c=we(c);let[le,he]=i!==void 0&&r!==void 0?[i,r]:[Y(e,!0),L=>re(e,L)];if(wp(()=>{!ce&&!O&&(G(!0),(D(e)===q&&S||D(e)===Ae)&&(D(e)===q&&S&&H(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(U=>{U.startsWith(xr)&&window.localStorage.removeItem(U)})),G(!0))},[ce,G,O]),O)return null;let ee=B(e);if(!ee||A(ee))return null;let me=I(e);if(!me||i!==void 0&&i===!1||D(e)===q&&l||(o=="modal"||o=="corner-modal")&&Te(e))return null;let Fe=()=>{he(!1),u&&u(),T===!0&&j(e)};if(b=="center"&&o==="modal"||o==="large-modal"){let L={padding:"24px"};return o==="large-modal"?(L.width="85%",L.height="90%",L.maxHeight="800px",L.minHeight="500px",L.padding="0"):L.width="400px",Ke.createElement(je,{appearance:c,onClose:Fe,visible:le,style:L,dismissible:x,showFrigadeBranding:N},Ke.createElement(te,{appearance:c}),Ke.createElement(Mo,{appearance:c,steps:me,selectedStep:V,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:he,onDismiss:u,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:C,onFormDataChange:P,showFooter:f,prefillData:F,updateUrlOnPageChange:h}))}return o==="modal"&&b!=="center"?Ke.createElement(Po,{appearance:c,onClose:Fe,visible:le,modalPosition:b},Ke.createElement(te,{appearance:c}),Ke.createElement(Mo,{appearance:c,steps:me,selectedStep:V,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:he,onDismiss:u,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:C,onFormDataChange:P,showFooter:f,prefillData:F,updateUrlOnPageChange:h})):Ke.createElement(Ke.Fragment,null,Ke.createElement(te,{appearance:c}),Ke.createElement(Mo,{appearance:c,steps:me,selectedStep:V,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:he,onDismiss:u,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:C,onFormDataChange:P,showFooter:f,prefillData:F,updateUrlOnPageChange:h}))},Xi=Yi;import{useCallback as br,useContext as Fp,useEffect as kp}from"react";function wr(){let{organizationId:e,userId:t,setOrganizationId:o}=Fp(K),{mutateUserFlowState:i}=Ie(),{config:r,apiUrl:n}=He(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,T){return`frigade-user-group-registered-${x}-${T}`}kp(()=>{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=br(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 T={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()},[e,t,r,i]),g=br(async(x,T)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:T}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]),d=br(async(x,T)=>{if(p())if(T){let b=c(t,x);localStorage.setItem(b,"true"),o(x);let S={foreignUserId:t,foreignUserGroupId:x,properties:T};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var Ji="frigade-xFrigade_guestUserId",po="frigade-xFrigade_userId",Qi=({})=>{let{setFlowResponses:e}=Zt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ie(),{userId:r,setUserId:n}=Rt(),[s,p]=Uo(r),{getFlowStatus:c}=J(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Pp(K),[T,b]=Uo([]),[S,u]=Uo([]),{organizationId:v}=wr(),[w,C]=Uo(v);ao(()=>{if(!o&&t)for(let F=0;F<t.length;F++){let h=t[F],B=l.find(I=>I.slug===(h==null?void 0:h.flowId));if(B&&h&&h.shouldTrigger===!0&&B.type=="FORM"&&B.triggerType==="AUTOMATIC"&&!S.includes(B.slug)){setTimeout(()=>{N(h.flowId)},500);break}}},[o,t]),ao(()=>{x.length>0&&i()},[x]);function N(F){let h=l.find(B=>B.slug===F);h&&h.triggerType==="AUTOMATIC"&&!S.includes(h.slug)&&(u([...S,h.slug]),b([h]))}function P(){if(!r){let F=localStorage.getItem(po);if(F){n(F);return}let h=localStorage.getItem(Ji);if(h){n(h);return}d(!0);let B=Lt+vp();try{localStorage.setItem(Ji,B)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}n(I=>I||B)}}ao(()=>{try{if(l){let F=[];l.forEach(h=>{if(h.data){let B=h.data.match(/"imageUri":"(.*?)"/g);B&&B.forEach(I=>{let O=I.replace('"imageUri":"',"").replace('"',"");if(F.includes(O))return;let A=new Image;A.src=O,F.push(O)})}})}}catch{}},[l]),ao(()=>{if(r!==s&&(e([]),i()),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(po,r)}catch(F){console.log("Failed to save user id locally: Local storage available",F)}r===null&&setTimeout(()=>{r===null&&P()},50)},[r,l,g]),ao(()=>{v!=w&&(C(v),e([]),i())},[v,w,C]);function f(){return St.createElement(St.Fragment,null,T.map(F=>c(F.slug)!==Ae?null:St.createElement("span",{key:F.slug},St.createElement(Xi,{flowId:F.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(f,null))};import{ErrorBoundary as Rp}from"react-error-boundary";import co from"core-js-pure/actual/structured-clone";function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dt(...e){let t=e.shift(),o=e.length===1?e[0]:dt(...e);if(!Tr(t)||!Tr(o))throw new Error("deepmerge can only merge Objects");let i=co(t);return Object.entries(o).forEach(([r,n])=>{Tr(n)?i[r]!==void 0?Object.assign(i,{[r]:dt(i[r],co(n))}):Object.assign(i,{[r]:co(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...co(n)]}):Object.assign(i,{[r]:co(n)}):Object.assign(i,{[r]:n})}),i}var Zi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function Bp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Zi[o]){let r=Zi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Ep(e){if(!e)return;let t=dt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Ri(e){let{theme:t,styleOverrides:o}=e,i=Bp(t),r=Ep(o);return{overrides:i,css:r}}import jp from"styled-components";import{compose as Vp,variant as tn}from"styled-system";import en from"react";import Ap,{ThemeProvider as Ip,useTheme as Np}from"styled-components";import{border as Op,color as Lp,compose as Dp,get as $p,shadow as Mp,space as Up,system as zp,typography as Wp}from"styled-system";var _p={width:{property:"width",scale:"sizes",transform:(e,t)=>$p(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},Hp=Ap("div")(({css:e})=>e,Dp(Op,Lp,Mp,Up,Wp,zp(_p))),mo=({as:e,children:t,overrides:o,...i})=>{let r=Np(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>en.createElement(Hp,{as:e,...n,...i},t);if(o!==void 0){let p=dt(r,o);return en.createElement(Ip,{theme:p},s())}return s()};var uo={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"}},Gp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},on=jp(mo)(()=>({whiteSpace:"nowrap"}),Vp(tn({scale:"components.Button",variants:"components.Button"}),tn({prop:"size",variants:Gp})));import Kp from"styled-components";import{variant as qp,system as Yp}from"styled-system";var zo={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 rn=Kp(mo)(qp({scale:"components.Text",variants:"components.Text"}),Yp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var nn=4,sn="px",Xp=20,Jp=Object.fromEntries(Array.from(Array(Xp+1),(e,t)=>t===0?[.5,`${.5*nn}${sn}`]:[t,`${t*nn}${sn}`])),Wt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Fr={colors:{...Wt,neutral:{foreground:Wt.gray300},primary:{background:Wt.blue500,foreground:Wt.white,inverted:Wt.blue500},negative:{foreground:Wt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Jp,components:{Button:uo,Text:zo}};var ln="https://api.frigade.com",K=Qp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:ln,readonly:!1,debug:!1});function ed(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var td=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var we,ce;let[n,s]=Me(t||null),[p,c]=Me(o||null),[l,g]=Me([]),[d,x]=Me([]),[T,b]=Me([]),[S,u]=Me({}),[v,w]=Me({}),[C,N]=Me([]),[P,f]=Me({}),[F,h]=Me(!1),[B,I]=Me(!1),[O,A]=Me(!j(e)),D=(G,re)=>{if(re==="_blank"){window.open(G,"_blank");return}setTimeout(()=>{window.location.href=G},50)},$={theme:{...Je.theme,...((we=i==null?void 0:i.defaultAppearance)==null?void 0:we.theme)??{}},styleOverrides:{...Je.styleOverrides,...((ce=i==null?void 0:i.defaultAppearance)==null?void 0:ce.styleOverrides)??{}}};function j(G){return!!(G&&G.length>10&&G.substring(0,10)==="api_public")}Wo(()=>{t&&s(t)},[t]),Wo(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(po)&&window.localStorage.getItem(po)!==n&&ed()},[n]),Wo(()=>{o&&c(o)},[o]),Wo(()=>{if(j(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let H={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:T,setFlowResponses:b,userProperties:S,setUserProperties:u,openFlowStates:v,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:C,setCompletedFlowsToKeepOpenDuringSession:N,customVariables:P,setCustomVariables:f,isNewGuestUser:F,setIsNewGuestUser:h,hasActiveFullPageFlow:B,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:D,defaultAppearance:$,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:ln,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return bt.createElement(K.Provider,{value:H},r);let{overrides:V}=Ri($);return bt.createElement(Rp,{fallback:bt.createElement(bt.Fragment,null,r)},bt.createElement(K.Provider,{value:H},bt.createElement(Zp,{theme:dt($.theme,Fr,V??{},(i==null?void 0:i.theme)??{})},r,bt.createElement(Qi,null))))};import Vd from"react";import de,{useEffect as $s,useState as Ms}from"react";import _e,{useState as yd}from"react";import Ft from"styled-components";import jo from"react";import wt from"react";import pn from"styled-components";var an=pn.span`
|
|
679
|
+
`;var Yi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=Sr([]),[p,c]=Sr(!1),[l,g]=Sr(e.id);return yr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),yr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),yr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Re.createElement(Wi,{className:a("selectListContainer",i)},Re.createElement(_i,null,Re.createElement(Hi,{className:a("selectListTitle",i)},e.title),Re.createElement(ji,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let T=n.includes(d.id);return Re.createElement(Vi,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(S=>S!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:a("selectListSelectItem",i)},Re.createElement(Gi,{className:a("selectListItemImage",i)},d.imageUri&&Re.createElement(Ki,{src:d.imageUri,alt:`select-icon-${x}`}),Re.createElement(qi,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Re.createElement(Ze,{appearance:i,value:T,primaryColor:i.theme.colorPrimary}))}))};import Le,{useEffect as Xi,useState as lo}from"react";var bp=({children:e,id:t,shouldWrap:o=!1})=>Le.createElement(Le.Fragment,null,o?Le.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),$o=({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:T,showPagination:S=!1,customFormElements:b,allowBackNavigation:u,validationHandler:B,onFormDataChange:w,showFooter:h,prefillData:N,updateUrlOnPageChange:P})=>{let F={...{linkCollection:Ui,multiInput:Pi,callToAction:zi,selectList:Yi},...i},{primaryCTAClickSideEffects:C,secondaryCTAClickSideEffects:v}=le(),[I,O]=lo(!1),[A,D]=lo({}),[$,V]=lo(!1),[j,Y]=lo(!1),[de,he]=lo(null),K=t[o]??null,{markStepCompleted:te,markStepStarted:Q,isLoading:Se,updateCustomVariables:me,markFlowCompleted:Ee}=J();Xi(()=>{me(r)},[r,Se]),Xi(()=>{w&&w(A,re(),t[o],o)},[A]);function re(){return{data:A[t[o].id]??{},stepId:t[o].id,customVariables:r}}function ne(_,X,H){let se=o+1<t.length?t[o+1]:null;return s&&s(_,H,se,A,re()),n?n(_,o,X,se):!0}function Te(_,X){D(H=>{let se={};return se[_.id]=X,{...H,...se}})}function L(_){return _.selectedStep.imageUri?Le.createElement(Ni,{image:_.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let U=h&&Le.createElement($i,{step:t[o],canContinue:I&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(V(!0),B){let H=await B(t[o],o,t[o+1],A,re());if(H!==!0){he(typeof H=="string"?H:null),V(!1);return}else he(null)}let _={...re()};await te(p,t[o].id,_),o+1<t.length&&await Q(p,t[o+1].id);let X=ne(t[o],"primary",o);if(o+1>=t.length&&(g&&g(),T&&T(),l&&X&&(d&&d(!1),x(!1)),await Ee(p)),C(t[o]),V(!1),window&&u&&o+1<t.length&&(window.location.hash=t[o+1].id),window&&!u&&P&&o+1<t.length){let H=new URL(window.location.href);H.searchParams.set("p",t[o+1].id),window.history.pushState({},"",H.toString())}},onSecondaryClick:()=>{ne(t[o],"secondary",o),v(t[o])},onBack:async()=>{o-1>=0&&(V(!0),await Q(p,t[o-1].id),V(!1))},steps:t,allowBackNavigation:u,errorMessage:de,isSaving:$});return Le.createElement(Le.Fragment,null,Le.createElement(Ai,{className:a("formContainer",e)},Le.createElement(bp,{id:o,shouldWrap:c==="large-modal"},Le.createElement(Ii,{key:K.id,type:c,className:a("formContent",e)},t.map(_=>{let X=F[_.type];return K.id!==_.id?null:Le.createElement(X,{key:_.id,stepData:_,canContinue:I,setCanContinue:O,onSaveData:H=>{Te(_,H)},appearance:e,customFormElements:b,flowId:p,prefillData:N})}),S&&Le.createElement(Mi,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),U)),c=="large-modal"&&Le.createElement(L,{selectedStep:t[o]})))};import ao from"react";import{createGlobalStyle as wp}from"styled-components";var Tp=wp`
|
|
680
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map(([i,r])=>typeof r=="object"?`${i} { ${Object.entries(r).map(([s,p])=>`${bo(s)}: ${p};`).join(" ")} }`:`${bo(i)}: ${r};`).join(" ")} }`).join(" ")}`;function oe({appearance:e}){if(!e||!e.styleOverrides)return ao.createElement(ao.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?ao.createElement(ao.Fragment,null):ao.createElement(Tp,{inlineStyles:t})}var Qi=({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:T=!1,modalPosition:S="center",repeatable:b=!1,onDismiss:u,showPagination:B=!1,allowBackNavigation:w=!1,validationHandler:h,showFrigadeBranding:N=!1,onFormDataChange:P,showFooter:f=!0,prefillData:F={},updateUrlOnPageChange:C=!1})=>{var X;let{getFlow:v,getFlowSteps:I,isLoading:O,targetingLogicShouldHideFlow:A,getFlowStatus:D,getCurrentStepIndex:$,markFlowCompleted:V,markFlowNotStarted:j,markStepStarted:Y}=J(),de=$(e),{mergeAppearanceWithDefault:he}=Z(),[K,te]=Ji(!1),[Q,Se]=Ji(!1),{setOpenFlowState:me,getOpenFlowState:Ee,hasOpenModals:re}=Fe(),ne=I(e);c=he(c);let[Te,L]=i!==void 0&&r!==void 0?[i,r]:[Ee(e,!0),H=>me(e,H)];if(br(()=>{!K&&!O&&(te(!0),(D(e)===q&&b||D(e)===Ne)&&(D(e)===q&&b&&j(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(se=>{se.startsWith(xr)&&window.localStorage.removeItem(se)})),te(!0))},[K,te,O]),br(()=>{window&&w&&!Q&&(window.location.hash=ne[de].id,Se(!0))},[w,Q,Se]),br(()=>{var H;if(window&&((H=window==null?void 0:window.location)!=null&&H.hash)&&window.location.hash.replace("#","")!==ne[de].id){let se=window.location.hash.replace("#",""),Ae=ne.findIndex(Ie=>Ie.id===se);Ae!==-1&&Ae!==de&&Y(e,ne[Ae].id)}},[(X=window==null?void 0:window.location)==null?void 0:X.hash]),O)return null;let U=v(e);if(!U||A(U)||!ne||i!==void 0&&i===!1||D(e)===q&&l||(o=="modal"||o=="corner-modal")&&re(e))return null;let _=()=>{L(!1),u&&u(),T===!0&&V(e)};if(S=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",qe.createElement(Ve,{appearance:c,onClose:_,visible:Te,style:H,dismissible:x,showFrigadeBranding:N},qe.createElement(oe,{appearance:c}),qe.createElement($o,{appearance:c,steps:ne,selectedStep:de,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:L,onDismiss:u,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:h,onFormDataChange:P,showFooter:f,prefillData:F,updateUrlOnPageChange:C}))}return o==="modal"&&S!=="center"?qe.createElement(Po,{appearance:c,onClose:_,visible:Te,modalPosition:S},qe.createElement(oe,{appearance:c}),qe.createElement($o,{appearance:c,steps:ne,selectedStep:de,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:L,onDismiss:u,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:h,onFormDataChange:P,showFooter:f,prefillData:F,updateUrlOnPageChange:C})):qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:c}),qe.createElement($o,{appearance:c,steps:ne,selectedStep:de,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:L,onDismiss:u,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:h,onFormDataChange:P,showFooter:f,prefillData:F,updateUrlOnPageChange:C}))},Zi=Qi;import{useCallback as wr,useContext as Fp,useEffect as kp}from"react";function Tr(){let{organizationId:e,userId:t,setOrganizationId:o}=Fp(G),{mutateUserFlowState:i}=Oe(),{config:r,apiUrl:n}=je(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,T){return`frigade-user-group-registered-${x}-${T}`}kp(()=>{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=wr(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 T={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()},[e,t,r,i]),g=wr(async(x,T)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:T}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()},[e,t,r,i]),d=wr(async(x,T)=>{if(p())if(T){let S=c(t,x);localStorage.setItem(S,"true"),o(x);let b={foreignUserId:t,foreignUserGroupId:x,properties:T};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var Ri="frigade-xFrigade_guestUserId",co="frigade-xFrigade_userId",en=({})=>{let{setFlowResponses:e}=Rt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Oe(),{userId:r,setUserId:n}=eo(),[s,p]=Mo(r),{getFlowStatus:c}=J(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Pp(G),[T,S]=Mo([]),[b,u]=Mo([]),{organizationId:B}=Tr(),[w,h]=Mo(B);po(()=>{if(!o&&t)for(let F=0;F<t.length;F++){let C=t[F],v=l.find(I=>I.slug===(C==null?void 0:C.flowId));if(v&&C&&C.shouldTrigger===!0&&v.type=="FORM"&&v.triggerType==="AUTOMATIC"&&!b.includes(v.slug)){setTimeout(()=>{N(C.flowId)},500);break}}},[o,t]),po(()=>{x.length>0&&i()},[x]);function N(F){let C=l.find(v=>v.slug===F);C&&C.triggerType==="AUTOMATIC"&&!b.includes(C.slug)&&(u([...b,C.slug]),S([C]))}function P(){if(!r){let F=localStorage.getItem(co);if(F){n(F);return}let C=localStorage.getItem(Ri);if(C){n(C);return}d(!0);let v=Lt+vp();try{localStorage.setItem(Ri,v)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}n(I=>I||v)}}po(()=>{try{if(l){let F=[];l.forEach(C=>{if(C.data){let v=C.data.match(/"imageUri":"(.*?)"/g);v&&v.forEach(I=>{let O=I.replace('"imageUri":"',"").replace('"',"");if(F.includes(O))return;let A=new Image;A.src=O,F.push(O)})}})}}catch{}},[l]),po(()=>{if(r!==s&&(e([]),i()),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(co,r)}catch(F){console.log("Failed to save user id locally: Local storage available",F)}r===null&&setTimeout(()=>{r===null&&P()},50)},[r,l,g]),po(()=>{B!=w&&(h(B),e([]),i())},[B,w,h]);function f(){return St.createElement(St.Fragment,null,T.map(F=>c(F.slug)!==Ne?null:St.createElement("span",{key:F.slug},St.createElement(Zi,{flowId:F.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(f,null))};import{ErrorBoundary as Rp}from"react-error-boundary";var tn={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(tn[o]){let r=tn[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Ep(e){if(!e)return;let t=fe({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function on(e){let{theme:t,styleOverrides:o}=e,i=Bp(t),r=Ep(o);return{overrides:i,css:r}}import jp from"styled-components";import{compose as Vp,variant as nn}from"styled-system";import rn from"react";import Ap,{ThemeProvider as Ip,useTheme as Np}from"styled-components";import{border as Op,color as Lp,compose as Dp,get as $p,shadow as Mp,space as Up,system as zp,typography as Wp}from"styled-system";var _p={width:{property:"width",scale:"sizes",transform:(e,t)=>$p(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},Hp=Ap("div")(({css:e})=>e,Dp(Op,Lp,Mp,Up,Wp,zp(_p))),mo=({as:e,children:t,overrides:o,...i})=>{let r=Np(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>rn.createElement(Hp,{as:e,...n,...i},t);if(o!==void 0){let p=fe(r,o);return rn.createElement(Ip,{theme:p},s())}return s()};var uo={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"}},Gp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},sn=jp(mo)(()=>({whiteSpace:"nowrap"}),Vp(nn({scale:"components.Button",variants:"components.Button"}),nn({prop:"size",variants:Gp})));import Kp from"styled-components";import{variant as qp,system as Yp}from"styled-system";var Uo={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 ln=Kp(mo)(qp({scale:"components.Text",variants:"components.Text"}),Yp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var an=4,pn="px",Xp=20,Jp=Object.fromEntries(Array.from(Array(Xp+1),(e,t)=>t===0?[.5,`${.5*an}${pn}`]:[t,`${t*an}${pn}`])),Wt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Fr={colors:{...Wt,neutral:{foreground:Wt.gray300},primary:{background:Wt.blue500,foreground:Wt.white,inverted:Wt.blue500},negative:{foreground:Wt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Jp,components:{Button:uo,Text:Uo}};var dn="https://api.frigade.com",G=Qp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Qe,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:dn,readonly:!1,debug:!1});function ed(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var td=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var de,he;let[n,s]=ze(t||null),[p,c]=ze(o||null),[l,g]=ze([]),[d,x]=ze([]),[T,S]=ze([]),[b,u]=ze({}),[B,w]=ze({}),[h,N]=ze([]),[P,f]=ze({}),[F,C]=ze(!1),[v,I]=ze(!1),[O,A]=ze(!V(e)),D=(K,te)=>{if(te==="_blank"){window.open(K,"_blank");return}setTimeout(()=>{window.location.href=K},50)},$={theme:{...Qe.theme,...((de=i==null?void 0:i.defaultAppearance)==null?void 0:de.theme)??{}},styleOverrides:{...Qe.styleOverrides,...((he=i==null?void 0:i.defaultAppearance)==null?void 0:he.styleOverrides)??{}}};function V(K){return!!(K&&K.length>10&&K.substring(0,10)==="api_public")}zo(()=>{t&&s(t)},[t]),zo(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(co)&&window.localStorage.getItem(co)!==n&&ed()},[n]),zo(()=>{o&&c(o)},[o]),zo(()=>{if(V(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let j={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:T,setFlowResponses:S,userProperties:b,setUserProperties:u,openFlowStates:B,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:h,setCompletedFlowsToKeepOpenDuringSession:N,customVariables:P,setCustomVariables:f,isNewGuestUser:F,setIsNewGuestUser:C,hasActiveFullPageFlow:v,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:D,defaultAppearance:$,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:dn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return bt.createElement(G.Provider,{value:j},r);let{overrides:Y}=on($);return bt.createElement(Rp,{fallback:bt.createElement(bt.Fragment,null,r)},bt.createElement(G.Provider,{value:j},bt.createElement(Zp,{theme:fe($.theme,Fr,Y??{},(i==null?void 0:i.theme)??{})},r,bt.createElement(en,null))))};import Vd from"react";import ge,{useEffect as zs,useState as Ws}from"react";import He,{useState as yd}from"react";import Ft from"styled-components";import Ho from"react";import wt from"react";import mn from"styled-components";var cn=mn.span`
|
|
681
681
|
font-weight: 600;
|
|
682
682
|
font-size: 14px;
|
|
683
683
|
font-style: normal;
|
|
@@ -688,8 +688,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
688
688
|
vertical-align: middle;
|
|
689
689
|
margin-left: 32px;
|
|
690
690
|
padding-right: 12px;
|
|
691
|
-
${e=>
|
|
692
|
-
`,od=
|
|
691
|
+
${e=>ve(e)}
|
|
692
|
+
`,od=mn.div`
|
|
693
693
|
flex-direction: row;
|
|
694
694
|
justify-content: space-between;
|
|
695
695
|
display: flex;
|
|
@@ -697,12 +697,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
697
697
|
padding-bottom: 20px;
|
|
698
698
|
padding-right: 8px;
|
|
699
699
|
width: 100%;
|
|
700
|
-
${e=>
|
|
701
|
-
`,
|
|
700
|
+
${e=>ve(e)}
|
|
701
|
+
`,Wo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>wt.createElement(wt.Fragment,null,wt.createElement(od,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&wt.createElement(cn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),wt.createElement(Ze,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&wt.createElement(cn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),wt.createElement(oe,{appearance:p}));import fo from"styled-components";var un=fo.div`
|
|
702
702
|
font-weight: 700;
|
|
703
703
|
font-size: 18px;
|
|
704
704
|
line-height: 22px;
|
|
705
|
-
`,
|
|
705
|
+
`,fn=fo.p`
|
|
706
706
|
font-weight: 600;
|
|
707
707
|
font-size: 16px;
|
|
708
708
|
line-height: 24px;
|
|
@@ -710,7 +710,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
710
710
|
letter-spacing: 0.32px;
|
|
711
711
|
font-style: normal;
|
|
712
712
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
713
|
-
`,
|
|
713
|
+
`,gn=fo.p`
|
|
714
714
|
font-weight: 400;
|
|
715
715
|
font-size: 14px;
|
|
716
716
|
font-style: normal;
|
|
@@ -719,45 +719,45 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
719
719
|
letter-spacing: 0.28px;
|
|
720
720
|
margin: 8px 0px 0px 0px;
|
|
721
721
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
722
|
-
`,
|
|
722
|
+
`,_o=fo.div`
|
|
723
723
|
width: 6px;
|
|
724
724
|
position: absolute;
|
|
725
725
|
left: 0;
|
|
726
726
|
height: 100%;
|
|
727
727
|
border-top-right-radius: 4px;
|
|
728
728
|
border-bottom-right-radius: 4px;
|
|
729
|
-
`,
|
|
729
|
+
`,xn=fo.div`
|
|
730
730
|
flex-direction: row;
|
|
731
731
|
justify-content: flex-start;
|
|
732
732
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
733
733
|
padding-right: 16px;
|
|
734
|
-
`;var
|
|
734
|
+
`;var hn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return Ho.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&Ho.createElement(_o,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),Ho.createElement(xn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Ho.createElement(Wo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Tt from"react";import kr from"styled-components";import et from"styled-components";var bh=et.div`
|
|
735
735
|
background: #ffffff;
|
|
736
736
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
737
737
|
border-radius: 20px;
|
|
738
738
|
width: 385px;
|
|
739
739
|
padding: 24px 16px 16px 16px;
|
|
740
|
-
`,
|
|
740
|
+
`,wh=et.div`
|
|
741
741
|
/* Border bottom only on collapsable */
|
|
742
|
-
`,
|
|
742
|
+
`,Th=et.div`
|
|
743
743
|
display: flex;
|
|
744
744
|
flex-direction: row;
|
|
745
745
|
justify-content: space-between;
|
|
746
746
|
align-content: flex-start;
|
|
747
|
-
`,
|
|
747
|
+
`,Fh=et.h1`
|
|
748
748
|
display: flex;
|
|
749
749
|
margin: 0;
|
|
750
750
|
font-size: 18px;
|
|
751
|
-
`,
|
|
751
|
+
`,kh=et.h2`
|
|
752
752
|
font-size: 15px;
|
|
753
753
|
color: #4d4d4d;
|
|
754
|
-
`,
|
|
754
|
+
`,Ph=et.ul`
|
|
755
755
|
list-style: none;
|
|
756
|
-
`,
|
|
756
|
+
`,vh=et.li`
|
|
757
757
|
display: flex;
|
|
758
758
|
justify-content: flex-start;
|
|
759
759
|
flex-direction: row;
|
|
760
|
-
`,
|
|
760
|
+
`,Cn=et.div`
|
|
761
761
|
position: absolute;
|
|
762
762
|
left: 0;
|
|
763
763
|
top: 0;
|
|
@@ -765,7 +765,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
765
765
|
width: ${e=>e.fgWidth};
|
|
766
766
|
border-radius: 20px;
|
|
767
767
|
background-color: ${e=>e.theme.colorPrimary};
|
|
768
|
-
`,
|
|
768
|
+
`,yn=et.div`
|
|
769
769
|
position: relative;
|
|
770
770
|
left: 0;
|
|
771
771
|
top: 0;
|
|
@@ -782,7 +782,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
782
782
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
783
783
|
width: 100%;
|
|
784
784
|
|
|
785
|
-
${e=>
|
|
785
|
+
${e=>ve(e)}
|
|
786
786
|
`,id=kr.div`
|
|
787
787
|
flex-grow: 1;
|
|
788
788
|
position: relative;
|
|
@@ -794,12 +794,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
794
794
|
padding-right: ${e=>e.padding};
|
|
795
795
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
796
796
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
797
|
-
${e=>
|
|
798
|
-
`;var
|
|
797
|
+
${e=>ve(e)}
|
|
798
|
+
`;var De=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Tt.createElement(Tt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Tt.createElement(rd,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Tt.createElement(nd,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Tt.createElement(id,{textLocation:i,className:a("progressBar",s)},Tt.createElement(Cn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Tt.createElement(yn,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import go from"react";import ld from"styled-components";import Vo from"react";import jo from"react";var _t=({stepData:e,appearance:t})=>jo.createElement(jo.Fragment,null,jo.createElement(fn,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ae(e.title)}),jo.createElement(gn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ae(e.subtitle)}));import Pr from"react";var Ht=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Pr.createElement(No,{className:a("ctaContainer",t)},Pr.createElement(R,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Pr.createElement(R,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var jt=({stepData:e,appearance:t})=>Vo.createElement(Vo.Fragment,null,Vo.createElement(_t,{stepData:e,appearance:t}),Vo.createElement(Ht,{stepData:e,appearance:t}));import sd from"react";function Sn(e){return sd.createElement(Ke,{appearance:e.appearance,videoUri:e.videoUri})}var vr="default",ad=ld.img`
|
|
799
799
|
border-radius: 4px;
|
|
800
800
|
max-height: 260px;
|
|
801
801
|
min-height: 200px;
|
|
802
|
-
`,
|
|
802
|
+
`,bn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return go.createElement("div",null,o)}return go.createElement(un,{className:a("checklistStepContent",t)},e.imageUri?go.createElement(ad,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?go.createElement(Sn,{videoUri:e.videoUri,appearance:t}):null,go.createElement(jt,{stepData:e,appearance:t}))};import $e,{useRef as pd,useState as dd}from"react";import Vt from"styled-components";var wn=Vt.div`
|
|
803
803
|
display: block;
|
|
804
804
|
`,cd=Vt.div`
|
|
805
805
|
display: flex;
|
|
@@ -844,9 +844,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
844
844
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
845
845
|
border-radius: 50%;
|
|
846
846
|
}
|
|
847
|
-
`,
|
|
847
|
+
`,Tn="videoCarousel",Fn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return $e.createElement(wn,null,$e.createElement(jt,{stepData:e,appearance:t}));function o({video:n}){let s=pd(),[p,c]=dd(!1);return $e.createElement(md,null,!p&&$e.createElement(gd,{onClick:()=>{c(!0),s.current.play()},appearance:t},$e.createElement(Oo,null)),$e.createElement(ud,{controls:p,ref:s,play:p,src:n.uri}),$e.createElement(fd,null,n.title))}let i=e.props;return i.videos?$e.createElement(wn,null,$e.createElement(_t,{stepData:e,appearance:t}),$e.createElement(cd,null,i.videos.map((n,s)=>$e.createElement("span",{key:`${n.uri}-${s}`},$e.createElement(o,{video:n})))),$e.createElement(Ht,{stepData:e,appearance:t})):null};import tt from"react";import Go from"styled-components";var kn=Go.div`
|
|
848
848
|
display: block;
|
|
849
|
-
`,xd=
|
|
849
|
+
`,xd=Go.pre`
|
|
850
850
|
display: block;
|
|
851
851
|
background-color: #2a2a2a;
|
|
852
852
|
color: #f8f8f8;
|
|
@@ -862,21 +862,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
862
862
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
863
863
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
864
864
|
margin-bottom: 24px;
|
|
865
|
-
`,hd=
|
|
865
|
+
`,hd=Go.div`
|
|
866
866
|
font-size: 15px;
|
|
867
867
|
line-height: 20px;
|
|
868
868
|
margin-bottom: 12px;
|
|
869
869
|
margin-top: 12px;
|
|
870
|
-
`,Cd=
|
|
870
|
+
`,Cd=Go.div`
|
|
871
871
|
margin-top: 24px;
|
|
872
|
-
`,
|
|
872
|
+
`,Pn="codeSnippet",vn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return tt.createElement(kn,null,tt.createElement(jt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?tt.createElement(kn,null,tt.createElement(_t,{stepData:e,appearance:t}),tt.createElement(Cd,null,o.codeSnippets.map((r,n)=>tt.createElement("div",{key:n},r.title?tt.createElement(hd,null,r.title):null,r.code?tt.createElement(xd,null,r.code):null))),tt.createElement(Ht,{stepData:e,appearance:t})):null};var Sd=Ft.div`
|
|
873
873
|
display: flex;
|
|
874
874
|
flex-direction: row;
|
|
875
875
|
overflow: hidden;
|
|
876
876
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
877
877
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
878
878
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
879
|
-
${e=>
|
|
879
|
+
${e=>ve(e)}
|
|
880
880
|
`,bd=Ft.h1`
|
|
881
881
|
font-size: 18px;
|
|
882
882
|
font-style: normal;
|
|
@@ -892,7 +892,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
892
892
|
letter-spacing: 0.28px;
|
|
893
893
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
894
894
|
margin: 10px 0px 0px 0px;
|
|
895
|
-
`,
|
|
895
|
+
`,Bn=Ft.div``,Td=Ft.div`
|
|
896
896
|
list-style: none;
|
|
897
897
|
padding: 0;
|
|
898
898
|
margin: 0;
|
|
@@ -905,30 +905,30 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
905
905
|
`,kd=Ft.div`
|
|
906
906
|
flex: 2;
|
|
907
907
|
padding: 2rem 2rem 2rem 0rem;
|
|
908
|
-
`,Pd=({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}=
|
|
908
|
+
`,Pd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Z();c=g(c);let x={...{[vr]:bn,[Tn]:Fn,[Pn]:vn},...p},[T,S]=yd(0),b=r??T,u=n??S,B=o.filter(h=>h.complete===!0).length,w=()=>{var h;return!((h=o[b])!=null&&h.type)||!x[o[b].type]?x[vr]({stepData:o[b],appearance:c}):x[o[b].type]({stepData:o[b],appearance:c})};return He.createElement(Sd,{type:l,styleOverrides:i,className:s,appearance:c},He.createElement(Bn,{style:{flex:1}},He.createElement(Bn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},He.createElement(bd,{className:a("checklistTitle",c),appearance:c},e),He.createElement(wd,{className:a("checklistSubtitle",c),appearance:c},t),He.createElement(De,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),He.createElement(Td,{className:a("checklistStepsContainer",c)},o.map((h,N)=>He.createElement(hn,{data:h,index:N,key:N,listLength:o.length,isSelected:N===b,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{u(N)},appearance:c})))),He.createElement(Fd,{appearance:c,className:a("checklistDivider",c)}),He.createElement(kd,null,He.createElement(w,null)))},Br=Pd;import M,{useState as Id}from"react";import En from"react";import vd from"styled-components";var Bd=vd.svg`
|
|
909
909
|
transition: 'transform 0.35s ease-in-out';
|
|
910
|
-
`,Gt=({style:e,className:t})=>
|
|
910
|
+
`,Gt=({style:e,className:t})=>En.createElement(Bd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},En.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import xe from"styled-components";var Er={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},An=xe.div`
|
|
911
911
|
max-height: 350px;
|
|
912
912
|
padding-bottom: 40px;
|
|
913
|
-
`,
|
|
913
|
+
`,In=xe.div`
|
|
914
914
|
display: flex;
|
|
915
915
|
flex-direction: column;
|
|
916
916
|
margin-top: 20px;
|
|
917
|
-
`,
|
|
917
|
+
`,Nn=xe.h1`
|
|
918
918
|
font-style: normal;
|
|
919
919
|
font-weight: 600;
|
|
920
920
|
font-size: 30px;
|
|
921
921
|
line-height: 36px;
|
|
922
922
|
margin-bottom: 16px;
|
|
923
923
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
924
|
-
`,
|
|
924
|
+
`,On=xe.h2`
|
|
925
925
|
font-weight: 400;
|
|
926
926
|
font-size: 16px;
|
|
927
927
|
line-height: 20px;
|
|
928
928
|
margin-bottom: 16px;
|
|
929
929
|
padding-left: 1px;
|
|
930
930
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
931
|
-
`,
|
|
931
|
+
`,Ln=xe.div`
|
|
932
932
|
${e=>k(e)} {
|
|
933
933
|
border: 1px solid #fafafa;
|
|
934
934
|
}
|
|
@@ -938,11 +938,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
938
938
|
flex-direction: column;
|
|
939
939
|
min-height: 240px;
|
|
940
940
|
overflow: hidden;
|
|
941
|
-
`,
|
|
941
|
+
`,Dn=xe.div`
|
|
942
942
|
display: flex;
|
|
943
943
|
flex-direction: row;
|
|
944
944
|
justify-content: space-between;
|
|
945
|
-
|
|
945
|
+
`,$n=xe.p`
|
|
946
946
|
${e=>k(e)} {
|
|
947
947
|
font-weight: 400;
|
|
948
948
|
font-size: 10px;
|
|
@@ -951,12 +951,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
951
951
|
color: #8c8c8c;
|
|
952
952
|
margin: 20px;
|
|
953
953
|
}
|
|
954
|
-
`,
|
|
954
|
+
`,Mn=xe.div`
|
|
955
955
|
display: flex;
|
|
956
956
|
flex-direction: row;
|
|
957
|
-
`,
|
|
957
|
+
`,Un=xe.div`
|
|
958
958
|
flex: 1;
|
|
959
|
-
|
|
959
|
+
`,zn=xe.div`
|
|
960
960
|
${e=>k(e)} {
|
|
961
961
|
display: flex;
|
|
962
962
|
justify-content: center;
|
|
@@ -966,7 +966,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
966
966
|
padding-left: 8px;
|
|
967
967
|
padding-right: 8px;
|
|
968
968
|
}
|
|
969
|
-
`,
|
|
969
|
+
`,Wn=xe.p`
|
|
970
970
|
${e=>k(e)} {
|
|
971
971
|
font-style: normal;
|
|
972
972
|
font-weight: 600;
|
|
@@ -978,7 +978,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
978
978
|
margin-top: 20px;
|
|
979
979
|
margin-bottom: 16px;
|
|
980
980
|
}
|
|
981
|
-
`,
|
|
981
|
+
`,_n=xe.p`
|
|
982
982
|
${e=>k(e)} {
|
|
983
983
|
font-weight: 400;
|
|
984
984
|
font-size: 14px;
|
|
@@ -987,14 +987,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
987
987
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
988
988
|
margin-bottom: 8px;
|
|
989
989
|
}
|
|
990
|
-
`,
|
|
990
|
+
`,Hn=xe.div`
|
|
991
991
|
${e=>k(e)} {
|
|
992
992
|
display: flex;
|
|
993
993
|
flex-direction: row;
|
|
994
994
|
justify-content: center;
|
|
995
995
|
gap: 8px;
|
|
996
996
|
}
|
|
997
|
-
`,
|
|
997
|
+
`,jn=xe.div`
|
|
998
998
|
${e=>k(e)} {
|
|
999
999
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1000
1000
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -1014,7 +1014,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1014
1014
|
justify-content: space-between;
|
|
1015
1015
|
position: relative;
|
|
1016
1016
|
cursor: pointer;
|
|
1017
|
-
`,
|
|
1017
|
+
`,Vn=xe.p`
|
|
1018
1018
|
${e=>k(e)} {
|
|
1019
1019
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1020
1020
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -1023,12 +1023,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1023
1023
|
font-size: 14px;
|
|
1024
1024
|
line-height: 22px;
|
|
1025
1025
|
margin: 0;
|
|
1026
|
-
`,
|
|
1026
|
+
`,Gn=xe.div`
|
|
1027
1027
|
display: flex;
|
|
1028
1028
|
flex-direction: row;
|
|
1029
1029
|
justify-content: flex-end;
|
|
1030
1030
|
align-content: center;
|
|
1031
|
-
`,
|
|
1031
|
+
`,Kn=xe.div`
|
|
1032
1032
|
display: flex;
|
|
1033
1033
|
flex: 1;
|
|
1034
1034
|
flex-direction: row;
|
|
@@ -1036,14 +1036,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1036
1036
|
align-content: center;
|
|
1037
1037
|
align-items: center;
|
|
1038
1038
|
margin-right: 20px;
|
|
1039
|
-
`,
|
|
1039
|
+
`,qn=xe.div`
|
|
1040
1040
|
display: block;
|
|
1041
1041
|
width: 100%;
|
|
1042
|
-
`;import Ed from"styled-components";var
|
|
1042
|
+
`;import Ed from"styled-components";var Yn=Ed.div`
|
|
1043
1043
|
flex-direction: column;
|
|
1044
1044
|
justify-content: center;
|
|
1045
1045
|
display: flex;
|
|
1046
|
-
`;import
|
|
1046
|
+
`;import rt from"react";import ot from"styled-components";var Xn=ot.div`
|
|
1047
1047
|
border: 1px solid #fafafa;
|
|
1048
1048
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1049
1049
|
border-radius: 14px;
|
|
@@ -1051,13 +1051,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1051
1051
|
display: flex;
|
|
1052
1052
|
flex-direction: column;
|
|
1053
1053
|
overflow: hidden;
|
|
1054
|
-
`,
|
|
1054
|
+
`,Jn=ot.div`
|
|
1055
1055
|
display: flex;
|
|
1056
1056
|
flex-wrap: wrap;
|
|
1057
1057
|
justify-content: space-between;
|
|
1058
1058
|
overflow: hidden;
|
|
1059
1059
|
row-gap: 10px;
|
|
1060
|
-
`,
|
|
1060
|
+
`,Qn=ot.div`
|
|
1061
1061
|
${e=>k(e)} {
|
|
1062
1062
|
color: #595959;
|
|
1063
1063
|
}
|
|
@@ -1067,7 +1067,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1067
1067
|
line-height: 12px;
|
|
1068
1068
|
letter-spacing: 0.09em;
|
|
1069
1069
|
margin-bottom: 12px;
|
|
1070
|
-
`,
|
|
1070
|
+
`,Zn=ot.div`
|
|
1071
1071
|
${e=>k(e)} {
|
|
1072
1072
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1073
1073
|
background: #ffffff;
|
|
@@ -1080,7 +1080,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1080
1080
|
|
|
1081
1081
|
max-width: 150px;
|
|
1082
1082
|
min-width: 200px;
|
|
1083
|
-
`,
|
|
1083
|
+
`,Rn=ot.div`
|
|
1084
1084
|
${e=>k(e)} {
|
|
1085
1085
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1086
1086
|
}
|
|
@@ -1092,13 +1092,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1092
1092
|
justify-content: center;
|
|
1093
1093
|
align-content: center;
|
|
1094
1094
|
align-items: center;
|
|
1095
|
-
`,
|
|
1095
|
+
`,es=ot.div`
|
|
1096
1096
|
font-weight: 600;
|
|
1097
1097
|
font-size: 20px;
|
|
1098
1098
|
line-height: 24px;
|
|
1099
1099
|
width: 20px;
|
|
1100
1100
|
height: 20px;
|
|
1101
|
-
`,
|
|
1101
|
+
`,ts=ot.div`
|
|
1102
1102
|
${e=>k(e)} {
|
|
1103
1103
|
color: #434343;
|
|
1104
1104
|
}
|
|
@@ -1107,20 +1107,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1107
1107
|
line-height: 17px;
|
|
1108
1108
|
margin-top: 12px;
|
|
1109
1109
|
margin-bottom: 8px;
|
|
1110
|
-
`,
|
|
1110
|
+
`,os=ot.div`
|
|
1111
1111
|
${e=>k(e)} {
|
|
1112
1112
|
color: #8c8c8c;
|
|
1113
1113
|
}
|
|
1114
1114
|
font-weight: 400;
|
|
1115
1115
|
font-size: 12px;
|
|
1116
1116
|
line-height: 14px;
|
|
1117
|
-
`,
|
|
1117
|
+
`,rs=ot.a`
|
|
1118
1118
|
color: ${e=>e.color};
|
|
1119
1119
|
font-size: 12px;
|
|
1120
1120
|
line-height: 14px;
|
|
1121
1121
|
font-weight: 400;
|
|
1122
1122
|
cursor: pointer;
|
|
1123
|
-
`;var Ad=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=
|
|
1123
|
+
`;var Ad=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=le();return rt.createElement(Xn,{style:t,className:a("guideContainer",r)},rt.createElement(Qn,{className:a("guideTitle",r)},o),rt.createElement(Jn,{className:a("guideItemContainer",r)},e.map((p,c)=>rt.createElement(Zn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&rt.createElement(Rn,{className:a("guideIcon",r)},rt.createElement(es,null,p.icon)),rt.createElement(ts,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:ae(p.title)}),rt.createElement(os,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:ae(p.subtitle)}),rt.createElement(rs,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},xo=Ad;var Nd=({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 T=({stepData:f,handleSecondaryCTAClick:F,handleCTAClick:C})=>f?M.createElement(zn,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},M.createElement(Wn,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ae(f.title)}),M.createElement(_n,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ae(f.subtitle)}),M.createElement(Hn,{className:a("checklistCTAContainer",l)},f.secondaryButtonTitle&&M.createElement(R,{title:f.secondaryButtonTitle,onClick:F,appearance:l,secondary:!0}),M.createElement(R,{title:f.primaryButtonTitle,onClick:C,appearance:l}))):M.createElement(M.Fragment,null),b={...{default:f=>{var I;if((I=e[w])!=null&&I.StepContent){let O=e[w].StepContent;return M.createElement("div",null,O)}let F=e[w];return M.createElement(T,{stepData:f,handleCTAClick:()=>{F.handlePrimaryButtonClick&&F.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{F.handleSecondaryButtonClick&&F.handleSecondaryButtonClick()}})}},...c},[u,B]=Id(0),w=s??u,h=p??B,N=()=>{var f;return e?!((f=e[w])!=null&&f.type)||!b[e[w].type]?b.default(e[w]):b[e[w].type]({stepData:e[w],primaryColor:l.theme.colorPrimary}):M.createElement(M.Fragment,null)},P=e.filter(f=>f.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Er.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Er),M.createElement(Ve,{onClose:n,visible:r,appearance:l},M.createElement(qn,null,M.createElement(In,null,M.createElement(Nn,{appearance:l,className:a("checklistTitle",l)},t),M.createElement(On,{appearance:l,className:a("checklistSubtitle",l)},o)),M.createElement(An,null,e&&e.length>0&&M.createElement(Ln,{className:a("stepsContainer",l)},M.createElement(Dn,null,M.createElement("div",{style:{flex:3}},M.createElement($n,{className:a("stepsTitle",l)},i)),M.createElement(Kn,null,M.createElement(De,{style:{width:"100%"},count:P,total:e.length,appearance:l}))),M.createElement(Mn,null,M.createElement(Un,{className:a("checklistStepListContainer",l),appearance:l},e.map((f,F)=>{let C=w===F;return M.createElement(jn,{selected:C,className:a(`checklistStepListItem${C?"Selected":""}`,l),key:`checklist-guide-step-${f.id??F}`,disabled:f.blocked,onClick:()=>{f.blocked||h(F)},title:f.blocked?"Finish remaining steps to continue":void 0},C&&M.createElement(_o,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),M.createElement(Vn,{selected:C,className:a(`checklistStepListStepName${C?"Selected":""}`,l)},f.stepName),M.createElement(Gn,null,M.createElement(Ze,{value:f.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:f.progress,appearance:l}),M.createElement(Yn,null,M.createElement(Gt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),M.createElement(N,null))),g&&g.length>0&&M.createElement(xo,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:f=>(x&&x(f),!0)}))))):M.createElement(M.Fragment,null)},Ar=Nd;import Be,{useEffect as Cs,useState as Od}from"react";import ye from"react";import it from"styled-components";var is=it.div`
|
|
1124
1124
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1125
1125
|
border: 1px solid;
|
|
1126
1126
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1132,19 +1132,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1132
1132
|
display: flex;
|
|
1133
1133
|
flex-direction: column;
|
|
1134
1134
|
transition: max-height 0.25s;
|
|
1135
|
-
`,
|
|
1135
|
+
`,ns=it.div`
|
|
1136
1136
|
display: flex;
|
|
1137
1137
|
margin-bottom: 20px;
|
|
1138
|
-
`,
|
|
1138
|
+
`,ss=it.img`
|
|
1139
1139
|
border-radius: 4px;
|
|
1140
1140
|
max-height: 260px;
|
|
1141
1141
|
min-height: 200px;
|
|
1142
|
-
`,
|
|
1142
|
+
`,ls=it.div`
|
|
1143
1143
|
display: flex;
|
|
1144
1144
|
flex-direction: row;
|
|
1145
1145
|
justify-content: space-between;
|
|
1146
1146
|
align-items: center;
|
|
1147
|
-
`,
|
|
1147
|
+
`,as=it.p`
|
|
1148
1148
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1149
1149
|
font-style: normal;
|
|
1150
1150
|
font-weight: 500;
|
|
@@ -1155,23 +1155,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1155
1155
|
:hover {
|
|
1156
1156
|
opacity: 0.8;
|
|
1157
1157
|
}
|
|
1158
|
-
`,
|
|
1158
|
+
`,ps=it.div`
|
|
1159
1159
|
cursor: pointer;
|
|
1160
1160
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1161
1161
|
:hover {
|
|
1162
1162
|
opacity: 0.8;
|
|
1163
1163
|
}
|
|
1164
|
-
`,
|
|
1164
|
+
`,Sy=it.div``,ds=it.p`
|
|
1165
1165
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1166
1166
|
font-weight: 400;
|
|
1167
1167
|
font-size: 14px;
|
|
1168
1168
|
line-height: 22px;
|
|
1169
|
-
`,
|
|
1169
|
+
`,cs=it.div`
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
flex-direction: row;
|
|
1172
1172
|
justify-content: flex-start;
|
|
1173
1173
|
align-items: center;
|
|
1174
|
-
`;var
|
|
1174
|
+
`;var ms=({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 ye.createElement(ye.Fragment,null,e.imageUri||e.videoUri?ye.createElement(ns,{className:a("stepMediaContainer",n)},e.imageUri?ye.createElement(ss,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ye.createElement(Ke,{appearance:n,videoUri:e.videoUri}):null):null,ye.createElement(ds,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:ae(e.subtitle)}),ye.createElement(No,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?ye.createElement(R,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,ye.createElement(R,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let x=s[e.type];return x?x(e,n):null}return ye.createElement(is,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},ye.createElement(ls,{className:a("stepHeader",n)},ye.createElement(cs,null,ye.createElement(Wo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),ye.createElement(as,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:ae(e.title),onClick:()=>o()})),ye.createElement(ps,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},ye.createElement(Gt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),ye.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Kt from"styled-components";var Oy=Kt.div`
|
|
1175
1175
|
background: #ffffff;
|
|
1176
1176
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1177
1177
|
border-radius: 6px;
|
|
@@ -1185,26 +1185,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1185
1185
|
|
|
1186
1186
|
max-width: 800px;
|
|
1187
1187
|
min-width: 350px;
|
|
1188
|
-
`,
|
|
1188
|
+
`,us=Kt.div`
|
|
1189
1189
|
display: flex;
|
|
1190
1190
|
flex-direction: column;
|
|
1191
|
-
`,
|
|
1191
|
+
`,fs=Kt.h1`
|
|
1192
1192
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1193
1193
|
font-style: normal;
|
|
1194
1194
|
font-weight: 700;
|
|
1195
1195
|
font-size: 20px;
|
|
1196
1196
|
line-height: 24px;
|
|
1197
1197
|
margin-bottom: 8px;
|
|
1198
|
-
`,
|
|
1198
|
+
`,gs=Kt.h2`
|
|
1199
1199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1200
1200
|
font-weight: 400;
|
|
1201
1201
|
font-size: 14px;
|
|
1202
1202
|
line-height: 23px;
|
|
1203
1203
|
margin: 2px 0 0 0;
|
|
1204
|
-
`,
|
|
1204
|
+
`,xs=Kt.div`
|
|
1205
1205
|
display: block;
|
|
1206
1206
|
width: 100%;
|
|
1207
|
-
`,
|
|
1207
|
+
`,hs=Kt.div`
|
|
1208
1208
|
display: flex;
|
|
1209
1209
|
width: 100%;
|
|
1210
1210
|
flex-direction: column;
|
|
@@ -1212,23 +1212,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1212
1212
|
padding: 24px;
|
|
1213
1213
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1214
1214
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1215
|
-
`;var Ld=({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:T,style:
|
|
1215
|
+
`;var Ld=({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:T,style:S})=>{let b=o.filter(P=>P.complete).length,[u,B]=Od(Array(o.length).fill(!0));Cs(()=>{let P=[...u];if(n){for(let f=0;f<o.length;f++)if(!o[f].complete){P[f]=!1;break}B(P)}},[]),Cs(()=>{w(c)},[c]);let w=P=>{let f=[...u];if(s)for(let F=0;F<u.length;++F)F!==P&&(f[F]=!0);f[P]=!f[P],B(f)};if(!r&&d=="modal")return Be.createElement(Be.Fragment,null);let h=Be.createElement(Be.Fragment,null,Be.createElement(us,null,Be.createElement(fs,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:ae(e)}),Be.createElement(gs,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:ae(t)})),Be.createElement(De,{display:"percent",count:b,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),N=Be.createElement(xs,{className:Ce(a("checklistContainer",g),x)},o.map((P,f)=>{let F=u[f];return Be.createElement(ms,{appearance:g,stepData:P,collapsed:F,key:`modal-checklist-${P.id??f}`,onClick:()=>{if(c===f){w(f);return}l(f)},onPrimaryButtonClick:()=>{P.handlePrimaryButtonClick&&P.handlePrimaryButtonClick(),p&&!P.completionCriteria&&f<u.length-1&&u[f+1]&&l(f+1)},onSecondaryButtonClick:()=>{P.handleSecondaryButtonClick&&P.handleSecondaryButtonClick()},customStepTypes:T})}));return d==="inline"?Be.createElement(hs,{appearance:g,className:Ce(a("checklistInlineContainer",g),x),style:S},h,N):Be.createElement(Be.Fragment,null,Be.createElement(Ve,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:h},N))},Ir=Ld;import pe,{useEffect as Nr,useRef as Hd,useState as kt}from"react";import{useEffect as Dd,useState as $d}from"react";var ys=()=>{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]=$d(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 Dd(()=>{s()},[]),o};import qt from"react";import ce,{css as Ss,keyframes as bs}from"styled-components";var ws=Ss`
|
|
1216
1216
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1217
|
-
`,Md=
|
|
1217
|
+
`,Md=Ss`
|
|
1218
1218
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1219
|
-
`,Ud=
|
|
1219
|
+
`,Ud=bs`
|
|
1220
1220
|
from {
|
|
1221
1221
|
opacity: 0;
|
|
1222
1222
|
} to {
|
|
1223
1223
|
opacity: 1;
|
|
1224
1224
|
}
|
|
1225
|
-
`,zd=
|
|
1225
|
+
`,zd=bs`
|
|
1226
1226
|
from {
|
|
1227
1227
|
opacity: 1;
|
|
1228
1228
|
} to {
|
|
1229
1229
|
opacity: 0;
|
|
1230
1230
|
}
|
|
1231
|
-
`,
|
|
1231
|
+
`,Ts=ce.div`
|
|
1232
1232
|
margin: 0 -20px;
|
|
1233
1233
|
overflow-x: auto;
|
|
1234
1234
|
padding-left: 20px;
|
|
@@ -1245,13 +1245,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1245
1245
|
::-webkit-scrollbar {
|
|
1246
1246
|
display: none;
|
|
1247
1247
|
}
|
|
1248
|
-
`,
|
|
1248
|
+
`,Fs=ce.div`
|
|
1249
1249
|
display: flex;
|
|
1250
1250
|
flex-flow: row nowrap;
|
|
1251
1251
|
gap: 0 16px;
|
|
1252
1252
|
scroll-snap-align: center;
|
|
1253
1253
|
scroll-snap-stop: always;
|
|
1254
|
-
`,
|
|
1254
|
+
`,ks=ce.div`
|
|
1255
1255
|
animation: ${e=>e.reversed?zd:Ud} 0.25s ease-out;
|
|
1256
1256
|
background: linear-gradient(
|
|
1257
1257
|
to right,
|
|
@@ -1261,8 +1261,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1261
1261
|
position: absolute;
|
|
1262
1262
|
width: 64px;
|
|
1263
1263
|
z-index: 10;
|
|
1264
|
-
`,
|
|
1265
|
-
${
|
|
1264
|
+
`,Ps=ce.button`
|
|
1265
|
+
${ws}
|
|
1266
1266
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1267
1267
|
align-items: center;
|
|
1268
1268
|
border-radius: 50%;
|
|
@@ -1273,11 +1273,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1273
1273
|
justify-content: center;
|
|
1274
1274
|
position: absolute;
|
|
1275
1275
|
width: 48px;
|
|
1276
|
-
`,
|
|
1276
|
+
`,vs=ce.div`
|
|
1277
1277
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1278
1278
|
padding: 20px;
|
|
1279
|
-
`,
|
|
1280
|
-
${
|
|
1279
|
+
`,Bs=ce(vs)`
|
|
1280
|
+
${ws}
|
|
1281
1281
|
background: ${({theme:e})=>e.colorBackground};
|
|
1282
1282
|
position: relative;
|
|
1283
1283
|
|
|
@@ -1289,86 +1289,86 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1289
1289
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1290
1290
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1291
1291
|
}
|
|
1292
|
-
`,
|
|
1292
|
+
`,Es=ce.img`
|
|
1293
1293
|
border-radius: 50%;
|
|
1294
1294
|
height: 40px;
|
|
1295
1295
|
margin-bottom: 12px;
|
|
1296
1296
|
width: 40px;
|
|
1297
|
-
`,
|
|
1297
|
+
`,As=ce(vs)`
|
|
1298
1298
|
${e=>k(e)} {
|
|
1299
1299
|
${Md}
|
|
1300
1300
|
|
|
1301
1301
|
background: ${({theme:e})=>e.colorBackground};
|
|
1302
1302
|
}
|
|
1303
|
-
`,
|
|
1303
|
+
`,Jy=ce.div`
|
|
1304
1304
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1305
1305
|
display: flex;
|
|
1306
1306
|
flex-flow: row nowrap;
|
|
1307
1307
|
align-items: center;
|
|
1308
|
-
`,
|
|
1308
|
+
`,Qy=ce.div`
|
|
1309
1309
|
white-space: nowrap;
|
|
1310
|
-
`,
|
|
1310
|
+
`,Is=ce.div`
|
|
1311
1311
|
background: #d8fed8;
|
|
1312
1312
|
border-radius: 6px;
|
|
1313
1313
|
float: right;
|
|
1314
1314
|
margin-bottom: 12px;
|
|
1315
1315
|
padding: 4px 10px;
|
|
1316
|
-
`,Wd=
|
|
1316
|
+
`,Wd=ce.p`
|
|
1317
1317
|
font-weight: bold;
|
|
1318
1318
|
font-size: 18px;
|
|
1319
1319
|
line-height: 22px;
|
|
1320
1320
|
letter-spacing: calc(18px * -0.01);
|
|
1321
1321
|
margin: 0;
|
|
1322
|
-
`,
|
|
1322
|
+
`,Ns=ce(Wd)`
|
|
1323
1323
|
margin-bottom: 4px;
|
|
1324
|
-
`,
|
|
1324
|
+
`,Os=ce.div`
|
|
1325
1325
|
display: flex;
|
|
1326
1326
|
flex-flow: row nowrap;
|
|
1327
1327
|
align-items: center;
|
|
1328
1328
|
min-width: 50%;
|
|
1329
|
-
`,_d=
|
|
1329
|
+
`,_d=ce.p`
|
|
1330
1330
|
font-weight: bold;
|
|
1331
1331
|
font-size: 16px;
|
|
1332
1332
|
line-height: 20px;
|
|
1333
1333
|
letter-spacing: calc(16px * -0.01);
|
|
1334
1334
|
margin: 0;
|
|
1335
|
-
`,
|
|
1335
|
+
`,Ls=ce(_d)`
|
|
1336
1336
|
margin-bottom: 4px;
|
|
1337
1337
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1338
1338
|
`}
|
|
1339
|
-
`,ct=
|
|
1339
|
+
`,ct=ce.p`
|
|
1340
1340
|
color: ${({theme:e})=>e.colorText};
|
|
1341
1341
|
font-weight: normal;
|
|
1342
1342
|
font-size: 14px;
|
|
1343
1343
|
line-height: 22px;
|
|
1344
1344
|
margin: 0;
|
|
1345
|
-
`,
|
|
1345
|
+
`,Ds=ce.p`
|
|
1346
1346
|
color: ${({theme:e})=>e.colorText};
|
|
1347
1347
|
font-weight: 600;
|
|
1348
1348
|
font-size: 12px;
|
|
1349
1349
|
line-height: 16px;
|
|
1350
1350
|
margin: 0;
|
|
1351
|
-
`;ct.Loud=
|
|
1351
|
+
`;ct.Loud=ce(ct)`
|
|
1352
1352
|
font-weight: 600;
|
|
1353
|
-
`;ct.Quiet=
|
|
1353
|
+
`;ct.Quiet=ce(ct)`
|
|
1354
1354
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1355
1355
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1356
1356
|
`}
|
|
1357
|
-
`;var
|
|
1357
|
+
`;var $s=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Z(),{primaryCTAClickSideEffects:r}=le();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return qt.createElement(Bs,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&qt.createElement(Es,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&qt.createElement(Is,{className:a("carouselCompletedPill",o)},qt.createElement(Ds,{style:{color:"#108E0B"}},"Complete")),p&&qt.createElement(Ls,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&qt.createElement(ct.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var jd=()=>pe.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pe.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),pe.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),pe.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Ms=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=kt(!1),[n,s]=kt(!1);Nr(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?pe.createElement(ks,{style:c,reversed:n,onAnimationEnd:n?p:null},pe.createElement(Ps,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},pe.createElement(jd,null))):null},Us=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Hd(null),[n,s]=kt(!1),[p,c]=kt(!1),[l,g]=kt(null),[d,x]=kt([]),[T,S]=kt(0),{isSmall:b}=ys(),u=b?1:3,{getFlowMetadata:B,getFlowSteps:w,getNumberOfStepsCompleted:h,updateCustomVariables:N,isLoading:P}=J();Nr(()=>{N(o)},[o,P]),Nr(()=>{if(P)return;let O=B(e),A=h(e),D=w(e);g(O),O.data!==null&&(x(D.sort(($,V)=>Number($.complete)-Number(V.complete))),c(D.length>u),S(A))},[P]);let f=[];for(let O=0;O<d.length;O+=u)f.push(d.slice(O,O+u));let F=O=>{let A=O.target,D=A.scrollWidth-A.clientWidth,$=Math.ceil(A.scrollLeft);$>0&&n===!1&&s(!0),$===0&&n===!0&&s(!1),$<D&&p===!1&&c(!0),$===D&&p===!0&&c(!1)},C=(O=!0)=>{let A=O?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*A,behavior:"smooth"})},v=null,I=O=>{v!==null?clearTimeout(v):F(O),v=setTimeout(()=>{F(O)},16)};return P?null:pe.createElement(As,{className:Ce(a("carouselContainer",t),i)},pe.createElement("div",{style:{display:"flex",justifyContent:b?"center":"space-between",marginBottom:20,flexWrap:b?"wrap":"nowrap",gap:b?16:20}},pe.createElement("div",null,pe.createElement(Ns,{className:a("carouselTitle",t)},l==null?void 0:l.title),pe.createElement(ct.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),pe.createElement(Os,{className:a("progressWrapper",t)},pe.createElement(De,{count:T,total:d.length,appearance:t}))),pe.createElement("div",{style:{position:"relative"}},pe.createElement(Ms,{show:n,onClick:()=>C(!1)}),pe.createElement(Ms,{side:"right",show:p,onClick:C}),pe.createElement(Ts,{ref:r,onScroll:I},f.map((O,A)=>pe.createElement(Fs,{key:A,style:{flex:`0 0 calc(100% - ${d.length>u?36:0}px)`}},O.map((D,$)=>pe.createElement($s,{key:$,stepData:D,style:{flex:d.length>u?`0 1 calc(100% / ${u} - 16px * 2 / ${u})`:1},appearance:t})))))),pe.createElement(oe,{appearance:t}))};var Or=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:T,setVisible:S,customStepTypes:b,checklistStyle:u="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:w,...h})=>{let{getFlow:N,getFlowSteps:P,markStepCompleted:f,getStepStatus:F,getNumberOfStepsCompleted:C,isLoading:v,targetingLogicShouldHideFlow:I,updateCustomVariables:O,getFlowMetadata:A,isStepBlocked:D,getFlowStatus:$,hasActiveFullPageFlow:V,setHasActiveFullPageFlow:j}=J(),{primaryCTAClickSideEffects:Y,secondaryCTAClickSideEffects:de}=le(),{getOpenFlowState:he,setOpenFlowState:K}=Fe(),[te,Q]=Ws(r||0),[Se,me]=Ws(!1),Ee=c===void 0?he(e):c,re=s==="modal",{mergeAppearanceWithDefault:ne}=Z();if(x=ne(x),zs(()=>{O(l)},[l,v]),zs(()=>{c!==void 0&&(re&&c===!0?j(!0):re&&c===!1&&j(!1))},[c,S,V]),v)return null;let Te=N(e);if(!Te||I(Te))return null;let L=P(e);if(!L||T===!0&&$(e)===q)return null;let U=A(e);if(U!=null&&U.title&&(t=U.title),U!=null&&U.subtitle&&(o=U.subtitle),!Se&&r===void 0&&C(e)>0){let m=L.findIndex(y=>y.complete===!1);Q(m>-1?m:L.length-1),me(!0)}function _(){if(te+1>=L.length){re&&K(e,!1);return}D(e,L[te+1].id)||Q(te+1)}function X(m,y,E){let z=te+1<L.length?L[te+1]:null;d&&d(m,te,y,z)===!0&&re&&Ie(),g&&g(m,E,z),!g&&!d&&(m.primaryButtonUri||m.secondaryButtonUri)&&re&&Ie()}function H(){return L.map((m,y)=>({...m,handleSecondaryButtonClick:()=>{_(),de(m),m.skippable===!0&&f(e,m.id,{skipped:!0}),X(m,"secondary",y)},handlePrimaryButtonClick:()=>{(!m.completionCriteria&&(m.autoMarkCompleted||m.autoMarkCompleted===void 0)||m.completionCriteria&&m.autoMarkCompleted===!0)&&(f(e,m.id),_()),X(m,"primary",y),Y(m),F(e,m.id)===We&&_()}}))}function se(){return ge.createElement(oe,{appearance:x})}let Ae={steps:H(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:b,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:w};function Ie(){K(e,!1),p&&p(),S&&S(!1)}function Et(){return ge.createElement(ge.Fragment,null,ge.createElement(se,null),ge.createElement(Us,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return ge.createElement(ge.Fragment,null,ge.createElement(se,null),ge.createElement(Ir,{visible:Ee,onClose:()=>{Ie()},selectedStep:te,setSelectedStep:Q,autoExpandNextStep:!0,appearance:x,...Ae}))}function At(){let m=h.guideFlowId,y;return m&&N(m)&&(y=P(m)),ge.createElement(ge.Fragment,null,ge.createElement(se,null),ge.createElement(Ar,{visible:Ee,stepsTitle:U.stepsTitle?U.stepsTitle:"Your quick start guide",onClose:()=>{Ie()},selectedStep:te,setSelectedStep:Q,guideData:y,guideTitle:h.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:E=>{X(E,"link",0)},customStepTypes:b,...Ae}))}function gt(){let m=ge.createElement(Br,{flowId:e,style:i,selectedStep:te,setSelectedStep:Q,appearance:x,type:s,...Ae});return re?ge.createElement(Ve,{onClose:()=>{Ie()},visible:Ee,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ge.createElement(se,null),m):ge.createElement(ge.Fragment,null,ge.createElement(se,null),m)}switch(u){case"condensed":return ft();case"with-guide":return At();case"default":return gt();case"carousel":return Et();default:return gt()}};var Gd=e=>Vd.createElement(Or,{type:"inline",...e});import ut,{useEffect as Kd}from"react";import Ye from"react";import Ko from"styled-components";var _s=Ko.div`
|
|
1358
1358
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1359
1359
|
border-radius: 8px;
|
|
1360
1360
|
padding: 6px 10px 6px 10px;
|
|
1361
1361
|
min-width: 160px;
|
|
1362
1362
|
cursor: pointer;
|
|
1363
1363
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1364
|
-
`,
|
|
1364
|
+
`,Hs=Ko.div`
|
|
1365
1365
|
display: flex;
|
|
1366
1366
|
flex-direction: row;
|
|
1367
1367
|
justify-content: space-between;
|
|
1368
1368
|
align-items: center;
|
|
1369
1369
|
margin-bottom: 2px;
|
|
1370
1370
|
flex-grow: 2;
|
|
1371
|
-
`,
|
|
1371
|
+
`,js=Ko.div`
|
|
1372
1372
|
text-overflow: ellipsis;
|
|
1373
1373
|
font-weight: 600;
|
|
1374
1374
|
font-size: 12px;
|
|
@@ -1376,13 +1376,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1376
1376
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1377
1377
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1378
1378
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1379
|
-
`,
|
|
1379
|
+
`,Vs=Ko.div`
|
|
1380
1380
|
width: 20px;
|
|
1381
1381
|
margin-right: 8px;
|
|
1382
1382
|
display: flex;
|
|
1383
1383
|
height: 100%;
|
|
1384
1384
|
align-items: center;
|
|
1385
|
-
`;var
|
|
1385
|
+
`;var Gs=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ye.createElement(Ye.Fragment,null,Ye.createElement(oe,{appearance:s}),Ye.createElement(_s,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:Ce(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ye.createElement(Vs,{className:a("progressRingContainer",s)},Ye.createElement($t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ye.createElement(Hs,{type:p,className:a("badgeTitleContainer",s)},Ye.createElement(js,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Ye.createElement(Gt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ye.createElement(De,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import mt from"react";import ho from"styled-components";var Ks=ho.div`
|
|
1386
1386
|
display: flex;
|
|
1387
1387
|
flex-direction: row;
|
|
1388
1388
|
width: 100%;
|
|
@@ -1393,25 +1393,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1393
1393
|
border-width: 1px;
|
|
1394
1394
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1395
1395
|
border-radius: 12px;
|
|
1396
|
-
`,
|
|
1396
|
+
`,qs=ho.div`
|
|
1397
1397
|
${e=>k(e)} {
|
|
1398
1398
|
display: flex;
|
|
1399
1399
|
justify-content: center;
|
|
1400
1400
|
align-items: center;
|
|
1401
1401
|
margin-right: 16px;
|
|
1402
1402
|
}
|
|
1403
|
-
`,
|
|
1403
|
+
`,Ys=ho.div`
|
|
1404
1404
|
display: flex;
|
|
1405
1405
|
flex-direction: column;
|
|
1406
1406
|
flex: 1;
|
|
1407
1407
|
margin-top: 0;
|
|
1408
|
-
`,
|
|
1408
|
+
`,Xs=ho.div`
|
|
1409
1409
|
display: flex;
|
|
1410
1410
|
flex-direction: column;
|
|
1411
1411
|
justify-content: center;
|
|
1412
1412
|
margin-left: 16px;
|
|
1413
1413
|
min-width: 200px;
|
|
1414
|
-
`,
|
|
1414
|
+
`,Y0=ho.div`
|
|
1415
1415
|
display: flex;
|
|
1416
1416
|
justify-content: center;
|
|
1417
1417
|
align-items: flex-end;
|
|
@@ -1420,7 +1420,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1420
1420
|
:hover {
|
|
1421
1421
|
opacity: 0.8;
|
|
1422
1422
|
}
|
|
1423
|
-
`;var
|
|
1423
|
+
`;var Js=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>mt.createElement(mt.Fragment,null,mt.createElement(Ks,{appearance:i,className:Ce(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&mt.createElement(qs,{className:a("fullWidthProgressBadgeIcon",i)},o),mt.createElement(Ys,null,mt.createElement(Pe,{size:"small",appearance:i,title:e,subtitle:t})),mt.createElement(Xs,{className:a("fullWidthProgressBadgeProgressContainer",i)},mt.createElement(De,{count:r,total:n,display:"percent",textLocation:"top"}))));var qd=({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:T,getNumberOfStepsCompleted:S,isLoading:b,targetingLogicShouldHideFlow:u,updateCustomVariables:B}=J(),{mergeAppearanceWithDefault:w}=Z();l=w(l);let{setOpenFlowState:h,getOpenFlowState:N}=Fe();if(Kd(()=>{B(p)},[p,b]),b)return null;let P=d(e);if(!P||u(P)||c===!0&&T(e)===q)return null;let f=x(e),F=S(e);return g==="full-width"?ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:l}),ut.createElement(Js,{title:t,subtitle:o,count:F,total:f.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:l}),ut.createElement(Gs,{count:F,total:f.length,title:t,style:r,onClick:()=>{h(e,!0),n&&n()},type:g,className:s,appearance:l}))};import Yd from"react";var Xd=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=J(),{mergeAppearanceWithDefault:p}=Z();o=p(o);let c=r(e);if(!c||n(c))return null;let l=s(e);return Yd.createElement(xo,{steps:l,style:t,appearance:o,...i})};import Pt,{useContext as ac,useEffect as pc}from"react";import W,{useEffect as qo,useLayoutEffect as Rs,useRef as tc,useState as Yt}from"react";import Co from"styled-components";import{useCallback as Jd,useEffect as Qd,useState as Zd}from"react";var Lr=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function Qs(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]=Zd(o),n=Jd(()=>{e&&r(e.getBoundingClientRect())},[e]);return Qd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}import{useContext as Rd,useState as ec}from"react";function Zs(){let{debug:e}=Rd(G),[t,o]=ec([]);function i(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.log(n)))}function r(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.warn(n)))}return{logIfDebugMode:i,logErrorIfDebugMode:r}}var el=300,tl=100,oc=500,Xt=12,rc=Co.div`
|
|
1424
1424
|
width: 100%;
|
|
1425
1425
|
height: 100%;
|
|
1426
1426
|
border-radius: 9999px;
|
|
@@ -1452,16 +1452,16 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1452
1452
|
opacity: 1;
|
|
1453
1453
|
`,nc=Co.div`
|
|
1454
1454
|
pointer-events: all;
|
|
1455
|
-
`,
|
|
1455
|
+
`,ol=Co.div`
|
|
1456
1456
|
display: flex;
|
|
1457
1457
|
align-content: center;
|
|
1458
1458
|
justify-content: center;
|
|
1459
1459
|
align-items: center;
|
|
1460
1460
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1461
|
-
`,sc=Co(
|
|
1461
|
+
`,sc=Co(ol)`
|
|
1462
1462
|
width: ${Xt+12}px;
|
|
1463
1463
|
height: ${Xt+12}px;
|
|
1464
|
-
`,lc=({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:T,showStepCount:
|
|
1464
|
+
`,lc=({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:T,showStepCount:S=!0,completedStepsCount:b=0,showFrigadeBranding:u=!1,cssPosition:B="absolute"})=>{var Ie,Et,ft,At,gt,m,y,E,z,ue,Qt,jr;let{logErrorIfDebugMode:w}=Zs(),[h,N]=Yt(),[P,f]=Yt(new Date),F=tc(null),[C,v]=Yt(document.querySelector(e[l].selector)),I=Qs(C,P),[O,A]=Yt(),[D,$]=Yt(!T),V=(Et=(Ie=e[l])==null?void 0:Ie.props)!=null&&Et.position?e[l].props.position:B,j=((At=(ft=e[l])==null?void 0:ft.props)==null?void 0:At.zIndex)??90,Y=(h==null?void 0:h.width)??el,de=(h==null?void 0:h.height)??tl,[he,K]=Yt(new Date().getTime()),te=window.location.pathname.split("/").pop();Rs(()=>{F.current&&N({width:F.current.clientWidth,height:F.current.clientHeight})},[l,P,V]),qo(()=>{T||$(!0)},[l]);let Q=()=>{let ie=document.querySelector(e[l].selector);if(!ie){A(void 0),v(null),w(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}O&&O===JSON.stringify(ie==null?void 0:ie.getBoundingClientRect())||(v(ie),f(new Date),ie&&A(JSON.stringify(ie.getBoundingClientRect())))};if(qo(()=>{let ie=new MutationObserver(Q);return ie.observe(document.body,{subtree:!0,childList:!0}),()=>ie.disconnect()},[Q]),qo(()=>{let ie=new MutationObserver(Q);return ie.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>ie.disconnect()},[Q]),qo(()=>{let ie=setInterval(()=>{Q()},10);return()=>clearInterval(ie)},[Q]),Rs(()=>{setTimeout(()=>{Q()},oc),Q()},[l,te]),C===null||!p||I.height===0&&I.width===0&&V!=="fixed"&&B!=="static")return null;let Se=i==="auto"?"right":i,me=Lr(I,Se,Y,s,V),Ee=I.right+Y>(window.innerWidth||document.documentElement.clientWidth),re=I.bottom+tl>(window.innerHeight||document.documentElement.clientHeight);Ee&&i==="auto"&&(me=Lr(I,"left",Y,s,V),Se="left"),(m=(gt=e[l])==null?void 0:gt.props)!=null&&m.tooltipPosition&&((E=(y=e[l])==null?void 0:y.props)==null?void 0:E.tooltipPosition)!=="auto"&&(((ue=(z=e[l])==null?void 0:z.props)==null?void 0:ue.tooltipPosition)==="left"||((jr=(Qt=e[l])==null?void 0:Qt.props)==null?void 0:jr.tooltipPosition)==="right")&&(Se=e[l].props.tooltipPosition);let ne=()=>{let ie=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{Q()},30)),b===e.length-1)return o()},st=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),T&&!e[l].secondaryButtonUri&&$(!1))};return W.createElement(W.Fragment,null,S&&e.length>1&&W.createElement(oi,null,W.createElement(ii,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&W.createElement(ri,{showStepCount:S,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&W.createElement(R,{title:e[l].secondaryButtonTitle,appearance:d,onClick:st,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&W.createElement(R,{title:e[l].primaryButtonTitle,appearance:d,onClick:ie,withMargin:!1,size:"small"})))},Te=()=>W.createElement(W.Fragment,null,x&&W.createElement(Qr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},W.createElement(ke,null)),e[l].imageUri&&W.createElement(Zr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&W.createElement(Rr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},W.createElement(Ke,{appearance:d,videoUri:e[l].videoUri})),W.createElement(ti,{className:a("tooltipContentContainer",d)},W.createElement(Pe,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),W.createElement(ei,{className:a("tooltipFooter",d)},W.createElement(ne,null)))),U={...{default:ie=>{var st;if((st=e[l])!=null&&st.StepContent){let Wl=e[l].StepContent;return W.createElement("div",null,Wl)}return W.createElement(Te,null)}},...g},_=()=>{var ie;return e?!((ie=e[l])!=null&&ie.type)||!U[e[l].type]?U.default(e[l]):U[e[l].type]({stepData:e[l],primaryColor:n}):W.createElement(W.Fragment,null)};if(e[l].complete===!0||me.x==0&&me.y==0&&new Date().getTime()-he<100)return null;let X={top:(me==null?void 0:me.y)-Xt,left:(Se=="left"?I.x+s.x:(me==null?void 0:me.x)-Xt)??0,cursor:T?"pointer":"default",position:V},H=()=>{let st=X.left+(Se=="left"?-Y:24);return Math.min(Math.max(st,20),window.innerWidth-Y-20)},se=()=>{if(V==="fixed")return X.top;let ie=X.top+de,st=20;return ie>window.innerHeight-st?X.top+-de:X.top},Ae=()=>{T&&(f(new Date),$(!D))};return W.createElement(nc,null,W.createElement(sc,{style:X,zIndex:j,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&B!=="static"&&W.createElement(W.Fragment,null,W.createElement(ic,{style:{position:V},onClick:Ae,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),W.createElement(rc,{style:{position:"absolute"},onClick:Ae,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),W.createElement(ol,{style:{...X,left:H(),top:se()},zIndex:j+1,className:a("tooltipContainerWrapper",d)},D&&W.createElement(W.Fragment,null,W.createElement(wo,{ref:F,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:B!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:el,zIndex:j+10},W.createElement(_,null)),u&&W.createElement(si,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:j+10},W.createElement(To,{appearance:d})))))},Dr=lc;import{Portal as dc}from"react-portal";var cc=({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:T="absolute",...S})=>{let{getFlow:b,getFlowSteps:u,isLoading:B,targetingLogicShouldHideFlow:w,markStepCompleted:h,markStepStarted:N,markFlowCompleted:P,updateCustomVariables:f,getCurrentStepIndex:F,getStepStatus:C,isStepBlocked:v,getFlowStatus:I,getNumberOfStepsCompleted:O}=J(),{isLoadingUserFlowStateData:A}=Oe(),{primaryCTAClickSideEffects:D,secondaryCTAClickSideEffects:$}=le(),{hasOpenModals:V}=Fe(),j=F(e),{openFlowStates:Y}=ac(G),{mergeAppearanceWithDefault:de}=Z();if(o=de(o),pc(()=>{f(t)},[t,B]),A)return null;let he=b(e);if(!he||w(he)||I(e)==q||V())return null;let K=u(e);if(Object.keys(Y).length>0){let L=Object.keys(Y).find(U=>Y[U]===!0);if(L!==void 0&&L!==e)return Pt.createElement(Pt.Fragment,null)}async function te(L){if(await h(e,L.id),K.map(U=>C(e,U.id)).every(U=>U===We)){await P(e);return}if(!l&&j+1<K.length&&!n){if(v(e,K[j+1].id))return;await N(e,K[j+1].id)}}function Q(L,U,_){let X=j+1<K.length?K[j+1]:null;r&&r(L,j,U,X),i&&i(L,_,X)}function Se(){return K.map(L=>({...L,handleSecondaryButtonClick:async()=>{$(L),L.skippable===!0&&await h(e,L.id,{skipped:!0}),Q(L,"secondary",j)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await te(L),Q(L,"primary",j),D(L)}}))}async function me(L){s&&s(),g==="complete-flow"?await P(e):await h(e,L.id)}function Ee(){d&&d()}let re=!document.querySelector(K[j].selector);function ne(){let L=K.findIndex(U=>!!document.querySelector(U.selector));return K.map((U,_)=>re&&!n&&_!==L&&x||!n&&_!==j?null:Pt.createElement(Dr,{key:U.id,appearance:o,steps:Se(),selectedStep:_,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>me(U),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:O(e),onComplete:Ee,cssPosition:T,...S}))}function Te(){return Pt.createElement(Pt.Fragment,null,Pt.createElement(oe,{appearance:o}),ne())}return T==="static"?Te():Pt.createElement(dc,null,Te())};import Me,{useEffect as mc,useRef as uc,useState as fc}from"react";import{Portal as gc}from"react-portal";import vt from"styled-components";var rl=vt.button`
|
|
1465
1465
|
${e=>k(e)} {
|
|
1466
1466
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1467
1467
|
|
|
@@ -1479,17 +1479,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1479
1479
|
opacity: 0.8;
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
|
-
`,
|
|
1482
|
+
`,il=vt.span`
|
|
1483
1483
|
${e=>k(e)} {
|
|
1484
1484
|
font-size: 12px;
|
|
1485
1485
|
display: inline-block;
|
|
1486
1486
|
}
|
|
1487
|
-
`,
|
|
1487
|
+
`,nl=vt.span`
|
|
1488
1488
|
${e=>k(e)} {
|
|
1489
1489
|
font-size: 12px;
|
|
1490
1490
|
display: inline-block;
|
|
1491
1491
|
}
|
|
1492
|
-
`,
|
|
1492
|
+
`,sl=vt.div`
|
|
1493
1493
|
position: fixed;
|
|
1494
1494
|
right: 0;
|
|
1495
1495
|
bottom: 0;
|
|
@@ -1499,7 +1499,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1499
1499
|
flex-direction: column;
|
|
1500
1500
|
align-items: flex-end;
|
|
1501
1501
|
z-index: 50;
|
|
1502
|
-
`,
|
|
1502
|
+
`,ll=vt.button`
|
|
1503
1503
|
${e=>k(e)} {
|
|
1504
1504
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1505
1505
|
background-color: #ffffff;
|
|
@@ -1515,7 +1515,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1515
1515
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1516
1516
|
border-radius: 45px;
|
|
1517
1517
|
cursor: pointer;
|
|
1518
|
-
`,
|
|
1518
|
+
`,al=vt.div`
|
|
1519
1519
|
${e=>k(e)} {
|
|
1520
1520
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1521
1521
|
background: #ffffff;
|
|
@@ -1532,7 +1532,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1532
1532
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1533
1533
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1534
1534
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1535
|
-
`,
|
|
1535
|
+
`,pl=vt.button`
|
|
1536
1536
|
${e=>k(e)} {
|
|
1537
1537
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1538
1538
|
color: #434343;
|
|
@@ -1549,7 +1549,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1549
1549
|
font-size: 14px;
|
|
1550
1550
|
|
|
1551
1551
|
padding: 8px 12px;
|
|
1552
|
-
`;import
|
|
1552
|
+
`;import dl from"react";var cl=({style:e,className:t})=>dl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},dl.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 ml from"react";var ul=({style:e,className:t})=>ml.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"},ml.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 xc=({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:T}=J(),{primaryCTAClickSideEffects:S}=le(),b=uc(null),[u,B]=fc(!1),{mergeAppearanceWithDefault:w}=Z();s=w(s),mc(()=>(document.addEventListener("click",h,!1),()=>{document.removeEventListener("click",h,!1)}),[]);let h=C=>{b.current&&!b.current.contains(C.target)&&B(!1)};if(x)return null;let N=p(e);if(!N||T(N))return null;let P=c(e);if(!P||!i)return null;function f(C,v){!C.completionCriteria&&(C.autoMarkCompleted||C.autoMarkCompleted===void 0)&&l(e,C.id),S(C),o&&o(C,v),B(!1)}function F(){return u&&Me.createElement(al,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},P.map((C,v)=>Me.createElement(pl,{className:a("floatingWidgetMenuItem",s),key:v,onClick:()=>f(C,v)},C.title)))}return r=="inline"?Me.createElement("span",{ref:b},Me.createElement(rl,{style:t,onClick:()=>{B(!u)},className:a("supportButton",s)},Me.createElement(nl,{className:a("supportIconContainer",s)},Me.createElement(ul,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Me.createElement(il,{className:a("supportButtonTitle",s)},n)),Me.createElement(F,null)):Me.createElement(gc,null,Me.createElement(sl,{style:t,ref:b},Me.createElement(F,null),Me.createElement(ll,{onClick:()=>{B(!u)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Me.createElement(cl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Xe,{useEffect as hc}from"react";import Yo from"styled-components";var fl=Yo.div`
|
|
1553
1553
|
${e=>k(e)} {
|
|
1554
1554
|
display: flex;
|
|
1555
1555
|
flex-direction: column;
|
|
@@ -1564,17 +1564,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1564
1564
|
border-radius: 12px;
|
|
1565
1565
|
position: relative;
|
|
1566
1566
|
}
|
|
1567
|
-
`,
|
|
1567
|
+
`,gl=Yo.div`
|
|
1568
1568
|
display: flex;
|
|
1569
1569
|
flex-direction: column;
|
|
1570
1570
|
flex: 1;
|
|
1571
|
-
`,
|
|
1571
|
+
`,xl=Yo.div`
|
|
1572
1572
|
display: flex;
|
|
1573
1573
|
flex-direction: column;
|
|
1574
1574
|
justify-content: center;
|
|
1575
1575
|
align-items: flex-start;
|
|
1576
1576
|
margin-top: 16px;
|
|
1577
|
-
`,
|
|
1577
|
+
`,hl=Yo.div`
|
|
1578
1578
|
${e=>k(e)} {
|
|
1579
1579
|
position: absolute;
|
|
1580
1580
|
top: 16px;
|
|
@@ -1585,7 +1585,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1585
1585
|
opacity: 0.8;
|
|
1586
1586
|
}
|
|
1587
1587
|
}
|
|
1588
|
-
`;var Cc=({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:T,getFlowSteps:
|
|
1588
|
+
`;var Cc=({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:T,getFlowSteps:S,getFlowStatus:b,getCurrentStepIndex:u}=J(),{primaryCTAClickSideEffects:B}=le(),{mergeAppearanceWithDefault:w}=Z();if(r=w(r),hc(()=>{T(o)},[o,d]),d)return null;let h=c(e);if(!h||x(h)||b(e)===q)return null;let P=S(e)[u(e)];return Xe.createElement(Xe.Fragment,null,Xe.createElement(oe,{appearance:r}),Xe.createElement(fl,{appearance:r,className:Ce(a("embeddedTipContainer",r),n),style:s},(p===!0||P.dismissible)&&Xe.createElement(hl,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},Xe.createElement(ke,null)),Xe.createElement(gl,null,Xe.createElement(Pe,{size:"small",appearance:r,title:P.title,subtitle:P.subtitle})),P.primaryButtonTitle&&Xe.createElement(xl,{className:a("embeddedTipCallToActionContainer",r)},Xe.createElement(R,{classPrefix:"embeddedTip",title:P.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{P.handlePrimaryButtonClick(),B(P),!(i&&i(P,u(e),"primary")===!1)&&(await g(e,P.id),await l(e))}}))))};import be,{useEffect as yc}from"react";import Jt from"styled-components";var Cl=Jt.div`
|
|
1589
1589
|
// use the :not annotation
|
|
1590
1590
|
${e=>k(e)} {
|
|
1591
1591
|
display: flex;
|
|
@@ -1597,19 +1597,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1597
1597
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1598
1598
|
border-radius: 12px;
|
|
1599
1599
|
}
|
|
1600
|
-
`,
|
|
1600
|
+
`,yl=Jt.div`
|
|
1601
1601
|
${e=>k(e)} {
|
|
1602
1602
|
display: flex;
|
|
1603
1603
|
width: 46px;
|
|
1604
1604
|
height: 46px;
|
|
1605
1605
|
}
|
|
1606
|
-
`,
|
|
1606
|
+
`,Sl=Jt.div`
|
|
1607
1607
|
display: flex;
|
|
1608
1608
|
flex-direction: column;
|
|
1609
1609
|
flex: 1;
|
|
1610
1610
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1611
1611
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1612
|
-
`,
|
|
1612
|
+
`,bl=Jt.div`
|
|
1613
1613
|
display: flex;
|
|
1614
1614
|
flex-direction: column;
|
|
1615
1615
|
justify-content: center;
|
|
@@ -1627,7 +1627,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1627
1627
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1628
1628
|
align-items: flex-end;
|
|
1629
1629
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1630
|
-
`;import Ur from"react";var
|
|
1630
|
+
`;import Ur from"react";var wl=({style:e,className:t})=>Ur.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Ur.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Ur.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var Sc=({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:T,getFlowMetadata:S,getFlowStatus:b,getFlowSteps:u,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:w}=le(),{mergeAppearanceWithDefault:h}=Z();if(s=h(s),yc(()=>{T(r)},[r,d]),d)return null;let N=l(e);if(!N||x(N)||b(e)===q)return null;let P=u(e),f=P.length>0?P[B(e)]:S(e);return f!=null&&f.title&&(t=f.title),f!=null&&f.subtitle&&(o=f.subtitle),be.createElement(be.Fragment,null,be.createElement(oe,{appearance:s}),be.createElement(Cl,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&be.createElement(yl,{className:a("bannerIconContainer",s)},c||be.createElement(wl,null)),p==="square"&&f.dismissible&&be.createElement(Mr,{type:p,className:a("bannerDismissButtonContainer",s)},be.createElement($r,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},be.createElement(ke,null))),be.createElement(Sl,{type:p},be.createElement(Pe,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(f==null?void 0:f.primaryButtonTitle)&&be.createElement(bl,{type:p,className:a("bannerCallToActionContainer",s)},be.createElement(R,{title:f==null?void 0:f.primaryButtonTitle,appearance:s,onClick:()=>{w(f),n&&n(f,0,"primary")},classPrefix:"banner"})),p!=="square"&&f.dismissible&&be.createElement(Mr,{type:p,className:a("bannerDismissButtonContainer",s)},be.createElement($r,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},be.createElement(ke,null)))))};import ee,{useEffect as bc}from"react";import{Portal as wc}from"react-portal";import nt from"styled-components";var Tl=nt.div`
|
|
1631
1631
|
display: flex;
|
|
1632
1632
|
flex-direction: column;
|
|
1633
1633
|
width: 100%;
|
|
@@ -1646,7 +1646,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1646
1646
|
z-index: 1000;
|
|
1647
1647
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1648
1648
|
min-width: 550px;
|
|
1649
|
-
`,
|
|
1649
|
+
`,Fl=nt.button`
|
|
1650
1650
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1651
1651
|
border-radius: 8px;
|
|
1652
1652
|
// If selected make border color primary and text color color priamry
|
|
@@ -1667,33 +1667,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1667
1667
|
display: flex;
|
|
1668
1668
|
justify-content: center;
|
|
1669
1669
|
align-items: center;
|
|
1670
|
-
`,zr=
|
|
1670
|
+
`,zr=nt.div`
|
|
1671
1671
|
display: flex;
|
|
1672
1672
|
justify-content: space-between;
|
|
1673
1673
|
margin-top: 16px;
|
|
1674
1674
|
gap: 8px;
|
|
1675
|
-
`,
|
|
1675
|
+
`,kl=nt.div`
|
|
1676
1676
|
display: flex;
|
|
1677
1677
|
justify-content: space-between;
|
|
1678
1678
|
margin-top: 8px;
|
|
1679
|
-
`,Wr=
|
|
1679
|
+
`,Wr=nt.div`
|
|
1680
1680
|
font-size: 12px;
|
|
1681
1681
|
line-height: 18px;
|
|
1682
1682
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1683
1683
|
font-style: normal;
|
|
1684
1684
|
font-weight: 400;
|
|
1685
1685
|
letter-spacing: 0.24px;
|
|
1686
|
-
`,_r=
|
|
1686
|
+
`,_r=nt.div`
|
|
1687
1687
|
display: flex;
|
|
1688
1688
|
flex-direction: column;
|
|
1689
1689
|
flex: 1;
|
|
1690
|
-
`,
|
|
1690
|
+
`,a1=nt.div`
|
|
1691
1691
|
display: flex;
|
|
1692
1692
|
flex-direction: column;
|
|
1693
1693
|
justify-content: center;
|
|
1694
1694
|
align-items: flex-start;
|
|
1695
1695
|
margin-top: 16px;
|
|
1696
|
-
`,
|
|
1696
|
+
`,Pl=nt.textarea`
|
|
1697
1697
|
${e=>k(e)} {
|
|
1698
1698
|
margin-top: 16px;
|
|
1699
1699
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1704,7 +1704,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1704
1704
|
width: 100%;
|
|
1705
1705
|
height: 100px;
|
|
1706
1706
|
}
|
|
1707
|
-
`,
|
|
1707
|
+
`,vl=nt.div`
|
|
1708
1708
|
${e=>k(e)} {
|
|
1709
1709
|
position: absolute;
|
|
1710
1710
|
top: 16px;
|
|
@@ -1715,7 +1715,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1715
1715
|
opacity: 0.8;
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
`;var Tc=({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:T,updateCustomVariables:
|
|
1718
|
+
`;var Tc=({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:T,updateCustomVariables:S,getFlowSteps:b,getFlowStatus:u,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:w}=le(),{mergeAppearanceWithDefault:h}=Z(),[N,P]=ee.useState(null),[f,F]=ee.useState(""),{hasOpenModals:C,setKeepCompletedFlowOpenDuringSession:v,shouldKeepCompletedFlowOpenDuringSession:I}=Fe();if(r=h(r),bc(()=>{S(o)},[o,x]),x)return null;let O=c(e);if(!O||T(O)||u(e)===q||d(e)===1&&!I(e)||C())return null;let D=b(e)[d(e)];function $(){return ee.createElement(ee.Fragment,null,ee.createElement(_r,null,ee.createElement(Pe,{size:"large",appearance:r,title:D.title,subtitle:D.subtitle})),ee.createElement(zr,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(Y=>ee.createElement(Fl,{className:a("npsNumberButton",r),selected:N===Y+1,key:Y,onClick:async()=>{v(e),P(Y+1),await g(e,D.id,{score:Y+1})},appearance:r},Y+1))),ee.createElement(kl,{appearance:r},ee.createElement(Wr,{appearance:r},"Not likely at all"),ee.createElement(Wr,{appearance:r},"Extremely likely")))}function V(){return ee.createElement(ee.Fragment,null,ee.createElement(_r,null,ee.createElement(Pe,{appearance:r,title:D.title??"Why did you choose this score?",size:"large"})),ee.createElement(Pl,{appearance:r,value:f,onChange:Y=>{F(Y.target.value)},placeHolder:"Add your optional fedback here..."}),ee.createElement(zr,{appearance:r,className:a("npsNumberButtonContainer",r)},ee.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await l(e),i&&i(D,1,"primary")},appearance:r,title:D.secondaryButtonTitle||"Skip",secondary:!0}),ee.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await g(e,D.id,{feedbackText:f}),await l(e),i&&i(D,1,"primary")},appearance:r,title:D.primaryButtonTitle||"Submit"})))}function j(){return d(e)>=2?null:ee.createElement(ee.Fragment,null,ee.createElement(oe,{appearance:r}),ee.createElement(Tl,{appearance:r,className:Ce(a("npsSurveyContainer",r),n),style:s,type:p},ee.createElement(vl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},ee.createElement(ke,null)),d(e)==0&&$(),d(e)==1&&V()))}return p==="inline"?j():ee.createElement(wc,null,j())};import we,{useEffect as Pc}from"react";import Bt from"styled-components";var Bl=Bt.div`
|
|
1719
1719
|
${e=>k(e)} {
|
|
1720
1720
|
display: flex;
|
|
1721
1721
|
flex-direction: column;
|
|
@@ -1726,21 +1726,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1726
1726
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1727
1727
|
position: relative;
|
|
1728
1728
|
}
|
|
1729
|
-
`,
|
|
1729
|
+
`,El=Bt.div`
|
|
1730
1730
|
display: flex;
|
|
1731
1731
|
flex-direction: column;
|
|
1732
1732
|
flex: 1;
|
|
1733
|
-
`,
|
|
1733
|
+
`,Al=Bt.div`
|
|
1734
1734
|
display: flex;
|
|
1735
1735
|
flex-direction: row;
|
|
1736
1736
|
justify-content: center;
|
|
1737
1737
|
align-items: stretch;
|
|
1738
1738
|
gap: 16px;
|
|
1739
1739
|
margin-top: 8px;
|
|
1740
|
-
`,
|
|
1740
|
+
`,Il=Bt.div`
|
|
1741
1741
|
margin-top: 16px;
|
|
1742
1742
|
margin-bottom: 16px;
|
|
1743
|
-
`,
|
|
1743
|
+
`,Nl=Bt.div`
|
|
1744
1744
|
${e=>k(e)} {
|
|
1745
1745
|
position: absolute;
|
|
1746
1746
|
top: -16px;
|
|
@@ -1751,7 +1751,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1751
1751
|
opacity: 0.8;
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
1754
|
-
`,
|
|
1754
|
+
`,Ol=Bt.h1`
|
|
1755
1755
|
${e=>k(e)} {
|
|
1756
1756
|
font-style: normal;
|
|
1757
1757
|
justify-content: center;
|
|
@@ -1765,7 +1765,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1765
1765
|
color: ${e=>e.appearance.theme.colorText};
|
|
1766
1766
|
margin-bottom: 8px;
|
|
1767
1767
|
}
|
|
1768
|
-
`,
|
|
1768
|
+
`,Ll=Bt.h2`
|
|
1769
1769
|
${e=>k(e)} {
|
|
1770
1770
|
font-style: normal;
|
|
1771
1771
|
justify-content: center;
|
|
@@ -1777,10 +1777,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${eo}${t}.${eo}${t} { ${Object.entries(o).map
|
|
|
1777
1777
|
letter-spacing: 0.28px;
|
|
1778
1778
|
margin-bottom: 8px;
|
|
1779
1779
|
}
|
|
1780
|
-
`;import
|
|
1780
|
+
`;import Dl from"react";import Fc from"styled-components";var kc=Fc.img`
|
|
1781
1781
|
width: 100%;
|
|
1782
1782
|
height: 100%;
|
|
1783
1783
|
min-height: 200px;
|
|
1784
1784
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1785
|
-
`;function
|
|
1785
|
+
`;function $l({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Dl.createElement(Ke,{appearance:t,videoUri:e.videoUri}):e.imageUri?Dl.createElement(kc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var vc=({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:T,updateCustomVariables:S,getFlowSteps:b,getFlowStatus:u,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:w,secondaryCTAClickSideEffects:h}=le(),{mergeAppearanceWithDefault:N}=Z(),{setOpenFlowState:P,getOpenFlowState:f,hasOpenModals:F}=Fe(),[C,v]=[f(e,!0),j=>P(e,j)];if(r=N(r),Pc(()=>{S(o)},[o,x]),x)return null;let I=l(e);if(!I||T(I)||u(e)===q||F())return null;let A=b(e)[B(e)],D=()=>{v(!1),t&&t(),g(e)};function $(){return we.createElement(we.Fragment,null,we.createElement(oe,{appearance:r}),we.createElement(Bl,{appearance:r,className:Ce(a("announcementContainer",r),n),style:s},(p===!0||A.dismissible)&&c=="inline"&&we.createElement(Nl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},we.createElement(ke,null)),we.createElement(El,null,we.createElement(Ol,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:ae(A.title)}),A.subtitle&&we.createElement(Ll,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:ae(A.subtitle)})),(A.imageUri||A.videoUri)&&we.createElement(Il,{className:a("announcementMediaContainer",r)},we.createElement($l,{appearance:r,stepData:A})),(A.primaryButtonTitle||A.secondaryButtonTitle)&&we.createElement(Al,{className:a("announcementCTAContainer",r)},A.secondaryButtonTitle&&we.createElement(R,{classPrefix:"announcement",title:A.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{A.handleSecondaryButtonClick(),h(A),i&&i(A,B(e),"secondary")},secondary:!0}),A.primaryButtonTitle&&we.createElement(R,{classPrefix:"announcement",title:A.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{A.handlePrimaryButtonClick(),w(A),!(i&&i(A,B(e),"primary")===!1)&&(await d(e,A.id),await g(e))}}))))}let V={padding:"24px",maxWidth:"400px"};return c==="inline"?$():c!=="center"?we.createElement(Po,{modalPosition:c,onClose:D,visible:C,dismissible:p,appearance:r},$()):we.createElement(Ve,{appearance:r,onClose:D,visible:C,style:V,dismissible:p},$())};import*as Xo from"react";import Ml from"react";var Ul=({as:e="span",children:t,variant:o="Body1",...i})=>Ml.createElement(ln,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),Bc=Object.fromEntries(Object.keys(Uo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Ml.createElement(Ul,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Hr=Object.assign(Ul,Bc);var zl=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return Xo.createElement(sn,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},Xo.createElement(Hr,{color:(s=uo[r])==null?void 0:s.color,fontWeight:"semibold"},i))},Ec=Object.fromEntries(Object.keys(uo).map(e=>{let t=o=>Xo.createElement(zl,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),Ac=Object.assign(zl,Ec);export{mo as Box,Ac as Button,Ze as CheckBox,Ro as FlowType,at as FormLabel,cr as FormTextField,vc as FrigadeAnnouncement,Sc as FrigadeBanner,Or as FrigadeChecklist,Qe as FrigadeDefaultAppearance,Cc as FrigadeEmbeddedTip,Qi as FrigadeForm,Xd as FrigadeGuide,Gd as FrigadeHeroChecklist,Tc as FrigadeNPSSurvey,qd as FrigadeProgressBadge,td as FrigadeProvider,xc as FrigadeSupportWidget,cc as FrigadeTour,De as ProgressBar,$t as ProgressRing,Hr as Text,Fr as tokens,Fe as useFlowOpens,Rt as useFlowResponses,J as useFlows,Tr as useOrganization,eo as useUser,Oe as useUserFlowStates};
|
|
1786
1786
|
//# sourceMappingURL=index.mjs.map
|