@frigade/react 1.36.3 → 1.36.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +4 -0
- package/lib/index.js +209 -204
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +210 -205
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var Eo=Object.getOwnPropertySymbols;var si=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable;var ni=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))si.call(t,o)&&ni(e,o,t[o]);if(Eo)for(var o of Eo(t))li.call(t,o)&&ni(e,o,t[o]);return e},j=(e,t)=>na(e,sa(t));var ai=e=>typeof e=="symbol"?e:e+"",Ne=(e,t)=>{var o={};for(var i in e)si.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Eo)for(var i of Eo(e))t.indexOf(i)<0&&li.call(e,i)&&(o[i]=e[i]);return o};var U=(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 Et,{createContext as bd,useEffect as Jo,useState as je}from"react";import{ThemeProvider as wd}from"styled-components";import Bt,{useContext as Xp,useEffect as Xt,useState as yo}from"react";import{useCallback as kt,useContext as ya,useEffect as Sa}from"react";import lr,{useMemo as di}from"react";var pi="1.36.3 ";var ot="NOT_STARTED_STEP",R="COMPLETED_FLOW",Ao="ABORTED_FLOW",Ft="STARTED_FLOW",Me="NOT_STARTED_FLOW",De="COMPLETED_STEP",Oo="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=lr.useContext(J);return{config:di(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":pi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:di(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function _t(){let{shouldGracefullyDegrade:e,readonly:t}=lr.useContext(J);return(o,i)=>U(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return zt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),zt();let n=la+o,r=aa+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 zt()}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 zt(p)}return l?l.ok?l:zt(l.statusText):zt()})}function zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ht(){let{publicApiKey:e,shouldGracefullyDegrade:t}=lr.useContext(J);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as ci}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=pa(J);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(b({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,T=Ne(C,[ai(c)]);return b({},T)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import fa from"swr/immutable";import ao from"core-js-pure/actual/structured-clone";function ar(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xe(...e){let t=e.shift(),o=e.length===1?e[0]:xe(...e);if(!ar(t)||!ar(o))throw new Error("deepmerge can only merge Objects");let i=ao(t);return Object.entries(o).forEach(([n,r])=>{ar(r)?i[n]!==void 0?Object.assign(i,{[n]:xe(i[n],ao(r))}):Object.assign(i,{[n]:ao(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ao(r)]}):Object.assign(i,{[n]:ao(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function Ue(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=da(J),{resetOpenFlowState:d}=Be(),[s,m]=ma(!1),c={data:r.map(S=>({flowId:S.id,flowState:R,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=S=>fetch(S,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${S}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:C,mutate:h,error:A}=p?fa(y,g):ua(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),F=T==null?void 0:T.data;ca(()=>{!s&&!C&&F&&m(!0)},[F,s,C]);function P(S){return U(this,null,function*(){if(F&&!p){let k=F.find(L=>L.flowId===S);k&&k.flowState!==R&&(k.flowState=R),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function v(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.stepStates[k]=L,O.flowState=Ft),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function B(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.lastStepId=k,O.stepStates[k]=L,O.flowState=Ft),yield h(xe(T,{data:F}),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function f(S){return U(this,null,function*(){if(F){let k=F.find(L=>L.flowId===S);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=ga,Object.keys(k.stepStates).forEach(L=>{k.stepStates[L].actionType=ot,k.stepStates[L].createdAt=new Date().toISOString()}),yield h(xe(T,{data:F}),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1}),d(S))}})}function I(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.stepStates[k]=L),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:F,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:v,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:B,error:A}}function po(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=Ue(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=ha(J),[d,s]=ci(new Set),[m,c]=ci(new Set),g=_t();function y(h){let A=JSON.stringify(h);if(d.has(A))return null;d.add(A),s(d),m.add(h),c(m);let F=l==null?void 0:l.find(P=>P.flowSlug===h.flowSlug&&P.stepId===h.stepId&&P.actionType===h.actionType&&P.createdAt===h.createdAt);return g(`${t}flowResponses`,j(b({},e),{method:"POST",body:A})).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),r([...n,h])):F||p(v=>[...v!=null?v:[],h])})}function T(h){return U(this,null,function*(){h.foreignUserId&&(h.actionType===Ft||h.actionType===Me?yield y(h):h.actionType===R?yield y(h):h.actionType===Oo?yield y(h):h.actionType===De?yield y(h):h.actionType===Ao?yield y(h):h.actionType===ot&&(yield y(h)))})}function C(){let h=[];return o==null||o.forEach(A=>{if(A&&A.stepStates&&Object.keys(A.stepStates).length!==0)for(let F in A.stepStates){let P=A.stepStates[F];h.push({foreignUserId:A.foreignUserId,flowSlug:A.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...h,...l]}return{addResponse:T,setFlowResponses:p,getFlowResponses:C}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,mi=e=>{let t=xa.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Ca(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function pr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}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 X(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,readonly:y}=ya(J),T={data:[]},{verifySDKInitiated:C}=Ht(),{addResponse:h,getFlowResponses:A}=po(),F=x=>fetch(x,e).then(u=>u.ok?u.json():(console.log(`Error fetching ${x} (${u.status}): ${u.statusText}. Will gracefully degrade and hide Frigade`),g(!0),T)).catch(u=>(console.log(`Error fetching ${x}: ${u}. Will gracefully degrade and hide Frigade`),g(!0),T)),{mutateUserFlowState:P,userFlowStatesData:v,isLoadingUserFlowStateData:B,optimisticallyMarkFlowCompleted:f,optimisticallyMarkFlowNotStarted:I,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:L}=Ue(),{data:O,error:N,isLoading:V}=ba(l?`${t}flows${y?"?readonly=true":""}`:null,F,{keepPreviousData:!0});Sa(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function W(x){if(V)return null;let u=o.find(w=>w.slug===x);return!u&&o.length>0&&!B&&!V?(console.log(`Flow with id ${x} not found`),null):(u==null?void 0:u.active)===!1&&!y?null:u}function Y(x){var z,ce;if(!W(x))return[];let u=W(x).data;return u?(u=Q(u),((ce=(z=pr(u))==null?void 0:z.data)!=null?ce:[]).map(ae=>{let wt=ie(ae);return j(b({handleSecondaryButtonClick:()=>{ae.skippable===!0&&re(x,ae.id,{skipped:!0})}},ae),{complete:Fe(x,ae.id)===De||wt>=1,currentlyActive:v==null?void 0:v.some(Tt=>Tt.flowId==x&&Tt.lastStepId===ae.id),blocked:ye(x,ae.id),hidden:$e(x,ae.id),handlePrimaryButtonClick:()=>{(!ae.completionCriteria&&(ae.autoMarkCompleted||ae.autoMarkCompleted===void 0)||ae.completionCriteria&&ae.autoMarkCompleted===!0)&&re(x,ae.id)},progress:wt})}).filter(ae=>ae.hidden!==!0)):[]}function Q(x){return x.replaceAll(/\${(.*?)}/g,(u,w)=>p[w]===void 0?"":String(p[w]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function de(x){var w;if(!W(x))return[];let u=W(x).data;return u?(u=Q(u),(w=JSON.parse(u))!=null?w:{}):[]}function H(x,u){d(w=>j(b({},w),{[x]:u}))}function le(x){!B&&!V&&x&&JSON.stringify(p)!=JSON.stringify(b(b({},p),x))&&Object.keys(x).forEach(u=>{H(u,x[u])})}let fe=kt((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:Oo,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield L(x,u,z),h(z))}),[n,r,v]),Te=kt((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:ot,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield k(x,u,z),h(z))}),[n,r,v]),re=kt((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:De,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield S(x,u,z),h(z))}),[n,r,v]),Z=kt((x,u)=>U(this,null,function*(){if(!C()||Oe(x)===Me)return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Me,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield I(x),he(w)&&h(w)}),[n,r,v]),q=kt((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Ft,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&h(w)}),[n,r,v]),_=kt((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:R,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&(yield f(x),h(w))}),[n,r,v]),Le=kt((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Ao,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&(yield f(x),h(w))}),[n,r,v]);function he(x){var u;if(v===void 0)return!1;if(v){let w=v.find(z=>z.flowId===x.flowSlug);if(x.actionType===ot&&(!(w!=null&&w.stepStates[x.stepId])||w.stepStates[x.stepId].actionType===ot))return!1;if(w&&((u=w.stepStates[x.stepId])==null?void 0:u.actionType)===x.actionType){if(x.actionType===De&&(!x.data||JSON.stringify(x.data)===JSON.stringify({})))return!1;let z=Object.keys(w.stepStates).sort((ce,ae)=>{let wt=new Date(w.stepStates[ce].createdAt),Tt=new Date(w.stepStates[ae].createdAt);return wt.getTime()-Tt.getTime()});if(w.stepStates[z[z.length-1]].actionType===x.actionType&&x.stepId===z[z.length-1])return!1}if(w&&w.flowState===R&&x.actionType===R)return!1}return!0}function Fe(x,u){let w=$(x,u);return B?null:w?w.actionType:ot}function ye(x,u){let w=$(x,u);return w?w.blocked:!1}function $e(x,u){let w=$(x,u);return w?w.hidden:!1}function $(x,u){var z;if(B)return null;let w=v==null?void 0:v.find(ce=>ce.flowId===x);return!w||!w.stepStates[u]?null:(z=w.stepStates[u])!=null?z:null}function M(x){var w,z;if(B||!v)return null;if(Oe(x)===Me)return(w=Y(x)[0])!=null?w:null;let u=(z=v.find(ce=>ce.flowId===x))==null?void 0:z.lastStepId;return u?Y(x).find(ce=>ce.id===u):null}function D(x){var z;let u=M(x);if(!u)return 0;let w=(z=Y(x).findIndex(ce=>ce.id===u.id))!=null?z:0;return Fe(x,u.id)===De&&w<Y(x).length-1?w+1:w}function ie(x){if(!x.completionCriteria)return;let u=mi(x.completionCriteria);if(u===null)return;let w=bt(u),z=Ge(u);return z===0?void 0:w/z}function Oe(x){let u=v==null?void 0:v.find(w=>w.flowId===x);return u?u.flowState:null}function bt(x){let u=Y(x);return u.length===0?0:u.filter(z=>Fe(x,z.id)===De).length}function Ge(x){return Y(x).length}function mt(x){let u=o.find(w=>w.slug===x);return u?pr(u.data):null}function Ke(x){if(y)return!1;if(B)return!0;if(x!=null&&x.targetingLogic&&v){let u=v.find(w=>w.flowId===x.slug);if(u)return u.shouldTrigger===!1}return!!(x!=null&&x.targetingLogic&&n&&n.startsWith("guest_"))}function Dt(x){return!Ke(W(x))}function Ut(){n&&P()}function Wt(){return o}return{getAllFlows:Wt,getFlow:W,getFlowData:mt,isLoading:B||V,getStepStatus:Fe,getFlowSteps:Y,getCurrentStepIndex:D,markStepStarted:fe,markStepCompleted:re,markFlowNotStarted:Z,markFlowStarted:q,markFlowCompleted:_,markFlowAborted:Le,markStepNotStarted:Te,getFlowStatus:Oe,getNumberOfStepsCompleted:bt,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Ke,setCustomVariable:H,updateCustomVariables:le,customVariables:p,getStepOptionalProgress:ie,getFlowMetadata:de,isStepBlocked:ye,isStepHidden:$e,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Dt,refresh:Ut}}import{useCallback as cr,useContext as wa,useEffect as Ta}from"react";var Vt="guest_";function co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(J),{config:r,apiUrl:l}=Je(),{mutateUserFlowState:p}=Ue(),d=_t(),{verifySDKInitiated:s}=Ht();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(Vt))return;let T=m(e);localStorage.getItem(T)||(d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=cr(T=>U(this,null,function*(){if(!s())return;let C={foreignId:e,properties:T};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(C)})),i(h=>b(b({},h),T)),p()}),[e,r,n,p]),g=cr((T,C)=>U(this,null,function*(){if(!s())return;let A={foreignId:e,events:[{event:T,properties:C}]};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),p()}),[e,r,p]),y=cr((T,C)=>U(this,null,function*(){if(s())if(C){let h=m(T);localStorage.setItem(h,"true"),o(T);let A={foreignId:T,properties:C};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),i(F=>b(b({},F),C)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as Qp}from"uuid";import Re,{useEffect as hn,useState as qp}from"react";import qe,{useEffect as gr,useState as Na}from"react";import $o from"styled-components";import Fa from"react";import ka from"styled-components";var ui="fr-",mo="cfr-";function a(e,t){let o=`${ui}${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+" "+mo+e}return o}function E(e){if(!e.className||e.className.indexOf(mo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(ui)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function No(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${No(t)}: ${e.styleOverrides[t]};`).join(" "):""}function be(...e){return e.filter(Boolean).join(" ")}function uo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
2
|
+
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var Ao=Object.getOwnPropertySymbols;var si=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable;var ni=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))si.call(t,o)&&ni(e,o,t[o]);if(Ao)for(var o of Ao(t))li.call(t,o)&&ni(e,o,t[o]);return e},j=(e,t)=>na(e,sa(t));var ai=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)si.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Ao)for(var i of Ao(e))t.indexOf(i)<0&&li.call(e,i)&&(o[i]=e[i]);return o};var U=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(l){n(l)}},s=d=>{try{p(o.throw(d))}catch(l){n(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import Ot,{createContext as wd,useEffect as Jo,useState as Ge}from"react";import{ThemeProvider as Td}from"styled-components";import At,{useContext as Qp,useEffect as Qt,useState as So}from"react";import{useCallback as Pt,useContext as ya,useEffect as Sa}from"react";import ar,{useMemo as di}from"react";var pi="1.36.4 ";var nt="NOT_STARTED_STEP",R="COMPLETED_FLOW",Oo="ABORTED_FLOW",kt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",po="STARTED_STEP";function Xe(){let{publicApiKey:e,userId:t,apiUrl:o}=ar.useContext(Y);return{config:di(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":pi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:di(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Ht(){let{shouldGracefullyDegrade:e,readonly:t}=ar.useContext(Y);return(o,i)=>U(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return _t();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),_t();let n=la+o,r=aa+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 l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return _t()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(p){return _t(p)}return s?s.ok?s:_t(s.statusText):_t()})}function _t(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Vt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=ar.useContext(Y);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as ci}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Oe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=pa(Y);function r(c,f=!1){var C;return(C=e[c])!=null?C:f}function s(c,f){t(C=>j(b({},C),{[c]:f}))}function p(c){t(f=>{let x=f,{[c]:C}=x,w=Le(x,[ai(c)]);return b({},w)})}function d(c){n.includes(c)||i(f=>[...f,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,C])=>C&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import co from"core-js-pure/actual/structured-clone";function pr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!pr(t)||!pr(o))throw new Error("deepmerge can only merge Objects");let i=co(t);return Object.entries(o).forEach(([n,r])=>{pr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],co(r))}):Object.assign(i,{[n]:co(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...co(r)]}):Object.assign(i,{[n]:co(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function We(){let{config:e,apiUrl:t}=Xe(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(Y),{resetOpenFlowState:d}=Oe(),[l,m]=ma(!1),c={data:r.map(S=>({flowId:S.id,flowState:R,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=S=>fetch(S,e).then(F=>{if(F.ok)return F.json();throw new Error("Failed to fetch user flow states")}).catch(F=>(console.log(`Error fetching ${S}: ${F}. Will gracefully degrade and hide Frigade`),s(!0),c)),C=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:x,mutate:g,error:A}=p?fa(C,f):ua(C,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),T=w==null?void 0:w.data;ca(()=>{!l&&!x&&T&&m(!0)},[T,l,x]);function k(S){return U(this,null,function*(){if(T&&!p){let F=T.find(M=>M.flowId===S);F&&F.flowState!==R&&(F.flowState=R),yield g(Promise.resolve(Ce(w,{data:T})),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function P(S,F,M){return U(this,null,function*(){if(T){let O=T.find(I=>I.flowId===S);O&&(O.stepStates[F]=M,O.flowState=kt),yield g(Promise.resolve(Ce(w,{data:T})),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function v(S,F,M){return U(this,null,function*(){if(T){let O=T.find(I=>I.flowId===S);O&&(O.lastStepId=F,O.stepStates[F]=M,O.flowState=kt),yield g(Ce(w,{data:T}),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function u(S){return U(this,null,function*(){if(T){let F=T.find(M=>M.flowId===S);F&&F.flowState!==Ue&&(F.flowState=Ue,F.lastStepId=ga,Object.keys(F.stepStates).forEach(M=>{F.stepStates[M].actionType=nt,F.stepStates[M].createdAt=new Date().toISOString()}),yield g(Ce(w,{data:T}),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1}),d(S))}})}function L(S,F,M){return U(this,null,function*(){if(T){let O=T.find(I=>I.flowId===S);O&&(O.stepStates[F]=M),yield g(Promise.resolve(Ce(w,{data:T})),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:k,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:L,optimisticallyMarkStepStarted:v,error:A}}function mo(){let{config:e,apiUrl:t}=Xe(),{userFlowStatesData:o,mutateUserFlowState:i}=We(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=ha(Y),[d,l]=ci(new Set),[m,c]=ci(new Set),f=Ht();function C(g){let A=JSON.stringify(g);if(d.has(A))return null;d.add(A),l(d),m.add(g),c(m);let T=s==null?void 0:s.find(k=>k.flowSlug===g.flowSlug&&k.stepId===g.stepId&&k.actionType===g.actionType&&k.createdAt===g.createdAt);return f(`${t}flowResponses`,j(b({},e),{method:"POST",body:A})).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):T||p(P=>[...P!=null?P:[],g])})}function w(g){return U(this,null,function*(){g.foreignUserId&&(g.actionType===kt||g.actionType===Ue?yield C(g):g.actionType===R?yield C(g):g.actionType===po?yield C(g):g.actionType===$e?yield C(g):g.actionType===Oo?yield C(g):g.actionType===nt&&(yield C(g)))})}function x(){let g=[];return o==null||o.forEach(A=>{if(A&&A.stepStates&&Object.keys(A.stepStates).length!==0)for(let T in A.stepStates){let k=A.stepStates[T];g.push({foreignUserId:A.foreignUserId,flowSlug:A.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...g,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:x}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,mi=e=>{let t=xa.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Ca(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function dr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var cr=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(cr||{});function J(){let{config:e,apiUrl:t}=Xe(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:C}=ya(Y),w={data:[]},{verifySDKInitiated:x}=Vt(),{addResponse:g,getFlowResponses:A}=mo(),T=h=>fetch(h,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${h} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),w)).catch(y=>(console.log(`Error fetching ${h}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),w)),{mutateUserFlowState:k,userFlowStatesData:P,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:u,optimisticallyMarkFlowNotStarted:L,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:M}=We(),{data:O,error:I,isLoading:V}=ba(s?`${t}flows${C?"?readonly=true":""}`:null,T,{keepPreviousData:!0});Sa(()=>{if(I){console.error(I);return}O&&O.data&&i(O.data)},[O,I]);function W(h){if(V)return null;let y=o.find(B=>B.slug===h);return!y&&o.length>0&&!v&&!V?(console.log(`Flow with id ${h} not found`),null):(y==null?void 0:y.active)===!1&&!C?null:y}function q(h){var N,ie;if(!W(h))return[];let y=W(h).data;return y?(y=X(y),((ie=(N=dr(y))==null?void 0:N.data)!=null?ie:[]).map(Q=>{let De=se(Q);return j(b({handleSecondaryButtonClick:()=>{Q.skippable===!0&&re(h,Q.id,{skipped:!0})}},Q),{complete:Pe(h,Q.id)===$e||De>=1,started:Pe(h,Q.id)===po||Pe(h,Q.id)===$e,currentlyActive:P==null?void 0:P.some(ht=>ht.flowId==h&&ht.lastStepId===Q.id),blocked:Ae(h,Q.id),hidden:be(h,Q.id),handlePrimaryButtonClick:()=>{(!Q.completionCriteria&&(Q.autoMarkCompleted||Q.autoMarkCompleted===void 0)||Q.completionCriteria&&Q.autoMarkCompleted===!0)&&re(h,Q.id)},progress:De})}).filter(Q=>Q.hidden!==!0)):[]}function X(h){return h.replaceAll(/\${(.*?)}/g,(y,B)=>p[B]===void 0?"":String(p[B]).replace(/[\u00A0-\u9999<>\&]/g,function(N){return"&#"+N.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 de(h){var B;if(!W(h))return[];let y=W(h).data;return y?(y=X(y),(B=JSON.parse(y))!=null?B:{}):[]}function H(h,y){d(B=>j(b({},B),{[h]:y}))}function ae(h){!v&&!V&&h&&JSON.stringify(p)!=JSON.stringify(b(b({},p),h))&&Object.keys(h).forEach(y=>{H(y,h[y])})}let fe=Pt((h,y,B)=>U(this,null,function*(){if(!x())return;let N={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:po,data:B!=null?B:{},createdAt:new Date,blocked:!1,hidden:!1};xe(N)&&(yield M(h,y,N),g(N))}),[n,r,P]),Te=Pt((h,y,B)=>U(this,null,function*(){if(!x())return;let N={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:nt,data:B!=null?B:{},createdAt:new Date,blocked:!1,hidden:!1};xe(N)&&(yield F(h,y,N),g(N))}),[n,r,P]),re=Pt((h,y,B)=>U(this,null,function*(){if(!x())return;let N={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:$e,data:B!=null?B:{},createdAt:new Date,blocked:!1,hidden:!1};xe(N)&&(yield S(h,y,N),g(N))}),[n,r,P]),Z=Pt((h,y)=>U(this,null,function*(){if(!x()||ce(h)===Ue)return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield L(h),xe(B)&&g(B)}),[n,r,P]),he=Pt((h,y)=>U(this,null,function*(){if(!x())return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:kt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};xe(B)&&g(B)}),[n,r,P]),D=Pt((h,y)=>U(this,null,function*(){if(!x())return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:R,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};xe(B)&&(yield u(h),g(B))}),[n,r,P]),Se=Pt((h,y)=>U(this,null,function*(){if(!x())return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Oo,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};xe(B)&&(yield u(h),g(B))}),[n,r,P]);function xe(h){var y;if(P===void 0)return!1;if(P){let B=P.find(N=>N.flowId===h.flowSlug);if(h.actionType===nt&&(!(B!=null&&B.stepStates[h.stepId])||B.stepStates[h.stepId].actionType===nt))return!1;if(B&&((y=B.stepStates[h.stepId])==null?void 0:y.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let N=Object.keys(B.stepStates).sort((ie,Q)=>{let De=new Date(B.stepStates[ie].createdAt),ht=new Date(B.stepStates[Q].createdAt);return De.getTime()-ht.getTime()});if(B.stepStates[N[N.length-1]].actionType===h.actionType&&h.stepId===N[N.length-1])return!1}if(B&&B.flowState===R&&h.actionType===R)return!1}return!0}function Pe(h,y){let B=_(h,y);return v?null:B?B.actionType:nt}function Ae(h,y){let B=_(h,y);return B?B.blocked:!1}function be(h,y){let B=_(h,y);return B?B.hidden:!1}function _(h,y){var N;if(v)return null;let B=P==null?void 0:P.find(ie=>ie.flowId===h);return!B||!B.stepStates[y]?null:(N=B.stepStates[y])!=null?N:null}function $(h){var B,N;if(v||!P)return null;if(ce(h)===Ue)return(B=q(h)[0])!=null?B:null;let y=(N=P.find(ie=>ie.flowId===h))==null?void 0:N.lastStepId;return y?q(h).find(ie=>ie.id===y):null}function z(h){var N;let y=$(h);if(!y)return 0;let B=(N=q(h).findIndex(ie=>ie.id===y.id))!=null?N:0;return Pe(h,y.id)===$e&&B<q(h).length-1?B+1:B}function se(h){if(!h.completionCriteria)return;let y=mi(h.completionCriteria);if(y===null)return;let B=rt(y),N=it(y);return N===0?void 0:B/N}function ce(h){let y=P==null?void 0:P.find(B=>B.flowId===h);return y?y.flowState:null}function rt(h){let y=q(h);return y.length===0?0:y.filter(N=>Pe(h,N.id)===$e).length}function it(h){return q(h).length}function Wt(h){let y=o.find(B=>B.slug===h);return y?dr(y.data):null}function Ke(h){if(C)return!1;if(v)return!0;if(h!=null&&h.targetingLogic&&P){let y=P.find(B=>B.flowId===h.slug);if(y)return y.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function gt(h){return!Ke(W(h))}function Je(){n&&k()}function zt(){return o}return{getAllFlows:zt,getFlow:W,getFlowData:Wt,isLoading:v||V,getStepStatus:Pe,getFlowSteps:q,getCurrentStepIndex:z,markStepStarted:fe,markStepCompleted:re,markFlowNotStarted:Z,markFlowStarted:he,markFlowCompleted:D,markFlowAborted:Se,markStepNotStarted:Te,getFlowStatus:ce,getNumberOfStepsCompleted:rt,getNumberOfSteps:it,targetingLogicShouldHideFlow:Ke,setCustomVariable:H,updateCustomVariables:ae,customVariables:p,getStepOptionalProgress:se,getFlowMetadata:de,isStepBlocked:Ae,isStepHidden:be,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:gt,refresh:Je}}import{useCallback as mr,useContext as wa,useEffect as Ta}from"react";var jt="guest_";function uo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(Y),{config:r,apiUrl:s}=Xe(),{mutateUserFlowState:p}=We(),d=Ht(),{verifySDKInitiated:l}=Vt();function m(w){return`frigade-user-registered-${w}`}Ta(()=>{if(e&&!t){if(e.startsWith(jt))return;let w=m(e);localStorage.getItem(w)||(d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(w,"true"))}},[e,n,t]);let c=mr(w=>U(this,null,function*(){if(!l())return;let x={foreignId:e,properties:w};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(x)})),i(g=>b(b({},g),w)),p()}),[e,r,n,p]),f=mr((w,x)=>U(this,null,function*(){if(!l())return;let A={foreignId:e,events:[{event:w,properties:x}]};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),p()}),[e,r,p]),C=mr((w,x)=>U(this,null,function*(){if(l())if(x){let g=m(w);localStorage.setItem(g,"true"),o(w);let A={foreignId:w,properties:x};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),i(T=>b(b({},T),x)),p()}else o(w)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:C,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Zp}from"uuid";import et,{useEffect as hn,useState as Yp}from"react";import qe,{useEffect as hr,useState as Na}from"react";import $o from"styled-components";import Fa from"react";import ka from"styled-components";var ui="fr-",fo="cfr-";function a(e,t){let o=`${ui}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+fo+e}return o}function E(e){if(!e.className||e.className.indexOf(fo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(ui)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function No(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ve(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${No(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Fe(...e){return e.filter(Boolean).join(" ")}function go(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,fi=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import
|
|
26
|
+
`,fi=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import ur from"react";import va from"styled-components";var Ba=va.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,Ne=()=>ur.createElement(Ba,null,ur.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},ur.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Ia}from"react-portal";import vi from"react";import fr from"react";function Ea({style:e,className:t}){return fr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},fr.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),fr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var gi=Ea;import gr from"styled-components";import st from"styled-components";var Io=st.div`
|
|
31
31
|
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -57,11 +57,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
|
-
`,hi=
|
|
60
|
+
`,hi=st.div`
|
|
61
61
|
${e=>E(e)} {
|
|
62
62
|
${e=>e.hasImage?Aa:Oa};
|
|
63
63
|
}
|
|
64
|
-
`,xi=
|
|
64
|
+
`,xi=st.img`
|
|
65
65
|
${e=>E(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
@@ -69,7 +69,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
69
69
|
min-height: 200px;
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
|
-
`,Ci=
|
|
72
|
+
`,Ci=st.div`
|
|
73
73
|
${e=>E(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
@@ -77,19 +77,19 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
77
77
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
78
78
|
object-fit: cover;
|
|
79
79
|
}
|
|
80
|
-
`,yi=
|
|
80
|
+
`,yi=st.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
align-content: center;
|
|
85
|
-
`,Si=
|
|
85
|
+
`,Si=st.div`
|
|
86
86
|
padding: 22px 22px 12px;
|
|
87
|
-
`,bi=
|
|
87
|
+
`,bi=st.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
justify-content: center;
|
|
92
|
-
`,wi=
|
|
92
|
+
`,wi=st.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
flex: 2;
|
|
95
95
|
flex-shrink: 1;
|
|
@@ -101,7 +101,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
|
-
`,Ti=
|
|
104
|
+
`,Ti=st.p`
|
|
105
105
|
${e=>E(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
@@ -110,7 +110,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
110
110
|
color: #808080;
|
|
111
111
|
}
|
|
112
112
|
margin: 0;
|
|
113
|
-
`;var Fi=
|
|
113
|
+
`;var Fi=gr.div`
|
|
114
114
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
115
115
|
position: absolute;
|
|
116
116
|
bottom: -47px;
|
|
@@ -121,7 +121,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
121
121
|
align-items: center;
|
|
122
122
|
justify-content: center;
|
|
123
123
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
124
|
-
`,ki=
|
|
124
|
+
`,ki=gr(Io)`
|
|
125
125
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
126
126
|
position: absolute;
|
|
127
127
|
bottom: -60px;
|
|
@@ -134,7 +134,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
134
134
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
135
135
|
padding: 0;
|
|
136
136
|
z-index: ${e=>e.zIndex};
|
|
137
|
-
`,Pi=
|
|
137
|
+
`,Pi=gr.div`
|
|
138
138
|
display: flex;
|
|
139
139
|
justify-content: center;
|
|
140
140
|
align-items: center;
|
|
@@ -158,7 +158,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
158
158
|
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
159
159
|
z-index: 1500;
|
|
160
160
|
border-radius: ${e=>{var t,o,i;return(i=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?i:8}}px;
|
|
161
|
-
${e=>
|
|
161
|
+
${e=>ve(e)}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
padding: 32px;
|
|
@@ -205,7 +205,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Na("");return hr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),hr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),hr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement(Ia,null,qe.createElement(fi,{appearance:r,onClose:()=>{s&&e()}}),qe.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:i},s&&qe.createElement(Ma,{className:a("modalClose",r),onClick:()=>e(),appearance:r},qe.createElement(Ne,null)),o&&qe.createElement($a,null,o),qe.createElement(Da,null,n),p&&qe.createElement(Fi,{appearance:r,className:a("poweredByFrigadeRibbon",r)},qe.createElement(Lo,{appearance:r})))):qe.createElement(qe.Fragment,null)};import Ct,{useEffect as xr,useState as Ua}from"react";import Mo from"styled-components";import{Portal as Wa}from"react-portal";function za(e){switch(e){case"top-left":return`
|
|
209
209
|
top: 0;
|
|
210
210
|
left: 0;
|
|
211
211
|
`;case"top-right":return`
|
|
@@ -249,7 +249,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,Do=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:
|
|
252
|
+
`,Do=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[p,d]=Ua("");return xr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),xr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),xr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?Ct.createElement(Wa,null,Ct.createElement(_a,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},s&&Ct.createElement(Va,{className:a("cornerModalClose",n),onClick:()=>e()},Ct.createElement(Ne,null)),o&&Ct.createElement(Ha,null,o),Ct.createElement(ja,null,i))):Ct.createElement(Ct.Fragment,null)};import{useContext as Ga}from"react";function ee(){let{defaultAppearance:e}=Ga(Y);function t(o){var n,r,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import vt,{useContext as up,useEffect as ji,useState as vr}from"react";import Ho from"styled-components";import zo,{useEffect as Ii,useState as Sr}from"react";import br from"styled-components";import Uo from"styled-components";var Bi=Uo.label`
|
|
253
253
|
${e=>E(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
@@ -280,11 +280,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import
|
|
283
|
+
`;import Cr from"react";var lt={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function yt({title:e,required:t,appearance:o=lt}){return e?Cr.createElement(Wo,{className:a("formLabelWrapper",o)},t?Cr.createElement(Ai,{className:a("formLabelRequired",o),appearance:o},"*"):null,Cr.createElement(Bi,{className:a("formLabel",o)},e)):null}import Oi from"react";function Gt({title:e,appearance:t}){return e?Oi.createElement(Wo,null,Oi.createElement(Ei,{className:a("formSubLabel",t)},e)):null}import{z as yr}from"zod";function Ni(e,t){var o,i,n,r,s,p,d;try{if(t){if(t.type=="number"){let l=yr.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?l=l.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((r=m.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=yr.string();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(s=m.message)!=null?s:"Value is too short"):m.requirement=="max"?l=l.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(l=l.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof yr.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var Ka=br.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,br
|
|
287
|
+
`,wr=br.input`
|
|
288
288
|
${e=>E(e)} {
|
|
289
289
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
290
290
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -300,7 +300,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
|
-
`,qa=
|
|
303
|
+
`,qa=br.textarea`
|
|
304
304
|
${e=>E(e)} {
|
|
305
305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
306
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -317,7 +317,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
317
317
|
box-sizing: border-box;
|
|
318
318
|
margin-bottom: 10px;
|
|
319
319
|
resize: none;
|
|
320
|
-
`;function
|
|
320
|
+
`;function Tr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,p]=Sr((n==null?void 0:n.text)||""),[d,l]=Sr(!1),[m,c]=Sr(!1),f=wr;Ii(()=>{s===""&&!d&&(l(!0),C(""))},[]),Ii(()=>{if(m){C(s);return}},[m]);function C(x){var A;if(p(x),o({text:x}),r.required===!0&&x.trim()===""){i([{id:r.id,message:`${(A=r.title)!=null?A:"Field"} is required`,hidden:!m}]);return}let g=Ni(x,r.validation);if(g&&(x.trim()!==""||r.required===!0)){i([{id:r.id,message:g,hidden:!m}]);return}i([])}r.multiline&&(f=qa);function w(){var x;switch((x=r==null?void 0:r.validation)==null?void 0:x.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return zo.createElement(Ka,null,zo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),zo.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:x=>{C(x.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:w(),onBlur:()=>{c(!0)}}),zo.createElement(Gt,{title:r.subtitle,appearance:t.appearance}))}import Ze,{useEffect as Li,useState as $i}from"react";import Mi from"styled-components";var Fr="",Ya=Mi.div`
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
width: 100%;
|
|
@@ -344,9 +344,9 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
344
344
|
background-repeat: no-repeat;
|
|
345
345
|
background-size: 1.5em 1.5em;
|
|
346
346
|
-webkit-print-color-adjust: exact;
|
|
347
|
-
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,
|
|
348
|
-
${e=>
|
|
349
|
-
`,
|
|
347
|
+
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,C,w,x,g,A,T;let r=e,[s,p]=$i(!1),[d,l]=$i(!1);return Li(()=>{var k,P,v,u;if(!((k=i==null?void 0:i.choice)!=null&&k[0])&&!s){if(p(!0),r.requireSelection){o({choice:[Fr]});return}if(r.defaultValue&&((P=r.props.options)!=null&&P.find(L=>L.id===r.defaultValue))){let L=(v=r.props.options)==null?void 0:v.find(S=>S.id===r.defaultValue);o({choice:[L.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),Li(()=>{var k;d&&(r.requireSelection&&((k=i==null?void 0:i.choice)==null?void 0:k[0])===Fr?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),Ze.createElement(Ya,null,Ze.createElement(yt,{title:r.title,required:!1,appearance:t.appearance}),Ze.createElement(Ja,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:k=>{l(!0),o({choice:[k.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Ze.createElement("option",{key:"null-value",value:Fr,disabled:!0},(f=r.placeholder)!=null?f:"Select an option"),(C=r.props.options)==null?void 0:C.map(k=>Ze.createElement("option",{key:k.id,value:k.id},k.title))),((x=(w=r.props.options)==null?void 0:w.find(k=>{var P;return k.id===((P=i==null?void 0:i.choice)==null?void 0:P[0])}))==null?void 0:x.isOpenEnded)&&Ze.createElement(Ze.Fragment,null,Ze.createElement(yt,{title:(T=(A=(g=r.props.options)==null?void 0:g.find(k=>{var P;return k.id===((P=i==null?void 0:i.choice)==null?void 0:P[0])}))==null?void 0:A.openEndedLabel)!=null?T:"Please specify",required:!1,appearance:t.appearance}),Ze.createElement(wr,{type:"text",placeholder:"Enter your answer here",onChange:k=>{o({choice:[k.target.value]})},appearance:t.appearance})),Ze.createElement(Gt,{title:r.subtitle,appearance:t.appearance}))}import Co,{useEffect as kr,useState as Wi}from"react";import zi from"styled-components";import xo from"react";import ho from"react";var Ui=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return ho.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Xa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>ho.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},ho.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},ho.createElement(Ui,{color:n,size:t}),ho.createElement(Ui,{color:e,percentage:Math.max(o,.1),size:t})),i),Kt=Xa;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>xo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ra={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ep={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},tp={border:"1px solid #000000",color:"#FFFFFF"},op={border:"1px solid #C5CBD3"},rp={color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np=e=>e==="square"?Ra:ep,sp=(e,t)=>e==="square"?t?tp:op:t?rp:ip,lp=Qa.div`
|
|
348
|
+
${e=>ve(e)}
|
|
349
|
+
`,at=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=lt,style:r,className:s})=>{let p=np(t),d=sp(t,e);return e===!0?p=j(b(b({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=b(b({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?xo.createElement(Kt,{fillColor:o,percentage:i,size:22}):xo.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:Fe(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&xo.createElement(Za,{color:"#FFFFFF"}))};var ap=zi.div`
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: column;
|
|
352
352
|
width: 100%;
|
|
@@ -377,7 +377,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
377
377
|
height: 48px;
|
|
378
378
|
padding: 0 18px;
|
|
379
379
|
margin-bottom: 10px;
|
|
380
|
-
`;function _i({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[
|
|
380
|
+
`;function _i({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,p]=Wi((i==null?void 0:i.choice)||[]),[d,l]=Wi(!1);return kr(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),kr(()=>{o({choice:s})},[s]),kr(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),Co.createElement(ap,null,Co.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>Co.createElement(pp,{appearance:t.appearance,className:a(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(f=>f!==c.id));return}s.length<r.props.maxChoices?p([...s,c.id]):s.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,Co.createElement(at,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),Co.createElement(Gt,{title:r.subtitle,appearance:t.appearance}))}import _o from"react";import Hi from"styled-components";import dp from"dompurify";function me(e){return{__html:dp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var cp=Hi.h1`
|
|
381
381
|
${e=>E(e)} {
|
|
382
382
|
font-style: normal;
|
|
383
383
|
font-weight: 700;
|
|
@@ -398,7 +398,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
398
398
|
letter-spacing: 0.28px;
|
|
399
399
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
400
400
|
}
|
|
401
|
-
`;function
|
|
401
|
+
`;function Ie({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return _o.createElement(_o.Fragment,null,_o.createElement(cp,{appearance:e,className:a(`${n}${n?go(i):i}Title`,e),dangerouslySetInnerHTML:me(t),size:i}),o&&_o.createElement(mp,{appearance:e,className:a(`${n}${n?go(i):i}Subtitle`,e),dangerouslySetInnerHTML:me(o),size:i}))}import*as Pr from"react";var Vi=e=>Pr.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Pr.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 fp=Ho.div`
|
|
402
402
|
display: flex;
|
|
403
403
|
flex-direction: column;
|
|
404
404
|
justify-content: flex-end;
|
|
@@ -416,20 +416,20 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
416
416
|
`,xp=Ho.div`
|
|
417
417
|
padding-left: 1px;
|
|
418
418
|
padding-right: 1px;
|
|
419
|
-
`,Cp={text:
|
|
419
|
+
`,Cp={text:Tr,multipleChoice:Di,multipleChoiceList:_i},Br="frigade-multiInputStepTypeData";function Gi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:p}){var v;let d=t.props,[l,m]=vr([]),[c,f]=vr([]),{userId:C}=uo(),[w,x]=vr(k()||(p?p[t.id]:null)||{}),{readonly:g}=up(Y),A=b(b({},Cp),s);ji(()=>{i(l.length===0)},[l,i]),ji(()=>{n(w)},[w]);function T(u,L){x(S=>{let F=j(b({},S),{[u.id]:L});return typeof window!="undefined"&&window.localStorage&&!g&&window.localStorage.setItem(P(),JSON.stringify(F)),F})}function k(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem(P());if(u)return JSON.parse(u)}return null}function P(){return`${Br}-${e}-${t.id}-${C}`}return vt.createElement(xp,{className:a("multiInput",r)},vt.createElement(Ie,{appearance:r,title:t.title,subtitle:t.subtitle}),vt.createElement(fp,{className:a("multiInputContainer",r)},(v=d==null?void 0:d.data)==null?void 0:v.map(u=>{let L=l.reverse().find(S=>S.id===u.id);return A[u.type]?vt.createElement("span",{key:u.id,"data-field-id":u.id,className:a("multiInputField",r)},A[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:S=>{!c.includes(u.id)&&S&&(S==null?void 0:S.text)!==""&&f(F=>[...F,u.id]),T(u,S)},inputData:w[u.id],setFormValidationErrors:S=>{S.length===0&&l.length===0||m(F=>S.length===0?F.filter(M=>M.id!==u.id):[...F,...S])}}),L&&L.message&&c.includes(u.id)&&L.hidden!==!0&&vt.createElement(gp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},vt.createElement(hp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},vt.createElement(Vi,null)),L.message)):null})))}import qt from"styled-components";var Ki=qt.div`
|
|
420
420
|
align-items: center;
|
|
421
421
|
display: flex;
|
|
422
422
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
423
423
|
padding-top: 14px;
|
|
424
|
-
`,qi=
|
|
424
|
+
`,qi=qt.div`
|
|
425
425
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
426
426
|
font-size: 12px;
|
|
427
|
-
`,Yi=
|
|
427
|
+
`,Yi=qt.div`
|
|
428
428
|
display: flex;
|
|
429
429
|
gap: 12px;
|
|
430
430
|
width: 100%;
|
|
431
431
|
justify-content: flex-end;
|
|
432
|
-
`,Ji=
|
|
432
|
+
`,Ji=qt.div`
|
|
433
433
|
display: flex;
|
|
434
434
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
435
435
|
// Otherwise, use 4px padding
|
|
@@ -437,11 +437,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
437
437
|
flex-grow: 1;
|
|
438
438
|
flex-basis: 0;
|
|
439
439
|
position: relative;
|
|
440
|
-
`,Xi=
|
|
440
|
+
`,Xi=qt.div`
|
|
441
441
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
442
442
|
position: relative;
|
|
443
443
|
overflow-y: auto;
|
|
444
|
-
`,Qi=
|
|
444
|
+
`,Qi=qt.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
align-self: stretch;
|
|
447
447
|
flex-grow: 1;
|
|
@@ -453,7 +453,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
453
453
|
background-position: center;
|
|
454
454
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
455
455
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
456
|
-
`;import
|
|
456
|
+
`;import St from"react";import Ri from"react";import en from"styled-components";import yp from"styled-components";var Zi=yp.div`
|
|
457
457
|
width: 24px;
|
|
458
458
|
height: 24px;
|
|
459
459
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -490,7 +490,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
490
490
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
491
491
|
line-height: 20px;
|
|
492
492
|
font-weight: 500;
|
|
493
|
-
${e=>
|
|
493
|
+
${e=>ve(e)}
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
font-family: inherit;
|
|
@@ -515,14 +515,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
515
515
|
margin-right: 8px;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
`,te=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:
|
|
518
|
+
`,te=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var f;function c(){let C=s?"buttonSecondary":"button";return l===""?C:`${l}${go(C)}`}return Ri.createElement(Sp,{secondary:s,appearance:p,disabled:i||m,loading:(f=m==null?void 0:m.toString())!=null?f:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?Ri.createElement(Zi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var tn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:p,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var C;let c=s.length>1&&r!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return St.createElement(St.Fragment,null,l!==null&&l!=null&&St.createElement(qi,{appearance:o,className:a("formCTAError",o)},l),St.createElement(Ki,{showBackButton:c,className:a("formCTAContainer",o)},c&&St.createElement(te,{title:(C=e.backButtonTitle)!=null?C:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),St.createElement(Yi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?St.createElement(te,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?St.createElement(te,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};import Er from"react";import bp from"styled-components";var wp=bp.div`
|
|
519
519
|
text-align: center;
|
|
520
|
-
`,on=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ee().mergeAppearanceWithDefault(i);return
|
|
520
|
+
`,on=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ee().mergeAppearanceWithDefault(i);return Er.createElement(wp,{className:o},Er.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Er.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import Bt from"react";import Yt from"styled-components";import{useContext as Tp}from"react";function pe(){let e=Tp(Y);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Fp=Yt.div`
|
|
521
521
|
display: flex;
|
|
522
522
|
flex-wrap: wrap;
|
|
523
523
|
align-content: center;
|
|
524
524
|
justify-content: center;
|
|
525
|
-
`,kp=
|
|
525
|
+
`,kp=Yt.div`
|
|
526
526
|
align-content: center;
|
|
527
527
|
align-items: center;
|
|
528
528
|
display: flex;
|
|
@@ -536,10 +536,10 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
536
536
|
flex-basis: 255px;
|
|
537
537
|
flex-grow: 0;
|
|
538
538
|
flex-shrink: 0;
|
|
539
|
-
`,Pp=
|
|
539
|
+
`,Pp=Yt.img`
|
|
540
540
|
width: 78px;
|
|
541
541
|
height: auto;
|
|
542
|
-
`,vp=
|
|
542
|
+
`,vp=Yt.button`
|
|
543
543
|
font-style: normal;
|
|
544
544
|
font-weight: 600;
|
|
545
545
|
font-size: 13px;
|
|
@@ -552,11 +552,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
552
552
|
border-radius: 100px;
|
|
553
553
|
padding: 8px 12px;
|
|
554
554
|
margin-top: 16px;
|
|
555
|
-
`,Bp=
|
|
555
|
+
`,Bp=Yt.h1`
|
|
556
556
|
font-weight: 700;
|
|
557
557
|
font-size: 28px;
|
|
558
558
|
line-height: 34px;
|
|
559
|
-
`,Ep=
|
|
559
|
+
`,Ep=Yt.h2`
|
|
560
560
|
font-style: normal;
|
|
561
561
|
font-weight: 400;
|
|
562
562
|
font-size: 16px;
|
|
@@ -565,7 +565,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
565
565
|
margin-top: 12px;
|
|
566
566
|
margin-bottom: 16px;
|
|
567
567
|
max-width: 70%;
|
|
568
|
-
`;function rn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=pe();return
|
|
568
|
+
`;function rn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=pe();return Bt.createElement("div",null,Bt.createElement(Bp,null,e.title),Bt.createElement(Ep,null,e.subtitle),Bt.createElement(Fp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Bt.createElement(kp,{key:r.title},Bt.createElement(Pp,{src:r.imageUri}),Bt.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import Xt,{useEffect as Up}from"react";import Go from"styled-components";import Ar from"react";var jo=({style:e,className:t})=>Ar.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},Ar.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Ar.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Et,{useRef as Ap,useState as Op}from"react";import Jt from"styled-components";var Np=Jt.div`
|
|
569
569
|
display: flex;
|
|
570
570
|
align-items: center;
|
|
571
571
|
justify-content: flex-start;
|
|
@@ -573,7 +573,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
573
573
|
width: 100%;
|
|
574
574
|
height: 100%;
|
|
575
575
|
position: relative;
|
|
576
|
-
`,Ip=
|
|
576
|
+
`,Ip=Jt.div`
|
|
577
577
|
position: absolute;
|
|
578
578
|
display: flex;
|
|
579
579
|
align-items: center;
|
|
@@ -592,61 +592,66 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
592
592
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
593
593
|
border-radius: 50%;
|
|
594
594
|
}
|
|
595
|
-
`,Lp=
|
|
595
|
+
`,Lp=Jt.video`
|
|
596
596
|
width: 100%;
|
|
597
597
|
height: 100%;
|
|
598
598
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
599
|
-
`,$p=
|
|
599
|
+
`,$p=Jt.iframe`
|
|
600
600
|
width: 100%;
|
|
601
601
|
height: 100%;
|
|
602
602
|
min-height: 260px;
|
|
603
603
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
604
|
-
`,Mp=
|
|
604
|
+
`,Mp=Jt.iframe`
|
|
605
605
|
width: 100%;
|
|
606
606
|
height: 100%;
|
|
607
607
|
min-height: 400px;
|
|
608
608
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
609
|
-
}
|
|
609
|
+
}`,Dp=Jt.iframe`
|
|
610
|
+
width: 100%;
|
|
611
|
+
height: 100%;
|
|
612
|
+
min-height: 400px;
|
|
613
|
+
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
614
|
+
`;function Re({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Et.createElement($p,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let r=t.split("vimeo.com/")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Et.createElement(Mp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let r=t.split("wistia.com/medias/")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Et.createElement(Dp,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return Et.createElement(Np,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Et.createElement(Ip,{onClick:()=>{n(!0),o.current.play()},appearance:e},Et.createElement(jo,null)),Et.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Wp=Go.div`
|
|
610
615
|
${e=>E(e)} {
|
|
611
616
|
display: flex;
|
|
612
617
|
flex-direction: column;
|
|
613
618
|
justify-content: center;
|
|
614
619
|
}
|
|
615
|
-
`,
|
|
620
|
+
`,zp=Go.img`
|
|
616
621
|
${e=>E(e)} {
|
|
617
622
|
width: 100%;
|
|
618
623
|
height: auto;
|
|
619
624
|
max-height: 250px;
|
|
620
625
|
margin-bottom: 24px;
|
|
621
626
|
}
|
|
622
|
-
`,
|
|
627
|
+
`,_p=Go.div`
|
|
623
628
|
${e=>E(e)} {
|
|
624
629
|
margin-bottom: 24px;
|
|
625
630
|
}
|
|
626
|
-
`,
|
|
631
|
+
`,Hp=Go.div`
|
|
627
632
|
${e=>E(e)} {
|
|
628
633
|
width: 100%;
|
|
629
634
|
height: auto;
|
|
630
635
|
max-height: 250px;
|
|
631
636
|
margin-bottom: 24px;
|
|
632
637
|
}
|
|
633
|
-
`;function nn({stepData:e,appearance:t,setCanContinue:o}){return
|
|
638
|
+
`;function nn({stepData:e,appearance:t,setCanContinue:o}){return Up(()=>{o(!0)},[]),Xt.createElement(Wp,{className:a("callToActionContainer",t)},Xt.createElement(_p,{className:a("callToActionTextContainer",t)},Xt.createElement(Ie,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Xt.createElement(zp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Xt.createElement(Hp,{appearance:t,className:a("callToActionVideo",t)},Xt.createElement(Re,{appearance:t,videoUri:e.videoUri})))}import pt,{useEffect as Or,useState as Nr}from"react";import bt from"styled-components";var sn=bt.div`
|
|
634
639
|
width: auto;
|
|
635
640
|
display: flex;
|
|
636
641
|
flex-direction: column;
|
|
637
642
|
justify-content: center;
|
|
638
643
|
align-items: center;
|
|
639
644
|
padding: 4px;
|
|
640
|
-
`,ln=
|
|
645
|
+
`,ln=bt.div`
|
|
641
646
|
width: 100%;
|
|
642
647
|
text-align: left;
|
|
643
|
-
`,an=
|
|
648
|
+
`,an=bt.h1`
|
|
644
649
|
font-style: normal;
|
|
645
650
|
font-weight: 700;
|
|
646
651
|
font-size: 32px;
|
|
647
652
|
line-height: 38px;
|
|
648
653
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
649
|
-
`,pn=
|
|
654
|
+
`,pn=bt.h1`
|
|
650
655
|
font-style: normal;
|
|
651
656
|
font-weight: 400;
|
|
652
657
|
font-size: 16px;
|
|
@@ -654,7 +659,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
654
659
|
margin-top: 16px;
|
|
655
660
|
margin-bottom: 16px;
|
|
656
661
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
657
|
-
`,dn=
|
|
662
|
+
`,dn=bt.div`
|
|
658
663
|
padding-top: 12px;
|
|
659
664
|
padding-bottom: 12px;
|
|
660
665
|
flex-direction: row;
|
|
@@ -665,17 +670,17 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
665
670
|
cursor: pointer;
|
|
666
671
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
667
672
|
width: 100%;
|
|
668
|
-
`,cn=
|
|
673
|
+
`,cn=bt.div`
|
|
669
674
|
padding-top: 10px;
|
|
670
675
|
padding-bottom: 10px;
|
|
671
676
|
flex-direction: row;
|
|
672
677
|
display: flex;
|
|
673
678
|
justify-content: flex-start;
|
|
674
|
-
`,mn=
|
|
679
|
+
`,mn=bt.img`
|
|
675
680
|
width: 42px;
|
|
676
681
|
height: 42px;
|
|
677
682
|
margin-right: 12px;
|
|
678
|
-
`,un=
|
|
683
|
+
`,un=bt.p`
|
|
679
684
|
font-style: normal;
|
|
680
685
|
font-weight: 500;
|
|
681
686
|
font-size: 17px;
|
|
@@ -683,8 +688,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
683
688
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
684
689
|
display: flex;
|
|
685
690
|
align-self: center;
|
|
686
|
-
`;var fn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,
|
|
687
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${No(l)}: ${p};`).join(" ")} }`:`${No(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ne({appearance:e}){if(!e||!e.styleOverrides)return Co.createElement(Co.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Co.createElement(Co.Fragment,null):Co.createElement(jp,{inlineStyles:t})}import{useEffect as Gp,useState as Kp}from"react";function Ve(e){let[t,o]=Kp(!1),{markStepStarted:i,isLoading:n,getFlowStatus:r,getFlowSteps:l,getCurrentStepIndex:p,targetingLogicShouldHideFlow:d,getFlow:s}=X(),m=l(e);function c(){return U(this,null,function*(){!t&&!n&&r(e)===Me&&d(s(e))===!1&&(o(!0),yield i(e,m[p(e)].id))})}return Gp(()=>{c()},[n,e]),{}}var xn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:C=!1,onDismiss:h,showPagination:A=!1,allowBackNavigation:F=!1,validationHandler:P,showFrigadeBranding:v=!1,onFormDataChange:B,showFooter:f=!0,prefillData:I={},updateUrlOnPageChange:S=!1})=>{let{getFlow:k,getFlowSteps:L,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:Y,markFlowNotStarted:Q,markStepStarted:de}=X(),H=W(e),{mergeAppearanceWithDefault:le}=ee(),[fe,Te]=qp(null),{setOpenFlowState:re,getOpenFlowState:Z,hasOpenModals:q}=Be();Ve(e);let _=L(e);d=le(d);let[Le,he]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),$=>re(e,$)],Fe=typeof window!="undefined"?window.location.hash:null;if(hn(()=>{var $;if(_&&_.length>0&&F){let M=typeof window!="undefined"&&(($=window==null?void 0:window.location)!=null&&$.hash)?window.location.hash.replace("#",""):"";if(_&&(_==null?void 0:_.length)>0){let D=-1;if(M){let ie=M;D=_.findIndex(Oe=>Oe.id===ie),fe===M&&(D=-1)}D!==-1&&(Te(M),de(e,_[D].id))}}},[Fe]),hn(()=>{!O&&_&&_.length&&typeof window!="undefined"&&F&&(window.location.hash=_[H].id)},[O,H,_]),O)return null;let ye=k(e);if(!ye||N(ye)||!_||i!==void 0&&i===!1||V(e)===R&&s&&!C||(o=="modal"||o=="corner-modal")&&q(e))return null;let $e=()=>{he(!1),h&&h(),y===!0&&Y(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",Re.createElement(Xe,{appearance:d,onClose:$e,visible:Le,style:$,dismissible:g,showFrigadeBranding:v},Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:B,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))}return o==="modal"&&T!=="center"?Re.createElement(Do,{appearance:d,onClose:$e,visible:Le,modalPosition:T},Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:B,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C})):Re.createElement(Re.Fragment,null,Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:B,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))},Cn=xn;import{useCallback as Nr,useContext as Yp,useEffect as Jp}from"react";function Ir(){let{organizationId:e,userId:t,setOrganizationId:o}=Yp(J),{mutateUserFlowState:i}=Ue(),{config:n,apiUrl:r}=Je(),l=_t(),{verifySDKInitiated:p}=Ht();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Jp(()=>{if(t&&e){if(t.startsWith(Vt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=Nr(g=>U(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 y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Nr((g,y)=>U(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 C={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=Nr((g,y)=>U(this,null,function*(){if(p())if(y){let T=d(t,g);localStorage.setItem(T,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var yn="frigade-xFrigade_guestUserId",So="frigade-xFrigade_userId",Sn=({})=>{let{setFlowResponses:e}=po(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ue(),{userId:n,setUserId:r}=co(),[l,p]=yo(n),{getFlowStatus:d}=X(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Xp(J),[y,T]=yo([]),[C,h]=yo([]),{organizationId:A}=Ir(),[F,P]=yo(A),[v,B]=yo(!1);Xt(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let L=t[k],O=s.find(N=>N.slug===(L==null?void 0:L.flowId));if(O&&L&&L.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!C.includes(O.slug)){setTimeout(()=>{f(L.flowId)},500);break}}},[o,t]),Xt(()=>{g.length>0&&i()},[g]),Xt(()=>{v||(B(!0),i())},[o,B]);function f(k){let L=s.find(O=>O.slug===k);L&&L.triggerType==="AUTOMATIC"&&!C.includes(L.slug)&&(h([...C,L.slug]),T([L]))}function I(){if(!n){let k=localStorage.getItem(So);if(k){r(k);return}let L=localStorage.getItem(yn);if(L){r(L);return}c(!0);let O=Vt+Qp();try{localStorage.setItem(yn,O)}catch(N){console.log("Failed to save guest user id locally: Local storage unavailable",N)}r(N=>N||O)}}Xt(()=>{try{if(s){let k=[];s.forEach(L=>{if(L.data){let O=L.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(N=>{let V=N.replace('"imageUri":"',"").replace('"',"");if(k.includes(V))return;let W=new Image;W.src=V,k.push(V)})}})}}catch(k){}},[s]),Xt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Vt))try{localStorage.setItem(So,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&I()},50)},[n,s,m]),Xt(()=>{A!=F&&(P(A),e([]),i())},[A,F,P]);function S(){return Bt.createElement(Bt.Fragment,null,y.map(k=>d(k.slug)!==Me?null:Bt.createElement("span",{key:k.slug},Bt.createElement(Cn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Bt.createElement(Bt.Fragment,null,Bt.createElement(S,null))};import{ErrorBoundary as Td}from"react-error-boundary";var bn={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 Zp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(bn[o]){let n=bn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function Rp(e){if(!e)return;let t=xe({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function wn(e){let{theme:t,styleOverrides:o}=e,i=Zp(t),n=Rp(o);return{overrides:i,css:n}}import ud from"styled-components";import{compose as fd,variant as Fn}from"styled-system";import Tn from"react";import ed,{ThemeProvider as td,useTheme as od}from"styled-components";import{border as rd,color as id,compose as nd,get as sd,shadow as ld,space as ad,system as pd,typography as dd}from"styled-system";var cd={width:{property:"width",scale:"sizes",transform:(e,t)=>sd(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},md=ed("div")(({css:e})=>e,nd(rd,id,ld,ad,dd,pd(cd))),bo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ne(r,["as","children","overrides"]);let l=od(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Tn.createElement(md,b(b({as:e},p),i),t);if(o!==void 0){let s=xe(l,o);return Tn.createElement(td,{theme:s},d())}return d()};var wo={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"}},gd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},kn=ud(bo)(()=>({whiteSpace:"nowrap"}),fd(Fn({scale:"components.Button",variants:"components.Button"}),Fn({prop:"size",variants:gd})));import hd from"styled-components";import{variant as xd,system as Cd}from"styled-system";var Yo={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 Pn=hd(bo)(xd({scale:"components.Text",variants:"components.Text"}),Cd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var vn=4,Bn="px",yd=20,Sd=Object.fromEntries(Array.from(Array(yd+1),(e,t)=>t===0?[.5,`${.5*vn}${Bn}`]:[t,`${t*vn}${Bn}`])),Qt={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"},Lr={colors:j(b({},Qt),{neutral:{foreground:Qt.gray300},primary:{background:Qt.blue500,foreground:Qt.white,inverted:Qt.blue500},negative:{foreground:Qt.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:Sd,components:{Button:wo,Text:Yo}};var En="https://api.frigade.com",J=bd({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:it,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:En,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 H,le,fe,Te,re;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,g]=je([]),[y,T]=je([]),[C,h]=je({}),[A,F]=je({}),[P,v]=je([]),[B,f]=je({}),[I,S]=je(!1),[k,L]=je(!1),[O,N]=je(!Y(e)),V=(Z,q)=>{if(q==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},W={theme:b(b({},it.theme),(le=(H=i==null?void 0:i.defaultAppearance)==null?void 0:H.theme)!=null?le:{}),styleOverrides:b(b({},it.styleOverrides),(Te=(fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.styleOverrides)!=null?Te:{})};function Y(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}Jo(()=>{t&&l(t)},[t]),Jo(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(So)&&window.localStorage.getItem(So)!==r&&Fd()},[r]),Jo(()=>{o&&d(o)},[o]),Jo(()=>{if(Y(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let Q={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:T,userProperties:C,setUserProperties:h,openFlowStates:A,setOpenFlowStates:F,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:v,customVariables:B,setCustomVariables:f,isNewGuestUser:I,setIsNewGuestUser:S,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:L,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:V,defaultAppearance:W,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:N,apiUrl:i&&i.apiUrl?i.apiUrl:En,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return Et.createElement(J.Provider,{value:Q},n);let{overrides:de}=wn(W);return Et.createElement(Td,{fallback:Et.createElement(Et.Fragment,null,n)},Et.createElement(J.Provider,{value:Q},Et.createElement(wd,{theme:xe(W.theme,Lr,de!=null?de:{},(re=i==null?void 0:i.theme)!=null?re:{})},n,Et.createElement(Sn,null))))};import fc from"react";import Ce,{useEffect as Vr,useState as rl}from"react";import Ye,{useState as Vd}from"react";import Nt from"styled-components";import Zo from"react";import At from"react";import On from"styled-components";var An=On.span`
|
|
691
|
+
`;var fn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=Nr([]),[p,d]=Nr(!1),[l,m]=Nr(e.id);return Or(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Or(()=>{l!==e.id&&(m(e.id),s([]))},[e]),Or(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),pt.createElement(sn,{className:a("selectListContainer",i)},pt.createElement(ln,null,pt.createElement(an,{className:a("selectListTitle",i)},e.title),pt.createElement(pn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,f)=>{let C=r.includes(c.id);return pt.createElement(dn,{key:`select-item-${f}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(w=>w!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:f===n.options.length-1,className:a("selectListSelectItem",i)},pt.createElement(cn,{className:a("selectListItemImage",i)},c.imageUri&&pt.createElement(mn,{src:c.imageUri,alt:`select-icon-${f}`}),pt.createElement(un,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),pt.createElement(at,{appearance:i,value:C,primaryColor:i.theme.colorPrimary}))}))};import ze,{useEffect as gn,useState as Ko}from"react";var Vp=({children:e,id:t,shouldWrap:o=!1})=>ze.createElement(ze.Fragment,null,o?ze.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),qo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:f,onDismiss:C,showPagination:w=!1,customFormElements:x,allowBackNavigation:g,validationHandler:A,onFormDataChange:T,showFooter:k,prefillData:P,updateUrlOnPageChange:v,repeatable:u})=>{var be;let S=b(b({},{linkCollection:rn,multiInput:Gi,callToAction:nn,selectList:fn}),i),{primaryCTAClickSideEffects:F,secondaryCTAClickSideEffects:M}=pe(),[O,I]=Ko(!1),[V,W]=Ko({}),[q,X]=Ko(!1),[de,H]=Ko(null),ae=(be=t[o])!=null?be:null,{markStepCompleted:fe,markStepStarted:Te,isLoading:re,updateCustomVariables:Z,markFlowCompleted:he}=J();gn(()=>{Z(n)},[n,re]),gn(()=>{T&&T(V,D(),t[o],o)},[V]);function D(){var $;return{data:($=V[t[o].id])!=null?$:{},stepId:t[o].id,customVariables:n}}function Se(_,$,z){let se=o+1<t.length?t[o+1]:null;return s&&s(_,z,se,V,D()),r?r(_,o,$,se):!0}function xe(_,$){W(z=>{let se={};return se[_.id]=$,b(b({},z),se)})}function Pe(_){return _.selectedStep.imageUri?ze.createElement(Qi,{image:_.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Ae=k&&ze.createElement(tn,{step:t[o],canContinue:O&&!q,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>U(void 0,null,function*(){if(X(!0),A){let z=yield A(t[o],o,t[o+1],V,D());if(z!==!0){H(typeof z=="string"?z:null),X(!1);return}else H(null)}let _=b({},D());yield fe(p,t[o].id,_),o+1<t.length&&!g&&(yield Te(p,t[o+1].id));let $=Se(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),C&&C(),l&&$&&(c&&c(!1),f(!1)),yield he(p),u&&(yield Te(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(se=>{se.startsWith(Br)&&window.localStorage.removeItem(se)}))),F(t[o]),X(!1),typeof window!="undefined"&&!g&&v&&o+1<t.length){let z=new URL(window.location.href);z.searchParams.set("p",t[o+1].id),window.history.pushState({},"",z.toString())}}),onSecondaryClick:()=>{Se(t[o],"secondary",o),M(t[o])},onBack:()=>U(void 0,null,function*(){o-1>=0&&(X(!0),yield Te(p,t[o-1].id),X(!1))}),steps:t,allowBackNavigation:g,errorMessage:de,isSaving:q});return ze.createElement(ze.Fragment,null,ze.createElement(Ji,{className:a("formContainer",e)},ze.createElement(Vp,{id:o,shouldWrap:d==="large-modal"},ze.createElement(Xi,{key:ae.id,type:d,className:a("formContent",e)},t.map(_=>{let $=S[_.type];return ae.id!==_.id?null:typeof $!="function"?$:ze.createElement($,{key:_.id,stepData:_,canContinue:O,setCanContinue:I,onSaveData:z=>{xe(_,z)},appearance:e,customFormElements:x,flowId:p,prefillData:P})}),w&&ze.createElement(on,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Ae)),d=="large-modal"&&ze.createElement(Pe,{selectedStep:t[o]})))};import yo from"react";import{createGlobalStyle as jp}from"styled-components";var Gp=jp`
|
|
692
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${fo}${t}.${fo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${No(s)}: ${p};`).join(" ")} }`:`${No(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ne({appearance:e}){if(!e||!e.styleOverrides)return yo.createElement(yo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?yo.createElement(yo.Fragment,null):yo.createElement(Gp,{inlineStyles:t})}import{useEffect as Kp,useState as qp}from"react";function je(e){let[t,o]=qp(!1),{markStepStarted:i,isLoading:n,getFlowStatus:r,getFlowSteps:s,getCurrentStepIndex:p,targetingLogicShouldHideFlow:d,getFlow:l}=J(),m=s(e);function c(){return U(this,null,function*(){!t&&!n&&r(e)===Ue&&d(l(e))===!1&&(o(!0),yield i(e,m[p(e)].id))})}return Kp(()=>{c()},[n,e]),{}}var xn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:C=!1,modalPosition:w="center",repeatable:x=!1,onDismiss:g,showPagination:A=!1,allowBackNavigation:T=!1,validationHandler:k,showFrigadeBranding:P=!1,onFormDataChange:v,showFooter:u=!0,prefillData:L={},updateUrlOnPageChange:S=!1})=>{let{getFlow:F,getFlowSteps:M,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:q,markFlowNotStarted:X,markStepStarted:de}=J(),H=W(e),{mergeAppearanceWithDefault:ae}=ee(),[fe,Te]=Yp(null),{setOpenFlowState:re,getOpenFlowState:Z,hasOpenModals:he}=Oe();je(e);let D=M(e);d=ae(d);let[Se,xe]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),_=>re(e,_)],Pe=typeof window!="undefined"?window.location.hash:null;if(hn(()=>{var _;if(D&&D.length>0&&T){let $=typeof window!="undefined"&&((_=window==null?void 0:window.location)!=null&&_.hash)?window.location.hash.replace("#",""):"";if(D&&(D==null?void 0:D.length)>0){let z=-1;if($){let se=$;z=D.findIndex(ce=>ce.id===se),fe===$&&(z=-1)}z!==-1&&(Te($),de(e,D[z].id))}}},[Pe]),hn(()=>{!O&&D&&D.length&&typeof window!="undefined"&&T&&(Te(D[H].id),window.location.hash=D[H].id)},[O,H,D]),O)return null;let Ae=F(e);if(!Ae||I(Ae)||!D||i!==void 0&&i===!1||V(e)===R&&l&&!x||(o=="modal"||o=="corner-modal")&&he(e))return null;let be=()=>{xe(!1),g&&g(),C===!0&&q(e)};if(w=="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",et.createElement(Qe,{appearance:d,onClose:be,visible:Se,style:_,dismissible:f,showFrigadeBranding:P},et.createElement(ne,{appearance:d}),et.createElement(qo,{appearance:d,steps:D,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:g,showPagination:A,customFormElements:s,allowBackNavigation:T,validationHandler:k,onFormDataChange:v,showFooter:u,prefillData:L,updateUrlOnPageChange:S,repeatable:x}))}return o==="modal"&&w!=="center"?et.createElement(Do,{appearance:d,onClose:be,visible:Se,modalPosition:w},et.createElement(ne,{appearance:d}),et.createElement(qo,{appearance:d,steps:D,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:g,showPagination:A,customFormElements:s,allowBackNavigation:T,validationHandler:k,onFormDataChange:v,showFooter:u,prefillData:L,updateUrlOnPageChange:S,repeatable:x})):et.createElement(et.Fragment,null,et.createElement(ne,{appearance:d}),et.createElement(qo,{appearance:d,steps:D,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:g,showPagination:A,customFormElements:s,allowBackNavigation:T,validationHandler:k,onFormDataChange:v,showFooter:u,prefillData:L,updateUrlOnPageChange:S,repeatable:x}))},Cn=xn;import{useCallback as Ir,useContext as Jp,useEffect as Xp}from"react";function Lr(){let{organizationId:e,userId:t,setOrganizationId:o}=Jp(Y),{mutateUserFlowState:i}=We(),{config:n,apiUrl:r}=Xe(),s=Ht(),{verifySDKInitiated:p}=Vt();function d(f,C){return`frigade-user-group-registered-${f}-${C}`}Xp(()=>{if(t&&e){if(t.startsWith(jt))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Ir(f=>U(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 C={foreignUserId:t,foreignUserGroupId:e,properties:f};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),m=Ir((f,C)=>U(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 x={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:C}]};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}),[e,t,n,i]),c=Ir((f,C)=>U(this,null,function*(){if(p())if(C){let w=d(t,f);localStorage.setItem(w,"true"),o(f);let x={foreignUserId:t,foreignUserGroupId:f,properties:C};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var yn="frigade-xFrigade_guestUserId",bo="frigade-xFrigade_userId",Sn=({})=>{let{setFlowResponses:e}=mo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=We(),{userId:n,setUserId:r}=uo(),[s,p]=So(n),{getFlowStatus:d}=J(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Qp(Y),[C,w]=So([]),[x,g]=So([]),{organizationId:A}=Lr(),[T,k]=So(A),[P,v]=So(!1);Qt(()=>{if(!o&&t)for(let F=0;F<t.length;F++){let M=t[F],O=l.find(I=>I.slug===(M==null?void 0:M.flowId));if(O&&M&&M.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!x.includes(O.slug)){setTimeout(()=>{u(M.flowId)},500);break}}},[o,t]),Qt(()=>{f.length>0&&i()},[f]),Qt(()=>{P||(v(!0),i())},[o,v]);function u(F){let M=l.find(O=>O.slug===F);M&&M.triggerType==="AUTOMATIC"&&!x.includes(M.slug)&&(g([...x,M.slug]),w([M]))}function L(){if(!n){let F=localStorage.getItem(bo);if(F){r(F);return}let M=localStorage.getItem(yn);if(M){r(M);return}c(!0);let O=jt+Zp();try{localStorage.setItem(yn,O)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}r(I=>I||O)}}Qt(()=>{try{if(l){let F=[];l.forEach(M=>{if(M.data){let O=M.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(I=>{let V=I.replace('"imageUri":"',"").replace('"',"");if(F.includes(V))return;let W=new Image;W.src=V,F.push(V)})}})}}catch(F){}},[l]),Qt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(jt))try{localStorage.setItem(bo,n)}catch(F){console.log("Failed to save user id locally: Local storage available",F)}n===null&&setTimeout(()=>{n===null&&L()},50)},[n,l,m]),Qt(()=>{A!=T&&(k(A),e([]),i())},[A,T,k]);function S(){return At.createElement(At.Fragment,null,C.map(F=>d(F.slug)!==Ue?null:At.createElement("span",{key:F.slug},At.createElement(Cn,{flowId:F.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return At.createElement(At.Fragment,null,At.createElement(S,null))};import{ErrorBoundary as Fd}from"react-error-boundary";var bn={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 Rp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(bn[o]){let n=bn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function ed(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function wn(e){let{theme:t,styleOverrides:o}=e,i=Rp(t),n=ed(o);return{overrides:i,css:n}}import fd from"styled-components";import{compose as gd,variant as Fn}from"styled-system";import Tn from"react";import td,{ThemeProvider as od,useTheme as rd}from"styled-components";import{border as id,color as nd,compose as sd,get as ld,shadow as ad,space as pd,system as dd,typography as cd}from"styled-system";var md={width:{property:"width",scale:"sizes",transform:(e,t)=>ld(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},ud=td("div")(({css:e})=>e,sd(id,nd,ad,pd,cd,dd(md))),wo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=rd(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Tn.createElement(ud,b(b({as:e},p),i),t);if(o!==void 0){let l=Ce(s,o);return Tn.createElement(od,{theme:l},d())}return d()};var To={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"}},hd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},kn=fd(wo)(()=>({whiteSpace:"nowrap"}),gd(Fn({scale:"components.Button",variants:"components.Button"}),Fn({prop:"size",variants:hd})));import xd from"styled-components";import{variant as Cd,system as yd}from"styled-system";var Yo={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 Pn=xd(wo)(Cd({scale:"components.Text",variants:"components.Text"}),yd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var vn=4,Bn="px",Sd=20,bd=Object.fromEntries(Array.from(Array(Sd+1),(e,t)=>t===0?[.5,`${.5*vn}${Bn}`]:[t,`${t*vn}${Bn}`])),Zt={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"},$r={colors:j(b({},Zt),{neutral:{foreground:Zt.gray300},primary:{background:Zt.blue500,foreground:Zt.white,inverted:Zt.blue500},negative:{foreground:Zt.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:bd,components:{Button:To,Text:Yo}};var En="https://api.frigade.com",Y=wd({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:lt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:En,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var H,ae,fe,Te,re;let[r,s]=Ge(t||null),[p,d]=Ge(o||null),[l,m]=Ge([]),[c,f]=Ge([]),[C,w]=Ge([]),[x,g]=Ge({}),[A,T]=Ge({}),[k,P]=Ge([]),[v,u]=Ge({}),[L,S]=Ge(!1),[F,M]=Ge(!1),[O,I]=Ge(!q(e)),V=(Z,he)=>{if(he==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},W={theme:b(b({},lt.theme),(ae=(H=i==null?void 0:i.defaultAppearance)==null?void 0:H.theme)!=null?ae:{}),styleOverrides:b(b({},lt.styleOverrides),(Te=(fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.styleOverrides)!=null?Te:{})};function q(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}Jo(()=>{t&&s(t)},[t]),Jo(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(bo)&&window.localStorage.getItem(bo)!==r&&kd()},[r]),Jo(()=>{o&&d(o)},[o]),Jo(()=>{if(q(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let X={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:w,userProperties:x,setUserProperties:g,openFlowStates:A,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:k,setCompletedFlowsToKeepOpenDuringSession:P,customVariables:v,setCustomVariables:u,isNewGuestUser:L,setIsNewGuestUser:S,hasActiveFullPageFlow:F,setHasActiveFullPageFlow:M,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:V,defaultAppearance:W,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:En,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return Ot.createElement(Y.Provider,{value:X},n);let{overrides:de}=wn(W);return Ot.createElement(Fd,{fallback:Ot.createElement(Ot.Fragment,null,n)},Ot.createElement(Y.Provider,{value:X},Ot.createElement(Td,{theme:Ce(W.theme,$r,de!=null?de:{},(re=i==null?void 0:i.theme)!=null?re:{})},n,Ot.createElement(Sn,null))))};import gc from"react";import ye,{useEffect as ir,useState as rl}from"react";import Ye,{useState as jd}from"react";import Lt from"styled-components";import Zo from"react";import Nt from"react";import On from"styled-components";var An=On.span`
|
|
688
693
|
font-weight: 600;
|
|
689
694
|
font-size: 14px;
|
|
690
695
|
font-style: normal;
|
|
@@ -695,8 +700,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
695
700
|
vertical-align: middle;
|
|
696
701
|
margin-left: 32px;
|
|
697
702
|
padding-right: 12px;
|
|
698
|
-
${e=>
|
|
699
|
-
`,
|
|
703
|
+
${e=>ve(e)}
|
|
704
|
+
`,vd=On.div`
|
|
700
705
|
flex-direction: row;
|
|
701
706
|
justify-content: space-between;
|
|
702
707
|
display: flex;
|
|
@@ -704,12 +709,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
704
709
|
padding-bottom: 20px;
|
|
705
710
|
padding-right: 8px;
|
|
706
711
|
width: 100%;
|
|
707
|
-
${e=>
|
|
708
|
-
`,Xo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:
|
|
712
|
+
${e=>ve(e)}
|
|
713
|
+
`,Xo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:p})=>Nt.createElement(Nt.Fragment,null,Nt.createElement(vd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:b({},n)},i==="left"&&e&&Nt.createElement(An,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Nt.createElement(at,{appearance:p,value:t,type:s,primaryColor:r}),i==="right"&&e&&Nt.createElement(An,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Nt.createElement(ne,{appearance:p}));import Fo from"styled-components";var Nn=Fo.div`
|
|
709
714
|
font-weight: 700;
|
|
710
715
|
font-size: 18px;
|
|
711
716
|
line-height: 22px;
|
|
712
|
-
`,In=
|
|
717
|
+
`,In=Fo.p`
|
|
713
718
|
font-weight: 600;
|
|
714
719
|
font-size: 16px;
|
|
715
720
|
line-height: 24px;
|
|
@@ -717,7 +722,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
717
722
|
letter-spacing: 0.32px;
|
|
718
723
|
font-style: normal;
|
|
719
724
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
720
|
-
`,Ln=
|
|
725
|
+
`,Ln=Fo.p`
|
|
721
726
|
font-weight: 400;
|
|
722
727
|
font-size: 14px;
|
|
723
728
|
font-style: normal;
|
|
@@ -726,23 +731,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
726
731
|
letter-spacing: 0.28px;
|
|
727
732
|
margin: 8px 0px 0px 0px;
|
|
728
733
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
729
|
-
`,Qo=
|
|
734
|
+
`,Qo=Fo.div`
|
|
730
735
|
width: 6px;
|
|
731
736
|
position: absolute;
|
|
732
737
|
left: 0;
|
|
733
738
|
height: 100%;
|
|
734
739
|
border-top-right-radius: 4px;
|
|
735
740
|
border-bottom-right-radius: 4px;
|
|
736
|
-
`,$n=
|
|
741
|
+
`,$n=Fo.div`
|
|
737
742
|
flex-direction: row;
|
|
738
743
|
justify-content: flex-start;
|
|
739
744
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
740
745
|
padding-right: 16px;
|
|
741
|
-
`;var Mn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:
|
|
746
|
+
`;var Mn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,d,l,m,c;return Zo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&Zo.createElement(Qo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Zo.createElement($n,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Zo.createElement(Xo,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:s})))};import It from"react";import Mr from"styled-components";import Ro from"styled-components";var uC=Ro.h1`
|
|
742
747
|
display: flex;
|
|
743
748
|
margin: 0;
|
|
744
749
|
font-size: 18px;
|
|
745
|
-
`,
|
|
750
|
+
`,fC=Ro.h2`
|
|
746
751
|
font-size: 15px;
|
|
747
752
|
color: #4d4d4d;
|
|
748
753
|
`,Dn=Ro.div`
|
|
@@ -764,33 +769,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
764
769
|
border-radius: 20px;
|
|
765
770
|
background-color: ${e=>e.theme.colorPrimary};
|
|
766
771
|
opacity: 0.12;
|
|
767
|
-
`;var
|
|
772
|
+
`;var Bd=Mr.div`
|
|
768
773
|
display: flex;
|
|
769
774
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
770
775
|
justify-content: flex-start;
|
|
771
776
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
772
777
|
width: 100%;
|
|
773
778
|
|
|
774
|
-
${e=>
|
|
775
|
-
`,
|
|
779
|
+
${e=>ve(e)}
|
|
780
|
+
`,Ed=Mr.div`
|
|
776
781
|
flex-grow: 1;
|
|
777
782
|
position: relative;
|
|
778
783
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
779
|
-
`,
|
|
784
|
+
`,Ad=Mr.span`
|
|
780
785
|
font-weight: 600;
|
|
781
786
|
font-size: 14px;
|
|
782
787
|
line-height: 18px;
|
|
783
788
|
padding-right: ${e=>e.padding};
|
|
784
789
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
785
|
-
${e=>
|
|
786
|
-
`;var
|
|
790
|
+
${e=>ve(e)}
|
|
791
|
+
`;var _e=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var f;if(t===0)return It.createElement(It.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(f=s==null?void 0:s.theme)==null?void 0:f.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(m="0px"),It.createElement(Bd,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:n},It.createElement(Ad,{className:a("progressBarStepText",s),styleOverrides:j(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:i},c),It.createElement(Ed,{textLocation:i,className:a("progressBar",s)},It.createElement(Dn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:a("progressBarFill",s)}),It.createElement(Un,{className:a("progressBarBackground",s),barHeight:d,appearance:s})))};import ko from"react";import Nd from"styled-components";import tr from"react";import er from"react";var Rt=({stepData:e,appearance:t})=>er.createElement(er.Fragment,null,er.createElement(In,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),er.createElement(Ln,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import Dr from"react";var eo=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Dr.createElement(Vo,{className:a("ctaContainer",t)},Dr.createElement(te,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Dr.createElement(te,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var to=({stepData:e,appearance:t})=>tr.createElement(tr.Fragment,null,tr.createElement(Rt,{stepData:e,appearance:t}),tr.createElement(eo,{stepData:e,appearance:t}));import Od from"react";function Wn(e){return Od.createElement(Re,{appearance:e.appearance,videoUri:e.videoUri})}var Ur="default",Id=Nd.img`
|
|
787
792
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
788
793
|
width: 100%;
|
|
789
794
|
height: auto;
|
|
790
795
|
min-height: 200px;
|
|
791
|
-
`,zn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return
|
|
796
|
+
`,zn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return ko.createElement("div",null,o)}return ko.createElement(Nn,{className:a("checklistStepContent",t)},e.imageUri?ko.createElement(Id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?ko.createElement(Wn,{videoUri:e.videoUri,appearance:t}):null,ko.createElement(to,{stepData:e,appearance:t}))};import He,{useRef as Ld,useState as $d}from"react";import oo from"styled-components";var _n=oo.div`
|
|
792
797
|
display: block;
|
|
793
|
-
|
|
798
|
+
`,Md=oo.div`
|
|
794
799
|
display: flex;
|
|
795
800
|
flex-direction: row;
|
|
796
801
|
flex-wrap: wrap;
|
|
@@ -800,20 +805,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
800
805
|
align-content: center;
|
|
801
806
|
margin-top: 24px;
|
|
802
807
|
margin-bottom: 24px;
|
|
803
|
-
`,
|
|
808
|
+
`,Dd=oo.div`
|
|
804
809
|
display: flex;
|
|
805
810
|
align-items: center;
|
|
806
811
|
justify-content: flex-start;
|
|
807
812
|
flex-direction: column;
|
|
808
813
|
margin-right: 16px;
|
|
809
|
-
`,
|
|
814
|
+
`,Ud=oo.video`
|
|
810
815
|
width: 200px;
|
|
811
816
|
height: 120px;
|
|
812
|
-
`,
|
|
817
|
+
`,Wd=oo.div`
|
|
813
818
|
font-size: 14px;
|
|
814
819
|
line-height: 20px;
|
|
815
820
|
text-align: center;
|
|
816
|
-
`,
|
|
821
|
+
`,zd=oo.div`
|
|
817
822
|
position: absolute;
|
|
818
823
|
width: 200px;
|
|
819
824
|
height: 120px;
|
|
@@ -833,9 +838,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
833
838
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
834
839
|
border-radius: 50%;
|
|
835
840
|
}
|
|
836
|
-
`,Hn="videoCarousel",Vn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return
|
|
841
|
+
`,Hn="videoCarousel",Vn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return He.createElement(_n,null,He.createElement(to,{stepData:e,appearance:t}));function o({video:r}){let s=Ld(),[p,d]=$d(!1);return He.createElement(Dd,null,!p&&He.createElement(zd,{onClick:()=>{d(!0),s.current.play()},appearance:t},He.createElement(jo,null)),He.createElement(Ud,{controls:p,ref:s,play:p,src:r.uri}),He.createElement(Wd,null,r.title))}let i=e.props;return i.videos?He.createElement(_n,null,He.createElement(Rt,{stepData:e,appearance:t}),He.createElement(Md,null,i.videos.map((r,s)=>He.createElement("span",{key:`${r.uri}-${s}`},He.createElement(o,{video:r})))),He.createElement(eo,{stepData:e,appearance:t})):null};import dt from"react";import or from"styled-components";var jn=or.div`
|
|
837
842
|
display: block;
|
|
838
|
-
`,
|
|
843
|
+
`,_d=or.pre`
|
|
839
844
|
display: block;
|
|
840
845
|
background-color: #2a2a2a;
|
|
841
846
|
color: #f8f8f8;
|
|
@@ -851,29 +856,29 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
851
856
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
852
857
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
853
858
|
margin-bottom: 24px;
|
|
854
|
-
`,
|
|
859
|
+
`,Hd=or.div`
|
|
855
860
|
font-size: 15px;
|
|
856
861
|
line-height: 20px;
|
|
857
862
|
margin-bottom: 12px;
|
|
858
863
|
margin-top: 12px;
|
|
859
|
-
`,
|
|
864
|
+
`,Vd=or.div`
|
|
860
865
|
margin-top: 24px;
|
|
861
|
-
`,Gn="codeSnippet",Kn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return
|
|
866
|
+
`,Gn="codeSnippet",Kn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return dt.createElement(jn,null,dt.createElement(to,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?dt.createElement(jn,null,dt.createElement(Rt,{stepData:e,appearance:t}),dt.createElement(Vd,null,o.codeSnippets.map((n,r)=>dt.createElement("div",{key:r},n.title?dt.createElement(Hd,null,n.title):null,n.code?dt.createElement(_d,null,n.code):null))),dt.createElement(eo,{stepData:e,appearance:t})):null};var Gd=Lt.div`
|
|
862
867
|
display: flex;
|
|
863
868
|
flex-direction: row;
|
|
864
869
|
overflow: hidden;
|
|
865
870
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
866
871
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
867
872
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
868
|
-
${e=>
|
|
869
|
-
`,
|
|
873
|
+
${e=>ve(e)}
|
|
874
|
+
`,Kd=Lt.h1`
|
|
870
875
|
font-size: 18px;
|
|
871
876
|
font-style: normal;
|
|
872
877
|
font-weight: 700;
|
|
873
878
|
line-height: 24px;
|
|
874
879
|
letter-spacing: 0.36px;
|
|
875
880
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
876
|
-
`,
|
|
881
|
+
`,qd=Lt.h2`
|
|
877
882
|
font-size: 14px;
|
|
878
883
|
font-style: normal;
|
|
879
884
|
font-weight: 400;
|
|
@@ -881,43 +886,43 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
881
886
|
letter-spacing: 0.28px;
|
|
882
887
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
883
888
|
margin: 10px 0px 0px 0px;
|
|
884
|
-
`,qn=
|
|
889
|
+
`,qn=Lt.div``,Yd=Lt.div`
|
|
885
890
|
list-style: none;
|
|
886
891
|
padding: 0;
|
|
887
892
|
margin: 0;
|
|
888
893
|
cursor: pointer;
|
|
889
894
|
width: 300px;
|
|
890
|
-
`,
|
|
895
|
+
`,Jd=Lt.div`
|
|
891
896
|
width: 1px;
|
|
892
897
|
margin-right: 40px;
|
|
893
898
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
894
|
-
`,
|
|
899
|
+
`,Xd=Lt.div`
|
|
895
900
|
flex: 2;
|
|
896
901
|
padding: 40px 40px 40px 0px;
|
|
897
|
-
`,
|
|
902
|
+
`,Qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=ee();d=m(d);let c={[Ur]:zn,[Hn]:Vn,[Gn]:Kn},f=b(b({},c),p),[C,w]=jd(0),x=n!=null?n:C,g=r!=null?r:w,A=o.filter(k=>k.complete===!0).length,T=()=>{var k;return!((k=o[x])!=null&&k.type)||!f[o[x].type]?f[Ur]({stepData:o[x],appearance:d}):typeof f[o[x].type]!="function"?f[o[x].type]:f[o[x].type]({stepData:o[x],appearance:d})};return Ye.createElement(Gd,{type:l,styleOverrides:i,className:s,appearance:d},Ye.createElement(qn,{style:{flex:1}},Ye.createElement(qn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(Kd,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(qd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(_e,{total:o.length,count:A,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(Yd,{className:a("checklistStepsContainer",d)},o.map((k,P)=>Ye.createElement(Mn,{data:k,index:P,key:P,listLength:o.length,isSelected:P===x,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{g(P)},appearance:d})))),Ye.createElement(Jd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Xd,null,Ye.createElement(T,null)))},Wr=Qd;import G,{useState as oc}from"react";import Yn from"react";import Zd from"styled-components";var Rd=Zd.svg`
|
|
898
903
|
transition: 'transform 0.35s ease-in-out';
|
|
899
|
-
`,
|
|
904
|
+
`,ro=({style:e,className:t})=>Yn.createElement(Rd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Yn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import we from"styled-components";var zr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Jn=we.div`
|
|
900
905
|
max-height: 350px;
|
|
901
906
|
padding-bottom: 40px;
|
|
902
|
-
`,Xn=
|
|
907
|
+
`,Xn=we.div`
|
|
903
908
|
display: flex;
|
|
904
909
|
flex-direction: column;
|
|
905
910
|
margin-top: 20px;
|
|
906
|
-
`,Qn=
|
|
911
|
+
`,Qn=we.h1`
|
|
907
912
|
font-style: normal;
|
|
908
913
|
font-weight: 600;
|
|
909
914
|
font-size: 30px;
|
|
910
915
|
line-height: 36px;
|
|
911
916
|
margin-bottom: 16px;
|
|
912
917
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
913
|
-
`,Zn=
|
|
918
|
+
`,Zn=we.h2`
|
|
914
919
|
font-weight: 400;
|
|
915
920
|
font-size: 16px;
|
|
916
921
|
line-height: 20px;
|
|
917
922
|
margin-bottom: 16px;
|
|
918
923
|
padding-left: 1px;
|
|
919
924
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
920
|
-
`,Rn=
|
|
925
|
+
`,Rn=we.div`
|
|
921
926
|
${e=>E(e)} {
|
|
922
927
|
border: 1px solid #fafafa;
|
|
923
928
|
}
|
|
@@ -927,11 +932,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
927
932
|
flex-direction: column;
|
|
928
933
|
min-height: 240px;
|
|
929
934
|
overflow: hidden;
|
|
930
|
-
`,es=
|
|
935
|
+
`,es=we.div`
|
|
931
936
|
display: flex;
|
|
932
937
|
flex-direction: row;
|
|
933
938
|
justify-content: space-between;
|
|
934
|
-
`,ts=
|
|
939
|
+
`,ts=we.p`
|
|
935
940
|
${e=>E(e)} {
|
|
936
941
|
font-weight: 400;
|
|
937
942
|
font-size: 10px;
|
|
@@ -940,12 +945,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
940
945
|
color: #8c8c8c;
|
|
941
946
|
margin: 20px;
|
|
942
947
|
}
|
|
943
|
-
`,os=
|
|
948
|
+
`,os=we.div`
|
|
944
949
|
display: flex;
|
|
945
950
|
flex-direction: row;
|
|
946
|
-
`,rs=
|
|
951
|
+
`,rs=we.div`
|
|
947
952
|
flex: 1;
|
|
948
|
-
`,is=
|
|
953
|
+
`,is=we.div`
|
|
949
954
|
${e=>E(e)} {
|
|
950
955
|
display: flex;
|
|
951
956
|
justify-content: center;
|
|
@@ -955,7 +960,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
955
960
|
padding-left: 8px;
|
|
956
961
|
padding-right: 8px;
|
|
957
962
|
}
|
|
958
|
-
`,ns=
|
|
963
|
+
`,ns=we.p`
|
|
959
964
|
${e=>E(e)} {
|
|
960
965
|
font-style: normal;
|
|
961
966
|
font-weight: 600;
|
|
@@ -967,7 +972,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
967
972
|
margin-top: 20px;
|
|
968
973
|
margin-bottom: 16px;
|
|
969
974
|
}
|
|
970
|
-
`,ss=
|
|
975
|
+
`,ss=we.p`
|
|
971
976
|
${e=>E(e)} {
|
|
972
977
|
font-weight: 400;
|
|
973
978
|
font-size: 14px;
|
|
@@ -976,14 +981,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
976
981
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
977
982
|
margin-bottom: 8px;
|
|
978
983
|
}
|
|
979
|
-
`,ls=
|
|
984
|
+
`,ls=we.div`
|
|
980
985
|
${e=>E(e)} {
|
|
981
986
|
display: flex;
|
|
982
987
|
flex-direction: row;
|
|
983
988
|
justify-content: center;
|
|
984
989
|
gap: 8px;
|
|
985
990
|
}
|
|
986
|
-
`,as=
|
|
991
|
+
`,as=we.div`
|
|
987
992
|
${e=>E(e)} {
|
|
988
993
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
989
994
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -1003,7 +1008,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1003
1008
|
justify-content: space-between;
|
|
1004
1009
|
position: relative;
|
|
1005
1010
|
cursor: pointer;
|
|
1006
|
-
`,ps=
|
|
1011
|
+
`,ps=we.p`
|
|
1007
1012
|
${e=>E(e)} {
|
|
1008
1013
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1009
1014
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -1012,12 +1017,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1012
1017
|
font-size: 14px;
|
|
1013
1018
|
line-height: 22px;
|
|
1014
1019
|
margin: 0;
|
|
1015
|
-
`,ds=
|
|
1020
|
+
`,ds=we.div`
|
|
1016
1021
|
display: flex;
|
|
1017
1022
|
flex-direction: row;
|
|
1018
1023
|
justify-content: flex-end;
|
|
1019
1024
|
align-content: center;
|
|
1020
|
-
`,cs=
|
|
1025
|
+
`,cs=we.div`
|
|
1021
1026
|
display: flex;
|
|
1022
1027
|
flex: 1;
|
|
1023
1028
|
flex-direction: row;
|
|
@@ -1025,14 +1030,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1025
1030
|
align-content: center;
|
|
1026
1031
|
align-items: center;
|
|
1027
1032
|
margin-right: 20px;
|
|
1028
|
-
`,ms=
|
|
1033
|
+
`,ms=we.div`
|
|
1029
1034
|
display: block;
|
|
1030
1035
|
width: 100%;
|
|
1031
|
-
`;import
|
|
1036
|
+
`;import ec from"styled-components";var us=ec.div`
|
|
1032
1037
|
flex-direction: column;
|
|
1033
1038
|
justify-content: center;
|
|
1034
1039
|
display: flex;
|
|
1035
|
-
`;import
|
|
1040
|
+
`;import mt from"react";import ct from"styled-components";var fs=ct.div`
|
|
1036
1041
|
border: 1px solid #fafafa;
|
|
1037
1042
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1038
1043
|
border-radius: 14px;
|
|
@@ -1040,13 +1045,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1040
1045
|
display: flex;
|
|
1041
1046
|
flex-direction: column;
|
|
1042
1047
|
overflow: hidden;
|
|
1043
|
-
`,gs=
|
|
1048
|
+
`,gs=ct.div`
|
|
1044
1049
|
display: flex;
|
|
1045
1050
|
flex-wrap: wrap;
|
|
1046
1051
|
justify-content: space-between;
|
|
1047
1052
|
overflow: hidden;
|
|
1048
1053
|
row-gap: 10px;
|
|
1049
|
-
`,hs=
|
|
1054
|
+
`,hs=ct.div`
|
|
1050
1055
|
${e=>E(e)} {
|
|
1051
1056
|
color: #595959;
|
|
1052
1057
|
}
|
|
@@ -1056,7 +1061,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1056
1061
|
line-height: 12px;
|
|
1057
1062
|
letter-spacing: 0.09em;
|
|
1058
1063
|
margin-bottom: 12px;
|
|
1059
|
-
`,xs=
|
|
1064
|
+
`,xs=ct.div`
|
|
1060
1065
|
${e=>E(e)} {
|
|
1061
1066
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1062
1067
|
background: #ffffff;
|
|
@@ -1069,7 +1074,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1069
1074
|
|
|
1070
1075
|
max-width: 150px;
|
|
1071
1076
|
min-width: 200px;
|
|
1072
|
-
`,Cs=
|
|
1077
|
+
`,Cs=ct.div`
|
|
1073
1078
|
${e=>E(e)} {
|
|
1074
1079
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1075
1080
|
}
|
|
@@ -1081,13 +1086,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1081
1086
|
justify-content: center;
|
|
1082
1087
|
align-content: center;
|
|
1083
1088
|
align-items: center;
|
|
1084
|
-
`,ys=
|
|
1089
|
+
`,ys=ct.div`
|
|
1085
1090
|
font-weight: 600;
|
|
1086
1091
|
font-size: 20px;
|
|
1087
1092
|
line-height: 24px;
|
|
1088
1093
|
width: 20px;
|
|
1089
1094
|
height: 20px;
|
|
1090
|
-
`,Ss=
|
|
1095
|
+
`,Ss=ct.div`
|
|
1091
1096
|
${e=>E(e)} {
|
|
1092
1097
|
color: #434343;
|
|
1093
1098
|
}
|
|
@@ -1096,20 +1101,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1096
1101
|
line-height: 17px;
|
|
1097
1102
|
margin-top: 12px;
|
|
1098
1103
|
margin-bottom: 8px;
|
|
1099
|
-
`,bs=
|
|
1104
|
+
`,bs=ct.div`
|
|
1100
1105
|
${e=>E(e)} {
|
|
1101
1106
|
color: #8c8c8c;
|
|
1102
1107
|
}
|
|
1103
1108
|
font-weight: 400;
|
|
1104
1109
|
font-size: 12px;
|
|
1105
1110
|
line-height: 14px;
|
|
1106
|
-
`,ws=
|
|
1111
|
+
`,ws=ct.a`
|
|
1107
1112
|
color: ${e=>e.color};
|
|
1108
1113
|
font-size: 12px;
|
|
1109
1114
|
line-height: 14px;
|
|
1110
1115
|
font-weight: 400;
|
|
1111
1116
|
cursor: pointer;
|
|
1112
|
-
`;var
|
|
1117
|
+
`;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=pe();return mt.createElement(fs,{style:t,className:a("guideContainer",n)},mt.createElement(hs,{className:a("guideTitle",n)},o),mt.createElement(gs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var l;return mt.createElement(xs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",n)},p.icon&&mt.createElement(Cs,{className:a("guideIcon",n)},mt.createElement(ys,null,p.icon)),mt.createElement(Ss,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:me(p.title)}),mt.createElement(bs,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:me(p.subtitle)}),mt.createElement(ws,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle))})))},Po=tc;var rc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let C=({stepData:u,handleSecondaryCTAClick:L,handleCTAClick:S})=>u?G.createElement(is,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},G.createElement(ns,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:me(u.title)}),G.createElement(ss,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:me(u.subtitle)}),G.createElement(ls,{className:a("checklistCTAContainer",l)},u.secondaryButtonTitle&&G.createElement(te,{title:u.secondaryButtonTitle,onClick:L,appearance:l,secondary:!0}),G.createElement(te,{title:u.primaryButtonTitle,onClick:S,appearance:l}))):G.createElement(G.Fragment,null),x=b(b({},{default:u=>{var M;if((M=e[T])!=null&&M.StepContent){let O=e[T].StepContent;return G.createElement("div",null,O)}let L=e[T];return G.createElement(C,{stepData:u,handleCTAClick:()=>{L.handlePrimaryButtonClick&&L.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{L.handleSecondaryButtonClick&&L.handleSecondaryButtonClick()}})}}),d),[g,A]=oc(0),T=s!=null?s:g,k=p!=null?p:A,P=()=>{var u;return e?!((u=e[T])!=null&&u.type)||!x[e[T].type]?x.default(e[T]):typeof x[e[T].type]!="function"?x[e[T].type]:x[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):G.createElement(G.Fragment,null)},v=e.filter(u=>u.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(zr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=zr),G.createElement(Qe,{onClose:r,visible:n,appearance:l},G.createElement(ms,null,G.createElement(Xn,null,G.createElement(Qn,{appearance:l,className:a("checklistTitle",l)},t),G.createElement(Zn,{appearance:l,className:a("checklistSubtitle",l)},o)),G.createElement(Jn,null,e&&e.length>0&&G.createElement(Rn,{className:a("stepsContainer",l)},G.createElement(es,null,G.createElement("div",{style:{flex:3}},G.createElement(ts,{className:a("stepsTitle",l)},i)),G.createElement(cs,null,G.createElement(_e,{style:{width:"100%"},count:v,total:e.length,appearance:l}))),G.createElement(os,null,G.createElement(rs,{className:a("checklistStepListContainer",l),appearance:l},e.map((u,L)=>{var F;let S=T===L;return G.createElement(as,{selected:S,className:a(`checklistStepListItem${S?"Selected":""}`,l),key:`checklist-guide-step-${(F=u.id)!=null?F:L}`,disabled:u.blocked,onClick:()=>{u.blocked||k(L)},title:u.blocked?"Finish remaining steps to continue":void 0},S&&G.createElement(Qo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(ps,{selected:S,className:a(`checklistStepListStepName${S?"Selected":""}`,l)},u.stepName),G.createElement(ds,null,G.createElement(at,{value:u.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:u.progress,appearance:l}),G.createElement(us,null,G.createElement(ro,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),G.createElement(P,null))),m&&m.length>0&&G.createElement(Po,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:u=>(f&&f(u),!0)}))))):G.createElement(G.Fragment,null)},_r=rc;import Me,{useEffect as rr,useState as ic}from"react";import ke from"react";import ut from"styled-components";var Ts=ut.div`
|
|
1113
1118
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1114
1119
|
border: 1px solid;
|
|
1115
1120
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1121,19 +1126,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1121
1126
|
display: flex;
|
|
1122
1127
|
flex-direction: column;
|
|
1123
1128
|
transition: max-height 0.25s;
|
|
1124
|
-
`,Fs=
|
|
1129
|
+
`,Fs=ut.div`
|
|
1125
1130
|
display: flex;
|
|
1126
1131
|
margin-bottom: 20px;
|
|
1127
|
-
`,ks=
|
|
1132
|
+
`,ks=ut.img`
|
|
1128
1133
|
border-radius: 4px;
|
|
1129
1134
|
max-height: 260px;
|
|
1130
1135
|
min-height: 200px;
|
|
1131
|
-
`,Ps=
|
|
1136
|
+
`,Ps=ut.div`
|
|
1132
1137
|
display: flex;
|
|
1133
1138
|
flex-direction: row;
|
|
1134
1139
|
justify-content: space-between;
|
|
1135
1140
|
align-items: center;
|
|
1136
|
-
`,vs=
|
|
1141
|
+
`,vs=ut.p`
|
|
1137
1142
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1138
1143
|
font-style: normal;
|
|
1139
1144
|
font-weight: 500;
|
|
@@ -1144,23 +1149,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1144
1149
|
:hover {
|
|
1145
1150
|
opacity: 0.8;
|
|
1146
1151
|
}
|
|
1147
|
-
`,Bs=
|
|
1152
|
+
`,Bs=ut.div`
|
|
1148
1153
|
cursor: pointer;
|
|
1149
1154
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1150
1155
|
:hover {
|
|
1151
1156
|
opacity: 0.8;
|
|
1152
1157
|
}
|
|
1153
|
-
`,
|
|
1158
|
+
`,d0=ut.div``,Es=ut.p`
|
|
1154
1159
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1155
1160
|
font-weight: 400;
|
|
1156
1161
|
font-size: 14px;
|
|
1157
1162
|
line-height: 22px;
|
|
1158
|
-
`,As=
|
|
1163
|
+
`,As=ut.div`
|
|
1159
1164
|
display: flex;
|
|
1160
1165
|
flex-direction: row;
|
|
1161
1166
|
justify-content: flex-start;
|
|
1162
1167
|
align-items: center;
|
|
1163
|
-
`;var Os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:
|
|
1168
|
+
`;var Os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,f;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 l(){var C;return ke.createElement(ke.Fragment,null,e.imageUri||e.videoUri?ke.createElement(Fs,{className:a("stepMediaContainer",r)},e.imageUri?ke.createElement(ks,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ke.createElement(Re,{appearance:r,videoUri:e.videoUri}):null):null,ke.createElement(Es,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:me(e.subtitle)}),ke.createElement(Vo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?ke.createElement(te,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,ke.createElement(te,{title:(C=e.primaryButtonTitle)!=null?C:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!s)return null;let C=s[e.type];return C?typeof C!="function"?C:C(e,r):null}return ke.createElement(Ts,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},ke.createElement(Ps,{className:a("stepHeader",r)},ke.createElement(As,null,ke.createElement(Xo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),ke.createElement(vs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:me(e.title),onClick:()=>o()})),ke.createElement(Bs,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},ke.createElement(ro,{style:j(b({},p),{transition:"transform 0.2s ease-in-out"})}))),ke.createElement("div",{key:e.id,style:b({},d)},(f=m())!=null?f:l()))};import io from"styled-components";var F0=io.div`
|
|
1164
1169
|
background: #ffffff;
|
|
1165
1170
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1166
1171
|
border-radius: 6px;
|
|
@@ -1174,26 +1179,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1174
1179
|
|
|
1175
1180
|
max-width: 800px;
|
|
1176
1181
|
min-width: 350px;
|
|
1177
|
-
`,Ns=
|
|
1182
|
+
`,Ns=io.div`
|
|
1178
1183
|
display: flex;
|
|
1179
1184
|
flex-direction: column;
|
|
1180
|
-
`,Is=
|
|
1185
|
+
`,Is=io.h1`
|
|
1181
1186
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1182
1187
|
font-style: normal;
|
|
1183
1188
|
font-weight: 700;
|
|
1184
1189
|
font-size: 20px;
|
|
1185
1190
|
line-height: 24px;
|
|
1186
1191
|
margin-bottom: 8px;
|
|
1187
|
-
`,Ls=
|
|
1192
|
+
`,Ls=io.h2`
|
|
1188
1193
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1189
1194
|
font-weight: 400;
|
|
1190
1195
|
font-size: 14px;
|
|
1191
1196
|
line-height: 23px;
|
|
1192
1197
|
margin: 2px 0 0 0;
|
|
1193
|
-
`,$s=
|
|
1198
|
+
`,$s=io.div`
|
|
1194
1199
|
display: block;
|
|
1195
1200
|
width: 100%;
|
|
1196
|
-
`,Ms=
|
|
1201
|
+
`,Ms=io.div`
|
|
1197
1202
|
display: flex;
|
|
1198
1203
|
width: 100%;
|
|
1199
1204
|
flex-direction: column;
|
|
@@ -1201,17 +1206,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1201
1206
|
padding: 24px;
|
|
1202
1207
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1203
1208
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1204
|
-
`;var
|
|
1209
|
+
`;var nc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:f,customStepTypes:C,style:w})=>{let x=o.filter(v=>v.complete).length,[g,A]=ic(Array(o.length).fill(!0));rr(()=>{let v=[...g];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){v[u]=!1;break}A(v)}},[]),rr(()=>{r&&T(d)},[d]),rr(()=>{p&&g[d]&&T(d)},[d]),rr(()=>{},[o]);let T=v=>{let u=[...g];if(s)for(let L=0;L<g.length;++L)L!=v&&u[v]&&(u[L]=!0);u[v]=!g[v],A(u)};if(!n&&c=="modal")return Me.createElement(Me.Fragment,null);let k=Me.createElement(Me.Fragment,null,Me.createElement(Ns,null,Me.createElement(Is,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:me(e)}),Me.createElement(Ls,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:me(t)})),Me.createElement(_e,{display:"percent",count:x,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),P=Me.createElement($s,{className:Fe(a("checklistContainer",m),f)},o.map((v,u)=>{var S;let L=g[u];return Me.createElement(Os,{appearance:m,stepData:v,collapsed:L,key:`modal-checklist-${(S=v.id)!=null?S:u}`,onClick:()=>{d==u?T(u):l(u)},onPrimaryButtonClick:()=>{p&&u<o.length-1&&l(u+1),v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()},customStepTypes:C})}));return c==="inline"?Me.createElement(Ms,{appearance:m,className:Fe(a("checklistInlineContainer",m),f),style:w},k,P):Me.createElement(Me.Fragment,null,Me.createElement(Qe,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:k},P))},Hr=nc;import ue,{useEffect as Vr,useRef as uc,useState as $t}from"react";import{useEffect as sc,useState as lc}from"react";var Ds=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=lc(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return sc(()=>{s()},[]),o};import no from"react";import ge,{css as Us,keyframes as Ws}from"styled-components";var zs=Us`
|
|
1205
1210
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1206
|
-
`,
|
|
1211
|
+
`,ac=Us`
|
|
1207
1212
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1208
|
-
`,
|
|
1213
|
+
`,pc=Ws`
|
|
1209
1214
|
from {
|
|
1210
1215
|
opacity: 0;
|
|
1211
1216
|
} to {
|
|
1212
1217
|
opacity: 1;
|
|
1213
1218
|
}
|
|
1214
|
-
`,
|
|
1219
|
+
`,dc=Ws`
|
|
1215
1220
|
from {
|
|
1216
1221
|
opacity: 1;
|
|
1217
1222
|
} to {
|
|
@@ -1241,7 +1246,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1241
1246
|
scroll-snap-align: center;
|
|
1242
1247
|
scroll-snap-stop: always;
|
|
1243
1248
|
`,Vs=ge.div`
|
|
1244
|
-
animation: ${e=>e.reversed?pc
|
|
1249
|
+
animation: ${e=>e.reversed?dc:pc} 0.25s ease-out;
|
|
1245
1250
|
background: linear-gradient(
|
|
1246
1251
|
to right,
|
|
1247
1252
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1285,16 +1290,16 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1285
1290
|
width: 40px;
|
|
1286
1291
|
`,Ys=ge(Gs)`
|
|
1287
1292
|
${e=>E(e)} {
|
|
1288
|
-
${
|
|
1293
|
+
${ac}
|
|
1289
1294
|
|
|
1290
1295
|
background: ${({theme:e})=>e.colorBackground};
|
|
1291
1296
|
}
|
|
1292
|
-
`,
|
|
1297
|
+
`,_0=ge.div`
|
|
1293
1298
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1294
1299
|
display: flex;
|
|
1295
1300
|
flex-flow: row nowrap;
|
|
1296
1301
|
align-items: center;
|
|
1297
|
-
`,
|
|
1302
|
+
`,H0=ge.div`
|
|
1298
1303
|
white-space: nowrap;
|
|
1299
1304
|
`,Js=ge.div`
|
|
1300
1305
|
background: #d8fed8;
|
|
@@ -1302,30 +1307,30 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1302
1307
|
float: right;
|
|
1303
1308
|
margin-bottom: 12px;
|
|
1304
1309
|
padding: 4px 10px;
|
|
1305
|
-
`,
|
|
1310
|
+
`,cc=ge.p`
|
|
1306
1311
|
font-weight: bold;
|
|
1307
1312
|
font-size: 18px;
|
|
1308
1313
|
line-height: 22px;
|
|
1309
1314
|
letter-spacing: calc(18px * -0.01);
|
|
1310
1315
|
margin: 0;
|
|
1311
|
-
`,Xs=ge(
|
|
1316
|
+
`,Xs=ge(cc)`
|
|
1312
1317
|
margin-bottom: 4px;
|
|
1313
1318
|
`,Qs=ge.div`
|
|
1314
1319
|
display: flex;
|
|
1315
1320
|
flex-flow: row nowrap;
|
|
1316
1321
|
align-items: center;
|
|
1317
1322
|
min-width: 50%;
|
|
1318
|
-
`,
|
|
1323
|
+
`,mc=ge.p`
|
|
1319
1324
|
font-weight: bold;
|
|
1320
1325
|
font-size: 16px;
|
|
1321
1326
|
line-height: 20px;
|
|
1322
1327
|
letter-spacing: calc(16px * -0.01);
|
|
1323
1328
|
margin: 0;
|
|
1324
|
-
`,Zs=ge(
|
|
1329
|
+
`,Zs=ge(mc)`
|
|
1325
1330
|
margin-bottom: 4px;
|
|
1326
1331
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1327
1332
|
`}
|
|
1328
|
-
`,
|
|
1333
|
+
`,wt=ge.p`
|
|
1329
1334
|
color: ${({theme:e})=>e.colorText};
|
|
1330
1335
|
font-weight: normal;
|
|
1331
1336
|
font-size: 14px;
|
|
@@ -1337,45 +1342,45 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1337
1342
|
font-size: 12px;
|
|
1338
1343
|
line-height: 16px;
|
|
1339
1344
|
margin: 0;
|
|
1340
|
-
`;
|
|
1345
|
+
`;wt.Loud=ge(wt)`
|
|
1341
1346
|
font-weight: 600;
|
|
1342
|
-
`;
|
|
1347
|
+
`;wt.Quiet=ge(wt)`
|
|
1343
1348
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1344
1349
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1345
1350
|
`}
|
|
1346
|
-
`;var el=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ee(),{primaryCTAClickSideEffects:n}=pe();o=i(o);let{imageUri:r=null,subtitle:
|
|
1351
|
+
`;var el=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ee(),{primaryCTAClickSideEffects:n}=pe();o=i(o);let{imageUri:r=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return no.createElement(Ks,{className:a("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&no.createElement(qs,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||l?.4:1}}),d&&no.createElement(Js,{className:a("carouselCompletedPill",o)},no.createElement(Rs,{style:{color:"#108E0B"}},"Complete")),p&&no.createElement(Zs,{blocked:l,complete:d,className:a("carouselCardTitle",o)},p),s&&no.createElement(wt.Quiet,{blocked:l,complete:d,className:a("carouselCardSubtitle",o)},s))};var fc=()=>ue.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ue.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ue.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ue.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),tl=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=$t(!1),[r,s]=$t(!1);Vr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ue.createElement(Vs,{style:d,reversed:r,onAnimationEnd:r?p:null},ue.createElement(js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ue.createElement(fc,null))):null},ol=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=uc(null),[r,s]=$t(!1),[p,d]=$t(!1),[l,m]=$t(null),[c,f]=$t([]),[C,w]=$t(0),{isSmall:x}=Ds(),g=x?1:3,{getFlowMetadata:A,getFlowSteps:T,getNumberOfStepsCompleted:k,updateCustomVariables:P,isLoading:v}=J();Vr(()=>{P(o)},[o,v]),Vr(()=>{if(v)return;let O=A(e),I=k(e),V=T(e);m(O),O.data!==null&&(f(V.sort((W,q)=>Number(W.complete)-Number(q.complete))),d(V.length>g),w(I))},[v]);let u=[];for(let O=0;O<c.length;O+=g)u.push(c.slice(O,O+g));let L=O=>{let I=O.target,V=I.scrollWidth-I.clientWidth,W=Math.ceil(I.scrollLeft);W>0&&r===!1&&s(!0),W===0&&r===!0&&s(!1),W<V&&p===!1&&d(!0),W===V&&p===!0&&d(!1)},S=(O=!0)=>{let I=O?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*I,behavior:"smooth"})},F=null,M=O=>{F!==null?clearTimeout(F):L(O),F=setTimeout(()=>{L(O)},16)};return v?null:ue.createElement(Ys,{className:Fe(a("carouselContainer",t),i)},ue.createElement("div",{style:{display:"flex",justifyContent:x?"center":"space-between",marginBottom:20,flexWrap:x?"wrap":"nowrap",gap:x?16:20}},ue.createElement("div",null,ue.createElement(Xs,{className:a("carouselTitle",t)},l==null?void 0:l.title),ue.createElement(wt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ue.createElement(Qs,{className:a("progressWrapper",t)},ue.createElement(_e,{count:C,total:c.length,appearance:t}))),ue.createElement("div",{style:{position:"relative"}},ue.createElement(tl,{show:r,onClick:()=>S(!1)}),ue.createElement(tl,{side:"right",show:p,onClick:S}),ue.createElement(_s,{ref:n,onScroll:M},u.map((O,I)=>ue.createElement(Hs,{key:I,style:{flex:`0 0 calc(100% - ${c.length>g?36:0}px)`}},O.map((V,W)=>ue.createElement(el,{key:W,stepData:V,style:{flex:c.length>g?`0 1 calc(100% / ${g} - 16px * 2 / ${g})`:1},appearance:t})))))),ue.createElement(ne,{appearance:t}))};var jr=P=>{var v=P,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:f,hideOnFlowCompletion:C,setVisible:w,customStepTypes:x,checklistStyle:g="default",autoExpandFirstIncompleteStep:A,autoExpandNextStep:T}=v,k=Le(v,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:L,markStepCompleted:S,getStepStatus:F,getNumberOfStepsCompleted:M,isLoading:O,targetingLogicShouldHideFlow:I,updateCustomVariables:V,getFlowMetadata:W,isStepBlocked:q,getFlowStatus:X,hasActiveFullPageFlow:de,setHasActiveFullPageFlow:H,markStepStarted:ae,getCurrentStepIndex:fe}=J(),{primaryCTAClickSideEffects:Te,secondaryCTAClickSideEffects:re}=pe(),{getOpenFlowState:Z,setOpenFlowState:he}=Oe(),[D,Se]=rl(n||0),[xe,Pe]=rl(!1),Ae=d===void 0?Z(e):d,be=s==="modal",{mergeAppearanceWithDefault:_}=ee();je(e);let $=L(e),z=fe(e);if(f=_(f),ir(()=>{V(l)},[l,O]),ir(()=>{d!==void 0&&(be&&d===!0?H(!0):be&&d===!1&&H(!1))},[d,w,de]),ir(()=>{!O&&$&&$[D]&&F(e,$[D].id)&&F(e,$[D].id)!==$e&&ae(e,$[D].id)},[D]),ir(()=>{D!==z&&Se(z)},[z]),O)return null;let se=u(e);if(!se||I(se)||!$||C===!0&&X(e)===R)return null;let ce=W(e);if(ce!=null&&ce.title&&(t=ce.title),ce!=null&&ce.subtitle&&(o=ce.subtitle),!xe&&n===void 0&&M(e)>0){let N=$.findIndex(ie=>ie.complete===!1);Se(N>-1?N:$.length-1),Pe(!0)}function rt(){if(D+1>=$.length){be&&he(e,!1);return}q(e,$[D+1].id)||Se(D+1)}function it(N,ie,Q){let De=D+1<$.length?$[D+1]:null;c&&c(N,D,ie,De)===!0&&be&&Je(),m&&m(N,Q,De),!m&&!c&&(N.primaryButtonUri||N.secondaryButtonUri)&&be&&Je()}function Wt(){return $.map((N,ie)=>j(b({},N),{handleSecondaryButtonClick:()=>{rt(),re(N),N.skippable===!0&&S(e,N.id,{skipped:!0}),it(N,"secondary",ie)},handlePrimaryButtonClick:()=>{(!N.completionCriteria&&(N.autoMarkCompleted||N.autoMarkCompleted===void 0)||N.completionCriteria&&N.autoMarkCompleted===!0)&&(S(e,N.id),rt()),it(N,"primary",ie),Te(N),F(e,N.id)===$e&&rt()}}))}function Ke(){return ye.createElement(ne,{appearance:f})}let gt={steps:Wt(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:x,type:s,className:r,autoExpandFirstIncompleteStep:A,autoExpandNextStep:T};function Je(){he(e,!1),p&&p(),w&&w(!1)}function zt(){return ye.createElement(ye.Fragment,null,ye.createElement(Ke,null),ye.createElement(ol,{flowId:e,appearance:f,customVariables:l,className:r}))}function h(){return ye.createElement(ye.Fragment,null,ye.createElement(Ke,null),ye.createElement(Hr,b({visible:Ae,onClose:()=>{Je()},selectedStep:D,setSelectedStep:Se,autoExpandNextStep:!0,appearance:f},gt)))}function y(){var Q;let N=k.guideFlowId,ie;return N&&u(N)&&(ie=L(N)),ye.createElement(ye.Fragment,null,ye.createElement(Ke,null),ye.createElement(_r,b({visible:Ae,stepsTitle:ce.stepsTitle?ce.stepsTitle:"Your quick start guide",onClose:()=>{Je()},selectedStep:D,setSelectedStep:Se,guideData:ie,guideTitle:(Q=k.guideTitle)!=null?Q:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:De=>{it(De,"link",0)},customStepTypes:x},gt)))}function B(){let N=ye.createElement(Wr,b({flowId:e,style:i,selectedStep:D,setSelectedStep:Se,appearance:f,type:s},gt));return be?ye.createElement(Qe,{onClose:()=>{Je()},visible:Ae,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ye.createElement(Ke,null),N):ye.createElement(ye.Fragment,null,ye.createElement(Ke,null),N)}switch(g){case"condensed":return h();case"with-guide":return y();case"default":return B();case"carousel":return zt();default:return B()}};var hc=e=>gc.createElement(jr,b({type:"inline"},e));import Ft,{useEffect as xc}from"react";import tt from"react";import nr from"styled-components";var il=nr.div`
|
|
1347
1352
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1348
1353
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1349
1354
|
padding: 10px 12px 10px 12px;
|
|
1350
1355
|
min-width: 160px;
|
|
1351
1356
|
cursor: pointer;
|
|
1352
1357
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1353
|
-
${e=>
|
|
1358
|
+
${e=>ve(e)}
|
|
1354
1359
|
|
|
1355
1360
|
&:hover {
|
|
1356
1361
|
filter: brightness(.99);
|
|
1357
1362
|
}
|
|
1358
|
-
`,nl=
|
|
1363
|
+
`,nl=nr.div`
|
|
1359
1364
|
display: flex;
|
|
1360
1365
|
flex-direction: row;
|
|
1361
1366
|
justify-content: space-between;
|
|
1362
1367
|
align-items: center;
|
|
1363
1368
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1364
1369
|
flex-grow: 2;
|
|
1365
|
-
`,sl=
|
|
1370
|
+
`,sl=nr.div`
|
|
1366
1371
|
text-overflow: ellipsis;
|
|
1367
1372
|
font-weight: 600;
|
|
1368
1373
|
font-size: 14px;
|
|
1369
1374
|
line-height: 16px;
|
|
1370
1375
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1371
1376
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1372
|
-
`,ll=
|
|
1377
|
+
`,ll=nr.div`
|
|
1373
1378
|
width: 20px;
|
|
1374
1379
|
margin-right: 8px;
|
|
1375
1380
|
display: flex;
|
|
1376
1381
|
height: 100%;
|
|
1377
1382
|
align-items: center;
|
|
1378
|
-
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:
|
|
1383
|
+
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:p="default"})=>tt.createElement(tt.Fragment,null,tt.createElement(ne,{appearance:s}),tt.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Fe(r!=null?r:"",a("progressBadgeContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&tt.createElement(ll,{className:a("progressRingContainer",s)},tt.createElement(Kt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),tt.createElement(nl,{type:p,className:a("badgeTitleContainer",s)},tt.createElement(sl,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&tt.createElement(ro,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&tt.createElement(_e,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Tt from"react";import vo from"styled-components";var pl=vo.div`
|
|
1379
1384
|
display: flex;
|
|
1380
1385
|
flex-direction: row;
|
|
1381
1386
|
width: 100%;
|
|
@@ -1385,25 +1390,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1385
1390
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1386
1391
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1387
1392
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1388
|
-
`,dl=
|
|
1393
|
+
`,dl=vo.div`
|
|
1389
1394
|
${e=>E(e)} {
|
|
1390
1395
|
display: flex;
|
|
1391
1396
|
justify-content: center;
|
|
1392
1397
|
align-items: center;
|
|
1393
1398
|
margin-right: 16px;
|
|
1394
1399
|
}
|
|
1395
|
-
`,cl=
|
|
1400
|
+
`,cl=vo.div`
|
|
1396
1401
|
display: flex;
|
|
1397
1402
|
flex-direction: column;
|
|
1398
1403
|
flex: 1;
|
|
1399
1404
|
margin-top: 0;
|
|
1400
|
-
`,ml=
|
|
1405
|
+
`,ml=vo.div`
|
|
1401
1406
|
display: flex;
|
|
1402
1407
|
flex-direction: column;
|
|
1403
1408
|
justify-content: center;
|
|
1404
1409
|
margin-left: 16px;
|
|
1405
1410
|
min-width: 200px;
|
|
1406
|
-
`,
|
|
1411
|
+
`,jS=vo.div`
|
|
1407
1412
|
display: flex;
|
|
1408
1413
|
justify-content: center;
|
|
1409
1414
|
align-items: flex-end;
|
|
@@ -1412,7 +1417,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1412
1417
|
:hover {
|
|
1413
1418
|
opacity: 0.8;
|
|
1414
1419
|
}
|
|
1415
|
-
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:
|
|
1420
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(pl,{appearance:i,className:Fe(a("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:p},o&&Tt.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),Tt.createElement(cl,null,Tt.createElement(Ie,{size:"small",appearance:i,title:e,subtitle:t})),Tt.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},Tt.createElement(_e,{count:n,total:r,display:"percent",textLocation:"top"}))));var Cc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:C,getNumberOfStepsCompleted:w,isLoading:x,targetingLogicShouldHideFlow:g,updateCustomVariables:A}=J(),{mergeAppearanceWithDefault:T}=ee();l=T(l);let{setOpenFlowState:k,getOpenFlowState:P}=Oe();if(xc(()=>{A(p)},[p,x]),x)return null;let v=c(e);if(!v||g(v)||d===!0&&C(e)===R)return null;let u=f(e),L=w(e);return m==="full-width"?Ft.createElement(Ft.Fragment,null,Ft.createElement(ne,{appearance:l}),Ft.createElement(ul,{title:t,subtitle:o,count:L,total:u.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):Ft.createElement(Ft.Fragment,null,Ft.createElement(ne,{appearance:l}),Ft.createElement(al,{count:L,total:u.length,title:t,style:n,onClick:()=>{k(e,!0),r&&r()},type:m,className:s,appearance:l}))};import yc from"react";var Sc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Le(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:p,getFlowSteps:d}=J(),{mergeAppearanceWithDefault:l}=ee();o=l(o);let m=s(e);if(!m||p(m))return null;let c=d(e);return yc.createElement(Po,b({steps:c,style:t,appearance:o},i))};import Mt,{useContext as Ic,useEffect as Lc}from"react";import K,{useEffect as Bo,useLayoutEffect as hl,useRef as Pc,useState as so}from"react";import Eo from"styled-components";import{useCallback as bc,useEffect as wc,useState as Tc}from"react";var Gr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}};function fl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,n]=Tc(o),r=bc(()=>{e&&n(e.getBoundingClientRect())},[e]);return wc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Fc,useState as kc}from"react";function gl(){let{debug:e}=Fc(Y),[t,o]=kc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var xl=300,Cl=100,vc=500,lo=12,Bc=Eo.div`
|
|
1416
1421
|
width: 100%;
|
|
1417
1422
|
height: 100%;
|
|
1418
1423
|
border-radius: 9999px;
|
|
@@ -1435,25 +1440,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1435
1440
|
opacity: 0;
|
|
1436
1441
|
}
|
|
1437
1442
|
}
|
|
1438
|
-
`,
|
|
1439
|
-
width: ${
|
|
1440
|
-
height: ${
|
|
1443
|
+
`,Ec=Eo.div`
|
|
1444
|
+
width: ${lo}px;
|
|
1445
|
+
height: ${lo}px;
|
|
1441
1446
|
border-radius: 100px;
|
|
1442
1447
|
background-color: ${e=>e.primaryColor};
|
|
1443
1448
|
z-index: 20;
|
|
1444
1449
|
opacity: 1;
|
|
1445
|
-
`,
|
|
1450
|
+
`,Ac=Eo.div`
|
|
1446
1451
|
pointer-events: all;
|
|
1447
|
-
`,yl=
|
|
1452
|
+
`,yl=Eo.div`
|
|
1448
1453
|
display: flex;
|
|
1449
1454
|
align-content: center;
|
|
1450
1455
|
justify-content: center;
|
|
1451
1456
|
align-items: center;
|
|
1452
1457
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1453
|
-
`,
|
|
1454
|
-
width: ${
|
|
1455
|
-
height: ${
|
|
1456
|
-
`,
|
|
1458
|
+
`,Oc=Eo(yl)`
|
|
1459
|
+
width: ${lo+12}px;
|
|
1460
|
+
height: ${lo+12}px;
|
|
1461
|
+
`,Nc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:C,showStepCount:w=!0,completedStepsCount:x=0,showFrigadeBranding:g=!1,cssPosition:A="absolute",onViewTooltip:T})=>{var it,Wt,Ke,gt,Je,zt,h,y,B,N,ie,Q,De,ht,ei,ti,oi,ri,ii;let{logErrorIfDebugMode:k}=gl(),[P,v]=so(),[u,L]=so(new Date),S=Pc(null),[F,M]=so(document.querySelector(e[l].selector)),O=fl(F,u),[I,V]=so(),[W,q]=so(!C),X=(Wt=(it=e[l])==null?void 0:it.props)!=null&&Wt.position?e[l].props.position:A,de=(Je=(gt=(Ke=e[l])==null?void 0:Ke.props)==null?void 0:gt.zIndex)!=null?Je:90,H=(zt=P==null?void 0:P.width)!=null?zt:xl,ae=(h=P==null?void 0:P.height)!=null?h:Cl,[fe,Te]=so(new Date().getTime());s=(N=(B=(y=e[l])==null?void 0:y.props)==null?void 0:B.offset)!=null?N:s;let re=window.location.pathname.split("/").pop();hl(()=>{S.current&&v({width:S.current.clientWidth,height:S.current.clientHeight})},[l,u,X]),Bo(()=>{C||q(!0)},[l]),Bo(()=>{p&&W&&T(l)},[W]);let Z=()=>{let le=document.querySelector(e[l].selector);if(!le){V(void 0),M(null),k(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}I&&I===JSON.stringify(le==null?void 0:le.getBoundingClientRect())||(M(le),L(new Date),le&&V(JSON.stringify(le.getBoundingClientRect())))};if(Bo(()=>{let le=new MutationObserver(Z);return le.observe(document.body,{subtree:!0,childList:!0}),()=>le.disconnect()},[Z]),Bo(()=>{let le=new MutationObserver(Z);return le.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>le.disconnect()},[Z]),Bo(()=>{let le=setInterval(()=>{Z()},10);return()=>clearInterval(le)},[Z]),hl(()=>{setTimeout(()=>{Z()},vc),Z()},[l,re]),F===null||!p)return null;let he=i==="auto"?"right":i,D=Gr(O,he,H,s,X),Se=O.right+H>(window.innerWidth||document.documentElement.clientWidth),xe=O.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Se&&i==="auto"&&(D=Gr(O,"left",H,s,X),he="left"),(Q=(ie=e[l])==null?void 0:ie.props)!=null&&Q.tooltipPosition&&((ht=(De=e[l])==null?void 0:De.props)==null?void 0:ht.tooltipPosition)!=="auto"&&(((ti=(ei=e[l])==null?void 0:ei.props)==null?void 0:ti.tooltipPosition)==="left"||((ri=(oi=e[l])==null?void 0:oi.props)==null?void 0:ri.tooltipPosition)==="right")&&(he=e[l].props.tooltipPosition);let Pe=()=>{let le=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),q(!1),setTimeout(()=>{Z()},30)),x===e.length-1)return o()},xt=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),C&&!e[l].secondaryButtonUri&&q(!1))};return K.createElement(K.Fragment,null,w&&e.length>1&&K.createElement(bi,null,K.createElement(Ti,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&K.createElement(wi,{showStepCount:w,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&K.createElement(te,{title:e[l].secondaryButtonTitle,appearance:c,onClick:xt,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&K.createElement(te,{title:e[l].primaryButtonTitle,appearance:c,onClick:le,withMargin:!1,size:"small"})))},Ae=()=>K.createElement(K.Fragment,null,f&&K.createElement(hi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri},K.createElement(Ne,null)),e[l].imageUri&&K.createElement(xi,{dismissible:f,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&K.createElement(Ci,{dismissible:f,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(Re,{appearance:c,videoUri:e[l].videoUri})),K.createElement(Si,{className:a("tooltipContentContainer",c)},K.createElement(Ie,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),K.createElement(yi,{className:a("tooltipFooter",c)},K.createElement(Pe,null)))),_=b(b({},{default:le=>{var xt;if((xt=e[l])!=null&&xt.StepContent){let ra=e[l].StepContent;return K.createElement("div",null,ra)}return K.createElement(Ae,null)}}),m),$=()=>{var le;return e?!((le=e[l])!=null&&le.type)||!_[e[l].type]?_.default(e[l]):_[e[l].type]({stepData:e[l],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[l].complete===!0||D.x==0&&D.y==0&&new Date().getTime()-fe<100)return null;let z={top:(D==null?void 0:D.y)-lo,left:(ii=he=="left"?O.x+s.x:(D==null?void 0:D.x)-lo)!=null?ii:0,cursor:C?"pointer":"default",position:X},se=()=>{let xt=z.left+(he=="left"?-H:24);return Math.min(Math.max(xt,20),window.innerWidth-H-20)},ce=()=>{if(X==="fixed")return z.top;let le=z.top+ae,xt=20;return le>window.innerHeight-xt?z.top+-ae:z.top},rt=()=>{C&&(L(new Date),q(!W))};return K.createElement(Ac,null,K.createElement(Oc,{style:z,zIndex:de,className:a("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&A!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:X},onClick:rt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:rt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(yl,{style:j(b({},z),{left:se(),top:ce()}),zIndex:de+1,className:a("tooltipContainerWrapper",c)},W&&K.createElement(K.Fragment,null,K.createElement(Io,{ref:S,layoutId:"tooltip-container",style:b({position:"relative",width:"max-content",right:0,top:A!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:xl,zIndex:de+10},K.createElement($,null)),g&&K.createElement(ki,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:de+10},K.createElement(Lo,{appearance:c})))))},Kr=Nc;import{Portal as $c}from"react-portal";var Mc=x=>{var g=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:C="absolute"}=g,w=Le(g,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:A,getFlowSteps:T,isLoading:k,targetingLogicShouldHideFlow:P,markStepCompleted:v,markStepStarted:u,markFlowCompleted:L,updateCustomVariables:S,getCurrentStepIndex:F,getStepStatus:M,isStepBlocked:O,getFlowStatus:I,getNumberOfStepsCompleted:V}=J(),{isLoadingUserFlowStateData:W}=We(),{primaryCTAClickSideEffects:q,secondaryCTAClickSideEffects:X}=pe(),{hasOpenModals:de}=Oe(),H=F(e),{openFlowStates:ae}=Ic(Y),{mergeAppearanceWithDefault:fe}=ee();if(o=fe(o),Lc(()=>{S(t)},[t,k]),W)return null;let Te=A(e);if(!Te||P(Te)||I(e)==R||de())return null;let re=T(e);if(Object.keys(ae).length>0){let $=Object.keys(ae).find(z=>ae[z]===!0);if($!==void 0&&$!==e)return Mt.createElement(Mt.Fragment,null)}function Z($){return U(this,null,function*(){if(yield v(e,$.id),re.map(z=>M(e,z.id)).every(z=>z===$e)){yield L(e);return}!l&&H+1<re.length&&!r&&O(e,re[H+1].id)})}function he($,z,se){let ce=H+1<re.length?re[H+1]:null;n&&n($,H,z,ce),i&&i($,se,ce)}function D(){return re.map($=>j(b({},$),{handleSecondaryButtonClick:()=>U(this,null,function*(){X($),$.skippable===!0&&(yield v(e,$.id,{skipped:!0})),he($,"secondary",H)}),handlePrimaryButtonClick:()=>U(this,null,function*(){(!$.completionCriteria&&($.autoMarkCompleted||$.autoMarkCompleted===void 0)||$.completionCriteria&&$.autoMarkCompleted===!0)&&(yield Z($)),he($,"primary",H),q($)})}))}function Se($){return U(this,null,function*(){s&&s(),m==="complete-flow"?yield L(e):yield v(e,$.id)})}function xe(){c&&c()}function Pe($){return U(this,null,function*(){yield u(e,re[$].id)})}let Ae=!document.querySelector(re[H].selector);function be(){let $=re.findIndex(z=>!!document.querySelector(z.selector));return re.map((z,se)=>Ae&&!r&&se!==$&&f||!r&&se!==H?null:Mt.createElement(Kr,b({key:z.id,appearance:o,steps:D(),selectedStep:se,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Se(z),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:V(e),onComplete:xe,cssPosition:C,onViewTooltip:Pe},w)))}function _(){return Mt.createElement(Mt.Fragment,null,Mt.createElement(ne,{appearance:o}),be())}return C==="static"?_():Mt.createElement($c,null,_())};import Ve,{useEffect as Dc,useRef as Uc,useState as Wc}from"react";import{Portal as zc}from"react-portal";import Dt from"styled-components";var Sl=Dt.button`
|
|
1457
1462
|
${e=>E(e)} {
|
|
1458
1463
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1459
1464
|
|
|
@@ -1471,17 +1476,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1471
1476
|
opacity: 0.8;
|
|
1472
1477
|
}
|
|
1473
1478
|
}
|
|
1474
|
-
`,bl
|
|
1479
|
+
`,bl=Dt.span`
|
|
1475
1480
|
${e=>E(e)} {
|
|
1476
1481
|
font-size: 12px;
|
|
1477
1482
|
display: inline-block;
|
|
1478
1483
|
}
|
|
1479
|
-
`,wl
|
|
1484
|
+
`,wl=Dt.span`
|
|
1480
1485
|
${e=>E(e)} {
|
|
1481
1486
|
font-size: 12px;
|
|
1482
1487
|
display: inline-block;
|
|
1483
1488
|
}
|
|
1484
|
-
`,Tl
|
|
1489
|
+
`,Tl=Dt.div`
|
|
1485
1490
|
position: fixed;
|
|
1486
1491
|
right: 0;
|
|
1487
1492
|
bottom: 0;
|
|
@@ -1491,7 +1496,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1491
1496
|
flex-direction: column;
|
|
1492
1497
|
align-items: flex-end;
|
|
1493
1498
|
z-index: 50;
|
|
1494
|
-
`,Fl
|
|
1499
|
+
`,Fl=Dt.button`
|
|
1495
1500
|
${e=>E(e)} {
|
|
1496
1501
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1497
1502
|
background-color: #ffffff;
|
|
@@ -1507,7 +1512,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1507
1512
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1508
1513
|
border-radius: 45px;
|
|
1509
1514
|
cursor: pointer;
|
|
1510
|
-
`,kl
|
|
1515
|
+
`,kl=Dt.div`
|
|
1511
1516
|
${e=>E(e)} {
|
|
1512
1517
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1513
1518
|
background: #ffffff;
|
|
@@ -1524,7 +1529,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1524
1529
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1525
1530
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1526
1531
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1527
|
-
`,Pl
|
|
1532
|
+
`,Pl=Dt.button`
|
|
1528
1533
|
${e=>E(e)} {
|
|
1529
1534
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1530
1535
|
color: #434343;
|
|
@@ -1541,7 +1546,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1541
1546
|
font-size: 14px;
|
|
1542
1547
|
|
|
1543
1548
|
padding: 8px 12px;
|
|
1544
|
-
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import El from"react";var Al=({style:e,className:t})=>El.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"},El.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
|
|
1549
|
+
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import El from"react";var Al=({style:e,className:t})=>El.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"},El.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 _c=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C}=J(),{primaryCTAClickSideEffects:w}=pe(),x=Uc(null),[g,A]=Wc(!1),{mergeAppearanceWithDefault:T}=ee();s=T(s),Dc(()=>(document.addEventListener("click",k,!1),()=>{document.removeEventListener("click",k,!1)}),[]);let k=S=>{x.current&&!x.current.contains(S.target)&&A(!1)};if(f)return null;let P=p(e);if(!P||C(P))return null;let v=d(e);if(!v||!i)return null;function u(S,F){!S.completionCriteria&&(S.autoMarkCompleted||S.autoMarkCompleted===void 0)&&l(e,S.id),w(S),o&&o(S,F),A(!1)}function L(){return g&&Ve.createElement(kl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},v.map((S,F)=>Ve.createElement(Pl,{className:a("floatingWidgetMenuItem",s),key:F,onClick:()=>u(S,F)},S.title)))}return n=="inline"?Ve.createElement("span",{ref:x},Ve.createElement(Sl,{style:t,onClick:()=>{A(!g)},className:a("supportButton",s)},Ve.createElement(wl,{className:a("supportIconContainer",s)},Ve.createElement(Al,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ve.createElement(bl,{className:a("supportButtonTitle",s)},r)),Ve.createElement(L,null)):Ve.createElement(zc,null,Ve.createElement(Tl,{style:t,ref:x},Ve.createElement(L,null),Ve.createElement(Fl,{onClick:()=>{A(!g)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ve.createElement(Bl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import ot,{useEffect as Hc}from"react";import sr from"styled-components";var Ol=sr.div`
|
|
1545
1550
|
${e=>E(e)} {
|
|
1546
1551
|
display: flex;
|
|
1547
1552
|
flex-direction: column;
|
|
@@ -1556,17 +1561,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1556
1561
|
border-radius: 12px;
|
|
1557
1562
|
position: relative;
|
|
1558
1563
|
}
|
|
1559
|
-
`,Nl=
|
|
1564
|
+
`,Nl=sr.div`
|
|
1560
1565
|
display: flex;
|
|
1561
1566
|
flex-direction: column;
|
|
1562
1567
|
flex: 1;
|
|
1563
|
-
`,Il=
|
|
1568
|
+
`,Il=sr.div`
|
|
1564
1569
|
display: flex;
|
|
1565
1570
|
flex-direction: column;
|
|
1566
1571
|
justify-content: center;
|
|
1567
1572
|
align-items: flex-start;
|
|
1568
1573
|
margin-top: 16px;
|
|
1569
|
-
`,Ll=
|
|
1574
|
+
`,Ll=sr.div`
|
|
1570
1575
|
${e=>E(e)} {
|
|
1571
1576
|
position: absolute;
|
|
1572
1577
|
top: 16px;
|
|
@@ -1577,7 +1582,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1577
1582
|
opacity: 0.8;
|
|
1578
1583
|
}
|
|
1579
1584
|
}
|
|
1580
|
-
`;var
|
|
1585
|
+
`;var Vc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowSteps:w,getFlowStatus:x,getCurrentStepIndex:g}=J(),{primaryCTAClickSideEffects:A}=pe(),{mergeAppearanceWithDefault:T}=ee();if(je(e),n=T(n),Hc(()=>{C(o)},[o,c]),c)return null;let k=d(e);if(!k||f(k)||x(e)===R)return null;let v=w(e)[g(e)];return ot.createElement(ot.Fragment,null,ot.createElement(ne,{appearance:n}),ot.createElement(Ol,{appearance:n,className:Fe(a("embeddedTipContainer",n),r),style:s},(p===!0||v.dismissible)&&ot.createElement(Ll,{onClick:()=>U(void 0,null,function*(){yield l(e),t&&t()}),className:a("embeddedTipDismissButton",n)},ot.createElement(Ne,null)),ot.createElement(Nl,null,ot.createElement(Ie,{size:"small",appearance:n,title:v.title,subtitle:v.subtitle})),v.primaryButtonTitle&&ot.createElement(Il,{className:a("embeddedTipCallToActionContainer",n)},ot.createElement(te,{classPrefix:"embeddedTip",title:v.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>U(void 0,null,function*(){v.handlePrimaryButtonClick(),A(v),!(i&&i(v,g(e),"primary")===!1)&&(yield m(e,v.id),yield l(e))})}))))};import Be,{useEffect as jc}from"react";import ao from"styled-components";var $l=ao.div`
|
|
1581
1586
|
// use the :not annotation
|
|
1582
1587
|
${e=>E(e)} {
|
|
1583
1588
|
display: flex;
|
|
@@ -1589,24 +1594,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1589
1594
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1590
1595
|
border-radius: 12px;
|
|
1591
1596
|
}
|
|
1592
|
-
`,Ml=
|
|
1597
|
+
`,Ml=ao.div`
|
|
1593
1598
|
${e=>E(e)} {
|
|
1594
1599
|
display: flex;
|
|
1595
1600
|
width: 46px;
|
|
1596
1601
|
height: 46px;
|
|
1597
1602
|
}
|
|
1598
|
-
`,Dl=
|
|
1603
|
+
`,Dl=ao.div`
|
|
1599
1604
|
display: flex;
|
|
1600
1605
|
flex-direction: column;
|
|
1601
1606
|
flex: 1;
|
|
1602
1607
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1603
1608
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1604
|
-
`,Ul=
|
|
1609
|
+
`,Ul=ao.div`
|
|
1605
1610
|
display: flex;
|
|
1606
1611
|
flex-direction: column;
|
|
1607
1612
|
justify-content: center;
|
|
1608
1613
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1609
|
-
`,qr=
|
|
1614
|
+
`,qr=ao.div`
|
|
1610
1615
|
display: flex;
|
|
1611
1616
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1612
1617
|
align-items: flex-end;
|
|
@@ -1614,12 +1619,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1614
1619
|
:hover {
|
|
1615
1620
|
opacity: 0.8;
|
|
1616
1621
|
}
|
|
1617
|
-
`,Yr=
|
|
1622
|
+
`,Yr=ao.div`
|
|
1618
1623
|
display: flex;
|
|
1619
1624
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1620
1625
|
align-items: flex-end;
|
|
1621
1626
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1622
|
-
`;import Jr from"react";var Wl=({style:e,className:t})=>Jr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Jr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Jr.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
|
|
1627
|
+
`;import Jr from"react";var Wl=({style:e,className:t})=>Jr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Jr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Jr.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 Gc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowMetadata:w,getFlowStatus:x,getFlowSteps:g,getCurrentStepIndex:A}=J(),{primaryCTAClickSideEffects:T}=pe(),{mergeAppearanceWithDefault:k}=ee();if(je(e),s=k(s),jc(()=>{C(n)},[n,c]),c)return null;let P=l(e);if(!P||f(P)||x(e)===R)return null;let v=g(e),u=v.length>0?v[A(e)]:w(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),Be.createElement(Be.Fragment,null,Be.createElement(ne,{appearance:s}),Be.createElement($l,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&Be.createElement(Ml,{className:a("bannerIconContainer",s)},d||Be.createElement(Wl,null)),p==="square"&&u.dismissible&&Be.createElement(Yr,{type:p,className:a("bannerDismissButtonContainer",s)},Be.createElement(qr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Be.createElement(Ne,null))),Be.createElement(Dl,{type:p},Be.createElement(Ie,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&Be.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",s)},Be.createElement(te,{title:u==null?void 0:u.primaryButtonTitle,appearance:s,onClick:()=>{T(u),r&&r(u,0,"primary")},classPrefix:"banner"})),p!=="square"&&u.dismissible&&Be.createElement(Yr,{type:p,className:a("bannerDismissButtonContainer",s)},Be.createElement(qr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Be.createElement(Ne,null)))))};import oe,{useEffect as Kc}from"react";import{Portal as qc}from"react-portal";import ft from"styled-components";var zl=ft.div`
|
|
1623
1628
|
display: flex;
|
|
1624
1629
|
flex-direction: column;
|
|
1625
1630
|
width: 100%;
|
|
@@ -1641,7 +1646,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1641
1646
|
border-width: 1px;
|
|
1642
1647
|
border-color: ${t=>t.appearance.theme.colorBorder};
|
|
1643
1648
|
border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
|
|
1644
|
-
`,_l=
|
|
1649
|
+
`,_l=ft.button`
|
|
1645
1650
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1646
1651
|
border-radius: 8px;
|
|
1647
1652
|
// If selected make border color primary and text color color priamry
|
|
@@ -1662,33 +1667,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1662
1667
|
display: flex;
|
|
1663
1668
|
justify-content: center;
|
|
1664
1669
|
align-items: center;
|
|
1665
|
-
`,Xr=
|
|
1670
|
+
`,Xr=ft.div`
|
|
1666
1671
|
display: flex;
|
|
1667
1672
|
justify-content: space-between;
|
|
1668
1673
|
margin-top: 16px;
|
|
1669
1674
|
gap: 8px;
|
|
1670
|
-
`,Hl=
|
|
1675
|
+
`,Hl=ft.div`
|
|
1671
1676
|
display: flex;
|
|
1672
1677
|
justify-content: space-between;
|
|
1673
1678
|
margin-top: 8px;
|
|
1674
|
-
`,Qr=
|
|
1679
|
+
`,Qr=ft.div`
|
|
1675
1680
|
font-size: 12px;
|
|
1676
1681
|
line-height: 18px;
|
|
1677
1682
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1678
1683
|
font-style: normal;
|
|
1679
1684
|
font-weight: 400;
|
|
1680
1685
|
letter-spacing: 0.24px;
|
|
1681
|
-
`,Zr=
|
|
1686
|
+
`,Zr=ft.div`
|
|
1682
1687
|
display: flex;
|
|
1683
1688
|
flex-direction: column;
|
|
1684
1689
|
flex: 1;
|
|
1685
|
-
`,
|
|
1690
|
+
`,cw=ft.div`
|
|
1686
1691
|
display: flex;
|
|
1687
1692
|
flex-direction: column;
|
|
1688
1693
|
justify-content: center;
|
|
1689
1694
|
align-items: flex-start;
|
|
1690
1695
|
margin-top: 16px;
|
|
1691
|
-
`,Vl=
|
|
1696
|
+
`,Vl=ft.textarea`
|
|
1692
1697
|
${e=>E(e)} {
|
|
1693
1698
|
margin-top: 16px;
|
|
1694
1699
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1700,7 +1705,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1700
1705
|
height: 100px;
|
|
1701
1706
|
resize: none;
|
|
1702
1707
|
}
|
|
1703
|
-
`,jl=
|
|
1708
|
+
`,jl=ft.div`
|
|
1704
1709
|
${e=>E(e)} {
|
|
1705
1710
|
position: absolute;
|
|
1706
1711
|
top: 16px;
|
|
@@ -1711,7 +1716,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1711
1716
|
opacity: 0.8;
|
|
1712
1717
|
}
|
|
1713
1718
|
}
|
|
1714
|
-
`;var
|
|
1719
|
+
`;var Yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:w,getFlowSteps:x,getFlowStatus:g,getFlowMetadata:A}=J(),{primaryCTAClickSideEffects:T}=pe(),{mergeAppearanceWithDefault:k}=ee(),[P,v]=oe.useState(null),[u,L]=oe.useState(""),S=A(e),{hasOpenModals:F,setKeepCompletedFlowOpenDuringSession:M,shouldKeepCompletedFlowOpenDuringSession:O}=Oe();if(je(e),n=k(n),Kc(()=>{w(o)},[o,f]),f)return null;let I=d(e);if(!I||C(I)||g(e)===R||c(e)===1&&!O(e)||F())return null;let W=x(e)[c(e)];function q(){var H,ae;return oe.createElement(oe.Fragment,null,oe.createElement(Zr,null,oe.createElement(Ie,{size:"large",appearance:n,title:W.title,subtitle:W.subtitle})),oe.createElement(Xr,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(fe=>oe.createElement(_l,{className:a("npsNumberButton",n),selected:P===fe+1,key:fe,onClick:()=>U(this,null,function*(){M(e),v(fe+1),yield m(e,W.id,{score:fe+1})}),appearance:n},fe+1))),oe.createElement(Hl,{appearance:n},oe.createElement(Qr,{appearance:n},(H=S==null?void 0:S.negativeLabel)!=null?H:"Not likely at all"),oe.createElement(Qr,{appearance:n},(ae=S==null?void 0:S.positiveLabel)!=null?ae:"Extremely likely")))}function X(){var H;return oe.createElement(oe.Fragment,null,oe.createElement(Zr,null,oe.createElement(Ie,{appearance:n,title:(H=W.title)!=null?H:"Why did you choose this score?",size:"large"})),oe.createElement(Vl,{appearance:n,value:u,onChange:ae=>{L(ae.target.value)},placeHolder:"Add your optional fedback here..."}),oe.createElement(Xr,{appearance:n,className:a("npsNumberButtonContainer",n)},oe.createElement(te,{size:"large",withMargin:!1,onClick:()=>U(this,null,function*(){yield l(e),i&&i(W,1,"primary")}),appearance:n,title:W.secondaryButtonTitle||"Skip",secondary:!0}),oe.createElement(te,{size:"large",withMargin:!1,onClick:()=>U(this,null,function*(){yield m(e,W.id,{feedbackText:u}),yield l(e),i&&i(W,1,"primary")}),appearance:n,title:W.primaryButtonTitle||"Submit"})))}function de(){return c(e)>=2?null:oe.createElement(oe.Fragment,null,oe.createElement(ne,{appearance:n}),oe.createElement(zl,{appearance:n,className:Fe(a("npsSurveyContainer",n),r),style:s,type:p},oe.createElement(jl,{onClick:()=>U(this,null,function*(){yield l(e),t&&t()}),className:a("npsSurveyDismissButton",n)},oe.createElement(Ne,null)),c(e)==0&&q(),c(e)==1&&X()))}return p==="inline"?de():oe.createElement(qc,null,de())};import Ee,{useEffect as Qc}from"react";import Ut from"styled-components";var Gl=Ut.div`
|
|
1715
1720
|
${e=>E(e)} {
|
|
1716
1721
|
display: flex;
|
|
1717
1722
|
flex-direction: column;
|
|
@@ -1722,21 +1727,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1722
1727
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1723
1728
|
position: relative;
|
|
1724
1729
|
}
|
|
1725
|
-
`,Kl=
|
|
1730
|
+
`,Kl=Ut.div`
|
|
1726
1731
|
display: flex;
|
|
1727
1732
|
flex-direction: column;
|
|
1728
1733
|
flex: 1;
|
|
1729
|
-
`,ql=
|
|
1734
|
+
`,ql=Ut.div`
|
|
1730
1735
|
display: flex;
|
|
1731
1736
|
flex-direction: row;
|
|
1732
1737
|
justify-content: center;
|
|
1733
1738
|
align-items: stretch;
|
|
1734
1739
|
gap: 16px;
|
|
1735
1740
|
margin-top: 8px;
|
|
1736
|
-
`,Yl=
|
|
1741
|
+
`,Yl=Ut.div`
|
|
1737
1742
|
margin-top: 16px;
|
|
1738
1743
|
margin-bottom: 16px;
|
|
1739
|
-
`,Jl=
|
|
1744
|
+
`,Jl=Ut.div`
|
|
1740
1745
|
${e=>E(e)} {
|
|
1741
1746
|
position: absolute;
|
|
1742
1747
|
top: -16px;
|
|
@@ -1747,7 +1752,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1747
1752
|
opacity: 0.8;
|
|
1748
1753
|
}
|
|
1749
1754
|
}
|
|
1750
|
-
`,Xl=
|
|
1755
|
+
`,Xl=Ut.h1`
|
|
1751
1756
|
${e=>E(e)} {
|
|
1752
1757
|
font-style: normal;
|
|
1753
1758
|
justify-content: center;
|
|
@@ -1761,7 +1766,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1761
1766
|
color: ${e=>e.appearance.theme.colorText};
|
|
1762
1767
|
margin-bottom: 8px;
|
|
1763
1768
|
}
|
|
1764
|
-
`,Ql=
|
|
1769
|
+
`,Ql=Ut.h2`
|
|
1765
1770
|
${e=>E(e)} {
|
|
1766
1771
|
font-style: normal;
|
|
1767
1772
|
justify-content: center;
|
|
@@ -1773,10 +1778,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map
|
|
|
1773
1778
|
letter-spacing: 0.28px;
|
|
1774
1779
|
margin-bottom: 8px;
|
|
1775
1780
|
}
|
|
1776
|
-
`;import Zl from"react";import
|
|
1781
|
+
`;import Zl from"react";import Jc from"styled-components";var Xc=Jc.img`
|
|
1777
1782
|
width: 100%;
|
|
1778
1783
|
height: 100%;
|
|
1779
1784
|
min-height: 200px;
|
|
1780
1785
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1781
|
-
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(
|
|
1786
|
+
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:w,getFlowSteps:x,getFlowStatus:g,getCurrentStepIndex:A}=J(),{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:k}=pe(),{mergeAppearanceWithDefault:P}=ee(),{setOpenFlowState:v,getOpenFlowState:u,hasOpenModals:L}=Oe();je(e);let[S,F]=[u(e,!0),X=>v(e,X)];if(n=P(n),Qc(()=>{w(o)},[o,f]),f)return null;let M=l(e);if(!M||C(M)||g(e)===R||L())return null;let I=x(e)[A(e)],V=()=>{F(!1),t&&t(),m(e)};function W(){return Ee.createElement(Ee.Fragment,null,Ee.createElement(ne,{appearance:n}),Ee.createElement(Gl,{appearance:n,className:Fe(a("announcementContainer",n),r),style:s},(p===!0||I.dismissible)&&d=="inline"&&Ee.createElement(Jl,{onClick:()=>U(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},Ee.createElement(Ne,null)),Ee.createElement(Kl,null,Ee.createElement(Xl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:me(I.title)}),I.subtitle&&Ee.createElement(Ql,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:me(I.subtitle)})),(I.imageUri||I.videoUri)&&Ee.createElement(Yl,{className:a("announcementMediaContainer",n)},Ee.createElement(Rl,{appearance:n,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&Ee.createElement(ql,{className:a("announcementCTAContainer",n)},I.secondaryButtonTitle&&Ee.createElement(te,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){I.handleSecondaryButtonClick(),k(I),i&&i(I,A(e),"secondary")}),secondary:!0}),I.primaryButtonTitle&&Ee.createElement(te,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){I.handlePrimaryButtonClick(),T(I),!(i&&i(I,A(e),"primary")===!1)&&(yield c(e,I.id),yield m(e))})}))))}let q={padding:"24px",maxWidth:"400px"};return d==="inline"?W():d!=="center"?Ee.createElement(Do,{modalPosition:d,onClose:V,visible:S,dismissible:p,appearance:n},W()):Ee.createElement(Qe,{appearance:n,onClose:V,visible:S,style:q,dismissible:p},W())};import*as lr from"react";import ea from"react";var ta=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Le(r,["as","children","variant"]);return ea.createElement(Pn,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Rc=Object.fromEntries(Object.keys(Yo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ea.createElement(ta,j(b({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),Rr=Object.assign(ta,Rc);var oa=s=>{var p=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Le(p,["as","className","size","title","variant"]);var d;return lr.createElement(kn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),lr.createElement(Rr,{color:(d=To[n])==null?void 0:d.color,fontWeight:"semibold"},i))},em=Object.fromEntries(Object.keys(To).map(e=>{let t=o=>lr.createElement(oa,j(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),tm=Object.assign(oa,em);export{wo as Box,tm as Button,at as CheckBox,cr as FlowType,yt as FormLabel,Tr as FormTextField,Zc as FrigadeAnnouncement,Gc as FrigadeBanner,jr as FrigadeChecklist,lt as FrigadeDefaultAppearance,Vc as FrigadeEmbeddedTip,xn as FrigadeForm,Sc as FrigadeGuide,hc as FrigadeHeroChecklist,Yc as FrigadeNPSSurvey,Cc as FrigadeProgressBadge,Pd as FrigadeProvider,_c as FrigadeSupportWidget,Mc as FrigadeTour,_e as ProgressBar,Kt as ProgressRing,Rr as Text,$r as tokens,Oe as useFlowOpens,mo as useFlowResponses,J as useFlows,Lr as useOrganization,uo as useUser,We as useUserFlowStates};
|
|
1782
1787
|
//# sourceMappingURL=index.mjs.map
|