@frigade/react 1.38.2 → 1.38.5
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.js +230 -230
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +243 -243
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -16
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var Wo=Object.getOwnPropertySymbols;var pi=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable;var ai=(e,t,o)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))pi.call(t,o)&&ai(e,o,t[o]);if(Wo)for(var o of Wo(t))di.call(t,o)&&ai(e,o,t[o]);return e},j=(e,t)=>la(e,aa(t));var ci=e=>typeof e=="symbol"?e:e+"",$e=(e,t)=>{var o={};for(var i in e)pi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Wo)for(var i of Wo(e))t.indexOf(i)<0&&di.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{a(o.next(d))}catch(l){n(l)}},s=d=>{try{a(o.throw(d))}catch(l){n(l)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);a((o=o.apply(e,t)).next())});import Oo,{createContext as Fd,useEffect as lr,useState as Ke}from"react";import{ThemeProvider as An}from"styled-components";import _t,{useContext as Rp,useEffect as ro,useState as Eo}from"react";import{useCallback as Lt,useContext as ba,useEffect as wa}from"react";import Sr,{useMemo as ui}from"react";var mi="1.38.2";var st="NOT_STARTED_STEP",pe="COMPLETED_FLOW",It="SKIPPED_FLOW",Ot="STARTED_FLOW",Ue="NOT_STARTED_FLOW",Me="COMPLETED_STEP",yo="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=Sr.useContext(oe);return{config:ui(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":mi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ui(()=>`${o}/v1/public/`,[o])}}var pa="frigade-last-call-at-",da="frigade-last-call-data-";function qt(){let{shouldGracefullyDegrade:e,readonly:t}=Sr.useContext(oe);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Kt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Kt();let n=pa+o,r=da+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let a=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(a&&d&&d==i.body){let l=new Date(a);if(new Date().getTime()-l.getTime()<1e3)return Kt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(a){return Kt(a)}return s?s.ok?s:Kt(s.statusText):Kt()})}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Yt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Sr.useContext(oe);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ca,useState as fi}from"react";import{useContext as ma,useEffect as ua,useState as fa}from"react";import ga from"swr";import{useContext as ca}from"react";function Ne(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=ca(oe);function r(c,g=!1){var S;return(S=e[c])!=null?S:g}function s(c,g){t(S=>j(b({},S),{[c]:g}))}function a(c){t(g=>{let h=g,{[c]:S}=h,k=$e(h,[ci(c)]);return b({},k)})}function d(c){n.includes(c)||i(g=>[...g,c])}function l(c){return n.includes(c)}function u(c){return Object.entries(e).some(([g,S])=>S&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:a,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ha from"swr/immutable";import So from"core-js-pure/actual/structured-clone";function br(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(...e){let t=e.shift(),o=e.length===1?e[0]:ue(...e);if(!br(t)||!br(o))throw new Error("deepmerge can only merge Objects");let i=So(t);return Object.entries(o).forEach(([n,r])=>{br(r)?i[n]!==void 0?Object.assign(i,{[n]:ue(i[n],So(r))}):Object.assign(i,{[n]:So(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...So(r)]}):Object.assign(i,{[n]:So(r)}):Object.assign(i,{[n]:r})}),i}function Jt(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var xa="unknown";function _e(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:a}=ma(oe),{resetOpenFlowState:d}=Ne(),[l,u]=fa(!1),c={data:r.map(T=>({flowId:T.id,flowState:pe,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=T=>fetch(T,e).then(A=>{if(A.ok)return A.json();throw new Error("Failed to fetch user flow states")}).catch(A=>(console.log(`Error fetching ${T}: ${A}. Will gracefully degrade and hide Frigade`),s(!0),c)),S=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:k,isLoading:h,mutate:x,error:F}=a?ha(S,g):ga(S,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),y=k==null?void 0:k.data;ua(()=>{!l&&!h&&y&&u(!0)},[y,l,h]);function v(T){return M(this,null,function*(){if(y&&!a){let A=y.find(N=>N.flowId===T);A&&A.flowState!==pe&&(A.flowState=pe),yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function L(T){return M(this,null,function*(){if(y&&!a){let A=y.find(N=>N.flowId===T);A&&A.flowState!==It&&(A.flowState=It),yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function E(T,A,N){return M(this,null,function*(){var U,z;if(y){let G=y.find(_=>_.flowId===T);if(G){let _=r.find(q=>q.slug===T),K=Jt(_==null?void 0:_.data),J=(z=(U=K==null?void 0:K.steps)!=null?U:K==null?void 0:K.data)!=null?z:[],O=J.findIndex(q=>q.id===A),Z=J&&J.length>O+1?J[O+1]:null;Z&&(G.lastStepId=Z.id),G.stepStates[A]=N,G.flowState=Ot}yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function f(T,A,N){return M(this,null,function*(){if(y){let U=y.find(z=>z.flowId===T);U&&(U.lastStepId=A,U.stepStates[A]=N,U.flowState=Ot),yield x(ue(k,{data:y}),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function w(T){return M(this,null,function*(){if(y){let A=y.find(N=>N.flowId===T);A&&A.flowState!==Ue&&(A.flowState=Ue,A.lastStepId=xa,Object.keys(A.stepStates).forEach(N=>{A.stepStates[N].actionType=st,A.stepStates[N].createdAt=new Date().toISOString()}),yield x(ue(k,{data:y}),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1}),d(T))}})}function I(T,A,N){return M(this,null,function*(){if(y){let U=y.find(z=>z.flowId===T);U&&(U.stepStates[A]=N),yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:y,isLoadingUserFlowStateData:!l,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowSkipped:L,optimisticallyMarkFlowNotStarted:w,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:f,error:F}}function bo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=_e(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:a}=Ca(oe),[d,l]=fi(new Set),[u,c]=fi(new Set),g=qt();function S(x){let F=JSON.stringify(x);if(d.has(F))return null;d.add(F),l(d),u.add(x),c(u);let y=s==null?void 0:s.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,j(b({},e),{method:"POST",body:F})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):y||a(L=>[...L!=null?L:[],x])})}function k(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===Ot||x.actionType===Ue?yield S(x):x.actionType===pe?yield S(x):x.actionType===yo?yield S(x):x.actionType===Me?yield S(x):x.actionType===It?yield S(x):x.actionType===st&&(yield S(x)))})}function h(){let x=[];return o==null||o.forEach(F=>{if(F&&F.stepStates&&Object.keys(F.stepStates).length!==0)for(let y in F.stepStates){let v=F.stepStates[y];x.push({foreignUserId:F.foreignUserId,flowSlug:F.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...s]}return{addResponse:k,setFlowResponses:a,getFlowResponses:h}}import Ta from"swr";var ya=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,gi=e=>{let t=ya.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Sa(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Sa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};var wr=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(wr||{});function ie(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:a,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:u,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:S,readonly:k,flowDataOverrides:h}=ba(oe),x={data:[]},{verifySDKInitiated:F}=Yt(),{addResponse:y,getFlowResponses:v}=bo(),L=m=>fetch(m,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${m} (${C.status}): ${C.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(C=>(console.log(`Error fetching ${m}: ${C}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:E,userFlowStatesData:f,isLoadingUserFlowStateData:w,optimisticallyMarkFlowCompleted:I,optimisticallyMarkFlowSkipped:T,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:U,optimisticallyMarkStepStarted:z}=_e(),{data:G,error:_,isLoading:K}=Ta(s?`${t}flows${k?"?readonly=true":""}`:null,L,{keepPreviousData:!0});wa(()=>{if(_){console.error(_);return}G&&G.data&&i(G.data)},[G,_]);function J(m){if(K)return null;let C=o.find(P=>P.slug===m);return!C&&o.length>0&&!w&&!K?(console.log(`Flow with id ${m} not found`),null):(C&&h&&h[m]&&(C.data=h[m]),(C==null?void 0:C.active)===!1&&!k?null:C)}function O(m){var W,Be,Et,At,Nt;if(!J(m))return[];let C=(W=J(m))==null?void 0:W.data;return C?(C=Z(C),((Nt=(At=(Be=Jt(C))==null?void 0:Be.data)!=null?At:(Et=Jt(C))==null?void 0:Et.steps)!=null?Nt:[]).map(ge=>{let xo=je(ge);return j(b({handleSecondaryButtonClick:()=>{ge.skippable===!0&&$(m,ge.id,{skipped:!0})}},ge),{complete:H(m,ge.id)===Me||xo>=1,started:H(m,ge.id)===yo||H(m,ge.id)===Me,currentlyActive:f==null?void 0:f.some(Co=>Co.flowId==m&&Co.lastStepId===ge.id),blocked:V(m,ge.id),hidden:ee(m,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&$(m,ge.id)},progress:xo})}).filter(ge=>ge.hidden!==!0)):[]}function Z(m){return m.replaceAll(/\${(.*?)}/g,(C,P)=>a[P]===void 0?"":String(a[P]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function q(m){var P;if(!J(m))return[];let C=J(m).data;return C?(C=Z(C),(P=JSON.parse(C))!=null?P:{}):[]}function ne(m,C){d(P=>j(b({},P),{[m]:C}))}function Se(m){!w&&!K&&m&&JSON.stringify(a)!=JSON.stringify(b(b({},a),m))&&Object.keys(m).forEach(C=>{ne(C,m[C])})}let ke=Lt((m,C,P)=>M(this,null,function*(){if(!F())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:yo,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};ae(W)&&(yield z(m,C,W),y(W))}),[n,r,f]),R=Lt((m,C,P)=>M(this,null,function*(){if(!F())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:st,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};ae(W)&&(yield U(m,C,W),y(W))}),[n,r,f]),$=Lt((m,C,P)=>M(this,null,function*(){if(!F())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:Me,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};ae(W)&&(yield N(m,C,W),y(W))}),[n,r,f]),re=Lt((m,C)=>M(this,null,function*(){if(!F()||xt(m)===Ue)return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Ue,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};yield A(m),ae(P)&&y(P)}),[n,r,f]),Pe=Lt((m,C)=>M(this,null,function*(){if(!F())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Ot,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};ae(P)&&y(P)}),[n,r,f]),Ve=Lt((m,C)=>M(this,null,function*(){if(!F())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:pe,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};ae(P)&&(yield I(m),y(P))}),[n,r,f]),ve=Lt((m,C)=>M(this,null,function*(){if(!F())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:It,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};ae(P)&&(yield T(m),y(P))}),[n,r,f]);function ae(m){var C;if(f===void 0)return!1;if(f){let P=f.find(W=>W.flowId===m.flowSlug);if(m.actionType===st&&(!(P!=null&&P.stepStates[m.stepId])||P.stepStates[m.stepId].actionType===st))return!1;if(P&&((C=P.stepStates[m.stepId])==null?void 0:C.actionType)===m.actionType){if(m.actionType===Me&&(!m.data||JSON.stringify(m.data)===JSON.stringify({})))return!1;let W=Object.keys(P.stepStates).sort((Be,Et)=>{let At=new Date(P.stepStates[Be].createdAt),Nt=new Date(P.stepStates[Et].createdAt);return At.getTime()-Nt.getTime()});if(P.stepStates[W[W.length-1]].actionType===m.actionType&&m.stepId===W[W.length-1])return!1}if(P&&P.flowState===pe&&m.actionType===pe)return!1}return!0}function H(m,C){let P=D(m,C);return w?null:P?P.actionType:st}function V(m,C){let P=D(m,C);return P?P.blocked:!1}function ee(m,C){let P=D(m,C);return P?P.hidden:!1}function D(m,C){var W;if(w)return null;let P=f==null?void 0:f.find(Be=>Be.flowId===m);return!P||!P.stepStates[C]?null:(W=P.stepStates[C])!=null?W:null}function Q(m){var P,W;if(w||!f)return null;if(xt(m)===Ue)return(P=O(m)[0])!=null?P:null;let C=(W=f.find(Be=>Be.flowId===m))==null?void 0:W.lastStepId;return C?O(m).find(Be=>Be.id===C):null}function we(m){var W;let C=Q(m);if(!C)return 0;let P=(W=O(m).findIndex(Be=>Be.id===C.id))!=null?W:0;return H(m,C.id)===Me&&P<O(m).length-1?P+1:P}function je(m){if(!m.completionCriteria)return;let C=gi(m.completionCriteria);if(C===null)return;let P=qe(C),W=nt(C);return W===0?void 0:P/W}function xt(m){let C=f==null?void 0:f.find(P=>P.flowId===m);return C?C.flowState:null}function qe(m){let C=O(m);return C.length===0?0:C.filter(W=>H(m,W.id)===Me).length}function nt(m){return O(m).length}function Xe(m){let C=o.find(P=>P.slug===m);return C?(h&&h[m]&&(C.data=h[m]),Jt(C.data)):null}function vt(m){if(k)return!1;if(w||S)return!0;if(m!=null&&m.targetingLogic&&f){let C=f.find(P=>P.flowId===m.slug);if(C)return C.shouldTrigger===!1}return!!(m!=null&&m.targetingLogic&&n&&n.startsWith("guest_"))}function jt(m){return!vt(J(m))}function Gt(){n&&E()}function Bt(){return o}return{getAllFlows:Bt,getFlow:J,getFlowData:Xe,isLoading:w||K,getStepStatus:H,getFlowSteps:O,getCurrentStepIndex:we,markStepStarted:ke,markStepCompleted:$,markFlowNotStarted:re,markFlowStarted:Pe,markFlowCompleted:Ve,markFlowSkipped:ve,markStepNotStarted:R,getFlowStatus:xt,getNumberOfStepsCompleted:qe,getNumberOfSteps:nt,targetingLogicShouldHideFlow:vt,setCustomVariable:ne,updateCustomVariables:Se,customVariables:a,getStepOptionalProgress:je,getFlowMetadata:q,isStepBlocked:V,isStepHidden:ee,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:u,isFlowAvailableToUser:jt,refresh:Gt}}import{useCallback as zo,useContext as Fa,useEffect as ka}from"react";var Xt="guest_";function wo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Fa(oe),{config:r,apiUrl:s}=Ze(),{mutateUserFlowState:a}=_e(),d=qt(),{verifySDKInitiated:l}=Yt();function u(h){return`frigade-user-registered-${h}`}ka(()=>{if(e&&!t){if(e.startsWith(Xt))return;let h=u(e);localStorage.getItem(h)||(d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(h,"true"))}},[e,n,t]);let c=zo(h=>M(this,null,function*(){if(!l())return;let x={foreignId:e,properties:h};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(x)})),i(F=>b(b({},F),h)),a()}),[e,r,n,a]),g=zo((h,x)=>M(this,null,function*(){if(!l())return;let y={foreignId:e,events:[{event:h,properties:x}]};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(y)})),a()}),[e,r,a]),S=zo((h,x)=>M(this,null,function*(){if(l())if(x&&Object.keys(x).length>0){let F=u(h);localStorage.setItem(F,"true"),o(h);let y={foreignId:h,properties:x};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(y)})),i(v=>b(b({},v),x)),a()}else o(h)}),[r,n,a]),k=zo(h=>M(this,null,function*(){if(!l())return;let x=typeof window!="undefined"?localStorage.getItem($t):null;if(console.log("id",localStorage.getItem($t)),!x)return;let F={foreignId:h,linkGuestId:x};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(F)})),a()}),[r,n,a]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:k}}import{v4 as ed}from"uuid";import ot,{useEffect as Cn,useState as Xp}from"react";import Ye,{useEffect as Pr,useState as La}from"react";import Go from"styled-components";import Pa from"react";import va from"styled-components";var hi="fr-",To="cfr-";function p(e,t){let o=`${hi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+To+e}return o}function B(e){if(!e.className||e.className.indexOf(To)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(hi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Ho(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ee(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Ho(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function Fo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=va.div`
|
|
2
|
+
var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var Wo=Object.getOwnPropertySymbols;var ci=Object.prototype.hasOwnProperty,mi=Object.prototype.propertyIsEnumerable;var di=(e,t,o)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))ci.call(t,o)&&di(e,o,t[o]);if(Wo)for(var o of Wo(t))mi.call(t,o)&&di(e,o,t[o]);return e},j=(e,t)=>la(e,aa(t));var ui=e=>typeof e=="symbol"?e:e+"",$e=(e,t)=>{var o={};for(var i in e)ci.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Wo)for(var i of Wo(e))t.indexOf(i)<0&&mi.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{a(o.next(d))}catch(l){n(l)}},s=d=>{try{a(o.throw(d))}catch(l){n(l)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);a((o=o.apply(e,t)).next())});import Oo,{createContext as Fd,useEffect as lr,useState as Ke}from"react";import{ThemeProvider as In}from"styled-components";import _t,{useContext as Rp,useEffect as ro,useState as Eo}from"react";import{useCallback as Lt,useContext as ba,useEffect as wa}from"react";import wr,{useMemo as gi}from"react";var fi="1.38.5";var st="NOT_STARTED_STEP",pe="COMPLETED_FLOW",It="SKIPPED_FLOW",Ot="STARTED_FLOW",Ue="NOT_STARTED_FLOW",Me="COMPLETED_STEP",yo="STARTED_STEP";function Re(){let{publicApiKey:e,userId:t,apiUrl:o}=wr.useContext(oe);return{config:gi(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":fi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:gi(()=>`${o}/v1/public/`,[o])}}var pa="frigade-last-call-at-",da="frigade-last-call-data-";function qt(){let{shouldGracefullyDegrade:e,readonly:t}=wr.useContext(oe);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Kt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Kt();let n=pa+o,r=da+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let a=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(a&&d&&d==i.body){let l=new Date(a);if(new Date().getTime()-l.getTime()<1e3)return Kt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(a){return Kt(a)}return s?s.ok?s:Kt(s.statusText):Kt()})}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Yt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=wr.useContext(oe);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ca,useState as hi}from"react";import{useContext as ma,useEffect as ua,useState as fa}from"react";import ga from"swr";import{useContext as ca}from"react";function Ne(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=ca(oe);function r(c,g=!1){var S;return(S=e[c])!=null?S:g}function s(c,g){t(S=>j(b({},S),{[c]:g}))}function a(c){t(g=>{let h=g,{[c]:S}=h,k=$e(h,[ui(c)]);return b({},k)})}function d(c){n.includes(c)||i(g=>[...g,c])}function l(c){return n.includes(c)}function u(c){return Object.entries(e).some(([g,S])=>S&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:a,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ha from"swr/immutable";import So from"core-js-pure/actual/structured-clone";function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(...e){let t=e.shift(),o=e.length===1?e[0]:ue(...e);if(!Tr(t)||!Tr(o))throw new Error("deepmerge can only merge Objects");let i=So(t);return Object.entries(o).forEach(([n,r])=>{Tr(r)?i[n]!==void 0?Object.assign(i,{[n]:ue(i[n],So(r))}):Object.assign(i,{[n]:So(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...So(r)]}):Object.assign(i,{[n]:So(r)}):Object.assign(i,{[n]:r})}),i}function Jt(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var xa="unknown";function _e(){let{config:e,apiUrl:t}=Re(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:a}=ma(oe),{resetOpenFlowState:d}=Ne(),[l,u]=fa(!1),c={data:r.map(T=>({flowId:T.id,flowState:pe,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=T=>fetch(T,e).then(A=>{if(A.ok)return A.json();throw new Error("Failed to fetch user flow states")}).catch(A=>(console.log(`Error fetching ${T}: ${A}. Will gracefully degrade and hide Frigade`),s(!0),c)),S=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:k,isLoading:h,mutate:x,error:F}=a?ha(S,g):ga(S,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),y=k==null?void 0:k.data;ua(()=>{!l&&!h&&y&&u(!0)},[y,l,h]);function v(T){return M(this,null,function*(){if(y&&!a){let A=y.find(N=>N.flowId===T);A&&A.flowState!==pe&&(A.flowState=pe),yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function L(T){return M(this,null,function*(){if(y&&!a){let A=y.find(N=>N.flowId===T);A&&A.flowState!==It&&(A.flowState=It),yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function E(T,A,N){return M(this,null,function*(){var U,z;if(y){let G=y.find(_=>_.flowId===T);if(G){let _=r.find(q=>q.slug===T),K=Jt(_==null?void 0:_.data),J=(z=(U=K==null?void 0:K.steps)!=null?U:K==null?void 0:K.data)!=null?z:[],O=J.findIndex(q=>q.id===A),Z=J&&J.length>O+1?J[O+1]:null;Z&&(G.lastStepId=Z.id),G.stepStates[A]=N,G.flowState=Ot}a||(yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1}))}})}function f(T,A,N){return M(this,null,function*(){if(y){let U=y.find(z=>z.flowId===T);U&&(U.lastStepId=A,U.stepStates[A]=N,U.flowState=Ot),a||(yield x(ue(k,{data:y}),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1}))}})}function w(T){return M(this,null,function*(){if(y){let A=y.find(N=>N.flowId===T);A&&A.flowState!==Ue&&(A.flowState=Ue,A.lastStepId=xa,Object.keys(A.stepStates).forEach(N=>{A.stepStates[N].actionType=st,A.stepStates[N].createdAt=new Date().toISOString()}),yield x(ue(k,{data:y}),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1}),d(T))}})}function I(T,A,N){return M(this,null,function*(){if(y){let U=y.find(z=>z.flowId===T);U&&(U.stepStates[A]=N),yield x(Promise.resolve(ue(k,{data:y})),{optimisticData:ue(k,{data:y}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:y,isLoadingUserFlowStateData:!l,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowSkipped:L,optimisticallyMarkFlowNotStarted:w,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:f,error:F}}function bo(){let{config:e,apiUrl:t}=Re(),{userFlowStatesData:o,mutateUserFlowState:i}=_e(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:a}=Ca(oe),[d,l]=hi(new Set),[u,c]=hi(new Set),g=qt();function S(x){let F=JSON.stringify(x);if(d.has(F))return null;d.add(F),l(d),u.add(x),c(u);let y=s==null?void 0:s.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,j(b({},e),{method:"POST",body:F})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):y||a(L=>[...L!=null?L:[],x])})}function k(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===Ot||x.actionType===Ue?yield S(x):x.actionType===pe?yield S(x):x.actionType===yo?yield S(x):x.actionType===Me?yield S(x):x.actionType===It?yield S(x):x.actionType===st&&(yield S(x)))})}function h(){let x=[];return o==null||o.forEach(F=>{if(F&&F.stepStates&&Object.keys(F.stepStates).length!==0)for(let y in F.stepStates){let v=F.stepStates[y];x.push({foreignUserId:F.foreignUserId,flowSlug:F.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...s]}return{addResponse:k,setFlowResponses:a,getFlowResponses:h}}import Ta from"swr";var ya=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,xi=e=>{let t=ya.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Sa(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Sa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};var Fr=(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))(Fr||{});function ie(){let{config:e,apiUrl:t}=Re(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:a,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:u,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:S,readonly:k,flowDataOverrides:h}=ba(oe),x={data:[]},{verifySDKInitiated:F}=Yt(),{addResponse:y,getFlowResponses:v}=bo(),L=m=>fetch(m,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${m} (${C.status}): ${C.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(C=>(console.log(`Error fetching ${m}: ${C}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:E,userFlowStatesData:f,isLoadingUserFlowStateData:w,optimisticallyMarkFlowCompleted:I,optimisticallyMarkFlowSkipped:T,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:U,optimisticallyMarkStepStarted:z}=_e(),{data:G,error:_,isLoading:K}=Ta(s?`${t}flows${k?"?readonly=true":""}`:null,L,{keepPreviousData:!0});wa(()=>{if(_){console.error(_);return}G&&G.data&&i(G.data)},[G,_]);function J(m){if(K)return null;let C=o.find(P=>P.slug===m);return!C&&o.length>0&&!w&&!K?(console.log(`Flow with id ${m} not found`),null):(C&&h&&h[m]&&(C.data=h[m]),(C==null?void 0:C.active)===!1&&!k?null:C)}function O(m){var W,Be,Et,At,Nt;if(!J(m))return[];let C=(W=J(m))==null?void 0:W.data;return C?(C=Z(C),((Nt=(At=(Be=Jt(C))==null?void 0:Be.data)!=null?At:(Et=Jt(C))==null?void 0:Et.steps)!=null?Nt:[]).map(ge=>{let xo=je(ge);return j(b({handleSecondaryButtonClick:()=>{ge.skippable===!0&&$(m,ge.id,{skipped:!0})}},ge),{complete:H(m,ge.id)===Me||xo>=1,started:H(m,ge.id)===yo||H(m,ge.id)===Me,currentlyActive:f==null?void 0:f.some(Co=>Co.flowId==m&&Co.lastStepId===ge.id),blocked:V(m,ge.id),hidden:ee(m,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&$(m,ge.id)},progress:xo})}).filter(ge=>ge.hidden!==!0)):[]}function Z(m){return m.replaceAll(/\${(.*?)}/g,(C,P)=>a[P]===void 0?"":String(a[P]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function q(m){var P;if(!J(m))return[];let C=J(m).data;return C?(C=Z(C),(P=JSON.parse(C))!=null?P:{}):[]}function ne(m,C){d(P=>j(b({},P),{[m]:C}))}function Se(m){!w&&!K&&m&&JSON.stringify(a)!=JSON.stringify(b(b({},a),m))&&Object.keys(m).forEach(C=>{ne(C,m[C])})}let ke=Lt((m,C,P)=>M(this,null,function*(){if(!F())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:yo,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};ae(W)&&(yield z(m,C,W),y(W))}),[n,r,f]),R=Lt((m,C,P)=>M(this,null,function*(){if(!F())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:st,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};ae(W)&&(yield U(m,C,W),y(W))}),[n,r,f]),$=Lt((m,C,P)=>M(this,null,function*(){if(!F())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:Me,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};ae(W)&&(yield N(m,C,W),y(W))}),[n,r,f]),re=Lt((m,C)=>M(this,null,function*(){if(!F()||xt(m)===Ue)return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Ue,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};yield A(m),ae(P)&&y(P)}),[n,r,f]),Pe=Lt((m,C)=>M(this,null,function*(){if(!F())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Ot,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};ae(P)&&y(P)}),[n,r,f]),Ve=Lt((m,C)=>M(this,null,function*(){if(!F())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:pe,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};ae(P)&&(yield I(m),y(P))}),[n,r,f]),ve=Lt((m,C)=>M(this,null,function*(){if(!F())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:It,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};ae(P)&&(yield T(m),y(P))}),[n,r,f]);function ae(m){var C;if(f===void 0)return!1;if(f){let P=f.find(W=>W.flowId===m.flowSlug);if(m.actionType===st&&(!(P!=null&&P.stepStates[m.stepId])||P.stepStates[m.stepId].actionType===st))return!1;if(P&&((C=P.stepStates[m.stepId])==null?void 0:C.actionType)===m.actionType){if(m.actionType===Me&&(!m.data||JSON.stringify(m.data)===JSON.stringify({})))return!1;let W=Object.keys(P.stepStates).sort((Be,Et)=>{let At=new Date(P.stepStates[Be].createdAt),Nt=new Date(P.stepStates[Et].createdAt);return At.getTime()-Nt.getTime()});if(P.stepStates[W[W.length-1]].actionType===m.actionType&&m.stepId===W[W.length-1])return!1}if(P&&P.flowState===pe&&m.actionType===pe)return!1}return!0}function H(m,C){let P=D(m,C);return w?null:P?P.actionType:st}function V(m,C){let P=D(m,C);return P?P.blocked:!1}function ee(m,C){let P=D(m,C);return P?P.hidden:!1}function D(m,C){var W;if(w)return null;let P=f==null?void 0:f.find(Be=>Be.flowId===m);return!P||!P.stepStates[C]?null:(W=P.stepStates[C])!=null?W:null}function Q(m){var P,W;if(w||!f)return null;if(xt(m)===Ue)return(P=O(m)[0])!=null?P:null;let C=(W=f.find(Be=>Be.flowId===m))==null?void 0:W.lastStepId;return C?O(m).find(Be=>Be.id===C):null}function we(m){var W;let C=Q(m);if(!C)return 0;let P=(W=O(m).findIndex(Be=>Be.id===C.id))!=null?W:0;return H(m,C.id)===Me&&P<O(m).length-1?P+1:P}function je(m){if(!m.completionCriteria)return;let C=xi(m.completionCriteria);if(C===null)return;let P=Ye(C),W=nt(C);return W===0?void 0:P/W}function xt(m){let C=f==null?void 0:f.find(P=>P.flowId===m);return C?C.flowState:null}function Ye(m){let C=O(m);return C.length===0?0:C.filter(W=>H(m,W.id)===Me).length}function nt(m){return O(m).length}function Qe(m){let C=o.find(P=>P.slug===m);return C?(h&&h[m]&&(C.data=h[m]),Jt(C.data)):null}function vt(m){if(k)return!1;if(w||S)return!0;if(m!=null&&m.targetingLogic&&f){let C=f.find(P=>P.flowId===m.slug);if(C)return C.shouldTrigger===!1}return!!(m!=null&&m.targetingLogic&&n&&n.startsWith("guest_"))}function jt(m){return!vt(J(m))}function Gt(){n&&E()}function Bt(){return o}return{getAllFlows:Bt,getFlow:J,getFlowData:Qe,isLoading:w||K,getStepStatus:H,getFlowSteps:O,getCurrentStepIndex:we,markStepStarted:ke,markStepCompleted:$,markFlowNotStarted:re,markFlowStarted:Pe,markFlowCompleted:Ve,markFlowSkipped:ve,markStepNotStarted:R,getFlowStatus:xt,getNumberOfStepsCompleted:Ye,getNumberOfSteps:nt,targetingLogicShouldHideFlow:vt,setCustomVariable:ne,updateCustomVariables:Se,customVariables:a,getStepOptionalProgress:je,getFlowMetadata:q,isStepBlocked:V,isStepHidden:ee,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:u,isFlowAvailableToUser:jt,refresh:Gt}}import{useCallback as zo,useContext as Fa,useEffect as ka}from"react";var Xt="guest_";function wo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Fa(oe),{config:r,apiUrl:s}=Re(),{mutateUserFlowState:a}=_e(),d=qt(),{verifySDKInitiated:l}=Yt();function u(h){return`frigade-user-registered-${h}`}ka(()=>{if(e&&!t){if(e.startsWith(Xt))return;let h=u(e);localStorage.getItem(h)||(d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(h,"true"))}},[e,n,t]);let c=zo(h=>M(this,null,function*(){if(!l())return;let x={foreignId:e,properties:h};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(x)})),i(F=>b(b({},F),h)),a()}),[e,r,n,a]),g=zo((h,x)=>M(this,null,function*(){if(!l())return;let y={foreignId:e,events:[{event:h,properties:x}]};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(y)})),a()}),[e,r,a]),S=zo((h,x)=>M(this,null,function*(){if(l())if(x&&Object.keys(x).length>0){let F=u(h);localStorage.setItem(F,"true"),o(h);let y={foreignId:h,properties:x};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(y)})),i(v=>b(b({},v),x)),a()}else o(h)}),[r,n,a]),k=zo(h=>M(this,null,function*(){if(!l())return;let x=typeof window!="undefined"?localStorage.getItem($t):null;if(console.log("id",localStorage.getItem($t)),!x)return;let F={foreignId:h,linkGuestId:x};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(F)})),a()}),[r,n,a]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:k}}import{v4 as ed}from"uuid";import rt,{useEffect as Sn,useState as Xp}from"react";import Je,{useEffect as Br,useState as La}from"react";import Go from"styled-components";import Pa from"react";import va from"styled-components";var Ci="fr-",To="cfr-";function p(e,t){let o=`${Ci}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+To+e}return o}function B(e){if(!e.className||e.className.indexOf(To)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Ci)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Ho(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ee(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Ho(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function Fo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=va.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,yi=({onClose:e,appearance:t})=>Pa.createElement(Ba,{className:p("modalBackground",t),onClick:()=>e()});import kr from"react";import Ea from"styled-components";var Aa=Ea.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Ie=()=>
|
|
30
|
+
`,Ie=()=>kr.createElement(Aa,null,kr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},kr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as $a}from"react-portal";import Ii from"react";import Pr from"react";function Na({style:e,className:t}){return Pr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Pr.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Pr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var Si=Na;import vr from"styled-components";import lt from"styled-components";var Vo=lt.div`
|
|
31
31
|
${e=>B(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -60,11 +60,11 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
60
60
|
right: 12px;
|
|
61
61
|
background-color: transparent;
|
|
62
62
|
border: none;
|
|
63
|
-
`,
|
|
63
|
+
`,bi=lt.button`
|
|
64
64
|
${e=>B(e)} {
|
|
65
65
|
${e=>e.hasImage?Ia:Oa};
|
|
66
66
|
}
|
|
67
|
-
`,
|
|
67
|
+
`,wi=lt.img`
|
|
68
68
|
${e=>B(e)} {
|
|
69
69
|
display: block;
|
|
70
70
|
width: 100%;
|
|
@@ -72,7 +72,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
72
72
|
min-height: 200px;
|
|
73
73
|
object-fit: cover;
|
|
74
74
|
}
|
|
75
|
-
`,
|
|
75
|
+
`,Ti=lt.div`
|
|
76
76
|
${e=>B(e)} {
|
|
77
77
|
display: block;
|
|
78
78
|
width: 100%;
|
|
@@ -80,19 +80,19 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
80
80
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
81
81
|
object-fit: cover;
|
|
82
82
|
}
|
|
83
|
-
`,
|
|
83
|
+
`,Fi=lt.div`
|
|
84
84
|
display: flex;
|
|
85
85
|
flex-direction: row;
|
|
86
86
|
justify-content: space-between;
|
|
87
87
|
align-content: center;
|
|
88
|
-
`,
|
|
88
|
+
`,ki=lt.div`
|
|
89
89
|
padding: 22px 22px 12px;
|
|
90
|
-
`,
|
|
90
|
+
`,Pi=lt.div`
|
|
91
91
|
display: flex;
|
|
92
92
|
flex: 1;
|
|
93
93
|
flex-direction: column;
|
|
94
94
|
justify-content: center;
|
|
95
|
-
`,
|
|
95
|
+
`,vi=lt.div`
|
|
96
96
|
display: flex;
|
|
97
97
|
flex: 2;
|
|
98
98
|
flex-shrink: 1;
|
|
@@ -104,7 +104,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
104
104
|
align-content: center;
|
|
105
105
|
align-items: center;
|
|
106
106
|
}
|
|
107
|
-
`,
|
|
107
|
+
`,Bi=lt.p`
|
|
108
108
|
${e=>B(e)} {
|
|
109
109
|
font-style: normal;
|
|
110
110
|
font-weight: 600;
|
|
@@ -113,7 +113,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
113
113
|
color: #808080;
|
|
114
114
|
}
|
|
115
115
|
margin: 0;
|
|
116
|
-
`;var
|
|
116
|
+
`;var Ei=vr.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 sa=Object.defineProperty,la=Object.defineProperties;var aa=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
|
+
`,Ai=vr(Vo)`
|
|
128
128
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
129
129
|
position: absolute;
|
|
130
130
|
bottom: -60px;
|
|
@@ -137,7 +137,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=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
|
+
`,Ni=vr.div`
|
|
141
141
|
display: flex;
|
|
142
142
|
justify-content: center;
|
|
143
143
|
align-items: center;
|
|
@@ -146,7 +146,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=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 jo({appearance:e}){return
|
|
149
|
+
`;function jo({appearance:e}){return Ii.createElement(Ni,{className:p("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Ii.createElement(Si,null))}var Ma=Go.div`
|
|
150
150
|
${e=>B(e)} {
|
|
151
151
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
152
152
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -208,7 +208,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
208
208
|
::-webkit-scrollbar {
|
|
209
209
|
display: none;
|
|
210
210
|
}
|
|
211
|
-
`,
|
|
211
|
+
`,et=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:a=!1})=>{let[d,l]=La("");return Br(()=>{let u=getComputedStyle(document.body).getPropertyValue("overflow");l(u)},[]),Br(()=>{let u=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[e]),Br(()=>{let u=document.body.style;return t?u.setProperty("overflow","hidden"):u.setProperty("overflow",d),()=>{u.setProperty("overflow",d)}},[t]),t?Je.createElement($a,null,Je.createElement(yi,{appearance:r,onClose:()=>{s&&e()}}),Je.createElement(Ma,{appearance:r,className:p("modalContainer",r),styleOverrides:i},s&&Je.createElement(Ua,{className:p("modalClose",r),onClick:()=>e(),appearance:r},Je.createElement(Ie,null)),o&&Je.createElement(Da,null,o),Je.createElement(_a,null,n),a&&Je.createElement(Ei,{appearance:r,className:p("poweredByFrigadeRibbon",r)},Je.createElement(jo,{appearance:r})))):Je.createElement(Je.Fragment,null)};import Ct,{useEffect as Er,useState as Wa}from"react";import Ko from"styled-components";import{Portal as za}from"react-portal";function Ha(e){switch(e){case"top-left":return`
|
|
212
212
|
top: 0;
|
|
213
213
|
left: 0;
|
|
214
214
|
`;case"top-right":return`
|
|
@@ -252,7 +252,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
252
252
|
::-webkit-scrollbar {
|
|
253
253
|
display: none;
|
|
254
254
|
}
|
|
255
|
-
`,qo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[a,d]=Wa("");return
|
|
255
|
+
`,qo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[a,d]=Wa("");return Er(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),Er(()=>{let l=u=>{u.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),Er(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",a),()=>{l.setProperty("overflow",a)}},[t]),t?Ct.createElement(za,null,Ct.createElement(Va,{appearance:n,className:p("cornerModalContainer",n),modalPosition:r},s&&Ct.createElement(Ga,{className:p("cornerModalClose",n),onClick:()=>e()},Ct.createElement(Ie,null)),o&&Ct.createElement(ja,null,o),Ct.createElement(Ka,null,i))):Ct.createElement(Ct.Fragment,null)};import{useContext as qa}from"react";function de(){let{defaultAppearance:e}=qa(oe);function t(o){var n,r,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import Mt,{useContext as gp,useEffect as Ji,useState as _r}from"react";import Zo from"styled-components";import Xo,{useEffect as Ui,useState as Ir}from"react";import Or from"styled-components";import Yo from"styled-components";var Oi=Yo.label`
|
|
256
256
|
${e=>B(e)} {
|
|
257
257
|
font-size: 12px;
|
|
258
258
|
line-height: 18px;
|
|
@@ -263,14 +263,14 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
263
263
|
letter-spacing: 0.24px;
|
|
264
264
|
}
|
|
265
265
|
display: flex;
|
|
266
|
-
`,
|
|
266
|
+
`,Li=Yo.label`
|
|
267
267
|
${e=>B(e)} {
|
|
268
268
|
font-size: 12px;
|
|
269
269
|
line-height: 20px;
|
|
270
270
|
margin-bottom: 5px;
|
|
271
271
|
}
|
|
272
272
|
display: flex;
|
|
273
|
-
|
|
273
|
+
`,$i=Yo.span`
|
|
274
274
|
font-weight: 400;
|
|
275
275
|
font-size: 14px;
|
|
276
276
|
line-height: 22px;
|
|
@@ -283,11 +283,11 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
283
283
|
align-items: flex-start;
|
|
284
284
|
justify-content: left;
|
|
285
285
|
margin-bottom: 10px;
|
|
286
|
-
`;import
|
|
286
|
+
`;import Ar from"react";var at={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function yt({title:e,required:t,appearance:o=at}){return e?Ar.createElement(Jo,{className:p("formLabelWrapper",o)},t?Ar.createElement($i,{className:p("formLabelRequired",o),appearance:o},"*"):null,Ar.createElement(Oi,{className:p("formLabel",o)},e)):null}import Mi from"react";function Qt({title:e,appearance:t}){return e?Mi.createElement(Jo,null,Mi.createElement(Li,{className:p("formSubLabel",t)},e)):null}import{z as Nr}from"zod";function Di(e,t){var o,i,n,r,s,a,d;try{if(t){if(t.type=="number"){let l=Nr.number();if(t.props)for(let u of t.props)u.requirement=="min"?l=l.min(Number(u.value),(o=u.message)!=null?o:"Value is too small"):u.requirement=="max"?l=l.max(Number(u.value),(i=u.message)!=null?i:"Value is too large"):u.requirement=="positive"?l=l.positive((n=u.message)!=null?n:"Value must be positive"):u.requirement=="negative"&&(l=l.nonpositive((r=u.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=Nr.string();if(t.props)for(let u of t.props)u.requirement=="min"?l=l.min(Number(u.value),(s=u.message)!=null?s:"Value is too short"):u.requirement=="max"?l=l.max(Number(u.value),(a=u.message)!=null?a:"Value is too long"):u.requirement=="regex"&&(l=l.regex(new RegExp(String(u.value)),(d=u.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof Nr.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var Ya=Or.div`
|
|
287
287
|
display: flex;
|
|
288
288
|
flex-direction: column;
|
|
289
289
|
width: 100%;
|
|
290
|
-
`,
|
|
290
|
+
`,Lr=Or.input`
|
|
291
291
|
${e=>B(e)} {
|
|
292
292
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
293
293
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -303,7 +303,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
303
303
|
box-sizing: border-box;
|
|
304
304
|
padding: 0 10px;
|
|
305
305
|
margin-bottom: 10px;
|
|
306
|
-
`,Ja=
|
|
306
|
+
`,Ja=Or.textarea`
|
|
307
307
|
${e=>B(e)} {
|
|
308
308
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
309
309
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -320,13 +320,13 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
320
320
|
box-sizing: border-box;
|
|
321
321
|
margin-bottom: 10px;
|
|
322
322
|
resize: none;
|
|
323
|
-
`;function
|
|
323
|
+
`;function $r({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,a]=Ir((n==null?void 0:n.text)||""),[d,l]=Ir(!1),[u,c]=Ir(!1),g=Lr;Ui(()=>{s===""&&!d&&(l(!0),S(""))},[]),Ui(()=>{if(u){S(s);return}},[u]);function S(h){var F;if(a(h),o({text:h}),r.required===!0&&h.trim()===""){i([{id:r.id,message:`${(F=r.title)!=null?F:"Field"} is required`,hidden:!u}]);return}let x=Di(h,r.validation);if(x&&(h.trim()!==""||r.required===!0)){i([{id:r.id,message:x,hidden:!u}]);return}i([])}r.multiline&&(g=Ja);function k(){var h;switch((h=r==null?void 0:r.validation)==null?void 0:h.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Xo.createElement(Ya,null,Xo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),Xo.createElement(g,{className:p("inputComponent",t.appearance),value:s,onChange:h=>{S(h.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:k(),onBlur:()=>{c(!0)}}),Xo.createElement(Qt,{title:r.subtitle,appearance:t.appearance}))}import tt,{useEffect as _i,useState as Wi}from"react";import zi from"styled-components";var Mr="",Xa=zi.div`
|
|
324
324
|
display: flex;
|
|
325
325
|
flex-direction: column;
|
|
326
326
|
width: 100%;
|
|
327
327
|
-webkit-appearance: none;
|
|
328
328
|
appearance: none;
|
|
329
|
-
`,Qa=
|
|
329
|
+
`,Qa=zi.select`
|
|
330
330
|
${e=>B(e)} {
|
|
331
331
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
332
332
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -347,15 +347,15 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=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
|
|
350
|
+
`;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var u,c,g,S,k,h,x,F,y;let r=e,[s,a]=Wi(!1),[d,l]=Wi(!1);return _i(()=>{var v,L,E,f;if(!((v=i==null?void 0:i.choice)!=null&&v[0])&&!s){if(a(!0),r.requireSelection){o({choice:[Mr]});return}if(r.defaultValue&&((L=r.props.options)!=null&&L.find(w=>w.id===r.defaultValue))){let w=(E=r.props.options)==null?void 0:E.find(I=>I.id===r.defaultValue);o({choice:[w.id]})}else o({choice:[((f=r.props.options)==null?void 0:f[0].id)||""]})}},[]),_i(()=>{var v;d&&(r.requireSelection&&((v=i==null?void 0:i.choice)==null?void 0:v[0])===Mr?n([{message:"Please select an option",id:r.id}]):n([]))},[(u=i==null?void 0:i.choice)==null?void 0:u[0],d]),tt.createElement(Xa,null,tt.createElement(yt,{title:r.title,required:!1,appearance:t.appearance}),tt.createElement(Qa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:v=>{l(!0),o({choice:[v.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:p("multipleChoiceSelect",t.appearance)},r.requireSelection&&tt.createElement("option",{key:"null-value",value:Mr,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(S=r.props.options)==null?void 0:S.map(v=>tt.createElement("option",{key:v.id,value:v.id},v.title))),((h=(k=r.props.options)==null?void 0:k.find(v=>{var L;return v.id===((L=i==null?void 0:i.choice)==null?void 0:L[0])}))==null?void 0:h.isOpenEnded)&&tt.createElement(tt.Fragment,null,tt.createElement(yt,{title:(y=(F=(x=r.props.options)==null?void 0:x.find(v=>{var L;return v.id===((L=i==null?void 0:i.choice)==null?void 0:L[0])}))==null?void 0:F.openEndedLabel)!=null?y:"Please specify",required:!1,appearance:t.appearance}),tt.createElement(Lr,{type:"text",placeholder:"Enter your answer here",onChange:v=>{o({choice:[v.target.value]})},appearance:t.appearance})),tt.createElement(Qt,{title:r.subtitle,appearance:t.appearance}))}import vo,{useEffect as Dr,useState as ji}from"react";import Gi from"styled-components";import Po from"react";import ko from"react";var Vi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return ko.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Za=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>ko.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},ko.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},ko.createElement(Vi,{color:n,size:t}),ko.createElement(Vi,{color:e,percentage:Math.max(o,.1),size:t})),i),Zt=Za;import Ra from"styled-components";var ep=({color:e="#FFFFFF"})=>Po.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Po.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),tp={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},op={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},rp={border:"1px solid #000000",color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np={color:"#FFFFFF"},sp={border:"1px solid #C5CBD3"},lp=e=>e==="square"?tp:op,ap=(e,t)=>e==="square"?t?rp:ip:t?np:sp,pp=Ra.div`
|
|
351
351
|
${e=>Ee(e)}
|
|
352
|
-
`,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:s})=>{let a=lp(t),d=ap(t,e);return e===!0?a=j(b(b({},a),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):a=b(b({},a),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?Po.createElement(Zt,{fillColor:o,percentage:i,size:22}):Po.createElement(pp,{styleOverrides:a,style:r,role:"checkbox",className:Te(p("checkIconContainer",n),p(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Po.createElement(ep,{color:"#FFFFFF"}))};var dp=
|
|
352
|
+
`,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:s})=>{let a=lp(t),d=ap(t,e);return e===!0?a=j(b(b({},a),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):a=b(b({},a),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?Po.createElement(Zt,{fillColor:o,percentage:i,size:22}):Po.createElement(pp,{styleOverrides:a,style:r,role:"checkbox",className:Te(p("checkIconContainer",n),p(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Po.createElement(ep,{color:"#FFFFFF"}))};var dp=Gi.div`
|
|
353
353
|
display: flex;
|
|
354
354
|
flex-direction: column;
|
|
355
355
|
width: 100%;
|
|
356
356
|
-webkit-appearance: none;
|
|
357
357
|
appearance: none;
|
|
358
|
-
`,cp=
|
|
358
|
+
`,cp=Gi.button`
|
|
359
359
|
${e=>B(e)} {
|
|
360
360
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
361
361
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -380,7 +380,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
380
380
|
height: 48px;
|
|
381
381
|
padding: 0 18px;
|
|
382
382
|
margin-bottom: 10px;
|
|
383
|
-
`;function
|
|
383
|
+
`;function Ki({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var u;let r=e,[s,a]=ji((i==null?void 0:i.choice)||[]),[d,l]=ji(!1);return Dr(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),Dr(()=>{o({choice:s})},[s]),Dr(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),vo.createElement(dp,null,vo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(u=r.props.options)==null?void 0:u.map(c=>vo.createElement(cp,{appearance:t.appearance,className:p(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){a(s.filter(g=>g!==c.id));return}s.length<r.props.maxChoices?a([...s,c.id]):s.length==1&&r.props.maxChoices==1&&a([c.id])}},c.title,vo.createElement(pt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),vo.createElement(Qt,{title:r.subtitle,appearance:t.appearance}))}import Qo from"react";import qi from"styled-components";import mp from"dompurify";function ce(e){return{__html:mp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var up=qi.h1`
|
|
384
384
|
${e=>B(e)} {
|
|
385
385
|
font-style: normal;
|
|
386
386
|
font-weight: 700;
|
|
@@ -392,7 +392,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
392
392
|
margin-bottom: 4px;
|
|
393
393
|
color: ${e=>e.appearance.theme.colorText};
|
|
394
394
|
}
|
|
395
|
-
`,fp=
|
|
395
|
+
`,fp=qi.h2`
|
|
396
396
|
${e=>B(e)} {
|
|
397
397
|
font-style: normal;
|
|
398
398
|
font-weight: 400;
|
|
@@ -401,7 +401,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
401
401
|
letter-spacing: 0.28px;
|
|
402
402
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
403
403
|
}
|
|
404
|
-
`;function Oe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Qo.createElement(Qo.Fragment,null,Qo.createElement(up,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:p(`${n}${n?Fo(i):i}Title`,e),dangerouslySetInnerHTML:ce(t),size:i}),o&&Qo.createElement(fp,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:p(`${n}${n?Fo(i):i}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:i}))}import*as
|
|
404
|
+
`;function Oe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Qo.createElement(Qo.Fragment,null,Qo.createElement(up,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:p(`${n}${n?Fo(i):i}Title`,e),dangerouslySetInnerHTML:ce(t),size:i}),o&&Qo.createElement(fp,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:p(`${n}${n?Fo(i):i}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:i}))}import*as Ur from"react";var Yi=e=>Ur.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Ur.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var hp=Zo.div`
|
|
405
405
|
display: flex;
|
|
406
406
|
flex-direction: column;
|
|
407
407
|
justify-content: flex-end;
|
|
@@ -419,20 +419,20 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
419
419
|
`,yp=Zo.div`
|
|
420
420
|
padding-left: 1px;
|
|
421
421
|
padding-right: 1px;
|
|
422
|
-
`,Sp={text
|
|
422
|
+
`,Sp={text:$r,multipleChoice:Hi,multipleChoiceList:Ki},Wr="frigade-multiInputStepTypeData";function Xi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:a}){var E;let d=t.props,[l,u]=_r([]),[c,g]=_r([]),{userId:S}=wo(),[k,h]=_r(v()||(a?a[t.id]:null)||{}),{readonly:x}=gp(oe),F=b(b({},Sp),s);Ji(()=>{i(l.length===0)},[l,i]),Ji(()=>{n(k)},[k]);function y(f,w){h(I=>{let T=j(b({},I),{[f.id]:w});return typeof window!="undefined"&&window.localStorage&&!x&&window.localStorage.setItem(L(),JSON.stringify(T)),T})}function v(){if(typeof window!="undefined"&&window.localStorage){let f=window.localStorage.getItem(L());if(f)return JSON.parse(f)}return null}function L(){return`${Wr}-${e}-${t.id}-${S}`}return Mt.createElement(yp,{className:p("multiInput",r)},Mt.createElement(Oe,{appearance:r,title:t.title,subtitle:t.subtitle}),Mt.createElement(hp,{className:p("multiInputContainer",r)},(E=d==null?void 0:d.data)==null?void 0:E.map(f=>{let w=l.reverse().find(I=>I.id===f.id);return F[f.type]?Mt.createElement("span",{key:f.id,"data-field-id":f.id,className:p("multiInputField",r)},F[f.type]({formInput:f,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:I=>{!c.includes(f.id)&&I&&(I==null?void 0:I.text)!==""&&g(T=>[...T,f.id]),y(f,I)},inputData:k[f.id],setFormValidationErrors:I=>{I.length===0&&l.length===0||u(T=>I.length===0?T.filter(A=>A.id!==f.id):[...T,...I])}}),w&&w.message&&c.includes(f.id)&&w.hidden!==!0&&Mt.createElement(xp,{key:f.id,style:{overflow:"hidden"},appearance:r,className:p("multiInputValidationError",r)},Mt.createElement(Cp,{appearance:r,className:p("multiInputValidationErrorIcon",r)},Mt.createElement(Yi,null)),w.message)):null})))}import Rt from"styled-components";var Qi=Rt.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
|
+
`,Zi=Rt.div`
|
|
428
428
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
429
429
|
font-size: 12px;
|
|
430
|
-
`,
|
|
430
|
+
`,Ri=Rt.div`
|
|
431
431
|
display: flex;
|
|
432
432
|
gap: 12px;
|
|
433
433
|
width: 100%;
|
|
434
434
|
justify-content: flex-end;
|
|
435
|
-
`,
|
|
435
|
+
`,en=Rt.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 sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
440
440
|
flex-grow: 1;
|
|
441
441
|
flex-basis: 0;
|
|
442
442
|
position: relative;
|
|
443
|
-
`,
|
|
443
|
+
`,tn=Rt.div`
|
|
444
444
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
445
445
|
position: relative;
|
|
446
446
|
overflow-y: auto;
|
|
447
|
-
`,
|
|
447
|
+
`,on=Rt.div`
|
|
448
448
|
display: flex;
|
|
449
449
|
align-self: stretch;
|
|
450
450
|
flex-grow: 1;
|
|
@@ -456,7 +456,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
456
456
|
background-position: center;
|
|
457
457
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
458
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
459
|
-
`;import St from"react";import
|
|
459
|
+
`;import St from"react";import nn from"react";import sn from"styled-components";import bp from"styled-components";var rn=bp.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 sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
474
474
|
transform: rotate(360deg);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
`;var wp=
|
|
477
|
+
`;var wp=sn.button`
|
|
478
478
|
justify-content: center;
|
|
479
479
|
align-content: center;
|
|
480
480
|
align-items: center;
|
|
@@ -507,7 +507,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
507
507
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
508
508
|
cursor: not-allowed;
|
|
509
509
|
}
|
|
510
|
-
`,Ro=
|
|
510
|
+
`,Ro=sn.div`
|
|
511
511
|
${e=>B(e)} {
|
|
512
512
|
display: flex;
|
|
513
513
|
flex-direction: row;
|
|
@@ -518,10 +518,10 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
518
518
|
margin-right: 8px;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
`,le=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:a,withMargin:d=!0,classPrefix:l="",loading:u=!1,autoFocus:c=!1})=>{var S;function g(){let k=s?"buttonSecondary":"button";return l===""?k:`${l}${Fo(k)}`}return
|
|
521
|
+
`,le=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:a,withMargin:d=!0,classPrefix:l="",loading:u=!1,autoFocus:c=!1})=>{var S;function g(){let k=s?"buttonSecondary":"button";return l===""?k:`${l}${Fo(k)}`}return nn.createElement(wp,{tabindex:s?"0":"1",secondary:s,appearance:a,disabled:i||u,loading:(S=u==null?void 0:u.toString())!=null?S:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:p(g(),a),autoFocus:c},u?nn.createElement(rn,{className:p("buttonLoader",a)}):t!=null?t:"Continue")};var ln=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:a,allowBackNavigation:d,errorMessage:l,isSaving:u})=>{var S;let c=s.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return St.createElement(St.Fragment,null,l!==null&&l!=null&&St.createElement(Zi,{appearance:o,className:p("formCTAError",o)},l),St.createElement(Qi,{showBackButton:c,className:p("formCTAContainer",o)},c&&St.createElement(le,{title:(S=e.backButtonTitle)!=null?S:"Back",onClick:a,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),St.createElement(Ri,{className:p("ctaWrapper",o)},e.secondaryButtonTitle?St.createElement(le,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:u}):null," ",e.primaryButtonTitle?St.createElement(le,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:u}):null)))};import zr from"react";import Tp from"styled-components";var Fp=Tp.div`
|
|
522
522
|
text-align: center;
|
|
523
523
|
color: #e6e6e6;
|
|
524
|
-
`,er=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=de().mergeAppearanceWithDefault(i);return
|
|
524
|
+
`,er=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=de().mergeAppearanceWithDefault(i);return zr.createElement(Fp,{className:o},zr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>zr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"currentColor"}))))};import Dt from"react";import eo from"styled-components";import{useContext as kp}from"react";function fe(){let e=kp(oe);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Pp=eo.div`
|
|
525
525
|
display: flex;
|
|
526
526
|
flex-wrap: wrap;
|
|
527
527
|
align-content: center;
|
|
@@ -569,7 +569,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
569
569
|
margin-top: 12px;
|
|
570
570
|
margin-bottom: 16px;
|
|
571
571
|
max-width: 70%;
|
|
572
|
-
`;function
|
|
572
|
+
`;function an({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=fe();return Dt.createElement("div",null,Dt.createElement(Ap,{dangerouslySetInnerHTML:ce(e.title)}),Dt.createElement(Np,{dangerouslySetInnerHTML:ce(e.subtitle)}),Dt.createElement(Pp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Dt.createElement(vp,{key:r.title},Dt.createElement(Bp,{src:r.imageUri}),Dt.createElement(Ep,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import oo,{useEffect as Wp}from"react";import or from"styled-components";import Hr from"react";var tr=({style:e,className:t})=>Hr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},Hr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Hr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Ut,{useRef as Ip,useState as Op}from"react";import to from"styled-components";var Lp=to.div`
|
|
573
573
|
display: flex;
|
|
574
574
|
align-items: center;
|
|
575
575
|
justify-content: flex-start;
|
|
@@ -610,12 +610,12 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
610
610
|
height: 100%;
|
|
611
611
|
min-height: 400px;
|
|
612
612
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
613
|
-
|
|
613
|
+
`,_p=to.iframe`
|
|
614
614
|
width: 100%;
|
|
615
615
|
height: 100%;
|
|
616
616
|
min-height: 400px;
|
|
617
617
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
618
|
-
`;function
|
|
618
|
+
`;function ot({appearance:e,videoUri:t,autoplay:o=!1}){let i=Ip(),[n,r]=Op(o);if(t.includes("youtube")){let s=t.split("v=")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Ut.createElement(Dp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${s}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("youtubePlayer",e)})}if(t.includes("vimeo")){let s=t.split("vimeo.com/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Ut.createElement(Up,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("vimeoPlayer",e)})}if(t.includes("wistia")){let s=t.split("wistia.com/medias/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Ut.createElement(_p,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("wistiaPlayer",e)})}return Ut.createElement(Lp,{className:p("videoPlayerWrapper",e),appearance:e},!n&&Ut.createElement($p,{onClick:()=>{r(!0),i.current.play()},appearance:e,className:p("playIconWrapper",e)},Ut.createElement(tr,null)),Ut.createElement(Mp,{appearance:e,controls:n,ref:i,play:n,src:t,autoPlay:o,muted:o}))}var zp=or.div`
|
|
619
619
|
${e=>B(e)} {
|
|
620
620
|
display: flex;
|
|
621
621
|
flex-direction: column;
|
|
@@ -639,23 +639,23 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
639
639
|
max-height: 250px;
|
|
640
640
|
margin-bottom: 24px;
|
|
641
641
|
}
|
|
642
|
-
`;function
|
|
642
|
+
`;function pn({stepData:e,appearance:t,setCanContinue:o}){return Wp(()=>{o(!0)},[]),oo.createElement(zp,{className:p("callToActionContainer",t)},oo.createElement(Vp,{className:p("callToActionTextContainer",t)},oo.createElement(Oe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&oo.createElement(Hp,{className:p("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&oo.createElement(jp,{appearance:t,className:p("callToActionVideo",t)},oo.createElement(ot,{appearance:t,videoUri:e.videoUri})))}import dt,{useEffect as Vr,useState as jr}from"react";import bt from"styled-components";var dn=bt.div`
|
|
643
643
|
width: auto;
|
|
644
644
|
display: flex;
|
|
645
645
|
flex-direction: column;
|
|
646
646
|
justify-content: center;
|
|
647
647
|
align-items: center;
|
|
648
648
|
padding: 4px;
|
|
649
|
-
`,
|
|
649
|
+
`,cn=bt.div`
|
|
650
650
|
width: 100%;
|
|
651
651
|
text-align: left;
|
|
652
|
-
`,
|
|
652
|
+
`,mn=bt.h1`
|
|
653
653
|
font-style: normal;
|
|
654
654
|
font-weight: 700;
|
|
655
655
|
font-size: 32px;
|
|
656
656
|
line-height: 38px;
|
|
657
657
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
658
|
-
`,
|
|
658
|
+
`,un=bt.h1`
|
|
659
659
|
font-style: normal;
|
|
660
660
|
font-weight: 400;
|
|
661
661
|
font-size: 16px;
|
|
@@ -663,7 +663,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
663
663
|
margin-top: 16px;
|
|
664
664
|
margin-bottom: 16px;
|
|
665
665
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
666
|
-
`,
|
|
666
|
+
`,fn=bt.div`
|
|
667
667
|
padding-top: 12px;
|
|
668
668
|
padding-bottom: 12px;
|
|
669
669
|
flex-direction: row;
|
|
@@ -674,17 +674,17 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
674
674
|
cursor: pointer;
|
|
675
675
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
676
676
|
width: 100%;
|
|
677
|
-
`,
|
|
677
|
+
`,gn=bt.div`
|
|
678
678
|
padding-top: 10px;
|
|
679
679
|
padding-bottom: 10px;
|
|
680
680
|
flex-direction: row;
|
|
681
681
|
display: flex;
|
|
682
682
|
justify-content: flex-start;
|
|
683
|
-
`,
|
|
683
|
+
`,hn=bt.img`
|
|
684
684
|
width: 42px;
|
|
685
685
|
height: 42px;
|
|
686
686
|
margin-right: 12px;
|
|
687
|
-
`,
|
|
687
|
+
`,xn=bt.p`
|
|
688
688
|
font-style: normal;
|
|
689
689
|
font-weight: 500;
|
|
690
690
|
font-size: 17px;
|
|
@@ -692,8 +692,8 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
692
692
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
693
693
|
display: flex;
|
|
694
694
|
align-self: center;
|
|
695
|
-
`;var
|
|
696
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,a])=>`${Ho(s)}: ${a};`).join(" ")} }`:`${Ho(i)}: ${n};`).join(" ")} }`).join(" ")}`;function se({appearance:e}){if(!e||!e.styleOverrides)return Bo.createElement(Bo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Bo.createElement(Bo.Fragment,null):Bo.createElement(qp,{inlineStyles:t})}import{useEffect as Yp,useState as Jp}from"react";function Ge(e,t=!0){let[o,i]=Jp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:a,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:u}=ie(),c=a(e);function g(){return M(this,null,function*(){!o&&!r&&s(e)===Ue&&l(u(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return Yp(()=>{g()},[r,e,t]),{}}var yn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:a,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:u,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:S=!1,modalPosition:k="center",repeatable:h=!1,onDismiss:x,showPagination:F=!1,allowBackNavigation:y=!1,validationHandler:v,showFrigadeBranding:L=!1,onFormDataChange:E,showFooter:f=!0,prefillData:w={},updateUrlOnPageChange:I=!1})=>{let{getFlow:T,getFlowSteps:A,isLoading:N,targetingLogicShouldHideFlow:U,getFlowStatus:z,getCurrentStepIndex:G,markFlowCompleted:_,markFlowNotStarted:K,markStepStarted:J}=ie(),O=G(e),{mergeAppearanceWithDefault:Z}=de(),[q,ne]=Xp(null),{setOpenFlowState:Se,getOpenFlowState:ke,hasOpenModals:R}=Ne();Ge(e,i);let $=A(e);d=Z(d);let[re,Pe]=i!==void 0&&n!==void 0?[i,n]:[ke(e,!0),H=>Se(e,H)],Ve=typeof window!="undefined"?window.location.hash:null;if(Cn(()=>{var H;if($&&$.length>0&&y){let V=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if($&&($==null?void 0:$.length)>0){let ee=-1;if(V){let D=V;ee=$.findIndex(Q=>Q.id===D),q===V&&(ee=-1)}ee!==-1&&(ne(V),J(e,$[ee].id))}}},[Ve]),Cn(()=>{!N&&$&&$.length&&typeof window!="undefined"&&y&&(ne($[O].id),window.location.hash=$[O].id)},[N,O,$]),N)return null;let ve=T(e);if(!ve||U(ve)||!$||i!==void 0&&i===!1||z(e)===pe&&l&&!h||(o=="modal"||o=="corner-modal")&&R(e))return null;let ae=()=>{Pe(!1),x&&x(),S===!0&&_(e)};if(k=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",ot.createElement(Re,{appearance:d,onClose:ae,visible:re,style:H,dismissible:g,showFrigadeBranding:L},ot.createElement(se,{appearance:d}),ot.createElement(ir,{appearance:d,steps:$,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:F,customFormElements:s,allowBackNavigation:y,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:w,updateUrlOnPageChange:I,repeatable:h}))}return o==="modal"&&k!=="center"?ot.createElement(qo,{appearance:d,onClose:ae,visible:re,modalPosition:k},ot.createElement(se,{appearance:d}),ot.createElement(ir,{appearance:d,steps:$,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:F,customFormElements:s,allowBackNavigation:y,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:w,updateUrlOnPageChange:I,repeatable:h})):ot.createElement(ot.Fragment,null,ot.createElement(se,{appearance:d}),ot.createElement(ir,{appearance:d,steps:$,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:F,customFormElements:s,allowBackNavigation:y,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:w,updateUrlOnPageChange:I,repeatable:h}))},Sn=yn;import{useCallback as Vr,useContext as Qp,useEffect as Zp}from"react";function jr(){let{organizationId:e,userId:t,setOrganizationId:o}=Qp(oe),{mutateUserFlowState:i}=_e(),{config:n,apiUrl:r}=Ze(),s=qt(),{verifySDKInitiated:a}=Yt();function d(g,S){return`frigade-user-group-registered-${g}-${S}`}Zp(()=>{if(t&&e){if(t.startsWith(Xt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=Vr(g=>M(this,null,function*(){if(!a())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),u=Vr((g,S)=>M(this,null,function*(){if(!a())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let h={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:S}]};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(h)})),i()}),[e,t,n,i]),c=Vr((g,S)=>M(this,null,function*(){if(a())if(S){let k=d(t,g);localStorage.setItem(k,"true"),o(g);let h={foreignUserId:t,foreignUserGroupId:g,properties:S};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(h)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:u}}var $t="frigade-xFrigade_guestUserId",Ao="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=bo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=_e(),{userId:n,setUserId:r}=wo(),[s,a]=Eo(n),{getFlowStatus:d}=ie(),{flows:l,userProperties:u,setIsNewGuestUser:c,flowResponses:g}=Rp(oe),[S,k]=Eo([]),[h,x]=Eo([]),{organizationId:F}=jr(),[y,v]=Eo(F),[L,E]=Eo(!1);ro(()=>{if(!o&&t)for(let T=0;T<t.length;T++){let A=t[T],N=l.find(U=>U.slug===(A==null?void 0:A.flowId));if(N&&A&&A.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!h.includes(N.slug)){setTimeout(()=>{f(A.flowId)},500);break}}},[o,t]),ro(()=>{g.length>0&&i()},[g]),ro(()=>{L||(E(!0),i())},[o,E]);function f(T){let A=l.find(N=>N.slug===T);A&&A.triggerType==="AUTOMATIC"&&!h.includes(A.slug)&&(x([...h,A.slug]),k([A]))}function w(){if(!n){let T=localStorage.getItem(Ao);if(T){r(T);return}let A=localStorage.getItem($t);if(A){r(A);return}c(!0);let N=Xt+ed();try{localStorage.setItem($t,N)}catch(U){console.log("Failed to save guest user id locally: Local storage unavailable",U)}r(U=>U||N)}}ro(()=>{try{if(l){let T=[];l.forEach(A=>{if(A.data){let N=A.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(U=>{let z=U.replace('"imageUri":"',"").replace('"',"");if(T.includes(z))return;let G=new Image;G.src=z,T.push(z)})}})}}catch(T){}},[l]),ro(()=>{if(n!==s&&(e([]),i()),a(n),n&&!n.startsWith(Xt))try{localStorage.setItem(Ao,n)}catch(T){console.log("Failed to save user id locally: Local storage available",T)}n===null&&setTimeout(()=>{n===null&&w()},50)},[n,l,u]),ro(()=>{F!=y&&(v(F),e([]),i())},[F,y,v]);function I(){return _t.createElement(_t.Fragment,null,S.map(T=>d(T.slug)!==Ue?null:_t.createElement("span",{key:T.slug},_t.createElement(Sn,{flowId:T.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return _t.createElement(_t.Fragment,null,_t.createElement(I,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function td(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((s,a)=>{r[s]||(r[s]=a===n.length-1?i:{}),r=r[s]})}}),t}function od(e){if(!e)return;let t=ue({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=td(t),n=od(o);return{overrides:i,css:n}}import hd from"styled-components";import{compose as xd,variant as kn}from"styled-system";import Fn from"react";import rd,{ThemeProvider as id,useTheme as nd}from"styled-components";import{border as sd,color as ld,compose as ad,get as pd,shadow as dd,space as cd,system as md,typography as ud}from"styled-system";var fd={width:{property:"width",scale:"sizes",transform:(e,t)=>pd(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},gd=rd("div")(({css:e})=>e,ad(sd,ld,dd,cd,ud,md(fd))),No=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=$e(r,["as","children","overrides"]);let s=nd(),a={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(gd,b(b({as:e},a),i),t);if(o!==void 0){let l=ue(s,o);return Fn.createElement(id,{theme:l},d())}return d()};var Io={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Cd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=hd(No)(()=>({whiteSpace:"nowrap"}),xd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:Cd})));import yd from"styled-components";import{variant as Sd,system as bd}from"styled-system";var nr={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=yd(No)(Sd({scale:"components.Text",variants:"components.Text"}),bd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",wd=20,Td=Object.fromEntries(Array.from(Array(wd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),io={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},sr={colors:j(b({},io),{neutral:{foreground:io.gray300},primary:{background:io.blue500,foreground:io.white,inverted:io.blue500},negative:{foreground:io.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Td,components:{Button:Io,Text:nr}};var Nn="https://api.frigade.com",oe=Fd({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Nn,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 Z,q,ne,Se,ke,R;let r=typeof window!="undefined"?localStorage.getItem($t):null,[s,a]=Ke(t||r),[d,l]=Ke(o||null),[u,c]=Ke([]),[g,S]=Ke([]),[k,h]=Ke([]),[x,F]=Ke({}),[y,v]=Ke({}),[L,E]=Ke([]),[f,w]=Ke({}),[I,T]=Ke(!1),[A,N]=Ke(!1),[U,z]=Ke(!K(e)),G=($,re)=>{if(re==="_blank"){window.open($,"_blank");return}setTimeout(()=>{window.location.href=$},50)},_={theme:b(b({},at.theme),(q=(Z=i==null?void 0:i.defaultAppearance)==null?void 0:Z.theme)!=null?q:{}),styleOverrides:b(b({},at.styleOverrides),(Se=(ne=i==null?void 0:i.defaultAppearance)==null?void 0:ne.styleOverrides)!=null?Se:{})};function K($){return!!($&&$.length>10&&$.substring(0,10)==="api_public")}lr(()=>{t&&a(t)},[t]),lr(()=>{s&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Ao)&&window.localStorage.getItem(Ao)!==s&&kd()},[s]),lr(()=>{o&&l(o)},[o]),lr(()=>{if(K(e))z(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),z(!0);return}},[e,z]);let J={publicApiKey:e,userId:s,setUserId:a,setFlows:c,flows:u,failedFlowResponses:g,setFailedFlowResponses:S,flowResponses:k,setFlowResponses:h,userProperties:x,setUserProperties:F,openFlowStates:y,setOpenFlowStates:v,completedFlowsToKeepOpenDuringSession:L,setCompletedFlowsToKeepOpenDuringSession:E,customVariables:f,setCustomVariables:w,isNewGuestUser:I,setIsNewGuestUser:T,hasActiveFullPageFlow:A,setHasActiveFullPageFlow:N,organizationId:d,setOrganizationId:l,navigate:i&&i.navigate?i.navigate:G,defaultAppearance:_,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:z,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:O}=Tn(_);return U?Oo.createElement(oe.Provider,{value:J},Oo.createElement(An,{theme:ue(_.theme,sr,O!=null?O:{},(ke=i==null?void 0:i.theme)!=null?ke:{})},n)):Oo.createElement(oe.Provider,{value:J},Oo.createElement(An,{theme:ue(_.theme,sr,O!=null?O:{},(R=i==null?void 0:i.theme)!=null?R:{})},n,Oo.createElement(bn,null)))};import xc from"react";import Ce,{useEffect as hr,useState as il}from"react";import Je,{useState as jd}from"react";import wt from"styled-components";import dr from"react";import Wt from"react";import On from"styled-components";var In=On.span`
|
|
695
|
+
`;var Cn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=jr([]),[a,d]=jr(!1),[l,u]=jr(e.id);return Vr(()=>{r.length==0&&!a&&(d(!0),o({choice:[]}))},[a]),Vr(()=>{l!==e.id&&(u(e.id),s([]))},[e]),Vr(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),dt.createElement(dn,{className:p("selectListContainer",i)},dt.createElement(cn,null,dt.createElement(mn,{className:p("selectListTitle",i)},e.title),dt.createElement(un,{appearance:i,className:p("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let S=r.includes(c.id);return dt.createElement(fn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(k=>k!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:g===n.options.length-1,className:p("selectListSelectItem",i)},dt.createElement(gn,{className:p("selectListItemImage",i)},c.imageUri&&dt.createElement(hn,{src:c.imageUri,alt:`select-icon-${g}`}),dt.createElement(xn,{appearance:i,className:p("selectListSelectItemText",i)},c.title)),dt.createElement(pt,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};import We,{useEffect as yn,useState as rr}from"react";var Gp=({children:e,id:t,shouldWrap:o=!1})=>We.createElement(We.Fragment,null,o?We.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),ir=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:a,type:d,hideOnFlowCompletion:l,onComplete:u,setVisible:c,setShowModal:g,onDismiss:S,showPagination:k=!1,customFormElements:h,allowBackNavigation:x,validationHandler:F,onFormDataChange:y,showFooter:v,prefillData:L,updateUrlOnPageChange:E,repeatable:f})=>{var ae;let I=b(b({},{linkCollection:an,multiInput:Xi,callToAction:pn,selectList:Cn}),i),{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:A}=fe(),[N,U]=rr(!1),[z,G]=rr({}),[_,K]=rr(!1),[J,O]=rr(null),Z=(ae=t[o])!=null?ae:null,{markStepCompleted:q,markStepStarted:ne,isLoading:Se,updateCustomVariables:ke,markFlowCompleted:R}=ie();yn(()=>{ke(n)},[n,Se]),yn(()=>{y&&y(z,$(),t[o],o)},[z]);function $(){var V;return{data:(V=z[t[o].id])!=null?V:{},stepId:t[o].id,customVariables:n}}function re(H,V,ee){let D=o+1<t.length?t[o+1]:null;return s&&s(H,ee,D,z,$()),r?r(H,o,V,D):!0}function Pe(H,V){G(ee=>{let D={};return D[H.id]=V,b(b({},ee),D)})}function Ve(H){return H.selectedStep.imageUri?We.createElement(on,{image:H.selectedStep.imageUri,appearance:e,className:p("formContainerSidebarImage",e)}):null}let ve=v&&We.createElement(ln,{step:t[o],canContinue:N&&!_,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>M(void 0,null,function*(){if(K(!0),F){let ee=yield F(t[o],o,t[o+1],z,$());if(ee!==!0){O(typeof ee=="string"?ee:null),K(!1);return}else O(null)}let H=b({},$());yield q(a,t[o].id,H),o+1<t.length&&!x&&(yield ne(a,t[o+1].id));let V=re(t[o],"primary",o);if(o+1>=t.length&&(u&&u(),S&&S(),l&&V&&(c&&c(!1),g(!1)),yield R(a),f&&(yield ne(a,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(D=>{D.startsWith(Wr)&&window.localStorage.removeItem(D)}))),T(t[o]),K(!1),typeof window!="undefined"&&!x&&E&&o+1<t.length){let ee=new URL(window.location.href);ee.searchParams.set("p",t[o+1].id),window.history.pushState({},"",ee.toString())}}),onSecondaryClick:()=>{re(t[o],"secondary",o),A(t[o])},onBack:()=>M(void 0,null,function*(){o-1>=0&&(K(!0),yield ne(a,t[o-1].id),K(!1))}),steps:t,allowBackNavigation:x,errorMessage:J,isSaving:_});return We.createElement(We.Fragment,null,We.createElement(en,{className:p("formContainer",e)},We.createElement(Gp,{id:o,shouldWrap:d==="large-modal"},We.createElement(tn,{key:Z.id,type:d,className:p("formContent",e)},t.map(H=>{var ee;let V=I[(ee=H.type)!=null?ee:"multiInput"];return Z.id!==H.id?null:typeof V!="function"?V:We.createElement(V,{key:H.id,stepData:H,canContinue:N,setCanContinue:U,onSaveData:D=>{Pe(H,D)},appearance:e,customFormElements:h,flowId:a,prefillData:L})}),k&&We.createElement(er,{className:p("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ve)),d=="large-modal"&&We.createElement(Ve,{selectedStep:t[o]})))};import Bo from"react";import{createGlobalStyle as Kp}from"styled-components";var qp=Kp`
|
|
696
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,a])=>`${Ho(s)}: ${a};`).join(" ")} }`:`${Ho(i)}: ${n};`).join(" ")} }`).join(" ")}`;function se({appearance:e}){if(!e||!e.styleOverrides)return Bo.createElement(Bo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Bo.createElement(Bo.Fragment,null):Bo.createElement(qp,{inlineStyles:t})}import{useEffect as Yp,useState as Jp}from"react";function Ge(e,t=!0){let[o,i]=Jp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:a,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:u}=ie(),c=a(e);function g(){return M(this,null,function*(){!o&&!r&&s(e)===Ue&&l(u(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return Yp(()=>{g()},[r,e,t]),{}}var bn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:a,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:u,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:S=!1,modalPosition:k="center",repeatable:h=!1,onDismiss:x,showPagination:F=!1,allowBackNavigation:y=!1,validationHandler:v,showFrigadeBranding:L=!1,onFormDataChange:E,showFooter:f=!0,prefillData:w={},updateUrlOnPageChange:I=!1})=>{let{getFlow:T,getFlowSteps:A,isLoading:N,targetingLogicShouldHideFlow:U,getFlowStatus:z,getCurrentStepIndex:G,markFlowCompleted:_,markFlowNotStarted:K,markStepStarted:J}=ie(),O=G(e),{mergeAppearanceWithDefault:Z}=de(),[q,ne]=Xp(null),{setOpenFlowState:Se,getOpenFlowState:ke,hasOpenModals:R}=Ne();Ge(e,i);let $=A(e);d=Z(d);let[re,Pe]=i!==void 0&&n!==void 0?[i,n]:[ke(e,!0),H=>Se(e,H)],Ve=typeof window!="undefined"?window.location.hash:null;if(Sn(()=>{var H;if($&&$.length>0&&y){let V=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if($&&($==null?void 0:$.length)>0){let ee=-1;if(V){let D=V;ee=$.findIndex(Q=>Q.id===D),q===V&&(ee=-1)}ee!==-1&&(ne(V),J(e,$[ee].id))}}},[Ve]),Sn(()=>{!N&&$&&$.length&&typeof window!="undefined"&&y&&(ne($[O].id),window.location.hash=$[O].id)},[N,O,$]),N)return null;let ve=T(e);if(!ve||U(ve)||!$||i!==void 0&&i===!1||z(e)===pe&&l&&!h||(o=="modal"||o=="corner-modal")&&R(e))return null;let ae=()=>{Pe(!1),x&&x(),S===!0&&_(e)};if(k=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",rt.createElement(et,{appearance:d,onClose:ae,visible:re,style:H,dismissible:g,showFrigadeBranding:L},rt.createElement(se,{appearance:d}),rt.createElement(ir,{appearance:d,steps:$,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:F,customFormElements:s,allowBackNavigation:y,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:w,updateUrlOnPageChange:I,repeatable:h}))}return o==="modal"&&k!=="center"?rt.createElement(qo,{appearance:d,onClose:ae,visible:re,modalPosition:k},rt.createElement(se,{appearance:d}),rt.createElement(ir,{appearance:d,steps:$,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:F,customFormElements:s,allowBackNavigation:y,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:w,updateUrlOnPageChange:I,repeatable:h})):rt.createElement(rt.Fragment,null,rt.createElement(se,{appearance:d}),rt.createElement(ir,{appearance:d,steps:$,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:F,customFormElements:s,allowBackNavigation:y,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:w,updateUrlOnPageChange:I,repeatable:h}))},wn=bn;import{useCallback as Gr,useContext as Qp,useEffect as Zp}from"react";function Kr(){let{organizationId:e,userId:t,setOrganizationId:o}=Qp(oe),{mutateUserFlowState:i}=_e(),{config:n,apiUrl:r}=Re(),s=qt(),{verifySDKInitiated:a}=Yt();function d(g,S){return`frigade-user-group-registered-${g}-${S}`}Zp(()=>{if(t&&e){if(t.startsWith(Xt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=Gr(g=>M(this,null,function*(){if(!a())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),u=Gr((g,S)=>M(this,null,function*(){if(!a())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let h={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:S}]};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(h)})),i()}),[e,t,n,i]),c=Gr((g,S)=>M(this,null,function*(){if(a())if(S){let k=d(t,g);localStorage.setItem(k,"true"),o(g);let h={foreignUserId:t,foreignUserGroupId:g,properties:S};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(h)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:u}}var $t="frigade-xFrigade_guestUserId",Ao="frigade-xFrigade_userId",Tn=({})=>{let{setFlowResponses:e}=bo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=_e(),{userId:n,setUserId:r}=wo(),[s,a]=Eo(n),{getFlowStatus:d}=ie(),{flows:l,userProperties:u,setIsNewGuestUser:c,flowResponses:g}=Rp(oe),[S,k]=Eo([]),[h,x]=Eo([]),{organizationId:F}=Kr(),[y,v]=Eo(F),[L,E]=Eo(!1);ro(()=>{if(!o&&t)for(let T=0;T<t.length;T++){let A=t[T],N=l.find(U=>U.slug===(A==null?void 0:A.flowId));if(N&&A&&A.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!h.includes(N.slug)){setTimeout(()=>{f(A.flowId)},500);break}}},[o,t]),ro(()=>{g.length>0&&i()},[g]),ro(()=>{L||(E(!0),i())},[o,E]);function f(T){let A=l.find(N=>N.slug===T);A&&A.triggerType==="AUTOMATIC"&&!h.includes(A.slug)&&(x([...h,A.slug]),k([A]))}function w(){if(!n){let T=localStorage.getItem(Ao);if(T){r(T);return}let A=localStorage.getItem($t);if(A){r(A);return}c(!0);let N=Xt+ed();try{localStorage.setItem($t,N)}catch(U){console.log("Failed to save guest user id locally: Local storage unavailable",U)}r(U=>U||N)}}ro(()=>{try{if(l){let T=[];l.forEach(A=>{if(A.data){let N=A.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(U=>{let z=U.replace('"imageUri":"',"").replace('"',"");if(T.includes(z))return;let G=new Image;G.src=z,T.push(z)})}})}}catch(T){}},[l]),ro(()=>{if(n!==s&&(e([]),i()),a(n),n&&!n.startsWith(Xt))try{localStorage.setItem(Ao,n)}catch(T){console.log("Failed to save user id locally: Local storage available",T)}n===null&&setTimeout(()=>{n===null&&w()},50)},[n,l,u]),ro(()=>{F!=y&&(v(F),e([]),i())},[F,y,v]);function I(){return _t.createElement(_t.Fragment,null,S.map(T=>d(T.slug)!==Ue?null:_t.createElement("span",{key:T.slug},_t.createElement(wn,{flowId:T.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return _t.createElement(_t.Fragment,null,_t.createElement(I,null))};var Fn={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(Fn[o]){let n=Fn[o].split("."),r=t;n.forEach((s,a)=>{r[s]||(r[s]=a===n.length-1?i:{}),r=r[s]})}}),t}function od(e){if(!e)return;let t=ue({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function 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 vn}from"styled-system";import Pn from"react";import rd,{ThemeProvider as id,useTheme as nd}from"styled-components";import{border as sd,color as ld,compose as ad,get as pd,shadow as dd,space as cd,system as md,typography as ud}from"styled-system";var fd={width:{property:"width",scale:"sizes",transform:(e,t)=>pd(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},gd=rd("div")(({css:e})=>e,ad(sd,ld,dd,cd,ud,md(fd))),No=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=$e(r,["as","children","overrides"]);let s=nd(),a={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Pn.createElement(gd,b(b({as:e},a),i),t);if(o!==void 0){let l=ue(s,o);return Pn.createElement(id,{theme:l},d())}return d()};var Io={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Cd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Bn=hd(No)(()=>({whiteSpace:"nowrap"}),xd(vn({scale:"components.Button",variants:"components.Button"}),vn({prop:"size",variants:Cd})));import yd from"styled-components";import{variant as Sd,system as bd}from"styled-system";var nr={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var En=yd(No)(Sd({scale:"components.Text",variants:"components.Text"}),bd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var An=4,Nn="px",wd=20,Td=Object.fromEntries(Array.from(Array(wd+1),(e,t)=>t===0?[.5,`${.5*An}${Nn}`]:[t,`${t*An}${Nn}`])),io={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},sr={colors:j(b({},io),{neutral:{foreground:io.gray300},primary:{background:io.blue500,foreground:io.white,inverted:io.blue500},negative:{foreground:io.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Td,components:{Button:Io,Text:nr}};var On="https://api.frigade.com",oe=Fd({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:On,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 Z,q,ne,Se,ke,R;let r=typeof window!="undefined"?localStorage.getItem($t):null,[s,a]=Ke(t||r),[d,l]=Ke(o||null),[u,c]=Ke([]),[g,S]=Ke([]),[k,h]=Ke([]),[x,F]=Ke({}),[y,v]=Ke({}),[L,E]=Ke([]),[f,w]=Ke({}),[I,T]=Ke(!1),[A,N]=Ke(!1),[U,z]=Ke(!K(e)),G=($,re)=>{if(re==="_blank"){window.open($,"_blank");return}setTimeout(()=>{window.location.href=$},50)},_={theme:b(b({},at.theme),(q=(Z=i==null?void 0:i.defaultAppearance)==null?void 0:Z.theme)!=null?q:{}),styleOverrides:b(b({},at.styleOverrides),(Se=(ne=i==null?void 0:i.defaultAppearance)==null?void 0:ne.styleOverrides)!=null?Se:{})};function K($){return!!($&&$.length>10&&$.substring(0,10)==="api_public")}lr(()=>{t&&a(t)},[t]),lr(()=>{s&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Ao)&&window.localStorage.getItem(Ao)!==s&&kd()},[s]),lr(()=>{o&&l(o)},[o]),lr(()=>{if(K(e))z(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),z(!0);return}},[e,z]);let J={publicApiKey:e,userId:s,setUserId:a,setFlows:c,flows:u,failedFlowResponses:g,setFailedFlowResponses:S,flowResponses:k,setFlowResponses:h,userProperties:x,setUserProperties:F,openFlowStates:y,setOpenFlowStates:v,completedFlowsToKeepOpenDuringSession:L,setCompletedFlowsToKeepOpenDuringSession:E,customVariables:f,setCustomVariables:w,isNewGuestUser:I,setIsNewGuestUser:T,hasActiveFullPageFlow:A,setHasActiveFullPageFlow:N,organizationId:d,setOrganizationId:l,navigate:i&&i.navigate?i.navigate:G,defaultAppearance:_,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:z,apiUrl:i&&i.apiUrl?i.apiUrl:On,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:O}=kn(_);return U?Oo.createElement(oe.Provider,{value:J},Oo.createElement(In,{theme:ue(_.theme,sr,O!=null?O:{},(ke=i==null?void 0:i.theme)!=null?ke:{})},n)):Oo.createElement(oe.Provider,{value:J},Oo.createElement(In,{theme:ue(_.theme,sr,O!=null?O:{},(R=i==null?void 0:i.theme)!=null?R:{})},n,Oo.createElement(Tn,null)))};import xc from"react";import Ce,{useEffect as hr,useState as sl}from"react";import Xe,{useState as jd}from"react";import wt from"styled-components";import dr from"react";import Wt from"react";import $n from"styled-components";var Ln=$n.span`
|
|
697
697
|
font-weight: 600;
|
|
698
698
|
font-size: 14px;
|
|
699
699
|
font-style: normal;
|
|
@@ -705,7 +705,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
705
705
|
margin-left: 32px;
|
|
706
706
|
padding-right: 12px;
|
|
707
707
|
${e=>Ee(e)}
|
|
708
|
-
`,vd
|
|
708
|
+
`,vd=$n.div`
|
|
709
709
|
flex-direction: row;
|
|
710
710
|
justify-content: space-between;
|
|
711
711
|
display: flex;
|
|
@@ -714,11 +714,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
714
714
|
padding-right: 8px;
|
|
715
715
|
width: 100%;
|
|
716
716
|
${e=>Ee(e)}
|
|
717
|
-
`,ar=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:a})=>Wt.createElement(Wt.Fragment,null,Wt.createElement(vd,{className:p("checklistStepsContainer",a),appearance:a,styleOverrides:b({},n)},i==="left"&&e&&Wt.createElement(
|
|
717
|
+
`,ar=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:a})=>Wt.createElement(Wt.Fragment,null,Wt.createElement(vd,{className:p("checklistStepsContainer",a),appearance:a,styleOverrides:b({},n)},i==="left"&&e&&Wt.createElement(Ln,{className:p("checklistStepLabel",a),styleOverrides:o,appearnace:a},e),Wt.createElement(pt,{appearance:a,value:t,type:s,primaryColor:r}),i==="right"&&e&&Wt.createElement(Ln,{className:p("checklistStepLabel",a),styleOverrides:o,appearance:a},e)),Wt.createElement(se,{appearance:a}));import Lo from"styled-components";var Mn=Lo.div`
|
|
718
718
|
font-weight: 700;
|
|
719
719
|
font-size: 18px;
|
|
720
720
|
line-height: 22px;
|
|
721
|
-
|
|
721
|
+
`,Dn=Lo.p`
|
|
722
722
|
font-weight: 600;
|
|
723
723
|
font-size: 16px;
|
|
724
724
|
line-height: 24px;
|
|
@@ -726,7 +726,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
726
726
|
letter-spacing: 0.32px;
|
|
727
727
|
font-style: normal;
|
|
728
728
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
729
|
-
`,
|
|
729
|
+
`,Un=Lo.p`
|
|
730
730
|
font-weight: 400;
|
|
731
731
|
font-size: 14px;
|
|
732
732
|
font-style: normal;
|
|
@@ -742,19 +742,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
742
742
|
height: 100%;
|
|
743
743
|
border-top-right-radius: 4px;
|
|
744
744
|
border-bottom-right-radius: 4px;
|
|
745
|
-
`,
|
|
745
|
+
`,_n=Lo.div`
|
|
746
746
|
flex-direction: row;
|
|
747
747
|
justify-content: flex-start;
|
|
748
748
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
749
749
|
padding-right: 16px;
|
|
750
|
-
`;var
|
|
750
|
+
`;var Wn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var a,d,l,u,c;return dr.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&dr.createElement(pr,{className:p("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(a=s==null?void 0:s.theme)==null?void 0:a.colorPrimary)!=null?d:i}}),dr.createElement(_n,{className:p("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},dr.createElement(ar,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(u=s==null?void 0:s.theme)==null?void 0:u.colorPrimary)!=null?c:i,appearance:s})))};import zt from"react";import qr from"styled-components";import cr from"styled-components";var xC=cr.h1`
|
|
751
751
|
display: flex;
|
|
752
752
|
margin: 0;
|
|
753
753
|
font-size: 18px;
|
|
754
754
|
`,CC=cr.h2`
|
|
755
755
|
font-size: 15px;
|
|
756
756
|
color: #4d4d4d;
|
|
757
|
-
`,
|
|
757
|
+
`,zn=cr.div`
|
|
758
758
|
position: absolute;
|
|
759
759
|
left: 0;
|
|
760
760
|
top: 0;
|
|
@@ -763,7 +763,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
763
763
|
border-radius: 20px;
|
|
764
764
|
background-color: ${e=>e.theme.colorPrimary};
|
|
765
765
|
transition: width 0.5s;
|
|
766
|
-
`,
|
|
766
|
+
`,Hn=cr.div`
|
|
767
767
|
position: relative;
|
|
768
768
|
left: 0;
|
|
769
769
|
top: 0;
|
|
@@ -773,7 +773,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
773
773
|
border-radius: 20px;
|
|
774
774
|
background-color: ${e=>e.theme.colorPrimary};
|
|
775
775
|
opacity: 0.12;
|
|
776
|
-
`;var Bd=
|
|
776
|
+
`;var Bd=qr.div`
|
|
777
777
|
display: flex;
|
|
778
778
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
779
779
|
justify-content: flex-start;
|
|
@@ -781,23 +781,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
781
781
|
width: 100%;
|
|
782
782
|
|
|
783
783
|
${e=>Ee(e)}
|
|
784
|
-
`,Ed=
|
|
784
|
+
`,Ed=qr.div`
|
|
785
785
|
flex-grow: 1;
|
|
786
786
|
position: relative;
|
|
787
787
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
788
|
-
`,Ad=
|
|
788
|
+
`,Ad=qr.span`
|
|
789
789
|
font-weight: 600;
|
|
790
790
|
font-size: 14px;
|
|
791
791
|
line-height: 18px;
|
|
792
792
|
padding-right: ${e=>e.padding};
|
|
793
793
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
794
794
|
${e=>Ee(e)}
|
|
795
|
-
`;var ze=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var g;if(t===0)return zt.createElement(zt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=s==null?void 0:s.theme)==null?void 0:g.colorText});let a=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),u=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(u="0px"),zt.createElement(Bd,{className:p("progressBarContainer",s),textLocation:i,styleOverrides:n},zt.createElement(Ad,{className:p("progressBarStepText",s),styleOverrides:j(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:u,textLocation:i},c),zt.createElement(Ed,{textLocation:i,className:p("progressBar",s)},zt.createElement(
|
|
795
|
+
`;var ze=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var g;if(t===0)return zt.createElement(zt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=s==null?void 0:s.theme)==null?void 0:g.colorText});let a=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),u=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(u="0px"),zt.createElement(Bd,{className:p("progressBarContainer",s),textLocation:i,styleOverrides:n},zt.createElement(Ad,{className:p("progressBarStepText",s),styleOverrides:j(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:u,textLocation:i},c),zt.createElement(Ed,{textLocation:i,className:p("progressBar",s)},zt.createElement(zn,{style:{zIndex:o=="compact"?1:5},fgWidth:a,barHeight:d,appearance:s,className:p("progressBarFill",s)}),zt.createElement(Hn,{className:p("progressBarBackground",s),barHeight:d,appearance:s})))};import $o from"react";import Id from"styled-components";import ur from"react";import mr from"react";var no=({stepData:e,appearance:t})=>mr.createElement(mr.Fragment,null,mr.createElement(Dn,{appearance:t,className:p("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),mr.createElement(Un,{appearance:t,className:p("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import Yr from"react";var so=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Yr.createElement(Ro,{className:p("ctaContainer",t)},Yr.createElement(le,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Yr.createElement(le,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var lo=({stepData:e,appearance:t})=>ur.createElement(ur.Fragment,null,ur.createElement(no,{stepData:e,appearance:t}),ur.createElement(so,{stepData:e,appearance:t}));import Nd from"react";function Vn(e){return Nd.createElement(ot,{appearance:e.appearance,videoUri:e.videoUri,autoplay:e.autoplay})}var Jr="default",Od=Id.img`
|
|
796
796
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
797
797
|
width: 100%;
|
|
798
798
|
height: auto;
|
|
799
799
|
min-height: 200px;
|
|
800
|
-
`,
|
|
800
|
+
`,jn=({stepData:e,appearance:t})=>{var o;if(e!=null&&e.StepContent){let i=e.StepContent;return $o.createElement("div",null,i)}return $o.createElement(Mn,{className:p("checklistStepContent",t)},e.imageUri?$o.createElement(Od,{className:p("checklistStepImage",t),src:e.imageUri,appearance:t}):null,e.videoUri?$o.createElement(Vn,{videoUri:e.videoUri,appearance:t,autoplay:(o=e.props)==null?void 0:o.autoplayVideo}):null,$o.createElement(lo,{stepData:e,appearance:t}))};import He,{useRef as Ld,useState as $d}from"react";import ao from"styled-components";var Gn=ao.div`
|
|
801
801
|
display: block;
|
|
802
802
|
`,Md=ao.div`
|
|
803
803
|
display: flex;
|
|
@@ -842,7 +842,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
842
842
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
843
843
|
border-radius: 50%;
|
|
844
844
|
}
|
|
845
|
-
`,
|
|
845
|
+
`,Kn="videoCarousel",qn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return He.createElement(Gn,null,He.createElement(lo,{stepData:e,appearance:t}));function o({video:r}){let s=Ld(),[a,d]=$d(!1);return He.createElement(Dd,null,!a&&He.createElement(Wd,{onClick:()=>{d(!0),s.current.play()},appearance:t},He.createElement(tr,null)),He.createElement(Ud,{controls:a,ref:s,play:a,src:r.uri}),He.createElement(_d,null,r.title))}let i=e.props;return i.videos?He.createElement(Gn,null,He.createElement(no,{stepData:e,appearance:t}),He.createElement(Md,null,i.videos.map((r,s)=>He.createElement("span",{key:`${r.uri}-${s}`},He.createElement(o,{video:r})))),He.createElement(so,{stepData:e,appearance:t})):null};import ct from"react";import fr from"styled-components";var Yn=fr.div`
|
|
846
846
|
display: block;
|
|
847
847
|
`,zd=fr.pre`
|
|
848
848
|
display: block;
|
|
@@ -867,7 +867,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
867
867
|
margin-top: 12px;
|
|
868
868
|
`,Vd=fr.div`
|
|
869
869
|
margin-top: 24px;
|
|
870
|
-
`,
|
|
870
|
+
`,Jn="codeSnippet",Xn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return ct.createElement(Yn,null,ct.createElement(lo,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?ct.createElement(Yn,{className:p("codeSnippetContainer",t)},ct.createElement(no,{stepData:e,appearance:t}),ct.createElement(Vd,null,o.codeSnippets.map((n,r)=>ct.createElement("div",{key:r},n.title?ct.createElement(Hd,{dangerouslySetInnerHTML:ce(n.title)}):null,n.code?ct.createElement(zd,null,n.code):null))),ct.createElement(so,{stepData:e,appearance:t})):null};var Gd=wt.div`
|
|
871
871
|
display: flex;
|
|
872
872
|
flex-direction: row;
|
|
873
873
|
overflow: hidden;
|
|
@@ -908,30 +908,30 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
908
908
|
`,Zd=wt.div`
|
|
909
909
|
flex: 2;
|
|
910
910
|
padding: 40px 40px 40px 0px;
|
|
911
|
-
`,Rd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:a=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:u}=de();d=u(d);let c={[
|
|
911
|
+
`,Rd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:a=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:u}=de();d=u(d);let c={[Jr]:jn,[Kn]:qn,[Jn]:Xn},g=b(b({},c),a),[S,k]=jd(0),h=n!=null?n:S,x=r!=null?r:k,F=o.filter(v=>v.complete===!0).length,y=()=>{var v;return!((v=o[h])!=null&&v.type)||!g[o[h].type]?g[Jr]({stepData:o[h],appearance:d}):typeof g[o[h].type]!="function"?g[o[h].type]:g[o[h].type]({stepData:o[h],appearance:d})};return Xe.createElement(Gd,{type:l,styleOverrides:i,className:s,appearance:d},Xe.createElement(Jd,{className:p("checklistHeaderContainer",d),appearance:d},Xe.createElement(Yd,{className:p("checklistHeader",d),appearance:d},Xe.createElement(Kd,{className:p("checklistTitle",d),appearance:d},e),Xe.createElement(qd,{className:p("checklistSubtitle",d),appearance:d},t),Xe.createElement(ze,{total:o.length,count:F,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Xe.createElement(Xd,{className:p("checklistStepsContainer",d)},o.map((v,L)=>Xe.createElement(Wn,{data:v,index:L,key:L,listLength:o.length,isSelected:L===h,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x(L)},appearance:d})))),Xe.createElement(Qd,{appearance:d,className:p("checklistDivider",d)}),Xe.createElement(Zd,null,Xe.createElement(y,null)))},Xr=Rd;import Y,{useState as ic}from"react";import Qn from"react";import ec from"styled-components";var tc=ec.svg`
|
|
912
912
|
transition: 'transform 0.35s ease-in-out';
|
|
913
|
-
`,po=({style:e,className:t})=>
|
|
913
|
+
`,po=({style:e,className:t})=>Qn.createElement(tc,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Qn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var Qr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Zn=be.div`
|
|
914
914
|
max-height: 350px;
|
|
915
915
|
padding-bottom: 40px;
|
|
916
|
-
`,
|
|
916
|
+
`,Rn=be.div`
|
|
917
917
|
display: flex;
|
|
918
918
|
flex-direction: column;
|
|
919
919
|
margin-top: 20px;
|
|
920
|
-
`,
|
|
920
|
+
`,es=be.h1`
|
|
921
921
|
font-style: normal;
|
|
922
922
|
font-weight: 600;
|
|
923
923
|
font-size: 30px;
|
|
924
924
|
line-height: 36px;
|
|
925
925
|
margin-bottom: 16px;
|
|
926
926
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
927
|
-
`,
|
|
927
|
+
`,ts=be.h2`
|
|
928
928
|
font-weight: 400;
|
|
929
929
|
font-size: 16px;
|
|
930
930
|
line-height: 20px;
|
|
931
931
|
margin-bottom: 16px;
|
|
932
932
|
padding-left: 1px;
|
|
933
933
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
934
|
-
`,
|
|
934
|
+
`,os=be.div`
|
|
935
935
|
${e=>B(e)} {
|
|
936
936
|
border: 1px solid #fafafa;
|
|
937
937
|
}
|
|
@@ -941,11 +941,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
941
941
|
flex-direction: column;
|
|
942
942
|
min-height: 240px;
|
|
943
943
|
overflow: hidden;
|
|
944
|
-
`,
|
|
944
|
+
`,rs=be.div`
|
|
945
945
|
display: flex;
|
|
946
946
|
flex-direction: row;
|
|
947
947
|
justify-content: space-between;
|
|
948
|
-
`,
|
|
948
|
+
`,is=be.p`
|
|
949
949
|
${e=>B(e)} {
|
|
950
950
|
font-weight: 400;
|
|
951
951
|
font-size: 10px;
|
|
@@ -954,12 +954,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
954
954
|
color: #8c8c8c;
|
|
955
955
|
margin: 20px;
|
|
956
956
|
}
|
|
957
|
-
`,
|
|
957
|
+
`,ns=be.div`
|
|
958
958
|
display: flex;
|
|
959
959
|
flex-direction: row;
|
|
960
|
-
`,
|
|
960
|
+
`,ss=be.div`
|
|
961
961
|
flex: 1;
|
|
962
|
-
`,
|
|
962
|
+
`,ls=be.div`
|
|
963
963
|
${e=>B(e)} {
|
|
964
964
|
display: flex;
|
|
965
965
|
justify-content: center;
|
|
@@ -969,7 +969,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
969
969
|
padding-left: 8px;
|
|
970
970
|
padding-right: 8px;
|
|
971
971
|
}
|
|
972
|
-
`,
|
|
972
|
+
`,as=be.p`
|
|
973
973
|
${e=>B(e)} {
|
|
974
974
|
font-style: normal;
|
|
975
975
|
font-weight: 600;
|
|
@@ -981,7 +981,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
981
981
|
margin-top: 20px;
|
|
982
982
|
margin-bottom: 16px;
|
|
983
983
|
}
|
|
984
|
-
`,
|
|
984
|
+
`,ps=be.p`
|
|
985
985
|
${e=>B(e)} {
|
|
986
986
|
font-weight: 400;
|
|
987
987
|
font-size: 14px;
|
|
@@ -990,14 +990,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
990
990
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
991
991
|
margin-bottom: 8px;
|
|
992
992
|
}
|
|
993
|
-
`,
|
|
993
|
+
`,ds=be.div`
|
|
994
994
|
${e=>B(e)} {
|
|
995
995
|
display: flex;
|
|
996
996
|
flex-direction: row;
|
|
997
997
|
justify-content: center;
|
|
998
998
|
gap: 8px;
|
|
999
999
|
}
|
|
1000
|
-
`,
|
|
1000
|
+
`,cs=be.div`
|
|
1001
1001
|
${e=>B(e)} {
|
|
1002
1002
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1003
1003
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -1017,7 +1017,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1017
1017
|
justify-content: space-between;
|
|
1018
1018
|
position: relative;
|
|
1019
1019
|
cursor: pointer;
|
|
1020
|
-
`,
|
|
1020
|
+
`,ms=be.p`
|
|
1021
1021
|
${e=>B(e)} {
|
|
1022
1022
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1023
1023
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -1026,12 +1026,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1026
1026
|
font-size: 14px;
|
|
1027
1027
|
line-height: 22px;
|
|
1028
1028
|
margin: 0;
|
|
1029
|
-
`,
|
|
1029
|
+
`,us=be.div`
|
|
1030
1030
|
display: flex;
|
|
1031
1031
|
flex-direction: row;
|
|
1032
1032
|
justify-content: flex-end;
|
|
1033
1033
|
align-content: center;
|
|
1034
|
-
`,
|
|
1034
|
+
`,fs=be.div`
|
|
1035
1035
|
display: flex;
|
|
1036
1036
|
flex: 1;
|
|
1037
1037
|
flex-direction: row;
|
|
@@ -1039,14 +1039,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1039
1039
|
align-content: center;
|
|
1040
1040
|
align-items: center;
|
|
1041
1041
|
margin-right: 20px;
|
|
1042
|
-
`,
|
|
1042
|
+
`,gs=be.div`
|
|
1043
1043
|
display: block;
|
|
1044
1044
|
width: 100%;
|
|
1045
|
-
`;import oc from"styled-components";var
|
|
1045
|
+
`;import oc from"styled-components";var hs=oc.div`
|
|
1046
1046
|
flex-direction: column;
|
|
1047
1047
|
justify-content: center;
|
|
1048
1048
|
display: flex;
|
|
1049
|
-
`;import ut from"react";import mt from"styled-components";var
|
|
1049
|
+
`;import ut from"react";import mt from"styled-components";var xs=mt.div`
|
|
1050
1050
|
border: 1px solid #fafafa;
|
|
1051
1051
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1052
1052
|
border-radius: 14px;
|
|
@@ -1054,13 +1054,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1054
1054
|
display: flex;
|
|
1055
1055
|
flex-direction: column;
|
|
1056
1056
|
overflow: hidden;
|
|
1057
|
-
`,
|
|
1057
|
+
`,Cs=mt.div`
|
|
1058
1058
|
display: flex;
|
|
1059
1059
|
flex-wrap: wrap;
|
|
1060
1060
|
justify-content: space-between;
|
|
1061
1061
|
overflow: hidden;
|
|
1062
1062
|
row-gap: 10px;
|
|
1063
|
-
`,
|
|
1063
|
+
`,ys=mt.div`
|
|
1064
1064
|
${e=>B(e)} {
|
|
1065
1065
|
color: #595959;
|
|
1066
1066
|
}
|
|
@@ -1070,7 +1070,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1070
1070
|
line-height: 12px;
|
|
1071
1071
|
letter-spacing: 0.09em;
|
|
1072
1072
|
margin-bottom: 12px;
|
|
1073
|
-
`,
|
|
1073
|
+
`,Ss=mt.div`
|
|
1074
1074
|
${e=>B(e)} {
|
|
1075
1075
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1076
1076
|
background: #ffffff;
|
|
@@ -1083,7 +1083,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1083
1083
|
|
|
1084
1084
|
max-width: 150px;
|
|
1085
1085
|
min-width: 200px;
|
|
1086
|
-
`,
|
|
1086
|
+
`,bs=mt.div`
|
|
1087
1087
|
${e=>B(e)} {
|
|
1088
1088
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1089
1089
|
}
|
|
@@ -1095,13 +1095,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1095
1095
|
justify-content: center;
|
|
1096
1096
|
align-content: center;
|
|
1097
1097
|
align-items: center;
|
|
1098
|
-
`,
|
|
1098
|
+
`,ws=mt.div`
|
|
1099
1099
|
font-weight: 600;
|
|
1100
1100
|
font-size: 20px;
|
|
1101
1101
|
line-height: 24px;
|
|
1102
1102
|
width: 20px;
|
|
1103
1103
|
height: 20px;
|
|
1104
|
-
`,
|
|
1104
|
+
`,Ts=mt.div`
|
|
1105
1105
|
${e=>B(e)} {
|
|
1106
1106
|
color: #434343;
|
|
1107
1107
|
}
|
|
@@ -1110,20 +1110,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1110
1110
|
line-height: 17px;
|
|
1111
1111
|
margin-top: 12px;
|
|
1112
1112
|
margin-bottom: 8px;
|
|
1113
|
-
`,
|
|
1113
|
+
`,Fs=mt.div`
|
|
1114
1114
|
${e=>B(e)} {
|
|
1115
1115
|
color: #8c8c8c;
|
|
1116
1116
|
}
|
|
1117
1117
|
font-weight: 400;
|
|
1118
1118
|
font-size: 12px;
|
|
1119
1119
|
line-height: 14px;
|
|
1120
|
-
`,
|
|
1120
|
+
`,ks=mt.a`
|
|
1121
1121
|
color: ${e=>e.color};
|
|
1122
1122
|
font-size: 12px;
|
|
1123
1123
|
line-height: 14px;
|
|
1124
1124
|
font-weight: 400;
|
|
1125
1125
|
cursor: pointer;
|
|
1126
|
-
`;var rc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=fe();return ut.createElement(
|
|
1126
|
+
`;var rc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=fe();return ut.createElement(xs,{style:t,className:p("guideContainer",n)},ut.createElement(ys,{className:p("guideTitle",n)},o),ut.createElement(Cs,{className:p("guideItemContainer",n)},e.map((a,d)=>{var l;return ut.createElement(Ss,{key:`guide-${(l=a.id)!=null?l:d}`,className:p("guideItem",n)},a.icon&&ut.createElement(bs,{className:p("guideIcon",n)},ut.createElement(ws,null,a.icon)),ut.createElement(Ts,{className:p("guideItemTitle",n),dangerouslySetInnerHTML:ce(a.title)}),ut.createElement(Fs,{className:p("guideItemSubtitle",n),dangerouslySetInnerHTML:ce(a.subtitle)}),ut.createElement(ks,{className:p("guideItemLink",n),color:i,onClick:()=>{a.primaryButtonUri&&s(a),r&&r(a)}},a.primaryButtonTitle))})))},Mo=rc;var nc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:a,customStepTypes:d,appearance:l,guideData:u,guideTitle:c,onGuideButtonClick:g})=>{let S=({stepData:f,handleSecondaryCTAClick:w,handleCTAClick:I})=>f?Y.createElement(ls,{className:p("checklistStepContainer",l),"data-testid":"checklistStepContainer"},Y.createElement(as,{appearance:l,className:p("checklistStepTitle",l),dangerouslySetInnerHTML:ce(f.title)}),Y.createElement(ps,{appearance:l,className:p("checklistStepSubtitle",l),dangerouslySetInnerHTML:ce(f.subtitle)}),Y.createElement(ds,{className:p("checklistCTAContainer",l)},f.secondaryButtonTitle&&Y.createElement(le,{title:f.secondaryButtonTitle,onClick:w,appearance:l,secondary:!0}),Y.createElement(le,{title:f.primaryButtonTitle,onClick:I,appearance:l}))):Y.createElement(Y.Fragment,null),h=b(b({},{default:f=>{var A;if((A=e[y])!=null&&A.StepContent){let N=e[y].StepContent;return Y.createElement("div",null,N)}let w=e[y];return Y.createElement(S,{stepData:f,handleCTAClick:()=>{w.handlePrimaryButtonClick&&w.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{w.handleSecondaryButtonClick&&w.handleSecondaryButtonClick()}})}}),d),[x,F]=ic(0),y=s!=null?s:x,v=a!=null?a:F,L=()=>{var f;return e?!((f=e[y])!=null&&f.type)||!h[e[y].type]?h.default(e[y]):typeof h[e[y].type]!="function"?h[e[y].type]:h[e[y].type]({stepData:e[y],primaryColor:l.theme.colorPrimary}):Y.createElement(Y.Fragment,null)},E=e.filter(f=>f.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(Qr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Qr),Y.createElement(et,{onClose:r,visible:n,appearance:l},Y.createElement(gs,null,Y.createElement(Rn,null,Y.createElement(es,{appearance:l,className:p("checklistTitle",l)},t),Y.createElement(ts,{appearance:l,className:p("checklistSubtitle",l)},o)),Y.createElement(Zn,null,e&&e.length>0&&Y.createElement(os,{className:p("stepsContainer",l)},Y.createElement(rs,null,Y.createElement("div",{style:{flex:3}},Y.createElement(is,{className:p("stepsTitle",l)},i)),Y.createElement(fs,null,Y.createElement(ze,{style:{width:"100%"},count:E,total:e.length,appearance:l}))),Y.createElement(ns,null,Y.createElement(ss,{className:p("checklistStepListContainer",l),appearance:l},e.map((f,w)=>{var T;let I=y===w;return Y.createElement(cs,{selected:I,className:p(`checklistStepListItem${I?"Selected":""}`,l),key:`checklist-guide-step-${(T=f.id)!=null?T:w}`,disabled:f.blocked,onClick:()=>{f.blocked||v(w)},title:f.blocked?"Finish remaining steps to continue":void 0},I&&Y.createElement(pr,{className:p("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),Y.createElement(ms,{selected:I,className:p(`checklistStepListStepName${I?"Selected":""}`,l)},f.stepName),Y.createElement(us,null,Y.createElement(pt,{value:f.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:f.progress,appearance:l}),Y.createElement(hs,null,Y.createElement(po,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),Y.createElement(L,null))),u&&u.length>0&&Y.createElement(Mo,{steps:u,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:f=>(g&&g(f),!0)}))))):Y.createElement(Y.Fragment,null)},Zr=nc;import De,{useEffect as gr,useState as sc}from"react";import Fe from"react";import ft from"styled-components";var Ps=ft.div`
|
|
1127
1127
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1128
1128
|
border: 1px solid;
|
|
1129
1129
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1135,14 +1135,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1135
1135
|
display: flex;
|
|
1136
1136
|
flex-direction: column;
|
|
1137
1137
|
transition: max-height 0.25s;
|
|
1138
|
-
`,
|
|
1138
|
+
`,vs=ft.div`
|
|
1139
1139
|
display: flex;
|
|
1140
1140
|
margin-bottom: 20px;
|
|
1141
|
-
`,
|
|
1141
|
+
`,Bs=ft.img`
|
|
1142
1142
|
border-radius: 4px;
|
|
1143
1143
|
max-height: 260px;
|
|
1144
1144
|
min-height: 200px;
|
|
1145
|
-
`,
|
|
1145
|
+
`,Es=ft.div`
|
|
1146
1146
|
display: flex;
|
|
1147
1147
|
flex-direction: row;
|
|
1148
1148
|
justify-content: space-between;
|
|
@@ -1151,7 +1151,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1151
1151
|
:hover {
|
|
1152
1152
|
opacity: 0.8;
|
|
1153
1153
|
}
|
|
1154
|
-
`,
|
|
1154
|
+
`,As=ft.p`
|
|
1155
1155
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1156
1156
|
font-style: normal;
|
|
1157
1157
|
font-weight: 500;
|
|
@@ -1162,23 +1162,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1162
1162
|
:hover {
|
|
1163
1163
|
opacity: 0.8;
|
|
1164
1164
|
}
|
|
1165
|
-
`,
|
|
1165
|
+
`,Ns=ft.div`
|
|
1166
1166
|
cursor: pointer;
|
|
1167
1167
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1168
1168
|
:hover {
|
|
1169
1169
|
opacity: 0.8;
|
|
1170
1170
|
}
|
|
1171
|
-
`,h0=ft.div``,
|
|
1171
|
+
`,h0=ft.div``,Is=ft.p`
|
|
1172
1172
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1173
1173
|
font-weight: 400;
|
|
1174
1174
|
font-size: 14px;
|
|
1175
1175
|
line-height: 22px;
|
|
1176
|
-
`,
|
|
1176
|
+
`,Os=ft.div`
|
|
1177
1177
|
display: flex;
|
|
1178
1178
|
flex-direction: row;
|
|
1179
1179
|
justify-content: flex-start;
|
|
1180
1180
|
align-items: center;
|
|
1181
|
-
`;var
|
|
1181
|
+
`;var Ls=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,g;let a=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function l(){var S,k;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(vs,{className:p("stepMediaContainer",r)},e.imageUri?Fe.createElement(Bs,{className:p("stepImage",r),src:e.imageUri}):null,e.videoUri?Fe.createElement(ot,{appearance:r,videoUri:e.videoUri,autoplay:(S=e.props)==null?void 0:S.autoplayVideo}):null):null,Fe.createElement(Is,{className:p("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ce(e.subtitle)}),Fe.createElement(Ro,{className:p("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(le,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(le,{title:(k=e.primaryButtonTitle)!=null?k:"Continue",onClick:()=>i(),appearance:r})))}function u(){if(!s)return null;let S=s[e.type];return S?typeof S!="function"?S:S(e,r):null}return Fe.createElement(Ps,{"data-testid":`step-${e.id}`,className:p("checklistStepContainer",r),appearance:r},Fe.createElement(Es,{className:p("stepHeader",r),onClick:()=>o()},Fe.createElement(Os,null,Fe.createElement(ar,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Fe.createElement(As,{appearance:r,className:p("stepTitle",r),dangerouslySetInnerHTML:ce(e.title)})),Fe.createElement(Ns,{className:p("stepChevronContainer",r),appearance:r},Fe.createElement(po,{style:j(b({},a),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:b({},d)},(g=u())!=null?g:l()))};import co from"styled-components";var A0=co.div`
|
|
1182
1182
|
background: #ffffff;
|
|
1183
1183
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1184
1184
|
border-radius: 6px;
|
|
@@ -1192,26 +1192,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1192
1192
|
|
|
1193
1193
|
max-width: 800px;
|
|
1194
1194
|
min-width: 350px;
|
|
1195
|
-
|
|
1195
|
+
`,$s=co.div`
|
|
1196
1196
|
display: flex;
|
|
1197
1197
|
flex-direction: column;
|
|
1198
|
-
`,
|
|
1198
|
+
`,Ms=co.h1`
|
|
1199
1199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1200
1200
|
font-style: normal;
|
|
1201
1201
|
font-weight: 700;
|
|
1202
1202
|
font-size: 20px;
|
|
1203
1203
|
line-height: 24px;
|
|
1204
1204
|
margin-bottom: 8px;
|
|
1205
|
-
|
|
1205
|
+
`,Ds=co.h2`
|
|
1206
1206
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1207
1207
|
font-weight: 400;
|
|
1208
1208
|
font-size: 14px;
|
|
1209
1209
|
line-height: 23px;
|
|
1210
1210
|
margin: 2px 0 0 0;
|
|
1211
|
-
`,
|
|
1211
|
+
`,Us=co.div`
|
|
1212
1212
|
display: block;
|
|
1213
1213
|
width: 100%;
|
|
1214
|
-
`,
|
|
1214
|
+
`,_s=co.div`
|
|
1215
1215
|
display: flex;
|
|
1216
1216
|
width: 100%;
|
|
1217
1217
|
flex-direction: column;
|
|
@@ -1219,23 +1219,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1219
1219
|
padding: 24px;
|
|
1220
1220
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1221
1221
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1222
|
-
`;var lc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:a=!0,selectedStep:d,setSelectedStep:l,appearance:u,type:c,className:g,customStepTypes:S,style:k})=>{let h=o.filter(E=>E.complete).length,[x,F]=sc(Array(o.length).fill(!0));gr(()=>{let E=[...x];if(r){for(let f=0;f<o.length;f++)if(!o[f].complete){E[f]=!1;break}F(E)}},[]),gr(()=>{r&&y(d)},[d]),gr(()=>{a&&x[d]&&y(d)},[d]),gr(()=>{},[o]);let y=E=>{let f=[...x];if(s)for(let w=0;w<x.length;++w)w!=E&&f[E]&&(f[w]=!0);f[E]=!x[E],F(f)};if(!n&&c=="modal")return De.createElement(De.Fragment,null);let v=De.createElement(De.Fragment,null,De.createElement(
|
|
1222
|
+
`;var lc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:a=!0,selectedStep:d,setSelectedStep:l,appearance:u,type:c,className:g,customStepTypes:S,style:k})=>{let h=o.filter(E=>E.complete).length,[x,F]=sc(Array(o.length).fill(!0));gr(()=>{let E=[...x];if(r){for(let f=0;f<o.length;f++)if(!o[f].complete){E[f]=!1;break}F(E)}},[]),gr(()=>{r&&y(d)},[d]),gr(()=>{a&&x[d]&&y(d)},[d]),gr(()=>{},[o]);let y=E=>{let f=[...x];if(s)for(let w=0;w<x.length;++w)w!=E&&f[E]&&(f[w]=!0);f[E]=!x[E],F(f)};if(!n&&c=="modal")return De.createElement(De.Fragment,null);let v=De.createElement(De.Fragment,null,De.createElement($s,null,De.createElement(Ms,{appearance:u,className:p("checklistTitle",u),dangerouslySetInnerHTML:ce(e)}),De.createElement(Ds,{appearance:u,className:p("checklistSubtitle",u),dangerouslySetInnerHTML:ce(t)})),De.createElement(ze,{display:"percent",count:h,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:u})),L=De.createElement(Us,{className:Te(p("checklistContainer",u),g)},o.map((E,f)=>{var I;let w=x[f];return De.createElement(Ls,{appearance:u,stepData:E,collapsed:w,key:`modal-checklist-${(I=E.id)!=null?I:f}`,onClick:()=>{d==f?y(f):l(f)},onPrimaryButtonClick:()=>{a&&f<o.length-1&&l(f+1),E.handlePrimaryButtonClick&&E.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{E.handleSecondaryButtonClick&&E.handleSecondaryButtonClick()},customStepTypes:S})}));return c==="inline"?De.createElement(_s,{appearance:u,className:Te(p("checklistInlineContainer",u),g),style:k},v,L):De.createElement(De.Fragment,null,De.createElement(et,{onClose:i,visible:n,appearance:u,style:{maxWidth:"600px"},headerContent:v},L))},Rr=lc;import he,{useEffect as ei,useRef as gc,useState as Ht}from"react";import{useEffect as ac,useState as pc}from"react";var Ws=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([a])=>[a,!1])),[o,i]=pc(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let a=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let u=window.matchMedia(l);return u.addEventListener("change",r),[d,u.matches]}));i(a)};return ac(()=>{s()},[]),o};import mo from"react";import xe,{css as zs,keyframes as Hs}from"styled-components";var Vs=zs`
|
|
1223
1223
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1224
|
-
`,dc=
|
|
1224
|
+
`,dc=zs`
|
|
1225
1225
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1226
|
-
`,cc=
|
|
1226
|
+
`,cc=Hs`
|
|
1227
1227
|
from {
|
|
1228
1228
|
opacity: 0;
|
|
1229
1229
|
} to {
|
|
1230
1230
|
opacity: 1;
|
|
1231
1231
|
}
|
|
1232
|
-
`,mc=
|
|
1232
|
+
`,mc=Hs`
|
|
1233
1233
|
from {
|
|
1234
1234
|
opacity: 1;
|
|
1235
1235
|
} to {
|
|
1236
1236
|
opacity: 0;
|
|
1237
1237
|
}
|
|
1238
|
-
`,
|
|
1238
|
+
`,js=xe.div`
|
|
1239
1239
|
margin: 0 -20px;
|
|
1240
1240
|
overflow-x: auto;
|
|
1241
1241
|
padding-left: 20px;
|
|
@@ -1252,13 +1252,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1252
1252
|
::-webkit-scrollbar {
|
|
1253
1253
|
display: none;
|
|
1254
1254
|
}
|
|
1255
|
-
`,
|
|
1255
|
+
`,Gs=xe.div`
|
|
1256
1256
|
display: flex;
|
|
1257
1257
|
flex-flow: row nowrap;
|
|
1258
1258
|
gap: 0 16px;
|
|
1259
1259
|
scroll-snap-align: center;
|
|
1260
1260
|
scroll-snap-stop: always;
|
|
1261
|
-
`,
|
|
1261
|
+
`,Ks=xe.div`
|
|
1262
1262
|
animation: ${e=>e.reversed?mc:cc} 0.25s ease-out;
|
|
1263
1263
|
background: linear-gradient(
|
|
1264
1264
|
to right,
|
|
@@ -1268,8 +1268,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1268
1268
|
position: absolute;
|
|
1269
1269
|
width: 64px;
|
|
1270
1270
|
z-index: 10;
|
|
1271
|
-
`,
|
|
1272
|
-
${
|
|
1271
|
+
`,qs=xe.button`
|
|
1272
|
+
${Vs}
|
|
1273
1273
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1274
1274
|
align-items: center;
|
|
1275
1275
|
border-radius: 50%;
|
|
@@ -1280,11 +1280,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1280
1280
|
justify-content: center;
|
|
1281
1281
|
position: absolute;
|
|
1282
1282
|
width: 48px;
|
|
1283
|
-
`,
|
|
1283
|
+
`,Ys=xe.div`
|
|
1284
1284
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1285
1285
|
padding: 20px;
|
|
1286
|
-
`,
|
|
1287
|
-
${
|
|
1286
|
+
`,Js=xe(Ys)`
|
|
1287
|
+
${Vs}
|
|
1288
1288
|
background: ${({theme:e})=>e.colorBackground};
|
|
1289
1289
|
position: relative;
|
|
1290
1290
|
|
|
@@ -1296,12 +1296,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1296
1296
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1297
1297
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1298
1298
|
}
|
|
1299
|
-
`,
|
|
1299
|
+
`,Xs=xe.img`
|
|
1300
1300
|
border-radius: 50%;
|
|
1301
1301
|
height: 40px;
|
|
1302
1302
|
margin-bottom: 12px;
|
|
1303
1303
|
width: 40px;
|
|
1304
|
-
`,
|
|
1304
|
+
`,Qs=xe(Ys)`
|
|
1305
1305
|
${e=>B(e)} {
|
|
1306
1306
|
${dc}
|
|
1307
1307
|
|
|
@@ -1314,7 +1314,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1314
1314
|
align-items: center;
|
|
1315
1315
|
`,Y0=xe.div`
|
|
1316
1316
|
white-space: nowrap;
|
|
1317
|
-
`,
|
|
1317
|
+
`,Zs=xe.div`
|
|
1318
1318
|
background: #d8fed8;
|
|
1319
1319
|
border-radius: 6px;
|
|
1320
1320
|
float: right;
|
|
@@ -1326,9 +1326,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1326
1326
|
line-height: 22px;
|
|
1327
1327
|
letter-spacing: calc(18px * -0.01);
|
|
1328
1328
|
margin: 0;
|
|
1329
|
-
`,
|
|
1329
|
+
`,Rs=xe(uc)`
|
|
1330
1330
|
margin-bottom: 4px;
|
|
1331
|
-
`,
|
|
1331
|
+
`,el=xe.div`
|
|
1332
1332
|
display: flex;
|
|
1333
1333
|
flex-flow: row nowrap;
|
|
1334
1334
|
align-items: center;
|
|
@@ -1339,7 +1339,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1339
1339
|
line-height: 20px;
|
|
1340
1340
|
letter-spacing: calc(16px * -0.01);
|
|
1341
1341
|
margin: 0;
|
|
1342
|
-
`,
|
|
1342
|
+
`,tl=xe(fc)`
|
|
1343
1343
|
margin-bottom: 4px;
|
|
1344
1344
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1345
1345
|
`}
|
|
@@ -1349,7 +1349,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1349
1349
|
font-size: 14px;
|
|
1350
1350
|
line-height: 22px;
|
|
1351
1351
|
margin: 0;
|
|
1352
|
-
`,
|
|
1352
|
+
`,ol=xe.p`
|
|
1353
1353
|
color: ${({theme:e})=>e.colorText};
|
|
1354
1354
|
font-weight: 600;
|
|
1355
1355
|
font-size: 12px;
|
|
@@ -1361,7 +1361,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1361
1361
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1362
1362
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1363
1363
|
`}
|
|
1364
|
-
`;var
|
|
1364
|
+
`;var rl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=de(),{primaryCTAClickSideEffects:n}=fe();o=i(o);let{imageUri:r=null,subtitle:s=null,title:a=null,complete:d=!1,blocked:l=!1}=e,u=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return mo.createElement(Js,{className:p("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&mo.createElement(Xs,{className:p("carouselCardImage",o),src:r,alt:a,style:{opacity:d||l?.4:1}}),d&&mo.createElement(Zs,{className:p("carouselCompletedPill",o)},mo.createElement(ol,{style:{color:"#108E0B"}},"Complete")),a&&mo.createElement(tl,{blocked:l,complete:d,className:p("carouselCardTitle",o)},a),s&&mo.createElement(Tt.Quiet,{blocked:l,complete:d,className:p("carouselCardSubtitle",o)},s))};var hc=()=>he.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},he.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),il=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Ht(!1),[r,s]=Ht(!1);ei(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let a=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?he.createElement(Ks,{style:d,reversed:r,onAnimationEnd:r?a:null},he.createElement(qs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},he.createElement(hc,null))):null},nl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=gc(null),[r,s]=Ht(!1),[a,d]=Ht(!1),[l,u]=Ht(null),[c,g]=Ht([]),[S,k]=Ht(0),{isSmall:h}=Ws(),x=h?1:3,{getFlowMetadata:F,getFlowSteps:y,getNumberOfStepsCompleted:v,updateCustomVariables:L,isLoading:E}=ie();ei(()=>{L(o)},[o,E]),ei(()=>{if(E)return;let N=F(e),U=v(e),z=y(e);u(N),(N.data!==null||N.steps!==null)&&(g(z.sort((G,_)=>Number(G.complete)-Number(_.complete))),d(z.length>x),k(U))},[E]);let f=[];for(let N=0;N<c.length;N+=x)f.push(c.slice(N,N+x));let w=N=>{let U=N.target,z=U.scrollWidth-U.clientWidth,G=Math.ceil(U.scrollLeft);G>0&&r===!1&&s(!0),G===0&&r===!0&&s(!1),G<z&&a===!1&&d(!0),G===z&&a===!0&&d(!1)},I=(N=!0)=>{let U=N?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*U,behavior:"smooth"})},T=null,A=N=>{T!==null?clearTimeout(T):w(N),T=setTimeout(()=>{w(N)},16)};return E?null:he.createElement(Qs,{className:Te(p("carouselContainer",t),i)},he.createElement("div",{style:{display:"flex",justifyContent:h?"center":"space-between",marginBottom:20,flexWrap:h?"wrap":"nowrap",gap:h?16:20}},he.createElement("div",null,he.createElement(Rs,{className:p("carouselTitle",t)},l==null?void 0:l.title),he.createElement(Tt.Quiet,{className:p("carouselSubtitle",t)},l==null?void 0:l.subtitle)),he.createElement(el,{className:p("progressWrapper",t)},he.createElement(ze,{count:S,total:c.length,appearance:t}))),he.createElement("div",{style:{position:"relative"}},he.createElement(il,{show:r,onClick:()=>I(!1)}),he.createElement(il,{side:"right",show:a,onClick:I}),he.createElement(js,{ref:n,onScroll:A},f.map((N,U)=>he.createElement(Gs,{key:U,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},N.map((z,G)=>he.createElement(rl,{key:G,stepData:z,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),he.createElement(se,{appearance:t}))};var ti=L=>{var E=L,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:a,visible:d,customVariables:l,onStepCompletion:u,onButtonClick:c,appearance:g,hideOnFlowCompletion:S,setVisible:k,customStepTypes:h,checklistStyle:x="default",autoExpandFirstIncompleteStep:F,autoExpandNextStep:y}=E,v=$e(E,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:f,getFlowSteps:w,markStepCompleted:I,getStepStatus:T,getNumberOfStepsCompleted:A,isLoading:N,targetingLogicShouldHideFlow:U,updateCustomVariables:z,getFlowMetadata:G,isStepBlocked:_,getFlowStatus:K,hasActiveFullPageFlow:J,setHasActiveFullPageFlow:O,markStepStarted:Z,getCurrentStepIndex:q}=ie(),{primaryCTAClickSideEffects:ne,secondaryCTAClickSideEffects:Se}=fe(),{getOpenFlowState:ke,setOpenFlowState:R}=Ne(),[$,re]=sl(n||0),[Pe,Ve]=sl(!1),ve=d===void 0?ke(e):d,ae=s==="modal",{mergeAppearanceWithDefault:H}=de();Ge(e,d);let V=w(e),ee=q(e);if(g=H(g),hr(()=>{z(l)},[l,N]),hr(()=>{d!==void 0&&(ae&&d===!0?O(!0):ae&&d===!1&&O(!1))},[d,k,J]),hr(()=>{!N&&V&&V[$]&&T(e,V[$].id)&&T(e,V[$].id)!==Me&&Z(e,V[$].id)},[$]),hr(()=>{$!==ee&&re(ee)},[ee]),N)return null;let D=f(e);if(!D||U(D)||!V||S===!0&&K(e)===pe)return null;let Q=G(e);if(Q!=null&&Q.title&&(t=Q.title),Q!=null&&Q.subtitle&&(o=Q.subtitle),!Pe&&n===void 0&&A(e)>0){let m=V.findIndex(C=>C.complete===!1);re(m>-1?m:V.length-1),Ve(!0)}function we(){if($+1>=V.length){ae&&R(e,!1);return}_(e,V[$+1].id)||re($+1)}function je(m,C,P){let W=$+1<V.length?V[$+1]:null;c&&c(m,$,C,W)===!0&&ae&&Qe(),u&&u(m,P,W),!u&&!c&&(m.primaryButtonUri||m.secondaryButtonUri)&&ae&&Qe()}function xt(){return V.map((m,C)=>j(b({},m),{handleSecondaryButtonClick:()=>{we(),Se(m),m.skippable===!0&&I(e,m.id,{skipped:!0}),je(m,"secondary",C)},handlePrimaryButtonClick:()=>{(!m.completionCriteria&&(m.autoMarkCompleted||m.autoMarkCompleted===void 0)||m.completionCriteria&&m.autoMarkCompleted===!0)&&(I(e,m.id),we()),je(m,"primary",C),ne(m),T(e,m.id)===Me&&we()}}))}function Ye(){return Ce.createElement(se,{appearance:g})}let nt={steps:xt(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:h,type:s,className:r,autoExpandFirstIncompleteStep:F,autoExpandNextStep:y};function Qe(){R(e,!1),a&&a(),k&&k(!1)}function vt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(Ye,null),Ce.createElement(nl,{flowId:e,appearance:g,customVariables:l,className:r}))}function jt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(Ye,null),Ce.createElement(Rr,b({visible:ve,onClose:()=>{Qe()},selectedStep:$,setSelectedStep:re,autoExpandNextStep:!0,appearance:g},nt)))}function Gt(){var P;let m=v.guideFlowId,C;return m&&f(m)&&(C=w(m)),Ce.createElement(Ce.Fragment,null,Ce.createElement(Ye,null),Ce.createElement(Zr,b({visible:ve,stepsTitle:Q.stepsTitle?Q.stepsTitle:"Your quick start guide",onClose:()=>{Qe()},selectedStep:$,setSelectedStep:re,guideData:C,guideTitle:(P=v.guideTitle)!=null?P:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:W=>{je(W,"link",0)},customStepTypes:h},nt)))}function Bt(){let m=Ce.createElement(Xr,b({flowId:e,style:i,selectedStep:$,setSelectedStep:re,appearance:g,type:s},nt));return ae?Ce.createElement(et,{onClose:()=>{Qe()},visible:ve,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Ce.createElement(Ye,null),m):Ce.createElement(Ce.Fragment,null,Ce.createElement(Ye,null),m)}switch(x){case"condensed":return jt();case"with-guide":return Gt();case"default":return Bt();case"carousel":return vt();default:return Bt()}};var Cc=e=>xc.createElement(ti,b({type:"inline"},e));import kt,{useEffect as yc}from"react";import it from"react";import xr from"styled-components";var ll=xr.div`
|
|
1365
1365
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1366
1366
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1367
1367
|
padding: 10px 12px 10px 12px;
|
|
@@ -1373,27 +1373,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1373
1373
|
&:hover {
|
|
1374
1374
|
filter: brightness(.99);
|
|
1375
1375
|
}
|
|
1376
|
-
`,
|
|
1376
|
+
`,al=xr.div`
|
|
1377
1377
|
display: flex;
|
|
1378
1378
|
flex-direction: row;
|
|
1379
1379
|
justify-content: space-between;
|
|
1380
1380
|
align-items: center;
|
|
1381
1381
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1382
1382
|
flex-grow: 2;
|
|
1383
|
-
`,
|
|
1383
|
+
`,pl=xr.div`
|
|
1384
1384
|
text-overflow: ellipsis;
|
|
1385
1385
|
font-weight: 600;
|
|
1386
1386
|
font-size: 14px;
|
|
1387
1387
|
line-height: 16px;
|
|
1388
1388
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1389
1389
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1390
|
-
`,
|
|
1390
|
+
`,dl=xr.div`
|
|
1391
1391
|
width: 20px;
|
|
1392
1392
|
margin-right: 8px;
|
|
1393
1393
|
display: flex;
|
|
1394
1394
|
height: 100%;
|
|
1395
1395
|
align-items: center;
|
|
1396
|
-
`;var
|
|
1396
|
+
`;var cl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:a="default"})=>it.createElement(it.Fragment,null,it.createElement(se,{appearance:s}),it.createElement(ll,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},a=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",p("progressBadgeContainer",s)),appearance:s},a=="condensed"&&o&&o!==0&&it.createElement(dl,{className:p("progressRingContainer",s)},it.createElement(Zt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),it.createElement(al,{type:a,className:p("badgeTitleContainer",s)},it.createElement(pl,{type:a,appearance:s,className:p("badgeTitle",s)},e),i!==void 0&&it.createElement(po,{className:p("badgeChevron",s),color:s.theme.colorPrimary})),a=="default"&&o&&o!==0&&it.createElement(ze,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ft from"react";import Do from"styled-components";var ml=Do.div`
|
|
1397
1397
|
display: flex;
|
|
1398
1398
|
flex-direction: row;
|
|
1399
1399
|
width: 100%;
|
|
@@ -1403,19 +1403,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1403
1403
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1404
1404
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1405
1405
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1406
|
-
`,
|
|
1406
|
+
`,ul=Do.div`
|
|
1407
1407
|
${e=>B(e)} {
|
|
1408
1408
|
display: flex;
|
|
1409
1409
|
justify-content: center;
|
|
1410
1410
|
align-items: center;
|
|
1411
1411
|
margin-right: 16px;
|
|
1412
1412
|
}
|
|
1413
|
-
`,
|
|
1413
|
+
`,fl=Do.div`
|
|
1414
1414
|
display: flex;
|
|
1415
1415
|
flex-direction: column;
|
|
1416
1416
|
flex: 1;
|
|
1417
1417
|
margin-top: 0;
|
|
1418
|
-
`,
|
|
1418
|
+
`,gl=Do.div`
|
|
1419
1419
|
display: flex;
|
|
1420
1420
|
flex-direction: column;
|
|
1421
1421
|
justify-content: center;
|
|
@@ -1430,7 +1430,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1430
1430
|
:hover {
|
|
1431
1431
|
opacity: 0.8;
|
|
1432
1432
|
}
|
|
1433
|
-
`;var
|
|
1433
|
+
`;var hl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:a})=>Ft.createElement(Ft.Fragment,null,Ft.createElement(ml,{appearance:i,className:Te(p("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:a},o&&Ft.createElement(ul,{className:p("fullWidthProgressBadgeIcon",i)},o),Ft.createElement(fl,null,Ft.createElement(Oe,{size:"small",appearance:i,title:e,subtitle:t})),Ft.createElement(gl,{className:p("fullWidthProgressBadgeProgressContainer",i)},Ft.createElement(ze,{count:n,total:r,display:"percent",textLocation:"top"}))));var Sc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:a,hideOnFlowCompletion:d,appearance:l,type:u="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:S,getNumberOfStepsCompleted:k,isLoading:h,targetingLogicShouldHideFlow:x,updateCustomVariables:F}=ie(),{mergeAppearanceWithDefault:y}=de();l=y(l);let{setOpenFlowState:v,getOpenFlowState:L}=Ne();if(yc(()=>{F(a)},[a,h]),h)return null;let E=c(e);if(!E||x(E)||d===!0&&S(e)===pe)return null;let f=g(e),w=k(e);return u==="full-width"?kt.createElement(kt.Fragment,null,kt.createElement(se,{appearance:l}),kt.createElement(hl,{title:t,subtitle:o,count:w,total:f.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):kt.createElement(kt.Fragment,null,kt.createElement(se,{appearance:l}),kt.createElement(cl,{count:w,total:f.length,title:t,style:n,onClick:()=>{v(e,!0),r&&r()},type:u,className:s,appearance:l}))};import bc from"react";var wc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=$e(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:a,getFlowSteps:d}=ie(),{mergeAppearanceWithDefault:l}=de();o=l(o);let u=s(e);if(!u||a(u))return null;let c=d(e);return bc.createElement(Mo,b({steps:c,style:t,appearance:o},i))};import gt,{useContext as $c,useEffect as Mc}from"react";import X,{useEffect as uo,useLayoutEffect as yl,useRef as Bc,useState as fo}from"react";import Uo from"styled-components";import{useCallback as Tc,useEffect as Fc,useState as kc}from"react";var oi=(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 xl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,n]=kc(o),r=Tc(()=>{e&&n(e.getBoundingClientRect())},[e]);return Fc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Pc,useState as vc}from"react";function Cl(){let{debug:e}=Pc(oe),[t,o]=vc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var Sl=300,bl=100,Ec=500,go=12,Ac=Uo.div`
|
|
1434
1434
|
width: 100%;
|
|
1435
1435
|
height: 100%;
|
|
1436
1436
|
border-radius: 9999px;
|
|
@@ -1462,16 +1462,16 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1462
1462
|
opacity: 1;
|
|
1463
1463
|
`,Ic=Uo.div`
|
|
1464
1464
|
pointer-events: all;
|
|
1465
|
-
`,
|
|
1465
|
+
`,wl=Uo.div`
|
|
1466
1466
|
display: flex;
|
|
1467
1467
|
align-content: center;
|
|
1468
1468
|
justify-content: center;
|
|
1469
1469
|
align-items: center;
|
|
1470
1470
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1471
|
-
`,Oc=Uo(
|
|
1471
|
+
`,Oc=Uo(wl)`
|
|
1472
1472
|
width: ${go+12}px;
|
|
1473
1473
|
height: ${go+12}px;
|
|
1474
|
-
`,Lc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:a=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:u,appearance:c,dismissible:g=!1,showHighlightOnly:S,showStepCount:k=!0,completedStepsCount:h=0,showFrigadeBranding:x=!1,cssPosition:F="absolute",onViewTooltip:y,className:v})=>{var xt,
|
|
1474
|
+
`,Lc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:a=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:u,appearance:c,dismissible:g=!1,showHighlightOnly:S,showStepCount:k=!0,completedStepsCount:h=0,showFrigadeBranding:x=!1,cssPosition:F="absolute",onViewTooltip:y,className:v})=>{var xt,Ye,nt,Qe,vt,jt,Gt,Bt,m,C,P,W,Be,Et,At,Nt,ge,xo,Co;let{logErrorIfDebugMode:L}=Cl(),[E,f]=fo(),[w,I]=fo(new Date),T=Bc(null),[A,N]=fo(document.querySelector(e[l].selector)),U=xl(A,w),[z,G]=fo(),[_,K]=fo(!S),J=(Ye=(xt=e[l])==null?void 0:xt.props)!=null&&Ye.position?e[l].props.position:F,O=(vt=(Qe=(nt=e[l])==null?void 0:nt.props)==null?void 0:Qe.zIndex)!=null?vt:90,Z=(jt=E==null?void 0:E.width)!=null?jt:Sl,q=(Gt=E==null?void 0:E.height)!=null?Gt:bl,[ne,Se]=fo(new Date().getTime());s=(C=(m=(Bt=e[l])==null?void 0:Bt.props)==null?void 0:m.offset)!=null?C:s;let ke=window.location.pathname.split("/").pop();yl(()=>{T.current&&f({width:T.current.clientWidth,height:T.current.clientHeight})},[l,w,J]),uo(()=>{S||K(!0)},[l]),uo(()=>{a&&_&&y(l)},[_]);let R=()=>{if(J==="static")return;let te=document.querySelector(e[l].selector);if(!te){G(void 0),N(null),L(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}z&&z===JSON.stringify(te==null?void 0:te.getBoundingClientRect())||(N(te),I(new Date),te&&G(JSON.stringify(te.getBoundingClientRect())))};if(uo(()=>{let te=new MutationObserver(R);return te.observe(document.body,{subtree:!0,childList:!0}),()=>te.disconnect()},[R]),uo(()=>{let te=new MutationObserver(R);return te.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>te.disconnect()},[R]),uo(()=>{let te=setInterval(()=>{R()},10);return()=>clearInterval(te)},[R]),yl(()=>{setTimeout(()=>{R()},Ec),R()},[l,ke]),uo(()=>{if(!a)return;let te=Ze=>{Ze.key==="Escape"&&t()};return document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}},[]),A===null||!a)return null;let $=i==="auto"?"right":i,re=oi(U,$,Z,s,J),Pe=U.right+Z>(window.innerWidth||document.documentElement.clientWidth),Ve=U.bottom+bl>(window.innerHeight||document.documentElement.clientHeight);Pe&&i==="auto"&&(re=oi(U,"left",Z,s,J),$="left"),(W=(P=e[l])==null?void 0:P.props)!=null&&W.tooltipPosition&&((Et=(Be=e[l])==null?void 0:Be.props)==null?void 0:Et.tooltipPosition)!=="auto"&&(((Nt=(At=e[l])==null?void 0:At.props)==null?void 0:Nt.tooltipPosition)==="left"||((xo=(ge=e[l])==null?void 0:ge.props)==null?void 0:xo.tooltipPosition)==="right")&&($=e[l].props.tooltipPosition);let ve=()=>{let te=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),K(!1),setTimeout(()=>{R()},30)),h===e.length-1)return o()},Ze=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),S&&!e[l].secondaryButtonUri&&K(!1))};return X.createElement(X.Fragment,null,k&&e.length>1&&X.createElement(Pi,null,X.createElement(Bi,{role:"status",className:p("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&X.createElement(vi,{showStepCount:k,className:p("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&X.createElement(le,{title:e[l].secondaryButtonTitle,appearance:c,onClick:Ze,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&X.createElement(le,{title:e[l].primaryButtonTitle,appearance:c,onClick:te,autoFocus:!0,withMargin:!1,size:"small"})))},ae=()=>{var te;return X.createElement(X.Fragment,null,g&&X.createElement(bi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:p("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},X.createElement(Ie,null)),e[l].imageUri&&X.createElement(wi,{dismissible:g,appearance:c,role:"img","aria-label":e[l].title,src:e[l].imageUri,className:p("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&X.createElement(Ti,{dismissible:g,appearance:c,role:"video","aria-label":e[l].title,className:p("tooltipVideoContainer",c)},X.createElement(ot,{appearance:c,videoUri:e[l].videoUri,autoplay:(te=e[l].props)==null?void 0:te.autoplayVideo})),X.createElement(ki,{className:p("tooltipContentContainer",c)},X.createElement(Oe,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small",ariaPrefix:`Tooltip${e[l].id}`}),X.createElement(Fi,{className:p("tooltipFooter",c)},X.createElement(ve,null))))},V=b(b({},{default:te=>{var Ze;if((Ze=e[l])!=null&&Ze.StepContent){let na=e[l].StepContent;return X.createElement("div",null,na)}return X.createElement(ae,null)}}),u),ee=()=>{var te;return e?!((te=e[l])!=null&&te.type)||!V[e[l].type]?V.default(e[l]):V[e[l].type]({stepData:e[l],primaryColor:r}):X.createElement(X.Fragment,null)};if(e[l].complete===!0||re.x==0&&re.y==0&&new Date().getTime()-ne<100)return null;let D={top:(re==null?void 0:re.y)-go,left:(Co=$=="left"?U.x+s.x:(re==null?void 0:re.x)-go)!=null?Co:0,cursor:S?"pointer":"default",position:J},Q=()=>{let Ze=D.left+($=="left"?-Z:24);return Math.min(Math.max(Ze,20),window.innerWidth-Z-20)},we=()=>{if(J==="fixed")return D.top;let te=D.top+q,Ze=20;return te>window.innerHeight-Ze?D.top+-q:D.top},je=()=>{S&&(I(new Date),K(!_))};return X.createElement(Ic,{className:v},X.createElement(Oc,{style:D,zIndex:O,className:p("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&F!=="static"&&X.createElement(X.Fragment,null,X.createElement(Nc,{style:{position:J},onClick:je,primaryColor:c.theme.colorPrimary,className:p("tourHighlightInnerCircle",c)}),X.createElement(Ac,{style:{position:"absolute"},onClick:je,primaryColor:c.theme.colorPrimary,className:p("tourHighlightOuterCircle",c)}))),X.createElement(wl,{style:j(b({},D),{left:Q(),top:we()}),zIndex:O+1,className:p("tooltipContainerWrapper",c)},_&&X.createElement(X.Fragment,null,X.createElement(Vo,{ref:T,role:"dialog","aria-labelledby":`frigadeTooltip${e[l].id}Title`,"aria-describedby":`frigadeTooltip${e[l].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:b({position:"relative",width:"max-content",right:0,top:F!=="static"?12:0},d),appearance:c,className:p("tooltipContainer",c),maxWidth:Sl,zIndex:O+10},X.createElement(ee,null)),x&&X.createElement(Ai,{className:p("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:O+10},X.createElement(jo,{appearance:c})))))},_o=Lc;import{Portal as Dc}from"react-portal";var Uc=x=>{var F=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:a,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:u="skip-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:S="absolute",className:k}=F,h=$e(F,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:y,getFlowSteps:v,isLoading:L,targetingLogicShouldHideFlow:E,markStepCompleted:f,markStepStarted:w,markFlowCompleted:I,markFlowSkipped:T,updateCustomVariables:A,getCurrentStepIndex:N,getStepStatus:U,isStepBlocked:z,getFlowStatus:G,getNumberOfStepsCompleted:_}=ie(),{isLoadingUserFlowStateData:K}=_e(),{primaryCTAClickSideEffects:J,secondaryCTAClickSideEffects:O}=fe(),{hasOpenModals:Z}=Ne(),q=N(e),{openFlowStates:ne}=$c(oe),{mergeAppearanceWithDefault:Se}=de();if(o=Se(o),Mc(()=>{A(t)},[t,L]),K)return null;let ke=y(e);if(!ke||E(ke)||G(e)==pe||Z())return null;let R=v(e);if(Object.keys(ne).length>0){let D=Object.keys(ne).find(Q=>ne[Q]===!0);if(D!==void 0&&D!==e)return gt.createElement(gt.Fragment,null)}function $(D){return M(this,null,function*(){if(yield f(e,D.id),R.map(Q=>U(e,Q.id)).every(Q=>Q===Me)){yield I(e);return}!l&&q+1<R.length&&!r&&z(e,R[q+1].id)})}function re(D,Q,we){let je=q+1<R.length?R[q+1]:null;n&&n(D,q,Q,je),i&&i(D,we,je)}function Pe(){return R.map(D=>j(b({},D),{handleSecondaryButtonClick:()=>M(this,null,function*(){O(D),D.skippable===!0&&(yield f(e,D.id,{skipped:!0})),re(D,"secondary",q)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!D.completionCriteria&&(D.autoMarkCompleted||D.autoMarkCompleted===void 0)||D.completionCriteria&&D.autoMarkCompleted===!0)&&(yield $(D)),re(D,"primary",q),J(D)})}))}function Ve(D){return M(this,null,function*(){s&&s(),u==="skip-flow"?yield T(e):yield f(e,D.id)})}function ve(){c&&c()}function ae(D){return M(this,null,function*(){yield w(e,R[D].id)})}let H=!document.querySelector(R[q].selector);function V(){let D=R.findIndex((Q,we)=>!!document.querySelector(Q.selector)&&we>=q);return R.map((Q,we)=>r?gt.createElement(_o,b({key:Q.id,appearance:o,steps:Pe(),selectedStep:we,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>Ve(Q),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:ve,cssPosition:S,onViewTooltip:ae,className:k},h)):g&&H&&we===D?gt.createElement(_o,b({key:Q.id,appearance:o,steps:Pe(),selectedStep:we,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>Ve(Q),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:ve,cssPosition:S,onViewTooltip:ae,className:k},h)):we!=q?null:gt.createElement(_o,b({key:Q.id,appearance:o,steps:Pe(),selectedStep:we,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>Ve(Q),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:ve,cssPosition:S,onViewTooltip:ae,className:k},h)))}function ee(){return gt.createElement(gt.Fragment,null,gt.createElement(se,{appearance:o}),V())}return S==="static"?ee():gt.createElement(Dc,null,ee())};import Le,{useEffect as _c,useRef as Wc,useState as zc}from"react";import{Portal as Hc}from"react-portal";import Vt from"styled-components";var Tl=Vt.button`
|
|
1475
1475
|
${e=>B(e)} {
|
|
1476
1476
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1477
1477
|
|
|
@@ -1489,17 +1489,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1489
1489
|
opacity: 0.8;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
`,
|
|
1492
|
+
`,Fl=Vt.span`
|
|
1493
1493
|
${e=>B(e)} {
|
|
1494
1494
|
font-size: 12px;
|
|
1495
1495
|
display: inline-block;
|
|
1496
1496
|
}
|
|
1497
|
-
`,
|
|
1497
|
+
`,kl=Vt.span`
|
|
1498
1498
|
${e=>B(e)} {
|
|
1499
1499
|
font-size: 12px;
|
|
1500
1500
|
display: inline-block;
|
|
1501
1501
|
}
|
|
1502
|
-
`,
|
|
1502
|
+
`,Pl=Vt.div`
|
|
1503
1503
|
position: fixed;
|
|
1504
1504
|
right: 0;
|
|
1505
1505
|
bottom: 0;
|
|
@@ -1509,7 +1509,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1509
1509
|
flex-direction: column;
|
|
1510
1510
|
align-items: flex-end;
|
|
1511
1511
|
z-index: 50;
|
|
1512
|
-
`,
|
|
1512
|
+
`,vl=Vt.button`
|
|
1513
1513
|
${e=>B(e)} {
|
|
1514
1514
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1515
1515
|
background-color: #ffffff;
|
|
@@ -1525,7 +1525,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1525
1525
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1526
1526
|
border-radius: 45px;
|
|
1527
1527
|
cursor: pointer;
|
|
1528
|
-
`,
|
|
1528
|
+
`,Bl=Vt.div`
|
|
1529
1529
|
${e=>B(e)} {
|
|
1530
1530
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1531
1531
|
background: #ffffff;
|
|
@@ -1542,7 +1542,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1542
1542
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1543
1543
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1544
1544
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1545
|
-
`,
|
|
1545
|
+
`,El=Vt.button`
|
|
1546
1546
|
${e=>B(e)} {
|
|
1547
1547
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1548
1548
|
color: #434343;
|
|
@@ -1559,7 +1559,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1559
1559
|
font-size: 14px;
|
|
1560
1560
|
|
|
1561
1561
|
padding: 8px 12px;
|
|
1562
|
-
`;import
|
|
1562
|
+
`;import Al from"react";var Nl=({style:e,className:t})=>Al.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Al.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import Il from"react";var Ol=({style:e,className:t})=>Il.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},Il.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Vc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:a,getFlowSteps:d,markStepCompleted:l,getStepStatus:u,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S}=ie(),{primaryCTAClickSideEffects:k}=fe(),h=Wc(null),[x,F]=zc(!1),{mergeAppearanceWithDefault:y}=de();s=y(s),_c(()=>(document.addEventListener("click",v,!1),()=>{document.removeEventListener("click",v,!1)}),[]);let v=I=>{h.current&&!h.current.contains(I.target)&&F(!1)};if(g)return null;let L=a(e);if(!L||S(L))return null;let E=d(e);if(!E||!i)return null;function f(I,T){!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)&&l(e,I.id),k(I),o&&o(I,T),F(!1)}function w(){return x&&Le.createElement(Bl,{className:p("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},E.map((I,T)=>Le.createElement(El,{className:p("floatingWidgetMenuItem",s),key:T,onClick:()=>f(I,T)},I.title)))}return n=="inline"?Le.createElement("span",{ref:h},Le.createElement(se,{appearance:s}),Le.createElement(Tl,{style:t,onClick:()=>{F(!x)},className:p("supportButton",s)},Le.createElement(kl,{className:p("supportIconContainer",s)},Le.createElement(Ol,{className:p("supportIcon",s),style:{width:"18px",height:"18px"}})),Le.createElement(Fl,{className:p("supportButtonTitle",s)},r)),Le.createElement(w,null)):Le.createElement(Hc,null,Le.createElement(se,{appearance:s}),Le.createElement(Pl,{style:t,ref:h},Le.createElement(w,null),Le.createElement(vl,{onClick:()=>{F(!x)},whileHover:{scale:1.1},className:p("floatingWidgetButton",s)},Le.createElement(Nl,{className:p("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as Kc}from"react";import Cr from"styled-components";var Ll=Cr.div`
|
|
1563
1563
|
${e=>B(e)} {
|
|
1564
1564
|
display: flex;
|
|
1565
1565
|
flex-direction: column;
|
|
@@ -1574,17 +1574,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1574
1574
|
border-radius: 12px;
|
|
1575
1575
|
position: relative;
|
|
1576
1576
|
}
|
|
1577
|
-
|
|
1577
|
+
`,$l=Cr.div`
|
|
1578
1578
|
display: flex;
|
|
1579
1579
|
flex-direction: column;
|
|
1580
1580
|
flex: 1;
|
|
1581
|
-
`,
|
|
1581
|
+
`,Ml=Cr.div`
|
|
1582
1582
|
display: flex;
|
|
1583
1583
|
flex-direction: column;
|
|
1584
1584
|
justify-content: center;
|
|
1585
1585
|
align-items: flex-start;
|
|
1586
1586
|
margin-top: 16px;
|
|
1587
|
-
|
|
1587
|
+
`,Dl=Cr.div`
|
|
1588
1588
|
${e=>B(e)} {
|
|
1589
1589
|
position: absolute;
|
|
1590
1590
|
top: 16px;
|
|
@@ -1595,7 +1595,81 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1595
1595
|
opacity: 0.8;
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
|
-
`;
|
|
1598
|
+
`;import Pt from"styled-components";var Ul=Pt.div`
|
|
1599
|
+
${e=>B(e)} {
|
|
1600
|
+
display: flex;
|
|
1601
|
+
flex-direction: column;
|
|
1602
|
+
width: 100%;
|
|
1603
|
+
max-width: 500px;
|
|
1604
|
+
box-sizing: border-box;
|
|
1605
|
+
align-items: unset;
|
|
1606
|
+
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1607
|
+
position: relative;
|
|
1608
|
+
}
|
|
1609
|
+
`,_l=Pt.div`
|
|
1610
|
+
display: flex;
|
|
1611
|
+
flex-direction: column;
|
|
1612
|
+
flex: 1;
|
|
1613
|
+
`,Wl=Pt.div`
|
|
1614
|
+
display: flex;
|
|
1615
|
+
flex-direction: column;
|
|
1616
|
+
justify-content: center;
|
|
1617
|
+
align-items: center;
|
|
1618
|
+
margin-bottom: 12px;
|
|
1619
|
+
margin-top: 4px;
|
|
1620
|
+
`,zl=Pt.div`
|
|
1621
|
+
display: flex;
|
|
1622
|
+
flex-direction: row;
|
|
1623
|
+
justify-content: center;
|
|
1624
|
+
align-items: stretch;
|
|
1625
|
+
gap: 16px;
|
|
1626
|
+
margin-top: 8px;
|
|
1627
|
+
`,yr=Pt.div`
|
|
1628
|
+
margin-top: 16px;
|
|
1629
|
+
margin-bottom: 16px;
|
|
1630
|
+
`,Hl=Pt.div`
|
|
1631
|
+
${e=>B(e)} {
|
|
1632
|
+
position: absolute;
|
|
1633
|
+
top: -16px;
|
|
1634
|
+
right: -16px;
|
|
1635
|
+
cursor: pointer;
|
|
1636
|
+
|
|
1637
|
+
:hover {
|
|
1638
|
+
opacity: 0.8;
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
`,Vl=Pt.h1`
|
|
1642
|
+
${e=>B(e)} {
|
|
1643
|
+
font-style: normal;
|
|
1644
|
+
justify-content: center;
|
|
1645
|
+
text-align: center;
|
|
1646
|
+
font-size: 18px;
|
|
1647
|
+
font-weight: 700;
|
|
1648
|
+
line-height: 24px; /* 125% */
|
|
1649
|
+
letter-spacing: 0.36px;
|
|
1650
|
+
display: flex;
|
|
1651
|
+
align-items: center;
|
|
1652
|
+
color: ${e=>e.appearance.theme.colorText};
|
|
1653
|
+
margin-bottom: 8px;
|
|
1654
|
+
}
|
|
1655
|
+
`,jl=Pt.h2`
|
|
1656
|
+
${e=>B(e)} {
|
|
1657
|
+
font-style: normal;
|
|
1658
|
+
justify-content: center;
|
|
1659
|
+
text-align: center;
|
|
1660
|
+
font-weight: 400;
|
|
1661
|
+
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1662
|
+
font-size: 14px;
|
|
1663
|
+
line-height: 22px; /* 150% */
|
|
1664
|
+
letter-spacing: 0.28px;
|
|
1665
|
+
margin-bottom: 8px;
|
|
1666
|
+
}
|
|
1667
|
+
`;import Gl from"react";import jc from"styled-components";var Gc=jc.img`
|
|
1668
|
+
width: 100%;
|
|
1669
|
+
height: 100%;
|
|
1670
|
+
min-height: 200px;
|
|
1671
|
+
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1672
|
+
`;function Sr({stepData:e,appearance:t,classPrefix:o=""}){var i;return e.videoUri?Gl.createElement(ot,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo}):e.imageUri?Gl.createElement(Gc,{className:p(`${o}image`,t),appearance:t,src:e.imageUri}):null}var qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a})=>{let{getFlow:d,markFlowCompleted:l,markFlowSkipped:u,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S,updateCustomVariables:k,getFlowSteps:h,getFlowStatus:x,getCurrentStepIndex:F}=ie(),{primaryCTAClickSideEffects:y}=fe(),{mergeAppearanceWithDefault:v}=de();if(Ge(e),n=v(n),Kc(()=>{k(o)},[o,g]),g)return null;let L=d(e);if(!L||S(L)||x(e)===pe)return null;let f=h(e)[F(e)];return qe.createElement(qe.Fragment,null,qe.createElement(se,{appearance:n}),qe.createElement(Ll,{appearance:n,className:Te(p("embeddedTipContainer",n),r),style:s},(a===!0||f.dismissible)&&qe.createElement(Dl,{onClick:()=>M(void 0,null,function*(){yield u(e),t&&t()}),className:p("embeddedTipDismissButton",n)},qe.createElement(Ie,null)),(f.imageUri||f.videoUri)&&qe.createElement(yr,{className:p("embeddedTipMediaContainer",n)},qe.createElement(Sr,{appearance:n,stepData:f})),qe.createElement($l,null,qe.createElement(Oe,{size:"small",appearance:n,title:f.title,subtitle:f.subtitle})),f.primaryButtonTitle&&qe.createElement(Ml,{className:p("embeddedTipCallToActionContainer",n)},qe.createElement(le,{classPrefix:"embeddedTip",title:f.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>M(void 0,null,function*(){f.handlePrimaryButtonClick(),y(f),!(i&&i(f,F(e),"primary")===!1)&&(yield c(e,f.id),yield l(e))})}))))};import Ae,{useEffect as Yc}from"react";import ho from"styled-components";var Kl=ho.div`
|
|
1599
1673
|
// use the :not annotation
|
|
1600
1674
|
${e=>B(e)} {
|
|
1601
1675
|
display: flex;
|
|
@@ -1607,24 +1681,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1607
1681
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1608
1682
|
border-radius: 12px;
|
|
1609
1683
|
}
|
|
1610
|
-
`,
|
|
1684
|
+
`,ql=ho.div`
|
|
1611
1685
|
${e=>B(e)} {
|
|
1612
1686
|
display: flex;
|
|
1613
1687
|
width: 46px;
|
|
1614
1688
|
height: 46px;
|
|
1615
1689
|
}
|
|
1616
|
-
`,
|
|
1690
|
+
`,Yl=ho.div`
|
|
1617
1691
|
display: flex;
|
|
1618
1692
|
flex-direction: column;
|
|
1619
1693
|
flex: 1;
|
|
1620
1694
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1621
1695
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1622
|
-
`,
|
|
1696
|
+
`,Jl=ho.div`
|
|
1623
1697
|
display: flex;
|
|
1624
1698
|
flex-direction: column;
|
|
1625
1699
|
justify-content: center;
|
|
1626
1700
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1627
|
-
`,
|
|
1701
|
+
`,ri=ho.div`
|
|
1628
1702
|
display: flex;
|
|
1629
1703
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1630
1704
|
align-items: flex-end;
|
|
@@ -1632,12 +1706,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1632
1706
|
:hover {
|
|
1633
1707
|
opacity: 0.8;
|
|
1634
1708
|
}
|
|
1635
|
-
`,
|
|
1709
|
+
`,ii=ho.div`
|
|
1636
1710
|
display: flex;
|
|
1637
1711
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1638
1712
|
align-items: flex-end;
|
|
1639
1713
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1640
|
-
`;import
|
|
1714
|
+
`;import ni from"react";var Xl=({style:e,className:t})=>ni.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},ni.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),ni.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var Jc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:a="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:u,markFlowSkipped:c,isLoading:g,targetingLogicShouldHideFlow:S,updateCustomVariables:k,getFlowMetadata:h,getFlowStatus:x,getFlowSteps:F,getCurrentStepIndex:y}=ie(),{primaryCTAClickSideEffects:v}=fe(),{mergeAppearanceWithDefault:L}=de();if(Ge(e),s=L(s),Yc(()=>{k(n)},[n,g]),g)return null;let E=l(e);if(!E||S(E)||x(e)===pe)return null;let f=F(e),w=f.length>0?f[y(e)]:h(e);return w!=null&&w.title&&(t=w.title),w!=null&&w.subtitle&&(o=w.subtitle),Ae.createElement(Ae.Fragment,null,Ae.createElement(se,{appearance:s}),Ae.createElement(Kl,{type:a,appearance:s,className:p("bannerContainer",s)},a!="square"&&Ae.createElement(ql,{className:p("bannerIconContainer",s)},d||Ae.createElement(Xl,null)),a==="square"&&w.dismissible&&Ae.createElement(ii,{type:a,className:p("bannerDismissButtonContainer",s)},Ae.createElement(ri,{type:a,onClick:()=>M(void 0,null,function*(){yield c(e),i&&i()}),className:p("bannerDismissButton",s)},Ae.createElement(Ie,null))),Ae.createElement(Yl,{type:a},Ae.createElement(Oe,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(w==null?void 0:w.primaryButtonTitle)&&Ae.createElement(Jl,{type:a,className:p("bannerCallToActionContainer",s)},Ae.createElement(le,{title:w==null?void 0:w.primaryButtonTitle,appearance:s,onClick:()=>{v(w),r&&r(w,0,"primary")},classPrefix:"banner"})),a!=="square"&&w.dismissible&&Ae.createElement(ii,{type:a,className:p("bannerDismissButtonContainer",s)},Ae.createElement(ri,{type:a,onClick:()=>M(void 0,null,function*(){yield c(e),i&&i()}),className:p("bannerDismissButton",s)},Ae.createElement(Ie,null)))))};import me,{useEffect as Xc}from"react";import{Portal as Qc}from"react-portal";import ht from"styled-components";var Ql=ht.div`
|
|
1641
1715
|
display: flex;
|
|
1642
1716
|
flex-direction: column;
|
|
1643
1717
|
width: 100%;
|
|
@@ -1659,7 +1733,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1659
1733
|
border-width: 1px;
|
|
1660
1734
|
border-color: ${t=>t.appearance.theme.colorBorder};
|
|
1661
1735
|
border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
|
|
1662
|
-
`,
|
|
1736
|
+
`,Zl=ht.button`
|
|
1663
1737
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1664
1738
|
border-radius: 8px;
|
|
1665
1739
|
// If selected make border color primary and text color color priamry
|
|
@@ -1680,33 +1754,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1680
1754
|
display: flex;
|
|
1681
1755
|
justify-content: center;
|
|
1682
1756
|
align-items: center;
|
|
1683
|
-
`,
|
|
1757
|
+
`,si=ht.div`
|
|
1684
1758
|
display: flex;
|
|
1685
1759
|
justify-content: space-between;
|
|
1686
1760
|
margin-top: 16px;
|
|
1687
1761
|
gap: 8px;
|
|
1688
|
-
`,
|
|
1762
|
+
`,Rl=ht.div`
|
|
1689
1763
|
display: flex;
|
|
1690
1764
|
justify-content: space-between;
|
|
1691
1765
|
margin-top: 8px;
|
|
1692
|
-
`,
|
|
1766
|
+
`,li=ht.div`
|
|
1693
1767
|
font-size: 12px;
|
|
1694
1768
|
line-height: 18px;
|
|
1695
1769
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1696
1770
|
font-style: normal;
|
|
1697
1771
|
font-weight: 400;
|
|
1698
1772
|
letter-spacing: 0.24px;
|
|
1699
|
-
`,
|
|
1773
|
+
`,ai=ht.div`
|
|
1700
1774
|
display: flex;
|
|
1701
1775
|
flex-direction: column;
|
|
1702
1776
|
flex: 1;
|
|
1703
|
-
`,
|
|
1777
|
+
`,Bw=ht.div`
|
|
1704
1778
|
display: flex;
|
|
1705
1779
|
flex-direction: column;
|
|
1706
1780
|
justify-content: center;
|
|
1707
1781
|
align-items: flex-start;
|
|
1708
1782
|
margin-top: 16px;
|
|
1709
|
-
`,
|
|
1783
|
+
`,ea=ht.textarea`
|
|
1710
1784
|
${e=>B(e)} {
|
|
1711
1785
|
color: ${e=>e.appearance.theme.colorText};
|
|
1712
1786
|
margin-top: 16px;
|
|
@@ -1719,7 +1793,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1719
1793
|
height: 100px;
|
|
1720
1794
|
resize: none;
|
|
1721
1795
|
}
|
|
1722
|
-
`,
|
|
1796
|
+
`,ta=ht.div`
|
|
1723
1797
|
${e=>B(e)} {
|
|
1724
1798
|
position: absolute;
|
|
1725
1799
|
top: 16px;
|
|
@@ -1730,79 +1804,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1730
1804
|
opacity: 0.8;
|
|
1731
1805
|
}
|
|
1732
1806
|
}
|
|
1733
|
-
`;var
|
|
1734
|
-
${e=>B(e)} {
|
|
1735
|
-
display: flex;
|
|
1736
|
-
flex-direction: column;
|
|
1737
|
-
width: 100%;
|
|
1738
|
-
max-width: 500px;
|
|
1739
|
-
box-sizing: border-box;
|
|
1740
|
-
align-items: unset;
|
|
1741
|
-
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1742
|
-
position: relative;
|
|
1743
|
-
}
|
|
1744
|
-
`,ql=Pt.div`
|
|
1745
|
-
display: flex;
|
|
1746
|
-
flex-direction: column;
|
|
1747
|
-
flex: 1;
|
|
1748
|
-
`,Yl=Pt.div`
|
|
1749
|
-
display: flex;
|
|
1750
|
-
flex-direction: column;
|
|
1751
|
-
justify-content: center;
|
|
1752
|
-
align-items: center;
|
|
1753
|
-
margin-bottom: 12px;
|
|
1754
|
-
margin-top: 4px;
|
|
1755
|
-
`,Jl=Pt.div`
|
|
1756
|
-
display: flex;
|
|
1757
|
-
flex-direction: row;
|
|
1758
|
-
justify-content: center;
|
|
1759
|
-
align-items: stretch;
|
|
1760
|
-
gap: 16px;
|
|
1761
|
-
margin-top: 8px;
|
|
1762
|
-
`,Xl=Pt.div`
|
|
1763
|
-
margin-top: 16px;
|
|
1764
|
-
margin-bottom: 16px;
|
|
1765
|
-
`,Ql=Pt.div`
|
|
1766
|
-
${e=>B(e)} {
|
|
1767
|
-
position: absolute;
|
|
1768
|
-
top: -16px;
|
|
1769
|
-
right: -16px;
|
|
1770
|
-
cursor: pointer;
|
|
1771
|
-
|
|
1772
|
-
:hover {
|
|
1773
|
-
opacity: 0.8;
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
`,Zl=Pt.h1`
|
|
1777
|
-
${e=>B(e)} {
|
|
1778
|
-
font-style: normal;
|
|
1779
|
-
justify-content: center;
|
|
1780
|
-
text-align: center;
|
|
1781
|
-
font-size: 18px;
|
|
1782
|
-
font-weight: 700;
|
|
1783
|
-
line-height: 24px; /* 125% */
|
|
1784
|
-
letter-spacing: 0.36px;
|
|
1785
|
-
display: flex;
|
|
1786
|
-
align-items: center;
|
|
1787
|
-
color: ${e=>e.appearance.theme.colorText};
|
|
1788
|
-
margin-bottom: 8px;
|
|
1789
|
-
}
|
|
1790
|
-
`,Rl=Pt.h2`
|
|
1791
|
-
${e=>B(e)} {
|
|
1792
|
-
font-style: normal;
|
|
1793
|
-
justify-content: center;
|
|
1794
|
-
text-align: center;
|
|
1795
|
-
font-weight: 400;
|
|
1796
|
-
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1797
|
-
font-size: 14px;
|
|
1798
|
-
line-height: 22px; /* 150% */
|
|
1799
|
-
letter-spacing: 0.28px;
|
|
1800
|
-
margin-bottom: 8px;
|
|
1801
|
-
}
|
|
1802
|
-
`;import ea from"react";import Qc from"styled-components";var Zc=Qc.img`
|
|
1803
|
-
width: 100%;
|
|
1804
|
-
height: 100%;
|
|
1805
|
-
min-height: 200px;
|
|
1806
|
-
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1807
|
-
`;function ta({stepData:e,appearance:t,classPrefix:o=""}){var i;return e.videoUri?ea.createElement(tt,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo}):e.imageUri?ea.createElement(Zc,{className:p(`${o}image`,t),appearance:t,src:e.imageUri}):null}var em=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a=!0,modalPosition:d="center",showPagination:l=!0,allowBackNavigation:u})=>{let{getFlow:c,markFlowCompleted:g,markFlowSkipped:S,markStepCompleted:k,markStepStarted:h,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:y,getFlowSteps:v,getFlowStatus:L,getCurrentStepIndex:E}=ie(),{primaryCTAClickSideEffects:f,secondaryCTAClickSideEffects:w}=fe(),{mergeAppearanceWithDefault:I}=de(),{setOpenFlowState:T,getOpenFlowState:A,hasOpenModals:N}=Ne();Ge(e);let[U,z]=[A(e,!0),Se=>T(e,Se)];if(n=I(n),Rc(()=>{y(o)},[o,x]),x)return null;let G=c(e);if(!G||F(G)||L(e)===pe||N())return null;let _=v(e),K=E(e),J=_.length,O=_[K],Z=()=>M(void 0,null,function*(){z(!1),yield S(e),t&&t()});function q(){var Se;return ye.createElement(ye.Fragment,null,ye.createElement(se,{appearance:n}),ye.createElement(Kl,{appearance:n,className:Te(p("announcementContainer",n),r),style:s},(a===!0||O.dismissible)&&d=="inline"&&ye.createElement(Ql,{onClick:()=>M(this,null,function*(){yield S(e),t&&t()}),className:p("announcementDismissButton",n)},ye.createElement(Ie,null)),ye.createElement(ql,null,ye.createElement(Zl,{appearance:n,className:p("announcementTitle",n),dangerouslySetInnerHTML:ce(O.title)}),O.subtitle&&ye.createElement(Rl,{appearance:n,className:p("announcementSubtitle",n),dangerouslySetInnerHTML:ce(O.subtitle)})),(O.imageUri||O.videoUri)&&ye.createElement(Xl,{className:p("announcementMediaContainer",n)},ye.createElement(ta,{appearance:n,stepData:O})),l&&J>1&&ye.createElement(Yl,{className:p("announcementPaginationContainer",n)},ye.createElement(er,{className:p("announcementPagination",n),appearance:n,stepCount:J,currentStep:K})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&ye.createElement(Jl,{allowBackNavigation:u,className:p("announcementCTAContainer",n)},u&&K>0&&ye.createElement(le,{classPrefix:"announcementBack",title:(Se=O.backButtonTitle)!=null?Se:"Back",appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){i&&i(O,E(e),"back"),yield h(e,_[K-1].id)}),secondary:!0}),O.secondaryButtonTitle&&ye.createElement(le,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){O.handleSecondaryButtonClick(),w(O),i&&i(O,E(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&ye.createElement(le,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){f(O),!(i&&i(O,E(e),"primary")===!1)&&(E(e)===J-1?(O.handlePrimaryButtonClick(),yield g(e)):O.handlePrimaryButtonClick())})}))))}let ne={padding:"24px",maxWidth:"400px"};return d==="inline"?q():d!=="center"?ye.createElement(qo,{modalPosition:d,onClose:Z,visible:U,dismissible:a,appearance:n},q()):ye.createElement(Re,{appearance:n,onClose:Z,visible:U,style:ne,dismissible:a},q())};import*as yr from"react";import oa from"react";var ra=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=$e(r,["as","children","variant"]);return oa.createElement(vn,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},tm=Object.fromEntries(Object.keys(nr).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>oa.createElement(ra,j(b({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),li=Object.assign(ra,tm);var ia=s=>{var a=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=a,r=$e(a,["as","className","size","title","variant"]);var d;return yr.createElement(Pn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),yr.createElement(li,{color:(d=Io[n])==null?void 0:d.color,fontWeight:"semibold"},i))},om=Object.fromEntries(Object.keys(Io).map(e=>{let t=o=>yr.createElement(ia,j(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),rm=Object.assign(ia,om);export{No as Box,rm as Button,pt as CheckBox,wr as FlowType,yt as FormLabel,Or as FormTextField,em as FrigadeAnnouncement,qc as FrigadeBanner,Rr as FrigadeChecklist,at as FrigadeDefaultAppearance,Gc as FrigadeEmbeddedTip,yn as FrigadeForm,wc as FrigadeGuide,Cc as FrigadeHeroChecklist,Xc as FrigadeNPSSurvey,Sc as FrigadeProgressBadge,Pd as FrigadeProvider,Vc as FrigadeSupportWidget,Uc as FrigadeTour,ze as ProgressBar,Zt as ProgressRing,li as Text,sr as tokens,Ne as useFlowOpens,bo as useFlowResponses,ie as useFlows,jr as useOrganization,wo as useUser,_e as useUserFlowStates};
|
|
1807
|
+
`;var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:a="modal"})=>{let{getFlow:d,markFlowCompleted:l,markFlowSkipped:u,markStepCompleted:c,getNumberOfStepsCompleted:g,isLoading:S,targetingLogicShouldHideFlow:k,updateCustomVariables:h,getFlowSteps:x,getFlowStatus:F,getFlowMetadata:y}=ie(),{primaryCTAClickSideEffects:v}=fe(),{mergeAppearanceWithDefault:L}=de(),[E,f]=me.useState(null),[w,I]=me.useState(""),T=y(e),{hasOpenModals:A,setKeepCompletedFlowOpenDuringSession:N,shouldKeepCompletedFlowOpenDuringSession:U}=Ne();if(Ge(e),n=L(n),Xc(()=>{h(o)},[o,S]),S)return null;let z=d(e);if(!z||k(z)||F(e)===pe||g(e)===1&&!U(e)||A())return null;let _=x(e)[g(e)];function K(){var Z,q;return me.createElement(me.Fragment,null,me.createElement(ai,null,me.createElement(Oe,{size:"large",appearance:n,title:_.title,subtitle:_.subtitle})),me.createElement(si,{className:p("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(ne=>me.createElement(Zl,{className:p("npsNumberButton",n),selected:E===ne+1,key:ne,onClick:()=>M(this,null,function*(){N(e),f(ne+1),yield c(e,_.id,{score:ne+1})}),appearance:n},ne+1))),me.createElement(Rl,{appearance:n},me.createElement(li,{appearance:n},(Z=T==null?void 0:T.negativeLabel)!=null?Z:"Not likely at all"),me.createElement(li,{appearance:n},(q=T==null?void 0:T.positiveLabel)!=null?q:"Extremely likely")))}function J(){var Z;return me.createElement(me.Fragment,null,me.createElement(ai,null,me.createElement(Oe,{appearance:n,title:(Z=_.title)!=null?Z:"Why did you choose this score?",size:"large"})),me.createElement(ea,{appearance:n,value:w,onChange:q=>{I(q.target.value)},placeholder:"Add your optional feedback here..."}),me.createElement(si,{appearance:n,className:p("npsNumberButtonContainer",n)},me.createElement(le,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield l(e),i&&i(_,1,"primary")}),appearance:n,title:_.secondaryButtonTitle||"Skip",secondary:!0}),me.createElement(le,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield c(e,_.id,{feedbackText:w}),yield l(e),i&&i(_,1,"primary")}),appearance:n,title:_.primaryButtonTitle||"Submit"})))}function O(){return g(e)>=2?null:me.createElement(me.Fragment,null,me.createElement(se,{appearance:n}),me.createElement(Ql,{appearance:n,className:Te(p("npsSurveyContainer",n),r),style:s,type:a},me.createElement(ta,{onClick:()=>M(this,null,function*(){yield u(e),t&&t()}),className:p("npsSurveyDismissButton",n)},me.createElement(Ie,null)),g(e)==0&&K(),g(e)==1&&J()))}return a==="inline"?O():me.createElement(Qc,null,O())};import ye,{useEffect as Rc}from"react";var em=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a=!0,modalPosition:d="center",showPagination:l=!0,allowBackNavigation:u})=>{let{getFlow:c,markFlowCompleted:g,markFlowSkipped:S,markStepCompleted:k,markStepStarted:h,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:y,getFlowSteps:v,getFlowStatus:L,getCurrentStepIndex:E}=ie(),{primaryCTAClickSideEffects:f,secondaryCTAClickSideEffects:w}=fe(),{mergeAppearanceWithDefault:I}=de(),{setOpenFlowState:T,getOpenFlowState:A,hasOpenModals:N}=Ne();Ge(e);let[U,z]=[A(e,!0),Se=>T(e,Se)];if(n=I(n),Rc(()=>{y(o)},[o,x]),x)return null;let G=c(e);if(!G||F(G)||L(e)===pe||N())return null;let _=v(e),K=E(e),J=_.length,O=_[K],Z=()=>M(void 0,null,function*(){z(!1),yield S(e),t&&t()});function q(){var Se;return ye.createElement(ye.Fragment,null,ye.createElement(se,{appearance:n}),ye.createElement(Ul,{appearance:n,className:Te(p("announcementContainer",n),r),style:s},(a===!0||O.dismissible)&&d=="inline"&&ye.createElement(Hl,{onClick:()=>M(this,null,function*(){yield S(e),t&&t()}),className:p("announcementDismissButton",n)},ye.createElement(Ie,null)),ye.createElement(_l,null,ye.createElement(Vl,{appearance:n,className:p("announcementTitle",n),dangerouslySetInnerHTML:ce(O.title)}),O.subtitle&&ye.createElement(jl,{appearance:n,className:p("announcementSubtitle",n),dangerouslySetInnerHTML:ce(O.subtitle)})),(O.imageUri||O.videoUri)&&ye.createElement(yr,{className:p("announcementMediaContainer",n)},ye.createElement(Sr,{appearance:n,stepData:O})),l&&J>1&&ye.createElement(Wl,{className:p("announcementPaginationContainer",n)},ye.createElement(er,{className:p("announcementPagination",n),appearance:n,stepCount:J,currentStep:K})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&ye.createElement(zl,{allowBackNavigation:u,className:p("announcementCTAContainer",n)},u&&K>0&&ye.createElement(le,{classPrefix:"announcementBack",title:(Se=O.backButtonTitle)!=null?Se:"Back",appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){i&&i(O,E(e),"back"),yield h(e,_[K-1].id)}),secondary:!0}),O.secondaryButtonTitle&&ye.createElement(le,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){O.handleSecondaryButtonClick(),w(O),i&&i(O,E(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&ye.createElement(le,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){f(O),!(i&&i(O,E(e),"primary")===!1)&&(E(e)===J-1?(O.handlePrimaryButtonClick(),yield g(e)):O.handlePrimaryButtonClick())})}))))}let ne={padding:"24px",maxWidth:"400px"};return d==="inline"?q():d!=="center"?ye.createElement(qo,{modalPosition:d,onClose:Z,visible:U,dismissible:a,appearance:n},q()):ye.createElement(et,{appearance:n,onClose:Z,visible:U,style:ne,dismissible:a},q())};import*as br from"react";import oa from"react";var ra=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=$e(r,["as","children","variant"]);return oa.createElement(En,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},tm=Object.fromEntries(Object.keys(nr).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>oa.createElement(ra,j(b({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),pi=Object.assign(ra,tm);var ia=s=>{var a=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=a,r=$e(a,["as","className","size","title","variant"]);var d;return br.createElement(Bn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),br.createElement(pi,{color:(d=Io[n])==null?void 0:d.color,fontWeight:"semibold"},i))},om=Object.fromEntries(Object.keys(Io).map(e=>{let t=o=>br.createElement(ia,j(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),rm=Object.assign(ia,om);export{No as Box,rm as Button,pt as CheckBox,Fr as FlowType,yt as FormLabel,$r as FormTextField,em as FrigadeAnnouncement,Jc as FrigadeBanner,ti as FrigadeChecklist,at as FrigadeDefaultAppearance,qc as FrigadeEmbeddedTip,bn as FrigadeForm,wc as FrigadeGuide,Cc as FrigadeHeroChecklist,Zc as FrigadeNPSSurvey,Sc as FrigadeProgressBadge,Pd as FrigadeProvider,Vc as FrigadeSupportWidget,Uc as FrigadeTour,ze as ProgressBar,Zt as ProgressRing,pi as Text,sr as tokens,Ne as useFlowOpens,bo as useFlowResponses,ie as useFlows,Kr as useOrganization,wo as useUser,_e as useUserFlowStates};
|
|
1808
1808
|
//# sourceMappingURL=index.mjs.map
|