@frigade/react 1.37.11 → 1.37.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +163 -163
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +192 -192
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Io=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Io)for(var o of Io(t))ai.call(t,o)&&si(e,o,t[o]);return e},V=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Io)for(var i of Io(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(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 Ro,{createContext as Td,useEffect as er,useState as Ke}from"react";import{ThemeProvider as Fd}from"styled-components";import Nt,{useContext as Zp,useEffect as Zt,useState as Fo}from"react";import{useCallback as Bt,useContext as Sa,useEffect as ba}from"react";import ur,{useMemo as ci}from"react";var di="1.37.11";var lt="NOT_STARTED_STEP",oe="COMPLETED_FLOW",Lo="ABORTED_FLOW",vt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",fo="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=ur.useContext(X);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Vt(){let{shouldGracefullyDegrade:e,readonly:t}=ur.useContext(X);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Ht();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Ht();let n=aa+o,r=pa+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 Ht()}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 Ht(p)}return l?l.ok?l:Ht(l.statusText):Ht()})}function Ht(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function jt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=ur.useContext(X);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(X);function r(c,f=!1){var S;return(S=e[c])!=null?S:f}function l(c,f){t(S=>V(T({},S),{[c]:f}))}function p(c){t(f=>{let b=f,{[c]:S}=b,w=Le(b,[pi(c)]);return T({},w)})}function d(c){n.includes(c)||i(f=>[...f,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,S])=>S&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import ga from"swr/immutable";import go from"core-js-pure/actual/structured-clone";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(...e){let t=e.shift(),o=e.length===1?e[0]:ye(...e);if(!fr(t)||!fr(o))throw new Error("deepmerge can only merge Objects");let i=go(t);return Object.entries(o).forEach(([n,r])=>{fr(r)?i[n]!==void 0?Object.assign(i,{[n]:ye(i[n],go(r))}):Object.assign(i,{[n]:go(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...go(r)]}):Object.assign(i,{[n]:go(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function _e(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ca(X),{resetOpenFlowState:d}=Ee(),[s,m]=ua(!1),c={data:r.map(F=>({flowId:F.id,flowState:oe,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=F=>fetch(F,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${F}: ${P}. Will gracefully degrade and hide Frigade`),l(!0),c)),S=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:b,mutate:x,error:v}=p?ga(S,f):fa(S,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),k=w==null?void 0:w.data;ma(()=>{!s&&!b&&k&&m(!0)},[k,s,b]);function B(F){return M(this,null,function*(){if(k&&!p){let P=k.find(I=>I.flowId===F);P&&P.flowState!==oe&&(P.flowState=oe),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function L(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.stepStates[P]=I,O.flowState=vt),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function C(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.lastStepId=P,O.stepStates[P]=I,O.flowState=vt),yield x(ye(w,{data:k}),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function u(F){return M(this,null,function*(){if(k){let P=k.find(I=>I.flowId===F);P&&P.flowState!==Ue&&(P.flowState=Ue,P.lastStepId=ha,Object.keys(P.stepStates).forEach(I=>{P.stepStates[I].actionType=lt,P.stepStates[I].createdAt=new Date().toISOString()}),yield x(ye(w,{data:k}),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1}),d(F))}})}function N(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.stepStates[P]=I),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:k,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:B,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:C,error:v}}function ho(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=_e(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=xa(X),[d,s]=mi(new Set),[m,c]=mi(new Set),f=Vt();function S(x){let v=JSON.stringify(x);if(d.has(v))return null;d.add(v),s(d),m.add(x),c(m);let k=l==null?void 0:l.find(B=>B.flowSlug===x.flowSlug&&B.stepId===x.stepId&&B.actionType===x.actionType&&B.createdAt===x.createdAt);return f(`${t}flowResponses`,V(T({},e),{method:"POST",body:v})).then(B=>{B.status!==200&&B.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):k||p(L=>[...L!=null?L:[],x])})}function w(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===vt||x.actionType===Ue?yield S(x):x.actionType===oe?yield S(x):x.actionType===fo?yield S(x):x.actionType===$e?yield S(x):x.actionType===Lo?yield S(x):x.actionType===lt&&(yield S(x)))})}function b(){let x=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let k in v.stepStates){let B=v.stepStates[k];x.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:B.stepId,actionType:B.actionType,data:{},createdAt:new Date(B.createdAt),blocked:B.blocked,hidden:B.hidden})}}),[...x,...l]}return{addResponse:w,setFlowResponses:p,getFlowResponses:b}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function $o(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var gr=(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))(gr||{});function R(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:S,flowDataOverrides:w}=Sa(X),b={data:[]},{verifySDKInitiated:x}=jt(),{addResponse:v,getFlowResponses:k}=ho(),B=g=>fetch(g,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${g} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),b)).catch(y=>(console.log(`Error fetching ${g}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),b)),{mutateUserFlowState:L,userFlowStatesData:C,isLoadingUserFlowStateData:u,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowNotStarted:F,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:O}=_e(),{data:A,error:G,isLoading:_}=wa(l?`${t}flows${S?"?readonly=true":""}`:null,B,{keepPreviousData:!0});ba(()=>{if(G){console.error(G);return}A&&A.data&&i(A.data)},[A,G]);function Q(g){if(_)return null;let y=o.find(h=>h.slug===g);return!y&&o.length>0&&!u&&!_?(console.log(`Flow with id ${g} not found`),null):(y&&w&&w[g]&&(y.data=w[g]),(y==null?void 0:y.active)===!1&&!S?null:y)}function Y(g){var D,ge,De,xt,Pt;if(!Q(g))return[];let y=(D=Q(g))==null?void 0:D.data;return y?(y=ae(y),((Pt=(xt=(ge=$o(y))==null?void 0:ge.data)!=null?xt:(De=$o(y))==null?void 0:De.steps)!=null?Pt:[]).map(ue=>{let mo=de(ue);return V(T({handleSecondaryButtonClick:()=>{ue.skippable===!0&&Z(g,ue.id,{skipped:!0})}},ue),{complete:xe(g,ue.id)===$e||mo>=1,started:xe(g,ue.id)===fo||xe(g,ue.id)===$e,currentlyActive:C==null?void 0:C.some(uo=>uo.flowId==g&&uo.lastStepId===ue.id),blocked:Ce(g,ue.id),hidden:H(g,ue.id),handlePrimaryButtonClick:()=>{(!ue.completionCriteria&&(ue.autoMarkCompleted||ue.autoMarkCompleted===void 0)||ue.completionCriteria&&ue.autoMarkCompleted===!0)&&Z(g,ue.id)},progress:mo})}).filter(ue=>ue.hidden!==!0)):[]}function ae(g){return g.replaceAll(/\${(.*?)}/g,(y,h)=>p[h]===void 0?"":String(p[h]).replace(/[\u00A0-\u9999<>\&]/g,function(D){return"&#"+D.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function J(g){var h;if(!Q(g))return[];let y=Q(g).data;return y?(y=ae(y),(h=JSON.parse(y))!=null?h:{}):[]}function q(g,y){d(h=>V(T({},h),{[g]:y}))}function pe(g){!u&&!_&&g&&JSON.stringify(p)!=JSON.stringify(T(T({},p),g))&&Object.keys(g).forEach(y=>{q(y,g[y])})}let we=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:fo,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield O(g,y,D),v(D))}),[n,r,C]),Ne=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:lt,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield I(g,y,D),v(D))}),[n,r,C]),Z=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:$e,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield P(g,y,D),v(D))}),[n,r,C]),ce=Bt((g,y)=>M(this,null,function*(){if(!x()||je(g)===Ue)return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield F(g),ke(h)&&v(h)}),[n,r,C]),U=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:vt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&v(h)}),[n,r,C]),te=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:oe,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&(yield N(g),v(h))}),[n,r,C]),Ie=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:Lo,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&(yield N(g),v(h))}),[n,r,C]);function ke(g){var y;if(C===void 0)return!1;if(C){let h=C.find(D=>D.flowId===g.flowSlug);if(g.actionType===lt&&(!(h!=null&&h.stepStates[g.stepId])||h.stepStates[g.stepId].actionType===lt))return!1;if(h&&((y=h.stepStates[g.stepId])==null?void 0:y.actionType)===g.actionType){if(g.actionType===$e&&(!g.data||JSON.stringify(g.data)===JSON.stringify({})))return!1;let D=Object.keys(h.stepStates).sort((ge,De)=>{let xt=new Date(h.stepStates[ge].createdAt),Pt=new Date(h.stepStates[De].createdAt);return xt.getTime()-Pt.getTime()});if(h.stepStates[D[D.length-1]].actionType===g.actionType&&g.stepId===D[D.length-1])return!1}if(h&&h.flowState===oe&&g.actionType===oe)return!1}return!0}function xe(g,y){let h=W(g,y);return u?null:h?h.actionType:lt}function Ce(g,y){let h=W(g,y);return h?h.blocked:!1}function H(g,y){let h=W(g,y);return h?h.hidden:!1}function W(g,y){var D;if(u)return null;let h=C==null?void 0:C.find(ge=>ge.flowId===g);return!h||!h.stepStates[y]?null:(D=h.stepStates[y])!=null?D:null}function $(g){var h,D;if(u||!C)return null;if(je(g)===Ue)return(h=Y(g)[0])!=null?h:null;let y=(D=C.find(ge=>ge.flowId===g))==null?void 0:D.lastStepId;return y?Y(g).find(ge=>ge.id===y):null}function z(g){var D;let y=$(g);if(!y)return 0;let h=(D=Y(g).findIndex(ge=>ge.id===y.id))!=null?D:0;return xe(g,y.id)===$e&&h<Y(g).length-1?h+1:h}function de(g){if(!g.completionCriteria)return;let y=ui(g.completionCriteria);if(y===null)return;let h=nt(y),D=kt(y);return D===0?void 0:h/D}function je(g){let y=C==null?void 0:C.find(h=>h.flowId===g);return y?y.flowState:null}function nt(g){let y=Y(g);return y.length===0?0:y.filter(D=>xe(g,D.id)===$e).length}function kt(g){return Y(g).length}function Je(g){let y=o.find(h=>h.slug===g);return y?(w&&w[g]&&(y.data=w[g]),$o(y.data)):null}function st(g){if(S)return!1;if(u)return!0;if(g!=null&&g.targetingLogic&&C){let y=C.find(h=>h.flowId===g.slug);if(y)return y.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&n&&n.startsWith("guest_"))}function Xe(g){return!st(Q(g))}function Wt(){n&&L()}function zt(){return o}return{getAllFlows:zt,getFlow:Q,getFlowData:Je,isLoading:u||_,getStepStatus:xe,getFlowSteps:Y,getCurrentStepIndex:z,markStepStarted:we,markStepCompleted:Z,markFlowNotStarted:ce,markFlowStarted:U,markFlowCompleted:te,markFlowAborted:Ie,markStepNotStarted:Ne,getFlowStatus:je,getNumberOfStepsCompleted:nt,getNumberOfSteps:kt,targetingLogicShouldHideFlow:st,setCustomVariable:q,updateCustomVariables:pe,customVariables:p,getStepOptionalProgress:de,getFlowMetadata:J,isStepBlocked:Ce,isStepHidden:H,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Xe,refresh:Wt}}import{useCallback as hr,useContext as Ta,useEffect as Fa}from"react";var Gt="guest_";function xo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(X),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=_e(),d=Vt(),{verifySDKInitiated:s}=jt();function m(w){return`frigade-user-registered-${w}`}Fa(()=>{if(e&&!t){if(e.startsWith(Gt))return;let w=m(e);localStorage.getItem(w)||(d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(w,"true"))}},[e,n,t]);let c=hr(w=>M(this,null,function*(){if(!s())return;let b={foreignId:e,properties:w};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(b)})),i(x=>T(T({},x),w)),p()}),[e,r,n,p]),f=hr((w,b)=>M(this,null,function*(){if(!s())return;let v={foreignId:e,events:[{event:w,properties:b}]};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(v)})),p()}),[e,r,p]),S=hr((w,b)=>M(this,null,function*(){if(s())if(b){let x=m(w);localStorage.setItem(x,"true"),o(w);let v={foreignId:w,properties:b};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(v)})),i(k=>T(T({},k),b)),p()}else o(w)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Rp}from"uuid";import ot,{useEffect as xn,useState as Jp}from"react";import qe,{useEffect as Sr,useState as Ia}from"react";import _o from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",Co="cfr-";function a(e,t){let o=`${fi}${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(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Mo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Mo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function yo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
2
|
+
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Lo=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Lo)for(var o of Lo(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Lo)for(var i of Lo(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(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 er,{createContext as Td,useEffect as tr,useState as Ve}from"react";import{ThemeProvider as Fd}from"styled-components";import Nt,{useContext as Zp,useEffect as Rt,useState as ko}from"react";import{useCallback as Bt,useContext as Sa,useEffect as ba}from"react";import fr,{useMemo as ci}from"react";var di="1.37.12";var nt="NOT_STARTED_STEP",re="COMPLETED_FLOW",$o="ABORTED_FLOW",vt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Le="COMPLETED_STEP",go="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=fr.useContext(X);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function jt(){let{shouldGracefullyDegrade:e,readonly:t}=fr.useContext(X);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Vt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Vt();let n=aa+o,r=pa+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 Vt()}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 Vt(p)}return l?l.ok?l:Vt(l.statusText):Vt()})}function Vt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=fr.useContext(X);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(X);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(T({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,b=Ie(C,[pi(c)]);return T({},b)})}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 ga from"swr/immutable";import ho from"core-js-pure/actual/structured-clone";function gr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(...e){let t=e.shift(),o=e.length===1?e[0]:ye(...e);if(!gr(t)||!gr(o))throw new Error("deepmerge can only merge Objects");let i=ho(t);return Object.entries(o).forEach(([n,r])=>{gr(r)?i[n]!==void 0?Object.assign(i,{[n]:ye(i[n],ho(r))}):Object.assign(i,{[n]:ho(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ho(r)]}):Object.assign(i,{[n]:ho(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function De(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ca(X),{resetOpenFlowState:d}=Be(),[s,m]=ua(!1),c={data:r.map(w=>({flowId:w.id,flowState:re,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=w=>fetch(w,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${w}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:b,isLoading:C,mutate:x,error:P}=p?ga(y,g):fa(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=b==null?void 0:b.data;ma(()=>{!s&&!C&&S&&m(!0)},[S,s,C]);function v(w){return M(this,null,function*(){if(S&&!p){let k=S.find(I=>I.flowId===w);k&&k.flowState!==re&&(k.flowState=re),yield x(Promise.resolve(ye(b,{data:S})),{optimisticData:ye(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function $(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I,N.flowState=vt),yield x(Promise.resolve(ye(b,{data:S})),{optimisticData:ye(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function B(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=vt),yield x(ye(b,{data:S}),{optimisticData:ye(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function u(w){return M(this,null,function*(){if(S){let k=S.find(I=>I.flowId===w);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=ha,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield x(ye(b,{data:S}),{optimisticData:ye(b,{data:S}),revalidate:!1,rollbackOnError:!1}),d(w))}})}function O(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I),yield x(Promise.resolve(ye(b,{data:S})),{optimisticData:ye(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:S,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:O,optimisticallyMarkStepStarted:B,error:P}}function xo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=xa(X),[d,s]=mi(new Set),[m,c]=mi(new Set),g=jt();function y(x){let P=JSON.stringify(x);if(d.has(P))return null;d.add(P),s(d),m.add(x),c(m);let S=l==null?void 0:l.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,j(T({},e),{method:"POST",body:P})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):S||p($=>[...$!=null?$:[],x])})}function b(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===vt||x.actionType===Me?yield y(x):x.actionType===re?yield y(x):x.actionType===go?yield y(x):x.actionType===Le?yield y(x):x.actionType===$o?yield y(x):x.actionType===nt&&(yield y(x)))})}function C(){let x=[];return o==null||o.forEach(P=>{if(P&&P.stepStates&&Object.keys(P.stepStates).length!==0)for(let S in P.stepStates){let v=P.stepStates[S];x.push({foreignUserId:P.foreignUserId,flowSlug:P.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...l]}return{addResponse:b,setFlowResponses:p,getFlowResponses:C}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Mo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var hr=(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))(hr||{});function Z(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:b,flowDataOverrides:C}=Sa(X),x={data:[]},{verifySDKInitiated:P}=Gt(),{addResponse:S,getFlowResponses:v}=xo(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:A}=De(),{data:H,error:_,isLoading:R}=wa(l?`${t}flows${b?"?readonly=true":""}`:null,$,{keepPreviousData:!0});ba(()=>{if(_){console.error(_);return}H&&H.data&&i(H.data)},[H,_]);function J(h){if(R)return null;let f=o.find(F=>F.slug===h);return!f&&o.length>0&&!O&&!R?(console.log(`Flow with id ${h} not found`),null):(f&&C&&C[h]&&(f.data=C[h]),(f==null?void 0:f.active)===!1&&!b?null:f)}function Q(h){var U,fe,ht,kt,Pt;if(!J(h))return[];let f=(U=J(h))==null?void 0:U.data;return f?(f=q(f),((Pt=(kt=(fe=Mo(f))==null?void 0:fe.data)!=null?kt:(ht=Mo(f))==null?void 0:ht.steps)!=null?Pt:[]).map(ge=>{let uo=je(ge);return j(T({handleSecondaryButtonClick:()=>{ge.skippable===!0&&de(h,ge.id,{skipped:!0})}},ge),{complete:ce(h,ge.id)===Le||uo>=1,started:ce(h,ge.id)===go||ce(h,ge.id)===Le,currentlyActive:u==null?void 0:u.some(fo=>fo.flowId==h&&fo.lastStepId===ge.id),blocked:V(h,ge.id),hidden:W(h,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&de(h,ge.id)},progress:uo})}).filter(ge=>ge.hidden!==!0)):[]}function q(h){return h.replaceAll(/\${(.*?)}/g,(f,F)=>p[F]===void 0?"":String(p[F]).replace(/[\u00A0-\u9999<>\&]/g,function(U){return"&#"+U.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function Y(h){var F;if(!J(h))return[];let f=J(h).data;return f?(f=q(f),(F=JSON.parse(f))!=null?F:{}):[]}function pe(h,f){d(F=>j(T({},F),{[h]:f}))}function we(h){!O&&!R&&h&&JSON.stringify(p)!=JSON.stringify(T(T({},p),h))&&Object.keys(h).forEach(f=>{pe(f,h[f])})}let Oe=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:go,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield A(h,f,U),S(U))}),[n,r,u]),ee=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield N(h,f,U),S(U))}),[n,r,u]),de=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:Le,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield I(h,f,U),S(U))}),[n,r,u]),D=Bt((h,f)=>M(this,null,function*(){if(!P()||Xe(h)===Me)return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Me,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),xe(F)&&S(F)}),[n,r,u]),oe=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:vt,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&S(F)}),[n,r,u]),Ne=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:re,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]),Je=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:$o,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]);function xe(h){var f;if(u===void 0)return!1;if(u){let F=u.find(U=>U.flowId===h.flowSlug);if(h.actionType===nt&&(!(F!=null&&F.stepStates[h.stepId])||F.stepStates[h.stepId].actionType===nt))return!1;if(F&&((f=F.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===Le&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let U=Object.keys(F.stepStates).sort((fe,ht)=>{let kt=new Date(F.stepStates[fe].createdAt),Pt=new Date(F.stepStates[ht].createdAt);return kt.getTime()-Pt.getTime()});if(F.stepStates[U[U.length-1]].actionType===h.actionType&&h.stepId===U[U.length-1])return!1}if(F&&F.flowState===re&&h.actionType===re)return!1}return!0}function ce(h,f){let F=L(h,f);return O?null:F?F.actionType:nt}function V(h,f){let F=L(h,f);return F?F.blocked:!1}function W(h,f){let F=L(h,f);return F?F.hidden:!1}function L(h,f){var U;if(O)return null;let F=u==null?void 0:u.find(fe=>fe.flowId===h);return!F||!F.stepStates[f]?null:(U=F.stepStates[f])!=null?U:null}function z(h){var F,U;if(O||!u)return null;if(Xe(h)===Me)return(F=Q(h)[0])!=null?F:null;let f=(U=u.find(fe=>fe.flowId===h))==null?void 0:U.lastStepId;return f?Q(h).find(fe=>fe.id===f):null}function me(h){var U;let f=z(h);if(!f)return 0;let F=(U=Q(h).findIndex(fe=>fe.id===f.id))!=null?U:0;return ce(h,f.id)===Le&&F<Q(h).length-1?F+1:F}function je(h){if(!h.completionCriteria)return;let f=ui(h.completionCriteria);if(f===null)return;let F=Ft(f),U=Ge(f);return U===0?void 0:F/U}function Xe(h){let f=u==null?void 0:u.find(F=>F.flowId===h);return f?f.flowState:null}function Ft(h){let f=Q(h);return f.length===0?0:f.filter(U=>ce(h,U.id)===Le).length}function Ge(h){return Q(h).length}function gt(h){let f=o.find(F=>F.slug===h);return f?(C&&C[h]&&(f.data=C[h]),Mo(f.data)):null}function Ke(h){if(b)return!1;if(O||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(F=>F.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function Wt(h){return!Ke(J(h))}function zt(){n&&B()}function Ht(){return o}return{getAllFlows:Ht,getFlow:J,getFlowData:gt,isLoading:O||R,getStepStatus:ce,getFlowSteps:Q,getCurrentStepIndex:me,markStepStarted:Oe,markStepCompleted:de,markFlowNotStarted:D,markFlowStarted:oe,markFlowCompleted:Ne,markFlowAborted:Je,markStepNotStarted:ee,getFlowStatus:Xe,getNumberOfStepsCompleted:Ft,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Ke,setCustomVariable:pe,updateCustomVariables:we,customVariables:p,getStepOptionalProgress:je,getFlowMetadata:Y,isStepBlocked:V,isStepHidden:W,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Wt,refresh:zt}}import{useCallback as xr,useContext as Ta,useEffect as Fa}from"react";var Kt="guest_";function Co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(X),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=De(),d=jt(),{verifySDKInitiated:s}=Gt();function m(b){return`frigade-user-registered-${b}`}Fa(()=>{if(e&&!t){if(e.startsWith(Kt))return;let b=m(e);localStorage.getItem(b)||(d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(b,"true"))}},[e,n,t]);let c=xr(b=>M(this,null,function*(){if(!s())return;let C={foreignId:e,properties:b};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(C)})),i(x=>T(T({},x),b)),p()}),[e,r,n,p]),g=xr((b,C)=>M(this,null,function*(){if(!s())return;let P={foreignId:e,events:[{event:b,properties:C}]};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),p()}),[e,r,p]),y=xr((b,C)=>M(this,null,function*(){if(s())if(C){let x=m(b);localStorage.setItem(x,"true"),o(b);let P={foreignId:b,properties:C};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),i(S=>T(T({},S),C)),p()}else o(b)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as Rp}from"uuid";import ot,{useEffect as xn,useState as Jp}from"react";import qe,{useEffect as br,useState as Ia}from"react";import Wo from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",yo="cfr-";function a(e,t){let o=`${fi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+yo+e}return o}function E(e){if(!e.className||e.className.indexOf(yo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Do(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=>`${Do(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function So(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,gi=({onClose:e,appearance:t})=>ka.createElement(va,{className:a("modalBackground",t),onClick:()=>e()});import
|
|
26
|
+
`,gi=({onClose:e,appearance:t})=>ka.createElement(va,{className:a("modalBackground",t),onClick:()=>e()});import Cr from"react";import Ba from"styled-components";var Ea=Ba.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,Ee=()=>Cr.createElement(Ea,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 La}from"react-portal";import Bi from"react";import yr from"react";function Aa({style:e,className:t}){return yr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},yr.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"}),yr.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 hi=Aa;import Sr from"styled-components";import st from"styled-components";var Uo=st.div`
|
|
31
31
|
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -57,11 +57,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
|
-
`,xi=
|
|
60
|
+
`,xi=st.button`
|
|
61
61
|
${e=>E(e)} {
|
|
62
62
|
${e=>e.hasImage?Oa:Na};
|
|
63
63
|
}
|
|
64
|
-
`,Ci=
|
|
64
|
+
`,Ci=st.img`
|
|
65
65
|
${e=>E(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
@@ -69,7 +69,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
69
69
|
min-height: 200px;
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
|
-
`,yi=
|
|
72
|
+
`,yi=st.div`
|
|
73
73
|
${e=>E(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
@@ -77,19 +77,19 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
77
77
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
78
78
|
object-fit: cover;
|
|
79
79
|
}
|
|
80
|
-
`,Si=
|
|
80
|
+
`,Si=st.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
align-content: center;
|
|
85
|
-
`,bi=
|
|
85
|
+
`,bi=st.div`
|
|
86
86
|
padding: 22px 22px 12px;
|
|
87
|
-
`,wi=
|
|
87
|
+
`,wi=st.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
justify-content: center;
|
|
92
|
-
`,Ti=
|
|
92
|
+
`,Ti=st.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
flex: 2;
|
|
95
95
|
flex-shrink: 1;
|
|
@@ -101,7 +101,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
|
-
`,Fi=
|
|
104
|
+
`,Fi=st.p`
|
|
105
105
|
${e=>E(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
@@ -110,7 +110,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
110
110
|
color: #808080;
|
|
111
111
|
}
|
|
112
112
|
margin: 0;
|
|
113
|
-
`;var ki=
|
|
113
|
+
`;var ki=Sr.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 na=Object.defineProperty,sa=Object.defineProperties;var la=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
|
-
`,Pi=
|
|
124
|
+
`,Pi=Sr(Uo)`
|
|
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 na=Object.defineProperty,sa=Object.defineProperties;var la=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
|
-
`,vi=
|
|
137
|
+
`,vi=Sr.div`
|
|
138
138
|
display: flex;
|
|
139
139
|
justify-content: center;
|
|
140
140
|
align-items: center;
|
|
@@ -143,7 +143,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=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
|
|
146
|
+
`;function _o({appearance:e}){return Bi.createElement(vi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Bi.createElement(hi,null))}var $a=Wo.div`
|
|
147
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}};
|
|
@@ -158,7 +158,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
158
158
|
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
159
159
|
z-index: 1500;
|
|
160
160
|
border-radius: ${e=>{var t,o,i;return(i=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?i:8}}px;
|
|
161
|
-
${e=>
|
|
161
|
+
${e=>ke(e)}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
padding: 32px;
|
|
@@ -185,10 +185,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,Ma=
|
|
188
|
+
`,Ma=Wo.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
`,Da=
|
|
191
|
+
`,Da=Wo.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
@@ -198,14 +198,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
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
|
-
`,Ua=
|
|
201
|
+
`,Ua=Wo.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
|
-
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=Ia("");return
|
|
208
|
+
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=Ia("");return br(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");s(m)},[]),br(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),br(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement(La,null,qe.createElement(gi,{appearance:r,onClose:()=>{l&&e()}}),qe.createElement($a,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&qe.createElement(Da,{className:a("modalClose",r),onClick:()=>e(),appearance:r},qe.createElement(Ee,null)),o&&qe.createElement(Ma,null,o),qe.createElement(Ua,null,n),p&&qe.createElement(ki,{appearance:r,className:a("poweredByFrigadeRibbon",r)},qe.createElement(_o,{appearance:r})))):qe.createElement(qe.Fragment,null)};import xt,{useEffect as wr,useState as _a}from"react";import zo 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,7 +214,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
214
214
|
`;case"bottom-left":return`
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var Ha=
|
|
217
|
+
`}return"right: 0; bottom: 0;"}var Ha=zo.div`
|
|
218
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}};
|
|
@@ -230,10 +230,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
230
230
|
}
|
|
231
231
|
${e=>za(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
|
-
`,Va=
|
|
233
|
+
`,Va=zo.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,ja=
|
|
236
|
+
`,ja=zo.div`
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 16px;
|
|
239
239
|
right: 16px;
|
|
@@ -243,13 +243,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
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
|
-
`,Ga=
|
|
246
|
+
`,Ga=zo.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
252
|
+
`,Ho=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=_a("");return wr(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s)},[]),wr(()=>{let s=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e]),wr(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p)}},[t]),t?xt.createElement(Wa,null,xt.createElement(Ha,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&xt.createElement(ja,{className:a("cornerModalClose",n),onClick:()=>e()},xt.createElement(Ee,null)),o&&xt.createElement(Va,null,o),xt.createElement(Ga,null,i))):xt.createElement(xt.Fragment,null)};import{useContext as Ka}from"react";function ie(){let{defaultAppearance:e}=Ka(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 Et,{useContext as fp,useEffect as Gi,useState as Nr}from"react";import qo from"styled-components";import Go,{useEffect as Li,useState as kr}from"react";import Pr from"styled-components";import Vo from"styled-components";var Ei=Vo.label`
|
|
253
253
|
${e=>E(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
@@ -260,14 +260,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
260
260
|
letter-spacing: 0.24px;
|
|
261
261
|
}
|
|
262
262
|
display: flex;
|
|
263
|
-
`,Ai=
|
|
263
|
+
`,Ai=Vo.label`
|
|
264
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
|
-
`,Oi=
|
|
270
|
+
`,Oi=Vo.span`
|
|
271
271
|
font-weight: 400;
|
|
272
272
|
font-size: 14px;
|
|
273
273
|
line-height: 22px;
|
|
@@ -275,16 +275,16 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
275
275
|
display: flex;
|
|
276
276
|
margin-right: 5px;
|
|
277
277
|
margin-top: 10px;
|
|
278
|
-
`,Vo
|
|
278
|
+
`,jo=Vo.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 Tr from"react";var lt={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function Ct({title:e,required:t,appearance:o=lt}){return e?Tr.createElement(jo,{className:a("formLabelWrapper",o)},t?Tr.createElement(Oi,{className:a("formLabelRequired",o),appearance:o},"*"):null,Tr.createElement(Ei,{className:a("formLabel",o)},e)):null}import Ni from"react";function qt({title:e,appearance:t}){return e?Ni.createElement(jo,null,Ni.createElement(Ai,{className:a("formSubLabel",t)},e)):null}import{z as Fr}from"zod";function Ii(e,t){var o,i,n,r,l,p,d;try{if(t){if(t.type=="number"){let s=Fr.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=Fr.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 Fr.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 qa=Pr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,Pr
|
|
287
|
+
`,vr=Pr.input`
|
|
288
288
|
${e=>E(e)} {
|
|
289
289
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
290
290
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -300,7 +300,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
|
-
`,Ya=
|
|
303
|
+
`,Ya=Pr.textarea`
|
|
304
304
|
${e=>E(e)} {
|
|
305
305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
306
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -317,7 +317,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=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]=kr((n==null?void 0:n.text)||""),[d,s]=kr(!1),[m,c]=kr(!1),g=vr;Li(()=>{l===""&&!d&&(s(!0),y(""))},[]),Li(()=>{if(m){y(l);return}},[m]);function y(C){var P;if(p(C),o({text:C}),r.required===!0&&C.trim()===""){i([{id:r.id,message:`${(P=r.title)!=null?P:"Field"} is required`,hidden:!m}]);return}let x=Ii(C,r.validation);if(x&&(C.trim()!==""||r.required===!0)){i([{id:r.id,message:x,hidden:!m}]);return}i([])}r.multiline&&(g=Ya);function b(){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 Go.createElement(qa,null,Go.createElement(Ct,{title:r.title,required:r.required,appearance:t.appearance}),Go.createElement(g,{className:a("inputComponent",t.appearance),value:l,onChange:C=>{y(C.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:b(),onBlur:()=>{c(!0)}}),Go.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import et,{useEffect as $i,useState as Mi}from"react";import Di from"styled-components";var Er="",Ja=Di.div`
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
width: 100%;
|
|
@@ -344,9 +344,9 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=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 Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,
|
|
348
|
-
${e=>
|
|
349
|
-
`,
|
|
347
|
+
`;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,g,y,b,C,x,P,S;let r=e,[l,p]=Mi(!1),[d,s]=Mi(!1);return $i(()=>{var v,$,B,u;if(!((v=i==null?void 0:i.choice)!=null&&v[0])&&!l){if(p(!0),r.requireSelection){o({choice:[Er]});return}if(r.defaultValue&&(($=r.props.options)!=null&&$.find(O=>O.id===r.defaultValue))){let O=(B=r.props.options)==null?void 0:B.find(w=>w.id===r.defaultValue);o({choice:[O.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),$i(()=>{var v;d&&(r.requireSelection&&((v=i==null?void 0:i.choice)==null?void 0:v[0])===Er?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),et.createElement(Ja,null,et.createElement(Ct,{title:r.title,required:!1,appearance:t.appearance}),et.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:v=>{s(!0),o({choice:[v.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&et.createElement("option",{key:"null-value",value:Er,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(y=r.props.options)==null?void 0:y.map(v=>et.createElement("option",{key:v.id,value:v.id},v.title))),((C=(b=r.props.options)==null?void 0:b.find(v=>{var $;return v.id===(($=i==null?void 0:i.choice)==null?void 0:$[0])}))==null?void 0:C.isOpenEnded)&&et.createElement(et.Fragment,null,et.createElement(Ct,{title:(S=(P=(x=r.props.options)==null?void 0:x.find(v=>{var $;return v.id===(($=i==null?void 0:i.choice)==null?void 0:$[0])}))==null?void 0:P.openEndedLabel)!=null?S:"Please specify",required:!1,appearance:t.appearance}),et.createElement(vr,{type:"text",placeholder:"Enter your answer here",onChange:v=>{o({choice:[v.target.value]})},appearance:t.appearance})),et.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import To,{useEffect as Ar,useState as Wi}from"react";import zi from"styled-components";import wo from"react";import bo from"react";var _i=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return bo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Qa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:l})=>bo.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},bo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},bo.createElement(_i,{color:n,size:t}),bo.createElement(_i,{color:e,percentage:Math.max(o,.1),size:t})),i),Yt=Qa;import Za from"styled-components";var Ra=({color:e="#FFFFFF"})=>wo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ep={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},tp={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},op={border:"1px solid #000000",color:"#FFFFFF"},rp={border:"1px solid #C5CBD3"},ip={color:"#FFFFFF"},np={border:"1px solid #C5CBD3"},sp=e=>e==="square"?ep:tp,lp=(e,t)=>e==="square"?t?op:rp:t?ip:np,ap=Za.div`
|
|
348
|
+
${e=>ke(e)}
|
|
349
|
+
`,at=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=lt,style:r,className:l})=>{let p=sp(t),d=lp(t,e);return e===!0?p=j(T(T({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=T(T({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?wo.createElement(Yt,{fillColor:o,percentage:i,size:22}):wo.createElement(ap,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&wo.createElement(Ra,{color:"#FFFFFF"}))};var pp=zi.div`
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: column;
|
|
352
352
|
width: 100%;
|
|
@@ -377,7 +377,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
377
377
|
height: 48px;
|
|
378
378
|
padding: 0 18px;
|
|
379
379
|
margin-bottom: 10px;
|
|
380
|
-
`;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=Wi((i==null?void 0:i.choice)||[]),[d,s]=Wi(!1);return
|
|
380
|
+
`;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=Wi((i==null?void 0:i.choice)||[]),[d,s]=Wi(!1);return Ar(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}))},[]),Ar(()=>{o({choice:l})},[l]),Ar(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[l]),To.createElement(pp,null,To.createElement(Ct,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>To.createElement(dp,{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,To.createElement(at,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),To.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import Ko from"react";import Vi from"styled-components";import cp from"dompurify";function ne(e){return{__html:cp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var mp=Vi.h1`
|
|
381
381
|
${e=>E(e)} {
|
|
382
382
|
font-style: normal;
|
|
383
383
|
font-weight: 700;
|
|
@@ -398,38 +398,38 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
398
398
|
letter-spacing: 0.28px;
|
|
399
399
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
400
400
|
}
|
|
401
|
-
`;function
|
|
401
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Ko.createElement(Ko.Fragment,null,Ko.createElement(mp,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:a(`${n}${n?So(i):i}Title`,e),dangerouslySetInnerHTML:ne(t),size:i}),o&&Ko.createElement(up,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:a(`${n}${n?So(i):i}Subtitle`,e),dangerouslySetInnerHTML:ne(o),size:i}))}import*as Or from"react";var ji=e=>Or.createElement("svg",T({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Or.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 gp=qo.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
|
-
`,hp=
|
|
407
|
+
`,hp=qo.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
|
-
`,xp=
|
|
413
|
+
`,xp=qo.div`
|
|
414
414
|
margin-right: 4px;
|
|
415
415
|
display: inline-flex;
|
|
416
|
-
`,Cp=
|
|
416
|
+
`,Cp=qo.div`
|
|
417
417
|
padding-left: 1px;
|
|
418
418
|
padding-right: 1px;
|
|
419
|
-
`,yp={text:
|
|
419
|
+
`,yp={text:Br,multipleChoice:Ui,multipleChoiceList:Hi},Ir="frigade-multiInputStepTypeData";function Ki({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:l,prefillData:p}){var B;let d=t.props,[s,m]=Nr([]),[c,g]=Nr([]),{userId:y}=Co(),[b,C]=Nr(v()||(p?p[t.id]:null)||{}),{readonly:x}=fp(X),P=T(T({},yp),l);Gi(()=>{i(s.length===0)},[s,i]),Gi(()=>{n(b)},[b]);function S(u,O){C(w=>{let k=j(T({},w),{[u.id]:O});return typeof window!="undefined"&&window.localStorage&&!x&&window.localStorage.setItem($(),JSON.stringify(k)),k})}function v(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem($());if(u)return JSON.parse(u)}return null}function $(){return`${Ir}-${e}-${t.id}-${y}`}return Et.createElement(Cp,{className:a("multiInput",r)},Et.createElement(Ae,{appearance:r,title:t.title,subtitle:t.subtitle}),Et.createElement(gp,{className:a("multiInputContainer",r)},(B=d==null?void 0:d.data)==null?void 0:B.map(u=>{let O=s.reverse().find(w=>w.id===u.id);return P[u.type]?Et.createElement("span",{key:u.id,"data-field-id":u.id,className:a("multiInputField",r)},P[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:w=>{!c.includes(u.id)&&w&&(w==null?void 0:w.text)!==""&&g(k=>[...k,u.id]),S(u,w)},inputData:b[u.id],setFormValidationErrors:w=>{w.length===0&&s.length===0||m(k=>w.length===0?k.filter(I=>I.id!==u.id):[...k,...w])}}),O&&O.message&&c.includes(u.id)&&O.hidden!==!0&&Et.createElement(hp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Et.createElement(xp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Et.createElement(ji,null)),O.message)):null})))}import Jt from"styled-components";var qi=Jt.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
|
-
`,Yi=
|
|
424
|
+
`,Yi=Jt.div`
|
|
425
425
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
426
426
|
font-size: 12px;
|
|
427
|
-
`,Ji=
|
|
427
|
+
`,Ji=Jt.div`
|
|
428
428
|
display: flex;
|
|
429
429
|
gap: 12px;
|
|
430
430
|
width: 100%;
|
|
431
431
|
justify-content: flex-end;
|
|
432
|
-
`,Xi=
|
|
432
|
+
`,Xi=Jt.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 na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
437
437
|
flex-grow: 1;
|
|
438
438
|
flex-basis: 0;
|
|
439
439
|
position: relative;
|
|
440
|
-
`,Qi=
|
|
440
|
+
`,Qi=Jt.div`
|
|
441
441
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
442
442
|
position: relative;
|
|
443
443
|
overflow-y: auto;
|
|
444
|
-
`,Zi=
|
|
444
|
+
`,Zi=Jt.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
align-self: stretch;
|
|
447
447
|
flex-grow: 1;
|
|
@@ -453,7 +453,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=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 yt from"react";import en from"react";import tn from"styled-components";import Sp from"styled-components";var Ri=Sp.div`
|
|
457
457
|
width: 24px;
|
|
458
458
|
height: 24px;
|
|
459
459
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -490,7 +490,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
490
490
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
491
491
|
line-height: 20px;
|
|
492
492
|
font-weight: 500;
|
|
493
|
-
${e=>
|
|
493
|
+
${e=>ke(e)}
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
font-family: inherit;
|
|
@@ -504,7 +504,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
504
504
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
505
505
|
cursor: not-allowed;
|
|
506
506
|
}
|
|
507
|
-
`,
|
|
507
|
+
`,Yo=tn.div`
|
|
508
508
|
${e=>E(e)} {
|
|
509
509
|
display: flex;
|
|
510
510
|
flex-direction: row;
|
|
@@ -515,14 +515,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
515
515
|
margin-right: 8px;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
`,
|
|
518
|
+
`,se=({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,autoFocus:c=!1})=>{var y;function g(){let b=l?"buttonSecondary":"button";return s===""?b:`${s}${So(b)}`}return en.createElement(bp,{tabindex:l?"0":"1",secondary:l,appearance:p,disabled:i||m,loading:(y=m==null?void 0:m.toString())!=null?y:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(g(),p),autoFocus:c},m?en.createElement(Ri,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var on=({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 yt.createElement(yt.Fragment,null,s!==null&&s!=null&&yt.createElement(Yi,{appearance:o,className:a("formCTAError",o)},s),yt.createElement(qi,{showBackButton:c,className:a("formCTAContainer",o)},c&&yt.createElement(se,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:p,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),yt.createElement(Ji,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?yt.createElement(se,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?yt.createElement(se,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:m}):null)))};import Lr from"react";import wp from"styled-components";var Tp=wp.div`
|
|
519
519
|
text-align: center;
|
|
520
|
-
`,rn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=
|
|
520
|
+
`,rn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ie().mergeAppearanceWithDefault(i);return Lr.createElement(Tp,{className:o},Lr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,l)=>Lr.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?n.colorPrimary:"#E6E6E6"}))))};import At from"react";import Xt from"styled-components";import{useContext as Fp}from"react";function ue(){let e=Fp(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 kp=Xt.div`
|
|
521
521
|
display: flex;
|
|
522
522
|
flex-wrap: wrap;
|
|
523
523
|
align-content: center;
|
|
524
524
|
justify-content: center;
|
|
525
|
-
`,Pp=
|
|
525
|
+
`,Pp=Xt.div`
|
|
526
526
|
align-content: center;
|
|
527
527
|
align-items: center;
|
|
528
528
|
display: flex;
|
|
@@ -536,10 +536,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
536
536
|
flex-basis: 255px;
|
|
537
537
|
flex-grow: 0;
|
|
538
538
|
flex-shrink: 0;
|
|
539
|
-
`,vp=
|
|
539
|
+
`,vp=Xt.img`
|
|
540
540
|
width: 78px;
|
|
541
541
|
height: auto;
|
|
542
|
-
`,Bp=
|
|
542
|
+
`,Bp=Xt.button`
|
|
543
543
|
font-style: normal;
|
|
544
544
|
font-weight: 600;
|
|
545
545
|
font-size: 13px;
|
|
@@ -552,11 +552,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
552
552
|
border-radius: 100px;
|
|
553
553
|
padding: 8px 12px;
|
|
554
554
|
margin-top: 16px;
|
|
555
|
-
`,Ep=
|
|
555
|
+
`,Ep=Xt.h1`
|
|
556
556
|
font-weight: 700;
|
|
557
557
|
font-size: 28px;
|
|
558
558
|
line-height: 34px;
|
|
559
|
-
`,Ap=
|
|
559
|
+
`,Ap=Xt.h2`
|
|
560
560
|
font-style: normal;
|
|
561
561
|
font-weight: 400;
|
|
562
562
|
font-size: 16px;
|
|
@@ -565,7 +565,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
565
565
|
margin-top: 12px;
|
|
566
566
|
margin-bottom: 16px;
|
|
567
567
|
max-width: 70%;
|
|
568
|
-
`;function nn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=
|
|
568
|
+
`;function nn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ue();return At.createElement("div",null,At.createElement(Ep,{dangerouslySetInnerHTML:ne(e.title)}),At.createElement(Ap,{dangerouslySetInnerHTML:ne(e.subtitle)}),At.createElement(kp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>At.createElement(Pp,{key:r.title},At.createElement(vp,{src:r.imageUri}),At.createElement(Bp,{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 Zt,{useEffect as _p}from"react";import Xo from"styled-components";import $r from"react";var Jo=({style:e,className:t})=>$r.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},$r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),$r.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 Ot,{useRef as Op,useState as Np}from"react";import Qt from"styled-components";var Ip=Qt.div`
|
|
569
569
|
display: flex;
|
|
570
570
|
align-items: center;
|
|
571
571
|
justify-content: flex-start;
|
|
@@ -573,7 +573,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
573
573
|
width: 100%;
|
|
574
574
|
height: 100%;
|
|
575
575
|
position: relative;
|
|
576
|
-
`,Lp=
|
|
576
|
+
`,Lp=Qt.div`
|
|
577
577
|
position: absolute;
|
|
578
578
|
display: flex;
|
|
579
579
|
align-items: center;
|
|
@@ -592,66 +592,66 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
592
592
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
593
593
|
border-radius: 50%;
|
|
594
594
|
}
|
|
595
|
-
`,$p=
|
|
595
|
+
`,$p=Qt.video`
|
|
596
596
|
width: 100%;
|
|
597
597
|
height: 100%;
|
|
598
598
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
599
|
-
`,Mp=
|
|
599
|
+
`,Mp=Qt.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
|
-
`,Dp=
|
|
604
|
+
`,Dp=Qt.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
|
-
}`,Up=
|
|
609
|
+
}`,Up=Qt.iframe`
|
|
610
610
|
width: 100%;
|
|
611
611
|
height: 100%;
|
|
612
612
|
min-height: 400px;
|
|
613
613
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
614
|
-
`;function tt({appearance:e,videoUri:t}){let o=Op(),[i,n]=Np(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Mp,{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)),Ot.createElement(Dp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let r=t.split("wistia.com/medias/")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Up,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return Ot.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Ot.createElement(Lp,{onClick:()=>{n(!0),o.current.play()},appearance:e},Ot.createElement(
|
|
614
|
+
`;function tt({appearance:e,videoUri:t}){let o=Op(),[i,n]=Np(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Mp,{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)),Ot.createElement(Dp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let r=t.split("wistia.com/medias/")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Up,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return Ot.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Ot.createElement(Lp,{onClick:()=>{n(!0),o.current.play()},appearance:e},Ot.createElement(Jo,null)),Ot.createElement($p,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Wp=Xo.div`
|
|
615
615
|
${e=>E(e)} {
|
|
616
616
|
display: flex;
|
|
617
617
|
flex-direction: column;
|
|
618
618
|
justify-content: center;
|
|
619
619
|
}
|
|
620
|
-
`,zp=
|
|
620
|
+
`,zp=Xo.img`
|
|
621
621
|
${e=>E(e)} {
|
|
622
622
|
width: 100%;
|
|
623
623
|
height: auto;
|
|
624
624
|
max-height: 250px;
|
|
625
625
|
margin-bottom: 24px;
|
|
626
626
|
}
|
|
627
|
-
`,Hp=
|
|
627
|
+
`,Hp=Xo.div`
|
|
628
628
|
${e=>E(e)} {
|
|
629
629
|
margin-bottom: 24px;
|
|
630
630
|
}
|
|
631
|
-
`,Vp=
|
|
631
|
+
`,Vp=Xo.div`
|
|
632
632
|
${e=>E(e)} {
|
|
633
633
|
width: 100%;
|
|
634
634
|
height: auto;
|
|
635
635
|
max-height: 250px;
|
|
636
636
|
margin-bottom: 24px;
|
|
637
637
|
}
|
|
638
|
-
`;function sn({stepData:e,appearance:t,setCanContinue:o}){return _p(()=>{o(!0)},[]),
|
|
638
|
+
`;function sn({stepData:e,appearance:t,setCanContinue:o}){return _p(()=>{o(!0)},[]),Zt.createElement(Wp,{className:a("callToActionContainer",t)},Zt.createElement(Hp,{className:a("callToActionTextContainer",t)},Zt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Zt.createElement(zp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Zt.createElement(Vp,{appearance:t,className:a("callToActionVideo",t)},Zt.createElement(tt,{appearance:t,videoUri:e.videoUri})))}import pt,{useEffect as Mr,useState as Dr}from"react";import St from"styled-components";var ln=St.div`
|
|
639
639
|
width: auto;
|
|
640
640
|
display: flex;
|
|
641
641
|
flex-direction: column;
|
|
642
642
|
justify-content: center;
|
|
643
643
|
align-items: center;
|
|
644
644
|
padding: 4px;
|
|
645
|
-
`,an=
|
|
645
|
+
`,an=St.div`
|
|
646
646
|
width: 100%;
|
|
647
647
|
text-align: left;
|
|
648
|
-
`,pn=
|
|
648
|
+
`,pn=St.h1`
|
|
649
649
|
font-style: normal;
|
|
650
650
|
font-weight: 700;
|
|
651
651
|
font-size: 32px;
|
|
652
652
|
line-height: 38px;
|
|
653
653
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
654
|
-
`,dn=
|
|
654
|
+
`,dn=St.h1`
|
|
655
655
|
font-style: normal;
|
|
656
656
|
font-weight: 400;
|
|
657
657
|
font-size: 16px;
|
|
@@ -659,7 +659,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
659
659
|
margin-top: 16px;
|
|
660
660
|
margin-bottom: 16px;
|
|
661
661
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
662
|
-
`,cn=
|
|
662
|
+
`,cn=St.div`
|
|
663
663
|
padding-top: 12px;
|
|
664
664
|
padding-bottom: 12px;
|
|
665
665
|
flex-direction: row;
|
|
@@ -670,17 +670,17 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
670
670
|
cursor: pointer;
|
|
671
671
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
672
672
|
width: 100%;
|
|
673
|
-
`,mn=
|
|
673
|
+
`,mn=St.div`
|
|
674
674
|
padding-top: 10px;
|
|
675
675
|
padding-bottom: 10px;
|
|
676
676
|
flex-direction: row;
|
|
677
677
|
display: flex;
|
|
678
678
|
justify-content: flex-start;
|
|
679
|
-
`,un=
|
|
679
|
+
`,un=St.img`
|
|
680
680
|
width: 42px;
|
|
681
681
|
height: 42px;
|
|
682
682
|
margin-right: 12px;
|
|
683
|
-
`,fn=
|
|
683
|
+
`,fn=St.p`
|
|
684
684
|
font-style: normal;
|
|
685
685
|
font-weight: 500;
|
|
686
686
|
font-size: 17px;
|
|
@@ -688,8 +688,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
688
688
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
689
689
|
display: flex;
|
|
690
690
|
align-self: center;
|
|
691
|
-
`;var gn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=
|
|
692
|
-
${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])=>`${Mo(l)}: ${p};`).join(" ")} }`:`${Mo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function le({appearance:e}){if(!e||!e.styleOverrides)return To.createElement(To.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?To.createElement(To.Fragment,null):To.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ge(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=R(),c=p(e);function f(){return M(this,null,function*(){!o&&!r&&l(e)===Ue&&s(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{f()},[r,e,t]),{}}var Cn=({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:f=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:b=!1,onDismiss:x,showPagination:v=!1,allowBackNavigation:k=!1,validationHandler:B,showFrigadeBranding:L=!1,onFormDataChange:C,showFooter:u=!0,prefillData:N={},updateUrlOnPageChange:F=!1})=>{let{getFlow:P,getFlowSteps:I,isLoading:O,targetingLogicShouldHideFlow:A,getFlowStatus:G,getCurrentStepIndex:_,markFlowCompleted:Q,markFlowNotStarted:Y,markStepStarted:ae}=R(),J=_(e),{mergeAppearanceWithDefault:q}=re(),[pe,we]=Jp(null),{setOpenFlowState:Ne,getOpenFlowState:Z,hasOpenModals:ce}=Ee();Ge(e,i);let U=I(e);d=q(d);let[te,Ie]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),H=>Ne(e,H)],ke=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var H;if(U&&U.length>0&&k){let W=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if(U&&(U==null?void 0:U.length)>0){let $=-1;if(W){let z=W;$=U.findIndex(de=>de.id===z),pe===W&&($=-1)}$!==-1&&(we(W),ae(e,U[$].id))}}},[ke]),xn(()=>{!O&&U&&U.length&&typeof window!="undefined"&&k&&(we(U[J].id),window.location.hash=U[J].id)},[O,J,U]),O)return null;let xe=P(e);if(!xe||A(xe)||!U||i!==void 0&&i===!1||G(e)===oe&&s&&!b||(o=="modal"||o=="corner-modal")&&ce(e))return null;let Ce=()=>{Ie(!1),x&&x(),S===!0&&Q(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",ot.createElement(Re,{appearance:d,onClose:Ce,visible:te,style:H,dismissible:f,showFrigadeBranding:L},ot.createElement(le,{appearance:d}),ot.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b}))}return o==="modal"&&w!=="center"?ot.createElement(zo,{appearance:d,onClose:Ce,visible:te,modalPosition:w},ot.createElement(le,{appearance:d}),ot.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b})):ot.createElement(ot.Fragment,null,ot.createElement(le,{appearance:d}),ot.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b}))},yn=Cn;import{useCallback as Dr,useContext as Xp,useEffect as Qp}from"react";function Ur(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(X),{mutateUserFlowState:i}=_e(),{config:n,apiUrl:r}=Ze(),l=Vt(),{verifySDKInitiated:p}=jt();function d(f,S){return`frigade-user-group-registered-${f}-${S}`}Qp(()=>{if(t&&e){if(t.startsWith(Gt))return;let f=d(t,e);localStorage.getItem(f)||(l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let s=Dr(f=>M(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:f};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),m=Dr((f,S)=>M(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 b={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:S}]};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(b)})),i()}),[e,t,n,i]),c=Dr((f,S)=>M(this,null,function*(){if(p())if(S){let w=d(t,f);localStorage.setItem(w,"true"),o(f);let b={foreignUserId:t,foreignUserGroupId:f,properties:S};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(b)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",ko="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=ho(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=_e(),{userId:n,setUserId:r}=xo(),[l,p]=Fo(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Zp(X),[S,w]=Fo([]),[b,x]=Fo([]),{organizationId:v}=Ur(),[k,B]=Fo(v),[L,C]=Fo(!1);Zt(()=>{if(!o&&t)for(let P=0;P<t.length;P++){let I=t[P],O=s.find(A=>A.slug===(I==null?void 0:I.flowId));if(O&&I&&I.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!b.includes(O.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),Zt(()=>{f.length>0&&i()},[f]),Zt(()=>{L||(C(!0),i())},[o,C]);function u(P){let I=s.find(O=>O.slug===P);I&&I.triggerType==="AUTOMATIC"&&!b.includes(I.slug)&&(x([...b,I.slug]),w([I]))}function N(){if(!n){let P=localStorage.getItem(ko);if(P){r(P);return}let I=localStorage.getItem(Sn);if(I){r(I);return}c(!0);let O=Gt+Rp();try{localStorage.setItem(Sn,O)}catch(A){console.log("Failed to save guest user id locally: Local storage unavailable",A)}r(A=>A||O)}}Zt(()=>{try{if(s){let P=[];s.forEach(I=>{if(I.data){let O=I.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(A=>{let G=A.replace('"imageUri":"',"").replace('"',"");if(P.includes(G))return;let _=new Image;_.src=G,P.push(G)})}})}}catch(P){}},[s]),Zt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Gt))try{localStorage.setItem(ko,n)}catch(P){console.log("Failed to save user id locally: Local storage available",P)}n===null&&setTimeout(()=>{n===null&&N()},50)},[n,s,m]),Zt(()=>{v!=k&&(B(v),e([]),i())},[v,k,B]);function F(){return Nt.createElement(Nt.Fragment,null,S.map(P=>d(P.slug)!==Ue?null:Nt.createElement("span",{key:P.slug},Nt.createElement(yn,{flowId:P.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Nt.createElement(Nt.Fragment,null,Nt.createElement(F,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function td(e){if(!e)return;let t=ye({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),Po=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let l=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,T(T({as:e},p),i),t);if(o!==void 0){let s=ye(l,o);return Fn.createElement(rd,{theme:s},d())}return d()};var vo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(Po)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var Zo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(Po)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),Rt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},_r={colors:V(T({},Rt),{neutral:{foreground:Rt.gray300},primary:{background:Rt.blue500,foreground:Rt.white,inverted:Rt.blue500},negative:{foreground:Rt.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:vo,Text:Zo}};var An="https://api.frigade.com",X=Td({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:pt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:An,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var J,q,pe,we,Ne;let[r,l]=Ke(t||null),[p,d]=Ke(o||null),[s,m]=Ke([]),[c,f]=Ke([]),[S,w]=Ke([]),[b,x]=Ke({}),[v,k]=Ke({}),[B,L]=Ke([]),[C,u]=Ke({}),[N,F]=Ke(!1),[P,I]=Ke(!1),[O,A]=Ke(!Q(e)),G=(Z,ce)=>{if(ce==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},_={theme:T(T({},pt.theme),(q=(J=i==null?void 0:i.defaultAppearance)==null?void 0:J.theme)!=null?q:{}),styleOverrides:T(T({},pt.styleOverrides),(we=(pe=i==null?void 0:i.defaultAppearance)==null?void 0:pe.styleOverrides)!=null?we:{})};function Q(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}er(()=>{t&&l(t)},[t]),er(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(ko)&&window.localStorage.getItem(ko)!==r&&kd()},[r]),er(()=>{o&&d(o)},[o]),er(()=>{if(Q(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let Y={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:S,setFlowResponses:w,userProperties:b,setUserProperties:x,openFlowStates:v,setOpenFlowStates:k,completedFlowsToKeepOpenDuringSession:B,setCompletedFlowsToKeepOpenDuringSession:L,customVariables:C,setCustomVariables:u,isNewGuestUser:N,setIsNewGuestUser:F,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:G,defaultAppearance:_,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:An,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0};if(O)return Ro.createElement(X.Provider,{value:Y},n);let{overrides:ae}=Tn(_);return Ro.createElement(X.Provider,{value:Y},Ro.createElement(Fd,{theme:ye(_.theme,_r,ae!=null?ae:{},(Ne=i==null?void 0:i.theme)!=null?Ne:{})},n,Ro.createElement(bn,null)))};import gc from"react";import Se,{useEffect as pr,useState as il}from"react";import Ye,{useState as jd}from"react";import $t from"styled-components";import rr from"react";import It from"react";import Nn from"styled-components";var On=Nn.span`
|
|
691
|
+
`;var gn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=Dr([]),[p,d]=Dr(!1),[s,m]=Dr(e.id);return Mr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Mr(()=>{s!==e.id&&(m(e.id),l([]))},[e]),Mr(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),pt.createElement(ln,{className:a("selectListContainer",i)},pt.createElement(an,null,pt.createElement(pn,{className:a("selectListTitle",i)},e.title),pt.createElement(dn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let y=r.includes(c.id);return pt.createElement(cn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(b=>b!==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)},pt.createElement(mn,{className:a("selectListItemImage",i)},c.imageUri&&pt.createElement(un,{src:c.imageUri,alt:`select-icon-${g}`}),pt.createElement(fn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),pt.createElement(at,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import Ue,{useEffect as hn,useState as Qo}from"react";var jp=({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),Zo=({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:b=!1,customFormElements:C,allowBackNavigation:x,validationHandler:P,onFormDataChange:S,showFooter:v,prefillData:$,updateUrlOnPageChange:B,repeatable:u})=>{var ce;let w=T(T({},{linkCollection:nn,multiInput:Ki,callToAction:sn,selectList:gn}),i),{primaryCTAClickSideEffects:k,secondaryCTAClickSideEffects:I}=ue(),[N,A]=Qo(!1),[H,_]=Qo({}),[R,J]=Qo(!1),[Q,q]=Qo(null),Y=(ce=t[o])!=null?ce:null,{markStepCompleted:pe,markStepStarted:we,isLoading:Oe,updateCustomVariables:ee,markFlowCompleted:de}=Z();hn(()=>{ee(n)},[n,Oe]),hn(()=>{S&&S(H,D(),t[o],o)},[H]);function D(){var W;return{data:(W=H[t[o].id])!=null?W:{},stepId:t[o].id,customVariables:n}}function oe(V,W,L){let z=o+1<t.length?t[o+1]:null;return l&&l(V,L,z,H,D()),r?r(V,o,W,z):!0}function Ne(V,W){_(L=>{let z={};return z[V.id]=W,T(T({},L),z)})}function Je(V){return V.selectedStep.imageUri?Ue.createElement(Zi,{image:V.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let xe=v&&Ue.createElement(on,{step:t[o],canContinue:N&&!R,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>M(void 0,null,function*(){if(J(!0),P){let L=yield P(t[o],o,t[o+1],H,D());if(L!==!0){q(typeof L=="string"?L:null),J(!1);return}else q(null)}let V=T({},D());yield pe(p,t[o].id,V),o+1<t.length&&!x&&(yield we(p,t[o+1].id));let W=oe(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),s&&W&&(c&&c(!1),g(!1)),yield de(p),u&&(yield we(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(z=>{z.startsWith(Ir)&&window.localStorage.removeItem(z)}))),k(t[o]),J(!1),typeof window!="undefined"&&!x&&B&&o+1<t.length){let L=new URL(window.location.href);L.searchParams.set("p",t[o+1].id),window.history.pushState({},"",L.toString())}}),onSecondaryClick:()=>{oe(t[o],"secondary",o),I(t[o])},onBack:()=>M(void 0,null,function*(){o-1>=0&&(J(!0),yield we(p,t[o-1].id),J(!1))}),steps:t,allowBackNavigation:x,errorMessage:Q,isSaving:R});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Xi,{className:a("formContainer",e)},Ue.createElement(jp,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(Qi,{key:Y.id,type:d,className:a("formContent",e)},t.map(V=>{var L;let W=w[(L=V.type)!=null?L:"multiInput"];return Y.id!==V.id?null:typeof W!="function"?W:Ue.createElement(W,{key:V.id,stepData:V,canContinue:N,setCanContinue:A,onSaveData:z=>{Ne(V,z)},appearance:e,customFormElements:C,flowId:p,prefillData:$})}),b&&Ue.createElement(rn,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),xe)),d=="large-modal"&&Ue.createElement(Je,{selectedStep:t[o]})))};import Fo from"react";import{createGlobalStyle as Gp}from"styled-components";var Kp=Gp`
|
|
692
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${Do(l)}: ${p};`).join(" ")} }`:`${Do(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ae({appearance:e}){if(!e||!e.styleOverrides)return Fo.createElement(Fo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Fo.createElement(Fo.Fragment,null):Fo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function He(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=Z(),c=p(e);function g(){return M(this,null,function*(){!o&&!r&&l(e)===Me&&s(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{g()},[r,e,t]),{}}var Cn=({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:b="center",repeatable:C=!1,onDismiss:x,showPagination:P=!1,allowBackNavigation:S=!1,validationHandler:v,showFrigadeBranding:$=!1,onFormDataChange:B,showFooter:u=!0,prefillData:O={},updateUrlOnPageChange:w=!1})=>{let{getFlow:k,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:A,getFlowStatus:H,getCurrentStepIndex:_,markFlowCompleted:R,markFlowNotStarted:J,markStepStarted:Q}=Z(),q=_(e),{mergeAppearanceWithDefault:Y}=ie(),[pe,we]=Jp(null),{setOpenFlowState:Oe,getOpenFlowState:ee,hasOpenModals:de}=Be();He(e,i);let D=I(e);d=Y(d);let[oe,Ne]=i!==void 0&&n!==void 0?[i,n]:[ee(e,!0),V=>Oe(e,V)],Je=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var V;if(D&&D.length>0&&S){let W=typeof window!="undefined"&&((V=window==null?void 0:window.location)!=null&&V.hash)?window.location.hash.replace("#",""):"";if(D&&(D==null?void 0:D.length)>0){let L=-1;if(W){let z=W;L=D.findIndex(me=>me.id===z),pe===W&&(L=-1)}L!==-1&&(we(W),Q(e,D[L].id))}}},[Je]),xn(()=>{!N&&D&&D.length&&typeof window!="undefined"&&S&&(we(D[q].id),window.location.hash=D[q].id)},[N,q,D]),N)return null;let xe=k(e);if(!xe||A(xe)||!D||i!==void 0&&i===!1||H(e)===re&&s&&!C||(o=="modal"||o=="corner-modal")&&de(e))return null;let ce=()=>{Ne(!1),x&&x(),y===!0&&R(e)};if(b=="center"&&o==="modal"||o==="large-modal"){let V={padding:"24px"};return o==="large-modal"?(V.width="85%",V.height="90%",V.maxHeight="800px",V.minHeight="500px",V.padding="0"):V.width="400px",ot.createElement(Re,{appearance:d,onClose:ce,visible:oe,style:V,dismissible:g,showFrigadeBranding:$},ot.createElement(ae,{appearance:d}),ot.createElement(Zo,{appearance:d,steps:D,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ne,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:w,repeatable:C}))}return o==="modal"&&b!=="center"?ot.createElement(Ho,{appearance:d,onClose:ce,visible:oe,modalPosition:b},ot.createElement(ae,{appearance:d}),ot.createElement(Zo,{appearance:d,steps:D,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ne,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:w,repeatable:C})):ot.createElement(ot.Fragment,null,ot.createElement(ae,{appearance:d}),ot.createElement(Zo,{appearance:d,steps:D,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ne,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:w,repeatable:C}))},yn=Cn;import{useCallback as Ur,useContext as Xp,useEffect as Qp}from"react";function _r(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(X),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Ze(),l=jt(),{verifySDKInitiated:p}=Gt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Qp(()=>{if(t&&e){if(t.startsWith(Kt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,j(T({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=Ur(g=>M(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(T({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Ur((g,y)=>M(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(T({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=Ur((g,y)=>M(this,null,function*(){if(p())if(y){let b=d(t,g);localStorage.setItem(b,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,j(T({},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 Sn="frigade-xFrigade_guestUserId",Po="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=xo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=Co(),[l,p]=ko(n),{getFlowStatus:d}=Z(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Zp(X),[y,b]=ko([]),[C,x]=ko([]),{organizationId:P}=_r(),[S,v]=ko(P),[$,B]=ko(!1);Rt(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let I=t[k],N=s.find(A=>A.slug===(I==null?void 0:I.flowId));if(N&&I&&I.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!C.includes(N.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),Rt(()=>{g.length>0&&i()},[g]),Rt(()=>{$||(B(!0),i())},[o,B]);function u(k){let I=s.find(N=>N.slug===k);I&&I.triggerType==="AUTOMATIC"&&!C.includes(I.slug)&&(x([...C,I.slug]),b([I]))}function O(){if(!n){let k=localStorage.getItem(Po);if(k){r(k);return}let I=localStorage.getItem(Sn);if(I){r(I);return}c(!0);let N=Kt+Rp();try{localStorage.setItem(Sn,N)}catch(A){console.log("Failed to save guest user id locally: Local storage unavailable",A)}r(A=>A||N)}}Rt(()=>{try{if(s){let k=[];s.forEach(I=>{if(I.data){let N=I.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(A=>{let H=A.replace('"imageUri":"',"").replace('"',"");if(k.includes(H))return;let _=new Image;_.src=H,k.push(H)})}})}}catch(k){}},[s]),Rt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Kt))try{localStorage.setItem(Po,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&O()},50)},[n,s,m]),Rt(()=>{P!=S&&(v(P),e([]),i())},[P,S,v]);function w(){return Nt.createElement(Nt.Fragment,null,y.map(k=>d(k.slug)!==Me?null:Nt.createElement("span",{key:k.slug},Nt.createElement(yn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Nt.createElement(Nt.Fragment,null,Nt.createElement(w,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function td(e){if(!e)return;let t=ye({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),vo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let l=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,T(T({as:e},p),i),t);if(o!==void 0){let s=ye(l,o);return Fn.createElement(rd,{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"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(vo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var Ro={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(vo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),eo={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Wr={colors:j(T({},eo),{neutral:{foreground:eo.gray300},primary:{background:eo.blue500,foreground:eo.white,inverted:eo.blue500},negative:{foreground:eo.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:Bo,Text:Ro}};var An="https://api.frigade.com",X=Td({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:lt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:An,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,Y,pe,we,Oe;let[r,l]=Ve(t||null),[p,d]=Ve(o||null),[s,m]=Ve([]),[c,g]=Ve([]),[y,b]=Ve([]),[C,x]=Ve({}),[P,S]=Ve({}),[v,$]=Ve([]),[B,u]=Ve({}),[O,w]=Ve(!1),[k,I]=Ve(!1),[N,A]=Ve(!R(e)),H=(ee,de)=>{if(de==="_blank"){window.open(ee,"_blank");return}setTimeout(()=>{window.location.href=ee},50)},_={theme:T(T({},lt.theme),(Y=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?Y:{}),styleOverrides:T(T({},lt.styleOverrides),(we=(pe=i==null?void 0:i.defaultAppearance)==null?void 0:pe.styleOverrides)!=null?we:{})};function R(ee){return!!(ee&&ee.length>10&&ee.substring(0,10)==="api_public")}tr(()=>{t&&l(t)},[t]),tr(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Po)&&window.localStorage.getItem(Po)!==r&&kd()},[r]),tr(()=>{o&&d(o)},[o]),tr(()=>{if(R(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let J={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:b,userProperties:C,setUserProperties:x,openFlowStates:P,setOpenFlowStates:S,completedFlowsToKeepOpenDuringSession:v,setCompletedFlowsToKeepOpenDuringSession:$,customVariables:B,setCustomVariables:u,isNewGuestUser:O,setIsNewGuestUser:w,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:H,defaultAppearance:_,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:An,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0};if(N)return er.createElement(X.Provider,{value:J},n);let{overrides:Q}=Tn(_);return er.createElement(X.Provider,{value:J},er.createElement(Fd,{theme:ye(_.theme,Wr,Q!=null?Q:{},(Oe=i==null?void 0:i.theme)!=null?Oe:{})},n,er.createElement(bn,null)))};import gc from"react";import Se,{useEffect as dr,useState as il}from"react";import Ye,{useState as jd}from"react";import $t from"styled-components";import ir from"react";import It from"react";import Nn from"styled-components";var On=Nn.span`
|
|
693
693
|
font-weight: 600;
|
|
694
694
|
font-size: 14px;
|
|
695
695
|
font-style: normal;
|
|
@@ -700,7 +700,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
700
700
|
vertical-align: middle;
|
|
701
701
|
margin-left: 32px;
|
|
702
702
|
padding-right: 12px;
|
|
703
|
-
${e=>
|
|
703
|
+
${e=>ke(e)}
|
|
704
704
|
`,vd=Nn.div`
|
|
705
705
|
flex-direction: row;
|
|
706
706
|
justify-content: space-between;
|
|
@@ -709,12 +709,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
709
709
|
padding-bottom: 20px;
|
|
710
710
|
padding-right: 8px;
|
|
711
711
|
width: 100%;
|
|
712
|
-
${e=>
|
|
713
|
-
`,
|
|
712
|
+
${e=>ke(e)}
|
|
713
|
+
`,or=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>It.createElement(It.Fragment,null,It.createElement(vd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:T({},n)},i==="left"&&e&&It.createElement(On,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),It.createElement(at,{appearance:p,value:t,type:l,primaryColor:r}),i==="right"&&e&&It.createElement(On,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),It.createElement(ae,{appearance:p}));import Eo from"styled-components";var In=Eo.div`
|
|
714
714
|
font-weight: 700;
|
|
715
715
|
font-size: 18px;
|
|
716
716
|
line-height: 22px;
|
|
717
|
-
`,Ln=
|
|
717
|
+
`,Ln=Eo.p`
|
|
718
718
|
font-weight: 600;
|
|
719
719
|
font-size: 16px;
|
|
720
720
|
line-height: 24px;
|
|
@@ -722,7 +722,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
722
722
|
letter-spacing: 0.32px;
|
|
723
723
|
font-style: normal;
|
|
724
724
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
725
|
-
`,$n=
|
|
725
|
+
`,$n=Eo.p`
|
|
726
726
|
font-weight: 400;
|
|
727
727
|
font-size: 14px;
|
|
728
728
|
font-style: normal;
|
|
@@ -731,26 +731,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
731
731
|
letter-spacing: 0.28px;
|
|
732
732
|
margin: 8px 0px 0px 0px;
|
|
733
733
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
734
|
-
`,
|
|
734
|
+
`,rr=Eo.div`
|
|
735
735
|
width: 6px;
|
|
736
736
|
position: absolute;
|
|
737
737
|
left: 0;
|
|
738
738
|
height: 100%;
|
|
739
739
|
border-top-right-radius: 4px;
|
|
740
740
|
border-bottom-right-radius: 4px;
|
|
741
|
-
`,Mn=
|
|
741
|
+
`,Mn=Eo.div`
|
|
742
742
|
flex-direction: row;
|
|
743
743
|
justify-content: flex-start;
|
|
744
744
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
745
745
|
padding-right: 16px;
|
|
746
|
-
`;var Dn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return
|
|
746
|
+
`;var Dn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return ir.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&ir.createElement(rr,{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}}),ir.createElement(Mn,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},ir.createElement(or,{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 Lt from"react";import zr from"styled-components";import nr from"styled-components";var uC=nr.h1`
|
|
747
747
|
display: flex;
|
|
748
748
|
margin: 0;
|
|
749
749
|
font-size: 18px;
|
|
750
|
-
`,fC=
|
|
750
|
+
`,fC=nr.h2`
|
|
751
751
|
font-size: 15px;
|
|
752
752
|
color: #4d4d4d;
|
|
753
|
-
`,Un=
|
|
753
|
+
`,Un=nr.div`
|
|
754
754
|
position: absolute;
|
|
755
755
|
left: 0;
|
|
756
756
|
top: 0;
|
|
@@ -759,7 +759,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
759
759
|
border-radius: 20px;
|
|
760
760
|
background-color: ${e=>e.theme.colorPrimary};
|
|
761
761
|
transition: width 0.5s;
|
|
762
|
-
`,_n=
|
|
762
|
+
`,_n=nr.div`
|
|
763
763
|
position: relative;
|
|
764
764
|
left: 0;
|
|
765
765
|
top: 0;
|
|
@@ -769,33 +769,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
769
769
|
border-radius: 20px;
|
|
770
770
|
background-color: ${e=>e.theme.colorPrimary};
|
|
771
771
|
opacity: 0.12;
|
|
772
|
-
`;var Bd=
|
|
772
|
+
`;var Bd=zr.div`
|
|
773
773
|
display: flex;
|
|
774
774
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
775
775
|
justify-content: flex-start;
|
|
776
776
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
777
777
|
width: 100%;
|
|
778
778
|
|
|
779
|
-
${e=>
|
|
780
|
-
`,Ed=
|
|
779
|
+
${e=>ke(e)}
|
|
780
|
+
`,Ed=zr.div`
|
|
781
781
|
flex-grow: 1;
|
|
782
782
|
position: relative;
|
|
783
783
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
784
|
-
`,Ad=
|
|
784
|
+
`,Ad=zr.span`
|
|
785
785
|
font-weight: 600;
|
|
786
786
|
font-size: 14px;
|
|
787
787
|
line-height: 18px;
|
|
788
788
|
padding-right: ${e=>e.padding};
|
|
789
789
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
790
|
-
${e=>
|
|
791
|
-
`;var
|
|
790
|
+
${e=>ke(e)}
|
|
791
|
+
`;var _e=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var g;if(t===0)return Lt.createElement(Lt.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"),Lt.createElement(Bd,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},Lt.createElement(Ad,{className:a("progressBarStepText",l),styleOverrides:j(T({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:m,textLocation:i},c),Lt.createElement(Ed,{textLocation:i,className:a("progressBar",l)},Lt.createElement(Un,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),Lt.createElement(_n,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};import Ao from"react";import Nd from"styled-components";import lr from"react";import sr from"react";var to=({stepData:e,appearance:t})=>sr.createElement(sr.Fragment,null,sr.createElement(Ln,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ne(e.title)}),sr.createElement($n,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ne(e.subtitle)}));import Hr from"react";var oo=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Hr.createElement(Yo,{className:a("ctaContainer",t)},Hr.createElement(se,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Hr.createElement(se,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var ro=({stepData:e,appearance:t})=>lr.createElement(lr.Fragment,null,lr.createElement(to,{stepData:e,appearance:t}),lr.createElement(oo,{stepData:e,appearance:t}));import Od from"react";function Wn(e){return Od.createElement(tt,{appearance:e.appearance,videoUri:e.videoUri})}var Vr="default",Id=Nd.img`
|
|
792
792
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
793
793
|
width: 100%;
|
|
794
794
|
height: auto;
|
|
795
795
|
min-height: 200px;
|
|
796
|
-
`,zn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return
|
|
796
|
+
`,zn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Ao.createElement("div",null,o)}return Ao.createElement(In,{className:a("checklistStepContent",t)},e.imageUri?Ao.createElement(Id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?Ao.createElement(Wn,{videoUri:e.videoUri,appearance:t}):null,Ao.createElement(ro,{stepData:e,appearance:t}))};import We,{useRef as Ld,useState as $d}from"react";import io from"styled-components";var Hn=io.div`
|
|
797
797
|
display: block;
|
|
798
|
-
`,Md=
|
|
798
|
+
`,Md=io.div`
|
|
799
799
|
display: flex;
|
|
800
800
|
flex-direction: row;
|
|
801
801
|
flex-wrap: wrap;
|
|
@@ -805,20 +805,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
805
805
|
align-content: center;
|
|
806
806
|
margin-top: 24px;
|
|
807
807
|
margin-bottom: 24px;
|
|
808
|
-
`,Dd=
|
|
808
|
+
`,Dd=io.div`
|
|
809
809
|
display: flex;
|
|
810
810
|
align-items: center;
|
|
811
811
|
justify-content: flex-start;
|
|
812
812
|
flex-direction: column;
|
|
813
813
|
margin-right: 16px;
|
|
814
|
-
`,Ud=
|
|
814
|
+
`,Ud=io.video`
|
|
815
815
|
width: 200px;
|
|
816
816
|
height: 120px;
|
|
817
|
-
`,_d=
|
|
817
|
+
`,_d=io.div`
|
|
818
818
|
font-size: 14px;
|
|
819
819
|
line-height: 20px;
|
|
820
820
|
text-align: center;
|
|
821
|
-
`,Wd=
|
|
821
|
+
`,Wd=io.div`
|
|
822
822
|
position: absolute;
|
|
823
823
|
width: 200px;
|
|
824
824
|
height: 120px;
|
|
@@ -838,9 +838,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
838
838
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
839
839
|
border-radius: 50%;
|
|
840
840
|
}
|
|
841
|
-
`,Vn="videoCarousel",jn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return
|
|
841
|
+
`,Vn="videoCarousel",jn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return We.createElement(Hn,null,We.createElement(ro,{stepData:e,appearance:t}));function o({video:r}){let l=Ld(),[p,d]=$d(!1);return We.createElement(Dd,null,!p&&We.createElement(Wd,{onClick:()=>{d(!0),l.current.play()},appearance:t},We.createElement(Jo,null)),We.createElement(Ud,{controls:p,ref:l,play:p,src:r.uri}),We.createElement(_d,null,r.title))}let i=e.props;return i.videos?We.createElement(Hn,null,We.createElement(to,{stepData:e,appearance:t}),We.createElement(Md,null,i.videos.map((r,l)=>We.createElement("span",{key:`${r.uri}-${l}`},We.createElement(o,{video:r})))),We.createElement(oo,{stepData:e,appearance:t})):null};import dt from"react";import ar from"styled-components";var Gn=ar.div`
|
|
842
842
|
display: block;
|
|
843
|
-
`,zd=
|
|
843
|
+
`,zd=ar.pre`
|
|
844
844
|
display: block;
|
|
845
845
|
background-color: #2a2a2a;
|
|
846
846
|
color: #f8f8f8;
|
|
@@ -856,21 +856,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
856
856
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
857
857
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
858
858
|
margin-bottom: 24px;
|
|
859
|
-
`,Hd=
|
|
859
|
+
`,Hd=ar.div`
|
|
860
860
|
font-size: 15px;
|
|
861
861
|
line-height: 20px;
|
|
862
862
|
margin-bottom: 12px;
|
|
863
863
|
margin-top: 12px;
|
|
864
|
-
`,Vd=
|
|
864
|
+
`,Vd=ar.div`
|
|
865
865
|
margin-top: 24px;
|
|
866
|
-
`,Kn="codeSnippet",qn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return
|
|
866
|
+
`,Kn="codeSnippet",qn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return dt.createElement(Gn,null,dt.createElement(ro,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?dt.createElement(Gn,{className:a("codeSnippetContainer",t)},dt.createElement(to,{stepData:e,appearance:t}),dt.createElement(Vd,null,o.codeSnippets.map((n,r)=>dt.createElement("div",{key:r},n.title?dt.createElement(Hd,{dangerouslySetInnerHTML:ne(n.title)}):null,n.code?dt.createElement(zd,null,n.code):null))),dt.createElement(oo,{stepData:e,appearance:t})):null};var Gd=$t.div`
|
|
867
867
|
display: flex;
|
|
868
868
|
flex-direction: row;
|
|
869
869
|
overflow: hidden;
|
|
870
870
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
871
871
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
872
872
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
873
|
-
${e=>
|
|
873
|
+
${e=>ke(e)}
|
|
874
874
|
`,Kd=$t.h1`
|
|
875
875
|
font-size: 18px;
|
|
876
876
|
font-style: normal;
|
|
@@ -899,9 +899,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
899
899
|
`,Xd=$t.div`
|
|
900
900
|
flex: 2;
|
|
901
901
|
padding: 40px 40px 40px 0px;
|
|
902
|
-
`,Qd=({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}=
|
|
902
|
+
`,Qd=({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}=ie();d=m(d);let c={[Vr]:zn,[Vn]:jn,[Kn]:qn},g=T(T({},c),p),[y,b]=jd(0),C=n!=null?n:y,x=r!=null?r:b,P=o.filter(v=>v.complete===!0).length,S=()=>{var v;return!((v=o[C])!=null&&v.type)||!g[o[C].type]?g[Vr]({stepData:o[C],appearance:d}):typeof g[o[C].type]!="function"?g[o[C].type]:g[o[C].type]({stepData:o[C],appearance:d})};return Ye.createElement(Gd,{type:s,styleOverrides:i,className:l,appearance:d},Ye.createElement(Yn,{style:{flex:1}},Ye.createElement(Yn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(Kd,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(qd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(_e,{total:o.length,count:P,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(Yd,{className:a("checklistStepsContainer",d)},o.map((v,$)=>Ye.createElement(Dn,{data:v,index:$,key:$,listLength:o.length,isSelected:$===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x($)},appearance:d})))),Ye.createElement(Jd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Xd,null,Ye.createElement(S,null)))},jr=Qd;import G,{useState as oc}from"react";import Jn from"react";import Zd from"styled-components";var Rd=Zd.svg`
|
|
903
903
|
transition: 'transform 0.35s ease-in-out';
|
|
904
|
-
`,
|
|
904
|
+
`,no=({style:e,className:t})=>Jn.createElement(Rd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Jn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var Gr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Xn=be.div`
|
|
905
905
|
max-height: 350px;
|
|
906
906
|
padding-bottom: 40px;
|
|
907
907
|
`,Qn=be.div`
|
|
@@ -1037,7 +1037,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1037
1037
|
flex-direction: column;
|
|
1038
1038
|
justify-content: center;
|
|
1039
1039
|
display: flex;
|
|
1040
|
-
`;import
|
|
1040
|
+
`;import mt from"react";import ct from"styled-components";var gs=ct.div`
|
|
1041
1041
|
border: 1px solid #fafafa;
|
|
1042
1042
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1043
1043
|
border-radius: 14px;
|
|
@@ -1045,13 +1045,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1045
1045
|
display: flex;
|
|
1046
1046
|
flex-direction: column;
|
|
1047
1047
|
overflow: hidden;
|
|
1048
|
-
`,hs=
|
|
1048
|
+
`,hs=ct.div`
|
|
1049
1049
|
display: flex;
|
|
1050
1050
|
flex-wrap: wrap;
|
|
1051
1051
|
justify-content: space-between;
|
|
1052
1052
|
overflow: hidden;
|
|
1053
1053
|
row-gap: 10px;
|
|
1054
|
-
`,xs=
|
|
1054
|
+
`,xs=ct.div`
|
|
1055
1055
|
${e=>E(e)} {
|
|
1056
1056
|
color: #595959;
|
|
1057
1057
|
}
|
|
@@ -1061,7 +1061,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1061
1061
|
line-height: 12px;
|
|
1062
1062
|
letter-spacing: 0.09em;
|
|
1063
1063
|
margin-bottom: 12px;
|
|
1064
|
-
`,Cs=
|
|
1064
|
+
`,Cs=ct.div`
|
|
1065
1065
|
${e=>E(e)} {
|
|
1066
1066
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1067
1067
|
background: #ffffff;
|
|
@@ -1074,7 +1074,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1074
1074
|
|
|
1075
1075
|
max-width: 150px;
|
|
1076
1076
|
min-width: 200px;
|
|
1077
|
-
`,ys=
|
|
1077
|
+
`,ys=ct.div`
|
|
1078
1078
|
${e=>E(e)} {
|
|
1079
1079
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1080
1080
|
}
|
|
@@ -1086,13 +1086,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1086
1086
|
justify-content: center;
|
|
1087
1087
|
align-content: center;
|
|
1088
1088
|
align-items: center;
|
|
1089
|
-
`,Ss=
|
|
1089
|
+
`,Ss=ct.div`
|
|
1090
1090
|
font-weight: 600;
|
|
1091
1091
|
font-size: 20px;
|
|
1092
1092
|
line-height: 24px;
|
|
1093
1093
|
width: 20px;
|
|
1094
1094
|
height: 20px;
|
|
1095
|
-
`,bs=
|
|
1095
|
+
`,bs=ct.div`
|
|
1096
1096
|
${e=>E(e)} {
|
|
1097
1097
|
color: #434343;
|
|
1098
1098
|
}
|
|
@@ -1101,20 +1101,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1101
1101
|
line-height: 17px;
|
|
1102
1102
|
margin-top: 12px;
|
|
1103
1103
|
margin-bottom: 8px;
|
|
1104
|
-
`,ws=
|
|
1104
|
+
`,ws=ct.div`
|
|
1105
1105
|
${e=>E(e)} {
|
|
1106
1106
|
color: #8c8c8c;
|
|
1107
1107
|
}
|
|
1108
1108
|
font-weight: 400;
|
|
1109
1109
|
font-size: 12px;
|
|
1110
1110
|
line-height: 14px;
|
|
1111
|
-
`,Ts=
|
|
1111
|
+
`,Ts=ct.a`
|
|
1112
1112
|
color: ${e=>e.color};
|
|
1113
1113
|
font-size: 12px;
|
|
1114
1114
|
line-height: 14px;
|
|
1115
1115
|
font-weight: 400;
|
|
1116
1116
|
cursor: pointer;
|
|
1117
|
-
`;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=
|
|
1117
|
+
`;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=ue();return mt.createElement(gs,{style:t,className:a("guideContainer",n)},mt.createElement(xs,{className:a("guideTitle",n)},o),mt.createElement(hs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var s;return mt.createElement(Cs,{key:`guide-${(s=p.id)!=null?s:d}`,className:a("guideItem",n)},p.icon&&mt.createElement(ys,{className:a("guideIcon",n)},mt.createElement(Ss,null,p.icon)),mt.createElement(bs,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:ne(p.title)}),mt.createElement(ws,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:ne(p.subtitle)}),mt.createElement(Ts,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&l(p),r&&r(p)}},p.primaryButtonTitle))})))},Oo=tc;var rc=({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:u,handleSecondaryCTAClick:O,handleCTAClick:w})=>u?G.createElement(ns,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},G.createElement(ss,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:ne(u.title)}),G.createElement(ls,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:ne(u.subtitle)}),G.createElement(as,{className:a("checklistCTAContainer",s)},u.secondaryButtonTitle&&G.createElement(se,{title:u.secondaryButtonTitle,onClick:O,appearance:s,secondary:!0}),G.createElement(se,{title:u.primaryButtonTitle,onClick:w,appearance:s}))):G.createElement(G.Fragment,null),C=T(T({},{default:u=>{var I;if((I=e[S])!=null&&I.StepContent){let N=e[S].StepContent;return G.createElement("div",null,N)}let O=e[S];return G.createElement(y,{stepData:u,handleCTAClick:()=>{O.handlePrimaryButtonClick&&O.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{O.handleSecondaryButtonClick&&O.handleSecondaryButtonClick()}})}}),d),[x,P]=oc(0),S=l!=null?l:x,v=p!=null?p:P,$=()=>{var u;return e?!((u=e[S])!=null&&u.type)||!C[e[S].type]?C.default(e[S]):typeof C[e[S].type]!="function"?C[e[S].type]:C[e[S].type]({stepData:e[S],primaryColor:s.theme.colorPrimary}):G.createElement(G.Fragment,null)},B=e.filter(u=>u.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&(Gr.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=Gr),G.createElement(Re,{onClose:r,visible:n,appearance:s},G.createElement(us,null,G.createElement(Qn,null,G.createElement(Zn,{appearance:s,className:a("checklistTitle",s)},t),G.createElement(Rn,{appearance:s,className:a("checklistSubtitle",s)},o)),G.createElement(Xn,null,e&&e.length>0&&G.createElement(es,{className:a("stepsContainer",s)},G.createElement(ts,null,G.createElement("div",{style:{flex:3}},G.createElement(os,{className:a("stepsTitle",s)},i)),G.createElement(ms,null,G.createElement(_e,{style:{width:"100%"},count:B,total:e.length,appearance:s}))),G.createElement(rs,null,G.createElement(is,{className:a("checklistStepListContainer",s),appearance:s},e.map((u,O)=>{var k;let w=S===O;return G.createElement(ps,{selected:w,className:a(`checklistStepListItem${w?"Selected":""}`,s),key:`checklist-guide-step-${(k=u.id)!=null?k:O}`,disabled:u.blocked,onClick:()=>{u.blocked||v(O)},title:u.blocked?"Finish remaining steps to continue":void 0},w&&G.createElement(rr,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(ds,{selected:w,className:a(`checklistStepListStepName${w?"Selected":""}`,s)},u.stepName),G.createElement(cs,null,G.createElement(at,{value:u.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:u.progress,appearance:s}),G.createElement(fs,null,G.createElement(no,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),G.createElement($,null))),m&&m.length>0&&G.createElement(Oo,{steps:m,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:u=>(g&&g(u),!0)}))))):G.createElement(G.Fragment,null)},Kr=rc;import $e,{useEffect as pr,useState as ic}from"react";import Fe from"react";import ut from"styled-components";var Fs=ut.div`
|
|
1118
1118
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1119
1119
|
border: 1px solid;
|
|
1120
1120
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1126,14 +1126,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1126
1126
|
display: flex;
|
|
1127
1127
|
flex-direction: column;
|
|
1128
1128
|
transition: max-height 0.25s;
|
|
1129
|
-
`,ks=
|
|
1129
|
+
`,ks=ut.div`
|
|
1130
1130
|
display: flex;
|
|
1131
1131
|
margin-bottom: 20px;
|
|
1132
|
-
`,Ps=
|
|
1132
|
+
`,Ps=ut.img`
|
|
1133
1133
|
border-radius: 4px;
|
|
1134
1134
|
max-height: 260px;
|
|
1135
1135
|
min-height: 200px;
|
|
1136
|
-
`,vs=
|
|
1136
|
+
`,vs=ut.div`
|
|
1137
1137
|
display: flex;
|
|
1138
1138
|
flex-direction: row;
|
|
1139
1139
|
justify-content: space-between;
|
|
@@ -1142,7 +1142,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1142
1142
|
:hover {
|
|
1143
1143
|
opacity: 0.8;
|
|
1144
1144
|
}
|
|
1145
|
-
`,Bs=
|
|
1145
|
+
`,Bs=ut.p`
|
|
1146
1146
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1147
1147
|
font-style: normal;
|
|
1148
1148
|
font-weight: 500;
|
|
@@ -1153,23 +1153,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1153
1153
|
:hover {
|
|
1154
1154
|
opacity: 0.8;
|
|
1155
1155
|
}
|
|
1156
|
-
`,Es=
|
|
1156
|
+
`,Es=ut.div`
|
|
1157
1157
|
cursor: pointer;
|
|
1158
1158
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1159
1159
|
:hover {
|
|
1160
1160
|
opacity: 0.8;
|
|
1161
1161
|
}
|
|
1162
|
-
`,m0=
|
|
1162
|
+
`,m0=ut.div``,As=ut.p`
|
|
1163
1163
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1164
1164
|
font-weight: 400;
|
|
1165
1165
|
font-size: 14px;
|
|
1166
1166
|
line-height: 22px;
|
|
1167
|
-
`,Os=
|
|
1167
|
+
`,Os=ut.div`
|
|
1168
1168
|
display: flex;
|
|
1169
1169
|
flex-direction: row;
|
|
1170
1170
|
justify-content: flex-start;
|
|
1171
1171
|
align-items: center;
|
|
1172
|
-
`;var Ns=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,
|
|
1172
|
+
`;var Ns=({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 Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(ks,{className:a("stepMediaContainer",r)},e.imageUri?Fe.createElement(Ps,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(tt,{appearance:r,videoUri:e.videoUri}):null):null,Fe.createElement(As,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ne(e.subtitle)}),Fe.createElement(Yo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(se,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(se,{title:(y=e.primaryButtonTitle)!=null?y:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!l)return null;let y=l[e.type];return y?typeof y!="function"?y:y(e,r):null}return Fe.createElement(Fs,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},Fe.createElement(vs,{className:a("stepHeader",r),onClick:()=>o()},Fe.createElement(Os,null,Fe.createElement(or,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Fe.createElement(Bs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:ne(e.title)})),Fe.createElement(Es,{className:a("stepChevronContainer",r),appearance:r},Fe.createElement(no,{style:j(T({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:T({},d)},(g=m())!=null?g:s()))};import so from"styled-components";var P0=so.div`
|
|
1173
1173
|
background: #ffffff;
|
|
1174
1174
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1175
1175
|
border-radius: 6px;
|
|
@@ -1183,26 +1183,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1183
1183
|
|
|
1184
1184
|
max-width: 800px;
|
|
1185
1185
|
min-width: 350px;
|
|
1186
|
-
`,Is=
|
|
1186
|
+
`,Is=so.div`
|
|
1187
1187
|
display: flex;
|
|
1188
1188
|
flex-direction: column;
|
|
1189
|
-
`,Ls=
|
|
1189
|
+
`,Ls=so.h1`
|
|
1190
1190
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1191
1191
|
font-style: normal;
|
|
1192
1192
|
font-weight: 700;
|
|
1193
1193
|
font-size: 20px;
|
|
1194
1194
|
line-height: 24px;
|
|
1195
1195
|
margin-bottom: 8px;
|
|
1196
|
-
`,$s=
|
|
1196
|
+
`,$s=so.h2`
|
|
1197
1197
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1198
1198
|
font-weight: 400;
|
|
1199
1199
|
font-size: 14px;
|
|
1200
1200
|
line-height: 23px;
|
|
1201
1201
|
margin: 2px 0 0 0;
|
|
1202
|
-
`,Ms=
|
|
1202
|
+
`,Ms=so.div`
|
|
1203
1203
|
display: block;
|
|
1204
1204
|
width: 100%;
|
|
1205
|
-
`,Ds=
|
|
1205
|
+
`,Ds=so.div`
|
|
1206
1206
|
display: flex;
|
|
1207
1207
|
width: 100%;
|
|
1208
1208
|
flex-direction: column;
|
|
@@ -1210,7 +1210,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1210
1210
|
padding: 24px;
|
|
1211
1211
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1212
1212
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1213
|
-
`;var nc=({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:
|
|
1213
|
+
`;var nc=({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:b})=>{let C=o.filter(B=>B.complete).length,[x,P]=ic(Array(o.length).fill(!0));pr(()=>{let B=[...x];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){B[u]=!1;break}P(B)}},[]),pr(()=>{r&&S(d)},[d]),pr(()=>{p&&x[d]&&S(d)},[d]),pr(()=>{},[o]);let S=B=>{let u=[...x];if(l)for(let O=0;O<x.length;++O)O!=B&&u[B]&&(u[O]=!0);u[B]=!x[B],P(u)};if(!n&&c=="modal")return $e.createElement($e.Fragment,null);let v=$e.createElement($e.Fragment,null,$e.createElement(Is,null,$e.createElement(Ls,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ne(e)}),$e.createElement($s,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ne(t)})),$e.createElement(_e,{display:"percent",count:C,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),$=$e.createElement(Ms,{className:Te(a("checklistContainer",m),g)},o.map((B,u)=>{var w;let O=x[u];return $e.createElement(Ns,{appearance:m,stepData:B,collapsed:O,key:`modal-checklist-${(w=B.id)!=null?w:u}`,onClick:()=>{d==u?S(u):s(u)},onPrimaryButtonClick:()=>{p&&u<o.length-1&&s(u+1),B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?$e.createElement(Ds,{appearance:m,className:Te(a("checklistInlineContainer",m),g),style:b},v,$):$e.createElement($e.Fragment,null,$e.createElement(Re,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:v},$))},qr=nc;import he,{useEffect as Yr,useRef as uc,useState as Mt}from"react";import{useEffect as sc,useState as lc}from"react";var Us=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=lc(t),n=null,r=()=>{n!==null?clearTimeout(n):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 sc(()=>{l()},[]),o};import lo from"react";import Ce,{css as _s,keyframes as Ws}from"styled-components";var zs=_s`
|
|
1214
1214
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1215
1215
|
`,ac=_s`
|
|
1216
1216
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -1226,7 +1226,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1226
1226
|
} to {
|
|
1227
1227
|
opacity: 0;
|
|
1228
1228
|
}
|
|
1229
|
-
`,Hs=
|
|
1229
|
+
`,Hs=Ce.div`
|
|
1230
1230
|
margin: 0 -20px;
|
|
1231
1231
|
overflow-x: auto;
|
|
1232
1232
|
padding-left: 20px;
|
|
@@ -1243,13 +1243,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1243
1243
|
::-webkit-scrollbar {
|
|
1244
1244
|
display: none;
|
|
1245
1245
|
}
|
|
1246
|
-
`,Vs=
|
|
1246
|
+
`,Vs=Ce.div`
|
|
1247
1247
|
display: flex;
|
|
1248
1248
|
flex-flow: row nowrap;
|
|
1249
1249
|
gap: 0 16px;
|
|
1250
1250
|
scroll-snap-align: center;
|
|
1251
1251
|
scroll-snap-stop: always;
|
|
1252
|
-
`,js=
|
|
1252
|
+
`,js=Ce.div`
|
|
1253
1253
|
animation: ${e=>e.reversed?dc:pc} 0.25s ease-out;
|
|
1254
1254
|
background: linear-gradient(
|
|
1255
1255
|
to right,
|
|
@@ -1259,7 +1259,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1259
1259
|
position: absolute;
|
|
1260
1260
|
width: 64px;
|
|
1261
1261
|
z-index: 10;
|
|
1262
|
-
`,Gs=
|
|
1262
|
+
`,Gs=Ce.button`
|
|
1263
1263
|
${zs}
|
|
1264
1264
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1265
1265
|
align-items: center;
|
|
@@ -1271,10 +1271,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1271
1271
|
justify-content: center;
|
|
1272
1272
|
position: absolute;
|
|
1273
1273
|
width: 48px;
|
|
1274
|
-
`,Ks=
|
|
1274
|
+
`,Ks=Ce.div`
|
|
1275
1275
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1276
1276
|
padding: 20px;
|
|
1277
|
-
`,qs=
|
|
1277
|
+
`,qs=Ce(Ks)`
|
|
1278
1278
|
${zs}
|
|
1279
1279
|
background: ${({theme:e})=>e.colorBackground};
|
|
1280
1280
|
position: relative;
|
|
@@ -1287,104 +1287,104 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1287
1287
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1288
1288
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1289
1289
|
}
|
|
1290
|
-
`,Ys=
|
|
1290
|
+
`,Ys=Ce.img`
|
|
1291
1291
|
border-radius: 50%;
|
|
1292
1292
|
height: 40px;
|
|
1293
1293
|
margin-bottom: 12px;
|
|
1294
1294
|
width: 40px;
|
|
1295
|
-
`,Js=
|
|
1295
|
+
`,Js=Ce(Ks)`
|
|
1296
1296
|
${e=>E(e)} {
|
|
1297
1297
|
${ac}
|
|
1298
1298
|
|
|
1299
1299
|
background: ${({theme:e})=>e.colorBackground};
|
|
1300
1300
|
}
|
|
1301
|
-
`,V0=
|
|
1301
|
+
`,V0=Ce.div`
|
|
1302
1302
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1303
1303
|
display: flex;
|
|
1304
1304
|
flex-flow: row nowrap;
|
|
1305
1305
|
align-items: center;
|
|
1306
|
-
`,j0=
|
|
1306
|
+
`,j0=Ce.div`
|
|
1307
1307
|
white-space: nowrap;
|
|
1308
|
-
`,Xs=
|
|
1308
|
+
`,Xs=Ce.div`
|
|
1309
1309
|
background: #d8fed8;
|
|
1310
1310
|
border-radius: 6px;
|
|
1311
1311
|
float: right;
|
|
1312
1312
|
margin-bottom: 12px;
|
|
1313
1313
|
padding: 4px 10px;
|
|
1314
|
-
`,cc=
|
|
1314
|
+
`,cc=Ce.p`
|
|
1315
1315
|
font-weight: bold;
|
|
1316
1316
|
font-size: 18px;
|
|
1317
1317
|
line-height: 22px;
|
|
1318
1318
|
letter-spacing: calc(18px * -0.01);
|
|
1319
1319
|
margin: 0;
|
|
1320
|
-
`,Qs=
|
|
1320
|
+
`,Qs=Ce(cc)`
|
|
1321
1321
|
margin-bottom: 4px;
|
|
1322
|
-
`,Zs=
|
|
1322
|
+
`,Zs=Ce.div`
|
|
1323
1323
|
display: flex;
|
|
1324
1324
|
flex-flow: row nowrap;
|
|
1325
1325
|
align-items: center;
|
|
1326
1326
|
min-width: 50%;
|
|
1327
|
-
`,mc=
|
|
1327
|
+
`,mc=Ce.p`
|
|
1328
1328
|
font-weight: bold;
|
|
1329
1329
|
font-size: 16px;
|
|
1330
1330
|
line-height: 20px;
|
|
1331
1331
|
letter-spacing: calc(16px * -0.01);
|
|
1332
1332
|
margin: 0;
|
|
1333
|
-
`,Rs=
|
|
1333
|
+
`,Rs=Ce(mc)`
|
|
1334
1334
|
margin-bottom: 4px;
|
|
1335
1335
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1336
1336
|
`}
|
|
1337
|
-
`,
|
|
1337
|
+
`,bt=Ce.p`
|
|
1338
1338
|
color: ${({theme:e})=>e.colorText};
|
|
1339
1339
|
font-weight: normal;
|
|
1340
1340
|
font-size: 14px;
|
|
1341
1341
|
line-height: 22px;
|
|
1342
1342
|
margin: 0;
|
|
1343
|
-
`,el=
|
|
1343
|
+
`,el=Ce.p`
|
|
1344
1344
|
color: ${({theme:e})=>e.colorText};
|
|
1345
1345
|
font-weight: 600;
|
|
1346
1346
|
font-size: 12px;
|
|
1347
1347
|
line-height: 16px;
|
|
1348
1348
|
margin: 0;
|
|
1349
|
-
`;
|
|
1349
|
+
`;bt.Loud=Ce(bt)`
|
|
1350
1350
|
font-weight: 600;
|
|
1351
|
-
`;
|
|
1351
|
+
`;bt.Quiet=Ce(bt)`
|
|
1352
1352
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1353
1353
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1354
1354
|
`}
|
|
1355
|
-
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=
|
|
1355
|
+
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ie(),{primaryCTAClickSideEffects:n}=ue();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 lo.createElement(qs,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&lo.createElement(Ys,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&lo.createElement(Xs,{className:a("carouselCompletedPill",o)},lo.createElement(el,{style:{color:"#108E0B"}},"Complete")),p&&lo.createElement(Rs,{blocked:s,complete:d,className:a("carouselCardTitle",o)},p),l&&lo.createElement(bt.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o)},l))};var fc=()=>he.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},he.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ol=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Mt(!1),[r,l]=Mt(!1);Yr(()=>{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?he.createElement(js,{style:d,reversed:r,onAnimationEnd:r?p:null},he.createElement(Gs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},he.createElement(fc,null))):null},rl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=uc(null),[r,l]=Mt(!1),[p,d]=Mt(!1),[s,m]=Mt(null),[c,g]=Mt([]),[y,b]=Mt(0),{isSmall:C}=Us(),x=C?1:3,{getFlowMetadata:P,getFlowSteps:S,getNumberOfStepsCompleted:v,updateCustomVariables:$,isLoading:B}=Z();Yr(()=>{$(o)},[o,B]),Yr(()=>{if(B)return;let N=P(e),A=v(e),H=S(e);m(N),(N.data!==null||N.steps!==null)&&(g(H.sort((_,R)=>Number(_.complete)-Number(R.complete))),d(H.length>x),b(A))},[B]);let u=[];for(let N=0;N<c.length;N+=x)u.push(c.slice(N,N+x));let O=N=>{let A=N.target,H=A.scrollWidth-A.clientWidth,_=Math.ceil(A.scrollLeft);_>0&&r===!1&&l(!0),_===0&&r===!0&&l(!1),_<H&&p===!1&&d(!0),_===H&&p===!0&&d(!1)},w=(N=!0)=>{let A=N?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*A,behavior:"smooth"})},k=null,I=N=>{k!==null?clearTimeout(k):O(N),k=setTimeout(()=>{O(N)},16)};return B?null:he.createElement(Js,{className:Te(a("carouselContainer",t),i)},he.createElement("div",{style:{display:"flex",justifyContent:C?"center":"space-between",marginBottom:20,flexWrap:C?"wrap":"nowrap",gap:C?16:20}},he.createElement("div",null,he.createElement(Qs,{className:a("carouselTitle",t)},s==null?void 0:s.title),he.createElement(bt.Quiet,{className:a("carouselSubtitle",t)},s==null?void 0:s.subtitle)),he.createElement(Zs,{className:a("progressWrapper",t)},he.createElement(_e,{count:y,total:c.length,appearance:t}))),he.createElement("div",{style:{position:"relative"}},he.createElement(ol,{show:r,onClick:()=>w(!1)}),he.createElement(ol,{side:"right",show:p,onClick:w}),he.createElement(Hs,{ref:n,onScroll:I},u.map((N,A)=>he.createElement(Vs,{key:A,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},N.map((H,_)=>he.createElement(tl,{key:_,stepData:H,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),he.createElement(ae,{appearance:t}))};var Jr=$=>{var 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:b,customStepTypes:C,checklistStyle:x="default",autoExpandFirstIncompleteStep:P,autoExpandNextStep:S}=B,v=Ie(B,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:O,markStepCompleted:w,getStepStatus:k,getNumberOfStepsCompleted:I,isLoading:N,targetingLogicShouldHideFlow:A,updateCustomVariables:H,getFlowMetadata:_,isStepBlocked:R,getFlowStatus:J,hasActiveFullPageFlow:Q,setHasActiveFullPageFlow:q,markStepStarted:Y,getCurrentStepIndex:pe}=Z(),{primaryCTAClickSideEffects:we,secondaryCTAClickSideEffects:Oe}=ue(),{getOpenFlowState:ee,setOpenFlowState:de}=Be(),[D,oe]=il(n||0),[Ne,Je]=il(!1),xe=d===void 0?ee(e):d,ce=l==="modal",{mergeAppearanceWithDefault:V}=ie();He(e,d);let W=O(e),L=pe(e);if(g=V(g),dr(()=>{H(s)},[s,N]),dr(()=>{d!==void 0&&(ce&&d===!0?q(!0):ce&&d===!1&&q(!1))},[d,b,Q]),dr(()=>{!N&&W&&W[D]&&k(e,W[D].id)&&k(e,W[D].id)!==Le&&Y(e,W[D].id)},[D]),dr(()=>{D!==L&&oe(L)},[L]),N)return null;let z=u(e);if(!z||A(z)||!W||y===!0&&J(e)===re)return null;let me=_(e);if(me!=null&&me.title&&(t=me.title),me!=null&&me.subtitle&&(o=me.subtitle),!Ne&&n===void 0&&I(e)>0){let f=W.findIndex(F=>F.complete===!1);oe(f>-1?f:W.length-1),Je(!0)}function je(){if(D+1>=W.length){ce&&de(e,!1);return}R(e,W[D+1].id)||oe(D+1)}function Xe(f,F,U){let fe=D+1<W.length?W[D+1]:null;c&&c(f,D,F,fe)===!0&&ce&&Ke(),m&&m(f,U,fe),!m&&!c&&(f.primaryButtonUri||f.secondaryButtonUri)&&ce&&Ke()}function Ft(){return W.map((f,F)=>j(T({},f),{handleSecondaryButtonClick:()=>{je(),Oe(f),f.skippable===!0&&w(e,f.id,{skipped:!0}),Xe(f,"secondary",F)},handlePrimaryButtonClick:()=>{(!f.completionCriteria&&(f.autoMarkCompleted||f.autoMarkCompleted===void 0)||f.completionCriteria&&f.autoMarkCompleted===!0)&&(w(e,f.id),je()),Xe(f,"primary",F),we(f),k(e,f.id)===Le&&je()}}))}function Ge(){return Se.createElement(ae,{appearance:g})}let gt={steps:Ft(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:C,type:l,className:r,autoExpandFirstIncompleteStep:P,autoExpandNextStep:S};function Ke(){de(e,!1),p&&p(),b&&b(!1)}function Wt(){return Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),Se.createElement(rl,{flowId:e,appearance:g,customVariables:s,className:r}))}function zt(){return Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),Se.createElement(qr,T({visible:xe,onClose:()=>{Ke()},selectedStep:D,setSelectedStep:oe,autoExpandNextStep:!0,appearance:g},gt)))}function Ht(){var U;let f=v.guideFlowId,F;return f&&u(f)&&(F=O(f)),Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),Se.createElement(Kr,T({visible:xe,stepsTitle:me.stepsTitle?me.stepsTitle:"Your quick start guide",onClose:()=>{Ke()},selectedStep:D,setSelectedStep:oe,guideData:F,guideTitle:(U=v.guideTitle)!=null?U:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:fe=>{Xe(fe,"link",0)},customStepTypes:C},gt)))}function h(){let f=Se.createElement(jr,T({flowId:e,style:i,selectedStep:D,setSelectedStep:oe,appearance:g,type:l},gt));return ce?Se.createElement(Re,{onClose:()=>{Ke()},visible:xe,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Se.createElement(Ge,null),f):Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),f)}switch(x){case"condensed":return zt();case"with-guide":return Ht();case"default":return h();case"carousel":return Wt();default:return h()}};var hc=e=>gc.createElement(Jr,T({type:"inline"},e));import Tt,{useEffect as xc}from"react";import rt from"react";import cr from"styled-components";var nl=cr.div`
|
|
1356
1356
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1357
1357
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1358
1358
|
padding: 10px 12px 10px 12px;
|
|
1359
1359
|
min-width: 160px;
|
|
1360
1360
|
cursor: pointer;
|
|
1361
1361
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1362
|
-
${e=>
|
|
1362
|
+
${e=>ke(e)}
|
|
1363
1363
|
|
|
1364
1364
|
&:hover {
|
|
1365
1365
|
filter: brightness(.99);
|
|
1366
1366
|
}
|
|
1367
|
-
`,sl=
|
|
1367
|
+
`,sl=cr.div`
|
|
1368
1368
|
display: flex;
|
|
1369
1369
|
flex-direction: row;
|
|
1370
1370
|
justify-content: space-between;
|
|
1371
1371
|
align-items: center;
|
|
1372
1372
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1373
1373
|
flex-grow: 2;
|
|
1374
|
-
`,ll=
|
|
1374
|
+
`,ll=cr.div`
|
|
1375
1375
|
text-overflow: ellipsis;
|
|
1376
1376
|
font-weight: 600;
|
|
1377
1377
|
font-size: 14px;
|
|
1378
1378
|
line-height: 16px;
|
|
1379
1379
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1380
1380
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1381
|
-
`,al=
|
|
1381
|
+
`,al=cr.div`
|
|
1382
1382
|
width: 20px;
|
|
1383
1383
|
margin-right: 8px;
|
|
1384
1384
|
display: flex;
|
|
1385
1385
|
height: 100%;
|
|
1386
1386
|
align-items: center;
|
|
1387
|
-
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(
|
|
1387
|
+
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(ae,{appearance:l}),rt.createElement(nl,{onClick:()=>i!==void 0&&i(),styleOverrides:T(T({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&rt.createElement(al,{className:a("progressRingContainer",l)},rt.createElement(Yt,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),rt.createElement(sl,{type:p,className:a("badgeTitleContainer",l)},rt.createElement(ll,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&rt.createElement(no,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&rt.createElement(_e,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));import wt from"react";import No from"styled-components";var dl=No.div`
|
|
1388
1388
|
display: flex;
|
|
1389
1389
|
flex-direction: row;
|
|
1390
1390
|
width: 100%;
|
|
@@ -1394,25 +1394,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1394
1394
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1395
1395
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1396
1396
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1397
|
-
`,cl=
|
|
1397
|
+
`,cl=No.div`
|
|
1398
1398
|
${e=>E(e)} {
|
|
1399
1399
|
display: flex;
|
|
1400
1400
|
justify-content: center;
|
|
1401
1401
|
align-items: center;
|
|
1402
1402
|
margin-right: 16px;
|
|
1403
1403
|
}
|
|
1404
|
-
`,ml=
|
|
1404
|
+
`,ml=No.div`
|
|
1405
1405
|
display: flex;
|
|
1406
1406
|
flex-direction: column;
|
|
1407
1407
|
flex: 1;
|
|
1408
1408
|
margin-top: 0;
|
|
1409
|
-
`,ul=
|
|
1409
|
+
`,ul=No.div`
|
|
1410
1410
|
display: flex;
|
|
1411
1411
|
flex-direction: column;
|
|
1412
1412
|
justify-content: center;
|
|
1413
1413
|
margin-left: 16px;
|
|
1414
1414
|
min-width: 200px;
|
|
1415
|
-
`,KS=
|
|
1415
|
+
`,KS=No.div`
|
|
1416
1416
|
display: flex;
|
|
1417
1417
|
justify-content: center;
|
|
1418
1418
|
align-items: flex-end;
|
|
@@ -1421,7 +1421,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1421
1421
|
:hover {
|
|
1422
1422
|
opacity: 0.8;
|
|
1423
1423
|
}
|
|
1424
|
-
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>
|
|
1424
|
+
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>wt.createElement(wt.Fragment,null,wt.createElement(dl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p},o&&wt.createElement(cl,{className:a("fullWidthProgressBadgeIcon",i)},o),wt.createElement(ml,null,wt.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),wt.createElement(ul,{className:a("fullWidthProgressBadgeProgressContainer",i)},wt.createElement(_e,{count:n,total:r,display:"percent",textLocation:"top"}))));var Cc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:b,isLoading:C,targetingLogicShouldHideFlow:x,updateCustomVariables:P}=Z(),{mergeAppearanceWithDefault:S}=ie();s=S(s);let{setOpenFlowState:v,getOpenFlowState:$}=Be();if(xc(()=>{P(p)},[p,C]),C)return null;let B=c(e);if(!B||x(B)||d===!0&&y(e)===re)return null;let u=g(e),O=b(e);return m==="full-width"?Tt.createElement(Tt.Fragment,null,Tt.createElement(ae,{appearance:s}),Tt.createElement(fl,{title:t,subtitle:o,count:O,total:u.length,style:n,className:l,appearance:s,icon:i,onClick:()=>{}})):Tt.createElement(Tt.Fragment,null,Tt.createElement(ae,{appearance:s}),Tt.createElement(pl,{count:O,total:u.length,title:t,style:n,onClick:()=>{v(e,!0),r&&r()},type:m,className:l,appearance:s}))};import yc from"react";var Sc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Ie(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=Z(),{mergeAppearanceWithDefault:s}=ie();o=s(o);let m=l(e);if(!m||p(m))return null;let c=d(e);return yc.createElement(Oo,T({steps:c,style:t,appearance:o},i))};import Dt,{useContext as Ic,useEffect as Lc}from"react";import K,{useEffect as ao,useLayoutEffect as xl,useRef as Pc,useState as po}from"react";import Io from"styled-components";import{useCallback as bc,useEffect as wc,useState as Tc}from"react";var Xr=(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 gl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,n]=Tc(o),r=bc(()=>{e&&n(e.getBoundingClientRect())},[e]);return wc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Fc,useState as kc}from"react";function hl(){let{debug:e}=Fc(X),[t,o]=kc([]);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 Cl=300,yl=100,vc=500,co=12,Bc=Io.div`
|
|
1425
1425
|
width: 100%;
|
|
1426
1426
|
height: 100%;
|
|
1427
1427
|
border-radius: 9999px;
|
|
@@ -1444,25 +1444,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1444
1444
|
opacity: 0;
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
|
-
`,Ec=
|
|
1448
|
-
width: ${
|
|
1449
|
-
height: ${
|
|
1447
|
+
`,Ec=Io.div`
|
|
1448
|
+
width: ${co}px;
|
|
1449
|
+
height: ${co}px;
|
|
1450
1450
|
border-radius: 100px;
|
|
1451
1451
|
background-color: ${e=>e.primaryColor};
|
|
1452
1452
|
z-index: 20;
|
|
1453
1453
|
opacity: 1;
|
|
1454
|
-
`,Ac=
|
|
1454
|
+
`,Ac=Io.div`
|
|
1455
1455
|
pointer-events: all;
|
|
1456
|
-
`,Sl=
|
|
1456
|
+
`,Sl=Io.div`
|
|
1457
1457
|
display: flex;
|
|
1458
1458
|
align-content: center;
|
|
1459
1459
|
justify-content: center;
|
|
1460
1460
|
align-items: center;
|
|
1461
1461
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1462
|
-
`,Oc=
|
|
1463
|
-
width: ${
|
|
1464
|
-
height: ${
|
|
1465
|
-
`,Nc=({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:
|
|
1462
|
+
`,Oc=Io(Sl)`
|
|
1463
|
+
width: ${co+12}px;
|
|
1464
|
+
height: ${co+12}px;
|
|
1465
|
+
`,Nc=({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:b=!0,completedStepsCount:C=0,showFrigadeBranding:x=!1,cssPosition:P="absolute",onViewTooltip:S,className:v})=>{var Ft,Ge,gt,Ke,Wt,zt,Ht,h,f,F,U,fe,ht,kt,Pt,ge,uo,fo,ni;let{logErrorIfDebugMode:$}=hl(),[B,u]=po(),[O,w]=po(new Date),k=Pc(null),[I,N]=po(document.querySelector(e[s].selector)),A=gl(I,O),[H,_]=po(),[R,J]=po(!y),Q=(Ge=(Ft=e[s])==null?void 0:Ft.props)!=null&&Ge.position?e[s].props.position:P,q=(Wt=(Ke=(gt=e[s])==null?void 0:gt.props)==null?void 0:Ke.zIndex)!=null?Wt:90,Y=(zt=B==null?void 0:B.width)!=null?zt:Cl,pe=(Ht=B==null?void 0:B.height)!=null?Ht:yl,[we,Oe]=po(new Date().getTime());l=(F=(f=(h=e[s])==null?void 0:h.props)==null?void 0:f.offset)!=null?F:l;let ee=window.location.pathname.split("/").pop();xl(()=>{k.current&&u({width:k.current.clientWidth,height:k.current.clientHeight})},[s,O,Q]),ao(()=>{y||J(!0)},[s]),ao(()=>{p&&R&&S(s)},[R]);let de=()=>{let te=document.querySelector(e[s].selector);if(!te){_(void 0),N(null),$(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}H&&H===JSON.stringify(te==null?void 0:te.getBoundingClientRect())||(N(te),w(new Date),te&&_(JSON.stringify(te.getBoundingClientRect())))};if(ao(()=>{let te=new MutationObserver(de);return te.observe(document.body,{subtree:!0,childList:!0}),()=>te.disconnect()},[de]),ao(()=>{let te=new MutationObserver(de);return te.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>te.disconnect()},[de]),ao(()=>{let te=setInterval(()=>{de()},10);return()=>clearInterval(te)},[de]),xl(()=>{setTimeout(()=>{de()},vc),de()},[s,ee]),ao(()=>{if(!p)return;let te=Qe=>{Qe.key==="Escape"&&t()};return document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}},[]),I===null||!p)return null;let D=i==="auto"?"right":i,oe=Xr(A,D,Y,l,Q),Ne=A.right+Y>(window.innerWidth||document.documentElement.clientWidth),Je=A.bottom+yl>(window.innerHeight||document.documentElement.clientHeight);Ne&&i==="auto"&&(oe=Xr(A,"left",Y,l,Q),D="left"),(fe=(U=e[s])==null?void 0:U.props)!=null&&fe.tooltipPosition&&((kt=(ht=e[s])==null?void 0:ht.props)==null?void 0:kt.tooltipPosition)!=="auto"&&(((ge=(Pt=e[s])==null?void 0:Pt.props)==null?void 0:ge.tooltipPosition)==="left"||((fo=(uo=e[s])==null?void 0:uo.props)==null?void 0:fo.tooltipPosition)==="right")&&(D=e[s].props.tooltipPosition);let xe=()=>{let te=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),J(!1),setTimeout(()=>{de()},30)),C===e.length-1)return o()},Qe=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),y&&!e[s].secondaryButtonUri&&J(!1))};return K.createElement(K.Fragment,null,b&&e.length>1&&K.createElement(wi,null,K.createElement(Fi,{role:"status",className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&K.createElement(Ti,{showStepCount:b,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&K.createElement(se,{title:e[s].secondaryButtonTitle,appearance:c,onClick:Qe,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&K.createElement(se,{title:e[s].primaryButtonTitle,appearance:c,onClick:te,autoFocus:!0,withMargin:!1,size:"small"})))},ce=()=>K.createElement(K.Fragment,null,g&&K.createElement(xi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},K.createElement(Ee,null)),e[s].imageUri&&K.createElement(Ci,{dismissible:g,appearance:c,role:"img","aria-label":e[s].title,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&K.createElement(yi,{dismissible:g,appearance:c,role:"video","aria-label":e[s].title,className:a("tooltipVideoContainer",c)},K.createElement(tt,{appearance:c,videoUri:e[s].videoUri})),K.createElement(bi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small",ariaPrefix:`Tooltip${e[s].id}`}),K.createElement(Si,{className:a("tooltipFooter",c)},K.createElement(xe,null)))),W=T(T({},{default:te=>{var Qe;if((Qe=e[s])!=null&&Qe.StepContent){let ia=e[s].StepContent;return K.createElement("div",null,ia)}return K.createElement(ce,null)}}),m),L=()=>{var te;return e?!((te=e[s])!=null&&te.type)||!W[e[s].type]?W.default(e[s]):W[e[s].type]({stepData:e[s],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[s].complete===!0||oe.x==0&&oe.y==0&&new Date().getTime()-we<100)return null;let z={top:(oe==null?void 0:oe.y)-co,left:(ni=D=="left"?A.x+l.x:(oe==null?void 0:oe.x)-co)!=null?ni:0,cursor:y?"pointer":"default",position:Q},me=()=>{let Qe=z.left+(D=="left"?-Y:24);return Math.min(Math.max(Qe,20),window.innerWidth-Y-20)},je=()=>{if(Q==="fixed")return z.top;let te=z.top+pe,Qe=20;return te>window.innerHeight-Qe?z.top+-pe:z.top},Xe=()=>{y&&(w(new Date),J(!R))};return K.createElement(Ac,{className:v},K.createElement(Oc,{style:z,zIndex:q,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&P!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:Q},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(Sl,{style:j(T({},z),{left:me(),top:je()}),zIndex:q+1,className:a("tooltipContainerWrapper",c)},R&&K.createElement(K.Fragment,null,K.createElement(Uo,{ref:k,role:"dialog","aria-labelledby":`frigadeTooltip${e[s].id}Title`,"aria-describedby":`frigadeTooltip${e[s].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:T({position:"relative",width:"max-content",right:0,top:P!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:Cl,zIndex:q+10},K.createElement(L,null)),x&&K.createElement(Pi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:q+10},K.createElement(_o,{appearance:c})))))},Qr=Nc;import{Portal as $c}from"react-portal";var Mc=x=>{var P=x,{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",className:b}=P,C=Ie(P,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:S,getFlowSteps:v,isLoading:$,targetingLogicShouldHideFlow:B,markStepCompleted:u,markStepStarted:O,markFlowCompleted:w,updateCustomVariables:k,getCurrentStepIndex:I,getStepStatus:N,isStepBlocked:A,getFlowStatus:H,getNumberOfStepsCompleted:_}=Z(),{isLoadingUserFlowStateData:R}=De(),{primaryCTAClickSideEffects:J,secondaryCTAClickSideEffects:Q}=ue(),{hasOpenModals:q}=Be(),Y=I(e),{openFlowStates:pe}=Ic(X),{mergeAppearanceWithDefault:we}=ie();if(o=we(o),Lc(()=>{k(t)},[t,$]),R)return null;let Oe=S(e);if(!Oe||B(Oe)||H(e)==re||q())return null;let ee=v(e);if(Object.keys(pe).length>0){let L=Object.keys(pe).find(z=>pe[z]===!0);if(L!==void 0&&L!==e)return Dt.createElement(Dt.Fragment,null)}function de(L){return M(this,null,function*(){if(yield u(e,L.id),ee.map(z=>N(e,z.id)).every(z=>z===Le)){yield w(e);return}!s&&Y+1<ee.length&&!r&&A(e,ee[Y+1].id)})}function D(L,z,me){let je=Y+1<ee.length?ee[Y+1]:null;n&&n(L,Y,z,je),i&&i(L,me,je)}function oe(){return ee.map(L=>j(T({},L),{handleSecondaryButtonClick:()=>M(this,null,function*(){Q(L),L.skippable===!0&&(yield u(e,L.id,{skipped:!0})),D(L,"secondary",Y)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&(yield de(L)),D(L,"primary",Y),J(L)})}))}function Ne(L){return M(this,null,function*(){l&&l(),m==="complete-flow"?yield w(e):yield u(e,L.id)})}function Je(){c&&c()}function xe(L){return M(this,null,function*(){yield O(e,ee[L].id)})}let ce=!document.querySelector(ee[Y].selector);function V(){let L=ee.findIndex(z=>!!document.querySelector(z.selector));return ee.map((z,me)=>ce&&!r&&me!==L&&g||!r&&me!==Y?null:Dt.createElement(Qr,T({key:z.id,appearance:o,steps:oe(),selectedStep:me,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ne(z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:_(e),onComplete:Je,cssPosition:y,onViewTooltip:xe,className:b},C)))}function W(){return Dt.createElement(Dt.Fragment,null,Dt.createElement(ae,{appearance:o}),V())}return y==="static"?W():Dt.createElement($c,null,W())};import ze,{useEffect as Dc,useRef as Uc,useState as _c}from"react";import{Portal as Wc}from"react-portal";import Ut from"styled-components";var bl=Ut.button`
|
|
1466
1466
|
${e=>E(e)} {
|
|
1467
1467
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1468
1468
|
|
|
@@ -1550,7 +1550,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1550
1550
|
font-size: 14px;
|
|
1551
1551
|
|
|
1552
1552
|
padding: 8px 12px;
|
|
1553
|
-
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.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 Al from"react";var Ol=({style:e,className:t})=>Al.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"},Al.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:
|
|
1553
|
+
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.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 Al from"react";var Ol=({style:e,className:t})=>Al.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"},Al.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}=Z(),{primaryCTAClickSideEffects:b}=ue(),C=Uc(null),[x,P]=_c(!1),{mergeAppearanceWithDefault:S}=ie();l=S(l),Dc(()=>(document.addEventListener("click",v,!1),()=>{document.removeEventListener("click",v,!1)}),[]);let v=w=>{C.current&&!C.current.contains(w.target)&&P(!1)};if(g)return null;let $=p(e);if(!$||y($))return null;let B=d(e);if(!B||!i)return null;function u(w,k){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&s(e,w.id),b(w),o&&o(w,k),P(!1)}function O(){return x&&ze.createElement(Pl,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},B.map((w,k)=>ze.createElement(vl,{className:a("floatingWidgetMenuItem",l),key:k,onClick:()=>u(w,k)},w.title)))}return n=="inline"?ze.createElement("span",{ref:C},ze.createElement(bl,{style:t,onClick:()=>{P(!x)},className:a("supportButton",l)},ze.createElement(Tl,{className:a("supportIconContainer",l)},ze.createElement(Ol,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),ze.createElement(wl,{className:a("supportButtonTitle",l)},r)),ze.createElement(O,null)):ze.createElement(Wc,null,ze.createElement(Fl,{style:t,ref:C},ze.createElement(O,null),ze.createElement(kl,{onClick:()=>{P(!x)},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},ze.createElement(El,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};import it,{useEffect as Hc}from"react";import mr from"styled-components";var Nl=mr.div`
|
|
1554
1554
|
${e=>E(e)} {
|
|
1555
1555
|
display: flex;
|
|
1556
1556
|
flex-direction: column;
|
|
@@ -1565,17 +1565,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1565
1565
|
border-radius: 12px;
|
|
1566
1566
|
position: relative;
|
|
1567
1567
|
}
|
|
1568
|
-
`,Il=
|
|
1568
|
+
`,Il=mr.div`
|
|
1569
1569
|
display: flex;
|
|
1570
1570
|
flex-direction: column;
|
|
1571
1571
|
flex: 1;
|
|
1572
|
-
`,Ll=
|
|
1572
|
+
`,Ll=mr.div`
|
|
1573
1573
|
display: flex;
|
|
1574
1574
|
flex-direction: column;
|
|
1575
1575
|
justify-content: center;
|
|
1576
1576
|
align-items: flex-start;
|
|
1577
1577
|
margin-top: 16px;
|
|
1578
|
-
`,$l=
|
|
1578
|
+
`,$l=mr.div`
|
|
1579
1579
|
${e=>E(e)} {
|
|
1580
1580
|
position: absolute;
|
|
1581
1581
|
top: 16px;
|
|
@@ -1586,7 +1586,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1586
1586
|
opacity: 0.8;
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
`;var Vc=({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:
|
|
1589
|
+
`;var Vc=({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:b,getFlowStatus:C,getCurrentStepIndex:x}=Z(),{primaryCTAClickSideEffects:P}=ue(),{mergeAppearanceWithDefault:S}=ie();if(He(e),n=S(n),Hc(()=>{y(o)},[o,c]),c)return null;let v=d(e);if(!v||g(v)||C(e)===re)return null;let B=b(e)[x(e)];return it.createElement(it.Fragment,null,it.createElement(ae,{appearance:n}),it.createElement(Nl,{appearance:n,className:Te(a("embeddedTipContainer",n),r),style:l},(p===!0||B.dismissible)&&it.createElement($l,{onClick:()=>M(void 0,null,function*(){yield s(e),t&&t()}),className:a("embeddedTipDismissButton",n)},it.createElement(Ee,null)),it.createElement(Il,null,it.createElement(Ae,{size:"small",appearance:n,title:B.title,subtitle:B.subtitle})),B.primaryButtonTitle&&it.createElement(Ll,{className:a("embeddedTipCallToActionContainer",n)},it.createElement(se,{classPrefix:"embeddedTip",title:B.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>M(void 0,null,function*(){B.handlePrimaryButtonClick(),P(B),!(i&&i(B,x(e),"primary")===!1)&&(yield m(e,B.id),yield s(e))})}))))};import Pe,{useEffect as jc}from"react";import mo from"styled-components";var Ml=mo.div`
|
|
1590
1590
|
// use the :not annotation
|
|
1591
1591
|
${e=>E(e)} {
|
|
1592
1592
|
display: flex;
|
|
@@ -1598,24 +1598,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1598
1598
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1599
1599
|
border-radius: 12px;
|
|
1600
1600
|
}
|
|
1601
|
-
`,Dl=
|
|
1601
|
+
`,Dl=mo.div`
|
|
1602
1602
|
${e=>E(e)} {
|
|
1603
1603
|
display: flex;
|
|
1604
1604
|
width: 46px;
|
|
1605
1605
|
height: 46px;
|
|
1606
1606
|
}
|
|
1607
|
-
`,Ul=
|
|
1607
|
+
`,Ul=mo.div`
|
|
1608
1608
|
display: flex;
|
|
1609
1609
|
flex-direction: column;
|
|
1610
1610
|
flex: 1;
|
|
1611
1611
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1612
1612
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1613
|
-
`,_l=
|
|
1613
|
+
`,_l=mo.div`
|
|
1614
1614
|
display: flex;
|
|
1615
1615
|
flex-direction: column;
|
|
1616
1616
|
justify-content: center;
|
|
1617
1617
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1618
|
-
`,
|
|
1618
|
+
`,Zr=mo.div`
|
|
1619
1619
|
display: flex;
|
|
1620
1620
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1621
1621
|
align-items: flex-end;
|
|
@@ -1623,12 +1623,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1623
1623
|
:hover {
|
|
1624
1624
|
opacity: 0.8;
|
|
1625
1625
|
}
|
|
1626
|
-
`,
|
|
1626
|
+
`,Rr=mo.div`
|
|
1627
1627
|
display: flex;
|
|
1628
1628
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1629
1629
|
align-items: flex-end;
|
|
1630
1630
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1631
|
-
`;import
|
|
1631
|
+
`;import ei from"react";var Wl=({style:e,className:t})=>ei.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},ei.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),ei.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var Gc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d})=>{let{getFlow:s,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowMetadata:b,getFlowStatus:C,getFlowSteps:x,getCurrentStepIndex:P}=Z(),{primaryCTAClickSideEffects:S}=ue(),{mergeAppearanceWithDefault:v}=ie();if(He(e),l=v(l),jc(()=>{y(n)},[n,c]),c)return null;let $=s(e);if(!$||g($)||C(e)===re)return null;let B=x(e),u=B.length>0?B[P(e)]:b(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),Pe.createElement(Pe.Fragment,null,Pe.createElement(ae,{appearance:l}),Pe.createElement(Ml,{type:p,appearance:l,className:a("bannerContainer",l)},p!="square"&&Pe.createElement(Dl,{className:a("bannerIconContainer",l)},d||Pe.createElement(Wl,null)),p==="square"&&u.dismissible&&Pe.createElement(Rr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Zr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null))),Pe.createElement(Ul,{type:p},Pe.createElement(Ae,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&Pe.createElement(_l,{type:p,className:a("bannerCallToActionContainer",l)},Pe.createElement(se,{title:u==null?void 0:u.primaryButtonTitle,appearance:l,onClick:()=>{S(u),r&&r(u,0,"primary")},classPrefix:"banner"})),p!=="square"&&u.dismissible&&Pe.createElement(Rr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Zr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null)))))};import le,{useEffect as Kc}from"react";import{Portal as qc}from"react-portal";import ft from"styled-components";var zl=ft.div`
|
|
1632
1632
|
display: flex;
|
|
1633
1633
|
flex-direction: column;
|
|
1634
1634
|
width: 100%;
|
|
@@ -1650,7 +1650,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1650
1650
|
border-width: 1px;
|
|
1651
1651
|
border-color: ${t=>t.appearance.theme.colorBorder};
|
|
1652
1652
|
border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
|
|
1653
|
-
`,Hl=
|
|
1653
|
+
`,Hl=ft.button`
|
|
1654
1654
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1655
1655
|
border-radius: 8px;
|
|
1656
1656
|
// If selected make border color primary and text color color priamry
|
|
@@ -1671,33 +1671,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1671
1671
|
display: flex;
|
|
1672
1672
|
justify-content: center;
|
|
1673
1673
|
align-items: center;
|
|
1674
|
-
`,
|
|
1674
|
+
`,ti=ft.div`
|
|
1675
1675
|
display: flex;
|
|
1676
1676
|
justify-content: space-between;
|
|
1677
1677
|
margin-top: 16px;
|
|
1678
1678
|
gap: 8px;
|
|
1679
|
-
`,Vl=
|
|
1679
|
+
`,Vl=ft.div`
|
|
1680
1680
|
display: flex;
|
|
1681
1681
|
justify-content: space-between;
|
|
1682
1682
|
margin-top: 8px;
|
|
1683
|
-
`,
|
|
1683
|
+
`,oi=ft.div`
|
|
1684
1684
|
font-size: 12px;
|
|
1685
1685
|
line-height: 18px;
|
|
1686
1686
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1687
1687
|
font-style: normal;
|
|
1688
1688
|
font-weight: 400;
|
|
1689
1689
|
letter-spacing: 0.24px;
|
|
1690
|
-
`,
|
|
1690
|
+
`,ri=ft.div`
|
|
1691
1691
|
display: flex;
|
|
1692
1692
|
flex-direction: column;
|
|
1693
1693
|
flex: 1;
|
|
1694
|
-
`,uw=
|
|
1694
|
+
`,uw=ft.div`
|
|
1695
1695
|
display: flex;
|
|
1696
1696
|
flex-direction: column;
|
|
1697
1697
|
justify-content: center;
|
|
1698
1698
|
align-items: flex-start;
|
|
1699
1699
|
margin-top: 16px;
|
|
1700
|
-
`,jl=
|
|
1700
|
+
`,jl=ft.textarea`
|
|
1701
1701
|
${e=>E(e)} {
|
|
1702
1702
|
color: ${e=>e.appearance.theme.colorText};
|
|
1703
1703
|
margin-top: 16px;
|
|
@@ -1710,7 +1710,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1710
1710
|
height: 100px;
|
|
1711
1711
|
resize: none;
|
|
1712
1712
|
}
|
|
1713
|
-
`,Gl=
|
|
1713
|
+
`,Gl=ft.div`
|
|
1714
1714
|
${e=>E(e)} {
|
|
1715
1715
|
position: absolute;
|
|
1716
1716
|
top: 16px;
|
|
@@ -1721,7 +1721,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1721
1721
|
opacity: 0.8;
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
|
-
`;var Yc=({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:
|
|
1724
|
+
`;var Yc=({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:b,getFlowSteps:C,getFlowStatus:x,getFlowMetadata:P}=Z(),{primaryCTAClickSideEffects:S}=ue(),{mergeAppearanceWithDefault:v}=ie(),[$,B]=le.useState(null),[u,O]=le.useState(""),w=P(e),{hasOpenModals:k,setKeepCompletedFlowOpenDuringSession:I,shouldKeepCompletedFlowOpenDuringSession:N}=Be();if(He(e),n=v(n),Kc(()=>{b(o)},[o,g]),g)return null;let A=d(e);if(!A||y(A)||x(e)===re||c(e)===1&&!N(e)||k())return null;let _=C(e)[c(e)];function R(){var q,Y;return le.createElement(le.Fragment,null,le.createElement(ri,null,le.createElement(Ae,{size:"large",appearance:n,title:_.title,subtitle:_.subtitle})),le.createElement(ti,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(pe=>le.createElement(Hl,{className:a("npsNumberButton",n),selected:$===pe+1,key:pe,onClick:()=>M(this,null,function*(){I(e),B(pe+1),yield m(e,_.id,{score:pe+1})}),appearance:n},pe+1))),le.createElement(Vl,{appearance:n},le.createElement(oi,{appearance:n},(q=w==null?void 0:w.negativeLabel)!=null?q:"Not likely at all"),le.createElement(oi,{appearance:n},(Y=w==null?void 0:w.positiveLabel)!=null?Y:"Extremely likely")))}function J(){var q;return le.createElement(le.Fragment,null,le.createElement(ri,null,le.createElement(Ae,{appearance:n,title:(q=_.title)!=null?q:"Why did you choose this score?",size:"large"})),le.createElement(jl,{appearance:n,value:u,onChange:Y=>{O(Y.target.value)},placeholder:"Add your optional feedback here..."}),le.createElement(ti,{appearance:n,className:a("npsNumberButtonContainer",n)},le.createElement(se,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield s(e),i&&i(_,1,"primary")}),appearance:n,title:_.secondaryButtonTitle||"Skip",secondary:!0}),le.createElement(se,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield m(e,_.id,{feedbackText:u}),yield s(e),i&&i(_,1,"primary")}),appearance:n,title:_.primaryButtonTitle||"Submit"})))}function Q(){return c(e)>=2?null:le.createElement(le.Fragment,null,le.createElement(ae,{appearance:n}),le.createElement(zl,{appearance:n,className:Te(a("npsSurveyContainer",n),r),style:l,type:p},le.createElement(Gl,{onClick:()=>M(this,null,function*(){yield s(e),t&&t()}),className:a("npsSurveyDismissButton",n)},le.createElement(Ee,null)),c(e)==0&&R(),c(e)==1&&J()))}return p==="inline"?Q():le.createElement(qc,null,Q())};import ve,{useEffect as Qc}from"react";import _t from"styled-components";var Kl=_t.div`
|
|
1725
1725
|
${e=>E(e)} {
|
|
1726
1726
|
display: flex;
|
|
1727
1727
|
flex-direction: column;
|
|
@@ -1788,5 +1788,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1788
1788
|
height: 100%;
|
|
1789
1789
|
min-height: 200px;
|
|
1790
1790
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1791
|
-
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Rl.createElement(tt,{appearance:t,videoUri:e.videoUri}):e.imageUri?Rl.createElement(Xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:
|
|
1791
|
+
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Rl.createElement(tt,{appearance:t,videoUri:e.videoUri}):e.imageUri?Rl.createElement(Xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:b,getFlowSteps:C,getFlowStatus:x,getCurrentStepIndex:P}=Z(),{primaryCTAClickSideEffects:S,secondaryCTAClickSideEffects:v}=ue(),{mergeAppearanceWithDefault:$}=ie(),{setOpenFlowState:B,getOpenFlowState:u,hasOpenModals:O}=Be();He(e);let[w,k]=[u(e,!0),J=>B(e,J)];if(n=$(n),Qc(()=>{b(o)},[o,g]),g)return null;let I=s(e);if(!I||y(I)||x(e)===re||O())return null;let A=C(e)[P(e)],H=()=>{k(!1),t&&t(),m(e)};function _(){return ve.createElement(ve.Fragment,null,ve.createElement(ae,{appearance:n}),ve.createElement(Kl,{appearance:n,className:Te(a("announcementContainer",n),r),style:l},(p===!0||A.dismissible)&&d=="inline"&&ve.createElement(Xl,{onClick:()=>M(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},ve.createElement(Ee,null)),ve.createElement(ql,null,ve.createElement(Ql,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:ne(A.title)}),A.subtitle&&ve.createElement(Zl,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:ne(A.subtitle)})),(A.imageUri||A.videoUri)&&ve.createElement(Jl,{className:a("announcementMediaContainer",n)},ve.createElement(ea,{appearance:n,stepData:A})),(A.primaryButtonTitle||A.secondaryButtonTitle)&&ve.createElement(Yl,{className:a("announcementCTAContainer",n)},A.secondaryButtonTitle&&ve.createElement(se,{classPrefix:"announcement",title:A.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){A.handleSecondaryButtonClick(),v(A),i&&i(A,P(e),"secondary")}),secondary:!0}),A.primaryButtonTitle&&ve.createElement(se,{classPrefix:"announcement",title:A.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){A.handlePrimaryButtonClick(),S(A),!(i&&i(A,P(e),"primary")===!1)&&(yield c(e,A.id),yield m(e))})}))))}let R={padding:"24px",maxWidth:"400px"};return d==="inline"?_():d!=="center"?ve.createElement(Ho,{modalPosition:d,onClose:H,visible:w,dismissible:p,appearance:n},_()):ve.createElement(Re,{appearance:n,onClose:H,visible:w,style:R,dismissible:p},_())};import*as ur from"react";import ta from"react";var oa=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Ie(r,["as","children","variant"]);return ta.createElement(vn,T({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Rc=Object.fromEntries(Object.keys(Ro).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ta.createElement(oa,j(T({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),ii=Object.assign(oa,Rc);var ra=l=>{var p=l,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Ie(p,["as","className","size","title","variant"]);var d;return ur.createElement(Pn,T({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),ur.createElement(ii,{color:(d=Bo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},em=Object.fromEntries(Object.keys(Bo).map(e=>{let t=o=>ur.createElement(ra,j(T({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),tm=Object.assign(ra,em);export{vo as Box,tm as Button,at as CheckBox,hr as FlowType,Ct as FormLabel,Br as FormTextField,Zc as FrigadeAnnouncement,Gc as FrigadeBanner,Jr as FrigadeChecklist,lt as FrigadeDefaultAppearance,Vc as FrigadeEmbeddedTip,Cn as FrigadeForm,Sc as FrigadeGuide,hc as FrigadeHeroChecklist,Yc as FrigadeNPSSurvey,Cc as FrigadeProgressBadge,Pd as FrigadeProvider,zc as FrigadeSupportWidget,Mc as FrigadeTour,_e as ProgressBar,Yt as ProgressRing,ii as Text,Wr as tokens,Be as useFlowOpens,xo as useFlowResponses,Z as useFlows,_r as useOrganization,Co as useUser,De as useUserFlowStates};
|
|
1792
1792
|
//# sourceMappingURL=index.mjs.map
|