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