@frigade/react 1.37.21 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -5
- package/dist/index.js +215 -207
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +298 -290
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Do=Object.getOwnPropertySymbols;var ai=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable;var li=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))ai.call(t,o)&&li(e,o,t[o]);if(Do)for(var o of Do(t))pi.call(t,o)&&li(e,o,t[o]);return e},V=(e,t)=>sa(e,la(t));var di=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)ai.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Do)for(var i of Do(e))t.indexOf(i)<0&&pi.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{a(o.next(d))}catch(l){n(l)}},s=d=>{try{a(o.throw(d))}catch(l){n(l)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);a((o=o.apply(e,t)).next())});import Ao,{createContext as Td,useEffect as nr,useState as je}from"react";import{ThemeProvider as An}from"styled-components";import $t,{useContext as Zp,useEffect as eo,useState as Po}from"react";import{useCallback as At,useContext as Sa,useEffect as ba}from"react";import Cr,{useMemo as mi}from"react";var ci="1.37.21";var nt="NOT_STARTED_STEP",ie="COMPLETED_FLOW",Uo="SKIPPED_FLOW",Et="STARTED_FLOW",De="NOT_STARTED_FLOW",$e="COMPLETED_STEP",ho="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=Cr.useContext(Z);return{config:mi(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ci,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:mi(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Gt(){let{shouldGracefullyDegrade:e,readonly:t}=Cr.useContext(Z);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return jt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),jt();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let a=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(a&&d&&d==i.body){let l=new Date(a);if(new Date().getTime()-l.getTime()<1e3)return jt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(a){return jt(a)}return s?s.ok?s:jt(s.statusText):jt()})}function jt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Kt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Cr.useContext(Z);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as ui}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(Z);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function s(c,g){t(y=>V(b({},y),{[c]:g}))}function a(c){t(g=>{let x=g,{[c]:y}=x,v=Le(x,[di(c)]);return b({},v)})}function d(c){n.includes(c)||i(g=>[...g,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:a,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ga from"swr/immutable";import xo from"core-js-pure/actual/structured-clone";function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!yr(t)||!yr(o))throw new Error("deepmerge can only merge Objects");let i=xo(t);return Object.entries(o).forEach(([n,r])=>{yr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],xo(r))}):Object.assign(i,{[n]:xo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...xo(r)]}):Object.assign(i,{[n]:xo(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function Ue(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:a}=ca(Z),{resetOpenFlowState:d}=Ee(),[l,m]=ua(!1),c={data:r.map(w=>({flowId:w.id,flowState:ie,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=w=>fetch(w,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${w}: ${k}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:v,isLoading:x,mutate:C,error:F}=a?ga(y,g):fa(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=v==null?void 0:v.data;ma(()=>{!l&&!x&&S&&m(!0)},[S,l,x]);function P(w){return D(this,null,function*(){if(S&&!a){let k=S.find(I=>I.flowId===w);k&&k.flowState!==ie&&(k.flowState=ie),yield C(Promise.resolve(Ce(v,{data:S})),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function $(w,k,I){return D(this,null,function*(){if(S){let N=S.find(O=>O.flowId===w);N&&(N.stepStates[k]=I,N.flowState=Et),yield C(Promise.resolve(Ce(v,{data:S})),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function B(w,k,I){return D(this,null,function*(){if(S){let N=S.find(O=>O.flowId===w);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=Et),yield C(Ce(v,{data:S}),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function u(w){return D(this,null,function*(){if(S){let k=S.find(I=>I.flowId===w);k&&k.flowState!==De&&(k.flowState=De,k.lastStepId=ha,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield C(Ce(v,{data:S}),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1}),d(w))}})}function A(w,k,I){return D(this,null,function*(){if(S){let N=S.find(O=>O.flowId===w);N&&(N.stepStates[k]=I),yield C(Promise.resolve(Ce(v,{data:S})),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:S,isLoadingUserFlowStateData:!l,mutateUserFlowState:C,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:B,error:F}}function Co(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=Ue(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:a}=xa(Z),[d,l]=ui(new Set),[m,c]=ui(new Set),g=Gt();function y(C){let F=JSON.stringify(C);if(d.has(F))return null;d.add(F),l(d),m.add(C),c(m);let S=s==null?void 0:s.find(P=>P.flowSlug===C.flowSlug&&P.stepId===C.stepId&&P.actionType===C.actionType&&P.createdAt===C.createdAt);return g(`${t}flowResponses`,V(b({},e),{method:"POST",body:F})).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+C.stepId+". Will retry again later."),r([...n,C])):S||a($=>[...$!=null?$:[],C])})}function v(C){return D(this,null,function*(){C.foreignUserId&&(C.actionType===Et||C.actionType===De?yield y(C):C.actionType===ie?yield y(C):C.actionType===ho?yield y(C):C.actionType===$e?yield y(C):C.actionType===Uo?yield y(C):C.actionType===nt&&(yield y(C)))})}function x(){let C=[];return o==null||o.forEach(F=>{if(F&&F.stepStates&&Object.keys(F.stepStates).length!==0)for(let S in F.stepStates){let P=F.stepStates[S];C.push({foreignUserId:F.foreignUserId,flowSlug:F.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...C,...s]}return{addResponse:v,setFlowResponses:a,getFlowResponses:x}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,fi=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function _o(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Sr=(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))(Sr||{});function te(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:a,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:v,flowDataOverrides:x}=Sa(Z),C={data:[]},{verifySDKInitiated:F}=Kt(),{addResponse:S,getFlowResponses:P}=Co(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),C)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),C)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:O}=Ue(),{data:H,error:_,isLoading:R}=wa(s?`${t}flows${v?"?readonly=true":""}`:null,$,{keepPreviousData:!0});ba(()=>{if(_){console.error(_);return}H&&H.data&&i(H.data)},[H,_]);function J(h){if(R)return null;let f=o.find(T=>T.slug===h);return!f&&o.length>0&&!A&&!R?(console.log(`Flow with id ${h} not found`),null):(f&&x&&x[h]&&(f.data=x[h]),(f==null?void 0:f.active)===!1&&!v?null:f)}function ee(h){var U,ge,xt,vt,Bt;if(!J(h))return[];let f=(U=J(h))==null?void 0:U.data;return f?(f=K(f),((Bt=(vt=(ge=_o(f))==null?void 0:ge.data)!=null?vt:(xt=_o(f))==null?void 0:xt.steps)!=null?Bt:[]).map(he=>{let fo=Ge(he);return V(b({handleSecondaryButtonClick:()=>{he.skippable===!0&&pe(h,he.id,{skipped:!0})}},he),{complete:me(h,he.id)===$e||fo>=1,started:me(h,he.id)===ho||me(h,he.id)===$e,currentlyActive:u==null?void 0:u.some(go=>go.flowId==h&&go.lastStepId===he.id),blocked:j(h,he.id),hidden:z(h,he.id),handlePrimaryButtonClick:()=>{(!he.completionCriteria&&(he.autoMarkCompleted||he.autoMarkCompleted===void 0)||he.completionCriteria&&he.autoMarkCompleted===!0)&&pe(h,he.id)},progress:fo})}).filter(he=>he.hidden!==!0)):[]}function K(h){return h.replaceAll(/\${(.*?)}/g,(f,T)=>a[T]===void 0?"":String(a[T]).replace(/[\u00A0-\u9999<>\&]/g,function(U){return"&#"+U.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 Y(h){var T;if(!J(h))return[];let f=J(h).data;return f?(f=K(f),(T=JSON.parse(f))!=null?T:{}):[]}function de(h,f){d(T=>V(b({},T),{[h]:f}))}function we(h){!A&&!R&&h&&JSON.stringify(a)!=JSON.stringify(b(b({},a),h))&&Object.keys(h).forEach(f=>{de(f,h[f])})}let Ie=At((h,f,T)=>D(this,null,function*(){if(!F())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:ho,data:T!=null?T:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield O(h,f,U),S(U))}),[n,r,u]),ce=At((h,f,T)=>D(this,null,function*(){if(!F())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:T!=null?T:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield N(h,f,U),S(U))}),[n,r,u]),pe=At((h,f,T)=>D(this,null,function*(){if(!F())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:$e,data:T!=null?T:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield I(h,f,U),S(U))}),[n,r,u]),M=At((h,f)=>D(this,null,function*(){if(!F()||Xe(h)===De)return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:De,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),ue(T)&&S(T)}),[n,r,u]),X=At((h,f)=>D(this,null,function*(){if(!F())return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Et,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(T)&&S(T)}),[n,r,u]),ke=At((h,f)=>D(this,null,function*(){if(!F())return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:ie,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(T)&&(yield w(h),S(T))}),[n,r,u]),He=At((h,f)=>D(this,null,function*(){if(!F())return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Uo,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(T)&&(yield w(h),S(T))}),[n,r,u]);function ue(h){var f;if(u===void 0)return!1;if(u){let T=u.find(U=>U.flowId===h.flowSlug);if(h.actionType===nt&&(!(T!=null&&T.stepStates[h.stepId])||T.stepStates[h.stepId].actionType===nt))return!1;if(T&&((f=T.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let U=Object.keys(T.stepStates).sort((ge,xt)=>{let vt=new Date(T.stepStates[ge].createdAt),Bt=new Date(T.stepStates[xt].createdAt);return vt.getTime()-Bt.getTime()});if(T.stepStates[U[U.length-1]].actionType===h.actionType&&h.stepId===U[U.length-1])return!1}if(T&&T.flowState===ie&&h.actionType===ie)return!1}return!0}function me(h,f){let T=L(h,f);return A?null:T?T.actionType:nt}function j(h,f){let T=L(h,f);return T?T.blocked:!1}function z(h,f){let T=L(h,f);return T?T.hidden:!1}function L(h,f){var U;if(A)return null;let T=u==null?void 0:u.find(ge=>ge.flowId===h);return!T||!T.stepStates[f]?null:(U=T.stepStates[f])!=null?U:null}function W(h){var T,U;if(A||!u)return null;if(Xe(h)===De)return(T=ee(h)[0])!=null?T:null;let f=(U=u.find(ge=>ge.flowId===h))==null?void 0:U.lastStepId;return f?ee(h).find(ge=>ge.id===f):null}function re(h){var U;let f=W(h);if(!f)return 0;let T=(U=ee(h).findIndex(ge=>ge.id===f.id))!=null?U:0;return me(h,f.id)===$e&&T<ee(h).length-1?T+1:T}function Ge(h){if(!h.completionCriteria)return;let f=fi(h.completionCriteria);if(f===null)return;let T=Pt(f),U=Ke(f);return U===0?void 0:T/U}function Xe(h){let f=u==null?void 0:u.find(T=>T.flowId===h);return f?f.flowState:null}function Pt(h){let f=ee(h);return f.length===0?0:f.filter(U=>me(h,U.id)===$e).length}function Ke(h){return ee(h).length}function ht(h){let f=o.find(T=>T.slug===h);return f?(x&&x[h]&&(f.data=x[h]),_o(f.data)):null}function qe(h){if(v)return!1;if(A||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(T=>T.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function zt(h){return!qe(J(h))}function Ht(){n&&B()}function Vt(){return o}return{getAllFlows:Vt,getFlow:J,getFlowData:ht,isLoading:A||R,getStepStatus:me,getFlowSteps:ee,getCurrentStepIndex:re,markStepStarted:Ie,markStepCompleted:pe,markFlowNotStarted:M,markFlowStarted:X,markFlowCompleted:ke,markFlowAborted:He,markStepNotStarted:ce,getFlowStatus:Xe,getNumberOfStepsCompleted:Pt,getNumberOfSteps:Ke,targetingLogicShouldHideFlow:qe,setCustomVariable:de,updateCustomVariables:we,customVariables:a,getStepOptionalProgress:Ge,getFlowMetadata:Y,isStepBlocked:j,isStepHidden:z,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:zt,refresh:Ht}}import{useCallback as Wo,useContext as Ta,useEffect as Fa}from"react";var qt="guest_";function yo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(Z),{config:r,apiUrl:s}=Ze(),{mutateUserFlowState:a}=Ue(),d=Gt(),{verifySDKInitiated:l}=Kt();function m(x){return`frigade-user-registered-${x}`}Fa(()=>{if(e&&!t){if(e.startsWith(qt))return;let x=m(e);localStorage.getItem(x)||(d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(x,"true"))}},[e,n,t]);let c=Wo(x=>D(this,null,function*(){if(!l())return;let C={foreignId:e,properties:x};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(C)})),i(F=>b(b({},F),x)),a()}),[e,r,n,a]),g=Wo((x,C)=>D(this,null,function*(){if(!l())return;let S={foreignId:e,events:[{event:x,properties:C}]};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(S)})),a()}),[e,r,a]),y=Wo((x,C)=>D(this,null,function*(){if(l())if(C&&Object.keys(C).length>0){let F=m(x);localStorage.setItem(F,"true"),o(x);let S={foreignId:x,properties:C};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(S)})),i(P=>b(b({},P),C)),a()}else o(x)}),[r,n,a]),v=Wo(x=>D(this,null,function*(){if(!l())return;let C=typeof window!="undefined"?localStorage.getItem(Nt):null;if(console.log("id",localStorage.getItem(Nt)),!C)return;let F={foreignId:x,linkGuestId:C};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(F)})),a()}),[r,n,a]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:v}}import{v4 as Rp}from"uuid";import ot,{useEffect as Cn,useState as Jp}from"react";import Ye,{useEffect as Fr,useState as Ia}from"react";import jo from"styled-components";import ka from"react";import Pa from"styled-components";var gi="fr-",So="cfr-";function p(e,t){let o=`${gi}${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+" "+So+e}return o}function E(e){if(!e.className||e.className.indexOf(So)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(gi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function zo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${zo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function bo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
2
|
+
var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var _o=Object.getOwnPropertySymbols;var pi=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable;var ai=(e,t,o)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))pi.call(t,o)&&ai(e,o,t[o]);if(_o)for(var o of _o(t))di.call(t,o)&&ai(e,o,t[o]);return e},G=(e,t)=>la(e,aa(t));var ci=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)pi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&_o)for(var i of _o(e))t.indexOf(i)<0&&di.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{a(o.next(d))}catch(l){n(l)}},s=d=>{try{a(o.throw(d))}catch(l){n(l)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);a((o=o.apply(e,t)).next())});import No,{createContext as Fd,useEffect as lr,useState as Ke}from"react";import{ThemeProvider as An}from"styled-components";import _t,{useContext as Rp,useEffect as oo,useState as Bo}from"react";import{useCallback as Lt,useContext as ba,useEffect as wa}from"react";import Sr,{useMemo as ui}from"react";var mi="1.38.0";var st="NOT_STARTED_STEP",le="COMPLETED_FLOW",Nt="SKIPPED_FLOW",Ot="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",Co="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=Sr.useContext(ee);return{config:ui(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":mi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ui(()=>`${o}/v1/public/`,[o])}}var pa="frigade-last-call-at-",da="frigade-last-call-data-";function qt(){let{shouldGracefullyDegrade:e,readonly:t}=Sr.useContext(ee);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Kt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Kt();let n=pa+o,r=da+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let a=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(a&&d&&d==i.body){let l=new Date(a);if(new Date().getTime()-l.getTime()<1e3)return Kt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(a){return Kt(a)}return s?s.ok?s:Kt(s.statusText):Kt()})}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Yt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Sr.useContext(ee);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ca,useState as fi}from"react";import{useContext as ma,useEffect as ua,useState as fa}from"react";import ga from"swr";import{useContext as ca}from"react";function Ae(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=ca(ee);function r(c,g=!1){var S;return(S=e[c])!=null?S:g}function s(c,g){t(S=>G(b({},S),{[c]:g}))}function a(c){t(g=>{let h=g,{[c]:S}=h,w=Le(h,[ci(c)]);return b({},w)})}function d(c){n.includes(c)||i(g=>[...g,c])}function l(c){return n.includes(c)}function f(c){return Object.entries(e).some(([g,S])=>S&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:a,hasOpenModals:f,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ha from"swr/immutable";import yo from"core-js-pure/actual/structured-clone";function br(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(...e){let t=e.shift(),o=e.length===1?e[0]:ue(...e);if(!br(t)||!br(o))throw new Error("deepmerge can only merge Objects");let i=yo(t);return Object.entries(o).forEach(([n,r])=>{br(r)?i[n]!==void 0?Object.assign(i,{[n]:ue(i[n],yo(r))}):Object.assign(i,{[n]:yo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...yo(r)]}):Object.assign(i,{[n]:yo(r)}):Object.assign(i,{[n]:r})}),i}var xa="unknown";function _e(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:a}=ma(ee),{resetOpenFlowState:d}=Ae(),[l,f]=fa(!1),c={data:r.map(P=>({flowId:P.id,flowState:le,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=P=>fetch(P,e).then(A=>{if(A.ok)return A.json();throw new Error("Failed to fetch user flow states")}).catch(A=>(console.log(`Error fetching ${P}: ${A}. Will gracefully degrade and hide Frigade`),s(!0),c)),S=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:h,mutate:x,error:T}=a?ha(S,g):ga(S,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),y=w==null?void 0:w.data;ua(()=>{!l&&!h&&y&&f(!0)},[y,l,h]);function F(P){return M(this,null,function*(){if(y&&!a){let A=y.find(I=>I.flowId===P);A&&A.flowState!==le&&(A.flowState=le),yield x(Promise.resolve(ue(w,{data:y})),{optimisticData:ue(w,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function O(P){return M(this,null,function*(){if(y&&!a){let A=y.find(I=>I.flowId===P);A&&A.flowState!==Nt&&(A.flowState=Nt),yield x(Promise.resolve(ue(w,{data:y})),{optimisticData:ue(w,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function v(P,A,I){return M(this,null,function*(){if(y){let D=y.find(z=>z.flowId===P);D&&(D.stepStates[A]=I,D.flowState=Ot),yield x(Promise.resolve(ue(w,{data:y})),{optimisticData:ue(w,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function m(P,A,I){return M(this,null,function*(){if(y){let D=y.find(z=>z.flowId===P);D&&(D.lastStepId=A,D.stepStates[A]=I,D.flowState=Ot),yield x(ue(w,{data:y}),{optimisticData:ue(w,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function N(P){return M(this,null,function*(){if(y){let A=y.find(I=>I.flowId===P);A&&A.flowState!==Ue&&(A.flowState=Ue,A.lastStepId=xa,Object.keys(A.stepStates).forEach(I=>{A.stepStates[I].actionType=st,A.stepStates[I].createdAt=new Date().toISOString()}),yield x(ue(w,{data:y}),{optimisticData:ue(w,{data:y}),revalidate:!1,rollbackOnError:!1}),d(P))}})}function E(P,A,I){return M(this,null,function*(){if(y){let D=y.find(z=>z.flowId===P);D&&(D.stepStates[A]=I),yield x(Promise.resolve(ue(w,{data:y})),{optimisticData:ue(w,{data:y}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:y,isLoadingUserFlowStateData:!l,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowSkipped:O,optimisticallyMarkFlowNotStarted:N,optimisticallyMarkStepCompleted:v,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:m,error:T}}function So(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=_e(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:a}=Ca(ee),[d,l]=fi(new Set),[f,c]=fi(new Set),g=qt();function S(x){let T=JSON.stringify(x);if(d.has(T))return null;d.add(T),l(d),f.add(x),c(f);let y=s==null?void 0:s.find(F=>F.flowSlug===x.flowSlug&&F.stepId===x.stepId&&F.actionType===x.actionType&&F.createdAt===x.createdAt);return g(`${t}flowResponses`,G(b({},e),{method:"POST",body:T})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):y||a(O=>[...O!=null?O:[],x])})}function w(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===Ot||x.actionType===Ue?yield S(x):x.actionType===le?yield S(x):x.actionType===Co?yield S(x):x.actionType===$e?yield S(x):x.actionType===Nt?yield S(x):x.actionType===st&&(yield S(x)))})}function h(){let x=[];return o==null||o.forEach(T=>{if(T&&T.stepStates&&Object.keys(T.stepStates).length!==0)for(let y in T.stepStates){let F=T.stepStates[y];x.push({foreignUserId:T.foreignUserId,flowSlug:T.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...x,...s]}return{addResponse:w,setFlowResponses:a,getFlowResponses:h}}import Ta from"swr";var ya=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,gi=e=>{let t=ya.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Sa(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Sa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Wo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var wr=(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))(wr||{});function ie(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:a,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:f,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:S,readonly:w,flowDataOverrides:h}=ba(ee),x={data:[]},{verifySDKInitiated:T}=Yt(),{addResponse:y,getFlowResponses:F}=So(),O=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:v,userFlowStatesData:m,isLoadingUserFlowStateData:N,optimisticallyMarkFlowCompleted:E,optimisticallyMarkFlowSkipped:P,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:D,optimisticallyMarkStepStarted:z}=_e(),{data:H,error:Q,isLoading:te}=Ta(s?`${t}flows${w?"?readonly=true":""}`:null,O,{keepPreviousData:!0});wa(()=>{if(Q){console.error(Q);return}H&&H.data&&i(H.data)},[H,Q]);function U(u){if(te)return null;let C=o.find(k=>k.slug===u);return!C&&o.length>0&&!N&&!te?(console.log(`Flow with id ${u} not found`),null):(C&&h&&h[u]&&(C.data=h[u]),(C==null?void 0:C.active)===!1&&!w?null:C)}function W(u){var _,Pe,Et,At,It;if(!U(u))return[];let C=(_=U(u))==null?void 0:_.data;return C?(C=oe(C),((It=(At=(Pe=Wo(C))==null?void 0:Pe.data)!=null?At:(Et=Wo(C))==null?void 0:Et.steps)!=null?It:[]).map(ge=>{let ho=je(ge);return G(b({handleSecondaryButtonClick:()=>{ge.skippable===!0&&L(u,ge.id,{skipped:!0})}},ge),{complete:V(u,ge.id)===$e||ho>=1,started:V(u,ge.id)===Co||V(u,ge.id)===$e,currentlyActive:m==null?void 0:m.some(xo=>xo.flowId==u&&xo.lastStepId===ge.id),blocked:j(u,ge.id),hidden:Z(u,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&L(u,ge.id)},progress:ho})}).filter(ge=>ge.hidden!==!0)):[]}function oe(u){return u.replaceAll(/\${(.*?)}/g,(C,k)=>a[k]===void 0?"":String(a[k]).replace(/[\u00A0-\u9999<>\&]/g,function(_){return"&#"+_.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(u){var k;if(!U(u))return[];let C=U(u).data;return C?(C=oe(C),(k=JSON.parse(C))!=null?k:{}):[]}function me(u,C){d(k=>G(b({},k),{[u]:C}))}function De(u){!N&&!te&&u&&JSON.stringify(a)!=JSON.stringify(b(b({},a),u))&&Object.keys(u).forEach(C=>{me(C,u[C])})}let Ee=Lt((u,C,k)=>M(this,null,function*(){if(!T())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:Co,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};se(_)&&(yield z(u,C,_),y(_))}),[n,r,m]),X=Lt((u,C,k)=>M(this,null,function*(){if(!T())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:st,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};se(_)&&(yield D(u,C,_),y(_))}),[n,r,m]),L=Lt((u,C,k)=>M(this,null,function*(){if(!T())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:$e,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};se(_)&&(yield I(u,C,_),y(_))}),[n,r,m]),re=Lt((u,C)=>M(this,null,function*(){if(!T()||xt(u)===Ue)return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Ue,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};yield A(u),se(k)&&y(k)}),[n,r,m]),Fe=Lt((u,C)=>M(this,null,function*(){if(!T())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Ot,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};se(k)&&y(k)}),[n,r,m]),Ve=Lt((u,C)=>M(this,null,function*(){if(!T())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:le,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};se(k)&&(yield E(u),y(k))}),[n,r,m]),ke=Lt((u,C)=>M(this,null,function*(){if(!T())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Nt,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};se(k)&&(yield P(u),y(k))}),[n,r,m]);function se(u){var C;if(m===void 0)return!1;if(m){let k=m.find(_=>_.flowId===u.flowSlug);if(u.actionType===st&&(!(k!=null&&k.stepStates[u.stepId])||k.stepStates[u.stepId].actionType===st))return!1;if(k&&((C=k.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType){if(u.actionType===$e&&(!u.data||JSON.stringify(u.data)===JSON.stringify({})))return!1;let _=Object.keys(k.stepStates).sort((Pe,Et)=>{let At=new Date(k.stepStates[Pe].createdAt),It=new Date(k.stepStates[Et].createdAt);return At.getTime()-It.getTime()});if(k.stepStates[_[_.length-1]].actionType===u.actionType&&u.stepId===_[_.length-1])return!1}if(k&&k.flowState===le&&u.actionType===le)return!1}return!0}function V(u,C){let k=$(u,C);return N?null:k?k.actionType:st}function j(u,C){let k=$(u,C);return k?k.blocked:!1}function Z(u,C){let k=$(u,C);return k?k.hidden:!1}function $(u,C){var _;if(N)return null;let k=m==null?void 0:m.find(Pe=>Pe.flowId===u);return!k||!k.stepStates[C]?null:(_=k.stepStates[C])!=null?_:null}function Y(u){var k,_;if(N||!m)return null;if(xt(u)===Ue)return(k=W(u)[0])!=null?k:null;let C=(_=m.find(Pe=>Pe.flowId===u))==null?void 0:_.lastStepId;return C?W(u).find(Pe=>Pe.id===C):null}function be(u){var _;let C=Y(u);if(!C)return 0;let k=(_=W(u).findIndex(Pe=>Pe.id===C.id))!=null?_:0;return V(u,C.id)===$e&&k<W(u).length-1?k+1:k}function je(u){if(!u.completionCriteria)return;let C=gi(u.completionCriteria);if(C===null)return;let k=qe(C),_=nt(C);return _===0?void 0:k/_}function xt(u){let C=m==null?void 0:m.find(k=>k.flowId===u);return C?C.flowState:null}function qe(u){let C=W(u);return C.length===0?0:C.filter(_=>V(u,_.id)===$e).length}function nt(u){return W(u).length}function Xe(u){let C=o.find(k=>k.slug===u);return C?(h&&h[u]&&(C.data=h[u]),Wo(C.data)):null}function vt(u){if(w)return!1;if(N||S)return!0;if(u!=null&&u.targetingLogic&&m){let C=m.find(k=>k.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&n&&n.startsWith("guest_"))}function jt(u){return!vt(U(u))}function Gt(){n&&v()}function Bt(){return o}return{getAllFlows:Bt,getFlow:U,getFlowData:Xe,isLoading:N||te,getStepStatus:V,getFlowSteps:W,getCurrentStepIndex:be,markStepStarted:Ee,markStepCompleted:L,markFlowNotStarted:re,markFlowStarted:Fe,markFlowCompleted:Ve,markFlowSkipped:ke,markStepNotStarted:X,getFlowStatus:xt,getNumberOfStepsCompleted:qe,getNumberOfSteps:nt,targetingLogicShouldHideFlow:vt,setCustomVariable:me,updateCustomVariables:De,customVariables:a,getStepOptionalProgress:je,getFlowMetadata:J,isStepBlocked:j,isStepHidden:Z,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:f,isFlowAvailableToUser:jt,refresh:Gt}}import{useCallback as zo,useContext as Fa,useEffect as ka}from"react";var Jt="guest_";function bo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Fa(ee),{config:r,apiUrl:s}=Ze(),{mutateUserFlowState:a}=_e(),d=qt(),{verifySDKInitiated:l}=Yt();function f(h){return`frigade-user-registered-${h}`}ka(()=>{if(e&&!t){if(e.startsWith(Jt))return;let h=f(e);localStorage.getItem(h)||(d(`${s}users`,G(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(h,"true"))}},[e,n,t]);let c=zo(h=>M(this,null,function*(){if(!l())return;let x={foreignId:e,properties:h};yield d(`${s}users`,G(b({},r),{method:"POST",body:JSON.stringify(x)})),i(T=>b(b({},T),h)),a()}),[e,r,n,a]),g=zo((h,x)=>M(this,null,function*(){if(!l())return;let y={foreignId:e,events:[{event:h,properties:x}]};yield d(`${s}users`,G(b({},r),{method:"POST",body:JSON.stringify(y)})),a()}),[e,r,a]),S=zo((h,x)=>M(this,null,function*(){if(l())if(x&&Object.keys(x).length>0){let T=f(h);localStorage.setItem(T,"true"),o(h);let y={foreignId:h,properties:x};yield d(`${s}users`,G(b({},r),{method:"POST",body:JSON.stringify(y)})),i(F=>b(b({},F),x)),a()}else o(h)}),[r,n,a]),w=zo(h=>M(this,null,function*(){if(!l())return;let x=typeof window!="undefined"?localStorage.getItem($t):null;if(console.log("id",localStorage.getItem($t)),!x)return;let T={foreignId:h,linkGuestId:x};yield d(`${s}users`,G(b({},r),{method:"POST",body:JSON.stringify(T)})),a()}),[r,n,a]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:w}}import{v4 as ed}from"uuid";import ot,{useEffect as Cn,useState as Xp}from"react";import Ye,{useEffect as Pr,useState as La}from"react";import Go from"styled-components";import Pa from"react";import va from"styled-components";var hi="fr-",wo="cfr-";function p(e,t){let o=`${hi}${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+" "+wo+e}return o}function B(e){if(!e.className||e.className.indexOf(wo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(hi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Ho(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=>`${Ho(t)}: ${e.styleOverrides[t]};`).join(" "):""}function we(...e){return e.filter(Boolean).join(" ")}function To(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=va.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>B(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,xi=({onClose:e,appearance:t})=>Pa.createElement(Ba,{className:p("modalBackground",t),onClick:()=>e()});import Tr from"react";import Ea from"styled-components";var Aa=Ea.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
31
|
-
${e=>
|
|
30
|
+
`,Ie=()=>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 $a}from"react-portal";import Ai from"react";import Fr from"react";function Ia({style:e,className:t}){return Fr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Fr.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"}),Fr.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 Ci=Ia;import kr from"styled-components";import lt from"styled-components";var Vo=lt.div`
|
|
31
|
+
${e=>B(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -60,52 +60,52 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
60
60
|
right: 12px;
|
|
61
61
|
background-color: transparent;
|
|
62
62
|
border: none;
|
|
63
|
-
`,
|
|
64
|
-
${e=>
|
|
63
|
+
`,yi=lt.button`
|
|
64
|
+
${e=>B(e)} {
|
|
65
65
|
${e=>e.hasImage?Na:Oa};
|
|
66
66
|
}
|
|
67
|
-
`,
|
|
68
|
-
${e=>
|
|
67
|
+
`,Si=lt.img`
|
|
68
|
+
${e=>B(e)} {
|
|
69
69
|
display: block;
|
|
70
70
|
width: 100%;
|
|
71
71
|
height: auto;
|
|
72
72
|
min-height: 200px;
|
|
73
73
|
object-fit: cover;
|
|
74
74
|
}
|
|
75
|
-
`,
|
|
76
|
-
${e=>
|
|
75
|
+
`,bi=lt.div`
|
|
76
|
+
${e=>B(e)} {
|
|
77
77
|
display: block;
|
|
78
78
|
width: 100%;
|
|
79
79
|
height: auto;
|
|
80
80
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
81
81
|
object-fit: cover;
|
|
82
82
|
}
|
|
83
|
-
`,
|
|
83
|
+
`,wi=lt.div`
|
|
84
84
|
display: flex;
|
|
85
85
|
flex-direction: row;
|
|
86
86
|
justify-content: space-between;
|
|
87
87
|
align-content: center;
|
|
88
|
-
`,
|
|
88
|
+
`,Ti=lt.div`
|
|
89
89
|
padding: 22px 22px 12px;
|
|
90
|
-
`,
|
|
90
|
+
`,Fi=lt.div`
|
|
91
91
|
display: flex;
|
|
92
92
|
flex: 1;
|
|
93
93
|
flex-direction: column;
|
|
94
94
|
justify-content: center;
|
|
95
|
-
`,
|
|
95
|
+
`,ki=lt.div`
|
|
96
96
|
display: flex;
|
|
97
97
|
flex: 2;
|
|
98
98
|
flex-shrink: 1;
|
|
99
99
|
gap: 8px;
|
|
100
100
|
height: 64px;
|
|
101
|
-
${e=>
|
|
101
|
+
${e=>B(e)} {
|
|
102
102
|
flex-direction: row;
|
|
103
103
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
104
104
|
align-content: center;
|
|
105
105
|
align-items: center;
|
|
106
106
|
}
|
|
107
|
-
`,
|
|
108
|
-
${e=>
|
|
107
|
+
`,Pi=lt.p`
|
|
108
|
+
${e=>B(e)} {
|
|
109
109
|
font-style: normal;
|
|
110
110
|
font-weight: 600;
|
|
111
111
|
font-size: 15px;
|
|
@@ -113,7 +113,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
113
113
|
color: #808080;
|
|
114
114
|
}
|
|
115
115
|
margin: 0;
|
|
116
|
-
`;var
|
|
116
|
+
`;var vi=kr.div`
|
|
117
117
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
118
118
|
position: absolute;
|
|
119
119
|
bottom: -47px;
|
|
@@ -124,7 +124,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
124
124
|
align-items: center;
|
|
125
125
|
justify-content: center;
|
|
126
126
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
127
|
-
`,
|
|
127
|
+
`,Bi=kr(Vo)`
|
|
128
128
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
129
129
|
position: absolute;
|
|
130
130
|
bottom: -60px;
|
|
@@ -137,7 +137,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
137
137
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
138
138
|
padding: 0;
|
|
139
139
|
z-index: ${e=>e.zIndex};
|
|
140
|
-
`,
|
|
140
|
+
`,Ei=kr.div`
|
|
141
141
|
display: flex;
|
|
142
142
|
justify-content: center;
|
|
143
143
|
align-items: center;
|
|
@@ -146,8 +146,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
146
146
|
font-size: 12px;
|
|
147
147
|
line-height: 18px;
|
|
148
148
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
149
|
-
`;function
|
|
150
|
-
${e=>
|
|
149
|
+
`;function jo({appearance:e}){return Ai.createElement(Ei,{className:p("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Ai.createElement(Ci,null))}var Ma=Go.div`
|
|
150
|
+
${e=>B(e)} {
|
|
151
151
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
152
152
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
153
153
|
/* Mobile */
|
|
@@ -161,7 +161,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
161
161
|
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
162
162
|
z-index: 1500;
|
|
163
163
|
border-radius: ${e=>{var t,o,i;return(i=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?i:8}}px;
|
|
164
|
-
${e=>
|
|
164
|
+
${e=>ve(e)}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
padding: 32px;
|
|
@@ -188,27 +188,27 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
188
188
|
opacity: 1;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
`,
|
|
191
|
+
`,Da=Go.div`
|
|
192
192
|
position: relative;
|
|
193
193
|
flex: 0 1 auto;
|
|
194
|
-
`,
|
|
194
|
+
`,Ua=Go.div`
|
|
195
195
|
position: absolute;
|
|
196
196
|
top: 16px;
|
|
197
197
|
right: 16px;
|
|
198
198
|
cursor: pointer;
|
|
199
199
|
z-index: 1501;
|
|
200
|
-
${e=>
|
|
200
|
+
${e=>B(e)} {
|
|
201
201
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
202
202
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
203
203
|
}
|
|
204
|
-
`,
|
|
204
|
+
`,_a=Go.div`
|
|
205
205
|
overflow: scroll;
|
|
206
206
|
flex: 1 1;
|
|
207
207
|
display: flex;
|
|
208
208
|
::-webkit-scrollbar {
|
|
209
209
|
display: none;
|
|
210
210
|
}
|
|
211
|
-
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:a=!1})=>{let[d,l]=
|
|
211
|
+
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:a=!1})=>{let[d,l]=La("");return Pr(()=>{let f=getComputedStyle(document.body).getPropertyValue("overflow");l(f)},[]),Pr(()=>{let f=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[e]),Pr(()=>{let f=document.body.style;return t?f.setProperty("overflow","hidden"):f.setProperty("overflow",d),()=>{f.setProperty("overflow",d)}},[t]),t?Ye.createElement($a,null,Ye.createElement(xi,{appearance:r,onClose:()=>{s&&e()}}),Ye.createElement(Ma,{appearance:r,className:p("modalContainer",r),styleOverrides:i},s&&Ye.createElement(Ua,{className:p("modalClose",r),onClick:()=>e(),appearance:r},Ye.createElement(Ie,null)),o&&Ye.createElement(Da,null,o),Ye.createElement(_a,null,n),a&&Ye.createElement(vi,{appearance:r,className:p("poweredByFrigadeRibbon",r)},Ye.createElement(jo,{appearance:r})))):Ye.createElement(Ye.Fragment,null)};import Ct,{useEffect as vr,useState as Wa}from"react";import Ko from"styled-components";import{Portal as za}from"react-portal";function Ha(e){switch(e){case"top-left":return`
|
|
212
212
|
top: 0;
|
|
213
213
|
left: 0;
|
|
214
214
|
`;case"top-right":return`
|
|
@@ -217,8 +217,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
217
217
|
`;case"bottom-left":return`
|
|
218
218
|
bottom: 0;
|
|
219
219
|
left: 0;
|
|
220
|
-
`}return"right: 0; bottom: 0;"}var
|
|
221
|
-
${e=>
|
|
220
|
+
`}return"right: 0; bottom: 0;"}var Va=Ko.div`
|
|
221
|
+
${e=>B(e)} {
|
|
222
222
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
223
223
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
224
224
|
position: fixed;
|
|
@@ -231,29 +231,29 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
231
231
|
width: 350px;
|
|
232
232
|
padding: 24px;
|
|
233
233
|
}
|
|
234
|
-
${e=>
|
|
234
|
+
${e=>Ha(e.modalPosition)}
|
|
235
235
|
margin: 28px;
|
|
236
|
-
`,
|
|
236
|
+
`,ja=Ko.div`
|
|
237
237
|
position: relative;
|
|
238
238
|
flex: 1;
|
|
239
|
-
`,
|
|
239
|
+
`,Ga=Ko.div`
|
|
240
240
|
position: absolute;
|
|
241
241
|
top: 16px;
|
|
242
242
|
right: 16px;
|
|
243
243
|
cursor: pointer;
|
|
244
244
|
z-index: 1501;
|
|
245
|
-
${e=>
|
|
245
|
+
${e=>B(e)} {
|
|
246
246
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
247
247
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
248
248
|
}
|
|
249
|
-
`,
|
|
249
|
+
`,Ka=Ko.div`
|
|
250
250
|
overflow: scroll;
|
|
251
251
|
flex: 5;
|
|
252
252
|
::-webkit-scrollbar {
|
|
253
253
|
display: none;
|
|
254
254
|
}
|
|
255
|
-
`,
|
|
256
|
-
${e=>
|
|
255
|
+
`,qo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[a,d]=Wa("");return vr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),vr(()=>{let l=f=>{f.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),vr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",a),()=>{l.setProperty("overflow",a)}},[t]),t?Ct.createElement(za,null,Ct.createElement(Va,{appearance:n,className:p("cornerModalContainer",n),modalPosition:r},s&&Ct.createElement(Ga,{className:p("cornerModalClose",n),onClick:()=>e()},Ct.createElement(Ie,null)),o&&Ct.createElement(ja,null,o),Ct.createElement(Ka,null,i))):Ct.createElement(Ct.Fragment,null)};import{useContext as qa}from"react";function ae(){let{defaultAppearance:e}=qa(ee);function t(o){var n,r,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import Mt,{useContext as gp,useEffect as qi,useState as Dr}from"react";import Zo from"styled-components";import Xo,{useEffect as Mi,useState as Ar}from"react";import Ir from"styled-components";import Yo from"styled-components";var Ii=Yo.label`
|
|
256
|
+
${e=>B(e)} {
|
|
257
257
|
font-size: 12px;
|
|
258
258
|
line-height: 18px;
|
|
259
259
|
margin-bottom: 5px;
|
|
@@ -263,14 +263,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
263
263
|
letter-spacing: 0.24px;
|
|
264
264
|
}
|
|
265
265
|
display: flex;
|
|
266
|
-
`,Ni=
|
|
267
|
-
${e=>
|
|
266
|
+
`,Ni=Yo.label`
|
|
267
|
+
${e=>B(e)} {
|
|
268
268
|
font-size: 12px;
|
|
269
269
|
line-height: 20px;
|
|
270
270
|
margin-bottom: 5px;
|
|
271
271
|
}
|
|
272
272
|
display: flex;
|
|
273
|
-
`,Oi=
|
|
273
|
+
`,Oi=Yo.span`
|
|
274
274
|
font-weight: 400;
|
|
275
275
|
font-size: 14px;
|
|
276
276
|
line-height: 22px;
|
|
@@ -278,17 +278,17 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
278
278
|
display: flex;
|
|
279
279
|
margin-right: 5px;
|
|
280
280
|
margin-top: 10px;
|
|
281
|
-
`,Yo
|
|
281
|
+
`,Jo=Yo.div`
|
|
282
282
|
display: flex;
|
|
283
283
|
align-items: flex-start;
|
|
284
284
|
justify-content: left;
|
|
285
285
|
margin-bottom: 10px;
|
|
286
|
-
`;import
|
|
286
|
+
`;import Br from"react";var at={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 yt({title:e,required:t,appearance:o=at}){return e?Br.createElement(Jo,{className:p("formLabelWrapper",o)},t?Br.createElement(Oi,{className:p("formLabelRequired",o),appearance:o},"*"):null,Br.createElement(Ii,{className:p("formLabel",o)},e)):null}import Li from"react";function Xt({title:e,appearance:t}){return e?Li.createElement(Jo,null,Li.createElement(Ni,{className:p("formSubLabel",t)},e)):null}import{z as Er}from"zod";function $i(e,t){var o,i,n,r,s,a,d;try{if(t){if(t.type=="number"){let l=Er.number();if(t.props)for(let f of t.props)f.requirement=="min"?l=l.min(Number(f.value),(o=f.message)!=null?o:"Value is too small"):f.requirement=="max"?l=l.max(Number(f.value),(i=f.message)!=null?i:"Value is too large"):f.requirement=="positive"?l=l.positive((n=f.message)!=null?n:"Value must be positive"):f.requirement=="negative"&&(l=l.nonpositive((r=f.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=Er.string();if(t.props)for(let f of t.props)f.requirement=="min"?l=l.min(Number(f.value),(s=f.message)!=null?s:"Value is too short"):f.requirement=="max"?l=l.max(Number(f.value),(a=f.message)!=null?a:"Value is too long"):f.requirement=="regex"&&(l=l.regex(new RegExp(String(f.value)),(d=f.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof Er.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var Ya=Ir.div`
|
|
287
287
|
display: flex;
|
|
288
288
|
flex-direction: column;
|
|
289
289
|
width: 100%;
|
|
290
|
-
`,
|
|
291
|
-
${e=>
|
|
290
|
+
`,Nr=Ir.input`
|
|
291
|
+
${e=>B(e)} {
|
|
292
292
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
293
293
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
294
294
|
font-size: 14px;
|
|
@@ -303,8 +303,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
303
303
|
box-sizing: border-box;
|
|
304
304
|
padding: 0 10px;
|
|
305
305
|
margin-bottom: 10px;
|
|
306
|
-
`,
|
|
307
|
-
${e=>
|
|
306
|
+
`,Ja=Ir.textarea`
|
|
307
|
+
${e=>B(e)} {
|
|
308
308
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
309
309
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
310
310
|
font-size: 14px;
|
|
@@ -320,14 +320,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
320
320
|
box-sizing: border-box;
|
|
321
321
|
margin-bottom: 10px;
|
|
322
322
|
resize: none;
|
|
323
|
-
`;function
|
|
323
|
+
`;function Or({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,a]=Ar((n==null?void 0:n.text)||""),[d,l]=Ar(!1),[f,c]=Ar(!1),g=Nr;Mi(()=>{s===""&&!d&&(l(!0),S(""))},[]),Mi(()=>{if(f){S(s);return}},[f]);function S(h){var T;if(a(h),o({text:h}),r.required===!0&&h.trim()===""){i([{id:r.id,message:`${(T=r.title)!=null?T:"Field"} is required`,hidden:!f}]);return}let x=$i(h,r.validation);if(x&&(h.trim()!==""||r.required===!0)){i([{id:r.id,message:x,hidden:!f}]);return}i([])}r.multiline&&(g=Ja);function w(){var h;switch((h=r==null?void 0:r.validation)==null?void 0:h.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Xo.createElement(Ya,null,Xo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),Xo.createElement(g,{className:p("inputComponent",t.appearance),value:s,onChange:h=>{S(h.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:w(),onBlur:()=>{c(!0)}}),Xo.createElement(Xt,{title:r.subtitle,appearance:t.appearance}))}import et,{useEffect as Di,useState as Ui}from"react";import _i from"styled-components";var Lr="",Xa=_i.div`
|
|
324
324
|
display: flex;
|
|
325
325
|
flex-direction: column;
|
|
326
326
|
width: 100%;
|
|
327
327
|
-webkit-appearance: none;
|
|
328
328
|
appearance: none;
|
|
329
|
-
`,
|
|
330
|
-
${e=>
|
|
329
|
+
`,Qa=_i.select`
|
|
330
|
+
${e=>B(e)} {
|
|
331
331
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
332
332
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
333
333
|
font-size: 14px;
|
|
@@ -347,16 +347,16 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
347
347
|
background-repeat: no-repeat;
|
|
348
348
|
background-size: 1.5em 1.5em;
|
|
349
349
|
-webkit-print-color-adjust: exact;
|
|
350
|
-
`;function
|
|
351
|
-
${e=>
|
|
352
|
-
`,
|
|
350
|
+
`;function Wi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var f,c,g,S,w,h,x,T,y;let r=e,[s,a]=Ui(!1),[d,l]=Ui(!1);return Di(()=>{var F,O,v,m;if(!((F=i==null?void 0:i.choice)!=null&&F[0])&&!s){if(a(!0),r.requireSelection){o({choice:[Lr]});return}if(r.defaultValue&&((O=r.props.options)!=null&&O.find(N=>N.id===r.defaultValue))){let N=(v=r.props.options)==null?void 0:v.find(E=>E.id===r.defaultValue);o({choice:[N.id]})}else o({choice:[((m=r.props.options)==null?void 0:m[0].id)||""]})}},[]),Di(()=>{var F;d&&(r.requireSelection&&((F=i==null?void 0:i.choice)==null?void 0:F[0])===Lr?n([{message:"Please select an option",id:r.id}]):n([]))},[(f=i==null?void 0:i.choice)==null?void 0:f[0],d]),et.createElement(Xa,null,et.createElement(yt,{title:r.title,required:!1,appearance:t.appearance}),et.createElement(Qa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:F=>{l(!0),o({choice:[F.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:p("multipleChoiceSelect",t.appearance)},r.requireSelection&&et.createElement("option",{key:"null-value",value:Lr,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(S=r.props.options)==null?void 0:S.map(F=>et.createElement("option",{key:F.id,value:F.id},F.title))),((h=(w=r.props.options)==null?void 0:w.find(F=>{var O;return F.id===((O=i==null?void 0:i.choice)==null?void 0:O[0])}))==null?void 0:h.isOpenEnded)&&et.createElement(et.Fragment,null,et.createElement(yt,{title:(y=(T=(x=r.props.options)==null?void 0:x.find(F=>{var O;return F.id===((O=i==null?void 0:i.choice)==null?void 0:O[0])}))==null?void 0:T.openEndedLabel)!=null?y:"Please specify",required:!1,appearance:t.appearance}),et.createElement(Nr,{type:"text",placeholder:"Enter your answer here",onChange:F=>{o({choice:[F.target.value]})},appearance:t.appearance})),et.createElement(Xt,{title:r.subtitle,appearance:t.appearance}))}import Po,{useEffect as $r,useState as Hi}from"react";import Vi from"styled-components";import ko from"react";import Fo from"react";var zi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return Fo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Za=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>Fo.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},Fo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Fo.createElement(zi,{color:n,size:t}),Fo.createElement(zi,{color:e,percentage:Math.max(o,.1),size:t})),i),Qt=Za;import Ra from"styled-components";var ep=({color:e="#FFFFFF"})=>ko.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ko.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),tp={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},op={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},rp={border:"1px solid #000000",color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np={color:"#FFFFFF"},sp={border:"1px solid #C5CBD3"},lp=e=>e==="square"?tp:op,ap=(e,t)=>e==="square"?t?rp:ip:t?np:sp,pp=Ra.div`
|
|
351
|
+
${e=>ve(e)}
|
|
352
|
+
`,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:s})=>{let a=lp(t),d=ap(t,e);return e===!0?a=G(b(b({},a),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):a=b(b({},a),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?ko.createElement(Qt,{fillColor:o,percentage:i,size:22}):ko.createElement(pp,{styleOverrides:a,style:r,role:"checkbox",className:we(p("checkIconContainer",n),p(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&ko.createElement(ep,{color:"#FFFFFF"}))};var dp=Vi.div`
|
|
353
353
|
display: flex;
|
|
354
354
|
flex-direction: column;
|
|
355
355
|
width: 100%;
|
|
356
356
|
-webkit-appearance: none;
|
|
357
357
|
appearance: none;
|
|
358
|
-
`,
|
|
359
|
-
${e=>
|
|
358
|
+
`,cp=Vi.button`
|
|
359
|
+
${e=>B(e)} {
|
|
360
360
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
361
361
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
362
362
|
font-size: 14px;
|
|
@@ -380,8 +380,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
380
380
|
height: 48px;
|
|
381
381
|
padding: 0 18px;
|
|
382
382
|
margin-bottom: 10px;
|
|
383
|
-
`;function
|
|
384
|
-
${e=>
|
|
383
|
+
`;function ji({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var f;let r=e,[s,a]=Hi((i==null?void 0:i.choice)||[]),[d,l]=Hi(!1);return $r(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),$r(()=>{o({choice:s})},[s]),$r(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),Po.createElement(dp,null,Po.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(f=r.props.options)==null?void 0:f.map(c=>Po.createElement(cp,{appearance:t.appearance,className:p(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){a(s.filter(g=>g!==c.id));return}s.length<r.props.maxChoices?a([...s,c.id]):s.length==1&&r.props.maxChoices==1&&a([c.id])}},c.title,Po.createElement(pt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),Po.createElement(Xt,{title:r.subtitle,appearance:t.appearance}))}import Qo from"react";import Gi from"styled-components";import mp from"dompurify";function pe(e){return{__html:mp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var up=Gi.h1`
|
|
384
|
+
${e=>B(e)} {
|
|
385
385
|
font-style: normal;
|
|
386
386
|
font-weight: 700;
|
|
387
387
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -392,8 +392,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
392
392
|
margin-bottom: 4px;
|
|
393
393
|
color: ${e=>e.appearance.theme.colorText};
|
|
394
394
|
}
|
|
395
|
-
`,
|
|
396
|
-
${e=>
|
|
395
|
+
`,fp=Gi.h2`
|
|
396
|
+
${e=>B(e)} {
|
|
397
397
|
font-style: normal;
|
|
398
398
|
font-weight: 400;
|
|
399
399
|
font-size: 14px;
|
|
@@ -401,38 +401,38 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
401
401
|
letter-spacing: 0.28px;
|
|
402
402
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
403
403
|
}
|
|
404
|
-
`;function Ne({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return
|
|
404
|
+
`;function Ne({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Qo.createElement(Qo.Fragment,null,Qo.createElement(up,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:p(`${n}${n?To(i):i}Title`,e),dangerouslySetInnerHTML:pe(t),size:i}),o&&Qo.createElement(fp,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:p(`${n}${n?To(i):i}Subtitle`,e),dangerouslySetInnerHTML:pe(o),size:i}))}import*as Mr from"react";var Ki=e=>Mr.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Mr.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 hp=Zo.div`
|
|
405
405
|
display: flex;
|
|
406
406
|
flex-direction: column;
|
|
407
407
|
justify-content: flex-end;
|
|
408
408
|
overflow: visible;
|
|
409
409
|
padding-top: 14px;
|
|
410
|
-
`,
|
|
410
|
+
`,xp=Zo.div`
|
|
411
411
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
412
412
|
font-size: 12px;
|
|
413
413
|
margin-bottom: 12px;
|
|
414
414
|
display: flex;
|
|
415
415
|
align-items: center;
|
|
416
|
-
`,
|
|
416
|
+
`,Cp=Zo.div`
|
|
417
417
|
margin-right: 4px;
|
|
418
418
|
display: inline-flex;
|
|
419
|
-
`,
|
|
419
|
+
`,yp=Zo.div`
|
|
420
420
|
padding-left: 1px;
|
|
421
421
|
padding-right: 1px;
|
|
422
|
-
`,
|
|
422
|
+
`,Sp={text:Or,multipleChoice:Wi,multipleChoiceList:ji},Ur="frigade-multiInputStepTypeData";function Yi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:a}){var v;let d=t.props,[l,f]=Dr([]),[c,g]=Dr([]),{userId:S}=bo(),[w,h]=Dr(F()||(a?a[t.id]:null)||{}),{readonly:x}=gp(ee),T=b(b({},Sp),s);qi(()=>{i(l.length===0)},[l,i]),qi(()=>{n(w)},[w]);function y(m,N){h(E=>{let P=G(b({},E),{[m.id]:N});return typeof window!="undefined"&&window.localStorage&&!x&&window.localStorage.setItem(O(),JSON.stringify(P)),P})}function F(){if(typeof window!="undefined"&&window.localStorage){let m=window.localStorage.getItem(O());if(m)return JSON.parse(m)}return null}function O(){return`${Ur}-${e}-${t.id}-${S}`}return Mt.createElement(yp,{className:p("multiInput",r)},Mt.createElement(Ne,{appearance:r,title:t.title,subtitle:t.subtitle}),Mt.createElement(hp,{className:p("multiInputContainer",r)},(v=d==null?void 0:d.data)==null?void 0:v.map(m=>{let N=l.reverse().find(E=>E.id===m.id);return T[m.type]?Mt.createElement("span",{key:m.id,"data-field-id":m.id,className:p("multiInputField",r)},T[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:E=>{!c.includes(m.id)&&E&&(E==null?void 0:E.text)!==""&&g(P=>[...P,m.id]),y(m,E)},inputData:w[m.id],setFormValidationErrors:E=>{E.length===0&&l.length===0||f(P=>E.length===0?P.filter(A=>A.id!==m.id):[...P,...E])}}),N&&N.message&&c.includes(m.id)&&N.hidden!==!0&&Mt.createElement(xp,{key:m.id,style:{overflow:"hidden"},appearance:r,className:p("multiInputValidationError",r)},Mt.createElement(Cp,{appearance:r,className:p("multiInputValidationErrorIcon",r)},Mt.createElement(Ki,null)),N.message)):null})))}import Zt from"styled-components";var Ji=Zt.div`
|
|
423
423
|
align-items: center;
|
|
424
424
|
display: flex;
|
|
425
425
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
426
426
|
padding-top: 14px;
|
|
427
|
-
`,
|
|
427
|
+
`,Xi=Zt.div`
|
|
428
428
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
429
429
|
font-size: 12px;
|
|
430
|
-
`,
|
|
430
|
+
`,Qi=Zt.div`
|
|
431
431
|
display: flex;
|
|
432
432
|
gap: 12px;
|
|
433
433
|
width: 100%;
|
|
434
434
|
justify-content: flex-end;
|
|
435
|
-
`,
|
|
435
|
+
`,Zi=Zt.div`
|
|
436
436
|
display: flex;
|
|
437
437
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
438
438
|
// Otherwise, use 4px padding
|
|
@@ -440,11 +440,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
440
440
|
flex-grow: 1;
|
|
441
441
|
flex-basis: 0;
|
|
442
442
|
position: relative;
|
|
443
|
-
`,
|
|
443
|
+
`,Ri=Zt.div`
|
|
444
444
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
445
445
|
position: relative;
|
|
446
446
|
overflow-y: auto;
|
|
447
|
-
`,
|
|
447
|
+
`,en=Zt.div`
|
|
448
448
|
display: flex;
|
|
449
449
|
align-self: stretch;
|
|
450
450
|
flex-grow: 1;
|
|
@@ -456,7 +456,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
456
456
|
background-position: center;
|
|
457
457
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
458
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
459
|
-
`;import St from"react";import
|
|
459
|
+
`;import St from"react";import on from"react";import rn from"styled-components";import bp from"styled-components";var tn=bp.div`
|
|
460
460
|
width: 24px;
|
|
461
461
|
height: 24px;
|
|
462
462
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -474,11 +474,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
474
474
|
transform: rotate(360deg);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
`;var
|
|
477
|
+
`;var wp=rn.button`
|
|
478
478
|
justify-content: center;
|
|
479
479
|
align-content: center;
|
|
480
480
|
align-items: center;
|
|
481
|
-
${e=>
|
|
481
|
+
${e=>B(e)} {
|
|
482
482
|
display: flex;
|
|
483
483
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
484
484
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -493,7 +493,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
493
493
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
494
494
|
line-height: 20px;
|
|
495
495
|
font-weight: 500;
|
|
496
|
-
${e=>
|
|
496
|
+
${e=>ve(e)}
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
font-family: inherit;
|
|
@@ -507,8 +507,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
507
507
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
508
508
|
cursor: not-allowed;
|
|
509
509
|
}
|
|
510
|
-
`,
|
|
511
|
-
${e=>
|
|
510
|
+
`,Ro=rn.div`
|
|
511
|
+
${e=>B(e)} {
|
|
512
512
|
display: flex;
|
|
513
513
|
flex-direction: row;
|
|
514
514
|
justify-content: flex-start;
|
|
@@ -518,14 +518,15 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
518
518
|
margin-right: 8px;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
`,
|
|
521
|
+
`,de=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:a,withMargin:d=!0,classPrefix:l="",loading:f=!1,autoFocus:c=!1})=>{var S;function g(){let w=s?"buttonSecondary":"button";return l===""?w:`${l}${To(w)}`}return on.createElement(wp,{tabindex:s?"0":"1",secondary:s,appearance:a,disabled:i||f,loading:(S=f==null?void 0:f.toString())!=null?S:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:p(g(),a),autoFocus:c},f?on.createElement(tn,{className:p("buttonLoader",a)}):t!=null?t:"Continue")};var nn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:a,allowBackNavigation:d,errorMessage:l,isSaving:f})=>{var S;let c=s.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return St.createElement(St.Fragment,null,l!==null&&l!=null&&St.createElement(Xi,{appearance:o,className:p("formCTAError",o)},l),St.createElement(Ji,{showBackButton:c,className:p("formCTAContainer",o)},c&&St.createElement(de,{title:(S=e.backButtonTitle)!=null?S:"Back",onClick:a,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),St.createElement(Qi,{className:p("ctaWrapper",o)},e.secondaryButtonTitle?St.createElement(de,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:f}):null," ",e.primaryButtonTitle?St.createElement(de,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:f}):null)))};import _r from"react";import Tp from"styled-components";var Fp=Tp.div`
|
|
522
522
|
text-align: center;
|
|
523
|
-
|
|
523
|
+
color: #e6e6e6;
|
|
524
|
+
`,er=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ae().mergeAppearanceWithDefault(i);return _r.createElement(Fp,{className:o},_r.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>_r.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"currentColor"}))))};import Dt from"react";import Rt from"styled-components";import{useContext as kp}from"react";function fe(){let e=kp(ee);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Pp=Rt.div`
|
|
524
525
|
display: flex;
|
|
525
526
|
flex-wrap: wrap;
|
|
526
527
|
align-content: center;
|
|
527
528
|
justify-content: center;
|
|
528
|
-
`,
|
|
529
|
+
`,vp=Rt.div`
|
|
529
530
|
align-content: center;
|
|
530
531
|
align-items: center;
|
|
531
532
|
display: flex;
|
|
@@ -539,10 +540,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
539
540
|
flex-basis: 255px;
|
|
540
541
|
flex-grow: 0;
|
|
541
542
|
flex-shrink: 0;
|
|
542
|
-
`,
|
|
543
|
+
`,Bp=Rt.img`
|
|
543
544
|
width: 78px;
|
|
544
545
|
height: auto;
|
|
545
|
-
`,
|
|
546
|
+
`,Ep=Rt.button`
|
|
546
547
|
font-style: normal;
|
|
547
548
|
font-weight: 600;
|
|
548
549
|
font-size: 13px;
|
|
@@ -555,11 +556,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
555
556
|
border-radius: 100px;
|
|
556
557
|
padding: 8px 12px;
|
|
557
558
|
margin-top: 16px;
|
|
558
|
-
`,
|
|
559
|
+
`,Ap=Rt.h1`
|
|
559
560
|
font-weight: 700;
|
|
560
561
|
font-size: 28px;
|
|
561
562
|
line-height: 34px;
|
|
562
|
-
`,
|
|
563
|
+
`,Ip=Rt.h2`
|
|
563
564
|
font-style: normal;
|
|
564
565
|
font-weight: 400;
|
|
565
566
|
font-size: 16px;
|
|
@@ -568,7 +569,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
568
569
|
margin-top: 12px;
|
|
569
570
|
margin-bottom: 16px;
|
|
570
571
|
max-width: 70%;
|
|
571
|
-
`;function sn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=fe();return
|
|
572
|
+
`;function sn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=fe();return Dt.createElement("div",null,Dt.createElement(Ap,{dangerouslySetInnerHTML:pe(e.title)}),Dt.createElement(Ip,{dangerouslySetInnerHTML:pe(e.subtitle)}),Dt.createElement(Pp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Dt.createElement(vp,{key:r.title},Dt.createElement(Bp,{src:r.imageUri}),Dt.createElement(Ep,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import to,{useEffect as Wp}from"react";import or from"styled-components";import Wr from"react";var tr=({style:e,className:t})=>Wr.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},Wr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Wr.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 Ut,{useRef as Np,useState as Op}from"react";import eo from"styled-components";var Lp=eo.div`
|
|
572
573
|
display: flex;
|
|
573
574
|
align-items: center;
|
|
574
575
|
justify-content: flex-start;
|
|
@@ -576,7 +577,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
576
577
|
width: 100%;
|
|
577
578
|
height: 100%;
|
|
578
579
|
position: relative;
|
|
579
|
-
|
|
580
|
+
`,$p=eo.div`
|
|
580
581
|
position: absolute;
|
|
581
582
|
display: flex;
|
|
582
583
|
align-items: center;
|
|
@@ -595,50 +596,50 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
595
596
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
596
597
|
border-radius: 50%;
|
|
597
598
|
}
|
|
598
|
-
|
|
599
|
+
`,Mp=eo.video`
|
|
599
600
|
width: 100%;
|
|
600
601
|
height: 100%;
|
|
601
602
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
602
|
-
`,
|
|
603
|
+
`,Dp=eo.iframe`
|
|
603
604
|
width: 100%;
|
|
604
605
|
height: 100%;
|
|
605
606
|
min-height: 260px;
|
|
606
607
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
607
|
-
`,
|
|
608
|
+
`,Up=eo.iframe`
|
|
608
609
|
width: 100%;
|
|
609
610
|
height: 100%;
|
|
610
611
|
min-height: 400px;
|
|
611
612
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
612
|
-
}`,
|
|
613
|
+
}`,_p=eo.iframe`
|
|
613
614
|
width: 100%;
|
|
614
615
|
height: 100%;
|
|
615
616
|
min-height: 400px;
|
|
616
617
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
617
|
-
`;function tt({appearance:e,videoUri:t,autoplay:o=!1}){let i=Np(),[n,r]=Op(o);if(t.includes("youtube")){let s=t.split("v=")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),
|
|
618
|
-
${e=>
|
|
618
|
+
`;function tt({appearance:e,videoUri:t,autoplay:o=!1}){let i=Np(),[n,r]=Op(o);if(t.includes("youtube")){let s=t.split("v=")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Ut.createElement(Dp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${s}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("youtubePlayer",e)})}if(t.includes("vimeo")){let s=t.split("vimeo.com/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Ut.createElement(Up,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("vimeoPlayer",e)})}if(t.includes("wistia")){let s=t.split("wistia.com/medias/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Ut.createElement(_p,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("wistiaPlayer",e)})}return Ut.createElement(Lp,{className:p("videoPlayerWrapper",e),appearance:e},!n&&Ut.createElement($p,{onClick:()=>{r(!0),i.current.play()},appearance:e,className:p("playIconWrapper",e)},Ut.createElement(tr,null)),Ut.createElement(Mp,{appearance:e,controls:n,ref:i,play:n,src:t,autoPlay:o,muted:o}))}var zp=or.div`
|
|
619
|
+
${e=>B(e)} {
|
|
619
620
|
display: flex;
|
|
620
621
|
flex-direction: column;
|
|
621
622
|
justify-content: center;
|
|
622
623
|
}
|
|
623
|
-
`,
|
|
624
|
-
${e=>
|
|
624
|
+
`,Hp=or.img`
|
|
625
|
+
${e=>B(e)} {
|
|
625
626
|
width: 100%;
|
|
626
627
|
height: auto;
|
|
627
628
|
max-height: 250px;
|
|
628
629
|
margin-bottom: 24px;
|
|
629
630
|
}
|
|
630
|
-
`,
|
|
631
|
-
${e=>
|
|
631
|
+
`,Vp=or.div`
|
|
632
|
+
${e=>B(e)} {
|
|
632
633
|
margin-bottom: 24px;
|
|
633
634
|
}
|
|
634
|
-
`,
|
|
635
|
-
${e=>
|
|
635
|
+
`,jp=or.div`
|
|
636
|
+
${e=>B(e)} {
|
|
636
637
|
width: 100%;
|
|
637
638
|
height: auto;
|
|
638
639
|
max-height: 250px;
|
|
639
640
|
margin-bottom: 24px;
|
|
640
641
|
}
|
|
641
|
-
`;function ln({stepData:e,appearance:t,setCanContinue:o}){return
|
|
642
|
+
`;function ln({stepData:e,appearance:t,setCanContinue:o}){return Wp(()=>{o(!0)},[]),to.createElement(zp,{className:p("callToActionContainer",t)},to.createElement(Vp,{className:p("callToActionTextContainer",t)},to.createElement(Ne,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&to.createElement(Hp,{className:p("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&to.createElement(jp,{appearance:t,className:p("callToActionVideo",t)},to.createElement(tt,{appearance:t,videoUri:e.videoUri})))}import dt,{useEffect as zr,useState as Hr}from"react";import bt from"styled-components";var an=bt.div`
|
|
642
643
|
width: auto;
|
|
643
644
|
display: flex;
|
|
644
645
|
flex-direction: column;
|
|
@@ -691,8 +692,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
691
692
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
692
693
|
display: flex;
|
|
693
694
|
align-self: center;
|
|
694
|
-
`;var hn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=
|
|
695
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,a])=>`${zo(s)}: ${a};`).join(" ")} }`:`${zo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function oe({appearance:e}){if(!e||!e.styleOverrides)return ko.createElement(ko.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?ko.createElement(ko.Fragment,null):ko.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ve(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:a,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:m}=te(),c=a(e);function g(){return D(this,null,function*(){!o&&!r&&s(e)===De&&l(m(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{g()},[r,e,t]),{}}var yn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:a,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:v="center",repeatable:x=!1,onDismiss:C,showPagination:F=!1,allowBackNavigation:S=!1,validationHandler:P,showFrigadeBranding:$=!1,onFormDataChange:B,showFooter:u=!0,prefillData:A={},updateUrlOnPageChange:w=!1})=>{let{getFlow:k,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:O,getFlowStatus:H,getCurrentStepIndex:_,markFlowCompleted:R,markFlowNotStarted:J,markStepStarted:ee}=te(),K=_(e),{mergeAppearanceWithDefault:Y}=ne(),[de,we]=Jp(null),{setOpenFlowState:Ie,getOpenFlowState:ce,hasOpenModals:pe}=Ee();Ve(e,i);let M=I(e);d=Y(d);let[X,ke]=i!==void 0&&n!==void 0?[i,n]:[ce(e,!0),j=>Ie(e,j)],He=typeof window!="undefined"?window.location.hash:null;if(Cn(()=>{var j;if(M&&M.length>0&&S){let z=typeof window!="undefined"&&((j=window==null?void 0:window.location)!=null&&j.hash)?window.location.hash.replace("#",""):"";if(M&&(M==null?void 0:M.length)>0){let L=-1;if(z){let W=z;L=M.findIndex(re=>re.id===W),de===z&&(L=-1)}L!==-1&&(we(z),ee(e,M[L].id))}}},[He]),Cn(()=>{!N&&M&&M.length&&typeof window!="undefined"&&S&&(we(M[K].id),window.location.hash=M[K].id)},[N,K,M]),N)return null;let ue=k(e);if(!ue||O(ue)||!M||i!==void 0&&i===!1||H(e)===ie&&l&&!x||(o=="modal"||o=="corner-modal")&&pe(e))return null;let me=()=>{ke(!1),C&&C(),y===!0&&R(e)};if(v=="center"&&o==="modal"||o==="large-modal"){let j={padding:"24px"};return o==="large-modal"?(j.width="85%",j.height="90%",j.maxHeight="800px",j.minHeight="500px",j.padding="0"):j.width="400px",ot.createElement(Re,{appearance:d,onClose:me,visible:X,style:j,dismissible:g,showFrigadeBranding:$},ot.createElement(oe,{appearance:d}),ot.createElement(or,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:S,validationHandler:P,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:w,repeatable:x}))}return o==="modal"&&v!=="center"?ot.createElement(Ko,{appearance:d,onClose:me,visible:X,modalPosition:v},ot.createElement(oe,{appearance:d}),ot.createElement(or,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:S,validationHandler:P,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:w,repeatable:x})):ot.createElement(ot.Fragment,null,ot.createElement(oe,{appearance:d}),ot.createElement(or,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:S,validationHandler:P,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:w,repeatable:x}))},Sn=yn;import{useCallback as zr,useContext as Xp,useEffect as Qp}from"react";function Hr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(Z),{mutateUserFlowState:i}=Ue(),{config:n,apiUrl:r}=Ze(),s=Gt(),{verifySDKInitiated:a}=Kt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Qp(()=>{if(t&&e){if(t.startsWith(qt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=zr(g=>D(this,null,function*(){if(!a())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 y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=zr((g,y)=>D(this,null,function*(){if(!a())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 x={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}),[e,t,n,i]),c=zr((g,y)=>D(this,null,function*(){if(a())if(y){let v=d(t,g);localStorage.setItem(v,"true"),o(g);let x={foreignUserId:t,foreignUserGroupId:g,properties:y};yield s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var Nt="frigade-xFrigade_guestUserId",vo="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=Co(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ue(),{userId:n,setUserId:r}=yo(),[s,a]=Po(n),{getFlowStatus:d}=te(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Zp(Z),[y,v]=Po([]),[x,C]=Po([]),{organizationId:F}=Hr(),[S,P]=Po(F),[$,B]=Po(!1);eo(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let I=t[k],N=l.find(O=>O.slug===(I==null?void 0:I.flowId));if(N&&I&&I.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!x.includes(N.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),eo(()=>{g.length>0&&i()},[g]),eo(()=>{$||(B(!0),i())},[o,B]);function u(k){let I=l.find(N=>N.slug===k);I&&I.triggerType==="AUTOMATIC"&&!x.includes(I.slug)&&(C([...x,I.slug]),v([I]))}function A(){if(!n){let k=localStorage.getItem(vo);if(k){r(k);return}let I=localStorage.getItem(Nt);if(I){r(I);return}c(!0);let N=qt+Rp();try{localStorage.setItem(Nt,N)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||N)}}eo(()=>{try{if(l){let k=[];l.forEach(I=>{if(I.data){let N=I.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(O=>{let H=O.replace('"imageUri":"',"").replace('"',"");if(k.includes(H))return;let _=new Image;_.src=H,k.push(H)})}})}}catch(k){}},[l]),eo(()=>{if(n!==s&&(e([]),i()),a(n),n&&!n.startsWith(qt))try{localStorage.setItem(vo,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&A()},50)},[n,l,m]),eo(()=>{F!=S&&(P(F),e([]),i())},[F,S,P]);function w(){return $t.createElement($t.Fragment,null,y.map(k=>d(k.slug)!==De?null:$t.createElement("span",{key:k.slug},$t.createElement(Sn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return $t.createElement($t.Fragment,null,$t.createElement(w,null))};var wn={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 ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((s,a)=>{r[s]||(r[s]=a===n.length-1?i:{}),r=r[s]})}}),t}function td(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(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},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),Bo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=id(),a={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,b(b({as:e},a),i),t);if(o!==void 0){let l=Ce(s,o);return Fn.createElement(rd,{theme:l},d())}return d()};var Eo={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"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(Bo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var rr={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 vn=Cd(Bo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),to={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"},ir={colors:V(b({},to),{neutral:{foreground:to.gray300},primary:{background:to.blue500,foreground:to.white,inverted:to.blue500},negative:{foreground:to.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:wd,components:{Button:Eo,Text:rr}};var Nn="https://api.frigade.com",Z=Td({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:lt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Nn,readonly:!1,debug:!1});function Fd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var kd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var Y,de,we,Ie,ce,pe;let r=typeof window!="undefined"?localStorage.getItem(Nt):null,[s,a]=je(t||r),[d,l]=je(o||null),[m,c]=je([]),[g,y]=je([]),[v,x]=je([]),[C,F]=je({}),[S,P]=je({}),[$,B]=je([]),[u,A]=je({}),[w,k]=je(!1),[I,N]=je(!1),[O,H]=je(!J(e)),_=(M,X)=>{if(X==="_blank"){window.open(M,"_blank");return}setTimeout(()=>{window.location.href=M},50)},R={theme:b(b({},lt.theme),(de=(Y=i==null?void 0:i.defaultAppearance)==null?void 0:Y.theme)!=null?de:{}),styleOverrides:b(b({},lt.styleOverrides),(Ie=(we=i==null?void 0:i.defaultAppearance)==null?void 0:we.styleOverrides)!=null?Ie:{})};function J(M){return!!(M&&M.length>10&&M.substring(0,10)==="api_public")}nr(()=>{t&&a(t)},[t]),nr(()=>{s&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(vo)&&window.localStorage.getItem(vo)!==s&&Fd()},[s]),nr(()=>{o&&l(o)},[o]),nr(()=>{if(J(e))H(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),H(!0);return}},[e,H]);let ee={publicApiKey:e,userId:s,setUserId:a,setFlows:c,flows:m,failedFlowResponses:g,setFailedFlowResponses:y,flowResponses:v,setFlowResponses:x,userProperties:C,setUserProperties:F,openFlowStates:S,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:$,setCompletedFlowsToKeepOpenDuringSession:B,customVariables:u,setCustomVariables:A,isNewGuestUser:w,setIsNewGuestUser:k,hasActiveFullPageFlow:I,setHasActiveFullPageFlow:N,organizationId:d,setOrganizationId:l,navigate:i&&i.navigate?i.navigate:_,defaultAppearance:R,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:H,apiUrl:i&&i.apiUrl?i.apiUrl:Nn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:K}=Tn(R);return O?Ao.createElement(Z.Provider,{value:ee},Ao.createElement(An,{theme:Ce(R.theme,ir,K!=null?K:{},(ce=i==null?void 0:i.theme)!=null?ce:{})},n)):Ao.createElement(Z.Provider,{value:ee},Ao.createElement(An,{theme:Ce(R.theme,ir,K!=null?K:{},(pe=i==null?void 0:i.theme)!=null?pe:{})},n,Ao.createElement(bn,null)))};import hc from"react";import Se,{useEffect as fr,useState as il}from"react";import Je,{useState as Vd}from"react";import wt from"styled-components";import ar from"react";import Mt from"react";import In from"styled-components";var On=In.span`
|
|
695
|
+
`;var hn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=Hr([]),[a,d]=Hr(!1),[l,f]=Hr(e.id);return zr(()=>{r.length==0&&!a&&(d(!0),o({choice:[]}))},[a]),zr(()=>{l!==e.id&&(f(e.id),s([]))},[e]),zr(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),dt.createElement(an,{className:p("selectListContainer",i)},dt.createElement(pn,null,dt.createElement(dn,{className:p("selectListTitle",i)},e.title),dt.createElement(cn,{appearance:i,className:p("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let S=r.includes(c.id);return dt.createElement(mn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(w=>w!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:g===n.options.length-1,className:p("selectListSelectItem",i)},dt.createElement(un,{className:p("selectListItemImage",i)},c.imageUri&&dt.createElement(fn,{src:c.imageUri,alt:`select-icon-${g}`}),dt.createElement(gn,{appearance:i,className:p("selectListSelectItemText",i)},c.title)),dt.createElement(pt,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};import We,{useEffect as xn,useState as rr}from"react";var Gp=({children:e,id:t,shouldWrap:o=!1})=>We.createElement(We.Fragment,null,o?We.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),ir=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:a,type:d,hideOnFlowCompletion:l,onComplete:f,setVisible:c,setShowModal:g,onDismiss:S,showPagination:w=!1,customFormElements:h,allowBackNavigation:x,validationHandler:T,onFormDataChange:y,showFooter:F,prefillData:O,updateUrlOnPageChange:v,repeatable:m})=>{var se;let E=b(b({},{linkCollection:sn,multiInput:Yi,callToAction:ln,selectList:hn}),i),{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:A}=fe(),[I,D]=rr(!1),[z,H]=rr({}),[Q,te]=rr(!1),[U,W]=rr(null),oe=(se=t[o])!=null?se:null,{markStepCompleted:J,markStepStarted:me,isLoading:De,updateCustomVariables:Ee,markFlowCompleted:X}=ie();xn(()=>{Ee(n)},[n,De]),xn(()=>{y&&y(z,L(),t[o],o)},[z]);function L(){var j;return{data:(j=z[t[o].id])!=null?j:{},stepId:t[o].id,customVariables:n}}function re(V,j,Z){let $=o+1<t.length?t[o+1]:null;return s&&s(V,Z,$,z,L()),r?r(V,o,j,$):!0}function Fe(V,j){H(Z=>{let $={};return $[V.id]=j,b(b({},Z),$)})}function Ve(V){return V.selectedStep.imageUri?We.createElement(en,{image:V.selectedStep.imageUri,appearance:e,className:p("formContainerSidebarImage",e)}):null}let ke=F&&We.createElement(nn,{step:t[o],canContinue:I&&!Q,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>M(void 0,null,function*(){if(te(!0),T){let Z=yield T(t[o],o,t[o+1],z,L());if(Z!==!0){W(typeof Z=="string"?Z:null),te(!1);return}else W(null)}let V=b({},L());yield J(a,t[o].id,V),o+1<t.length&&!x&&(yield me(a,t[o+1].id));let j=re(t[o],"primary",o);if(o+1>=t.length&&(f&&f(),S&&S(),l&&j&&(c&&c(!1),g(!1)),yield X(a),m&&(yield me(a,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach($=>{$.startsWith(Ur)&&window.localStorage.removeItem($)}))),P(t[o]),te(!1),typeof window!="undefined"&&!x&&v&&o+1<t.length){let Z=new URL(window.location.href);Z.searchParams.set("p",t[o+1].id),window.history.pushState({},"",Z.toString())}}),onSecondaryClick:()=>{re(t[o],"secondary",o),A(t[o])},onBack:()=>M(void 0,null,function*(){o-1>=0&&(te(!0),yield me(a,t[o-1].id),te(!1))}),steps:t,allowBackNavigation:x,errorMessage:U,isSaving:Q});return We.createElement(We.Fragment,null,We.createElement(Zi,{className:p("formContainer",e)},We.createElement(Gp,{id:o,shouldWrap:d==="large-modal"},We.createElement(Ri,{key:oe.id,type:d,className:p("formContent",e)},t.map(V=>{var Z;let j=E[(Z=V.type)!=null?Z:"multiInput"];return oe.id!==V.id?null:typeof j!="function"?j:We.createElement(j,{key:V.id,stepData:V,canContinue:I,setCanContinue:D,onSaveData:$=>{Fe(V,$)},appearance:e,customFormElements:h,flowId:a,prefillData:O})}),w&&We.createElement(er,{className:p("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ke)),d=="large-modal"&&We.createElement(Ve,{selectedStep:t[o]})))};import vo from"react";import{createGlobalStyle as Kp}from"styled-components";var qp=Kp`
|
|
696
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${wo}${t}.${wo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,a])=>`${Ho(s)}: ${a};`).join(" ")} }`:`${Ho(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ne({appearance:e}){if(!e||!e.styleOverrides)return vo.createElement(vo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?vo.createElement(vo.Fragment,null):vo.createElement(qp,{inlineStyles:t})}import{useEffect as Yp,useState as Jp}from"react";function Ge(e,t=!0){let[o,i]=Jp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:a,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:f}=ie(),c=a(e);function g(){return M(this,null,function*(){!o&&!r&&s(e)===Ue&&l(f(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return Yp(()=>{g()},[r,e,t]),{}}var yn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:a,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:f,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:h=!1,onDismiss:x,showPagination:T=!1,allowBackNavigation:y=!1,validationHandler:F,showFrigadeBranding:O=!1,onFormDataChange:v,showFooter:m=!0,prefillData:N={},updateUrlOnPageChange:E=!1})=>{let{getFlow:P,getFlowSteps:A,isLoading:I,targetingLogicShouldHideFlow:D,getFlowStatus:z,getCurrentStepIndex:H,markFlowCompleted:Q,markFlowNotStarted:te,markStepStarted:U}=ie(),W=H(e),{mergeAppearanceWithDefault:oe}=ae(),[J,me]=Xp(null),{setOpenFlowState:De,getOpenFlowState:Ee,hasOpenModals:X}=Ae();Ge(e,i);let L=A(e);d=oe(d);let[re,Fe]=i!==void 0&&n!==void 0?[i,n]:[Ee(e,!0),V=>De(e,V)],Ve=typeof window!="undefined"?window.location.hash:null;if(Cn(()=>{var V;if(L&&L.length>0&&y){let j=typeof window!="undefined"&&((V=window==null?void 0:window.location)!=null&&V.hash)?window.location.hash.replace("#",""):"";if(L&&(L==null?void 0:L.length)>0){let Z=-1;if(j){let $=j;Z=L.findIndex(Y=>Y.id===$),J===j&&(Z=-1)}Z!==-1&&(me(j),U(e,L[Z].id))}}},[Ve]),Cn(()=>{!I&&L&&L.length&&typeof window!="undefined"&&y&&(me(L[W].id),window.location.hash=L[W].id)},[I,W,L]),I)return null;let ke=P(e);if(!ke||D(ke)||!L||i!==void 0&&i===!1||z(e)===le&&l&&!h||(o=="modal"||o=="corner-modal")&&X(e))return null;let se=()=>{Fe(!1),x&&x(),S===!0&&Q(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let V={padding:"24px"};return o==="large-modal"?(V.width="85%",V.height="90%",V.maxHeight="800px",V.minHeight="500px",V.padding="0"):V.width="400px",ot.createElement(Re,{appearance:d,onClose:se,visible:re,style:V,dismissible:g,showFrigadeBranding:O},ot.createElement(ne,{appearance:d}),ot.createElement(ir,{appearance:d,steps:L,selectedStep:W,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Fe,onDismiss:x,showPagination:T,customFormElements:s,allowBackNavigation:y,validationHandler:F,onFormDataChange:v,showFooter:m,prefillData:N,updateUrlOnPageChange:E,repeatable:h}))}return o==="modal"&&w!=="center"?ot.createElement(qo,{appearance:d,onClose:se,visible:re,modalPosition:w},ot.createElement(ne,{appearance:d}),ot.createElement(ir,{appearance:d,steps:L,selectedStep:W,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Fe,onDismiss:x,showPagination:T,customFormElements:s,allowBackNavigation:y,validationHandler:F,onFormDataChange:v,showFooter:m,prefillData:N,updateUrlOnPageChange:E,repeatable:h})):ot.createElement(ot.Fragment,null,ot.createElement(ne,{appearance:d}),ot.createElement(ir,{appearance:d,steps:L,selectedStep:W,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Fe,onDismiss:x,showPagination:T,customFormElements:s,allowBackNavigation:y,validationHandler:F,onFormDataChange:v,showFooter:m,prefillData:N,updateUrlOnPageChange:E,repeatable:h}))},Sn=yn;import{useCallback as Vr,useContext as Qp,useEffect as Zp}from"react";function jr(){let{organizationId:e,userId:t,setOrganizationId:o}=Qp(ee),{mutateUserFlowState:i}=_e(),{config:n,apiUrl:r}=Ze(),s=qt(),{verifySDKInitiated:a}=Yt();function d(g,S){return`frigade-user-group-registered-${g}-${S}`}Zp(()=>{if(t&&e){if(t.startsWith(Jt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,G(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=Vr(g=>M(this,null,function*(){if(!a())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 S={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,G(b({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),f=Vr((g,S)=>M(this,null,function*(){if(!a())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 h={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:S}]};yield s(`${r}userGroups`,G(b({},n),{method:"POST",body:JSON.stringify(h)})),i()}),[e,t,n,i]),c=Vr((g,S)=>M(this,null,function*(){if(a())if(S){let w=d(t,g);localStorage.setItem(w,"true"),o(g);let h={foreignUserId:t,foreignUserGroupId:g,properties:S};yield s(`${r}userGroups`,G(b({},n),{method:"POST",body:JSON.stringify(h)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:f}}var $t="frigade-xFrigade_guestUserId",Eo="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=So(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=_e(),{userId:n,setUserId:r}=bo(),[s,a]=Bo(n),{getFlowStatus:d}=ie(),{flows:l,userProperties:f,setIsNewGuestUser:c,flowResponses:g}=Rp(ee),[S,w]=Bo([]),[h,x]=Bo([]),{organizationId:T}=jr(),[y,F]=Bo(T),[O,v]=Bo(!1);oo(()=>{if(!o&&t)for(let P=0;P<t.length;P++){let A=t[P],I=l.find(D=>D.slug===(A==null?void 0:A.flowId));if(I&&A&&A.shouldTrigger===!0&&I.type=="FORM"&&I.triggerType==="AUTOMATIC"&&!h.includes(I.slug)){setTimeout(()=>{m(A.flowId)},500);break}}},[o,t]),oo(()=>{g.length>0&&i()},[g]),oo(()=>{O||(v(!0),i())},[o,v]);function m(P){let A=l.find(I=>I.slug===P);A&&A.triggerType==="AUTOMATIC"&&!h.includes(A.slug)&&(x([...h,A.slug]),w([A]))}function N(){if(!n){let P=localStorage.getItem(Eo);if(P){r(P);return}let A=localStorage.getItem($t);if(A){r(A);return}c(!0);let I=Jt+ed();try{localStorage.setItem($t,I)}catch(D){console.log("Failed to save guest user id locally: Local storage unavailable",D)}r(D=>D||I)}}oo(()=>{try{if(l){let P=[];l.forEach(A=>{if(A.data){let I=A.data.match(/"imageUri":"(.*?)"/g);I&&I.forEach(D=>{let z=D.replace('"imageUri":"',"").replace('"',"");if(P.includes(z))return;let H=new Image;H.src=z,P.push(z)})}})}}catch(P){}},[l]),oo(()=>{if(n!==s&&(e([]),i()),a(n),n&&!n.startsWith(Jt))try{localStorage.setItem(Eo,n)}catch(P){console.log("Failed to save user id locally: Local storage available",P)}n===null&&setTimeout(()=>{n===null&&N()},50)},[n,l,f]),oo(()=>{T!=y&&(F(T),e([]),i())},[T,y,F]);function E(){return _t.createElement(_t.Fragment,null,S.map(P=>d(P.slug)!==Ue?null:_t.createElement("span",{key:P.slug},_t.createElement(Sn,{flowId:P.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return _t.createElement(_t.Fragment,null,_t.createElement(E,null))};var wn={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 td(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((s,a)=>{r[s]||(r[s]=a===n.length-1?i:{}),r=r[s]})}}),t}function od(e){if(!e)return;let t=ue({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=td(t),n=od(o);return{overrides:i,css:n}}import hd from"styled-components";import{compose as xd,variant as kn}from"styled-system";import Fn from"react";import rd,{ThemeProvider as id,useTheme as nd}from"styled-components";import{border as sd,color as ld,compose as ad,get as pd,shadow as dd,space as cd,system as md,typography as ud}from"styled-system";var fd={width:{property:"width",scale:"sizes",transform:(e,t)=>pd(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},gd=rd("div")(({css:e})=>e,ad(sd,ld,dd,cd,ud,md(fd))),Ao=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=nd(),a={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(gd,b(b({as:e},a),i),t);if(o!==void 0){let l=ue(s,o);return Fn.createElement(id,{theme:l},d())}return d()};var Io={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Cd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=hd(Ao)(()=>({whiteSpace:"nowrap"}),xd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:Cd})));import yd from"styled-components";import{variant as Sd,system as bd}from"styled-system";var nr={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 vn=yd(Ao)(Sd({scale:"components.Text",variants:"components.Text"}),bd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",wd=20,Td=Object.fromEntries(Array.from(Array(wd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),ro={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},sr={colors:G(b({},ro),{neutral:{foreground:ro.gray300},primary:{background:ro.blue500,foreground:ro.white,inverted:ro.blue500},negative:{foreground:ro.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:Td,components:{Button:Io,Text:nr}};var In="https://api.frigade.com",ee=Fd({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:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:In,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var oe,J,me,De,Ee,X;let r=typeof window!="undefined"?localStorage.getItem($t):null,[s,a]=Ke(t||r),[d,l]=Ke(o||null),[f,c]=Ke([]),[g,S]=Ke([]),[w,h]=Ke([]),[x,T]=Ke({}),[y,F]=Ke({}),[O,v]=Ke([]),[m,N]=Ke({}),[E,P]=Ke(!1),[A,I]=Ke(!1),[D,z]=Ke(!te(e)),H=(L,re)=>{if(re==="_blank"){window.open(L,"_blank");return}setTimeout(()=>{window.location.href=L},50)},Q={theme:b(b({},at.theme),(J=(oe=i==null?void 0:i.defaultAppearance)==null?void 0:oe.theme)!=null?J:{}),styleOverrides:b(b({},at.styleOverrides),(De=(me=i==null?void 0:i.defaultAppearance)==null?void 0:me.styleOverrides)!=null?De:{})};function te(L){return!!(L&&L.length>10&&L.substring(0,10)==="api_public")}lr(()=>{t&&a(t)},[t]),lr(()=>{s&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Eo)&&window.localStorage.getItem(Eo)!==s&&kd()},[s]),lr(()=>{o&&l(o)},[o]),lr(()=>{if(te(e))z(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),z(!0);return}},[e,z]);let U={publicApiKey:e,userId:s,setUserId:a,setFlows:c,flows:f,failedFlowResponses:g,setFailedFlowResponses:S,flowResponses:w,setFlowResponses:h,userProperties:x,setUserProperties:T,openFlowStates:y,setOpenFlowStates:F,completedFlowsToKeepOpenDuringSession:O,setCompletedFlowsToKeepOpenDuringSession:v,customVariables:m,setCustomVariables:N,isNewGuestUser:E,setIsNewGuestUser:P,hasActiveFullPageFlow:A,setHasActiveFullPageFlow:I,organizationId:d,setOrganizationId:l,navigate:i&&i.navigate?i.navigate:H,defaultAppearance:Q,shouldGracefullyDegrade:D,setShouldGracefullyDegrade:z,apiUrl:i&&i.apiUrl?i.apiUrl:In,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:W}=Tn(Q);return D?No.createElement(ee.Provider,{value:U},No.createElement(An,{theme:ue(Q.theme,sr,W!=null?W:{},(Ee=i==null?void 0:i.theme)!=null?Ee:{})},n)):No.createElement(ee.Provider,{value:U},No.createElement(An,{theme:ue(Q.theme,sr,W!=null?W:{},(X=i==null?void 0:i.theme)!=null?X:{})},n,No.createElement(bn,null)))};import xc from"react";import Ce,{useEffect as hr,useState as il}from"react";import Je,{useState as jd}from"react";import wt from"styled-components";import dr from"react";import Wt from"react";import On from"styled-components";var Nn=On.span`
|
|
696
697
|
font-weight: 600;
|
|
697
698
|
font-size: 14px;
|
|
698
699
|
font-style: normal;
|
|
@@ -703,8 +704,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
703
704
|
vertical-align: middle;
|
|
704
705
|
margin-left: 32px;
|
|
705
706
|
padding-right: 12px;
|
|
706
|
-
${e=>
|
|
707
|
-
`,
|
|
707
|
+
${e=>ve(e)}
|
|
708
|
+
`,vd=On.div`
|
|
708
709
|
flex-direction: row;
|
|
709
710
|
justify-content: space-between;
|
|
710
711
|
display: flex;
|
|
@@ -712,12 +713,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
712
713
|
padding-bottom: 20px;
|
|
713
714
|
padding-right: 8px;
|
|
714
715
|
width: 100%;
|
|
715
|
-
${e=>
|
|
716
|
-
`,
|
|
716
|
+
${e=>ve(e)}
|
|
717
|
+
`,ar=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:a})=>Wt.createElement(Wt.Fragment,null,Wt.createElement(vd,{className:p("checklistStepsContainer",a),appearance:a,styleOverrides:b({},n)},i==="left"&&e&&Wt.createElement(Nn,{className:p("checklistStepLabel",a),styleOverrides:o,appearnace:a},e),Wt.createElement(pt,{appearance:a,value:t,type:s,primaryColor:r}),i==="right"&&e&&Wt.createElement(Nn,{className:p("checklistStepLabel",a),styleOverrides:o,appearance:a},e)),Wt.createElement(ne,{appearance:a}));import Oo from"styled-components";var Ln=Oo.div`
|
|
717
718
|
font-weight: 700;
|
|
718
719
|
font-size: 18px;
|
|
719
720
|
line-height: 22px;
|
|
720
|
-
`,$n=
|
|
721
|
+
`,$n=Oo.p`
|
|
721
722
|
font-weight: 600;
|
|
722
723
|
font-size: 16px;
|
|
723
724
|
line-height: 24px;
|
|
@@ -725,7 +726,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
725
726
|
letter-spacing: 0.32px;
|
|
726
727
|
font-style: normal;
|
|
727
728
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
728
|
-
`,Mn=
|
|
729
|
+
`,Mn=Oo.p`
|
|
729
730
|
font-weight: 400;
|
|
730
731
|
font-size: 14px;
|
|
731
732
|
font-style: normal;
|
|
@@ -734,26 +735,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
734
735
|
letter-spacing: 0.28px;
|
|
735
736
|
margin: 8px 0px 0px 0px;
|
|
736
737
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
737
|
-
`,
|
|
738
|
+
`,pr=Oo.div`
|
|
738
739
|
width: 6px;
|
|
739
740
|
position: absolute;
|
|
740
741
|
left: 0;
|
|
741
742
|
height: 100%;
|
|
742
743
|
border-top-right-radius: 4px;
|
|
743
744
|
border-bottom-right-radius: 4px;
|
|
744
|
-
`,Dn=
|
|
745
|
+
`,Dn=Oo.div`
|
|
745
746
|
flex-direction: row;
|
|
746
747
|
justify-content: flex-start;
|
|
747
748
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
748
749
|
padding-right: 16px;
|
|
749
|
-
`;var Un=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var a,d,l,
|
|
750
|
+
`;var Un=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var a,d,l,f,c;return dr.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&dr.createElement(pr,{className:p("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(a=s==null?void 0:s.theme)==null?void 0:a.colorPrimary)!=null?d:i}}),dr.createElement(Dn,{className:p("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},dr.createElement(ar,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(f=s==null?void 0:s.theme)==null?void 0:f.colorPrimary)!=null?c:i,appearance:s})))};import zt from"react";import Gr from"styled-components";import cr from"styled-components";var hC=cr.h1`
|
|
750
751
|
display: flex;
|
|
751
752
|
margin: 0;
|
|
752
753
|
font-size: 18px;
|
|
753
|
-
`,
|
|
754
|
+
`,xC=cr.h2`
|
|
754
755
|
font-size: 15px;
|
|
755
756
|
color: #4d4d4d;
|
|
756
|
-
`,_n=
|
|
757
|
+
`,_n=cr.div`
|
|
757
758
|
position: absolute;
|
|
758
759
|
left: 0;
|
|
759
760
|
top: 0;
|
|
@@ -762,7 +763,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
762
763
|
border-radius: 20px;
|
|
763
764
|
background-color: ${e=>e.theme.colorPrimary};
|
|
764
765
|
transition: width 0.5s;
|
|
765
|
-
`,Wn=
|
|
766
|
+
`,Wn=cr.div`
|
|
766
767
|
position: relative;
|
|
767
768
|
left: 0;
|
|
768
769
|
top: 0;
|
|
@@ -772,33 +773,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
772
773
|
border-radius: 20px;
|
|
773
774
|
background-color: ${e=>e.theme.colorPrimary};
|
|
774
775
|
opacity: 0.12;
|
|
775
|
-
`;var
|
|
776
|
+
`;var Bd=Gr.div`
|
|
776
777
|
display: flex;
|
|
777
778
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
778
779
|
justify-content: flex-start;
|
|
779
780
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
780
781
|
width: 100%;
|
|
781
782
|
|
|
782
|
-
${e=>
|
|
783
|
-
`,
|
|
783
|
+
${e=>ve(e)}
|
|
784
|
+
`,Ed=Gr.div`
|
|
784
785
|
flex-grow: 1;
|
|
785
786
|
position: relative;
|
|
786
787
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
787
|
-
`,
|
|
788
|
+
`,Ad=Gr.span`
|
|
788
789
|
font-weight: 600;
|
|
789
790
|
font-size: 14px;
|
|
790
791
|
line-height: 18px;
|
|
791
792
|
padding-right: ${e=>e.padding};
|
|
792
793
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
793
|
-
${e=>
|
|
794
|
-
`;var
|
|
794
|
+
${e=>ve(e)}
|
|
795
|
+
`;var ze=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var g;if(t===0)return zt.createElement(zt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=s==null?void 0:s.theme)==null?void 0:g.colorText});let a=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),f=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(f="0px"),zt.createElement(Bd,{className:p("progressBarContainer",s),textLocation:i,styleOverrides:n},zt.createElement(Ad,{className:p("progressBarStepText",s),styleOverrides:G(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:f,textLocation:i},c),zt.createElement(Ed,{textLocation:i,className:p("progressBar",s)},zt.createElement(_n,{style:{zIndex:o=="compact"?1:5},fgWidth:a,barHeight:d,appearance:s,className:p("progressBarFill",s)}),zt.createElement(Wn,{className:p("progressBarBackground",s),barHeight:d,appearance:s})))};import Lo from"react";import Nd from"styled-components";import ur from"react";import mr from"react";var io=({stepData:e,appearance:t})=>mr.createElement(mr.Fragment,null,mr.createElement($n,{appearance:t,className:p("checklistStepTitle",t),dangerouslySetInnerHTML:pe(e.title)}),mr.createElement(Mn,{appearance:t,className:p("checklistStepSubtitle",t),dangerouslySetInnerHTML:pe(e.subtitle)}));import Kr from"react";var no=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Kr.createElement(Ro,{className:p("ctaContainer",t)},Kr.createElement(de,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Kr.createElement(de,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var so=({stepData:e,appearance:t})=>ur.createElement(ur.Fragment,null,ur.createElement(io,{stepData:e,appearance:t}),ur.createElement(no,{stepData:e,appearance:t}));import Id from"react";function zn(e){return Id.createElement(tt,{appearance:e.appearance,videoUri:e.videoUri,autoplay:e.autoplay})}var qr="default",Od=Nd.img`
|
|
795
796
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
796
797
|
width: 100%;
|
|
797
798
|
height: auto;
|
|
798
799
|
min-height: 200px;
|
|
799
|
-
`,Hn=({stepData:e,appearance:t})=>{var o;if(e!=null&&e.StepContent){let i=e.StepContent;return
|
|
800
|
+
`,Hn=({stepData:e,appearance:t})=>{var o;if(e!=null&&e.StepContent){let i=e.StepContent;return Lo.createElement("div",null,i)}return Lo.createElement(Ln,{className:p("checklistStepContent",t)},e.imageUri?Lo.createElement(Od,{className:p("checklistStepImage",t),src:e.imageUri,appearance:t}):null,e.videoUri?Lo.createElement(zn,{videoUri:e.videoUri,appearance:t,autoplay:(o=e.props)==null?void 0:o.autoplayVideo}):null,Lo.createElement(so,{stepData:e,appearance:t}))};import He,{useRef as Ld,useState as $d}from"react";import lo from"styled-components";var Vn=lo.div`
|
|
800
801
|
display: block;
|
|
801
|
-
|
|
802
|
+
`,Md=lo.div`
|
|
802
803
|
display: flex;
|
|
803
804
|
flex-direction: row;
|
|
804
805
|
flex-wrap: wrap;
|
|
@@ -808,20 +809,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
808
809
|
align-content: center;
|
|
809
810
|
margin-top: 24px;
|
|
810
811
|
margin-bottom: 24px;
|
|
811
|
-
`,
|
|
812
|
+
`,Dd=lo.div`
|
|
812
813
|
display: flex;
|
|
813
814
|
align-items: center;
|
|
814
815
|
justify-content: flex-start;
|
|
815
816
|
flex-direction: column;
|
|
816
817
|
margin-right: 16px;
|
|
817
|
-
`,
|
|
818
|
+
`,Ud=lo.video`
|
|
818
819
|
width: 200px;
|
|
819
820
|
height: 120px;
|
|
820
|
-
`,
|
|
821
|
+
`,_d=lo.div`
|
|
821
822
|
font-size: 14px;
|
|
822
823
|
line-height: 20px;
|
|
823
824
|
text-align: center;
|
|
824
|
-
`,
|
|
825
|
+
`,Wd=lo.div`
|
|
825
826
|
position: absolute;
|
|
826
827
|
width: 200px;
|
|
827
828
|
height: 120px;
|
|
@@ -841,9 +842,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
841
842
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
842
843
|
border-radius: 50%;
|
|
843
844
|
}
|
|
844
|
-
`,jn="videoCarousel",Gn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return
|
|
845
|
+
`,jn="videoCarousel",Gn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return He.createElement(Vn,null,He.createElement(so,{stepData:e,appearance:t}));function o({video:r}){let s=Ld(),[a,d]=$d(!1);return He.createElement(Dd,null,!a&&He.createElement(Wd,{onClick:()=>{d(!0),s.current.play()},appearance:t},He.createElement(tr,null)),He.createElement(Ud,{controls:a,ref:s,play:a,src:r.uri}),He.createElement(_d,null,r.title))}let i=e.props;return i.videos?He.createElement(Vn,null,He.createElement(io,{stepData:e,appearance:t}),He.createElement(Md,null,i.videos.map((r,s)=>He.createElement("span",{key:`${r.uri}-${s}`},He.createElement(o,{video:r})))),He.createElement(no,{stepData:e,appearance:t})):null};import ct from"react";import fr from"styled-components";var Kn=fr.div`
|
|
845
846
|
display: block;
|
|
846
|
-
`,
|
|
847
|
+
`,zd=fr.pre`
|
|
847
848
|
display: block;
|
|
848
849
|
background-color: #2a2a2a;
|
|
849
850
|
color: #f8f8f8;
|
|
@@ -859,29 +860,29 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
859
860
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
860
861
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
861
862
|
margin-bottom: 24px;
|
|
862
|
-
`,
|
|
863
|
+
`,Hd=fr.div`
|
|
863
864
|
font-size: 15px;
|
|
864
865
|
line-height: 20px;
|
|
865
866
|
margin-bottom: 12px;
|
|
866
867
|
margin-top: 12px;
|
|
867
|
-
`,
|
|
868
|
+
`,Vd=fr.div`
|
|
868
869
|
margin-top: 24px;
|
|
869
|
-
`,qn="codeSnippet",Yn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return
|
|
870
|
+
`,qn="codeSnippet",Yn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return ct.createElement(Kn,null,ct.createElement(so,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?ct.createElement(Kn,{className:p("codeSnippetContainer",t)},ct.createElement(io,{stepData:e,appearance:t}),ct.createElement(Vd,null,o.codeSnippets.map((n,r)=>ct.createElement("div",{key:r},n.title?ct.createElement(Hd,{dangerouslySetInnerHTML:pe(n.title)}):null,n.code?ct.createElement(zd,null,n.code):null))),ct.createElement(no,{stepData:e,appearance:t})):null};var Gd=wt.div`
|
|
870
871
|
display: flex;
|
|
871
872
|
flex-direction: row;
|
|
872
873
|
overflow: hidden;
|
|
873
874
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
874
875
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
875
876
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
876
|
-
${e=>
|
|
877
|
-
`,
|
|
877
|
+
${e=>ve(e)}
|
|
878
|
+
`,Kd=wt.h1`
|
|
878
879
|
font-size: 18px;
|
|
879
880
|
font-style: normal;
|
|
880
881
|
font-weight: 700;
|
|
881
882
|
line-height: 24px;
|
|
882
883
|
letter-spacing: 0.36px;
|
|
883
884
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
884
|
-
`,
|
|
885
|
+
`,qd=wt.h2`
|
|
885
886
|
font-size: 14px;
|
|
886
887
|
font-style: normal;
|
|
887
888
|
font-weight: 400;
|
|
@@ -889,49 +890,49 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
889
890
|
letter-spacing: 0.28px;
|
|
890
891
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
891
892
|
margin: 10px 0px 0px 0px;
|
|
892
|
-
`,
|
|
893
|
+
`,Yd=wt.div`
|
|
893
894
|
padding: 28px 0px 28px 28px;
|
|
894
895
|
border-bottom: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
895
|
-
`,Yd=wt.div`
|
|
896
|
-
flex: 1;
|
|
897
896
|
`,Jd=wt.div`
|
|
897
|
+
flex: 1;
|
|
898
|
+
`,Xd=wt.div`
|
|
898
899
|
list-style: none;
|
|
899
900
|
padding: 0;
|
|
900
901
|
margin: 0;
|
|
901
902
|
cursor: pointer;
|
|
902
903
|
min-width: 300px;
|
|
903
|
-
`,
|
|
904
|
+
`,Qd=wt.div`
|
|
904
905
|
width: 1px;
|
|
905
906
|
margin-right: 40px;
|
|
906
907
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
907
|
-
`,
|
|
908
|
+
`,Zd=wt.div`
|
|
908
909
|
flex: 2;
|
|
909
910
|
padding: 40px 40px 40px 0px;
|
|
910
|
-
`,
|
|
911
|
+
`,Rd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:a=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:f}=ae();d=f(d);let c={[qr]:Hn,[jn]:Gn,[qn]:Yn},g=b(b({},c),a),[S,w]=jd(0),h=n!=null?n:S,x=r!=null?r:w,T=o.filter(F=>F.complete===!0).length,y=()=>{var F;return!((F=o[h])!=null&&F.type)||!g[o[h].type]?g[qr]({stepData:o[h],appearance:d}):typeof g[o[h].type]!="function"?g[o[h].type]:g[o[h].type]({stepData:o[h],appearance:d})};return Je.createElement(Gd,{type:l,styleOverrides:i,className:s,appearance:d},Je.createElement(Jd,{className:p("checklistHeaderContainer",d),appearance:d},Je.createElement(Yd,{className:p("checklistHeader",d),appearance:d},Je.createElement(Kd,{className:p("checklistTitle",d),appearance:d},e),Je.createElement(qd,{className:p("checklistSubtitle",d),appearance:d},t),Je.createElement(ze,{total:o.length,count:T,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Je.createElement(Xd,{className:p("checklistStepsContainer",d)},o.map((F,O)=>Je.createElement(Un,{data:F,index:O,key:O,listLength:o.length,isSelected:O===h,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x(O)},appearance:d})))),Je.createElement(Qd,{appearance:d,className:p("checklistDivider",d)}),Je.createElement(Zd,null,Je.createElement(y,null)))},Yr=Rd;import K,{useState as ic}from"react";import Jn from"react";import ec from"styled-components";var tc=ec.svg`
|
|
911
912
|
transition: 'transform 0.35s ease-in-out';
|
|
912
|
-
`,
|
|
913
|
+
`,ao=({style:e,className:t})=>Jn.createElement(tc,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Jn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ye from"styled-components";var Jr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Xn=ye.div`
|
|
913
914
|
max-height: 350px;
|
|
914
915
|
padding-bottom: 40px;
|
|
915
|
-
`,Qn=
|
|
916
|
+
`,Qn=ye.div`
|
|
916
917
|
display: flex;
|
|
917
918
|
flex-direction: column;
|
|
918
919
|
margin-top: 20px;
|
|
919
|
-
`,Zn=
|
|
920
|
+
`,Zn=ye.h1`
|
|
920
921
|
font-style: normal;
|
|
921
922
|
font-weight: 600;
|
|
922
923
|
font-size: 30px;
|
|
923
924
|
line-height: 36px;
|
|
924
925
|
margin-bottom: 16px;
|
|
925
926
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
926
|
-
`,Rn=
|
|
927
|
+
`,Rn=ye.h2`
|
|
927
928
|
font-weight: 400;
|
|
928
929
|
font-size: 16px;
|
|
929
930
|
line-height: 20px;
|
|
930
931
|
margin-bottom: 16px;
|
|
931
932
|
padding-left: 1px;
|
|
932
933
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
933
|
-
`,es=
|
|
934
|
-
${e=>
|
|
934
|
+
`,es=ye.div`
|
|
935
|
+
${e=>B(e)} {
|
|
935
936
|
border: 1px solid #fafafa;
|
|
936
937
|
}
|
|
937
938
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -940,12 +941,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
940
941
|
flex-direction: column;
|
|
941
942
|
min-height: 240px;
|
|
942
943
|
overflow: hidden;
|
|
943
|
-
`,ts=
|
|
944
|
+
`,ts=ye.div`
|
|
944
945
|
display: flex;
|
|
945
946
|
flex-direction: row;
|
|
946
947
|
justify-content: space-between;
|
|
947
|
-
`,os=
|
|
948
|
-
${e=>
|
|
948
|
+
`,os=ye.p`
|
|
949
|
+
${e=>B(e)} {
|
|
949
950
|
font-weight: 400;
|
|
950
951
|
font-size: 10px;
|
|
951
952
|
line-height: 12px;
|
|
@@ -953,13 +954,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
953
954
|
color: #8c8c8c;
|
|
954
955
|
margin: 20px;
|
|
955
956
|
}
|
|
956
|
-
`,rs=
|
|
957
|
+
`,rs=ye.div`
|
|
957
958
|
display: flex;
|
|
958
959
|
flex-direction: row;
|
|
959
|
-
`,is=
|
|
960
|
+
`,is=ye.div`
|
|
960
961
|
flex: 1;
|
|
961
|
-
`,ns=
|
|
962
|
-
${e=>
|
|
962
|
+
`,ns=ye.div`
|
|
963
|
+
${e=>B(e)} {
|
|
963
964
|
display: flex;
|
|
964
965
|
justify-content: center;
|
|
965
966
|
align-content: center;
|
|
@@ -968,8 +969,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
968
969
|
padding-left: 8px;
|
|
969
970
|
padding-right: 8px;
|
|
970
971
|
}
|
|
971
|
-
`,ss=
|
|
972
|
-
${e=>
|
|
972
|
+
`,ss=ye.p`
|
|
973
|
+
${e=>B(e)} {
|
|
973
974
|
font-style: normal;
|
|
974
975
|
font-weight: 600;
|
|
975
976
|
font-size: 22px;
|
|
@@ -980,8 +981,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
980
981
|
margin-top: 20px;
|
|
981
982
|
margin-bottom: 16px;
|
|
982
983
|
}
|
|
983
|
-
`,ls=
|
|
984
|
-
${e=>
|
|
984
|
+
`,ls=ye.p`
|
|
985
|
+
${e=>B(e)} {
|
|
985
986
|
font-weight: 400;
|
|
986
987
|
font-size: 14px;
|
|
987
988
|
line-height: 18px;
|
|
@@ -989,15 +990,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
989
990
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
990
991
|
margin-bottom: 8px;
|
|
991
992
|
}
|
|
992
|
-
`,as=
|
|
993
|
-
${e=>
|
|
993
|
+
`,as=ye.div`
|
|
994
|
+
${e=>B(e)} {
|
|
994
995
|
display: flex;
|
|
995
996
|
flex-direction: row;
|
|
996
997
|
justify-content: center;
|
|
997
998
|
gap: 8px;
|
|
998
999
|
}
|
|
999
|
-
`,ps=
|
|
1000
|
-
${e=>
|
|
1000
|
+
`,ps=ye.div`
|
|
1001
|
+
${e=>B(e)} {
|
|
1001
1002
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1002
1003
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
1003
1004
|
:hover {
|
|
@@ -1016,8 +1017,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1016
1017
|
justify-content: space-between;
|
|
1017
1018
|
position: relative;
|
|
1018
1019
|
cursor: pointer;
|
|
1019
|
-
`,ds=
|
|
1020
|
-
${e=>
|
|
1020
|
+
`,ds=ye.p`
|
|
1021
|
+
${e=>B(e)} {
|
|
1021
1022
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1022
1023
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1023
1024
|
}
|
|
@@ -1025,12 +1026,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1025
1026
|
font-size: 14px;
|
|
1026
1027
|
line-height: 22px;
|
|
1027
1028
|
margin: 0;
|
|
1028
|
-
`,cs=
|
|
1029
|
+
`,cs=ye.div`
|
|
1029
1030
|
display: flex;
|
|
1030
1031
|
flex-direction: row;
|
|
1031
1032
|
justify-content: flex-end;
|
|
1032
1033
|
align-content: center;
|
|
1033
|
-
`,ms=
|
|
1034
|
+
`,ms=ye.div`
|
|
1034
1035
|
display: flex;
|
|
1035
1036
|
flex: 1;
|
|
1036
1037
|
flex-direction: row;
|
|
@@ -1038,14 +1039,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1038
1039
|
align-content: center;
|
|
1039
1040
|
align-items: center;
|
|
1040
1041
|
margin-right: 20px;
|
|
1041
|
-
`,us=
|
|
1042
|
+
`,us=ye.div`
|
|
1042
1043
|
display: block;
|
|
1043
1044
|
width: 100%;
|
|
1044
|
-
`;import
|
|
1045
|
+
`;import oc from"styled-components";var fs=oc.div`
|
|
1045
1046
|
flex-direction: column;
|
|
1046
1047
|
justify-content: center;
|
|
1047
1048
|
display: flex;
|
|
1048
|
-
`;import
|
|
1049
|
+
`;import ut from"react";import mt from"styled-components";var gs=mt.div`
|
|
1049
1050
|
border: 1px solid #fafafa;
|
|
1050
1051
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1051
1052
|
border-radius: 14px;
|
|
@@ -1053,14 +1054,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1053
1054
|
display: flex;
|
|
1054
1055
|
flex-direction: column;
|
|
1055
1056
|
overflow: hidden;
|
|
1056
|
-
`,hs=
|
|
1057
|
+
`,hs=mt.div`
|
|
1057
1058
|
display: flex;
|
|
1058
1059
|
flex-wrap: wrap;
|
|
1059
1060
|
justify-content: space-between;
|
|
1060
1061
|
overflow: hidden;
|
|
1061
1062
|
row-gap: 10px;
|
|
1062
|
-
`,xs=
|
|
1063
|
-
${e=>
|
|
1063
|
+
`,xs=mt.div`
|
|
1064
|
+
${e=>B(e)} {
|
|
1064
1065
|
color: #595959;
|
|
1065
1066
|
}
|
|
1066
1067
|
text-transform: uppercase;
|
|
@@ -1069,8 +1070,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1069
1070
|
line-height: 12px;
|
|
1070
1071
|
letter-spacing: 0.09em;
|
|
1071
1072
|
margin-bottom: 12px;
|
|
1072
|
-
`,Cs=
|
|
1073
|
-
${e=>
|
|
1073
|
+
`,Cs=mt.div`
|
|
1074
|
+
${e=>B(e)} {
|
|
1074
1075
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1075
1076
|
background: #ffffff;
|
|
1076
1077
|
border: 1px solid #fafafa;
|
|
@@ -1082,8 +1083,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1082
1083
|
|
|
1083
1084
|
max-width: 150px;
|
|
1084
1085
|
min-width: 200px;
|
|
1085
|
-
`,ys=
|
|
1086
|
-
${e=>
|
|
1086
|
+
`,ys=mt.div`
|
|
1087
|
+
${e=>B(e)} {
|
|
1087
1088
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1088
1089
|
}
|
|
1089
1090
|
width: 40px;
|
|
@@ -1094,14 +1095,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1094
1095
|
justify-content: center;
|
|
1095
1096
|
align-content: center;
|
|
1096
1097
|
align-items: center;
|
|
1097
|
-
`,Ss=
|
|
1098
|
+
`,Ss=mt.div`
|
|
1098
1099
|
font-weight: 600;
|
|
1099
1100
|
font-size: 20px;
|
|
1100
1101
|
line-height: 24px;
|
|
1101
1102
|
width: 20px;
|
|
1102
1103
|
height: 20px;
|
|
1103
|
-
`,bs=
|
|
1104
|
-
${e=>
|
|
1104
|
+
`,bs=mt.div`
|
|
1105
|
+
${e=>B(e)} {
|
|
1105
1106
|
color: #434343;
|
|
1106
1107
|
}
|
|
1107
1108
|
font-weight: 600;
|
|
@@ -1109,20 +1110,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1109
1110
|
line-height: 17px;
|
|
1110
1111
|
margin-top: 12px;
|
|
1111
1112
|
margin-bottom: 8px;
|
|
1112
|
-
`,ws=
|
|
1113
|
-
${e=>
|
|
1113
|
+
`,ws=mt.div`
|
|
1114
|
+
${e=>B(e)} {
|
|
1114
1115
|
color: #8c8c8c;
|
|
1115
1116
|
}
|
|
1116
1117
|
font-weight: 400;
|
|
1117
1118
|
font-size: 12px;
|
|
1118
1119
|
line-height: 14px;
|
|
1119
|
-
`,Ts=
|
|
1120
|
+
`,Ts=mt.a`
|
|
1120
1121
|
color: ${e=>e.color};
|
|
1121
1122
|
font-size: 12px;
|
|
1122
1123
|
line-height: 14px;
|
|
1123
1124
|
font-weight: 400;
|
|
1124
1125
|
cursor: pointer;
|
|
1125
|
-
`;var
|
|
1126
|
+
`;var rc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=fe();return ut.createElement(gs,{style:t,className:p("guideContainer",n)},ut.createElement(xs,{className:p("guideTitle",n)},o),ut.createElement(hs,{className:p("guideItemContainer",n)},e.map((a,d)=>{var l;return ut.createElement(Cs,{key:`guide-${(l=a.id)!=null?l:d}`,className:p("guideItem",n)},a.icon&&ut.createElement(ys,{className:p("guideIcon",n)},ut.createElement(Ss,null,a.icon)),ut.createElement(bs,{className:p("guideItemTitle",n),dangerouslySetInnerHTML:pe(a.title)}),ut.createElement(ws,{className:p("guideItemSubtitle",n),dangerouslySetInnerHTML:pe(a.subtitle)}),ut.createElement(Ts,{className:p("guideItemLink",n),color:i,onClick:()=>{a.primaryButtonUri&&s(a),r&&r(a)}},a.primaryButtonTitle))})))},$o=rc;var nc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:a,customStepTypes:d,appearance:l,guideData:f,guideTitle:c,onGuideButtonClick:g})=>{let S=({stepData:m,handleSecondaryCTAClick:N,handleCTAClick:E})=>m?K.createElement(ns,{className:p("checklistStepContainer",l),"data-testid":"checklistStepContainer"},K.createElement(ss,{appearance:l,className:p("checklistStepTitle",l),dangerouslySetInnerHTML:pe(m.title)}),K.createElement(ls,{appearance:l,className:p("checklistStepSubtitle",l),dangerouslySetInnerHTML:pe(m.subtitle)}),K.createElement(as,{className:p("checklistCTAContainer",l)},m.secondaryButtonTitle&&K.createElement(de,{title:m.secondaryButtonTitle,onClick:N,appearance:l,secondary:!0}),K.createElement(de,{title:m.primaryButtonTitle,onClick:E,appearance:l}))):K.createElement(K.Fragment,null),h=b(b({},{default:m=>{var A;if((A=e[y])!=null&&A.StepContent){let I=e[y].StepContent;return K.createElement("div",null,I)}let N=e[y];return K.createElement(S,{stepData:m,handleCTAClick:()=>{N.handlePrimaryButtonClick&&N.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{N.handleSecondaryButtonClick&&N.handleSecondaryButtonClick()}})}}),d),[x,T]=ic(0),y=s!=null?s:x,F=a!=null?a:T,O=()=>{var m;return e?!((m=e[y])!=null&&m.type)||!h[e[y].type]?h.default(e[y]):typeof h[e[y].type]!="function"?h[e[y].type]:h[e[y].type]({stepData:e[y],primaryColor:l.theme.colorPrimary}):K.createElement(K.Fragment,null)},v=e.filter(m=>m.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(Jr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Jr),K.createElement(Re,{onClose:r,visible:n,appearance:l},K.createElement(us,null,K.createElement(Qn,null,K.createElement(Zn,{appearance:l,className:p("checklistTitle",l)},t),K.createElement(Rn,{appearance:l,className:p("checklistSubtitle",l)},o)),K.createElement(Xn,null,e&&e.length>0&&K.createElement(es,{className:p("stepsContainer",l)},K.createElement(ts,null,K.createElement("div",{style:{flex:3}},K.createElement(os,{className:p("stepsTitle",l)},i)),K.createElement(ms,null,K.createElement(ze,{style:{width:"100%"},count:v,total:e.length,appearance:l}))),K.createElement(rs,null,K.createElement(is,{className:p("checklistStepListContainer",l),appearance:l},e.map((m,N)=>{var P;let E=y===N;return K.createElement(ps,{selected:E,className:p(`checklistStepListItem${E?"Selected":""}`,l),key:`checklist-guide-step-${(P=m.id)!=null?P:N}`,disabled:m.blocked,onClick:()=>{m.blocked||F(N)},title:m.blocked?"Finish remaining steps to continue":void 0},E&&K.createElement(pr,{className:p("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),K.createElement(ds,{selected:E,className:p(`checklistStepListStepName${E?"Selected":""}`,l)},m.stepName),K.createElement(cs,null,K.createElement(pt,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),K.createElement(fs,null,K.createElement(ao,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),K.createElement(O,null))),f&&f.length>0&&K.createElement($o,{steps:f,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(g&&g(m),!0)}))))):K.createElement(K.Fragment,null)},Xr=nc;import Me,{useEffect as gr,useState as sc}from"react";import Te from"react";import ft from"styled-components";var Fs=ft.div`
|
|
1126
1127
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1127
1128
|
border: 1px solid;
|
|
1128
1129
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1134,14 +1135,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1134
1135
|
display: flex;
|
|
1135
1136
|
flex-direction: column;
|
|
1136
1137
|
transition: max-height 0.25s;
|
|
1137
|
-
`,ks=
|
|
1138
|
+
`,ks=ft.div`
|
|
1138
1139
|
display: flex;
|
|
1139
1140
|
margin-bottom: 20px;
|
|
1140
|
-
`,Ps=
|
|
1141
|
+
`,Ps=ft.img`
|
|
1141
1142
|
border-radius: 4px;
|
|
1142
1143
|
max-height: 260px;
|
|
1143
1144
|
min-height: 200px;
|
|
1144
|
-
`,vs=
|
|
1145
|
+
`,vs=ft.div`
|
|
1145
1146
|
display: flex;
|
|
1146
1147
|
flex-direction: row;
|
|
1147
1148
|
justify-content: space-between;
|
|
@@ -1150,7 +1151,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1150
1151
|
:hover {
|
|
1151
1152
|
opacity: 0.8;
|
|
1152
1153
|
}
|
|
1153
|
-
`,Bs=
|
|
1154
|
+
`,Bs=ft.p`
|
|
1154
1155
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1155
1156
|
font-style: normal;
|
|
1156
1157
|
font-weight: 500;
|
|
@@ -1161,23 +1162,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1161
1162
|
:hover {
|
|
1162
1163
|
opacity: 0.8;
|
|
1163
1164
|
}
|
|
1164
|
-
`,Es=
|
|
1165
|
+
`,Es=ft.div`
|
|
1165
1166
|
cursor: pointer;
|
|
1166
1167
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1167
1168
|
:hover {
|
|
1168
1169
|
opacity: 0.8;
|
|
1169
1170
|
}
|
|
1170
|
-
`,
|
|
1171
|
+
`,g0=ft.div``,As=ft.p`
|
|
1171
1172
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1172
1173
|
font-weight: 400;
|
|
1173
1174
|
font-size: 14px;
|
|
1174
1175
|
line-height: 22px;
|
|
1175
|
-
`,
|
|
1176
|
+
`,Is=ft.div`
|
|
1176
1177
|
display: flex;
|
|
1177
1178
|
flex-direction: row;
|
|
1178
1179
|
justify-content: flex-start;
|
|
1179
1180
|
align-items: center;
|
|
1180
|
-
`;var
|
|
1181
|
+
`;var Ns=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,g;let a=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function l(){var S,w;return Te.createElement(Te.Fragment,null,e.imageUri||e.videoUri?Te.createElement(ks,{className:p("stepMediaContainer",r)},e.imageUri?Te.createElement(Ps,{className:p("stepImage",r),src:e.imageUri}):null,e.videoUri?Te.createElement(tt,{appearance:r,videoUri:e.videoUri,autoplay:(S=e.props)==null?void 0:S.autoplayVideo}):null):null,Te.createElement(As,{className:p("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:pe(e.subtitle)}),Te.createElement(Ro,{className:p("checklistCTAContainer",r)},e.secondaryButtonTitle?Te.createElement(de,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Te.createElement(de,{title:(w=e.primaryButtonTitle)!=null?w:"Continue",onClick:()=>i(),appearance:r})))}function f(){if(!s)return null;let S=s[e.type];return S?typeof S!="function"?S:S(e,r):null}return Te.createElement(Fs,{"data-testid":`step-${e.id}`,className:p("checklistStepContainer",r),appearance:r},Te.createElement(vs,{className:p("stepHeader",r),onClick:()=>o()},Te.createElement(Is,null,Te.createElement(ar,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Te.createElement(Bs,{appearance:r,className:p("stepTitle",r),dangerouslySetInnerHTML:pe(e.title)})),Te.createElement(Es,{className:p("stepChevronContainer",r),appearance:r},Te.createElement(ao,{style:G(b({},a),{transition:"transform 0.2s ease-in-out"})}))),Te.createElement("div",{key:e.id,style:b({},d)},(g=f())!=null?g:l()))};import po from"styled-components";var E0=po.div`
|
|
1181
1182
|
background: #ffffff;
|
|
1182
1183
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1183
1184
|
border-radius: 6px;
|
|
@@ -1191,26 +1192,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1191
1192
|
|
|
1192
1193
|
max-width: 800px;
|
|
1193
1194
|
min-width: 350px;
|
|
1194
|
-
`,
|
|
1195
|
+
`,Os=po.div`
|
|
1195
1196
|
display: flex;
|
|
1196
1197
|
flex-direction: column;
|
|
1197
|
-
`,Ls=
|
|
1198
|
+
`,Ls=po.h1`
|
|
1198
1199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1199
1200
|
font-style: normal;
|
|
1200
1201
|
font-weight: 700;
|
|
1201
1202
|
font-size: 20px;
|
|
1202
1203
|
line-height: 24px;
|
|
1203
1204
|
margin-bottom: 8px;
|
|
1204
|
-
`,$s=
|
|
1205
|
+
`,$s=po.h2`
|
|
1205
1206
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1206
1207
|
font-weight: 400;
|
|
1207
1208
|
font-size: 14px;
|
|
1208
1209
|
line-height: 23px;
|
|
1209
1210
|
margin: 2px 0 0 0;
|
|
1210
|
-
`,Ms=
|
|
1211
|
+
`,Ms=po.div`
|
|
1211
1212
|
display: block;
|
|
1212
1213
|
width: 100%;
|
|
1213
|
-
`,Ds=
|
|
1214
|
+
`,Ds=po.div`
|
|
1214
1215
|
display: flex;
|
|
1215
1216
|
width: 100%;
|
|
1216
1217
|
flex-direction: column;
|
|
@@ -1218,23 +1219,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1218
1219
|
padding: 24px;
|
|
1219
1220
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1220
1221
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1221
|
-
`;var
|
|
1222
|
+
`;var lc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:a=!0,selectedStep:d,setSelectedStep:l,appearance:f,type:c,className:g,customStepTypes:S,style:w})=>{let h=o.filter(v=>v.complete).length,[x,T]=sc(Array(o.length).fill(!0));gr(()=>{let v=[...x];if(r){for(let m=0;m<o.length;m++)if(!o[m].complete){v[m]=!1;break}T(v)}},[]),gr(()=>{r&&y(d)},[d]),gr(()=>{a&&x[d]&&y(d)},[d]),gr(()=>{},[o]);let y=v=>{let m=[...x];if(s)for(let N=0;N<x.length;++N)N!=v&&m[v]&&(m[N]=!0);m[v]=!x[v],T(m)};if(!n&&c=="modal")return Me.createElement(Me.Fragment,null);let F=Me.createElement(Me.Fragment,null,Me.createElement(Os,null,Me.createElement(Ls,{appearance:f,className:p("checklistTitle",f),dangerouslySetInnerHTML:pe(e)}),Me.createElement($s,{appearance:f,className:p("checklistSubtitle",f),dangerouslySetInnerHTML:pe(t)})),Me.createElement(ze,{display:"percent",count:h,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:f})),O=Me.createElement(Ms,{className:we(p("checklistContainer",f),g)},o.map((v,m)=>{var E;let N=x[m];return Me.createElement(Ns,{appearance:f,stepData:v,collapsed:N,key:`modal-checklist-${(E=v.id)!=null?E:m}`,onClick:()=>{d==m?y(m):l(m)},onPrimaryButtonClick:()=>{a&&m<o.length-1&&l(m+1),v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()},customStepTypes:S})}));return c==="inline"?Me.createElement(Ds,{appearance:f,className:we(p("checklistInlineContainer",f),g),style:w},F,O):Me.createElement(Me.Fragment,null,Me.createElement(Re,{onClose:i,visible:n,appearance:f,style:{maxWidth:"600px"},headerContent:F},O))},Qr=lc;import he,{useEffect as Zr,useRef as gc,useState as Ht}from"react";import{useEffect as ac,useState as pc}from"react";var Us=()=>{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(([a])=>[a,!1])),[o,i]=pc(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let a=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let f=window.matchMedia(l);return f.addEventListener("change",r),[d,f.matches]}));i(a)};return ac(()=>{s()},[]),o};import co from"react";import xe,{css as _s,keyframes as Ws}from"styled-components";var zs=_s`
|
|
1222
1223
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1223
|
-
`,
|
|
1224
|
+
`,dc=_s`
|
|
1224
1225
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1225
|
-
`,
|
|
1226
|
+
`,cc=Ws`
|
|
1226
1227
|
from {
|
|
1227
1228
|
opacity: 0;
|
|
1228
1229
|
} to {
|
|
1229
1230
|
opacity: 1;
|
|
1230
1231
|
}
|
|
1231
|
-
`,
|
|
1232
|
+
`,mc=Ws`
|
|
1232
1233
|
from {
|
|
1233
1234
|
opacity: 1;
|
|
1234
1235
|
} to {
|
|
1235
1236
|
opacity: 0;
|
|
1236
1237
|
}
|
|
1237
|
-
`,Hs=
|
|
1238
|
+
`,Hs=xe.div`
|
|
1238
1239
|
margin: 0 -20px;
|
|
1239
1240
|
overflow-x: auto;
|
|
1240
1241
|
padding-left: 20px;
|
|
@@ -1251,14 +1252,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1251
1252
|
::-webkit-scrollbar {
|
|
1252
1253
|
display: none;
|
|
1253
1254
|
}
|
|
1254
|
-
`,Vs=
|
|
1255
|
+
`,Vs=xe.div`
|
|
1255
1256
|
display: flex;
|
|
1256
1257
|
flex-flow: row nowrap;
|
|
1257
1258
|
gap: 0 16px;
|
|
1258
1259
|
scroll-snap-align: center;
|
|
1259
1260
|
scroll-snap-stop: always;
|
|
1260
|
-
`,js=
|
|
1261
|
-
animation: ${e=>e.reversed?cc
|
|
1261
|
+
`,js=xe.div`
|
|
1262
|
+
animation: ${e=>e.reversed?mc:cc} 0.25s ease-out;
|
|
1262
1263
|
background: linear-gradient(
|
|
1263
1264
|
to right,
|
|
1264
1265
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1267,7 +1268,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1267
1268
|
position: absolute;
|
|
1268
1269
|
width: 64px;
|
|
1269
1270
|
z-index: 10;
|
|
1270
|
-
`,Gs=
|
|
1271
|
+
`,Gs=xe.button`
|
|
1271
1272
|
${zs}
|
|
1272
1273
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1273
1274
|
align-items: center;
|
|
@@ -1279,10 +1280,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1279
1280
|
justify-content: center;
|
|
1280
1281
|
position: absolute;
|
|
1281
1282
|
width: 48px;
|
|
1282
|
-
`,Ks=
|
|
1283
|
+
`,Ks=xe.div`
|
|
1283
1284
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1284
1285
|
padding: 20px;
|
|
1285
|
-
`,qs=
|
|
1286
|
+
`,qs=xe(Ks)`
|
|
1286
1287
|
${zs}
|
|
1287
1288
|
background: ${({theme:e})=>e.colorBackground};
|
|
1288
1289
|
position: relative;
|
|
@@ -1295,104 +1296,104 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1295
1296
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1296
1297
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1297
1298
|
}
|
|
1298
|
-
`,Ys=
|
|
1299
|
+
`,Ys=xe.img`
|
|
1299
1300
|
border-radius: 50%;
|
|
1300
1301
|
height: 40px;
|
|
1301
1302
|
margin-bottom: 12px;
|
|
1302
1303
|
width: 40px;
|
|
1303
|
-
`,Js=
|
|
1304
|
-
${e=>
|
|
1305
|
-
${
|
|
1304
|
+
`,Js=xe(Ks)`
|
|
1305
|
+
${e=>B(e)} {
|
|
1306
|
+
${dc}
|
|
1306
1307
|
|
|
1307
1308
|
background: ${({theme:e})=>e.colorBackground};
|
|
1308
1309
|
}
|
|
1309
|
-
`,
|
|
1310
|
+
`,K0=xe.div`
|
|
1310
1311
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1311
1312
|
display: flex;
|
|
1312
1313
|
flex-flow: row nowrap;
|
|
1313
1314
|
align-items: center;
|
|
1314
|
-
`,
|
|
1315
|
+
`,q0=xe.div`
|
|
1315
1316
|
white-space: nowrap;
|
|
1316
|
-
`,Xs=
|
|
1317
|
+
`,Xs=xe.div`
|
|
1317
1318
|
background: #d8fed8;
|
|
1318
1319
|
border-radius: 6px;
|
|
1319
1320
|
float: right;
|
|
1320
1321
|
margin-bottom: 12px;
|
|
1321
1322
|
padding: 4px 10px;
|
|
1322
|
-
`,
|
|
1323
|
+
`,uc=xe.p`
|
|
1323
1324
|
font-weight: bold;
|
|
1324
1325
|
font-size: 18px;
|
|
1325
1326
|
line-height: 22px;
|
|
1326
1327
|
letter-spacing: calc(18px * -0.01);
|
|
1327
1328
|
margin: 0;
|
|
1328
|
-
`,Qs=
|
|
1329
|
+
`,Qs=xe(uc)`
|
|
1329
1330
|
margin-bottom: 4px;
|
|
1330
|
-
`,Zs=
|
|
1331
|
+
`,Zs=xe.div`
|
|
1331
1332
|
display: flex;
|
|
1332
1333
|
flex-flow: row nowrap;
|
|
1333
1334
|
align-items: center;
|
|
1334
1335
|
min-width: 50%;
|
|
1335
|
-
`,
|
|
1336
|
+
`,fc=xe.p`
|
|
1336
1337
|
font-weight: bold;
|
|
1337
1338
|
font-size: 16px;
|
|
1338
1339
|
line-height: 20px;
|
|
1339
1340
|
letter-spacing: calc(16px * -0.01);
|
|
1340
1341
|
margin: 0;
|
|
1341
|
-
`,Rs=
|
|
1342
|
+
`,Rs=xe(fc)`
|
|
1342
1343
|
margin-bottom: 4px;
|
|
1343
1344
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1344
1345
|
`}
|
|
1345
|
-
`,Tt=
|
|
1346
|
+
`,Tt=xe.p`
|
|
1346
1347
|
color: ${({theme:e})=>e.colorText};
|
|
1347
1348
|
font-weight: normal;
|
|
1348
1349
|
font-size: 14px;
|
|
1349
1350
|
line-height: 22px;
|
|
1350
1351
|
margin: 0;
|
|
1351
|
-
`,el=
|
|
1352
|
+
`,el=xe.p`
|
|
1352
1353
|
color: ${({theme:e})=>e.colorText};
|
|
1353
1354
|
font-weight: 600;
|
|
1354
1355
|
font-size: 12px;
|
|
1355
1356
|
line-height: 16px;
|
|
1356
1357
|
margin: 0;
|
|
1357
|
-
`;Tt.Loud=
|
|
1358
|
+
`;Tt.Loud=xe(Tt)`
|
|
1358
1359
|
font-weight: 600;
|
|
1359
|
-
`;Tt.Quiet=
|
|
1360
|
+
`;Tt.Quiet=xe(Tt)`
|
|
1360
1361
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1361
1362
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1362
1363
|
`}
|
|
1363
|
-
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=
|
|
1364
|
+
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ae(),{primaryCTAClickSideEffects:n}=fe();o=i(o);let{imageUri:r=null,subtitle:s=null,title:a=null,complete:d=!1,blocked:l=!1}=e,f=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return co.createElement(qs,{className:p("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&co.createElement(Ys,{className:p("carouselCardImage",o),src:r,alt:a,style:{opacity:d||l?.4:1}}),d&&co.createElement(Xs,{className:p("carouselCompletedPill",o)},co.createElement(el,{style:{color:"#108E0B"}},"Complete")),a&&co.createElement(Rs,{blocked:l,complete:d,className:p("carouselCardTitle",o)},a),s&&co.createElement(Tt.Quiet,{blocked:l,complete:d,className:p("carouselCardSubtitle",o)},s))};var hc=()=>he.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},he.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ol=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Ht(!1),[r,s]=Ht(!1);Zr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let a=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?he.createElement(js,{style:d,reversed:r,onAnimationEnd:r?a:null},he.createElement(Gs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},he.createElement(hc,null))):null},rl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=gc(null),[r,s]=Ht(!1),[a,d]=Ht(!1),[l,f]=Ht(null),[c,g]=Ht([]),[S,w]=Ht(0),{isSmall:h}=Us(),x=h?1:3,{getFlowMetadata:T,getFlowSteps:y,getNumberOfStepsCompleted:F,updateCustomVariables:O,isLoading:v}=ie();Zr(()=>{O(o)},[o,v]),Zr(()=>{if(v)return;let I=T(e),D=F(e),z=y(e);f(I),(I.data!==null||I.steps!==null)&&(g(z.sort((H,Q)=>Number(H.complete)-Number(Q.complete))),d(z.length>x),w(D))},[v]);let m=[];for(let I=0;I<c.length;I+=x)m.push(c.slice(I,I+x));let N=I=>{let D=I.target,z=D.scrollWidth-D.clientWidth,H=Math.ceil(D.scrollLeft);H>0&&r===!1&&s(!0),H===0&&r===!0&&s(!1),H<z&&a===!1&&d(!0),H===z&&a===!0&&d(!1)},E=(I=!0)=>{let D=I?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*D,behavior:"smooth"})},P=null,A=I=>{P!==null?clearTimeout(P):N(I),P=setTimeout(()=>{N(I)},16)};return v?null:he.createElement(Js,{className:we(p("carouselContainer",t),i)},he.createElement("div",{style:{display:"flex",justifyContent:h?"center":"space-between",marginBottom:20,flexWrap:h?"wrap":"nowrap",gap:h?16:20}},he.createElement("div",null,he.createElement(Qs,{className:p("carouselTitle",t)},l==null?void 0:l.title),he.createElement(Tt.Quiet,{className:p("carouselSubtitle",t)},l==null?void 0:l.subtitle)),he.createElement(Zs,{className:p("progressWrapper",t)},he.createElement(ze,{count:S,total:c.length,appearance:t}))),he.createElement("div",{style:{position:"relative"}},he.createElement(ol,{show:r,onClick:()=>E(!1)}),he.createElement(ol,{side:"right",show:a,onClick:E}),he.createElement(Hs,{ref:n,onScroll:A},m.map((I,D)=>he.createElement(Vs,{key:D,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},I.map((z,H)=>he.createElement(tl,{key:H,stepData:z,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),he.createElement(ne,{appearance:t}))};var Rr=O=>{var v=O,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:a,visible:d,customVariables:l,onStepCompletion:f,onButtonClick:c,appearance:g,hideOnFlowCompletion:S,setVisible:w,customStepTypes:h,checklistStyle:x="default",autoExpandFirstIncompleteStep:T,autoExpandNextStep:y}=v,F=Le(v,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:m,getFlowSteps:N,markStepCompleted:E,getStepStatus:P,getNumberOfStepsCompleted:A,isLoading:I,targetingLogicShouldHideFlow:D,updateCustomVariables:z,getFlowMetadata:H,isStepBlocked:Q,getFlowStatus:te,hasActiveFullPageFlow:U,setHasActiveFullPageFlow:W,markStepStarted:oe,getCurrentStepIndex:J}=ie(),{primaryCTAClickSideEffects:me,secondaryCTAClickSideEffects:De}=fe(),{getOpenFlowState:Ee,setOpenFlowState:X}=Ae(),[L,re]=il(n||0),[Fe,Ve]=il(!1),ke=d===void 0?Ee(e):d,se=s==="modal",{mergeAppearanceWithDefault:V}=ae();Ge(e,d);let j=N(e),Z=J(e);if(g=V(g),hr(()=>{z(l)},[l,I]),hr(()=>{d!==void 0&&(se&&d===!0?W(!0):se&&d===!1&&W(!1))},[d,w,U]),hr(()=>{!I&&j&&j[L]&&P(e,j[L].id)&&P(e,j[L].id)!==$e&&oe(e,j[L].id)},[L]),hr(()=>{L!==Z&&re(Z)},[Z]),I)return null;let $=m(e);if(!$||D($)||!j||S===!0&&te(e)===le)return null;let Y=H(e);if(Y!=null&&Y.title&&(t=Y.title),Y!=null&&Y.subtitle&&(o=Y.subtitle),!Fe&&n===void 0&&A(e)>0){let u=j.findIndex(C=>C.complete===!1);re(u>-1?u:j.length-1),Ve(!0)}function be(){if(L+1>=j.length){se&&X(e,!1);return}Q(e,j[L+1].id)||re(L+1)}function je(u,C,k){let _=L+1<j.length?j[L+1]:null;c&&c(u,L,C,_)===!0&&se&&Xe(),f&&f(u,k,_),!f&&!c&&(u.primaryButtonUri||u.secondaryButtonUri)&&se&&Xe()}function xt(){return j.map((u,C)=>G(b({},u),{handleSecondaryButtonClick:()=>{be(),De(u),u.skippable===!0&&E(e,u.id,{skipped:!0}),je(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(E(e,u.id),be()),je(u,"primary",C),me(u),P(e,u.id)===$e&&be()}}))}function qe(){return Ce.createElement(ne,{appearance:g})}let nt={steps:xt(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:h,type:s,className:r,autoExpandFirstIncompleteStep:T,autoExpandNextStep:y};function Xe(){X(e,!1),a&&a(),w&&w(!1)}function vt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(qe,null),Ce.createElement(rl,{flowId:e,appearance:g,customVariables:l,className:r}))}function jt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(qe,null),Ce.createElement(Qr,b({visible:ke,onClose:()=>{Xe()},selectedStep:L,setSelectedStep:re,autoExpandNextStep:!0,appearance:g},nt)))}function Gt(){var k;let u=F.guideFlowId,C;return u&&m(u)&&(C=N(u)),Ce.createElement(Ce.Fragment,null,Ce.createElement(qe,null),Ce.createElement(Xr,b({visible:ke,stepsTitle:Y.stepsTitle?Y.stepsTitle:"Your quick start guide",onClose:()=>{Xe()},selectedStep:L,setSelectedStep:re,guideData:C,guideTitle:(k=F.guideTitle)!=null?k:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:_=>{je(_,"link",0)},customStepTypes:h},nt)))}function Bt(){let u=Ce.createElement(Yr,b({flowId:e,style:i,selectedStep:L,setSelectedStep:re,appearance:g,type:s},nt));return se?Ce.createElement(Re,{onClose:()=>{Xe()},visible:ke,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Ce.createElement(qe,null),u):Ce.createElement(Ce.Fragment,null,Ce.createElement(qe,null),u)}switch(x){case"condensed":return jt();case"with-guide":return Gt();case"default":return Bt();case"carousel":return vt();default:return Bt()}};var Cc=e=>xc.createElement(Rr,b({type:"inline"},e));import kt,{useEffect as yc}from"react";import rt from"react";import xr from"styled-components";var nl=xr.div`
|
|
1364
1365
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1365
1366
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1366
1367
|
padding: 10px 12px 10px 12px;
|
|
1367
1368
|
min-width: 160px;
|
|
1368
1369
|
cursor: pointer;
|
|
1369
1370
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1370
|
-
${e=>
|
|
1371
|
+
${e=>ve(e)}
|
|
1371
1372
|
|
|
1372
1373
|
&:hover {
|
|
1373
1374
|
filter: brightness(.99);
|
|
1374
1375
|
}
|
|
1375
|
-
`,sl=
|
|
1376
|
+
`,sl=xr.div`
|
|
1376
1377
|
display: flex;
|
|
1377
1378
|
flex-direction: row;
|
|
1378
1379
|
justify-content: space-between;
|
|
1379
1380
|
align-items: center;
|
|
1380
1381
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1381
1382
|
flex-grow: 2;
|
|
1382
|
-
`,ll=
|
|
1383
|
+
`,ll=xr.div`
|
|
1383
1384
|
text-overflow: ellipsis;
|
|
1384
1385
|
font-weight: 600;
|
|
1385
1386
|
font-size: 14px;
|
|
1386
1387
|
line-height: 16px;
|
|
1387
1388
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1388
1389
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1389
|
-
`,al=
|
|
1390
|
+
`,al=xr.div`
|
|
1390
1391
|
width: 20px;
|
|
1391
1392
|
margin-right: 8px;
|
|
1392
1393
|
display: flex;
|
|
1393
1394
|
height: 100%;
|
|
1394
1395
|
align-items: center;
|
|
1395
|
-
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:a="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(
|
|
1396
|
+
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:a="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(ne,{appearance:s}),rt.createElement(nl,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},a=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:we(r!=null?r:"",p("progressBadgeContainer",s)),appearance:s},a=="condensed"&&o&&o!==0&&rt.createElement(al,{className:p("progressRingContainer",s)},rt.createElement(Qt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),rt.createElement(sl,{type:a,className:p("badgeTitleContainer",s)},rt.createElement(ll,{type:a,appearance:s,className:p("badgeTitle",s)},e),i!==void 0&&rt.createElement(ao,{className:p("badgeChevron",s),color:s.theme.colorPrimary})),a=="default"&&o&&o!==0&&rt.createElement(ze,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ft from"react";import Mo from"styled-components";var dl=Mo.div`
|
|
1396
1397
|
display: flex;
|
|
1397
1398
|
flex-direction: row;
|
|
1398
1399
|
width: 100%;
|
|
@@ -1402,25 +1403,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1402
1403
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1403
1404
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1404
1405
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1405
|
-
`,cl=
|
|
1406
|
-
${e=>
|
|
1406
|
+
`,cl=Mo.div`
|
|
1407
|
+
${e=>B(e)} {
|
|
1407
1408
|
display: flex;
|
|
1408
1409
|
justify-content: center;
|
|
1409
1410
|
align-items: center;
|
|
1410
1411
|
margin-right: 16px;
|
|
1411
1412
|
}
|
|
1412
|
-
`,ml=
|
|
1413
|
+
`,ml=Mo.div`
|
|
1413
1414
|
display: flex;
|
|
1414
1415
|
flex-direction: column;
|
|
1415
1416
|
flex: 1;
|
|
1416
1417
|
margin-top: 0;
|
|
1417
|
-
`,ul=
|
|
1418
|
+
`,ul=Mo.div`
|
|
1418
1419
|
display: flex;
|
|
1419
1420
|
flex-direction: column;
|
|
1420
1421
|
justify-content: center;
|
|
1421
1422
|
margin-left: 16px;
|
|
1422
1423
|
min-width: 200px;
|
|
1423
|
-
`,
|
|
1424
|
+
`,JS=Mo.div`
|
|
1424
1425
|
display: flex;
|
|
1425
1426
|
justify-content: center;
|
|
1426
1427
|
align-items: flex-end;
|
|
@@ -1429,7 +1430,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1429
1430
|
:hover {
|
|
1430
1431
|
opacity: 0.8;
|
|
1431
1432
|
}
|
|
1432
|
-
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:a})=>Ft.createElement(Ft.Fragment,null,Ft.createElement(dl,{appearance:i,className:
|
|
1433
|
+
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:a})=>Ft.createElement(Ft.Fragment,null,Ft.createElement(dl,{appearance:i,className:we(p("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:a},o&&Ft.createElement(cl,{className:p("fullWidthProgressBadgeIcon",i)},o),Ft.createElement(ml,null,Ft.createElement(Ne,{size:"small",appearance:i,title:e,subtitle:t})),Ft.createElement(ul,{className:p("fullWidthProgressBadgeProgressContainer",i)},Ft.createElement(ze,{count:n,total:r,display:"percent",textLocation:"top"}))));var Sc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:a,hideOnFlowCompletion:d,appearance:l,type:f="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:S,getNumberOfStepsCompleted:w,isLoading:h,targetingLogicShouldHideFlow:x,updateCustomVariables:T}=ie(),{mergeAppearanceWithDefault:y}=ae();l=y(l);let{setOpenFlowState:F,getOpenFlowState:O}=Ae();if(yc(()=>{T(a)},[a,h]),h)return null;let v=c(e);if(!v||x(v)||d===!0&&S(e)===le)return null;let m=g(e),N=w(e);return f==="full-width"?kt.createElement(kt.Fragment,null,kt.createElement(ne,{appearance:l}),kt.createElement(fl,{title:t,subtitle:o,count:N,total:m.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):kt.createElement(kt.Fragment,null,kt.createElement(ne,{appearance:l}),kt.createElement(pl,{count:N,total:m.length,title:t,style:n,onClick:()=>{F(e,!0),r&&r()},type:f,className:s,appearance:l}))};import bc from"react";var wc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Le(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:a,getFlowSteps:d}=ie(),{mergeAppearanceWithDefault:l}=ae();o=l(o);let f=s(e);if(!f||a(f))return null;let c=d(e);return bc.createElement($o,b({steps:c,style:t,appearance:o},i))};import gt,{useContext as $c,useEffect as Mc}from"react";import q,{useEffect as mo,useLayoutEffect as xl,useRef as Bc,useState as uo}from"react";import Do from"styled-components";import{useCallback as Tc,useEffect as Fc,useState as kc}from"react";var ei=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}};function gl(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,n]=kc(o),r=Tc(()=>{e&&n(e.getBoundingClientRect())},[e]);return Fc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Pc,useState as vc}from"react";function hl(){let{debug:e}=Pc(ee),[t,o]=vc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var Cl=300,yl=100,Ec=500,fo=12,Ac=Do.div`
|
|
1433
1434
|
width: 100%;
|
|
1434
1435
|
height: 100%;
|
|
1435
1436
|
border-radius: 9999px;
|
|
@@ -1452,26 +1453,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1452
1453
|
opacity: 0;
|
|
1453
1454
|
}
|
|
1454
1455
|
}
|
|
1455
|
-
`,
|
|
1456
|
-
width: ${
|
|
1457
|
-
height: ${
|
|
1456
|
+
`,Ic=Do.div`
|
|
1457
|
+
width: ${fo}px;
|
|
1458
|
+
height: ${fo}px;
|
|
1458
1459
|
border-radius: 100px;
|
|
1459
1460
|
background-color: ${e=>e.primaryColor};
|
|
1460
1461
|
z-index: 20;
|
|
1461
1462
|
opacity: 1;
|
|
1462
|
-
`,Nc
|
|
1463
|
+
`,Nc=Do.div`
|
|
1463
1464
|
pointer-events: all;
|
|
1464
|
-
`,Sl
|
|
1465
|
+
`,Sl=Do.div`
|
|
1465
1466
|
display: flex;
|
|
1466
1467
|
align-content: center;
|
|
1467
1468
|
justify-content: center;
|
|
1468
1469
|
align-items: center;
|
|
1469
1470
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1470
|
-
`,Oc
|
|
1471
|
-
width: ${
|
|
1472
|
-
height: ${
|
|
1473
|
-
`,
|
|
1474
|
-
${e=>
|
|
1471
|
+
`,Oc=Do(Sl)`
|
|
1472
|
+
width: ${fo+12}px;
|
|
1473
|
+
height: ${fo+12}px;
|
|
1474
|
+
`,Lc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:a=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:f,appearance:c,dismissible:g=!1,showHighlightOnly:S,showStepCount:w=!0,completedStepsCount:h=0,showFrigadeBranding:x=!1,cssPosition:T="absolute",onViewTooltip:y,className:F})=>{var xt,qe,nt,Xe,vt,jt,Gt,Bt,u,C,k,_,Pe,Et,At,It,ge,ho,xo;let{logErrorIfDebugMode:O}=hl(),[v,m]=uo(),[N,E]=uo(new Date),P=Bc(null),[A,I]=uo(document.querySelector(e[l].selector)),D=gl(A,N),[z,H]=uo(),[Q,te]=uo(!S),U=(qe=(xt=e[l])==null?void 0:xt.props)!=null&&qe.position?e[l].props.position:T,W=(vt=(Xe=(nt=e[l])==null?void 0:nt.props)==null?void 0:Xe.zIndex)!=null?vt:90,oe=(jt=v==null?void 0:v.width)!=null?jt:Cl,J=(Gt=v==null?void 0:v.height)!=null?Gt:yl,[me,De]=uo(new Date().getTime());s=(C=(u=(Bt=e[l])==null?void 0:Bt.props)==null?void 0:u.offset)!=null?C:s;let Ee=window.location.pathname.split("/").pop();xl(()=>{P.current&&m({width:P.current.clientWidth,height:P.current.clientHeight})},[l,N,U]),mo(()=>{S||te(!0)},[l]),mo(()=>{a&&Q&&y(l)},[Q]);let X=()=>{if(U==="static")return;let R=document.querySelector(e[l].selector);if(!R){H(void 0),I(null),O(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}z&&z===JSON.stringify(R==null?void 0:R.getBoundingClientRect())||(I(R),E(new Date),R&&H(JSON.stringify(R.getBoundingClientRect())))};if(mo(()=>{let R=new MutationObserver(X);return R.observe(document.body,{subtree:!0,childList:!0}),()=>R.disconnect()},[X]),mo(()=>{let R=new MutationObserver(X);return R.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>R.disconnect()},[X]),mo(()=>{let R=setInterval(()=>{X()},10);return()=>clearInterval(R)},[X]),xl(()=>{setTimeout(()=>{X()},Ec),X()},[l,Ee]),mo(()=>{if(!a)return;let R=Qe=>{Qe.key==="Escape"&&t()};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[]),A===null||!a)return null;let L=i==="auto"?"right":i,re=ei(D,L,oe,s,U),Fe=D.right+oe>(window.innerWidth||document.documentElement.clientWidth),Ve=D.bottom+yl>(window.innerHeight||document.documentElement.clientHeight);Fe&&i==="auto"&&(re=ei(D,"left",oe,s,U),L="left"),(_=(k=e[l])==null?void 0:k.props)!=null&&_.tooltipPosition&&((Et=(Pe=e[l])==null?void 0:Pe.props)==null?void 0:Et.tooltipPosition)!=="auto"&&(((It=(At=e[l])==null?void 0:At.props)==null?void 0:It.tooltipPosition)==="left"||((ho=(ge=e[l])==null?void 0:ge.props)==null?void 0:ho.tooltipPosition)==="right")&&(L=e[l].props.tooltipPosition);let ke=()=>{let R=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),te(!1),setTimeout(()=>{X()},30)),h===e.length-1)return o()},Qe=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),S&&!e[l].secondaryButtonUri&&te(!1))};return q.createElement(q.Fragment,null,w&&e.length>1&&q.createElement(Fi,null,q.createElement(Pi,{role:"status",className:p("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&q.createElement(ki,{showStepCount:w,className:p("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&q.createElement(de,{title:e[l].secondaryButtonTitle,appearance:c,onClick:Qe,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&q.createElement(de,{title:e[l].primaryButtonTitle,appearance:c,onClick:R,autoFocus:!0,withMargin:!1,size:"small"})))},se=()=>{var R;return q.createElement(q.Fragment,null,g&&q.createElement(yi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:p("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},q.createElement(Ie,null)),e[l].imageUri&&q.createElement(Si,{dismissible:g,appearance:c,role:"img","aria-label":e[l].title,src:e[l].imageUri,className:p("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&q.createElement(bi,{dismissible:g,appearance:c,role:"video","aria-label":e[l].title,className:p("tooltipVideoContainer",c)},q.createElement(tt,{appearance:c,videoUri:e[l].videoUri,autoplay:(R=e[l].props)==null?void 0:R.autoplayVideo})),q.createElement(Ti,{className:p("tooltipContentContainer",c)},q.createElement(Ne,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small",ariaPrefix:`Tooltip${e[l].id}`}),q.createElement(wi,{className:p("tooltipFooter",c)},q.createElement(ke,null))))},j=b(b({},{default:R=>{var Qe;if((Qe=e[l])!=null&&Qe.StepContent){let na=e[l].StepContent;return q.createElement("div",null,na)}return q.createElement(se,null)}}),f),Z=()=>{var R;return e?!((R=e[l])!=null&&R.type)||!j[e[l].type]?j.default(e[l]):j[e[l].type]({stepData:e[l],primaryColor:r}):q.createElement(q.Fragment,null)};if(e[l].complete===!0||re.x==0&&re.y==0&&new Date().getTime()-me<100)return null;let $={top:(re==null?void 0:re.y)-fo,left:(xo=L=="left"?D.x+s.x:(re==null?void 0:re.x)-fo)!=null?xo:0,cursor:S?"pointer":"default",position:U},Y=()=>{let Qe=$.left+(L=="left"?-oe:24);return Math.min(Math.max(Qe,20),window.innerWidth-oe-20)},be=()=>{if(U==="fixed")return $.top;let R=$.top+J,Qe=20;return R>window.innerHeight-Qe?$.top+-J:$.top},je=()=>{S&&(E(new Date),te(!Q))};return q.createElement(Nc,{className:F},q.createElement(Oc,{style:$,zIndex:W,className:p("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&T!=="static"&&q.createElement(q.Fragment,null,q.createElement(Ic,{style:{position:U},onClick:je,primaryColor:c.theme.colorPrimary,className:p("tourHighlightInnerCircle",c)}),q.createElement(Ac,{style:{position:"absolute"},onClick:je,primaryColor:c.theme.colorPrimary,className:p("tourHighlightOuterCircle",c)}))),q.createElement(Sl,{style:G(b({},$),{left:Y(),top:be()}),zIndex:W+1,className:p("tooltipContainerWrapper",c)},Q&&q.createElement(q.Fragment,null,q.createElement(Vo,{ref:P,role:"dialog","aria-labelledby":`frigadeTooltip${e[l].id}Title`,"aria-describedby":`frigadeTooltip${e[l].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:b({position:"relative",width:"max-content",right:0,top:T!=="static"?12:0},d),appearance:c,className:p("tooltipContainer",c),maxWidth:Cl,zIndex:W+10},q.createElement(Z,null)),x&&q.createElement(Bi,{className:p("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:W+10},q.createElement(jo,{appearance:c})))))},Uo=Lc;import{Portal as Dc}from"react-portal";var Uc=x=>{var T=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:a,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:f="skip-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:S="absolute",className:w}=T,h=Le(T,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:y,getFlowSteps:F,isLoading:O,targetingLogicShouldHideFlow:v,markStepCompleted:m,markStepStarted:N,markFlowCompleted:E,markFlowSkipped:P,updateCustomVariables:A,getCurrentStepIndex:I,getStepStatus:D,isStepBlocked:z,getFlowStatus:H,getNumberOfStepsCompleted:Q}=ie(),{isLoadingUserFlowStateData:te}=_e(),{primaryCTAClickSideEffects:U,secondaryCTAClickSideEffects:W}=fe(),{hasOpenModals:oe}=Ae(),J=I(e),{openFlowStates:me}=$c(ee),{mergeAppearanceWithDefault:De}=ae();if(o=De(o),Mc(()=>{A(t)},[t,O]),te)return null;let Ee=y(e);if(!Ee||v(Ee)||H(e)==le||oe())return null;let X=F(e);if(Object.keys(me).length>0){let $=Object.keys(me).find(Y=>me[Y]===!0);if($!==void 0&&$!==e)return gt.createElement(gt.Fragment,null)}function L($){return M(this,null,function*(){if(yield m(e,$.id),X.map(Y=>D(e,Y.id)).every(Y=>Y===$e)){yield E(e);return}!l&&J+1<X.length&&!r&&z(e,X[J+1].id)})}function re($,Y,be){let je=J+1<X.length?X[J+1]:null;n&&n($,J,Y,je),i&&i($,be,je)}function Fe(){return X.map($=>G(b({},$),{handleSecondaryButtonClick:()=>M(this,null,function*(){W($),$.skippable===!0&&(yield m(e,$.id,{skipped:!0})),re($,"secondary",J)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!$.completionCriteria&&($.autoMarkCompleted||$.autoMarkCompleted===void 0)||$.completionCriteria&&$.autoMarkCompleted===!0)&&(yield L($)),re($,"primary",J),U($)})}))}function Ve($){return M(this,null,function*(){s&&s(),f==="skip-flow"?yield P(e):yield m(e,$.id)})}function ke(){c&&c()}function se($){return M(this,null,function*(){yield N(e,X[$].id)})}let V=!document.querySelector(X[J].selector);function j(){let $=X.findIndex((Y,be)=>!!document.querySelector(Y.selector)&&be>=J);return X.map((Y,be)=>r?gt.createElement(Uo,b({key:Y.id,appearance:o,steps:Fe(),selectedStep:be,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>Ve(Y),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:Q(e),onComplete:ke,cssPosition:S,onViewTooltip:se,className:w},h)):g&&V&&be===$?gt.createElement(Uo,b({key:Y.id,appearance:o,steps:Fe(),selectedStep:be,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>Ve(Y),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:Q(e),onComplete:ke,cssPosition:S,onViewTooltip:se,className:w},h)):be!=J?null:gt.createElement(Uo,b({key:Y.id,appearance:o,steps:Fe(),selectedStep:be,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>Ve(Y),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:Q(e),onComplete:ke,cssPosition:S,onViewTooltip:se,className:w},h)))}function Z(){return gt.createElement(gt.Fragment,null,gt.createElement(ne,{appearance:o}),j())}return S==="static"?Z():gt.createElement(Dc,null,Z())};import Oe,{useEffect as _c,useRef as Wc,useState as zc}from"react";import{Portal as Hc}from"react-portal";import Vt from"styled-components";var bl=Vt.button`
|
|
1475
|
+
${e=>B(e)} {
|
|
1475
1476
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1476
1477
|
|
|
1477
1478
|
display: flex;
|
|
@@ -1488,17 +1489,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1488
1489
|
opacity: 0.8;
|
|
1489
1490
|
}
|
|
1490
1491
|
}
|
|
1491
|
-
`,wl=
|
|
1492
|
-
${e=>
|
|
1492
|
+
`,wl=Vt.span`
|
|
1493
|
+
${e=>B(e)} {
|
|
1493
1494
|
font-size: 12px;
|
|
1494
1495
|
display: inline-block;
|
|
1495
1496
|
}
|
|
1496
|
-
`,Tl=
|
|
1497
|
-
${e=>
|
|
1497
|
+
`,Tl=Vt.span`
|
|
1498
|
+
${e=>B(e)} {
|
|
1498
1499
|
font-size: 12px;
|
|
1499
1500
|
display: inline-block;
|
|
1500
1501
|
}
|
|
1501
|
-
`,Fl=
|
|
1502
|
+
`,Fl=Vt.div`
|
|
1502
1503
|
position: fixed;
|
|
1503
1504
|
right: 0;
|
|
1504
1505
|
bottom: 0;
|
|
@@ -1508,8 +1509,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1508
1509
|
flex-direction: column;
|
|
1509
1510
|
align-items: flex-end;
|
|
1510
1511
|
z-index: 50;
|
|
1511
|
-
`,kl=
|
|
1512
|
-
${e=>
|
|
1512
|
+
`,kl=Vt.button`
|
|
1513
|
+
${e=>B(e)} {
|
|
1513
1514
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1514
1515
|
background-color: #ffffff;
|
|
1515
1516
|
border: 1px solid #f5f5f5;
|
|
@@ -1524,8 +1525,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1524
1525
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1525
1526
|
border-radius: 45px;
|
|
1526
1527
|
cursor: pointer;
|
|
1527
|
-
`,Pl=
|
|
1528
|
-
${e=>
|
|
1528
|
+
`,Pl=Vt.div`
|
|
1529
|
+
${e=>B(e)} {
|
|
1529
1530
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1530
1531
|
background: #ffffff;
|
|
1531
1532
|
}
|
|
@@ -1541,8 +1542,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1541
1542
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1542
1543
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1543
1544
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1544
|
-
`,vl=
|
|
1545
|
-
${e=>
|
|
1545
|
+
`,vl=Vt.button`
|
|
1546
|
+
${e=>B(e)} {
|
|
1546
1547
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1547
1548
|
color: #434343;
|
|
1548
1549
|
:hover {
|
|
@@ -1558,8 +1559,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1558
1559
|
font-size: 14px;
|
|
1559
1560
|
|
|
1560
1561
|
padding: 8px 12px;
|
|
1561
|
-
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.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 Al from"react";var
|
|
1562
|
-
${e=>
|
|
1562
|
+
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.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 Al from"react";var Il=({style:e,className:t})=>Al.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"},Al.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 Vc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:a,getFlowSteps:d,markStepCompleted:l,getStepStatus:f,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S}=ie(),{primaryCTAClickSideEffects:w}=fe(),h=Wc(null),[x,T]=zc(!1),{mergeAppearanceWithDefault:y}=ae();s=y(s),_c(()=>(document.addEventListener("click",F,!1),()=>{document.removeEventListener("click",F,!1)}),[]);let F=E=>{h.current&&!h.current.contains(E.target)&&T(!1)};if(g)return null;let O=a(e);if(!O||S(O))return null;let v=d(e);if(!v||!i)return null;function m(E,P){!E.completionCriteria&&(E.autoMarkCompleted||E.autoMarkCompleted===void 0)&&l(e,E.id),w(E),o&&o(E,P),T(!1)}function N(){return x&&Oe.createElement(Pl,{className:p("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},v.map((E,P)=>Oe.createElement(vl,{className:p("floatingWidgetMenuItem",s),key:P,onClick:()=>m(E,P)},E.title)))}return n=="inline"?Oe.createElement("span",{ref:h},Oe.createElement(ne,{appearance:s}),Oe.createElement(bl,{style:t,onClick:()=>{T(!x)},className:p("supportButton",s)},Oe.createElement(Tl,{className:p("supportIconContainer",s)},Oe.createElement(Il,{className:p("supportIcon",s),style:{width:"18px",height:"18px"}})),Oe.createElement(wl,{className:p("supportButtonTitle",s)},r)),Oe.createElement(N,null)):Oe.createElement(Hc,null,Oe.createElement(ne,{appearance:s}),Oe.createElement(Fl,{style:t,ref:h},Oe.createElement(N,null),Oe.createElement(kl,{onClick:()=>{T(!x)},whileHover:{scale:1.1},className:p("floatingWidgetButton",s)},Oe.createElement(El,{className:p("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import it,{useEffect as jc}from"react";import Cr from"styled-components";var Nl=Cr.div`
|
|
1563
|
+
${e=>B(e)} {
|
|
1563
1564
|
display: flex;
|
|
1564
1565
|
flex-direction: column;
|
|
1565
1566
|
width: 100%;
|
|
@@ -1573,18 +1574,18 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1573
1574
|
border-radius: 12px;
|
|
1574
1575
|
position: relative;
|
|
1575
1576
|
}
|
|
1576
|
-
`,
|
|
1577
|
+
`,Ol=Cr.div`
|
|
1577
1578
|
display: flex;
|
|
1578
1579
|
flex-direction: column;
|
|
1579
1580
|
flex: 1;
|
|
1580
|
-
`,Ll=
|
|
1581
|
+
`,Ll=Cr.div`
|
|
1581
1582
|
display: flex;
|
|
1582
1583
|
flex-direction: column;
|
|
1583
1584
|
justify-content: center;
|
|
1584
1585
|
align-items: flex-start;
|
|
1585
1586
|
margin-top: 16px;
|
|
1586
|
-
`,$l=
|
|
1587
|
-
${e=>
|
|
1587
|
+
`,$l=Cr.div`
|
|
1588
|
+
${e=>B(e)} {
|
|
1588
1589
|
position: absolute;
|
|
1589
1590
|
top: 16px;
|
|
1590
1591
|
right: 16px;
|
|
@@ -1594,9 +1595,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1594
1595
|
opacity: 0.8;
|
|
1595
1596
|
}
|
|
1596
1597
|
}
|
|
1597
|
-
`;var
|
|
1598
|
+
`;var Gc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:f,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:S,getFlowSteps:w,getFlowStatus:h,getCurrentStepIndex:x}=ie(),{primaryCTAClickSideEffects:T}=fe(),{mergeAppearanceWithDefault:y}=ae();if(Ge(e),n=y(n),jc(()=>{S(o)},[o,c]),c)return null;let F=d(e);if(!F||g(F)||h(e)===le)return null;let v=w(e)[x(e)];return it.createElement(it.Fragment,null,it.createElement(ne,{appearance:n}),it.createElement(Nl,{appearance:n,className:we(p("embeddedTipContainer",n),r),style:s},(a===!0||v.dismissible)&&it.createElement($l,{onClick:()=>M(void 0,null,function*(){yield l(e),t&&t()}),className:p("embeddedTipDismissButton",n)},it.createElement(Ie,null)),it.createElement(Ol,null,it.createElement(Ne,{size:"small",appearance:n,title:v.title,subtitle:v.subtitle})),v.primaryButtonTitle&&it.createElement(Ll,{className:p("embeddedTipCallToActionContainer",n)},it.createElement(de,{classPrefix:"embeddedTip",title:v.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>M(void 0,null,function*(){v.handlePrimaryButtonClick(),T(v),!(i&&i(v,x(e),"primary")===!1)&&(yield f(e,v.id),yield l(e))})}))))};import Be,{useEffect as Kc}from"react";import go from"styled-components";var Ml=go.div`
|
|
1598
1599
|
// use the :not annotation
|
|
1599
|
-
${e=>
|
|
1600
|
+
${e=>B(e)} {
|
|
1600
1601
|
display: flex;
|
|
1601
1602
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1602
1603
|
width: 100%;
|
|
@@ -1606,24 +1607,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1606
1607
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1607
1608
|
border-radius: 12px;
|
|
1608
1609
|
}
|
|
1609
|
-
`,Dl=
|
|
1610
|
-
${e=>
|
|
1610
|
+
`,Dl=go.div`
|
|
1611
|
+
${e=>B(e)} {
|
|
1611
1612
|
display: flex;
|
|
1612
1613
|
width: 46px;
|
|
1613
1614
|
height: 46px;
|
|
1614
1615
|
}
|
|
1615
|
-
`,Ul=
|
|
1616
|
+
`,Ul=go.div`
|
|
1616
1617
|
display: flex;
|
|
1617
1618
|
flex-direction: column;
|
|
1618
1619
|
flex: 1;
|
|
1619
1620
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1620
1621
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1621
|
-
`,_l=
|
|
1622
|
+
`,_l=go.div`
|
|
1622
1623
|
display: flex;
|
|
1623
1624
|
flex-direction: column;
|
|
1624
1625
|
justify-content: center;
|
|
1625
1626
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1626
|
-
`,
|
|
1627
|
+
`,ti=go.div`
|
|
1627
1628
|
display: flex;
|
|
1628
1629
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1629
1630
|
align-items: flex-end;
|
|
@@ -1631,12 +1632,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1631
1632
|
:hover {
|
|
1632
1633
|
opacity: 0.8;
|
|
1633
1634
|
}
|
|
1634
|
-
`,
|
|
1635
|
+
`,oi=go.div`
|
|
1635
1636
|
display: flex;
|
|
1636
1637
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1637
1638
|
align-items: flex-end;
|
|
1638
1639
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1639
|
-
`;import
|
|
1640
|
+
`;import ri from"react";var Wl=({style:e,className:t})=>ri.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},ri.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),ri.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 qc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:a="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:f,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:S,getFlowMetadata:w,getFlowStatus:h,getFlowSteps:x,getCurrentStepIndex:T}=ie(),{primaryCTAClickSideEffects:y}=fe(),{mergeAppearanceWithDefault:F}=ae();if(Ge(e),s=F(s),Kc(()=>{S(n)},[n,c]),c)return null;let O=l(e);if(!O||g(O)||h(e)===le)return null;let v=x(e),m=v.length>0?v[T(e)]:w(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),Be.createElement(Be.Fragment,null,Be.createElement(ne,{appearance:s}),Be.createElement(Ml,{type:a,appearance:s,className:p("bannerContainer",s)},a!="square"&&Be.createElement(Dl,{className:p("bannerIconContainer",s)},d||Be.createElement(Wl,null)),a==="square"&&m.dismissible&&Be.createElement(oi,{type:a,className:p("bannerDismissButtonContainer",s)},Be.createElement(ti,{type:a,onClick:()=>M(void 0,null,function*(){yield f(e),i&&i()}),className:p("bannerDismissButton",s)},Be.createElement(Ie,null))),Be.createElement(Ul,{type:a},Be.createElement(Ne,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&Be.createElement(_l,{type:a,className:p("bannerCallToActionContainer",s)},Be.createElement(de,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{y(m),r&&r(m,0,"primary")},classPrefix:"banner"})),a!=="square"&&m.dismissible&&Be.createElement(oi,{type:a,className:p("bannerDismissButtonContainer",s)},Be.createElement(ti,{type:a,onClick:()=>M(void 0,null,function*(){yield f(e),i&&i()}),className:p("bannerDismissButton",s)},Be.createElement(Ie,null)))))};import ce,{useEffect as Yc}from"react";import{Portal as Jc}from"react-portal";import ht from"styled-components";var zl=ht.div`
|
|
1640
1641
|
display: flex;
|
|
1641
1642
|
flex-direction: column;
|
|
1642
1643
|
width: 100%;
|
|
@@ -1658,7 +1659,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1658
1659
|
border-width: 1px;
|
|
1659
1660
|
border-color: ${t=>t.appearance.theme.colorBorder};
|
|
1660
1661
|
border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
|
|
1661
|
-
`,Hl=
|
|
1662
|
+
`,Hl=ht.button`
|
|
1662
1663
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1663
1664
|
border-radius: 8px;
|
|
1664
1665
|
// If selected make border color primary and text color color priamry
|
|
@@ -1679,34 +1680,34 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1679
1680
|
display: flex;
|
|
1680
1681
|
justify-content: center;
|
|
1681
1682
|
align-items: center;
|
|
1682
|
-
`,
|
|
1683
|
+
`,ii=ht.div`
|
|
1683
1684
|
display: flex;
|
|
1684
1685
|
justify-content: space-between;
|
|
1685
1686
|
margin-top: 16px;
|
|
1686
1687
|
gap: 8px;
|
|
1687
|
-
`,Vl=
|
|
1688
|
+
`,Vl=ht.div`
|
|
1688
1689
|
display: flex;
|
|
1689
1690
|
justify-content: space-between;
|
|
1690
1691
|
margin-top: 8px;
|
|
1691
|
-
`,
|
|
1692
|
+
`,ni=ht.div`
|
|
1692
1693
|
font-size: 12px;
|
|
1693
1694
|
line-height: 18px;
|
|
1694
1695
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1695
1696
|
font-style: normal;
|
|
1696
1697
|
font-weight: 400;
|
|
1697
1698
|
letter-spacing: 0.24px;
|
|
1698
|
-
`,
|
|
1699
|
+
`,si=ht.div`
|
|
1699
1700
|
display: flex;
|
|
1700
1701
|
flex-direction: column;
|
|
1701
1702
|
flex: 1;
|
|
1702
|
-
`,
|
|
1703
|
+
`,xw=ht.div`
|
|
1703
1704
|
display: flex;
|
|
1704
1705
|
flex-direction: column;
|
|
1705
1706
|
justify-content: center;
|
|
1706
1707
|
align-items: flex-start;
|
|
1707
1708
|
margin-top: 16px;
|
|
1708
|
-
`,jl=
|
|
1709
|
-
${e=>
|
|
1709
|
+
`,jl=ht.textarea`
|
|
1710
|
+
${e=>B(e)} {
|
|
1710
1711
|
color: ${e=>e.appearance.theme.colorText};
|
|
1711
1712
|
margin-top: 16px;
|
|
1712
1713
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1718,8 +1719,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1718
1719
|
height: 100px;
|
|
1719
1720
|
resize: none;
|
|
1720
1721
|
}
|
|
1721
|
-
`,Gl=
|
|
1722
|
-
${e=>
|
|
1722
|
+
`,Gl=ht.div`
|
|
1723
|
+
${e=>B(e)} {
|
|
1723
1724
|
position: absolute;
|
|
1724
1725
|
top: 16px;
|
|
1725
1726
|
right: 16px;
|
|
@@ -1729,8 +1730,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1729
1730
|
opacity: 0.8;
|
|
1730
1731
|
}
|
|
1731
1732
|
}
|
|
1732
|
-
`;var
|
|
1733
|
-
${e=>
|
|
1733
|
+
`;var Xc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:a="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:f,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:h,getFlowStatus:x,getFlowMetadata:T}=ie(),{primaryCTAClickSideEffects:y}=fe(),{mergeAppearanceWithDefault:F}=ae(),[O,v]=ce.useState(null),[m,N]=ce.useState(""),E=T(e),{hasOpenModals:P,setKeepCompletedFlowOpenDuringSession:A,shouldKeepCompletedFlowOpenDuringSession:I}=Ae();if(Ge(e),n=F(n),Yc(()=>{w(o)},[o,g]),g)return null;let D=d(e);if(!D||S(D)||x(e)===le||c(e)===1&&!I(e)||P())return null;let H=h(e)[c(e)];function Q(){var W,oe;return ce.createElement(ce.Fragment,null,ce.createElement(si,null,ce.createElement(Ne,{size:"large",appearance:n,title:H.title,subtitle:H.subtitle})),ce.createElement(ii,{className:p("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(J=>ce.createElement(Hl,{className:p("npsNumberButton",n),selected:O===J+1,key:J,onClick:()=>M(this,null,function*(){A(e),v(J+1),yield f(e,H.id,{score:J+1})}),appearance:n},J+1))),ce.createElement(Vl,{appearance:n},ce.createElement(ni,{appearance:n},(W=E==null?void 0:E.negativeLabel)!=null?W:"Not likely at all"),ce.createElement(ni,{appearance:n},(oe=E==null?void 0:E.positiveLabel)!=null?oe:"Extremely likely")))}function te(){var W;return ce.createElement(ce.Fragment,null,ce.createElement(si,null,ce.createElement(Ne,{appearance:n,title:(W=H.title)!=null?W:"Why did you choose this score?",size:"large"})),ce.createElement(jl,{appearance:n,value:m,onChange:oe=>{N(oe.target.value)},placeholder:"Add your optional feedback here..."}),ce.createElement(ii,{appearance:n,className:p("npsNumberButtonContainer",n)},ce.createElement(de,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield l(e),i&&i(H,1,"primary")}),appearance:n,title:H.secondaryButtonTitle||"Skip",secondary:!0}),ce.createElement(de,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield f(e,H.id,{feedbackText:m}),yield l(e),i&&i(H,1,"primary")}),appearance:n,title:H.primaryButtonTitle||"Submit"})))}function U(){return c(e)>=2?null:ce.createElement(ce.Fragment,null,ce.createElement(ne,{appearance:n}),ce.createElement(zl,{appearance:n,className:we(p("npsSurveyContainer",n),r),style:s,type:a},ce.createElement(Gl,{onClick:()=>M(this,null,function*(){yield l(e),t&&t()}),className:p("npsSurveyDismissButton",n)},ce.createElement(Ie,null)),c(e)==0&&Q(),c(e)==1&&te()))}return a==="inline"?U():ce.createElement(Jc,null,U())};import Se,{useEffect as Rc}from"react";import Pt from"styled-components";var Kl=Pt.div`
|
|
1734
|
+
${e=>B(e)} {
|
|
1734
1735
|
display: flex;
|
|
1735
1736
|
flex-direction: column;
|
|
1736
1737
|
width: 100%;
|
|
@@ -1740,22 +1741,29 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1740
1741
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1741
1742
|
position: relative;
|
|
1742
1743
|
}
|
|
1743
|
-
`,ql=
|
|
1744
|
+
`,ql=Pt.div`
|
|
1744
1745
|
display: flex;
|
|
1745
1746
|
flex-direction: column;
|
|
1746
1747
|
flex: 1;
|
|
1747
|
-
`,Yl=
|
|
1748
|
+
`,Yl=Pt.div`
|
|
1749
|
+
display: flex;
|
|
1750
|
+
flex-direction: column;
|
|
1751
|
+
justify-content: center;
|
|
1752
|
+
align-items: center;
|
|
1753
|
+
margin-bottom: 12px;
|
|
1754
|
+
margin-top: 4px;
|
|
1755
|
+
`,Jl=Pt.div`
|
|
1748
1756
|
display: flex;
|
|
1749
1757
|
flex-direction: row;
|
|
1750
1758
|
justify-content: center;
|
|
1751
1759
|
align-items: stretch;
|
|
1752
1760
|
gap: 16px;
|
|
1753
1761
|
margin-top: 8px;
|
|
1754
|
-
`,
|
|
1762
|
+
`,Xl=Pt.div`
|
|
1755
1763
|
margin-top: 16px;
|
|
1756
1764
|
margin-bottom: 16px;
|
|
1757
|
-
`,
|
|
1758
|
-
${e=>
|
|
1765
|
+
`,Ql=Pt.div`
|
|
1766
|
+
${e=>B(e)} {
|
|
1759
1767
|
position: absolute;
|
|
1760
1768
|
top: -16px;
|
|
1761
1769
|
right: -16px;
|
|
@@ -1765,8 +1773,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1765
1773
|
opacity: 0.8;
|
|
1766
1774
|
}
|
|
1767
1775
|
}
|
|
1768
|
-
`,
|
|
1769
|
-
${e=>
|
|
1776
|
+
`,Zl=Pt.h1`
|
|
1777
|
+
${e=>B(e)} {
|
|
1770
1778
|
font-style: normal;
|
|
1771
1779
|
justify-content: center;
|
|
1772
1780
|
text-align: center;
|
|
@@ -1779,8 +1787,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1779
1787
|
color: ${e=>e.appearance.theme.colorText};
|
|
1780
1788
|
margin-bottom: 8px;
|
|
1781
1789
|
}
|
|
1782
|
-
`,
|
|
1783
|
-
${e=>
|
|
1790
|
+
`,Rl=Pt.h2`
|
|
1791
|
+
${e=>B(e)} {
|
|
1784
1792
|
font-style: normal;
|
|
1785
1793
|
justify-content: center;
|
|
1786
1794
|
text-align: center;
|
|
@@ -1791,10 +1799,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map
|
|
|
1791
1799
|
letter-spacing: 0.28px;
|
|
1792
1800
|
margin-bottom: 8px;
|
|
1793
1801
|
}
|
|
1794
|
-
`;import
|
|
1802
|
+
`;import ea from"react";import Qc from"styled-components";var Zc=Qc.img`
|
|
1795
1803
|
width: 100%;
|
|
1796
1804
|
height: 100%;
|
|
1797
1805
|
min-height: 200px;
|
|
1798
1806
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1799
|
-
`;function
|
|
1807
|
+
`;function ta({stepData:e,appearance:t,classPrefix:o=""}){var i;return e.videoUri?ea.createElement(tt,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo}):e.imageUri?ea.createElement(Zc,{className:p(`${o}image`,t),appearance:t,src:e.imageUri}):null}var em=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a=!0,modalPosition:d="center",showPagination:l=!0})=>{let{getFlow:f,markFlowCompleted:c,markFlowSkipped:g,markStepCompleted:S,markStepStarted:w,isLoading:h,targetingLogicShouldHideFlow:x,updateCustomVariables:T,getFlowSteps:y,getFlowStatus:F,getCurrentStepIndex:O}=ie(),{primaryCTAClickSideEffects:v,secondaryCTAClickSideEffects:m}=fe(),{mergeAppearanceWithDefault:N}=ae(),{setOpenFlowState:E,getOpenFlowState:P,hasOpenModals:A}=Ae();Ge(e);let[I,D]=[P(e,!0),me=>E(e,me)];if(n=N(n),Rc(()=>{T(o)},[o,h]),h)return null;let z=f(e);if(!z||x(z)||F(e)===le||A())return null;let H=y(e),Q=O(e),te=H.length,U=H[Q],W=()=>M(void 0,null,function*(){D(!1),yield g(e),t&&t()});function oe(){return Se.createElement(Se.Fragment,null,Se.createElement(ne,{appearance:n}),Se.createElement(Kl,{appearance:n,className:we(p("announcementContainer",n),r),style:s},(a===!0||U.dismissible)&&d=="inline"&&Se.createElement(Ql,{onClick:()=>M(this,null,function*(){yield g(e),t&&t()}),className:p("announcementDismissButton",n)},Se.createElement(Ie,null)),Se.createElement(ql,null,Se.createElement(Zl,{appearance:n,className:p("announcementTitle",n),dangerouslySetInnerHTML:pe(U.title)}),U.subtitle&&Se.createElement(Rl,{appearance:n,className:p("announcementSubtitle",n),dangerouslySetInnerHTML:pe(U.subtitle)})),(U.imageUri||U.videoUri)&&Se.createElement(Xl,{className:p("announcementMediaContainer",n)},Se.createElement(ta,{appearance:n,stepData:U})),l&&te>1&&Se.createElement(Yl,{className:p("announcementPaginationContainer",n)},Se.createElement(er,{className:p("announcementPagination",n),appearance:n,stepCount:te,currentStep:Q})),(U.primaryButtonTitle||U.secondaryButtonTitle)&&Se.createElement(Jl,{className:p("announcementCTAContainer",n)},U.secondaryButtonTitle&&Se.createElement(de,{classPrefix:"announcement",title:U.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){U.handleSecondaryButtonClick(),m(U),i&&i(U,O(e),"secondary")}),secondary:!0}),U.primaryButtonTitle&&Se.createElement(de,{classPrefix:"announcement",title:U.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){v(U),!(i&&i(U,O(e),"primary")===!1)&&(O(e)===te-1?(U.handlePrimaryButtonClick(),yield c(e)):U.handlePrimaryButtonClick())})}))))}let J={padding:"24px",maxWidth:"400px"};return d==="inline"?oe():d!=="center"?Se.createElement(qo,{modalPosition:d,onClose:W,visible:I,dismissible:a,appearance:n},oe()):Se.createElement(Re,{appearance:n,onClose:W,visible:I,style:J,dismissible:a},oe())};import*as yr from"react";import oa from"react";var ra=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Le(r,["as","children","variant"]);return oa.createElement(vn,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},tm=Object.fromEntries(Object.keys(nr).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>oa.createElement(ra,G(b({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),li=Object.assign(ra,tm);var ia=s=>{var a=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=a,r=Le(a,["as","className","size","title","variant"]);var d;return yr.createElement(Pn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),yr.createElement(li,{color:(d=Io[n])==null?void 0:d.color,fontWeight:"semibold"},i))},om=Object.fromEntries(Object.keys(Io).map(e=>{let t=o=>yr.createElement(ia,G(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),rm=Object.assign(ia,om);export{Ao as Box,rm as Button,pt as CheckBox,wr as FlowType,yt as FormLabel,Or as FormTextField,em as FrigadeAnnouncement,qc as FrigadeBanner,Rr as FrigadeChecklist,at as FrigadeDefaultAppearance,Gc as FrigadeEmbeddedTip,yn as FrigadeForm,wc as FrigadeGuide,Cc as FrigadeHeroChecklist,Xc as FrigadeNPSSurvey,Sc as FrigadeProgressBadge,Pd as FrigadeProvider,Vc as FrigadeSupportWidget,Uc as FrigadeTour,ze as ProgressBar,Qt as ProgressRing,li as Text,sr as tokens,Ae as useFlowOpens,So as useFlowResponses,ie as useFlows,jr as useOrganization,bo as useUser,_e as useUserFlowStates};
|
|
1800
1808
|
//# sourceMappingURL=index.mjs.map
|