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