@frigade/react 1.35.56 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +299 -299
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +269 -269
- 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 Bo=Object.getOwnPropertySymbols;var oi=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable;var ti=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))oi.call(t,o)&&ti(e,o,t[o]);if(Bo)for(var o of Bo(t))ri.call(t,o)&&ti(e,o,t[o]);return e},_=(e,t)=>na(e,sa(t));var ii=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)oi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Bo)for(var i of Bo(e))t.indexOf(i)<0&&ri.call(e,i)&&(o[i]=e[i]);return o};var D=(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 Bt,{createContext as Cd,useEffect as qo,useState as je}from"react";import{ThemeProvider as yd}from"styled-components";import vt,{useContext as qp,useEffect as Yt,useState as Co}from"react";import{useCallback as Ft,useContext as ya,useEffect as Sa}from"react";import nr,{useMemo as si}from"react";var ni="1.35.56 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",Eo="ABORTED_FLOW",Tt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ke="COMPLETED_STEP",Ao="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=nr.useContext(Q);return{config:si(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ni,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:si(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Wt(){let{shouldGracefullyDegrade:e,readonly:t}=nr.useContext(Q);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Ut();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Ut();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 Ut()}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 Ut(p)}return s?s.ok?s:Ut(s.statusText):Ut()})}function Ut(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function zt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=nr.useContext(Q);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 li}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(Q);function r(c,f=!1){var y;return(y=e[c])!=null?y:f}function s(c,f){t(y=>_(w({},y),{[c]:f}))}function p(c){t(f=>{let S=f,{[c]:y}=S,T=Ie(S,[ii(c)]);return w({},T)})}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,y])=>y&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import so from"core-js-pure/actual/structured-clone";function sr(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(!sr(t)||!sr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([n,r])=>{sr(r)?i[n]!==void 0?Object.assign(i,{[n]:xe(i[n],so(r))}):Object.assign(i,{[n]:so(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...so(r)]}):Object.assign(i,{[n]:so(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function De(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(Q),{resetOpenFlowState:d}=Be(),[l,m]=ma(!1),c={data:r.map(h=>({flowId:h.id,flowState:Z,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=h=>fetch(h,e).then(b=>{if(b.ok)return b.json();throw new Error("Failed to fetch user flow states")}).catch(b=>(console.log(`Error fetching ${h}: ${b}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:S,mutate:g,error:E}=p?fa(y,f):ua(y,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),P=T==null?void 0:T.data;ca(()=>{!l&&!S&&P&&m(!0)},[P,l,S]);function F(h){return D(this,null,function*(){if(P&&!p){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Z&&(b.flowState=Z),yield g(Promise.resolve(xe(T,{data:P})),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function A(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.stepStates[b]=N,L.flowState=Tt),yield g(Promise.resolve(xe(T,{data:P})),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function I(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.lastStepId=b,L.stepStates[b]=N,L.flowState=Tt),yield g(xe(T,{data:P}),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function x(h){return D(this,null,function*(){if(P){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Me&&(b.flowState=Me,b.lastStepId=ga,Object.keys(b.stepStates).forEach(N=>{b.stepStates[N].actionType=He,b.stepStates[N].createdAt=new Date().toISOString()}),yield g(xe(T,{data:P}),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1}),d(h))}})}function v(h,b){return D(this,null,function*(){if(P){let N=P.find(L=>L.flowId===h);N&&N.stepStates[b]!==He&&(N.stepStates[b]=He),yield g(xe(T,{data:P}),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:P,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:v,optimisticallyMarkStepStarted:I,error:E}}function lo(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=ha(Q),[d,l]=li(new Set),[m,c]=li(new Set),f=Wt();function y(g){let E=JSON.stringify(g);if(d.has(E))return null;d.add(E),l(d),m.add(g),c(m);let P=s==null?void 0:s.find(F=>F.flowSlug===g.flowSlug&&F.stepId===g.stepId&&F.actionType===g.actionType&&F.createdAt===g.createdAt);return f(`${t}flowResponses`,_(w({},e),{method:"POST",body:E})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):P||p(A=>[...A!=null?A:[],g])})}function T(g){return D(this,null,function*(){g.foreignUserId&&(g.actionType===Tt||g.actionType===Me?yield y(g):g.actionType===Z?yield y(g):g.actionType===Ao?yield y(g):g.actionType===Ke?yield y(g):g.actionType===Eo?yield y(g):g.actionType===He&&(yield y(g)))})}function S(){let g=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let P in E.stepStates){let F=E.stepStates[P];g.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...g,...s]}return{addResponse:T,setFlowResponses:p,getFlowResponses:S}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ai=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 lr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var ar=(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))(ar||{});function R(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:y}=ya(Q),T={data:[]},{verifySDKInitiated:S}=zt(),{addResponse:g,getFlowResponses:E}=lo(),P=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. Will gracefully degrade and hide Frigade`),f(!0),T)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),f(!0),T)),{mutateUserFlowState:F,userFlowStatesData:A,isLoadingUserFlowStateData:I,optimisticallyMarkFlowCompleted:x,optimisticallyMarkFlowNotStarted:v,optimisticallyMarkStepCompleted:h,optimisticallyMarkStepNotStarted:b,optimisticallyMarkStepStarted:N}=De(),{data:L,error:O,isLoading:j}=ba(s?`${t}flows${y?"?readonly=true":""}`:null,P,{keepPreviousData:!0});Sa(()=>{if(O){console.error(O);return}L&&L.data&&i(L.data)},[L,O]);function M(u){if(j)return null;let C=o.find(k=>k.slug===u);return!C&&o.length>0&&!I&&!j?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1&&!y?null:C}function G(u){var z,Fe;if(!M(u))return[];let C=M(u).data;return C?(C=le(C),((Fe=(z=lr(C))==null?void 0:z.data)!=null?Fe:[]).map(ge=>{let wt=J(ge);return _(w({handleSecondaryButtonClick:()=>{ge.skippable===!0&&V(u,ge.id,{skipped:!0})}},ge),{complete:ue(u,ge.id)===Ke||wt>=1,blocked:Oe(u,ge.id),hidden:Te(u,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&V(u,ge.id)},progress:wt})}).filter(ge=>ge.hidden!==!0)):[]}function le(u){return u.replaceAll(/\${(.*?)}/g,(C,k)=>p[k]===void 0?"":String(p[k]).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 pe(u){var k;if(!M(u))return[];let C=M(u).data;return C?(C=le(C),(k=JSON.parse(C))!=null?k:{}):[]}function q(u,C){d(k=>_(w({},k),{[u]:C}))}function se(u){!I&&!j&&u&&JSON.stringify(p)!=JSON.stringify(w(w({},p),u))&&Object.keys(u).forEach(C=>{q(C,u[C])})}let de=Ft((u,C,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:Ao,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield N(u,C,z),g(z))}),[n,r,A]),Se=Ft((u,C,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:He,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield b(u,C),g(z))}),[n,r,A]),V=Ft((u,C,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:Ke,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield h(u,C,z),g(z))}),[n,r,A]),Y=Ft((u,C)=>D(this,null,function*(){if(!S()||fe(u)===Me)return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Me,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};yield v(u),X(k)&&g(k)}),[n,r,A]),ee=Ft((u,C)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Tt,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&g(k)}),[n,r,A]),Ve=Ft((u,C)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Z,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(u),g(k))}),[n,r,A]),Le=Ft((u,C)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Eo,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(u),g(k))}),[n,r,A]);function X(u){var C;if(!A&&u.actionType===He)return!1;if(A){let k=A.find(z=>z.flowId===u.flowSlug);if(u.actionType===He&&(!(k!=null&&k.stepStates[u.stepId])||k.stepStates[u.stepId].actionType===He))return!1;if(k&&((C=k.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType){let z=Object.keys(k.stepStates).sort((Fe,ge)=>{let wt=new Date(k.stepStates[Fe].createdAt),vo=new Date(k.stepStates[ge].createdAt);return wt.getTime()-vo.getTime()});if(k.stepStates[z[z.length-1]].actionType===u.actionType)return!1}if(k&&k.flowState===Z&&u.actionType===Z)return!1}return!0}function ue(u,C){let k=U(u,C);return I?null:k?k.actionType:He}function Oe(u,C){let k=U(u,C);return k?k.blocked:!1}function Te(u,C){let k=U(u,C);return k?k.hidden:!1}function U(u,C){var z;if(I)return null;let k=A==null?void 0:A.find(Fe=>Fe.flowId===u);return!k||!k.stepStates[C]?null:(z=k.stepStates[C])!=null?z:null}function $(u){var k,z;if(I||!A)return null;if(fe(u)===Me)return(k=G(u)[0])!=null?k:null;let C=(z=A.find(Fe=>Fe.flowId===u))==null?void 0:z.lastStepId;return C?G(u).find(Fe=>Fe.id===C):null}function W(u){var z;let C=$(u);if(!C)return 0;let k=(z=G(u).findIndex(Fe=>Fe.id===C.id))!=null?z:0;return ue(u,C.id)===Ke&&k<G(u).length-1?k+1:k}function J(u){if(!u.completionCriteria)return;let C=ai(u.completionCriteria);if(C===null)return;let k=$e(C),z=Ge(C);return z===0?void 0:k/z}function fe(u){let C=A==null?void 0:A.find(k=>k.flowId===u);return C?C.flowState:null}function $e(u){let C=G(u);return C.length===0?0:C.filter(z=>ue(u,z.id)===Ke).length}function Ge(u){return G(u).length}function Xe(u){let C=o.find(k=>k.slug===u);return C?lr(C.data):null}function St(u){if(y)return!1;if(I)return!0;if(u!=null&&u.targetingLogic&&A){let C=A.find(k=>k.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&n&&n.startsWith("guest_"))}function Mt(u){return!St(M(u))}function Dt(){n&&F()}function bt(){return o}return{getAllFlows:bt,getFlow:M,getFlowData:Xe,isLoading:I||j,getStepStatus:ue,getFlowSteps:G,getCurrentStepIndex:W,markStepStarted:de,markStepCompleted:V,markFlowNotStarted:Y,markFlowStarted:ee,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:Se,getFlowStatus:fe,getNumberOfStepsCompleted:$e,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:St,setCustomVariable:q,updateCustomVariables:se,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:pe,isStepBlocked:Oe,isStepHidden:Te,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Mt,refresh:Dt}}import{useCallback as pr,useContext as wa,useEffect as Ta}from"react";var _t="guest_";function ao(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(Q),{config:r,apiUrl:s}=Je(),{mutateUserFlowState:p}=De(),d=Wt(),{verifySDKInitiated:l}=zt();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(_t))return;let T=m(e);localStorage.getItem(T)||(d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=pr(T=>D(this,null,function*(){if(!l())return;let S={foreignId:e,properties:T};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(S)})),i(g=>w(w({},g),T)),p()}),[e,r,n,p]),f=pr((T,S)=>D(this,null,function*(){if(!l())return;let E={foreignId:e,events:[{event:T,properties:S}]};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),p()}),[e,r,p]),y=pr((T,S)=>D(this,null,function*(){if(l())if(S){let g=m(T);localStorage.setItem(g,"true"),o(T);let E={foreignId:T,properties:S};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),i(P=>w(w({},P),S)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Yp}from"uuid";import et,{useEffect as mn,useState as un}from"react";import qe,{useEffect as ur,useState as Ia}from"react";import Lo from"styled-components";import Fa from"react";import ka from"styled-components";var pi="fr-",po="cfr-";function a(e,t){let o=`${pi}${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+" "+po+e}return o}function B(e){if(!e.className||e.className.indexOf(po)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(pi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Oo(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=>`${Oo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function be(...e){return e.filter(Boolean).join(" ")}function co(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 Eo=Object.getOwnPropertySymbols;var ni=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable;var ii=(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={}))ni.call(t,o)&&ii(e,o,t[o]);if(Eo)for(var o of Eo(t))si.call(t,o)&&ii(e,o,t[o]);return e},j=(e,t)=>na(e,sa(t));var li=e=>typeof e=="symbol"?e:e+"",Ne=(e,t)=>{var o={};for(var i in e)ni.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&&si.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 Bt,{createContext as bd,useEffect as Xo,useState as Ge}from"react";import{ThemeProvider as wd}from"styled-components";import vt,{useContext as Jp,useEffect as Xt,useState as Co}from"react";import{useCallback as Ft,useContext as ya,useEffect as Sa}from"react";import sr,{useMemo as pi}from"react";var ai="1.36.0 ";var He="NOT_STARTED_STEP",R="COMPLETED_FLOW",Ao="ABORTED_FLOW",Tt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ve="COMPLETED_STEP",Oo="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=sr.useContext(X);return{config:pi(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ai,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:pi(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function zt(){let{shouldGracefullyDegrade:e,readonly:t}=sr.useContext(X);return(o,i)=>U(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Wt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Wt();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 Wt()}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 Wt(p)}return l?l.ok?l:Wt(l.statusText):Wt()})}function Wt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function _t(){let{publicApiKey:e,shouldGracefullyDegrade:t}=sr.useContext(X);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 di}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(X);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,[li(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 lo from"core-js-pure/actual/structured-clone";function lr(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(!lr(t)||!lr(o))throw new Error("deepmerge can only merge Objects");let i=lo(t);return Object.entries(o).forEach(([n,r])=>{lr(r)?i[n]!==void 0?Object.assign(i,{[n]:xe(i[n],lo(r))}):Object.assign(i,{[n]:lo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...lo(r)]}):Object.assign(i,{[n]:lo(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function De(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=da(X),{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(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`),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}),k=T==null?void 0:T.data;ca(()=>{!s&&!C&&k&&m(!0)},[k,s,C]);function P(S){return U(this,null,function*(){if(k&&!p){let F=k.find(L=>L.flowId===S);F&&F.flowState!==R&&(F.flowState=R),yield h(Promise.resolve(xe(T,{data:k})),{optimisticData:xe(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function B(S,F,L){return U(this,null,function*(){if(k){let O=k.find(N=>N.flowId===S);O&&(O.stepStates[F]=L,O.flowState=Tt),yield h(Promise.resolve(xe(T,{data:k})),{optimisticData:xe(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function v(S,F,L){return U(this,null,function*(){if(k){let O=k.find(N=>N.flowId===S);O&&(O.lastStepId=F,O.stepStates[F]=L,O.flowState=Tt),yield h(xe(T,{data:k}),{optimisticData:xe(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function f(S){return U(this,null,function*(){if(k){let F=k.find(L=>L.flowId===S);F&&F.flowState!==Me&&(F.flowState=Me,F.lastStepId=ga,Object.keys(F.stepStates).forEach(L=>{F.stepStates[L].actionType=He,F.stepStates[L].createdAt=new Date().toISOString()}),yield h(xe(T,{data:k}),{optimisticData:xe(T,{data:k}),revalidate:!1,rollbackOnError:!1}),d(S))}})}function I(S,F){return U(this,null,function*(){if(k){let L=k.find(O=>O.flowId===S);L&&L.stepStates[F]!==He&&(L.stepStates[F]=He),yield h(xe(T,{data:k}),{optimisticData:xe(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:k,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:B,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:v,error:A}}function ao(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=ha(X),[d,s]=di(new Set),[m,c]=di(new Set),g=zt();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 k=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])):k||p(B=>[...B!=null?B:[],h])})}function T(h){return U(this,null,function*(){h.foreignUserId&&(h.actionType===Tt||h.actionType===Me?yield y(h):h.actionType===R?yield y(h):h.actionType===Oo?yield y(h):h.actionType===Ve?yield y(h):h.actionType===Ao?yield y(h):h.actionType===He&&(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 k in A.stepStates){let P=A.stepStates[k];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,ci=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 ar(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var pr=(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))(pr||{});function J(){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(X),T={data:[]},{verifySDKInitiated:C}=_t(),{addResponse:h,getFlowResponses:A}=ao(),k=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:B,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:f,optimisticallyMarkFlowNotStarted:I,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:L}=De(),{data:O,error:N,isLoading:V}=ba(l?`${t}flows${y?"?readonly=true":""}`:null,k,{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&&!v&&!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,de;if(!W(x))return[];let u=W(x).data;return u?(u=Q(u),((de=(z=ar(u))==null?void 0:z.data)!=null?de:[]).map(ce=>{let wt=ie(ce);return j(b({handleSecondaryButtonClick:()=>{ce.skippable===!0&&re(x,ce.id,{skipped:!0})}},ce),{complete:Fe(x,ce.id)===Ve||wt>=1,blocked:ye(x,ce.id),hidden:$e(x,ce.id),handlePrimaryButtonClick:()=>{(!ce.completionCriteria&&(ce.autoMarkCompleted||ce.autoMarkCompleted===void 0)||ce.completionCriteria&&ce.autoMarkCompleted===!0)&&re(x,ce.id)},progress:wt})}).filter(ce=>ce.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 pe(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){!v&&!V&&x&&JSON.stringify(p)!=JSON.stringify(b(b({},p),x))&&Object.keys(x).forEach(u=>{H(u,x[u])})}let fe=Ft((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,B]),Te=Ft((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:He,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield F(x,u),h(z))}),[n,r,B]),re=Ft((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:Ve,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield S(x,u,z),h(z))}),[n,r,B]),Z=Ft((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,B]),q=Ft((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Tt,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&h(w)}),[n,r,B]),_=Ft((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,B]),Le=Ft((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,B]);function he(x){var u;if(!B&&x.actionType===He)return!1;if(B){let w=B.find(z=>z.flowId===x.flowSlug);if(x.actionType===He&&(!(w!=null&&w.stepStates[x.stepId])||w.stepStates[x.stepId].actionType===He))return!1;if(w&&((u=w.stepStates[x.stepId])==null?void 0:u.actionType)===x.actionType){let z=Object.keys(w.stepStates).sort((de,ce)=>{let wt=new Date(w.stepStates[de].createdAt),Bo=new Date(w.stepStates[ce].createdAt);return wt.getTime()-Bo.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 v?null:w?w.actionType:He}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(v)return null;let w=B==null?void 0:B.find(de=>de.flowId===x);return!w||!w.stepStates[u]?null:(z=w.stepStates[u])!=null?z:null}function M(x){var w,z;if(v||!B)return null;if(Oe(x)===Me)return(w=Y(x)[0])!=null?w:null;let u=(z=B.find(de=>de.flowId===x))==null?void 0:z.lastStepId;return u?Y(x).find(de=>de.id===u):null}function D(x){var z;let u=M(x);if(!u)return 0;let w=(z=Y(x).findIndex(de=>de.id===u.id))!=null?z:0;return Fe(x,u.id)===Ve&&w<Y(x).length-1?w+1:w}function ie(x){if(!x.completionCriteria)return;let u=ci(x.completionCriteria);if(u===null)return;let w=bt(u),z=Ke(u);return z===0?void 0:w/z}function Oe(x){let u=B==null?void 0:B.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)===Ve).length}function Ke(x){return Y(x).length}function mt(x){let u=o.find(w=>w.slug===x);return u?ar(u.data):null}function qe(x){if(y)return!1;if(v)return!0;if(x!=null&&x.targetingLogic&&B){let u=B.find(w=>w.flowId===x.slug);if(u)return u.shouldTrigger===!1}return!!(x!=null&&x.targetingLogic&&n&&n.startsWith("guest_"))}function Mt(x){return!qe(W(x))}function Dt(){n&&P()}function Ut(){return o}return{getAllFlows:Ut,getFlow:W,getFlowData:mt,isLoading:v||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:Ke,targetingLogicShouldHideFlow:qe,setCustomVariable:H,updateCustomVariables:le,customVariables:p,getStepOptionalProgress:ie,getFlowMetadata:pe,isStepBlocked:ye,isStepHidden:$e,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Mt,refresh:Dt}}import{useCallback as dr,useContext as wa,useEffect as Ta}from"react";var Ht="guest_";function po(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(X),{config:r,apiUrl:l}=Je(),{mutateUserFlowState:p}=De(),d=zt(),{verifySDKInitiated:s}=_t();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(Ht))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=dr(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=dr((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=dr((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(k=>b(b({},k),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 et,{useEffect as gn,useState as qp}from"react";import Ye,{useEffect as fr,useState as Na}from"react";import $o from"styled-components";import Fa from"react";import ka from"styled-components";var mi="fr-",co="cfr-";function a(e,t){let o=`${mi}${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+" "+co+e}return o}function E(e){if(!e.className||e.className.indexOf(co)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(mi)?"":`: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 mo(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;
|
|
@@ -7,7 +7,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>E(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,ui=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import cr from"react";import va from"styled-components";var Ba=va.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Ee=()=>
|
|
31
|
-
${e=>
|
|
30
|
+
`,Ee=()=>cr.createElement(Ba,null,cr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},cr.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 Pi from"react";import mr from"react";function Ea({style:e,className:t}){return mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},mr.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"}),mr.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 fi=Ea;import ur from"styled-components";import rt from"styled-components";var Io=rt.div`
|
|
31
|
+
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -57,52 +57,52 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
|
-
`,
|
|
61
|
-
${e=>
|
|
60
|
+
`,gi=rt.div`
|
|
61
|
+
${e=>E(e)} {
|
|
62
62
|
${e=>e.hasImage?Aa:Oa};
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
65
|
-
${e=>
|
|
64
|
+
`,hi=rt.img`
|
|
65
|
+
${e=>E(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
68
68
|
height: auto;
|
|
69
69
|
min-height: 200px;
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
|
-
`,
|
|
73
|
-
${e=>
|
|
72
|
+
`,xi=rt.div`
|
|
73
|
+
${e=>E(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
76
76
|
height: auto;
|
|
77
77
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
78
78
|
object-fit: cover;
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`,Ci=rt.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
align-content: center;
|
|
85
|
-
`,
|
|
85
|
+
`,yi=rt.div`
|
|
86
86
|
padding: 22px 22px 12px;
|
|
87
|
-
`,
|
|
87
|
+
`,Si=rt.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
justify-content: center;
|
|
92
|
-
`,
|
|
92
|
+
`,bi=rt.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
flex: 2;
|
|
95
95
|
flex-shrink: 1;
|
|
96
96
|
gap: 8px;
|
|
97
97
|
height: 64px;
|
|
98
|
-
${e=>
|
|
98
|
+
${e=>E(e)} {
|
|
99
99
|
flex-direction: row;
|
|
100
100
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
|
-
`,
|
|
105
|
-
${e=>
|
|
104
|
+
`,wi=rt.p`
|
|
105
|
+
${e=>E(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
108
108
|
font-size: 15px;
|
|
@@ -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
|
|
113
|
+
`;var Ti=ur.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
|
-
`,
|
|
124
|
+
`,Fi=ur(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
|
-
`,
|
|
137
|
+
`,ki=ur.div`
|
|
138
138
|
display: flex;
|
|
139
139
|
justify-content: center;
|
|
140
140
|
align-items: center;
|
|
@@ -143,8 +143,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
143
143
|
font-size: 12px;
|
|
144
144
|
line-height: 18px;
|
|
145
145
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
146
|
-
`;function
|
|
147
|
-
${e=>
|
|
146
|
+
`;function Lo({appearance:e}){return Pi.createElement(ki,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Pi.createElement(fi,null))}var La=$o.div`
|
|
147
|
+
${e=>E(e)} {
|
|
148
148
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
149
149
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
150
150
|
/* Mobile */
|
|
@@ -185,27 +185,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,$a
|
|
188
|
+
`,$a=$o.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
`,Ma
|
|
191
|
+
`,Ma=$o.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
195
195
|
cursor: pointer;
|
|
196
196
|
z-index: 1501;
|
|
197
|
-
${e=>
|
|
197
|
+
${e=>E(e)} {
|
|
198
198
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
200
|
}
|
|
201
|
-
`,Da
|
|
201
|
+
`,Da=$o.div`
|
|
202
202
|
overflow: scroll;
|
|
203
203
|
flex: 1 1;
|
|
204
204
|
display: flex;
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:
|
|
208
|
+
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=Na("");return fr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");s(m)},[]),fr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),fr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?Ye.createElement(Ia,null,Ye.createElement(ui,{appearance:r,onClose:()=>{l&&e()}}),Ye.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&Ye.createElement(Ma,{className:a("modalClose",r),onClick:()=>e(),appearance:r},Ye.createElement(Ee,null)),o&&Ye.createElement($a,null,o),Ye.createElement(Da,null,n),p&&Ye.createElement(Ti,{appearance:r,className:a("poweredByFrigadeRibbon",r)},Ye.createElement(Lo,{appearance:r})))):Ye.createElement(Ye.Fragment,null)};import ft,{useEffect as gr,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`
|
|
@@ -214,8 +214,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
214
214
|
`;case"bottom-left":return`
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var _a
|
|
218
|
-
${e=>
|
|
217
|
+
`}return"right: 0; bottom: 0;"}var _a=Mo.div`
|
|
218
|
+
${e=>E(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
221
221
|
position: fixed;
|
|
@@ -230,27 +230,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
230
230
|
}
|
|
231
231
|
${e=>za(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
|
-
`,Ha
|
|
233
|
+
`,Ha=Mo.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,
|
|
236
|
+
`,Va=Mo.div`
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 16px;
|
|
239
239
|
right: 16px;
|
|
240
240
|
cursor: pointer;
|
|
241
241
|
z-index: 1501;
|
|
242
|
-
${e=>
|
|
242
|
+
${e=>E(e)} {
|
|
243
243
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
244
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
245
|
}
|
|
246
|
-
`,
|
|
246
|
+
`,ja=Mo.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
253
|
-
${e=>
|
|
252
|
+
`,Do=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=Ua("");return gr(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s)},[]),gr(()=>{let s=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e]),gr(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p)}},[t]),t?ft.createElement(Wa,null,ft.createElement(_a,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&ft.createElement(Va,{className:a("cornerModalClose",n),onClick:()=>e()},ft.createElement(Ee,null)),o&&ft.createElement(Ha,null,o),ft.createElement(ja,null,i))):ft.createElement(ft.Fragment,null)};import{useContext as Ga}from"react";function ee(){let{defaultAppearance:e}=Ga(X);function t(o){var n,r,l;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,(l=o.theme)!=null?l:{})}:i}return{mergeAppearanceWithDefault:t}}import kt,{useContext as up,useEffect as Vi,useState as kr}from"react";import Ho from"styled-components";import zo,{useEffect as Ni,useState as Cr}from"react";import yr from"styled-components";import Uo from"styled-components";var vi=Uo.label`
|
|
253
|
+
${e=>E(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
256
256
|
margin-bottom: 5px;
|
|
@@ -260,14 +260,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
260
260
|
letter-spacing: 0.24px;
|
|
261
261
|
}
|
|
262
262
|
display: flex;
|
|
263
|
-
`,
|
|
264
|
-
${e=>
|
|
263
|
+
`,Bi=Uo.label`
|
|
264
|
+
${e=>E(e)} {
|
|
265
265
|
font-size: 12px;
|
|
266
266
|
line-height: 20px;
|
|
267
267
|
margin-bottom: 5px;
|
|
268
268
|
}
|
|
269
269
|
display: flex;
|
|
270
|
-
`,
|
|
270
|
+
`,Ei=Uo.span`
|
|
271
271
|
font-weight: 400;
|
|
272
272
|
font-size: 14px;
|
|
273
273
|
line-height: 22px;
|
|
@@ -275,17 +275,17 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
275
275
|
display: flex;
|
|
276
276
|
margin-right: 5px;
|
|
277
277
|
margin-top: 10px;
|
|
278
|
-
`,Uo
|
|
278
|
+
`,Wo=Uo.div`
|
|
279
279
|
display: flex;
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import
|
|
283
|
+
`;import hr from"react";var it={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 gt({title:e,required:t,appearance:o=it}){return e?hr.createElement(Wo,{className:a("formLabelWrapper",o)},t?hr.createElement(Ei,{className:a("formLabelRequired",o),appearance:o},"*"):null,hr.createElement(vi,{className:a("formLabel",o)},e)):null}import Ai from"react";function Vt({title:e,appearance:t}){return e?Ai.createElement(Wo,null,Ai.createElement(Bi,{className:a("formSubLabel",t)},e)):null}import{z as xr}from"zod";function Oi(e,t){var o,i,n,r,l,p,d;try{if(t){if(t.type=="number"){let s=xr.number();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?s=s.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?s=s.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(s=s.nonpositive((r=m.message)!=null?r:"Value must be negative"));s.parse(Number(e))}if(t.type=="string"){let s=xr.string();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(l=m.message)!=null?l:"Value is too short"):m.requirement=="max"?s=s.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(s=s.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));s.parse(e)}return}}catch(s){if(s instanceof xr.ZodError)return s.issues&&s.issues.length>0?s.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,s)}return null}var Ka=yr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,yr
|
|
288
|
-
${e=>
|
|
287
|
+
`,Sr=yr.input`
|
|
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}};
|
|
291
291
|
font-size: 14px;
|
|
@@ -300,8 +300,8 @@ 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=
|
|
304
|
-
${e=>
|
|
303
|
+
`,qa=yr.textarea`
|
|
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}};
|
|
307
307
|
font-size: 14px;
|
|
@@ -317,14 +317,14 @@ 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 br({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[l,p]=Cr((n==null?void 0:n.text)||""),[d,s]=Cr(!1),[m,c]=Cr(!1),g=Sr;Ni(()=>{l===""&&!d&&(s(!0),y(""))},[]),Ni(()=>{if(m){y(l);return}},[m]);function y(C){var A;if(p(C),o({text:C}),r.required===!0&&C.trim()===""){i([{id:r.id,message:`${(A=r.title)!=null?A:"Field"} is required`,hidden:!m}]);return}let h=Oi(C,r.validation);if(h&&(C.trim()!==""||r.required===!0)){i([{id:r.id,message:h,hidden:!m}]);return}i([])}r.multiline&&(g=qa);function T(){var C;switch((C=r==null?void 0:r.validation)==null?void 0:C.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return zo.createElement(Ka,null,zo.createElement(gt,{title:r.title,required:r.required,appearance:t.appearance}),zo.createElement(g,{className:a("inputComponent",t.appearance),value:l,onChange:C=>{y(C.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:T(),onBlur:()=>{c(!0)}}),zo.createElement(Vt,{title:r.subtitle,appearance:t.appearance}))}import Ze,{useEffect as Ii,useState as Li}from"react";import $i from"styled-components";var wr="",Ya=$i.div`
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
width: 100%;
|
|
324
324
|
-webkit-appearance: none;
|
|
325
325
|
appearance: none;
|
|
326
|
-
`,Xa
|
|
327
|
-
${e=>
|
|
326
|
+
`,Xa=$i.select`
|
|
327
|
+
${e=>E(e)} {
|
|
328
328
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
329
329
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
330
330
|
font-size: 14px;
|
|
@@ -344,16 +344,16 @@ 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
|
|
347
|
+
`;function Mi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,g,y,T,C,h,A,k;let r=e,[l,p]=Li(!1),[d,s]=Li(!1);return Ii(()=>{var P,B,v,f;if(!((P=i==null?void 0:i.choice)!=null&&P[0])&&!l){if(p(!0),r.requireSelection){o({choice:[wr]});return}if(r.defaultValue&&((B=r.props.options)!=null&&B.find(I=>I.id===r.defaultValue))){let I=(v=r.props.options)==null?void 0:v.find(S=>S.id===r.defaultValue);o({choice:[I.id]})}else o({choice:[((f=r.props.options)==null?void 0:f[0].id)||""]})}},[]),Ii(()=>{var P;d&&(r.requireSelection&&((P=i==null?void 0:i.choice)==null?void 0:P[0])===wr?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(gt,{title:r.title,required:!1,appearance:t.appearance}),Ze.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:P=>{s(!0),o({choice:[P.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Ze.createElement("option",{key:"null-value",value:wr,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(y=r.props.options)==null?void 0:y.map(P=>Ze.createElement("option",{key:P.id,value:P.id},P.title))),((C=(T=r.props.options)==null?void 0:T.find(P=>{var B;return P.id===((B=i==null?void 0:i.choice)==null?void 0:B[0])}))==null?void 0:C.isOpenEnded)&&Ze.createElement(Ze.Fragment,null,Ze.createElement(gt,{title:(k=(A=(h=r.props.options)==null?void 0:h.find(P=>{var B;return P.id===((B=i==null?void 0:i.choice)==null?void 0:B[0])}))==null?void 0:A.openEndedLabel)!=null?k:"Please specify",required:!1,appearance:t.appearance}),Ze.createElement(Sr,{type:"text",placeholder:"Enter your answer here",onChange:P=>{o({choice:[P.target.value]})},appearance:t.appearance})),Ze.createElement(Vt,{title:r.subtitle,appearance:t.appearance}))}import go,{useEffect as Tr,useState as Ui}from"react";import Wi from"styled-components";import fo from"react";import uo from"react";var Di=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return uo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Ja=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:l})=>uo.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},uo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},uo.createElement(Di,{color:n,size:t}),uo.createElement(Di,{color:e,percentage:Math.max(o,.1),size:t})),i),jt=Ja;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>fo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fo.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
348
|
${e=>ke(e)}
|
|
349
|
-
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:
|
|
349
|
+
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:l})=>{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?fo.createElement(jt,{fillColor:o,percentage:i,size:22}):fo.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:be(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&fo.createElement(Za,{color:"#FFFFFF"}))};var ap=Wi.div`
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: column;
|
|
352
352
|
width: 100%;
|
|
353
353
|
-webkit-appearance: none;
|
|
354
354
|
appearance: none;
|
|
355
|
-
`,pp=
|
|
356
|
-
${e=>
|
|
355
|
+
`,pp=Wi.button`
|
|
356
|
+
${e=>E(e)} {
|
|
357
357
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
358
358
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
359
359
|
font-size: 14px;
|
|
@@ -377,8 +377,8 @@ 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
|
|
381
|
-
${e=>
|
|
380
|
+
`;function zi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=Ui((i==null?void 0:i.choice)||[]),[d,s]=Ui(!1);return Tr(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}))},[]),Tr(()=>{o({choice:l})},[l]),Tr(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[l]),go.createElement(ap,null,go.createElement(gt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>go.createElement(pp,{appearance:t.appearance,className:a(l.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":l.includes(c.id),onClick:()=>{if(l.includes(c.id)){p(l.filter(g=>g!==c.id));return}l.length<r.props.maxChoices?p([...l,c.id]):l.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,go.createElement(nt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),go.createElement(Vt,{title:r.subtitle,appearance:t.appearance}))}import _o from"react";import _i 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"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var cp=_i.h1`
|
|
381
|
+
${e=>E(e)} {
|
|
382
382
|
font-style: normal;
|
|
383
383
|
font-weight: 700;
|
|
384
384
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -389,8 +389,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
389
389
|
margin-bottom: 4px;
|
|
390
390
|
color: ${e=>e.appearance.theme.colorText};
|
|
391
391
|
}
|
|
392
|
-
`,mp=
|
|
393
|
-
${e=>
|
|
392
|
+
`,mp=_i.h2`
|
|
393
|
+
${e=>E(e)} {
|
|
394
394
|
font-style: normal;
|
|
395
395
|
font-weight: 400;
|
|
396
396
|
font-size: 14px;
|
|
@@ -398,38 +398,38 @@ 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 Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return
|
|
401
|
+
`;function Ae({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?mo(i):i}Title`,e),dangerouslySetInnerHTML:me(t),size:i}),o&&_o.createElement(mp,{appearance:e,className:a(`${n}${n?mo(i):i}Subtitle`,e),dangerouslySetInnerHTML:me(o),size:i}))}import*as Fr from"react";var Hi=e=>Fr.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Fr.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;
|
|
405
405
|
overflow: visible;
|
|
406
406
|
padding-top: 14px;
|
|
407
|
-
`,gp=
|
|
407
|
+
`,gp=Ho.div`
|
|
408
408
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
409
409
|
font-size: 12px;
|
|
410
410
|
margin-bottom: 12px;
|
|
411
411
|
display: flex;
|
|
412
412
|
align-items: center;
|
|
413
|
-
`,hp=
|
|
413
|
+
`,hp=Ho.div`
|
|
414
414
|
margin-right: 4px;
|
|
415
415
|
display: inline-flex;
|
|
416
|
-
`,xp=
|
|
416
|
+
`,xp=Ho.div`
|
|
417
417
|
padding-left: 1px;
|
|
418
418
|
padding-right: 1px;
|
|
419
|
-
`,Cp={text:
|
|
419
|
+
`,Cp={text:br,multipleChoice:Mi,multipleChoiceList:zi},Pr="frigade-multiInputStepTypeData";function ji({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:l,prefillData:p}){var v;let d=t.props,[s,m]=kr([]),[c,g]=kr([]),{userId:y}=po(),[T,C]=kr(P()||(p?p[t.id]:null)||{}),{readonly:h}=up(X),A=b(b({},Cp),l);Vi(()=>{i(s.length===0)},[s,i]),Vi(()=>{n(T)},[T]);function k(f,I){C(S=>{let F=j(b({},S),{[f.id]:I});return typeof window!="undefined"&&window.localStorage&&!h&&window.localStorage.setItem(B(),JSON.stringify(F)),F})}function P(){if(typeof window!="undefined"&&window.localStorage){let f=window.localStorage.getItem(B());if(f)return JSON.parse(f)}return null}function B(){return`${Pr}-${e}-${t.id}-${y}`}return kt.createElement(xp,{className:a("multiInput",r)},kt.createElement(Ae,{appearance:r,title:t.title,subtitle:t.subtitle}),kt.createElement(fp,{className:a("multiInputContainer",r)},(v=d==null?void 0:d.data)==null?void 0:v.map(f=>{let I=s.reverse().find(S=>S.id===f.id);return A[f.type]?kt.createElement("span",{key:f.id,"data-field-id":f.id,className:a("multiInputField",r)},A[f.type]({formInput:f,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:S=>{!c.includes(f.id)&&S&&(S==null?void 0:S.text)!==""&&g(F=>[...F,f.id]),k(f,S)},inputData:T[f.id],setFormValidationErrors:S=>{S.length===0&&s.length===0||m(F=>S.length===0?F.filter(L=>L.id!==f.id):[...F,...S])}}),I&&I.message&&c.includes(f.id)&&I.hidden!==!0&&kt.createElement(gp,{key:f.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},kt.createElement(hp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},kt.createElement(Hi,null)),I.message)):null})))}import Gt from"styled-components";var Gi=Gt.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
|
-
`,
|
|
424
|
+
`,Ki=Gt.div`
|
|
425
425
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
426
426
|
font-size: 12px;
|
|
427
|
-
`,
|
|
427
|
+
`,qi=Gt.div`
|
|
428
428
|
display: flex;
|
|
429
429
|
gap: 12px;
|
|
430
430
|
width: 100%;
|
|
431
431
|
justify-content: flex-end;
|
|
432
|
-
`,
|
|
432
|
+
`,Yi=Gt.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
|
-
`,
|
|
440
|
+
`,Xi=Gt.div`
|
|
441
441
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
442
442
|
position: relative;
|
|
443
443
|
overflow-y: auto;
|
|
444
|
-
`,
|
|
444
|
+
`,Ji=Gt.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 ht from"react";import Zi from"react";import Ri from"styled-components";import yp from"styled-components";var Qi=yp.div`
|
|
457
457
|
width: 24px;
|
|
458
458
|
height: 24px;
|
|
459
459
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -471,11 +471,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
471
471
|
transform: rotate(360deg);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
`;var Sp=
|
|
474
|
+
`;var Sp=Ri.button`
|
|
475
475
|
justify-content: center;
|
|
476
476
|
align-content: center;
|
|
477
477
|
align-items: center;
|
|
478
|
-
${e=>
|
|
478
|
+
${e=>E(e)} {
|
|
479
479
|
display: flex;
|
|
480
480
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
481
481
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -504,8 +504,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
504
504
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
505
505
|
cursor: not-allowed;
|
|
506
506
|
}
|
|
507
|
-
`,
|
|
508
|
-
${e=>
|
|
507
|
+
`,Vo=Ri.div`
|
|
508
|
+
${e=>E(e)} {
|
|
509
509
|
display: flex;
|
|
510
510
|
flex-direction: row;
|
|
511
511
|
justify-content: flex-start;
|
|
@@ -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
|
-
`,
|
|
518
|
+
`,te=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:l=!1,appearance:p,withMargin:d=!0,classPrefix:s="",loading:m=!1})=>{var g;function c(){let y=l?"buttonSecondary":"button";return s===""?y:`${s}${mo(y)}`}return Zi.createElement(Sp,{secondary:l,appearance:p,disabled:i||m,loading:(g=m==null?void 0:m.toString())!=null?g:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?Zi.createElement(Qi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var en=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:l,onBack:p,allowBackNavigation:d,errorMessage:s,isSaving:m})=>{var y;let c=l.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return ht.createElement(ht.Fragment,null,s!==null&&s!=null&&ht.createElement(Ki,{appearance:o,className:a("formCTAError",o)},s),ht.createElement(Gi,{showBackButton:c,className:a("formCTAContainer",o)},c&&ht.createElement(te,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:p,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),ht.createElement(qi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?ht.createElement(te,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?ht.createElement(te,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:m}):null)))};import vr from"react";import bp from"styled-components";var wp=bp.div`
|
|
519
519
|
text-align: center;
|
|
520
|
-
`,
|
|
520
|
+
`,tn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ee().mergeAppearanceWithDefault(i);return vr.createElement(wp,{className:o},vr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,l)=>vr.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?n.colorPrimary:"#E6E6E6"}))))};import Pt from"react";import Kt from"styled-components";import{useContext as Tp}from"react";function ae(){let e=Tp(X);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let l=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(l="_self"),e.navigate(n,l)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Fp=Kt.div`
|
|
521
521
|
display: flex;
|
|
522
522
|
flex-wrap: wrap;
|
|
523
523
|
align-content: center;
|
|
524
524
|
justify-content: center;
|
|
525
|
-
`,kp=
|
|
525
|
+
`,kp=Kt.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=Kt.img`
|
|
540
540
|
width: 78px;
|
|
541
541
|
height: auto;
|
|
542
|
-
`,vp=
|
|
542
|
+
`,vp=Kt.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=Kt.h1`
|
|
556
556
|
font-weight: 700;
|
|
557
557
|
font-size: 28px;
|
|
558
558
|
line-height: 34px;
|
|
559
|
-
`,Ep=
|
|
559
|
+
`,Ep=Kt.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
|
|
568
|
+
`;function on({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ae();return Pt.createElement("div",null,Pt.createElement(Bp,null,e.title),Pt.createElement(Ep,null,e.subtitle),Pt.createElement(Fp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Pt.createElement(kp,{key:r.title},Pt.createElement(Pp,{src:r.imageUri}),Pt.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var l;r.uri&&o(r.uri,(l=r.uriTarget)!=null?l:"_blank")}},r.title)))))}import Yt,{useEffect as Dp}from"react";import Go from"styled-components";import Br from"react";var jo=({style:e,className:t})=>Br.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},Br.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Br.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 qt,{useRef as Ap,useState as Op}from"react";import ho from"styled-components";var Np=ho.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
|
-
`,
|
|
576
|
+
`,Ip=ho.div`
|
|
577
577
|
position: absolute;
|
|
578
578
|
display: flex;
|
|
579
579
|
align-items: center;
|
|
@@ -592,61 +592,61 @@ 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=ho.video`
|
|
596
596
|
width: 100%;
|
|
597
597
|
height: 100%;
|
|
598
598
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
599
|
-
`,$p=
|
|
599
|
+
`,$p=ho.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=ho.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
|
-
}`;function Re({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],
|
|
610
|
-
${e=>
|
|
609
|
+
}`;function Re({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),qt.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],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),qt.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)})}return qt.createElement(Np,{className:a("videoPlayerWrapper",e),appearance:e},!i&&qt.createElement(Ip,{onClick:()=>{n(!0),o.current.play()},appearance:e},qt.createElement(jo,null)),qt.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Up=Go.div`
|
|
610
|
+
${e=>E(e)} {
|
|
611
611
|
display: flex;
|
|
612
612
|
flex-direction: column;
|
|
613
613
|
justify-content: center;
|
|
614
614
|
}
|
|
615
|
-
`,Wp=
|
|
616
|
-
${e=>
|
|
615
|
+
`,Wp=Go.img`
|
|
616
|
+
${e=>E(e)} {
|
|
617
617
|
width: 100%;
|
|
618
618
|
height: auto;
|
|
619
619
|
max-height: 250px;
|
|
620
620
|
margin-bottom: 24px;
|
|
621
621
|
}
|
|
622
|
-
`,zp=
|
|
623
|
-
${e=>
|
|
622
|
+
`,zp=Go.div`
|
|
623
|
+
${e=>E(e)} {
|
|
624
624
|
margin-bottom: 24px;
|
|
625
625
|
}
|
|
626
|
-
`,_p=
|
|
627
|
-
${e=>
|
|
626
|
+
`,_p=Go.div`
|
|
627
|
+
${e=>E(e)} {
|
|
628
628
|
width: 100%;
|
|
629
629
|
height: auto;
|
|
630
630
|
max-height: 250px;
|
|
631
631
|
margin-bottom: 24px;
|
|
632
632
|
}
|
|
633
|
-
`;function
|
|
633
|
+
`;function rn({stepData:e,appearance:t,setCanContinue:o}){return Dp(()=>{o(!0)},[]),Yt.createElement(Up,{className:a("callToActionContainer",t)},Yt.createElement(zp,{className:a("callToActionTextContainer",t)},Yt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Yt.createElement(Wp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Yt.createElement(_p,{appearance:t,className:a("callToActionVideo",t)},Yt.createElement(Re,{appearance:t,videoUri:e.videoUri})))}import st,{useEffect as Er,useState as Ar}from"react";import xt from"styled-components";var nn=xt.div`
|
|
634
634
|
width: auto;
|
|
635
635
|
display: flex;
|
|
636
636
|
flex-direction: column;
|
|
637
637
|
justify-content: center;
|
|
638
638
|
align-items: center;
|
|
639
639
|
padding: 4px;
|
|
640
|
-
`,
|
|
640
|
+
`,sn=xt.div`
|
|
641
641
|
width: 100%;
|
|
642
642
|
text-align: left;
|
|
643
|
-
`,
|
|
643
|
+
`,ln=xt.h1`
|
|
644
644
|
font-style: normal;
|
|
645
645
|
font-weight: 700;
|
|
646
646
|
font-size: 32px;
|
|
647
647
|
line-height: 38px;
|
|
648
648
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
649
|
-
`,
|
|
649
|
+
`,an=xt.h1`
|
|
650
650
|
font-style: normal;
|
|
651
651
|
font-weight: 400;
|
|
652
652
|
font-size: 16px;
|
|
@@ -654,7 +654,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
654
654
|
margin-top: 16px;
|
|
655
655
|
margin-bottom: 16px;
|
|
656
656
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
657
|
-
`,
|
|
657
|
+
`,pn=xt.div`
|
|
658
658
|
padding-top: 12px;
|
|
659
659
|
padding-bottom: 12px;
|
|
660
660
|
flex-direction: row;
|
|
@@ -665,17 +665,17 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
665
665
|
cursor: pointer;
|
|
666
666
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
667
667
|
width: 100%;
|
|
668
|
-
`,
|
|
668
|
+
`,dn=xt.div`
|
|
669
669
|
padding-top: 10px;
|
|
670
670
|
padding-bottom: 10px;
|
|
671
671
|
flex-direction: row;
|
|
672
672
|
display: flex;
|
|
673
673
|
justify-content: flex-start;
|
|
674
|
-
`,
|
|
674
|
+
`,cn=xt.img`
|
|
675
675
|
width: 42px;
|
|
676
676
|
height: 42px;
|
|
677
677
|
margin-right: 12px;
|
|
678
|
-
`,
|
|
678
|
+
`,mn=xt.p`
|
|
679
679
|
font-style: normal;
|
|
680
680
|
font-weight: 500;
|
|
681
681
|
font-size: 17px;
|
|
@@ -683,8 +683,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
683
683
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
684
684
|
display: flex;
|
|
685
685
|
align-self: center;
|
|
686
|
-
`;var
|
|
687
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${Oo(s)}: ${p};`).join(" ")} }`:`${Oo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return xo.createElement(xo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?xo.createElement(xo.Fragment,null):xo.createElement(Vp,{inlineStyles:t})}var fn=({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:y=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:g,showPagination:E=!1,allowBackNavigation:P=!1,validationHandler:F,showFrigadeBranding:A=!1,onFormDataChange:I,showFooter:x=!0,prefillData:v={},updateUrlOnPageChange:h=!1})=>{let{getFlow:b,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:O,getFlowStatus:j,getCurrentStepIndex:M,markFlowCompleted:G,markFlowNotStarted:le,markStepStarted:pe}=R(),q=M(e),{mergeAppearanceWithDefault:se}=te(),[de,Se]=un(!1),[V,Y]=un(""),{setOpenFlowState:ee,getOpenFlowState:Ve,hasOpenModals:Le}=Be(),X=N(e);d=se(d);let[ue,Oe]=i!==void 0&&n!==void 0?[i,n]:[Ve(e,!0),W=>ee(e,W)];mn(()=>{!de&&!L&&(Se(!0),(j(e)===Z&&S||j(e)===Me)&&(j(e)===Z&&S&&le(e),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(J=>{J.startsWith(kr)&&window.localStorage.removeItem(J)})),Se(!0))},[de,Se,L]);let Te=typeof window!="undefined"?window.location.hash:null;if(mn(()=>{var J;let W=typeof window!="undefined"&&((J=window==null?void 0:window.location)!=null&&J.hash)?window.location.hash.replace("#",""):"";if(W!=V&&X&&(X==null?void 0:X.length)>0){let fe=-1;if(W){let $e=W;fe=X.findIndex(Ge=>Ge.id===$e),V===W&&(fe=-1),Y(W)}else fe=0,Y("");fe!==-1&&pe(e,X[fe].id)}},[X,Te]),L)return null;let U=b(e);if(!U||O(U)||!X||i!==void 0&&i===!1||j(e)===Z&&l||(o=="modal"||o=="corner-modal")&&Le(e))return null;let $=()=>{Oe(!1),g&&g(),y===!0&&G(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let W={padding:"24px"};return o==="large-modal"?(W.width="85%",W.height="90%",W.maxHeight="800px",W.minHeight="500px",W.padding="0"):W.width="400px",et.createElement(Qe,{appearance:d,onClose:$,visible:ue,style:W,dismissible:f,showFrigadeBranding:A},et.createElement(ie,{appearance:d}),et.createElement(Go,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))}return o==="modal"&&T!=="center"?et.createElement(Mo,{appearance:d,onClose:$,visible:ue,modalPosition:T},et.createElement(ie,{appearance:d}),et.createElement(Go,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h})):et.createElement(et.Fragment,null,et.createElement(ie,{appearance:d}),et.createElement(Go,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))},gn=fn;import{useCallback as Ar,useContext as Gp,useEffect as Kp}from"react";function Or(){let{organizationId:e,userId:t,setOrganizationId:o}=Gp(Q),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Je(),s=Wt(),{verifySDKInitiated:p}=zt();function d(f,y){return`frigade-user-group-registered-${f}-${y}`}Kp(()=>{if(t&&e){if(t.startsWith(_t))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Ar(f=>D(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:f};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Ar((f,y)=>D(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 S={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:y}]};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),c=Ar((f,y)=>D(this,null,function*(){if(p())if(y){let T=d(t,f);localStorage.setItem(T,"true"),o(f);let S={foreignUserId:t,foreignUserGroupId:f,properties:y};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var hn="frigade-xFrigade_guestUserId",yo="frigade-xFrigade_userId",xn=({})=>{let{setFlowResponses:e}=lo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=ao(),[s,p]=Co(n),{getFlowStatus:d}=R(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=qp(Q),[y,T]=Co([]),[S,g]=Co([]),{organizationId:E}=Or(),[P,F]=Co(E),[A,I]=Co(!1);Yt(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let N=t[b],L=l.find(O=>O.slug===(N==null?void 0:N.flowId));if(L&&N&&N.shouldTrigger===!0&&L.type=="FORM"&&L.triggerType==="AUTOMATIC"&&!S.includes(L.slug)){setTimeout(()=>{x(N.flowId)},500);break}}},[o,t]),Yt(()=>{f.length>0&&i()},[f]),Yt(()=>{A||(I(!0),i())},[o,I]);function x(b){let N=l.find(L=>L.slug===b);N&&N.triggerType==="AUTOMATIC"&&!S.includes(N.slug)&&(g([...S,N.slug]),T([N]))}function v(){if(!n){let b=localStorage.getItem(yo);if(b){r(b);return}let N=localStorage.getItem(hn);if(N){r(N);return}c(!0);let L=_t+Yp();try{localStorage.setItem(hn,L)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||L)}}Yt(()=>{try{if(l){let b=[];l.forEach(N=>{if(N.data){let L=N.data.match(/"imageUri":"(.*?)"/g);L&&L.forEach(O=>{let j=O.replace('"imageUri":"',"").replace('"',"");if(b.includes(j))return;let M=new Image;M.src=j,b.push(j)})}})}}catch(b){}},[l]),Yt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(_t))try{localStorage.setItem(yo,n)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}n===null&&setTimeout(()=>{n===null&&v()},50)},[n,l,m]),Yt(()=>{E!=P&&(F(E),e([]),i())},[E,P,F]);function h(){return vt.createElement(vt.Fragment,null,y.map(b=>d(b.slug)!==Me?null:vt.createElement("span",{key:b.slug},vt.createElement(gn,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return vt.createElement(vt.Fragment,null,vt.createElement(h,null))};import{ErrorBoundary as Sd}from"react-error-boundary";var Cn={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 Xp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Cn[o]){let n=Cn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function Jp(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 yn(e){let{theme:t,styleOverrides:o}=e,i=Xp(t),n=Jp(o);return{overrides:i,css:n}}import dd from"styled-components";import{compose as cd,variant as bn}from"styled-system";import Sn from"react";import Qp,{ThemeProvider as Zp,useTheme as Rp}from"styled-components";import{border as ed,color as td,compose as od,get as rd,shadow as id,space as nd,system as sd,typography as ld}from"styled-system";var ad={width:{property:"width",scale:"sizes",transform:(e,t)=>rd(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},pd=Qp("div")(({css:e})=>e,od(ed,td,id,nd,ld,sd(ad))),So=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let s=Rp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(pd,w(w({as:e},p),i),t);if(o!==void 0){let l=xe(s,o);return Sn.createElement(Zp,{theme:l},d())}return d()};var bo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},md={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},wn=dd(So)(()=>({whiteSpace:"nowrap"}),cd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:md})));import ud from"styled-components";import{variant as fd,system as gd}from"styled-system";var Ko={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Tn=ud(So)(fd({scale:"components.Text",variants:"components.Text"}),gd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",hd=20,xd=Object.fromEntries(Array.from(Array(hd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),Xt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Ir={colors:_(w({},Xt),{neutral:{foreground:Xt.gray300},primary:{background:Xt.blue500,foreground:Xt.white,inverted:Xt.blue500},negative:{foreground:Xt.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:xd,components:{Button:bo,Text:Ko}};var Pn="https://api.frigade.com",Q=Cd({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:Pn,readonly:!1,debug:!1});function bd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var wd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,se,de,Se,V;let[r,s]=je(t||null),[p,d]=je(o||null),[l,m]=je([]),[c,f]=je([]),[y,T]=je([]),[S,g]=je({}),[E,P]=je({}),[F,A]=je([]),[I,x]=je({}),[v,h]=je(!1),[b,N]=je(!1),[L,O]=je(!G(e)),j=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},M={theme:w(w({},it.theme),(se=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?se:{}),styleOverrides:w(w({},it.styleOverrides),(Se=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?Se:{})};function G(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}qo(()=>{t&&s(t)},[t]),qo(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(yo)&&window.localStorage.getItem(yo)!==r&&bd()},[r]),qo(()=>{o&&d(o)},[o]),qo(()=>{if(G(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let le={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:y,setFlowResponses:T,userProperties:S,setUserProperties:g,openFlowStates:E,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:I,setCustomVariables:x,isNewGuestUser:v,setIsNewGuestUser:h,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:j,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:Pn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(L)return Bt.createElement(Q.Provider,{value:le},n);let{overrides:pe}=yn(M);return Bt.createElement(Sd,{fallback:Bt.createElement(Bt.Fragment,null,n)},Bt.createElement(Q.Provider,{value:le},Bt.createElement(yd,{theme:xe(M.theme,Ir,pe!=null?pe:{},(V=i==null?void 0:i.theme)!=null?V:{})},n,Bt.createElement(xn,null))))};import dc from"react";import Ce,{useEffect as ol,useState as rl}from"react";import Ye,{useState as zd}from"react";import Ot from"styled-components";import Jo from"react";import Et from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
686
|
+
`;var un=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=Ar([]),[p,d]=Ar(!1),[s,m]=Ar(e.id);return Er(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Er(()=>{s!==e.id&&(m(e.id),l([]))},[e]),Er(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),st.createElement(nn,{className:a("selectListContainer",i)},st.createElement(sn,null,st.createElement(ln,{className:a("selectListTitle",i)},e.title),st.createElement(an,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let y=r.includes(c.id);return st.createElement(pn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(T=>T!==c.id));return}r.length<n.maxChoices?l([...r,c.id]):r.length==1&&n.maxChoices==1&&l([c.id])},hideBottomBorder:g===n.options.length-1,className:a("selectListSelectItem",i)},st.createElement(dn,{className:a("selectListItemImage",i)},c.imageUri&&st.createElement(cn,{src:c.imageUri,alt:`select-icon-${g}`}),st.createElement(mn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),st.createElement(nt,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import Ue,{useEffect as fn,useState as Ko}from"react";var Hp=({children:e,id:t,shouldWrap:o=!1})=>Ue.createElement(Ue.Fragment,null,o?Ue.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:l,flowId:p,type:d,hideOnFlowCompletion:s,onComplete:m,setVisible:c,setShowModal:g,onDismiss:y,showPagination:T=!1,customFormElements:C,allowBackNavigation:h,validationHandler:A,onFormDataChange:k,showFooter:P,prefillData:B,updateUrlOnPageChange:v,repeatable:f})=>{var $e;let S=b(b({},{linkCollection:on,multiInput:ji,callToAction:rn,selectList:un}),i),{primaryCTAClickSideEffects:F,secondaryCTAClickSideEffects:L}=ae(),[O,N]=Ko(!1),[V,W]=Ko({}),[Y,Q]=Ko(!1),[pe,H]=Ko(null),le=($e=t[o])!=null?$e:null,{markStepCompleted:fe,markStepStarted:Te,isLoading:re,updateCustomVariables:Z,markFlowCompleted:q}=J();fn(()=>{Z(n)},[n,re]),fn(()=>{k&&k(V,_(),t[o],o)},[V]);function _(){var M;return{data:(M=V[t[o].id])!=null?M:{},stepId:t[o].id,customVariables:n}}function Le($,M,D){let ie=o+1<t.length?t[o+1]:null;return l&&l($,D,ie,V,_()),r?r($,o,M,ie):!0}function he($,M){W(D=>{let ie={};return ie[$.id]=M,b(b({},D),ie)})}function Fe($){return $.selectedStep.imageUri?Ue.createElement(Ji,{image:$.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let ye=P&&Ue.createElement(en,{step:t[o],canContinue:O&&!Y,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>U(void 0,null,function*(){if(Q(!0),A){let D=yield A(t[o],o,t[o+1],V,_());if(D!==!0){H(typeof D=="string"?D:null),Q(!1);return}else H(null)}let $=b({},_());yield fe(p,t[o].id,$),o+1<t.length&&!h&&(yield Te(p,t[o+1].id));let M=Le(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),s&&M&&(c&&c(!1),g(!1)),yield q(p),f&&(yield Te(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(ie=>{ie.startsWith(Pr)&&window.localStorage.removeItem(ie)}))),F(t[o]),Q(!1),typeof window!="undefined"&&!h&&v&&o+1<t.length){let D=new URL(window.location.href);D.searchParams.set("p",t[o+1].id),window.history.pushState({},"",D.toString())}}),onSecondaryClick:()=>{Le(t[o],"secondary",o),L(t[o])},onBack:()=>U(void 0,null,function*(){o-1>=0&&(Q(!0),yield Te(p,t[o-1].id),Q(!1))}),steps:t,allowBackNavigation:h,errorMessage:pe,isSaving:Y});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Yi,{className:a("formContainer",e)},Ue.createElement(Hp,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(Xi,{key:le.id,type:d,className:a("formContent",e)},t.map($=>{let M=S[$.type];return le.id!==$.id?null:typeof M!="function"?M:Ue.createElement(M,{key:$.id,stepData:$,canContinue:O,setCanContinue:N,onSaveData:D=>{he($,D)},appearance:e,customFormElements:C,flowId:p,prefillData:B})}),T&&Ue.createElement(tn,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ye)),d=="large-modal"&&Ue.createElement(Fe,{selectedStep:t[o]})))};import xo from"react";import{createGlobalStyle as Vp}from"styled-components";var jp=Vp`
|
|
687
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${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 xo.createElement(xo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?xo.createElement(xo.Fragment,null):xo.createElement(jp,{inlineStyles:t})}import{useEffect as Gp,useState as Kp}from"react";function je(e){let[t,o]=Kp(!1),{markStepStarted:i,isLoading:n,getFlowStatus:r,getFlowSteps:l,getCurrentStepIndex:p}=J(),d=l(e);function s(){return U(this,null,function*(){!t&&!n&&r(e)===Me&&(o(!0),yield i(e,d[p(e)].id))})}return Gp(()=>{s()},[n,e]),{}}var hn=({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:k=!1,validationHandler:P,showFrigadeBranding:B=!1,onFormDataChange:v,showFooter:f=!0,prefillData:I={},updateUrlOnPageChange:S=!1})=>{let{getFlow:F,getFlowSteps:L,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:Y,markFlowNotStarted:Q,markStepStarted:pe}=J(),H=W(e),{mergeAppearanceWithDefault:le}=ee(),[fe,Te]=qp(null),{setOpenFlowState:re,getOpenFlowState:Z,hasOpenModals:q}=Be();je(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(gn(()=>{var $;if(_&&_.length>0&&k){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),pe(e,_[D].id))}}},[Fe]),gn(()=>{!O&&_&&_.length&&typeof window!="undefined"&&k&&(window.location.hash=_[H].id)},[O,H,_]),O)return null;let ye=F(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",et.createElement(Qe,{appearance:d,onClose:$e,visible:Le,style:$,dismissible:g,showFrigadeBranding:B},et.createElement(ne,{appearance:d}),et.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:k,validationHandler:P,onFormDataChange:v,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))}return o==="modal"&&T!=="center"?et.createElement(Do,{appearance:d,onClose:$e,visible:Le,modalPosition:T},et.createElement(ne,{appearance:d}),et.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:k,validationHandler:P,onFormDataChange:v,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C})):et.createElement(et.Fragment,null,et.createElement(ne,{appearance:d}),et.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:k,validationHandler:P,onFormDataChange:v,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))},xn=hn;import{useCallback as Or,useContext as Yp,useEffect as Xp}from"react";function Nr(){let{organizationId:e,userId:t,setOrganizationId:o}=Yp(X),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Je(),l=zt(),{verifySDKInitiated:p}=_t();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Xp(()=>{if(t&&e){if(t.startsWith(Ht))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=Or(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=Or((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=Or((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 Cn="frigade-xFrigade_guestUserId",yo="frigade-xFrigade_userId",yn=({})=>{let{setFlowResponses:e}=ao(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=po(),[l,p]=Co(n),{getFlowStatus:d}=J(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Jp(X),[y,T]=Co([]),[C,h]=Co([]),{organizationId:A}=Nr(),[k,P]=Co(A),[B,v]=Co(!1);Xt(()=>{if(!o&&t)for(let F=0;F<t.length;F++){let L=t[F],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(()=>{B||(v(!0),i())},[o,v]);function f(F){let L=s.find(O=>O.slug===F);L&&L.triggerType==="AUTOMATIC"&&!C.includes(L.slug)&&(h([...C,L.slug]),T([L]))}function I(){if(!n){let F=localStorage.getItem(yo);if(F){r(F);return}let L=localStorage.getItem(Cn);if(L){r(L);return}c(!0);let O=Ht+Qp();try{localStorage.setItem(Cn,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 F=[];s.forEach(L=>{if(L.data){let O=L.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(N=>{let V=N.replace('"imageUri":"',"").replace('"',"");if(F.includes(V))return;let W=new Image;W.src=V,F.push(V)})}})}}catch(F){}},[s]),Xt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Ht))try{localStorage.setItem(yo,n)}catch(F){console.log("Failed to save user id locally: Local storage available",F)}n===null&&setTimeout(()=>{n===null&&I()},50)},[n,s,m]),Xt(()=>{A!=k&&(P(A),e([]),i())},[A,k,P]);function S(){return vt.createElement(vt.Fragment,null,y.map(F=>d(F.slug)!==Me?null:vt.createElement("span",{key:F.slug},vt.createElement(xn,{flowId:F.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return vt.createElement(vt.Fragment,null,vt.createElement(S,null))};import{ErrorBoundary as Td}from"react-error-boundary";var Sn={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(Sn[o]){let n=Sn[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 bn(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 Tn}from"styled-system";import wn 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))),So=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=()=>wn.createElement(md,b(b({as:e},p),i),t);if(o!==void 0){let s=xe(l,o);return wn.createElement(td,{theme:s},d())}return d()};var bo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},gd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Fn=ud(So)(()=>({whiteSpace:"nowrap"}),fd(Tn({scale:"components.Button",variants:"components.Button"}),Tn({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 kn=hd(So)(xd({scale:"components.Text",variants:"components.Text"}),Cd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Pn=4,vn="px",yd=20,Sd=Object.fromEntries(Array.from(Array(yd+1),(e,t)=>t===0?[.5,`${.5*Pn}${vn}`]:[t,`${t*Pn}${vn}`])),Jt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Ir={colors:j(b({},Jt),{neutral:{foreground:Jt.gray300},primary:{background:Jt.blue500,foreground:Jt.white,inverted:Jt.blue500},negative:{foreground:Jt.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:bo,Text:Yo}};var Bn="https://api.frigade.com",X=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:Bn,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]=Ge(t||null),[p,d]=Ge(o||null),[s,m]=Ge([]),[c,g]=Ge([]),[y,T]=Ge([]),[C,h]=Ge({}),[A,k]=Ge({}),[P,B]=Ge([]),[v,f]=Ge({}),[I,S]=Ge(!1),[F,L]=Ge(!1),[O,N]=Ge(!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")}Xo(()=>{t&&l(t)},[t]),Xo(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(yo)&&window.localStorage.getItem(yo)!==r&&Fd()},[r]),Xo(()=>{o&&d(o)},[o]),Xo(()=>{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:k,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:B,customVariables:v,setCustomVariables:f,isNewGuestUser:I,setIsNewGuestUser:S,hasActiveFullPageFlow:F,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:Bn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return Bt.createElement(X.Provider,{value:Q},n);let{overrides:pe}=bn(W);return Bt.createElement(Td,{fallback:Bt.createElement(Bt.Fragment,null,n)},Bt.createElement(X.Provider,{value:Q},Bt.createElement(wd,{theme:xe(W.theme,Ir,pe!=null?pe:{},(re=i==null?void 0:i.theme)!=null?re:{})},n,Bt.createElement(yn,null))))};import fc from"react";import Ce,{useEffect as Hr,useState as rl}from"react";import Xe,{useState as Vd}from"react";import Ot from"styled-components";import Zo from"react";import Et from"react";import An from"styled-components";var En=An.span`
|
|
688
688
|
font-weight: 600;
|
|
689
689
|
font-size: 14px;
|
|
690
690
|
font-style: normal;
|
|
@@ -696,7 +696,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
696
696
|
margin-left: 32px;
|
|
697
697
|
padding-right: 12px;
|
|
698
698
|
${e=>ke(e)}
|
|
699
|
-
`,
|
|
699
|
+
`,Pd=An.div`
|
|
700
700
|
flex-direction: row;
|
|
701
701
|
justify-content: space-between;
|
|
702
702
|
display: flex;
|
|
@@ -705,11 +705,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
705
705
|
padding-right: 8px;
|
|
706
706
|
width: 100%;
|
|
707
707
|
${e=>ke(e)}
|
|
708
|
-
`,
|
|
708
|
+
`,Jo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>Et.createElement(Et.Fragment,null,Et.createElement(Pd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:b({},n)},i==="left"&&e&&Et.createElement(En,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Et.createElement(nt,{appearance:p,value:t,type:l,primaryColor:r}),i==="right"&&e&&Et.createElement(En,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Et.createElement(ne,{appearance:p}));import wo from"styled-components";var On=wo.div`
|
|
709
709
|
font-weight: 700;
|
|
710
710
|
font-size: 18px;
|
|
711
711
|
line-height: 22px;
|
|
712
|
-
`,
|
|
712
|
+
`,Nn=wo.p`
|
|
713
713
|
font-weight: 600;
|
|
714
714
|
font-size: 16px;
|
|
715
715
|
line-height: 24px;
|
|
@@ -717,7 +717,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
717
717
|
letter-spacing: 0.32px;
|
|
718
718
|
font-style: normal;
|
|
719
719
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
720
|
-
`,
|
|
720
|
+
`,In=wo.p`
|
|
721
721
|
font-weight: 400;
|
|
722
722
|
font-size: 14px;
|
|
723
723
|
font-style: normal;
|
|
@@ -726,26 +726,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
726
726
|
letter-spacing: 0.28px;
|
|
727
727
|
margin: 8px 0px 0px 0px;
|
|
728
728
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
729
|
-
`,
|
|
729
|
+
`,Qo=wo.div`
|
|
730
730
|
width: 6px;
|
|
731
731
|
position: absolute;
|
|
732
732
|
left: 0;
|
|
733
733
|
height: 100%;
|
|
734
734
|
border-top-right-radius: 4px;
|
|
735
735
|
border-bottom-right-radius: 4px;
|
|
736
|
-
`,
|
|
736
|
+
`,Ln=wo.div`
|
|
737
737
|
flex-direction: row;
|
|
738
738
|
justify-content: flex-start;
|
|
739
739
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
740
740
|
padding-right: 16px;
|
|
741
|
-
`;var
|
|
741
|
+
`;var $n=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return Zo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&Zo.createElement(Qo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=l==null?void 0:l.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Zo.createElement(Ln,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},Zo.createElement(Jo,{value:e.complete,labelPosition:"left",label:(s=e.stepName)!=null?s:e.title,style:n,primaryColor:(c=(m=l==null?void 0:l.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:l})))};import At from"react";import Lr from"styled-components";import Ro from"styled-components";var mC=Ro.h1`
|
|
742
742
|
display: flex;
|
|
743
743
|
margin: 0;
|
|
744
744
|
font-size: 18px;
|
|
745
|
-
`,
|
|
745
|
+
`,uC=Ro.h2`
|
|
746
746
|
font-size: 15px;
|
|
747
747
|
color: #4d4d4d;
|
|
748
|
-
`,
|
|
748
|
+
`,Mn=Ro.div`
|
|
749
749
|
position: absolute;
|
|
750
750
|
left: 0;
|
|
751
751
|
top: 0;
|
|
@@ -754,7 +754,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
754
754
|
border-radius: 20px;
|
|
755
755
|
background-color: ${e=>e.theme.colorPrimary};
|
|
756
756
|
transition: width 0.5s;
|
|
757
|
-
|
|
757
|
+
`,Dn=Ro.div`
|
|
758
758
|
position: relative;
|
|
759
759
|
left: 0;
|
|
760
760
|
top: 0;
|
|
@@ -764,7 +764,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
764
764
|
border-radius: 20px;
|
|
765
765
|
background-color: ${e=>e.theme.colorPrimary};
|
|
766
766
|
opacity: 0.12;
|
|
767
|
-
`;var
|
|
767
|
+
`;var vd=Lr.div`
|
|
768
768
|
display: flex;
|
|
769
769
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
770
770
|
justify-content: flex-start;
|
|
@@ -772,24 +772,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
772
772
|
width: 100%;
|
|
773
773
|
|
|
774
774
|
${e=>ke(e)}
|
|
775
|
-
`,
|
|
775
|
+
`,Bd=Lr.div`
|
|
776
776
|
flex-grow: 1;
|
|
777
777
|
position: relative;
|
|
778
778
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
779
|
-
`,
|
|
779
|
+
`,Ed=Lr.span`
|
|
780
780
|
font-weight: 600;
|
|
781
781
|
font-size: 14px;
|
|
782
782
|
line-height: 18px;
|
|
783
783
|
padding-right: ${e=>e.padding};
|
|
784
784
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
785
785
|
${e=>ke(e)}
|
|
786
|
-
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:
|
|
786
|
+
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var g;if(t===0)return At.createElement(At.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=l==null?void 0:l.theme)==null?void 0:g.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",s=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${s}% complete`),i==="top"&&(m="0px"),At.createElement(vd,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},At.createElement(Ed,{className:a("progressBarStepText",l),styleOverrides:j(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:m,textLocation:i},c),At.createElement(Bd,{textLocation:i,className:a("progressBar",l)},At.createElement(Mn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),At.createElement(Dn,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};import To from"react";import Od from"styled-components";import tr from"react";import er from"react";var Qt=({stepData:e,appearance:t})=>er.createElement(er.Fragment,null,er.createElement(Nn,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),er.createElement(In,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import $r from"react";var Zt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return $r.createElement(Vo,{className:a("ctaContainer",t)},$r.createElement(te,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&$r.createElement(te,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Rt=({stepData:e,appearance:t})=>tr.createElement(tr.Fragment,null,tr.createElement(Qt,{stepData:e,appearance:t}),tr.createElement(Zt,{stepData:e,appearance:t}));import Ad from"react";function Un(e){return Ad.createElement(Re,{appearance:e.appearance,videoUri:e.videoUri})}var Mr="default",Nd=Od.img`
|
|
787
787
|
border-radius: 4px;
|
|
788
788
|
max-height: 260px;
|
|
789
789
|
min-height: 200px;
|
|
790
|
-
`,
|
|
790
|
+
`,Wn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return To.createElement("div",null,o)}return To.createElement(On,{className:a("checklistStepContent",t)},e.imageUri?To.createElement(Nd,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?To.createElement(Un,{videoUri:e.videoUri,appearance:t}):null,To.createElement(Rt,{stepData:e,appearance:t}))};import ze,{useRef as Id,useState as Ld}from"react";import eo from"styled-components";var zn=eo.div`
|
|
791
791
|
display: block;
|
|
792
|
-
|
|
792
|
+
`,$d=eo.div`
|
|
793
793
|
display: flex;
|
|
794
794
|
flex-direction: row;
|
|
795
795
|
flex-wrap: wrap;
|
|
@@ -799,20 +799,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
799
799
|
align-content: center;
|
|
800
800
|
margin-top: 24px;
|
|
801
801
|
margin-bottom: 24px;
|
|
802
|
-
`,
|
|
802
|
+
`,Md=eo.div`
|
|
803
803
|
display: flex;
|
|
804
804
|
align-items: center;
|
|
805
805
|
justify-content: flex-start;
|
|
806
806
|
flex-direction: column;
|
|
807
807
|
margin-right: 16px;
|
|
808
|
-
`,
|
|
808
|
+
`,Dd=eo.video`
|
|
809
809
|
width: 200px;
|
|
810
810
|
height: 120px;
|
|
811
|
-
|
|
811
|
+
`,Ud=eo.div`
|
|
812
812
|
font-size: 14px;
|
|
813
813
|
line-height: 20px;
|
|
814
814
|
text-align: center;
|
|
815
|
-
`,
|
|
815
|
+
`,Wd=eo.div`
|
|
816
816
|
position: absolute;
|
|
817
817
|
width: 200px;
|
|
818
818
|
height: 120px;
|
|
@@ -832,9 +832,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
832
832
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
833
833
|
border-radius: 50%;
|
|
834
834
|
}
|
|
835
|
-
`,
|
|
835
|
+
`,_n="videoCarousel",Hn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(zn,null,ze.createElement(Rt,{stepData:e,appearance:t}));function o({video:r}){let l=Id(),[p,d]=Ld(!1);return ze.createElement(Md,null,!p&&ze.createElement(Wd,{onClick:()=>{d(!0),l.current.play()},appearance:t},ze.createElement(jo,null)),ze.createElement(Dd,{controls:p,ref:l,play:p,src:r.uri}),ze.createElement(Ud,null,r.title))}let i=e.props;return i.videos?ze.createElement(zn,null,ze.createElement(Qt,{stepData:e,appearance:t}),ze.createElement($d,null,i.videos.map((r,l)=>ze.createElement("span",{key:`${r.uri}-${l}`},ze.createElement(o,{video:r})))),ze.createElement(Zt,{stepData:e,appearance:t})):null};import lt from"react";import or from"styled-components";var Vn=or.div`
|
|
836
836
|
display: block;
|
|
837
|
-
`,
|
|
837
|
+
`,zd=or.pre`
|
|
838
838
|
display: block;
|
|
839
839
|
background-color: #2a2a2a;
|
|
840
840
|
color: #f8f8f8;
|
|
@@ -850,14 +850,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
850
850
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
851
851
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
852
852
|
margin-bottom: 24px;
|
|
853
|
-
`,
|
|
853
|
+
`,_d=or.div`
|
|
854
854
|
font-size: 15px;
|
|
855
855
|
line-height: 20px;
|
|
856
856
|
margin-bottom: 12px;
|
|
857
857
|
margin-top: 12px;
|
|
858
|
-
`,
|
|
858
|
+
`,Hd=or.div`
|
|
859
859
|
margin-top: 24px;
|
|
860
|
-
`,
|
|
860
|
+
`,jn="codeSnippet",Gn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(Vn,null,lt.createElement(Rt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?lt.createElement(Vn,null,lt.createElement(Qt,{stepData:e,appearance:t}),lt.createElement(Hd,null,o.codeSnippets.map((n,r)=>lt.createElement("div",{key:r},n.title?lt.createElement(_d,null,n.title):null,n.code?lt.createElement(zd,null,n.code):null))),lt.createElement(Zt,{stepData:e,appearance:t})):null};var jd=Ot.div`
|
|
861
861
|
display: flex;
|
|
862
862
|
flex-direction: row;
|
|
863
863
|
overflow: hidden;
|
|
@@ -865,14 +865,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
865
865
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
866
866
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
867
867
|
${e=>ke(e)}
|
|
868
|
-
`,
|
|
868
|
+
`,Gd=Ot.h1`
|
|
869
869
|
font-size: 18px;
|
|
870
870
|
font-style: normal;
|
|
871
871
|
font-weight: 700;
|
|
872
872
|
line-height: 24px;
|
|
873
873
|
letter-spacing: 0.36px;
|
|
874
874
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
875
|
-
`,
|
|
875
|
+
`,Kd=Ot.h2`
|
|
876
876
|
font-size: 14px;
|
|
877
877
|
font-style: normal;
|
|
878
878
|
font-weight: 400;
|
|
@@ -880,44 +880,44 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
880
880
|
letter-spacing: 0.28px;
|
|
881
881
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
882
882
|
margin: 10px 0px 0px 0px;
|
|
883
|
-
`,
|
|
883
|
+
`,Kn=Ot.div``,qd=Ot.div`
|
|
884
884
|
list-style: none;
|
|
885
885
|
padding: 0;
|
|
886
886
|
margin: 0;
|
|
887
887
|
cursor: pointer;
|
|
888
888
|
width: 300px;
|
|
889
|
-
`,
|
|
889
|
+
`,Yd=Ot.div`
|
|
890
890
|
width: 1px;
|
|
891
891
|
margin-right: 40px;
|
|
892
892
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
893
|
-
`,
|
|
893
|
+
`,Xd=Ot.div`
|
|
894
894
|
flex: 2;
|
|
895
895
|
padding: 2rem 2rem 2rem 0rem;
|
|
896
|
-
`,
|
|
896
|
+
`,Jd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=ee();d=m(d);let c={[Mr]:Wn,[_n]:Hn,[jn]:Gn},g=b(b({},c),p),[y,T]=Vd(0),C=n!=null?n:y,h=r!=null?r:T,A=o.filter(P=>P.complete===!0).length,k=()=>{var P;return!((P=o[C])!=null&&P.type)||!g[o[C].type]?g[Mr]({stepData:o[C],appearance:d}):g[o[C].type]({stepData:o[C],appearance:d})};return Xe.createElement(jd,{type:s,styleOverrides:i,className:l,appearance:d},Xe.createElement(Kn,{style:{flex:1}},Xe.createElement(Kn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Xe.createElement(Gd,{className:a("checklistTitle",d),appearance:d},e),Xe.createElement(Kd,{className:a("checklistSubtitle",d),appearance:d},t),Xe.createElement(We,{total:o.length,count:A,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Xe.createElement(qd,{className:a("checklistStepsContainer",d)},o.map((P,B)=>Xe.createElement($n,{data:P,index:B,key:B,listLength:o.length,isSelected:B===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{h(B)},appearance:d})))),Xe.createElement(Yd,{appearance:d,className:a("checklistDivider",d)}),Xe.createElement(Xd,null,Xe.createElement(k,null)))},Dr=Jd;import G,{useState as tc}from"react";import qn from"react";import Qd from"styled-components";var Zd=Qd.svg`
|
|
897
897
|
transition: 'transform 0.35s ease-in-out';
|
|
898
|
-
`,
|
|
898
|
+
`,to=({style:e,className:t})=>qn.createElement(Zd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},qn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import Se from"styled-components";var Ur={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Yn=Se.div`
|
|
899
899
|
max-height: 350px;
|
|
900
900
|
padding-bottom: 40px;
|
|
901
|
-
`,
|
|
901
|
+
`,Xn=Se.div`
|
|
902
902
|
display: flex;
|
|
903
903
|
flex-direction: column;
|
|
904
904
|
margin-top: 20px;
|
|
905
|
-
`,
|
|
905
|
+
`,Jn=Se.h1`
|
|
906
906
|
font-style: normal;
|
|
907
907
|
font-weight: 600;
|
|
908
908
|
font-size: 30px;
|
|
909
909
|
line-height: 36px;
|
|
910
910
|
margin-bottom: 16px;
|
|
911
911
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
912
|
-
`,
|
|
912
|
+
`,Qn=Se.h2`
|
|
913
913
|
font-weight: 400;
|
|
914
914
|
font-size: 16px;
|
|
915
915
|
line-height: 20px;
|
|
916
916
|
margin-bottom: 16px;
|
|
917
917
|
padding-left: 1px;
|
|
918
918
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
919
|
-
`,
|
|
920
|
-
${e=>
|
|
919
|
+
`,Zn=Se.div`
|
|
920
|
+
${e=>E(e)} {
|
|
921
921
|
border: 1px solid #fafafa;
|
|
922
922
|
}
|
|
923
923
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -926,12 +926,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
926
926
|
flex-direction: column;
|
|
927
927
|
min-height: 240px;
|
|
928
928
|
overflow: hidden;
|
|
929
|
-
`,
|
|
929
|
+
`,Rn=Se.div`
|
|
930
930
|
display: flex;
|
|
931
931
|
flex-direction: row;
|
|
932
932
|
justify-content: space-between;
|
|
933
|
-
`,
|
|
934
|
-
${e=>
|
|
933
|
+
`,es=Se.p`
|
|
934
|
+
${e=>E(e)} {
|
|
935
935
|
font-weight: 400;
|
|
936
936
|
font-size: 10px;
|
|
937
937
|
line-height: 12px;
|
|
@@ -939,13 +939,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
939
939
|
color: #8c8c8c;
|
|
940
940
|
margin: 20px;
|
|
941
941
|
}
|
|
942
|
-
`,
|
|
942
|
+
`,ts=Se.div`
|
|
943
943
|
display: flex;
|
|
944
944
|
flex-direction: row;
|
|
945
|
-
`,
|
|
945
|
+
`,os=Se.div`
|
|
946
946
|
flex: 1;
|
|
947
|
-
`,
|
|
948
|
-
${e=>
|
|
947
|
+
`,rs=Se.div`
|
|
948
|
+
${e=>E(e)} {
|
|
949
949
|
display: flex;
|
|
950
950
|
justify-content: center;
|
|
951
951
|
align-content: center;
|
|
@@ -954,8 +954,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
954
954
|
padding-left: 8px;
|
|
955
955
|
padding-right: 8px;
|
|
956
956
|
}
|
|
957
|
-
`,
|
|
958
|
-
${e=>
|
|
957
|
+
`,is=Se.p`
|
|
958
|
+
${e=>E(e)} {
|
|
959
959
|
font-style: normal;
|
|
960
960
|
font-weight: 600;
|
|
961
961
|
font-size: 22px;
|
|
@@ -966,8 +966,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
966
966
|
margin-top: 20px;
|
|
967
967
|
margin-bottom: 16px;
|
|
968
968
|
}
|
|
969
|
-
`,
|
|
970
|
-
${e=>
|
|
969
|
+
`,ns=Se.p`
|
|
970
|
+
${e=>E(e)} {
|
|
971
971
|
font-weight: 400;
|
|
972
972
|
font-size: 14px;
|
|
973
973
|
line-height: 18px;
|
|
@@ -975,15 +975,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
975
975
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
976
976
|
margin-bottom: 8px;
|
|
977
977
|
}
|
|
978
|
-
`,
|
|
979
|
-
${e=>
|
|
978
|
+
`,ss=Se.div`
|
|
979
|
+
${e=>E(e)} {
|
|
980
980
|
display: flex;
|
|
981
981
|
flex-direction: row;
|
|
982
982
|
justify-content: center;
|
|
983
983
|
gap: 8px;
|
|
984
984
|
}
|
|
985
|
-
`,
|
|
986
|
-
${e=>
|
|
985
|
+
`,ls=Se.div`
|
|
986
|
+
${e=>E(e)} {
|
|
987
987
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
988
988
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
989
989
|
:hover {
|
|
@@ -1002,8 +1002,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1002
1002
|
justify-content: space-between;
|
|
1003
1003
|
position: relative;
|
|
1004
1004
|
cursor: pointer;
|
|
1005
|
-
`,
|
|
1006
|
-
${e=>
|
|
1005
|
+
`,as=Se.p`
|
|
1006
|
+
${e=>E(e)} {
|
|
1007
1007
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1008
1008
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1009
1009
|
}
|
|
@@ -1011,12 +1011,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1011
1011
|
font-size: 14px;
|
|
1012
1012
|
line-height: 22px;
|
|
1013
1013
|
margin: 0;
|
|
1014
|
-
`,
|
|
1014
|
+
`,ps=Se.div`
|
|
1015
1015
|
display: flex;
|
|
1016
1016
|
flex-direction: row;
|
|
1017
1017
|
justify-content: flex-end;
|
|
1018
1018
|
align-content: center;
|
|
1019
|
-
`,
|
|
1019
|
+
`,ds=Se.div`
|
|
1020
1020
|
display: flex;
|
|
1021
1021
|
flex: 1;
|
|
1022
1022
|
flex-direction: row;
|
|
@@ -1024,14 +1024,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1024
1024
|
align-content: center;
|
|
1025
1025
|
align-items: center;
|
|
1026
1026
|
margin-right: 20px;
|
|
1027
|
-
`,
|
|
1027
|
+
`,cs=Se.div`
|
|
1028
1028
|
display: block;
|
|
1029
1029
|
width: 100%;
|
|
1030
|
-
`;import
|
|
1030
|
+
`;import Rd from"styled-components";var ms=Rd.div`
|
|
1031
1031
|
flex-direction: column;
|
|
1032
1032
|
justify-content: center;
|
|
1033
1033
|
display: flex;
|
|
1034
|
-
`;import pt from"react";import at from"styled-components";var
|
|
1034
|
+
`;import pt from"react";import at from"styled-components";var us=at.div`
|
|
1035
1035
|
border: 1px solid #fafafa;
|
|
1036
1036
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1037
1037
|
border-radius: 14px;
|
|
@@ -1039,14 +1039,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1039
1039
|
display: flex;
|
|
1040
1040
|
flex-direction: column;
|
|
1041
1041
|
overflow: hidden;
|
|
1042
|
-
`,
|
|
1042
|
+
`,fs=at.div`
|
|
1043
1043
|
display: flex;
|
|
1044
1044
|
flex-wrap: wrap;
|
|
1045
1045
|
justify-content: space-between;
|
|
1046
1046
|
overflow: hidden;
|
|
1047
1047
|
row-gap: 10px;
|
|
1048
|
-
`,
|
|
1049
|
-
${e=>
|
|
1048
|
+
`,gs=at.div`
|
|
1049
|
+
${e=>E(e)} {
|
|
1050
1050
|
color: #595959;
|
|
1051
1051
|
}
|
|
1052
1052
|
text-transform: uppercase;
|
|
@@ -1055,8 +1055,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1055
1055
|
line-height: 12px;
|
|
1056
1056
|
letter-spacing: 0.09em;
|
|
1057
1057
|
margin-bottom: 12px;
|
|
1058
|
-
`,
|
|
1059
|
-
${e=>
|
|
1058
|
+
`,hs=at.div`
|
|
1059
|
+
${e=>E(e)} {
|
|
1060
1060
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1061
1061
|
background: #ffffff;
|
|
1062
1062
|
border: 1px solid #fafafa;
|
|
@@ -1068,8 +1068,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1068
1068
|
|
|
1069
1069
|
max-width: 150px;
|
|
1070
1070
|
min-width: 200px;
|
|
1071
|
-
`,
|
|
1072
|
-
${e=>
|
|
1071
|
+
`,xs=at.div`
|
|
1072
|
+
${e=>E(e)} {
|
|
1073
1073
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1074
1074
|
}
|
|
1075
1075
|
width: 40px;
|
|
@@ -1080,14 +1080,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1080
1080
|
justify-content: center;
|
|
1081
1081
|
align-content: center;
|
|
1082
1082
|
align-items: center;
|
|
1083
|
-
`,
|
|
1083
|
+
`,Cs=at.div`
|
|
1084
1084
|
font-weight: 600;
|
|
1085
1085
|
font-size: 20px;
|
|
1086
1086
|
line-height: 24px;
|
|
1087
1087
|
width: 20px;
|
|
1088
1088
|
height: 20px;
|
|
1089
|
-
`,
|
|
1090
|
-
${e=>
|
|
1089
|
+
`,ys=at.div`
|
|
1090
|
+
${e=>E(e)} {
|
|
1091
1091
|
color: #434343;
|
|
1092
1092
|
}
|
|
1093
1093
|
font-weight: 600;
|
|
@@ -1095,20 +1095,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1095
1095
|
line-height: 17px;
|
|
1096
1096
|
margin-top: 12px;
|
|
1097
1097
|
margin-bottom: 8px;
|
|
1098
|
-
`,
|
|
1099
|
-
${e=>
|
|
1098
|
+
`,Ss=at.div`
|
|
1099
|
+
${e=>E(e)} {
|
|
1100
1100
|
color: #8c8c8c;
|
|
1101
1101
|
}
|
|
1102
1102
|
font-weight: 400;
|
|
1103
1103
|
font-size: 12px;
|
|
1104
1104
|
line-height: 14px;
|
|
1105
|
-
`,
|
|
1105
|
+
`,bs=at.a`
|
|
1106
1106
|
color: ${e=>e.color};
|
|
1107
1107
|
font-size: 12px;
|
|
1108
1108
|
line-height: 14px;
|
|
1109
1109
|
font-weight: 400;
|
|
1110
1110
|
cursor: pointer;
|
|
1111
|
-
`;var
|
|
1111
|
+
`;var ec=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=ae();return pt.createElement(us,{style:t,className:a("guideContainer",n)},pt.createElement(gs,{className:a("guideTitle",n)},o),pt.createElement(fs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var s;return pt.createElement(hs,{key:`guide-${(s=p.id)!=null?s:d}`,className:a("guideItem",n)},p.icon&&pt.createElement(xs,{className:a("guideIcon",n)},pt.createElement(Cs,null,p.icon)),pt.createElement(ys,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:me(p.title)}),pt.createElement(Ss,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:me(p.subtitle)}),pt.createElement(bs,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&l(p),r&&r(p)}},p.primaryButtonTitle))})))},Fo=ec;var oc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:l,setSelectedStep:p,customStepTypes:d,appearance:s,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let y=({stepData:f,handleSecondaryCTAClick:I,handleCTAClick:S})=>f?G.createElement(rs,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},G.createElement(is,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:me(f.title)}),G.createElement(ns,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:me(f.subtitle)}),G.createElement(ss,{className:a("checklistCTAContainer",s)},f.secondaryButtonTitle&&G.createElement(te,{title:f.secondaryButtonTitle,onClick:I,appearance:s,secondary:!0}),G.createElement(te,{title:f.primaryButtonTitle,onClick:S,appearance:s}))):G.createElement(G.Fragment,null),C=b(b({},{default:f=>{var L;if((L=e[k])!=null&&L.StepContent){let O=e[k].StepContent;return G.createElement("div",null,O)}let I=e[k];return G.createElement(y,{stepData:f,handleCTAClick:()=>{I.handlePrimaryButtonClick&&I.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{I.handleSecondaryButtonClick&&I.handleSecondaryButtonClick()}})}}),d),[h,A]=tc(0),k=l!=null?l:h,P=p!=null?p:A,B=()=>{var f;return e?!((f=e[k])!=null&&f.type)||!C[e[k].type]?C.default(e[k]):C[e[k].type]({stepData:e[k],primaryColor:s.theme.colorPrimary}):G.createElement(G.Fragment,null)},v=e.filter(f=>f.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&(Ur.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=Ur),G.createElement(Qe,{onClose:r,visible:n,appearance:s},G.createElement(cs,null,G.createElement(Xn,null,G.createElement(Jn,{appearance:s,className:a("checklistTitle",s)},t),G.createElement(Qn,{appearance:s,className:a("checklistSubtitle",s)},o)),G.createElement(Yn,null,e&&e.length>0&&G.createElement(Zn,{className:a("stepsContainer",s)},G.createElement(Rn,null,G.createElement("div",{style:{flex:3}},G.createElement(es,{className:a("stepsTitle",s)},i)),G.createElement(ds,null,G.createElement(We,{style:{width:"100%"},count:v,total:e.length,appearance:s}))),G.createElement(ts,null,G.createElement(os,{className:a("checklistStepListContainer",s),appearance:s},e.map((f,I)=>{var F;let S=k===I;return G.createElement(ls,{selected:S,className:a(`checklistStepListItem${S?"Selected":""}`,s),key:`checklist-guide-step-${(F=f.id)!=null?F:I}`,disabled:f.blocked,onClick:()=>{f.blocked||P(I)},title:f.blocked?"Finish remaining steps to continue":void 0},S&&G.createElement(Qo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(as,{selected:S,className:a(`checklistStepListStepName${S?"Selected":""}`,s)},f.stepName),G.createElement(ps,null,G.createElement(nt,{value:f.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:f.progress,appearance:s}),G.createElement(ms,null,G.createElement(to,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),G.createElement(B,null))),m&&m.length>0&&G.createElement(Fo,{steps:m,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:f=>(g&&g(f),!0)}))))):G.createElement(G.Fragment,null)},Wr=oc;import Ie,{useEffect as Ms,useState as rc}from"react";import we from"react";import dt from"styled-components";var ws=dt.div`
|
|
1112
1112
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1113
1113
|
border: 1px solid;
|
|
1114
1114
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1120,19 +1120,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1120
1120
|
display: flex;
|
|
1121
1121
|
flex-direction: column;
|
|
1122
1122
|
transition: max-height 0.25s;
|
|
1123
|
-
`,
|
|
1123
|
+
`,Ts=dt.div`
|
|
1124
1124
|
display: flex;
|
|
1125
1125
|
margin-bottom: 20px;
|
|
1126
|
-
`,
|
|
1126
|
+
`,Fs=dt.img`
|
|
1127
1127
|
border-radius: 4px;
|
|
1128
1128
|
max-height: 260px;
|
|
1129
1129
|
min-height: 200px;
|
|
1130
|
-
`,
|
|
1130
|
+
`,ks=dt.div`
|
|
1131
1131
|
display: flex;
|
|
1132
1132
|
flex-direction: row;
|
|
1133
1133
|
justify-content: space-between;
|
|
1134
1134
|
align-items: center;
|
|
1135
|
-
`,
|
|
1135
|
+
`,Ps=dt.p`
|
|
1136
1136
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1137
1137
|
font-style: normal;
|
|
1138
1138
|
font-weight: 500;
|
|
@@ -1143,23 +1143,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1143
1143
|
:hover {
|
|
1144
1144
|
opacity: 0.8;
|
|
1145
1145
|
}
|
|
1146
|
-
`,
|
|
1146
|
+
`,vs=dt.div`
|
|
1147
1147
|
cursor: pointer;
|
|
1148
1148
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1149
1149
|
:hover {
|
|
1150
1150
|
opacity: 0.8;
|
|
1151
1151
|
}
|
|
1152
|
-
`,
|
|
1152
|
+
`,p0=dt.div``,Bs=dt.p`
|
|
1153
1153
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1154
1154
|
font-weight: 400;
|
|
1155
1155
|
font-size: 14px;
|
|
1156
1156
|
line-height: 22px;
|
|
1157
|
-
`,
|
|
1157
|
+
`,Es=dt.div`
|
|
1158
1158
|
display: flex;
|
|
1159
1159
|
flex-direction: row;
|
|
1160
1160
|
justify-content: flex-start;
|
|
1161
1161
|
align-items: center;
|
|
1162
|
-
`;var
|
|
1162
|
+
`;var As=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,g;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function s(){var y;return we.createElement(we.Fragment,null,e.imageUri||e.videoUri?we.createElement(Ts,{className:a("stepMediaContainer",r)},e.imageUri?we.createElement(Fs,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?we.createElement(Re,{appearance:r,videoUri:e.videoUri}):null):null,we.createElement(Bs,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:me(e.subtitle)}),we.createElement(Vo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?we.createElement(te,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,we.createElement(te,{title:(y=e.primaryButtonTitle)!=null?y:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!l)return null;let y=l[e.type];return y?y(e,r):null}return we.createElement(ws,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},we.createElement(ks,{className:a("stepHeader",r)},we.createElement(Es,null,we.createElement(Jo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),we.createElement(Ps,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:me(e.title),onClick:()=>o()})),we.createElement(vs,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},we.createElement(to,{style:j(b({},p),{transition:"transform 0.2s ease-in-out"})}))),we.createElement("div",{key:e.id,style:b({},d)},(g=m())!=null?g:s()))};import oo from"styled-components";var T0=oo.div`
|
|
1163
1163
|
background: #ffffff;
|
|
1164
1164
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1165
1165
|
border-radius: 6px;
|
|
@@ -1173,26 +1173,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1173
1173
|
|
|
1174
1174
|
max-width: 800px;
|
|
1175
1175
|
min-width: 350px;
|
|
1176
|
-
`,
|
|
1176
|
+
`,Os=oo.div`
|
|
1177
1177
|
display: flex;
|
|
1178
1178
|
flex-direction: column;
|
|
1179
|
-
`,
|
|
1179
|
+
`,Ns=oo.h1`
|
|
1180
1180
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1181
1181
|
font-style: normal;
|
|
1182
1182
|
font-weight: 700;
|
|
1183
1183
|
font-size: 20px;
|
|
1184
1184
|
line-height: 24px;
|
|
1185
1185
|
margin-bottom: 8px;
|
|
1186
|
-
`,
|
|
1186
|
+
`,Is=oo.h2`
|
|
1187
1187
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1188
1188
|
font-weight: 400;
|
|
1189
1189
|
font-size: 14px;
|
|
1190
1190
|
line-height: 23px;
|
|
1191
1191
|
margin: 2px 0 0 0;
|
|
1192
|
-
`,
|
|
1192
|
+
`,Ls=oo.div`
|
|
1193
1193
|
display: block;
|
|
1194
1194
|
width: 100%;
|
|
1195
|
-
|
|
1195
|
+
`,$s=oo.div`
|
|
1196
1196
|
display: flex;
|
|
1197
1197
|
width: 100%;
|
|
1198
1198
|
flex-direction: column;
|
|
@@ -1200,23 +1200,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1200
1200
|
padding: 24px;
|
|
1201
1201
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1202
1202
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1203
|
-
`;var
|
|
1203
|
+
`;var ic=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:s,appearance:m,type:c,className:g,customStepTypes:y,style:T})=>{let C=o.filter(v=>v.complete).length,[h,A]=rc(Array(o.length).fill(!0));Ms(()=>{let v=[...h];if(r){for(let f=0;f<o.length;f++)if(!o[f].complete){v[f]=!1;break}A(v)}},[]),Ms(()=>{r&&k(d)},[d]);let k=v=>{let f=[...h];if(l)for(let I=0;I<h.length;++I)I!==v&&(f[I]=!0);f[v]=!f[v],A(f)};if(!n&&c=="modal")return Ie.createElement(Ie.Fragment,null);let P=Ie.createElement(Ie.Fragment,null,Ie.createElement(Os,null,Ie.createElement(Ns,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:me(e)}),Ie.createElement(Is,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:me(t)})),Ie.createElement(We,{display:"percent",count:C,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),B=Ie.createElement(Ls,{className:be(a("checklistContainer",m),g)},o.map((v,f)=>{var S;let I=h[f];return Ie.createElement(As,{appearance:m,stepData:v,collapsed:I,key:`modal-checklist-${(S=v.id)!=null?S:f}`,onClick:()=>{if(d===f){k(f);return}s(f)},onPrimaryButtonClick:()=>{v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick(),p&&!v.completionCriteria&&f<h.length-1&&h[f+1]&&s(f+1)},onSecondaryButtonClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?Ie.createElement($s,{appearance:m,className:be(a("checklistInlineContainer",m),g),style:T},P,B):Ie.createElement(Ie.Fragment,null,Ie.createElement(Qe,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:P},B))},zr=ic;import ue,{useEffect as _r,useRef as mc,useState as Nt}from"react";import{useEffect as nc,useState as sc}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]=sc(t),n=null,r=()=>{n!==null?clearTimeout(n):l(),n=setTimeout(()=>{l()},16)},l=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,s])=>{if(!window)return[d,!1];let m=window.matchMedia(s);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return nc(()=>{l()},[]),o};import ro from"react";import ge,{css as Us,keyframes as Ws}from"styled-components";var zs=Us`
|
|
1204
1204
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1205
|
-
`,
|
|
1205
|
+
`,lc=Us`
|
|
1206
1206
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1207
|
-
`,
|
|
1207
|
+
`,ac=Ws`
|
|
1208
1208
|
from {
|
|
1209
1209
|
opacity: 0;
|
|
1210
1210
|
} to {
|
|
1211
1211
|
opacity: 1;
|
|
1212
1212
|
}
|
|
1213
|
-
`,
|
|
1213
|
+
`,pc=Ws`
|
|
1214
1214
|
from {
|
|
1215
1215
|
opacity: 1;
|
|
1216
1216
|
} to {
|
|
1217
1217
|
opacity: 0;
|
|
1218
1218
|
}
|
|
1219
|
-
`,
|
|
1219
|
+
`,_s=ge.div`
|
|
1220
1220
|
margin: 0 -20px;
|
|
1221
1221
|
overflow-x: auto;
|
|
1222
1222
|
padding-left: 20px;
|
|
@@ -1233,14 +1233,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1233
1233
|
::-webkit-scrollbar {
|
|
1234
1234
|
display: none;
|
|
1235
1235
|
}
|
|
1236
|
-
`,
|
|
1236
|
+
`,Hs=ge.div`
|
|
1237
1237
|
display: flex;
|
|
1238
1238
|
flex-flow: row nowrap;
|
|
1239
1239
|
gap: 0 16px;
|
|
1240
1240
|
scroll-snap-align: center;
|
|
1241
1241
|
scroll-snap-stop: always;
|
|
1242
|
-
`,
|
|
1243
|
-
animation: ${e=>e.reversed?
|
|
1242
|
+
`,Vs=ge.div`
|
|
1243
|
+
animation: ${e=>e.reversed?pc:ac} 0.25s ease-out;
|
|
1244
1244
|
background: linear-gradient(
|
|
1245
1245
|
to right,
|
|
1246
1246
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1249,8 +1249,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1249
1249
|
position: absolute;
|
|
1250
1250
|
width: 64px;
|
|
1251
1251
|
z-index: 10;
|
|
1252
|
-
`,js=
|
|
1253
|
-
${
|
|
1252
|
+
`,js=ge.button`
|
|
1253
|
+
${zs}
|
|
1254
1254
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1255
1255
|
align-items: center;
|
|
1256
1256
|
border-radius: 50%;
|
|
@@ -1261,11 +1261,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1261
1261
|
justify-content: center;
|
|
1262
1262
|
position: absolute;
|
|
1263
1263
|
width: 48px;
|
|
1264
|
-
`,
|
|
1264
|
+
`,Gs=ge.div`
|
|
1265
1265
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1266
1266
|
padding: 20px;
|
|
1267
|
-
`,
|
|
1268
|
-
${
|
|
1267
|
+
`,Ks=ge(Gs)`
|
|
1268
|
+
${zs}
|
|
1269
1269
|
background: ${({theme:e})=>e.colorBackground};
|
|
1270
1270
|
position: relative;
|
|
1271
1271
|
|
|
@@ -1277,72 +1277,72 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1277
1277
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1278
1278
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1279
1279
|
}
|
|
1280
|
-
`,
|
|
1280
|
+
`,qs=ge.img`
|
|
1281
1281
|
border-radius: 50%;
|
|
1282
1282
|
height: 40px;
|
|
1283
1283
|
margin-bottom: 12px;
|
|
1284
1284
|
width: 40px;
|
|
1285
|
-
`,
|
|
1286
|
-
${e=>
|
|
1287
|
-
${
|
|
1285
|
+
`,Ys=ge(Gs)`
|
|
1286
|
+
${e=>E(e)} {
|
|
1287
|
+
${lc}
|
|
1288
1288
|
|
|
1289
1289
|
background: ${({theme:e})=>e.colorBackground};
|
|
1290
1290
|
}
|
|
1291
|
-
`,
|
|
1291
|
+
`,z0=ge.div`
|
|
1292
1292
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1293
1293
|
display: flex;
|
|
1294
1294
|
flex-flow: row nowrap;
|
|
1295
1295
|
align-items: center;
|
|
1296
|
-
`,
|
|
1296
|
+
`,_0=ge.div`
|
|
1297
1297
|
white-space: nowrap;
|
|
1298
|
-
`,
|
|
1298
|
+
`,Xs=ge.div`
|
|
1299
1299
|
background: #d8fed8;
|
|
1300
1300
|
border-radius: 6px;
|
|
1301
1301
|
float: right;
|
|
1302
1302
|
margin-bottom: 12px;
|
|
1303
1303
|
padding: 4px 10px;
|
|
1304
|
-
`,
|
|
1304
|
+
`,dc=ge.p`
|
|
1305
1305
|
font-weight: bold;
|
|
1306
1306
|
font-size: 18px;
|
|
1307
1307
|
line-height: 22px;
|
|
1308
1308
|
letter-spacing: calc(18px * -0.01);
|
|
1309
1309
|
margin: 0;
|
|
1310
|
-
`,
|
|
1310
|
+
`,Js=ge(dc)`
|
|
1311
1311
|
margin-bottom: 4px;
|
|
1312
|
-
`,
|
|
1312
|
+
`,Qs=ge.div`
|
|
1313
1313
|
display: flex;
|
|
1314
1314
|
flex-flow: row nowrap;
|
|
1315
1315
|
align-items: center;
|
|
1316
1316
|
min-width: 50%;
|
|
1317
|
-
`,
|
|
1317
|
+
`,cc=ge.p`
|
|
1318
1318
|
font-weight: bold;
|
|
1319
1319
|
font-size: 16px;
|
|
1320
1320
|
line-height: 20px;
|
|
1321
1321
|
letter-spacing: calc(16px * -0.01);
|
|
1322
1322
|
margin: 0;
|
|
1323
|
-
`,
|
|
1323
|
+
`,Zs=ge(cc)`
|
|
1324
1324
|
margin-bottom: 4px;
|
|
1325
1325
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1326
1326
|
`}
|
|
1327
|
-
`,
|
|
1327
|
+
`,Ct=ge.p`
|
|
1328
1328
|
color: ${({theme:e})=>e.colorText};
|
|
1329
1329
|
font-weight: normal;
|
|
1330
1330
|
font-size: 14px;
|
|
1331
1331
|
line-height: 22px;
|
|
1332
1332
|
margin: 0;
|
|
1333
|
-
`,
|
|
1333
|
+
`,Rs=ge.p`
|
|
1334
1334
|
color: ${({theme:e})=>e.colorText};
|
|
1335
1335
|
font-weight: 600;
|
|
1336
1336
|
font-size: 12px;
|
|
1337
1337
|
line-height: 16px;
|
|
1338
1338
|
margin: 0;
|
|
1339
|
-
`;
|
|
1339
|
+
`;Ct.Loud=ge(Ct)`
|
|
1340
1340
|
font-weight: 600;
|
|
1341
|
-
`;
|
|
1341
|
+
`;Ct.Quiet=ge(Ct)`
|
|
1342
1342
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1343
1343
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1344
1344
|
`}
|
|
1345
|
-
`;var
|
|
1345
|
+
`;var el=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ee(),{primaryCTAClickSideEffects:n}=ae();o=i(o);let{imageUri:r=null,subtitle:l=null,title:p=null,complete:d=!1,blocked:s=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return ro.createElement(Ks,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&ro.createElement(qs,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&ro.createElement(Xs,{className:a("carouselCompletedPill",o)},ro.createElement(Rs,{style:{color:"#108E0B"}},"Complete")),p&&ro.createElement(Zs,{blocked:s,complete:d,className:a("carouselCardTitle",o)},p),l&&ro.createElement(Ct.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o)},l))};var uc=()=>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]=Nt(!1),[r,l]=Nt(!1);_r(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&l(!0)},[t]);let p=()=>{n(!1),l(!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(uc,null))):null},ol=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=mc(null),[r,l]=Nt(!1),[p,d]=Nt(!1),[s,m]=Nt(null),[c,g]=Nt([]),[y,T]=Nt(0),{isSmall:C}=Ds(),h=C?1:3,{getFlowMetadata:A,getFlowSteps:k,getNumberOfStepsCompleted:P,updateCustomVariables:B,isLoading:v}=J();_r(()=>{B(o)},[o,v]),_r(()=>{if(v)return;let O=A(e),N=P(e),V=k(e);m(O),O.data!==null&&(g(V.sort((W,Y)=>Number(W.complete)-Number(Y.complete))),d(V.length>h),T(N))},[v]);let f=[];for(let O=0;O<c.length;O+=h)f.push(c.slice(O,O+h));let I=O=>{let N=O.target,V=N.scrollWidth-N.clientWidth,W=Math.ceil(N.scrollLeft);W>0&&r===!1&&l(!0),W===0&&r===!0&&l(!1),W<V&&p===!1&&d(!0),W===V&&p===!0&&d(!1)},S=(O=!0)=>{let N=O?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*N,behavior:"smooth"})},F=null,L=O=>{F!==null?clearTimeout(F):I(O),F=setTimeout(()=>{I(O)},16)};return v?null:ue.createElement(Ys,{className:be(a("carouselContainer",t),i)},ue.createElement("div",{style:{display:"flex",justifyContent:C?"center":"space-between",marginBottom:20,flexWrap:C?"wrap":"nowrap",gap:C?16:20}},ue.createElement("div",null,ue.createElement(Js,{className:a("carouselTitle",t)},s==null?void 0:s.title),ue.createElement(Ct.Quiet,{className:a("carouselSubtitle",t)},s==null?void 0:s.subtitle)),ue.createElement(Qs,{className:a("progressWrapper",t)},ue.createElement(We,{count:y,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:L},f.map((O,N)=>ue.createElement(Hs,{key:N,style:{flex:`0 0 calc(100% - ${c.length>h?36:0}px)`}},O.map((V,W)=>ue.createElement(el,{key:W,stepData:V,style:{flex:c.length>h?`0 1 calc(100% / ${h} - 16px * 2 / ${h})`:1},appearance:t})))))),ue.createElement(ne,{appearance:t}))};var Vr=B=>{var v=B,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:l="inline",onDismiss:p,visible:d,customVariables:s,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:y,setVisible:T,customStepTypes:C,checklistStyle:h="default",autoExpandFirstIncompleteStep:A,autoExpandNextStep:k}=v,P=Ne(v,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:f,getFlowSteps:I,markStepCompleted:S,getStepStatus:F,getNumberOfStepsCompleted:L,isLoading:O,targetingLogicShouldHideFlow:N,updateCustomVariables:V,getFlowMetadata:W,isStepBlocked:Y,getFlowStatus:Q,hasActiveFullPageFlow:pe,setHasActiveFullPageFlow:H,markStepStarted:le}=J(),{primaryCTAClickSideEffects:fe,secondaryCTAClickSideEffects:Te}=ae(),{getOpenFlowState:re,setOpenFlowState:Z}=Be(),[q,_]=rl(n||0),[Le,he]=rl(!1),Fe=d===void 0?re(e):d,ye=l==="modal",{mergeAppearanceWithDefault:$e}=ee();je(e);let $=I(e);if(g=$e(g),Hr(()=>{V(s)},[s,O]),Hr(()=>{d!==void 0&&(ye&&d===!0?H(!0):ye&&d===!1&&H(!1))},[d,T,pe]),Hr(()=>{!O&&$&&$[q]&&F(e,$[q].id)&&F(e,$[q].id)!==Ve&&le(e,$[q].id)},[q]),O)return null;let M=f(e);if(!M||N(M)||!$||y===!0&&Q(e)===R)return null;let D=W(e);if(D!=null&&D.title&&(t=D.title),D!=null&&D.subtitle&&(o=D.subtitle),!Le&&n===void 0&&L(e)>0){let u=$.findIndex(w=>w.complete===!1);_(u>-1?u:$.length-1),he(!0)}function ie(){if(q+1>=$.length){ye&&Z(e,!1);return}Y(e,$[q+1].id)||_(q+1)}function Oe(u,w,z){let de=q+1<$.length?$[q+1]:null;c&&c(u,q,w,de)===!0&&ye&&qe(),m&&m(u,z,de),!m&&!c&&(u.primaryButtonUri||u.secondaryButtonUri)&&ye&&qe()}function bt(){return $.map((u,w)=>j(b({},u),{handleSecondaryButtonClick:()=>{ie(),Te(u),u.skippable===!0&&S(e,u.id,{skipped:!0}),Oe(u,"secondary",w)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(S(e,u.id),ie()),Oe(u,"primary",w),fe(u),F(e,u.id)===Ve&&ie()}}))}function Ke(){return Ce.createElement(ne,{appearance:g})}let mt={steps:bt(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:C,type:l,className:r,autoExpandFirstIncompleteStep:A,autoExpandNextStep:k};function qe(){Z(e,!1),p&&p(),T&&T(!1)}function Mt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(Ke,null),Ce.createElement(ol,{flowId:e,appearance:g,customVariables:s,className:r}))}function Dt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(Ke,null),Ce.createElement(zr,b({visible:Fe,onClose:()=>{qe()},selectedStep:q,setSelectedStep:_,autoExpandNextStep:!0,appearance:g},mt)))}function Ut(){var z;let u=P.guideFlowId,w;return u&&f(u)&&(w=I(u)),Ce.createElement(Ce.Fragment,null,Ce.createElement(Ke,null),Ce.createElement(Wr,b({visible:Fe,stepsTitle:D.stepsTitle?D.stepsTitle:"Your quick start guide",onClose:()=>{qe()},selectedStep:q,setSelectedStep:_,guideData:w,guideTitle:(z=P.guideTitle)!=null?z:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:de=>{Oe(de,"link",0)},customStepTypes:C},mt)))}function x(){let u=Ce.createElement(Dr,b({flowId:e,style:i,selectedStep:q,setSelectedStep:_,appearance:g,type:l},mt));return ye?Ce.createElement(Qe,{onClose:()=>{qe()},visible:Fe,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Ce.createElement(Ke,null),u):Ce.createElement(Ce.Fragment,null,Ce.createElement(Ke,null),u)}switch(h){case"condensed":return Dt();case"with-guide":return Ut();case"default":return x();case"carousel":return Mt();default:return x()}};var gc=e=>fc.createElement(Vr,b({type:"inline"},e));import St,{useEffect as hc}from"react";import tt from"react";import rr from"styled-components";var il=rr.div`
|
|
1346
1346
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1347
1347
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1348
1348
|
padding: 10px 12px 10px 12px;
|
|
@@ -1354,27 +1354,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1354
1354
|
&:hover {
|
|
1355
1355
|
filter: brightness(.99);
|
|
1356
1356
|
}
|
|
1357
|
-
`,nl=
|
|
1357
|
+
`,nl=rr.div`
|
|
1358
1358
|
display: flex;
|
|
1359
1359
|
flex-direction: row;
|
|
1360
1360
|
justify-content: space-between;
|
|
1361
1361
|
align-items: center;
|
|
1362
1362
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1363
1363
|
flex-grow: 2;
|
|
1364
|
-
`,sl=
|
|
1364
|
+
`,sl=rr.div`
|
|
1365
1365
|
text-overflow: ellipsis;
|
|
1366
1366
|
font-weight: 600;
|
|
1367
1367
|
font-size: 14px;
|
|
1368
1368
|
line-height: 16px;
|
|
1369
1369
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1370
1370
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1371
|
-
`,ll=
|
|
1371
|
+
`,ll=rr.div`
|
|
1372
1372
|
width: 20px;
|
|
1373
1373
|
margin-right: 8px;
|
|
1374
1374
|
display: flex;
|
|
1375
1375
|
height: 100%;
|
|
1376
1376
|
align-items: center;
|
|
1377
|
-
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:
|
|
1377
|
+
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>tt.createElement(tt.Fragment,null,tt.createElement(ne,{appearance:l}),tt.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:be(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&tt.createElement(ll,{className:a("progressRingContainer",l)},tt.createElement(jt,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),tt.createElement(nl,{type:p,className:a("badgeTitleContainer",l)},tt.createElement(sl,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&tt.createElement(to,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&tt.createElement(We,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));import yt from"react";import ko from"styled-components";var pl=ko.div`
|
|
1378
1378
|
display: flex;
|
|
1379
1379
|
flex-direction: row;
|
|
1380
1380
|
width: 100%;
|
|
@@ -1385,7 +1385,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1385
1385
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1386
1386
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1387
1387
|
`,dl=ko.div`
|
|
1388
|
-
${e=>
|
|
1388
|
+
${e=>E(e)} {
|
|
1389
1389
|
display: flex;
|
|
1390
1390
|
justify-content: center;
|
|
1391
1391
|
align-items: center;
|
|
@@ -1402,7 +1402,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1402
1402
|
justify-content: center;
|
|
1403
1403
|
margin-left: 16px;
|
|
1404
1404
|
min-width: 200px;
|
|
1405
|
-
`,
|
|
1405
|
+
`,VS=ko.div`
|
|
1406
1406
|
display: flex;
|
|
1407
1407
|
justify-content: center;
|
|
1408
1408
|
align-items: flex-end;
|
|
@@ -1411,7 +1411,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1411
1411
|
:hover {
|
|
1412
1412
|
opacity: 0.8;
|
|
1413
1413
|
}
|
|
1414
|
-
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:
|
|
1414
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>yt.createElement(yt.Fragment,null,yt.createElement(pl,{appearance:i,className:be(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p},o&&yt.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),yt.createElement(cl,null,yt.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),yt.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},yt.createElement(We,{count:n,total:r,display:"percent",textLocation:"top"}))));var xc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:T,isLoading:C,targetingLogicShouldHideFlow:h,updateCustomVariables:A}=J(),{mergeAppearanceWithDefault:k}=ee();s=k(s);let{setOpenFlowState:P,getOpenFlowState:B}=Be();if(hc(()=>{A(p)},[p,C]),C)return null;let v=c(e);if(!v||h(v)||d===!0&&y(e)===R)return null;let f=g(e),I=T(e);return m==="full-width"?St.createElement(St.Fragment,null,St.createElement(ne,{appearance:s}),St.createElement(ul,{title:t,subtitle:o,count:I,total:f.length,style:n,className:l,appearance:s,icon:i,onClick:()=>{}})):St.createElement(St.Fragment,null,St.createElement(ne,{appearance:s}),St.createElement(al,{count:I,total:f.length,title:t,style:n,onClick:()=>{P(e,!0),r&&r()},type:m,className:l,appearance:s}))};import Cc from"react";var yc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Ne(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=J(),{mergeAppearanceWithDefault:s}=ee();o=s(o);let m=l(e);if(!m||p(m))return null;let c=d(e);return Cc.createElement(Fo,b({steps:c,style:t,appearance:o},i))};import It,{useContext as Nc,useEffect as Ic}from"react";import K,{useEffect as Po,useLayoutEffect as hl,useRef as kc,useState as io}from"react";import vo from"styled-components";import{useCallback as Sc,useEffect as bc,useState as wc}from"react";var jr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,l=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+l,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+l,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]=wc(o),r=Sc(()=>{e&&n(e.getBoundingClientRect())},[e]);return bc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Tc,useState as Fc}from"react";function gl(){let{debug:e}=Tc(X),[t,o]=Fc([]);function i(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var xl=300,Cl=100,Pc=500,no=12,vc=vo.div`
|
|
1415
1415
|
width: 100%;
|
|
1416
1416
|
height: 100%;
|
|
1417
1417
|
border-radius: 9999px;
|
|
@@ -1434,26 +1434,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1434
1434
|
opacity: 0;
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
|
-
`,
|
|
1438
|
-
width: ${
|
|
1439
|
-
height: ${
|
|
1437
|
+
`,Bc=vo.div`
|
|
1438
|
+
width: ${no}px;
|
|
1439
|
+
height: ${no}px;
|
|
1440
1440
|
border-radius: 100px;
|
|
1441
1441
|
background-color: ${e=>e.primaryColor};
|
|
1442
1442
|
z-index: 20;
|
|
1443
1443
|
opacity: 1;
|
|
1444
|
-
`,
|
|
1444
|
+
`,Ec=vo.div`
|
|
1445
1445
|
pointer-events: all;
|
|
1446
|
-
`,yl=
|
|
1446
|
+
`,yl=vo.div`
|
|
1447
1447
|
display: flex;
|
|
1448
1448
|
align-content: center;
|
|
1449
1449
|
justify-content: center;
|
|
1450
1450
|
align-items: center;
|
|
1451
1451
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1452
|
-
`,
|
|
1453
|
-
width: ${
|
|
1454
|
-
height: ${
|
|
1455
|
-
`,
|
|
1456
|
-
${e=>
|
|
1452
|
+
`,Ac=vo(yl)`
|
|
1453
|
+
width: ${no+12}px;
|
|
1454
|
+
height: ${no+12}px;
|
|
1455
|
+
`,Oc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:y,showStepCount:T=!0,completedStepsCount:C=0,showFrigadeBranding:h=!1,cssPosition:A="absolute",onViewTooltip:k})=>{var Ke,mt,qe,Mt,Dt,Ut,x,u,w,z,de,ce,wt,Bo,Rr,ei,ti,oi,ri;let{logErrorIfDebugMode:P}=gl(),[B,v]=io(),[f,I]=io(new Date),S=kc(null),[F,L]=io(document.querySelector(e[s].selector)),O=fl(F,f),[N,V]=io(),[W,Y]=io(!y),Q=(mt=(Ke=e[s])==null?void 0:Ke.props)!=null&&mt.position?e[s].props.position:A,pe=(Dt=(Mt=(qe=e[s])==null?void 0:qe.props)==null?void 0:Mt.zIndex)!=null?Dt:90,H=(Ut=B==null?void 0:B.width)!=null?Ut:xl,le=(x=B==null?void 0:B.height)!=null?x:Cl,[fe,Te]=io(new Date().getTime());l=(z=(w=(u=e[s])==null?void 0:u.props)==null?void 0:w.offset)!=null?z:l;let re=window.location.pathname.split("/").pop();hl(()=>{S.current&&v({width:S.current.clientWidth,height:S.current.clientHeight})},[s,f,Q]),Po(()=>{y||Y(!0)},[s]),Po(()=>{p&&W&&k(s)},[W]);let Z=()=>{let se=document.querySelector(e[s].selector);if(!se){V(void 0),L(null),P(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}N&&N===JSON.stringify(se==null?void 0:se.getBoundingClientRect())||(L(se),I(new Date),se&&V(JSON.stringify(se.getBoundingClientRect())))};if(Po(()=>{let se=new MutationObserver(Z);return se.observe(document.body,{subtree:!0,childList:!0}),()=>se.disconnect()},[Z]),Po(()=>{let se=new MutationObserver(Z);return se.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>se.disconnect()},[Z]),Po(()=>{let se=setInterval(()=>{Z()},10);return()=>clearInterval(se)},[Z]),hl(()=>{setTimeout(()=>{Z()},Pc),Z()},[s,re]),F===null||!p)return null;let q=i==="auto"?"right":i,_=jr(O,q,H,l,Q),Le=O.right+H>(window.innerWidth||document.documentElement.clientWidth),he=O.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Le&&i==="auto"&&(_=jr(O,"left",H,l,Q),q="left"),(ce=(de=e[s])==null?void 0:de.props)!=null&&ce.tooltipPosition&&((Bo=(wt=e[s])==null?void 0:wt.props)==null?void 0:Bo.tooltipPosition)!=="auto"&&(((ei=(Rr=e[s])==null?void 0:Rr.props)==null?void 0:ei.tooltipPosition)==="left"||((oi=(ti=e[s])==null?void 0:ti.props)==null?void 0:oi.tooltipPosition)==="right")&&(q=e[s].props.tooltipPosition);let Fe=()=>{let se=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),Y(!1),setTimeout(()=>{Z()},30)),C===e.length-1)return o()},ut=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),y&&!e[s].secondaryButtonUri&&Y(!1))};return K.createElement(K.Fragment,null,T&&e.length>1&&K.createElement(Si,null,K.createElement(wi,{className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&K.createElement(bi,{showStepCount:T,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&K.createElement(te,{title:e[s].secondaryButtonTitle,appearance:c,onClick:ut,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&K.createElement(te,{title:e[s].primaryButtonTitle,appearance:c,onClick:se,withMargin:!1,size:"small"})))},ye=()=>K.createElement(K.Fragment,null,g&&K.createElement(gi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri},K.createElement(Ee,null)),e[s].imageUri&&K.createElement(hi,{dismissible:g,appearance:c,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&K.createElement(xi,{dismissible:g,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(Re,{appearance:c,videoUri:e[s].videoUri})),K.createElement(yi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small"}),K.createElement(Ci,{className:a("tooltipFooter",c)},K.createElement(Fe,null)))),$=b(b({},{default:se=>{var ut;if((ut=e[s])!=null&&ut.StepContent){let ra=e[s].StepContent;return K.createElement("div",null,ra)}return K.createElement(ye,null)}}),m),M=()=>{var se;return e?!((se=e[s])!=null&&se.type)||!$[e[s].type]?$.default(e[s]):$[e[s].type]({stepData:e[s],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[s].complete===!0||_.x==0&&_.y==0&&new Date().getTime()-fe<100)return null;let D={top:(_==null?void 0:_.y)-no,left:(ri=q=="left"?O.x+l.x:(_==null?void 0:_.x)-no)!=null?ri:0,cursor:y?"pointer":"default",position:Q},ie=()=>{let ut=D.left+(q=="left"?-H:24);return Math.min(Math.max(ut,20),window.innerWidth-H-20)},Oe=()=>{if(Q==="fixed")return D.top;let se=D.top+le,ut=20;return se>window.innerHeight-ut?D.top+-le:D.top},bt=()=>{y&&(I(new Date),Y(!W))};return K.createElement(Ec,null,K.createElement(Ac,{style:D,zIndex:pe,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&A!=="static"&&K.createElement(K.Fragment,null,K.createElement(Bc,{style:{position:Q},onClick:bt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(vc,{style:{position:"absolute"},onClick:bt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(yl,{style:j(b({},D),{left:ie(),top:Oe()}),zIndex:pe+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:pe+10},K.createElement(M,null)),h&&K.createElement(Fi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:pe+10},K.createElement(Lo,{appearance:c})))))},Gr=Oc;import{Portal as Lc}from"react-portal";var $c=C=>{var h=C,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:l,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:s=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:y="absolute"}=h,T=Ne(h,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:A,getFlowSteps:k,isLoading:P,targetingLogicShouldHideFlow:B,markStepCompleted:v,markStepStarted:f,markFlowCompleted:I,updateCustomVariables:S,getCurrentStepIndex:F,getStepStatus:L,isStepBlocked:O,getFlowStatus:N,getNumberOfStepsCompleted:V}=J(),{isLoadingUserFlowStateData:W}=De(),{primaryCTAClickSideEffects:Y,secondaryCTAClickSideEffects:Q}=ae(),{hasOpenModals:pe}=Be(),H=F(e),{openFlowStates:le}=Nc(X),{mergeAppearanceWithDefault:fe}=ee();if(o=fe(o),Ic(()=>{S(t)},[t,P]),W)return null;let Te=A(e);if(!Te||B(Te)||N(e)==R||pe())return null;let re=k(e);if(Object.keys(le).length>0){let M=Object.keys(le).find(D=>le[D]===!0);if(M!==void 0&&M!==e)return It.createElement(It.Fragment,null)}function Z(M){return U(this,null,function*(){if(yield v(e,M.id),re.map(D=>L(e,D.id)).every(D=>D===Ve)){yield I(e);return}!s&&H+1<re.length&&!r&&O(e,re[H+1].id)})}function q(M,D,ie){let Oe=H+1<re.length?re[H+1]:null;n&&n(M,H,D,Oe),i&&i(M,ie,Oe)}function _(){return re.map(M=>j(b({},M),{handleSecondaryButtonClick:()=>U(this,null,function*(){Q(M),M.skippable===!0&&(yield v(e,M.id,{skipped:!0})),q(M,"secondary",H)}),handlePrimaryButtonClick:()=>U(this,null,function*(){(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&(yield Z(M)),q(M,"primary",H),Y(M)})}))}function Le(M){return U(this,null,function*(){l&&l(),m==="complete-flow"?yield I(e):yield v(e,M.id)})}function he(){c&&c()}function Fe(M){return U(this,null,function*(){yield f(e,re[M].id)})}let ye=!document.querySelector(re[H].selector);function $e(){let M=re.findIndex(D=>!!document.querySelector(D.selector));return re.map((D,ie)=>ye&&!r&&ie!==M&&g||!r&&ie!==H?null:It.createElement(Gr,b({key:D.id,appearance:o,steps:_(),selectedStep:ie,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Le(D),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:V(e),onComplete:he,cssPosition:y,onViewTooltip:Fe},T)))}function $(){return It.createElement(It.Fragment,null,It.createElement(ne,{appearance:o}),$e())}return y==="static"?$():It.createElement(Lc,null,$())};import _e,{useEffect as Mc,useRef as Dc,useState as Uc}from"react";import{Portal as Wc}from"react-portal";import Lt from"styled-components";var Sl=Lt.button`
|
|
1456
|
+
${e=>E(e)} {
|
|
1457
1457
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1458
1458
|
|
|
1459
1459
|
display: flex;
|
|
@@ -1471,12 +1471,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
1473
|
`,bl=Lt.span`
|
|
1474
|
-
${e=>
|
|
1474
|
+
${e=>E(e)} {
|
|
1475
1475
|
font-size: 12px;
|
|
1476
1476
|
display: inline-block;
|
|
1477
1477
|
}
|
|
1478
1478
|
`,wl=Lt.span`
|
|
1479
|
-
${e=>
|
|
1479
|
+
${e=>E(e)} {
|
|
1480
1480
|
font-size: 12px;
|
|
1481
1481
|
display: inline-block;
|
|
1482
1482
|
}
|
|
@@ -1491,7 +1491,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1491
1491
|
align-items: flex-end;
|
|
1492
1492
|
z-index: 50;
|
|
1493
1493
|
`,Fl=Lt.button`
|
|
1494
|
-
${e=>
|
|
1494
|
+
${e=>E(e)} {
|
|
1495
1495
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1496
1496
|
background-color: #ffffff;
|
|
1497
1497
|
border: 1px solid #f5f5f5;
|
|
@@ -1507,7 +1507,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1507
1507
|
border-radius: 45px;
|
|
1508
1508
|
cursor: pointer;
|
|
1509
1509
|
`,kl=Lt.div`
|
|
1510
|
-
${e=>
|
|
1510
|
+
${e=>E(e)} {
|
|
1511
1511
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1512
1512
|
background: #ffffff;
|
|
1513
1513
|
}
|
|
@@ -1524,7 +1524,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1524
1524
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1525
1525
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1526
1526
|
`,Pl=Lt.button`
|
|
1527
|
-
${e=>
|
|
1527
|
+
${e=>E(e)} {
|
|
1528
1528
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1529
1529
|
color: #434343;
|
|
1530
1530
|
:hover {
|
|
@@ -1540,8 +1540,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1540
1540
|
font-size: 14px;
|
|
1541
1541
|
|
|
1542
1542
|
padding: 8px 12px;
|
|
1543
|
-
`;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
|
|
1544
|
-
${e=>
|
|
1543
|
+
`;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 zc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:l})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:s,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y}=J(),{primaryCTAClickSideEffects:T}=ae(),C=Dc(null),[h,A]=Uc(!1),{mergeAppearanceWithDefault:k}=ee();l=k(l),Mc(()=>(document.addEventListener("click",P,!1),()=>{document.removeEventListener("click",P,!1)}),[]);let P=S=>{C.current&&!C.current.contains(S.target)&&A(!1)};if(g)return null;let B=p(e);if(!B||y(B))return null;let v=d(e);if(!v||!i)return null;function f(S,F){!S.completionCriteria&&(S.autoMarkCompleted||S.autoMarkCompleted===void 0)&&s(e,S.id),T(S),o&&o(S,F),A(!1)}function I(){return h&&_e.createElement(kl,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},v.map((S,F)=>_e.createElement(Pl,{className:a("floatingWidgetMenuItem",l),key:F,onClick:()=>f(S,F)},S.title)))}return n=="inline"?_e.createElement("span",{ref:C},_e.createElement(Sl,{style:t,onClick:()=>{A(!h)},className:a("supportButton",l)},_e.createElement(wl,{className:a("supportIconContainer",l)},_e.createElement(Al,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),_e.createElement(bl,{className:a("supportButtonTitle",l)},r)),_e.createElement(I,null)):_e.createElement(Wc,null,_e.createElement(Tl,{style:t,ref:C},_e.createElement(I,null),_e.createElement(Fl,{onClick:()=>{A(!h)},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},_e.createElement(Bl,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};import ot,{useEffect as _c}from"react";import ir from"styled-components";var Ol=ir.div`
|
|
1544
|
+
${e=>E(e)} {
|
|
1545
1545
|
display: flex;
|
|
1546
1546
|
flex-direction: column;
|
|
1547
1547
|
width: 100%;
|
|
@@ -1555,18 +1555,18 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1555
1555
|
border-radius: 12px;
|
|
1556
1556
|
position: relative;
|
|
1557
1557
|
}
|
|
1558
|
-
`,
|
|
1558
|
+
`,Nl=ir.div`
|
|
1559
1559
|
display: flex;
|
|
1560
1560
|
flex-direction: column;
|
|
1561
1561
|
flex: 1;
|
|
1562
|
-
`,
|
|
1562
|
+
`,Il=ir.div`
|
|
1563
1563
|
display: flex;
|
|
1564
1564
|
flex-direction: column;
|
|
1565
1565
|
justify-content: center;
|
|
1566
1566
|
align-items: flex-start;
|
|
1567
1567
|
margin-top: 16px;
|
|
1568
|
-
`,Ll=
|
|
1569
|
-
${e=>
|
|
1568
|
+
`,Ll=ir.div`
|
|
1569
|
+
${e=>E(e)} {
|
|
1570
1570
|
position: absolute;
|
|
1571
1571
|
top: 16px;
|
|
1572
1572
|
right: 16px;
|
|
@@ -1576,9 +1576,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1576
1576
|
opacity: 0.8;
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
`;var
|
|
1579
|
+
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowSteps:T,getFlowStatus:C,getCurrentStepIndex:h}=J(),{primaryCTAClickSideEffects:A}=ae(),{mergeAppearanceWithDefault:k}=ee();if(je(e),n=k(n),_c(()=>{y(o)},[o,c]),c)return null;let P=d(e);if(!P||g(P)||C(e)===R)return null;let v=T(e)[h(e)];return ot.createElement(ot.Fragment,null,ot.createElement(ne,{appearance:n}),ot.createElement(Ol,{appearance:n,className:be(a("embeddedTipContainer",n),r),style:l},(p===!0||v.dismissible)&&ot.createElement(Ll,{onClick:()=>U(void 0,null,function*(){yield s(e),t&&t()}),className:a("embeddedTipDismissButton",n)},ot.createElement(Ee,null)),ot.createElement(Nl,null,ot.createElement(Ae,{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,h(e),"primary")===!1)&&(yield m(e,v.id),yield s(e))})}))))};import Pe,{useEffect as Vc}from"react";import so from"styled-components";var $l=so.div`
|
|
1580
1580
|
// use the :not annotation
|
|
1581
|
-
${e=>
|
|
1581
|
+
${e=>E(e)} {
|
|
1582
1582
|
display: flex;
|
|
1583
1583
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1584
1584
|
width: 100%;
|
|
@@ -1588,24 +1588,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1588
1588
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1589
1589
|
border-radius: 12px;
|
|
1590
1590
|
}
|
|
1591
|
-
`,Ml=
|
|
1592
|
-
${e=>
|
|
1591
|
+
`,Ml=so.div`
|
|
1592
|
+
${e=>E(e)} {
|
|
1593
1593
|
display: flex;
|
|
1594
1594
|
width: 46px;
|
|
1595
1595
|
height: 46px;
|
|
1596
1596
|
}
|
|
1597
|
-
`,Dl=
|
|
1597
|
+
`,Dl=so.div`
|
|
1598
1598
|
display: flex;
|
|
1599
1599
|
flex-direction: column;
|
|
1600
1600
|
flex: 1;
|
|
1601
1601
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1602
1602
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1603
|
-
`,Ul=
|
|
1603
|
+
`,Ul=so.div`
|
|
1604
1604
|
display: flex;
|
|
1605
1605
|
flex-direction: column;
|
|
1606
1606
|
justify-content: center;
|
|
1607
1607
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1608
|
-
`,
|
|
1608
|
+
`,Kr=so.div`
|
|
1609
1609
|
display: flex;
|
|
1610
1610
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1611
1611
|
align-items: flex-end;
|
|
@@ -1613,12 +1613,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1613
1613
|
:hover {
|
|
1614
1614
|
opacity: 0.8;
|
|
1615
1615
|
}
|
|
1616
|
-
`,
|
|
1616
|
+
`,qr=so.div`
|
|
1617
1617
|
display: flex;
|
|
1618
1618
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1619
1619
|
align-items: flex-end;
|
|
1620
1620
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1621
|
-
`;import
|
|
1621
|
+
`;import Yr from"react";var Wl=({style:e,className:t})=>Yr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Yr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Yr.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var jc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d})=>{let{getFlow:s,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowMetadata:T,getFlowStatus:C,getFlowSteps:h,getCurrentStepIndex:A}=J(),{primaryCTAClickSideEffects:k}=ae(),{mergeAppearanceWithDefault:P}=ee();if(je(e),l=P(l),Vc(()=>{y(n)},[n,c]),c)return null;let B=s(e);if(!B||g(B)||C(e)===R)return null;let v=h(e),f=v.length>0?v[A(e)]:T(e);return f!=null&&f.title&&(t=f.title),f!=null&&f.subtitle&&(o=f.subtitle),Pe.createElement(Pe.Fragment,null,Pe.createElement(ne,{appearance:l}),Pe.createElement($l,{type:p,appearance:l,className:a("bannerContainer",l)},p!="square"&&Pe.createElement(Ml,{className:a("bannerIconContainer",l)},d||Pe.createElement(Wl,null)),p==="square"&&f.dismissible&&Pe.createElement(qr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Kr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null))),Pe.createElement(Dl,{type:p},Pe.createElement(Ae,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(f==null?void 0:f.primaryButtonTitle)&&Pe.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",l)},Pe.createElement(te,{title:f==null?void 0:f.primaryButtonTitle,appearance:l,onClick:()=>{k(f),r&&r(f,0,"primary")},classPrefix:"banner"})),p!=="square"&&f.dismissible&&Pe.createElement(qr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Kr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null)))))};import oe,{useEffect as Gc}from"react";import{Portal as Kc}from"react-portal";import ct from"styled-components";var zl=ct.div`
|
|
1622
1622
|
display: flex;
|
|
1623
1623
|
flex-direction: column;
|
|
1624
1624
|
width: 100%;
|
|
@@ -1661,7 +1661,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1661
1661
|
display: flex;
|
|
1662
1662
|
justify-content: center;
|
|
1663
1663
|
align-items: center;
|
|
1664
|
-
`,
|
|
1664
|
+
`,Xr=ct.div`
|
|
1665
1665
|
display: flex;
|
|
1666
1666
|
justify-content: space-between;
|
|
1667
1667
|
margin-top: 16px;
|
|
@@ -1670,25 +1670,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1670
1670
|
display: flex;
|
|
1671
1671
|
justify-content: space-between;
|
|
1672
1672
|
margin-top: 8px;
|
|
1673
|
-
`,
|
|
1673
|
+
`,Jr=ct.div`
|
|
1674
1674
|
font-size: 12px;
|
|
1675
1675
|
line-height: 18px;
|
|
1676
1676
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1677
1677
|
font-style: normal;
|
|
1678
1678
|
font-weight: 400;
|
|
1679
1679
|
letter-spacing: 0.24px;
|
|
1680
|
-
`,
|
|
1680
|
+
`,Qr=ct.div`
|
|
1681
1681
|
display: flex;
|
|
1682
1682
|
flex-direction: column;
|
|
1683
1683
|
flex: 1;
|
|
1684
|
-
`,
|
|
1684
|
+
`,dw=ct.div`
|
|
1685
1685
|
display: flex;
|
|
1686
1686
|
flex-direction: column;
|
|
1687
1687
|
justify-content: center;
|
|
1688
1688
|
align-items: flex-start;
|
|
1689
1689
|
margin-top: 16px;
|
|
1690
|
-
`,
|
|
1691
|
-
${e=>
|
|
1690
|
+
`,Vl=ct.textarea`
|
|
1691
|
+
${e=>E(e)} {
|
|
1692
1692
|
margin-top: 16px;
|
|
1693
1693
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1694
1694
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1699,8 +1699,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1699
1699
|
height: 100px;
|
|
1700
1700
|
resize: none;
|
|
1701
1701
|
}
|
|
1702
|
-
`,
|
|
1703
|
-
${e=>
|
|
1702
|
+
`,jl=ct.div`
|
|
1703
|
+
${e=>E(e)} {
|
|
1704
1704
|
position: absolute;
|
|
1705
1705
|
top: 16px;
|
|
1706
1706
|
right: 16px;
|
|
@@ -1710,8 +1710,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1710
1710
|
opacity: 0.8;
|
|
1711
1711
|
}
|
|
1712
1712
|
}
|
|
1713
|
-
`;var
|
|
1714
|
-
${e=>
|
|
1713
|
+
`;var qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:C,getFlowStatus:h,getFlowMetadata:A}=J(),{primaryCTAClickSideEffects:k}=ae(),{mergeAppearanceWithDefault:P}=ee(),[B,v]=oe.useState(null),[f,I]=oe.useState(""),S=A(e),{hasOpenModals:F,setKeepCompletedFlowOpenDuringSession:L,shouldKeepCompletedFlowOpenDuringSession:O}=Be();if(je(e),n=P(n),Gc(()=>{T(o)},[o,g]),g)return null;let N=d(e);if(!N||y(N)||h(e)===R||c(e)===1&&!O(e)||F())return null;let W=C(e)[c(e)];function Y(){var H,le;return oe.createElement(oe.Fragment,null,oe.createElement(Qr,null,oe.createElement(Ae,{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:B===fe+1,key:fe,onClick:()=>U(this,null,function*(){L(e),v(fe+1),yield m(e,W.id,{score:fe+1})}),appearance:n},fe+1))),oe.createElement(Hl,{appearance:n},oe.createElement(Jr,{appearance:n},(H=S==null?void 0:S.negativeLabel)!=null?H:"Not likely at all"),oe.createElement(Jr,{appearance:n},(le=S==null?void 0:S.positiveLabel)!=null?le:"Extremely likely")))}function Q(){var H;return oe.createElement(oe.Fragment,null,oe.createElement(Qr,null,oe.createElement(Ae,{appearance:n,title:(H=W.title)!=null?H:"Why did you choose this score?",size:"large"})),oe.createElement(Vl,{appearance:n,value:f,onChange:le=>{I(le.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 s(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:f}),yield s(e),i&&i(W,1,"primary")}),appearance:n,title:W.primaryButtonTitle||"Submit"})))}function pe(){return c(e)>=2?null:oe.createElement(oe.Fragment,null,oe.createElement(ne,{appearance:n}),oe.createElement(zl,{appearance:n,className:be(a("npsSurveyContainer",n),r),style:l,type:p},oe.createElement(jl,{onClick:()=>U(this,null,function*(){yield s(e),t&&t()}),className:a("npsSurveyDismissButton",n)},oe.createElement(Ee,null)),c(e)==0&&Y(),c(e)==1&&Q()))}return p==="inline"?pe():oe.createElement(Kc,null,pe())};import ve,{useEffect as Jc}from"react";import $t from"styled-components";var Gl=$t.div`
|
|
1714
|
+
${e=>E(e)} {
|
|
1715
1715
|
display: flex;
|
|
1716
1716
|
flex-direction: column;
|
|
1717
1717
|
width: 100%;
|
|
@@ -1736,7 +1736,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1736
1736
|
margin-top: 16px;
|
|
1737
1737
|
margin-bottom: 16px;
|
|
1738
1738
|
`,Xl=$t.div`
|
|
1739
|
-
${e=>
|
|
1739
|
+
${e=>E(e)} {
|
|
1740
1740
|
position: absolute;
|
|
1741
1741
|
top: -16px;
|
|
1742
1742
|
right: -16px;
|
|
@@ -1747,7 +1747,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1747
1747
|
}
|
|
1748
1748
|
}
|
|
1749
1749
|
`,Jl=$t.h1`
|
|
1750
|
-
${e=>
|
|
1750
|
+
${e=>E(e)} {
|
|
1751
1751
|
font-style: normal;
|
|
1752
1752
|
justify-content: center;
|
|
1753
1753
|
text-align: center;
|
|
@@ -1761,7 +1761,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1761
1761
|
margin-bottom: 8px;
|
|
1762
1762
|
}
|
|
1763
1763
|
`,Ql=$t.h2`
|
|
1764
|
-
${e=>
|
|
1764
|
+
${e=>E(e)} {
|
|
1765
1765
|
font-style: normal;
|
|
1766
1766
|
justify-content: center;
|
|
1767
1767
|
text-align: center;
|
|
@@ -1772,10 +1772,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map
|
|
|
1772
1772
|
letter-spacing: 0.28px;
|
|
1773
1773
|
margin-bottom: 8px;
|
|
1774
1774
|
}
|
|
1775
|
-
`;import Zl from"react";import
|
|
1775
|
+
`;import Zl from"react";import Yc from"styled-components";var Xc=Yc.img`
|
|
1776
1776
|
width: 100%;
|
|
1777
1777
|
height: 100%;
|
|
1778
1778
|
min-height: 200px;
|
|
1779
1779
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1780
|
-
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(
|
|
1780
|
+
`;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 Qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:C,getFlowStatus:h,getCurrentStepIndex:A}=J(),{primaryCTAClickSideEffects:k,secondaryCTAClickSideEffects:P}=ae(),{mergeAppearanceWithDefault:B}=ee(),{setOpenFlowState:v,getOpenFlowState:f,hasOpenModals:I}=Be();je(e);let[S,F]=[f(e,!0),Q=>v(e,Q)];if(n=B(n),Jc(()=>{T(o)},[o,g]),g)return null;let L=s(e);if(!L||y(L)||h(e)===R||I())return null;let N=C(e)[A(e)],V=()=>{F(!1),t&&t(),m(e)};function W(){return ve.createElement(ve.Fragment,null,ve.createElement(ne,{appearance:n}),ve.createElement(Gl,{appearance:n,className:be(a("announcementContainer",n),r),style:l},(p===!0||N.dismissible)&&d=="inline"&&ve.createElement(Xl,{onClick:()=>U(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},ve.createElement(Ee,null)),ve.createElement(Kl,null,ve.createElement(Jl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:me(N.title)}),N.subtitle&&ve.createElement(Ql,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:me(N.subtitle)})),(N.imageUri||N.videoUri)&&ve.createElement(Yl,{className:a("announcementMediaContainer",n)},ve.createElement(Rl,{appearance:n,stepData:N})),(N.primaryButtonTitle||N.secondaryButtonTitle)&&ve.createElement(ql,{className:a("announcementCTAContainer",n)},N.secondaryButtonTitle&&ve.createElement(te,{classPrefix:"announcement",title:N.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){N.handleSecondaryButtonClick(),P(N),i&&i(N,A(e),"secondary")}),secondary:!0}),N.primaryButtonTitle&&ve.createElement(te,{classPrefix:"announcement",title:N.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){N.handlePrimaryButtonClick(),k(N),!(i&&i(N,A(e),"primary")===!1)&&(yield c(e,N.id),yield m(e))})}))))}let Y={padding:"24px",maxWidth:"400px"};return d==="inline"?W():d!=="center"?ve.createElement(Do,{modalPosition:d,onClose:V,visible:S,dismissible:p,appearance:n},W()):ve.createElement(Qe,{appearance:n,onClose:V,visible:S,style:Y,dismissible:p},W())};import*as nr from"react";import ea from"react";var ta=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Ne(r,["as","children","variant"]);return ea.createElement(kn,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Zc=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]})),Zr=Object.assign(ta,Zc);var oa=l=>{var p=l,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Ne(p,["as","className","size","title","variant"]);var d;return nr.createElement(Fn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),nr.createElement(Zr,{color:(d=bo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},Rc=Object.fromEntries(Object.keys(bo).map(e=>{let t=o=>nr.createElement(oa,j(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),em=Object.assign(oa,Rc);export{So as Box,em as Button,nt as CheckBox,pr as FlowType,gt as FormLabel,br as FormTextField,Qc as FrigadeAnnouncement,jc as FrigadeBanner,Vr as FrigadeChecklist,it as FrigadeDefaultAppearance,Hc as FrigadeEmbeddedTip,hn as FrigadeForm,yc as FrigadeGuide,gc as FrigadeHeroChecklist,qc as FrigadeNPSSurvey,xc as FrigadeProgressBadge,kd as FrigadeProvider,zc as FrigadeSupportWidget,$c as FrigadeTour,We as ProgressBar,jt as ProgressRing,Zr as Text,Ir as tokens,Be as useFlowOpens,ao as useFlowResponses,J as useFlows,Nr as useOrganization,po as useUser,De as useUserFlowStates};
|
|
1781
1781
|
//# sourceMappingURL=index.mjs.map
|