@frigade/react 1.32.86 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +263 -11
- package/lib/index.js +220 -220
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +215 -215
- package/lib/index.mjs.map +1 -1
- package/package.json +3 -1
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDescriptor;var Tl=Object.getOwnPropertyNames;var Fl=Object.getPrototypeOf,kl=Object.prototype.hasOwnProperty;var Pl=(e,t)=>{for(var o in t)Fo(e,o,{get:t[o],enumerable:!0})},Br=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Tl(t))!kl.call(e,r)&&r!==o&&Fo(e,r,{get:()=>t[r],enumerable:!(i=wl(t,r))||i.enumerable});return e};var u=(e,t,o)=>(o=e!=null?bl(Fl(e)):{},Br(t||!e||!e.__esModule?Fo(o,"default",{value:e,enumerable:!0}):o,e)),vl=e=>Br(Fo({},"__esModule",{value:!0}),e);var Cp={};Pl(Cp,{CheckBox:()=>Re,FormLabel:()=>ct,FormTextField:()=>$o,FrigadeBanner:()=>ul,FrigadeChecklist:()=>Qo,FrigadeDefaultAppearance:()=>Qe,FrigadeEmbeddedTip:()=>ll,FrigadeForm:()=>dr,FrigadeGuide:()=>Us,FrigadeHeroChecklist:()=>Fs,FrigadeNPSSurvey:()=>yl,FrigadeProgressBadge:()=>$s,FrigadeProvider:()=>Gi,FrigadeSupportWidget:()=>ol,FrigadeTour:()=>Gs,ProgressRing:()=>Et,useFlowOpens:()=>Ie,useFlowResponses:()=>_t,useFlows:()=>R,useOrganization:()=>jo,useUser:()=>Wt});module.exports=vl(Cp);var J=u(require("react")),Hi=require("styled-components");var xe=u(require("react"));var We=require("react");var kt=u(require("react"));var Ar="1.32.86 ";var _e="NOT_STARTED_STEP",se="COMPLETED_FLOW",ko="ABORTED_FLOW",Pt="STARTED_FLOW",He="NOT_STARTED_FLOW",Ve="COMPLETED_STEP",Po="STARTED_STEP";function Xe(){let{publicApiKey:e,userId:t,apiUrl:o}=kt.default.useContext(Y);return{config:(0,kt.useMemo)(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Ar,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:(0,kt.useMemo)(()=>`${o}/v1/public/`,[o])}}var El="frigade-last-call-at-",Bl="frigade-last-call-data-";function $t(){let{shouldGracefullyDegrade:e,readonly:t}=kt.default.useContext(Y);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Dt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Dt();let r=El+o,n=Bl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),d=window.localStorage.getItem(n);if(p&&d&&d==i.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return Dt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return Dt(p)}return s?s.ok?s:Dt(s.statusText):Dt()}}function Dt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Mt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=kt.default.useContext(Y);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}var no=require("react");var Ut=require("react");var Nr=u(require("swr"));var Ir=require("react");function Ie(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=(0,Ir.useContext)(Y);function n(c,g=!1){return e[c]??g}function s(c,g){t(y=>({...y,[c]:g}))}function p(c){t(g=>{let{[c]:y,...F}=g;return{...F}})}function d(c){r.includes(c)||i(g=>[...g,c])}function a(c){return r.includes(c)}function C(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:C,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var Lr=u(require("swr/immutable")),Al="unknown";function ze(){let{config:e,apiUrl:t}=Xe(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=(0,Ut.useContext)(Y),{resetOpenFlowState:d}=Ie(),[a,C]=(0,Ut.useState)(!1),c={data:n.map(S=>({flowId:S.id,flowState:se,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=S=>fetch(S,e).then(B=>{if(B.ok)return B.json();throw new Error("Failed to fetch user flow states")}).catch(B=>(console.log(`Error fetching ${S}: ${B}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:F,isLoading:v,mutate:h,error:E}=p?(0,Lr.default)(y,g):(0,Nr.default)(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),x=F==null?void 0:F.data;(0,Ut.useEffect)(()=>{!a&&!v&&x&&C(!0)},[x,a,v]);async function k(S){if(x&&!p){let B=x.find($=>$.flowId===S);B&&B.flowState!==se&&(B.flowState=se),await h(Promise.resolve({...F,data:x}),{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}async function L(S,B,$){if(x){let _=x.find(O=>O.flowId===S);_&&(_.stepStates[B]=$,_.flowState=Pt),await h(Promise.resolve({...F,data:x}),{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}async function b(S,B,$){if(x){let _=x.find(O=>O.flowId===S);_&&(_.lastStepId=B,_.stepStates[B]=$,_.flowState=Pt),await h({...F,data:x},{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}async function m(S){if(x){let B=x.find($=>$.flowId===S);B&&B.flowState!==He&&(B.flowState=He,B.lastStepId=Al,Object.keys(B.stepStates).forEach($=>{B.stepStates[$].actionType=_e,B.stepStates[$].createdAt=new Date().toISOString()}),await h({...F,data:x},{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1}),d(S))}}async function T(S,B){if(x){let $=x.find(_=>_.flowId===S);$&&$.stepStates[B]!==_e&&($.stepStates[B]=_e),await h({...F,data:x},{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:x,isLoadingUserFlowStateData:!a,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:k,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:T,optimisticallyMarkStepStarted:b,error:E}}function _t(){let{config:e,apiUrl:t}=Xe(),{userFlowStatesData:o,mutateUserFlowState:i}=ze(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=(0,no.useContext)(Y),[d,a]=(0,no.useState)(new Set),[C,c]=(0,no.useState)(new Set),g=$t();function y(h){let E=JSON.stringify(h);if(d.has(E))return null;d.add(E),a(d),C.add(h),c(C);let x=s==null?void 0:s.find(k=>k.flowSlug===h.flowSlug&&k.stepId===h.stepId&&k.actionType===h.actionType&&k.createdAt===h.createdAt);return g(`${t}flowResponses`,{...e,method:"POST",body:E}).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),n([...r,h])):x||p(L=>[...L??[],h])})}async function F(h){h.foreignUserId&&(h.actionType===Pt||h.actionType===He?await y(h):h.actionType===se?await y(h):h.actionType===Po?await y(h):h.actionType===Ve?await y(h):h.actionType===ko?await y(h):h.actionType===_e&&await y(h))}function v(){let h=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let x in E.stepStates){let k=E.stepStates[x];h.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...h,...s]}return{addResponse:F,setFlowResponses:p,getFlowResponses:v}}var Dr=u(require("swr"));var Il=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Or=e=>{let t=Il.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Nl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Nl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function R(){let{config:e,apiUrl:t}=Xe(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,setFlowResponses:C,setShouldGracefullyDegrade:c,readonly:g}=(0,We.useContext)(Y),y={data:[]},{verifySDKInitiated:F}=Mt(),{addResponse:v,getFlowResponses:h}=_t(),E=f=>fetch(f,e).then(w=>w.ok?w.json():(console.log(`Error fetching ${f} (${w.status}): ${w.statusText}. .Will gracefully degrade and hide Frigade`),c(!0),y)).catch(w=>(console.log(`Error fetching ${f}: ${w}. Will gracefully degrade and hide Frigade`),c(!0),y)),{userFlowStatesData:x,isLoadingUserFlowStateData:k,optimisticallyMarkFlowCompleted:L,optimisticallyMarkFlowNotStarted:b,optimisticallyMarkStepCompleted:m,optimisticallyMarkStepNotStarted:T,optimisticallyMarkStepStarted:S}=ze(),{data:B,error:$,isLoading:_}=(0,Dr.default)(n?`${t}flows${g?"?readonly=true":""}`:null,E,{keepPreviousData:!0});(0,We.useEffect)(()=>{if($){console.error($);return}B&&B.data&&i(B.data)},[B,$]);function O(f){if(_)return null;let w=o.find(A=>A.slug===f);return!w&&o.length>0&&!k&&!_?(console.log(`Flow with slug ${f} not found`),null):(w==null?void 0:w.active)===!1?null:w}function D(f){var I;if(!O(f))return[];let w=O(f).data;return w?(w=G(w),(((I=JSON.parse(w))==null?void 0:I.data)??[]).map(ne=>{let Ft=at(ne);return{handleSecondaryButtonClick:()=>{ne.skippable===!0&&Pe(f,ne.id,{skipped:!0})},...ne,complete:he(f,ne.id)===Ve||Ft>=1,blocked:W(f,ne.id),hidden:M(f,ne.id),handlePrimaryButtonClick:()=>{(!ne.completionCriteria&&(ne.autoMarkCompleted||ne.autoMarkCompleted===void 0)||ne.completionCriteria&&ne.autoMarkCompleted===!0)&&Pe(f,ne.id)},progress:Ft}}).filter(ne=>ne.hidden!==!0)):[]}function G(f){return f.replaceAll(/\${(.*?)}/g,(w,A)=>s[A]===void 0?"":String(s[A]).replace(/[\u00A0-\u9999<>\&]/g,function(I){return"&#"+I.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 U(f){if(!O(f))return[];let w=O(f).data;return w?(w=G(w),JSON.parse(w)??{}):[]}function re(f,w){p(A=>({...A,[f]:w}))}function ie(f){!k&&!_&&f&&JSON.stringify(s)!=JSON.stringify({...s,...f})&&Object.keys(f).forEach(w=>{re(w,f[w])})}let Z=(0,We.useCallback)(async(f,w,A)=>{F();let I={foreignUserId:r,flowSlug:f,stepId:w,actionType:Po,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};Q(I)&&(await S(f,w,I),v(I))},[r,x]),q=(0,We.useCallback)(async(f,w,A)=>{F();let I={foreignUserId:r,flowSlug:f,stepId:w,actionType:_e,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};Q(I)&&(await T(f,w),v(I))},[r,x]),Pe=(0,We.useCallback)(async(f,w,A)=>{F();let I={foreignUserId:r,flowSlug:f,stepId:w,actionType:Ve,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};Q(I)&&(await m(f,w,I),v(I))},[r,x]),ae=(0,We.useCallback)(async(f,w)=>{if(F(),Ye(f)===He)return;let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:He,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};await b(f),Q(A)&&v(A)},[r,x]),X=(0,We.useCallback)(async(f,w)=>{F();let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:Pt,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};Q(A)&&v(A)},[r,x]),ve=(0,We.useCallback)(async(f,w)=>{F();let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:se,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};Q(A)&&(await L(f),v(A))},[r,x]),Oe=(0,We.useCallback)(async(f,w)=>{F();let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:ko,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};Q(A)&&(await L(f),v(A))},[r,x]);function Q(f){var w;if(!x&&f.actionType===_e)return!1;if(x){let A=x.find(I=>I.flowId===f.flowSlug);if(f.actionType===_e&&(!(A!=null&&A.stepStates[f.stepId])||A.stepStates[f.stepId].actionType===_e)||A&&((w=A.stepStates[f.stepId])==null?void 0:w.actionType)===f.actionType||A&&A.flowState===se&&f.actionType===se)return!1}return!0}function he(f,w){let A=pe(f,w);return k?null:A?A.actionType:_e}function W(f,w){let A=pe(f,w);return A?A.blocked:!1}function M(f,w){let A=pe(f,w);return A?A.hidden:!1}function pe(f,w){if(k)return null;let A=x==null?void 0:x.find(I=>I.flowId===f);return!A||!A.stepStates[w]?null:A.stepStates[w]??null}function K(f){var A;if(k||!x)return null;if(Ye(f)===He)return D(f)[0]??null;let w=(A=x.find(I=>I.flowId===f))==null?void 0:A.lastStepId;return w?D(f).find(I=>I.id===w):null}function de(f){let w=K(f);if(!w)return 0;let A=D(f).findIndex(I=>I.id===w.id)??0;return he(f,w.id)===Ve&&A<D(f).length-1?A+1:A}function at(f){if(!f.completionCriteria)return;let w=Or(f.completionCriteria);if(w===null)return;let A=Tt(w),I=V(w);return I===0?void 0:A/I}function Ye(f){let w=x==null?void 0:x.find(A=>A.flowId===f);return w?w.flowState:null}function Tt(f){let w=D(f);return w.length===0?0:w.filter(I=>he(f,I.id)===Ve).length}function V(f){return D(f).length}function Ue(f){return JSON.parse(o.find(w=>w.slug===f).data)}function Je(f){if(g)return!1;if(k)return!0;if(f!=null&&f.targetingLogic&&x){let w=x.find(A=>A.flowId===f.slug);if(w)return w.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&r&&r.startsWith("guest_"))}function Ro(f){return!Je(O(f))}return{getFlow:O,getFlowData:Ue,isLoading:k||_,getStepStatus:he,getFlowSteps:D,getCurrentStepIndex:de,markStepStarted:Z,markStepCompleted:Pe,markFlowNotStarted:ae,markFlowStarted:X,markFlowCompleted:ve,markFlowAborted:Oe,markStepNotStarted:q,getFlowStatus:Ye,getNumberOfStepsCompleted:Tt,getNumberOfSteps:V,targetingLogicShouldHideFlow:Je,setCustomVariable:re,updateCustomVariables:ie,customVariables:s,getStepOptionalProgress:at,getFlowMetadata:U,isStepBlocked:W,isStepHidden:M,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Ro}}var vt=require("react");var zt="guest_";function Wt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=(0,vt.useContext)(Y),{config:n,apiUrl:s}=Xe(),{mutateUserFlowState:p}=ze(),d=$t(),{verifySDKInitiated:a}=Mt();(0,vt.useEffect)(()=>{if(e&&!t){if(e.startsWith(zt))return;let g=`frigade-user-registered-${e}`;localStorage.getItem(g)||(d(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(g,"true"))}},[e,r,t]);let C=(0,vt.useCallback)(async g=>{a();let y={foreignId:e,properties:g};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(y)}),i(F=>({...F,...g})),p()},[e,n,r,p]),c=(0,vt.useCallback)(async(g,y)=>{a();let v={foreignId:e,events:[{event:g,properties:y}]};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:C,trackEventForUser:c}}var zi=require("uuid");var Ae=u(require("react"));var Ne=u(require("react")),ao=u(require("styled-components"));var Mr=u(require("react")),Ur=u(require("styled-components"));var $r="fr-",so="cfr-";function l(e,t){let o=`${$r}${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+" "+so+e}return o}function P(e){if(!e.className||e.className.indexOf(so)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith($r)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function er(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function pt(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${er(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ee(...e){return e.filter(Boolean).join(" ")}function lo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ll=Ur.default.div`
|
|
2
|
+
var Gl=Object.create;var Eo=Object.defineProperty;var ql=Object.getOwnPropertyDescriptor;var Kl=Object.getOwnPropertyNames;var Yl=Object.getPrototypeOf,Xl=Object.prototype.hasOwnProperty;var Jl=(e,t)=>{for(var o in t)Eo(e,o,{get:t[o],enumerable:!0})},Hr=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Kl(t))!Xl.call(e,r)&&r!==o&&Eo(e,r,{get:()=>t[r],enumerable:!(i=ql(t,r))||i.enumerable});return e};var m=(e,t,o)=>(o=e!=null?Gl(Yl(e)):{},Hr(t||!e||!e.__esModule?Eo(o,"default",{value:e,enumerable:!0}):o,e)),Ql=e=>Hr(Eo({},"__esModule",{value:!0}),e);var Xp={};Jl(Xp,{Button:()=>jl,CheckBox:()=>et,FormLabel:()=>mt,FormTextField:()=>Wo,FrigadeBanner:()=>Ol,FrigadeChecklist:()=>sr,FrigadeDefaultAppearance:()=>Ze,FrigadeEmbeddedTip:()=>Bl,FrigadeForm:()=>br,FrigadeGuide:()=>nl,FrigadeHeroChecklist:()=>Gs,FrigadeNPSSurvey:()=>Wl,FrigadeProgressBadge:()=>rl,FrigadeProvider:()=>un,FrigadeSupportWidget:()=>Tl,FrigadeTour:()=>ml,ProgressRing:()=>Et,Text:()=>ar,tokens:()=>Ro,useFlowOpens:()=>Ne,useFlowResponses:()=>_t,useFlows:()=>R,useOrganization:()=>Xo,useUser:()=>Ht});module.exports=Ql(Xp);var X=m(require("react")),pn=require("styled-components");var xe=m(require("react"));var He=require("react");var Pt=m(require("react"));var Vr="1.33.0 ";var _e="NOT_STARTED_STEP",se="COMPLETED_FLOW",Ao="ABORTED_FLOW",vt="STARTED_FLOW",Ve="NOT_STARTED_FLOW",je="COMPLETED_STEP",Io="STARTED_STEP";function Qe(){let{publicApiKey:e,userId:t,apiUrl:o}=Pt.default.useContext(Y);return{config:(0,Pt.useMemo)(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Vr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:(0,Pt.useMemo)(()=>`${o}/v1/public/`,[o])}}var Zl="frigade-last-call-at-",Rl="frigade-last-call-data-";function Mt(){let{shouldGracefullyDegrade:e,readonly:t}=Pt.default.useContext(Y);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return $t();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),$t();let r=Zl+o,n=Rl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),d=window.localStorage.getItem(n);if(p&&d&&d==i.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return $t()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return $t(p)}return s?s.ok?s:$t(s.statusText):$t()}}function $t(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ut(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Pt.default.useContext(Y);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}var ao=require("react");var zt=require("react");var Gr=m(require("swr"));var jr=require("react");function Ne(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=(0,jr.useContext)(Y);function n(c,g=!1){return e[c]??g}function s(c,g){t(S=>({...S,[c]:g}))}function p(c){t(g=>{let{[c]:S,...F}=g;return{...F}})}function d(c){r.includes(c)||i(g=>[...g,c])}function a(c){return r.includes(c)}function C(c){return Object.entries(e).some(([g,S])=>S&&g!=c)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:C,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var qr=m(require("swr/immutable")),ea="unknown";function We(){let{config:e,apiUrl:t}=Qe(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=(0,zt.useContext)(Y),{resetOpenFlowState:d}=Ne(),[a,C]=(0,zt.useState)(!1),c={data:n.map(y=>({flowId:y.id,flowState:se,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=y=>fetch(y,e).then(E=>{if(E.ok)return E.json();throw new Error("Failed to fetch user flow states")}).catch(E=>(console.log(`Error fetching ${y}: ${E}. Will gracefully degrade and hide Frigade`),s(!0),c)),S=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:F,isLoading:v,mutate:h,error:B}=p?(0,qr.default)(S,g):(0,Gr.default)(S,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),x=F==null?void 0:F.data;(0,zt.useEffect)(()=>{!a&&!v&&x&&C(!0)},[x,a,v]);async function k(y){if(x&&!p){let E=x.find($=>$.flowId===y);E&&E.flowState!==se&&(E.flowState=se),await h(Promise.resolve({...F,data:x}),{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}async function L(y,E,$){if(x){let z=x.find(O=>O.flowId===y);z&&(z.stepStates[E]=$,z.flowState=vt),await h(Promise.resolve({...F,data:x}),{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}async function b(y,E,$){if(x){let z=x.find(O=>O.flowId===y);z&&(z.lastStepId=E,z.stepStates[E]=$,z.flowState=vt),await h({...F,data:x},{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}async function u(y){if(x){let E=x.find($=>$.flowId===y);E&&E.flowState!==Ve&&(E.flowState=Ve,E.lastStepId=ea,Object.keys(E.stepStates).forEach($=>{E.stepStates[$].actionType=_e,E.stepStates[$].createdAt=new Date().toISOString()}),await h({...F,data:x},{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1}),d(y))}}async function T(y,E){if(x){let $=x.find(z=>z.flowId===y);$&&$.stepStates[E]!==_e&&($.stepStates[E]=_e),await h({...F,data:x},{optimisticData:{...F,data:x},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:x,isLoadingUserFlowStateData:!a,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:k,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:T,optimisticallyMarkStepStarted:b,error:B}}function _t(){let{config:e,apiUrl:t}=Qe(),{userFlowStatesData:o,mutateUserFlowState:i}=We(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=(0,ao.useContext)(Y),[d,a]=(0,ao.useState)(new Set),[C,c]=(0,ao.useState)(new Set),g=Mt();function S(h){let B=JSON.stringify(h);if(d.has(B))return null;d.add(B),a(d),C.add(h),c(C);let x=s==null?void 0:s.find(k=>k.flowSlug===h.flowSlug&&k.stepId===h.stepId&&k.actionType===h.actionType&&k.createdAt===h.createdAt);return g(`${t}flowResponses`,{...e,method:"POST",body:B}).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),n([...r,h])):x||p(L=>[...L??[],h])})}async function F(h){h.foreignUserId&&(h.actionType===vt||h.actionType===Ve?await S(h):h.actionType===se?await S(h):h.actionType===Io?await S(h):h.actionType===je?await S(h):h.actionType===Ao?await S(h):h.actionType===_e&&await S(h))}function v(){let h=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let x in B.stepStates){let k=B.stepStates[x];h.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...h,...s]}return{addResponse:F,setFlowResponses:p,getFlowResponses:v}}var Yr=m(require("swr"));var ta=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Kr=e=>{let t=ta.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=oa(i,"'","");n.startsWith("flow_")&&(o=n)}),o},oa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function R(){let{config:e,apiUrl:t}=Qe(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,setFlowResponses:C,setShouldGracefullyDegrade:c,readonly:g}=(0,He.useContext)(Y),S={data:[]},{verifySDKInitiated:F}=Ut(),{addResponse:v,getFlowResponses:h}=_t(),B=f=>fetch(f,e).then(w=>w.ok?w.json():(console.log(`Error fetching ${f} (${w.status}): ${w.statusText}. .Will gracefully degrade and hide Frigade`),c(!0),S)).catch(w=>(console.log(`Error fetching ${f}: ${w}. Will gracefully degrade and hide Frigade`),c(!0),S)),{userFlowStatesData:x,isLoadingUserFlowStateData:k,optimisticallyMarkFlowCompleted:L,optimisticallyMarkFlowNotStarted:b,optimisticallyMarkStepCompleted:u,optimisticallyMarkStepNotStarted:T,optimisticallyMarkStepStarted:y}=We(),{data:E,error:$,isLoading:z}=(0,Yr.default)(n?`${t}flows${g?"?readonly=true":""}`:null,B,{keepPreviousData:!0});(0,He.useEffect)(()=>{if($){console.error($);return}E&&E.data&&i(E.data)},[E,$]);function O(f){if(z)return null;let w=o.find(A=>A.slug===f);return!w&&o.length>0&&!k&&!z?(console.log(`Flow with slug ${f} not found`),null):(w==null?void 0:w.active)===!1?null:w}function D(f){var I;if(!O(f))return[];let w=O(f).data;return w?(w=G(w),(((I=JSON.parse(w))==null?void 0:I.data)??[]).map(ne=>{let kt=pt(ne);return{handleSecondaryButtonClick:()=>{ne.skippable===!0&&Pe(f,ne.id,{skipped:!0})},...ne,complete:he(f,ne.id)===je||kt>=1,blocked:W(f,ne.id),hidden:M(f,ne.id),handlePrimaryButtonClick:()=>{(!ne.completionCriteria&&(ne.autoMarkCompleted||ne.autoMarkCompleted===void 0)||ne.completionCriteria&&ne.autoMarkCompleted===!0)&&Pe(f,ne.id)},progress:kt}}).filter(ne=>ne.hidden!==!0)):[]}function G(f){return f.replaceAll(/\${(.*?)}/g,(w,A)=>s[A]===void 0?"":String(s[A]).replace(/[\u00A0-\u9999<>\&]/g,function(I){return"&#"+I.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 U(f){if(!O(f))return[];let w=O(f).data;return w?(w=G(w),JSON.parse(w)??{}):[]}function re(f,w){p(A=>({...A,[f]:w}))}function ie(f){!k&&!z&&f&&JSON.stringify(s)!=JSON.stringify({...s,...f})&&Object.keys(f).forEach(w=>{re(w,f[w])})}let Z=(0,He.useCallback)(async(f,w,A)=>{F();let I={foreignUserId:r,flowSlug:f,stepId:w,actionType:Io,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};Q(I)&&(await y(f,w,I),v(I))},[r,x]),q=(0,He.useCallback)(async(f,w,A)=>{F();let I={foreignUserId:r,flowSlug:f,stepId:w,actionType:_e,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};Q(I)&&(await T(f,w),v(I))},[r,x]),Pe=(0,He.useCallback)(async(f,w,A)=>{F();let I={foreignUserId:r,flowSlug:f,stepId:w,actionType:je,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};Q(I)&&(await u(f,w,I),v(I))},[r,x]),ae=(0,He.useCallback)(async(f,w)=>{if(F(),Xe(f)===Ve)return;let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:Ve,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};await b(f),Q(A)&&v(A)},[r,x]),J=(0,He.useCallback)(async(f,w)=>{F();let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:vt,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};Q(A)&&v(A)},[r,x]),ve=(0,He.useCallback)(async(f,w)=>{F();let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:se,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};Q(A)&&(await L(f),v(A))},[r,x]),De=(0,He.useCallback)(async(f,w)=>{F();let A={foreignUserId:r,flowSlug:f,stepId:"unknown",actionType:Ao,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};Q(A)&&(await L(f),v(A))},[r,x]);function Q(f){var w;if(!x&&f.actionType===_e)return!1;if(x){let A=x.find(I=>I.flowId===f.flowSlug);if(f.actionType===_e&&(!(A!=null&&A.stepStates[f.stepId])||A.stepStates[f.stepId].actionType===_e)||A&&((w=A.stepStates[f.stepId])==null?void 0:w.actionType)===f.actionType||A&&A.flowState===se&&f.actionType===se)return!1}return!0}function he(f,w){let A=pe(f,w);return k?null:A?A.actionType:_e}function W(f,w){let A=pe(f,w);return A?A.blocked:!1}function M(f,w){let A=pe(f,w);return A?A.hidden:!1}function pe(f,w){if(k)return null;let A=x==null?void 0:x.find(I=>I.flowId===f);return!A||!A.stepStates[w]?null:A.stepStates[w]??null}function K(f){var A;if(k||!x)return null;if(Xe(f)===Ve)return D(f)[0]??null;let w=(A=x.find(I=>I.flowId===f))==null?void 0:A.lastStepId;return w?D(f).find(I=>I.id===w):null}function de(f){let w=K(f);if(!w)return 0;let A=D(f).findIndex(I=>I.id===w.id)??0;return he(f,w.id)===je&&A<D(f).length-1?A+1:A}function pt(f){if(!f.completionCriteria)return;let w=Kr(f.completionCriteria);if(w===null)return;let A=Ft(w),I=V(w);return I===0?void 0:A/I}function Xe(f){let w=x==null?void 0:x.find(A=>A.flowId===f);return w?w.flowState:null}function Ft(f){let w=D(f);return w.length===0?0:w.filter(I=>he(f,I.id)===je).length}function V(f){return D(f).length}function ze(f){return JSON.parse(o.find(w=>w.slug===f).data)}function Je(f){if(g)return!1;if(k)return!0;if(f!=null&&f.targetingLogic&&x){let w=x.find(A=>A.flowId===f.slug);if(w)return w.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&r&&r.startsWith("guest_"))}function dr(f){return!Je(O(f))}return{getFlow:O,getFlowData:ze,isLoading:k||z,getStepStatus:he,getFlowSteps:D,getCurrentStepIndex:de,markStepStarted:Z,markStepCompleted:Pe,markFlowNotStarted:ae,markFlowStarted:J,markFlowCompleted:ve,markFlowAborted:De,markStepNotStarted:q,getFlowStatus:Xe,getNumberOfStepsCompleted:Ft,getNumberOfSteps:V,targetingLogicShouldHideFlow:Je,setCustomVariable:re,updateCustomVariables:ie,customVariables:s,getStepOptionalProgress:pt,getFlowMetadata:U,isStepBlocked:W,isStepHidden:M,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,isFlowAvailableToUser:dr}}var Bt=require("react");var Wt="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=(0,Bt.useContext)(Y),{config:n,apiUrl:s}=Qe(),{mutateUserFlowState:p}=We(),d=Mt(),{verifySDKInitiated:a}=Ut();(0,Bt.useEffect)(()=>{if(e&&!t){if(e.startsWith(Wt))return;let g=`frigade-user-registered-${e}`;localStorage.getItem(g)||(d(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(g,"true"))}},[e,r,t]);let C=(0,Bt.useCallback)(async g=>{a();let S={foreignId:e,properties:g};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(F=>({...F,...g})),p()},[e,n,r,p]),c=(0,Bt.useCallback)(async(g,S)=>{a();let v={foreignId:e,events:[{event:g,properties:S}]};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:C,trackEventForUser:c}}var Ri=require("uuid");var Ie=m(require("react"));var Le=m(require("react")),mo=m(require("styled-components"));var Jr=m(require("react")),Qr=m(require("styled-components"));var Xr="fr-",po="cfr-";function l(e,t){let o=`${Xr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+po+e}return o}function P(e){if(!e.className||e.className.indexOf(po)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Xr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function cr(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function dt(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${cr(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ee(...e){return e.filter(Boolean).join(" ")}function co(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ra=Qr.default.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,Zr=({onClose:e,appearance:t})=>Jr.default.createElement(ra,{className:l("modalBackground",t),onClick:()=>e()});var No=m(require("react")),Rr=m(require("styled-components")),ia=Rr.default.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
`,$e=()=>No.default.createElement(ia,null,No.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},No.default.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));var ci=require("react-portal");var mr=m(require("react"));var Lo=m(require("react"));function na({style:e,className:t}){return Lo.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Lo.default.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Lo.default.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var ei=na;var Do=m(require("styled-components"));var ct=m(require("styled-components"));var Oo=ct.default.div`
|
|
31
31
|
${e=>P(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -38,13 +38,13 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
padding: 22px 22px 12px;
|
|
40
40
|
z-index: ${e=>e.zIndex};
|
|
41
|
-
`,
|
|
41
|
+
`,ti=ct.default.div`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
45
45
|
top: 12px;
|
|
46
46
|
right: 12px;
|
|
47
|
-
`,
|
|
47
|
+
`,oi=ct.default.img`
|
|
48
48
|
${e=>P(e)} {
|
|
49
49
|
display: block;
|
|
50
50
|
width: 100%;
|
|
@@ -53,7 +53,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
53
53
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
54
54
|
margin-bottom: 16px;
|
|
55
55
|
}
|
|
56
|
-
`,
|
|
56
|
+
`,ri=ct.default.div`
|
|
57
57
|
${e=>P(e)} {
|
|
58
58
|
display: block;
|
|
59
59
|
width: 100%;
|
|
@@ -62,17 +62,17 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
62
62
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
63
63
|
margin-bottom: 16px;
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,ii=ct.default.div`
|
|
66
66
|
display: flex;
|
|
67
67
|
flex-direction: row;
|
|
68
68
|
justify-content: space-between;
|
|
69
69
|
align-content: center;
|
|
70
|
-
`,
|
|
70
|
+
`,ni=ct.default.div`
|
|
71
71
|
display: flex;
|
|
72
72
|
flex: 1;
|
|
73
73
|
flex-direction: column;
|
|
74
74
|
justify-content: center;
|
|
75
|
-
`,
|
|
75
|
+
`,si=ct.default.div`
|
|
76
76
|
display: flex;
|
|
77
77
|
flex: 2;
|
|
78
78
|
flex-shrink: 1;
|
|
@@ -84,7 +84,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
84
84
|
align-content: center;
|
|
85
85
|
align-items: center;
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,li=ct.default.p`
|
|
88
88
|
${e=>P(e)} {
|
|
89
89
|
font-style: normal;
|
|
90
90
|
font-weight: 600;
|
|
@@ -93,7 +93,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
93
93
|
color: #808080;
|
|
94
94
|
}
|
|
95
95
|
margin: 0;
|
|
96
|
-
`;var
|
|
96
|
+
`;var ai=Do.default.div`
|
|
97
97
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
98
98
|
position: absolute;
|
|
99
99
|
bottom: -47px;
|
|
@@ -104,7 +104,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
104
104
|
align-items: center;
|
|
105
105
|
justify-content: center;
|
|
106
106
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
107
|
-
`,
|
|
107
|
+
`,pi=(0,Do.default)(Oo)`
|
|
108
108
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
109
109
|
position: absolute;
|
|
110
110
|
bottom: -60px;
|
|
@@ -117,7 +117,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
117
117
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
118
118
|
padding: 0;
|
|
119
119
|
z-index: ${e=>e.zIndex};
|
|
120
|
-
`,
|
|
120
|
+
`,di=Do.default.div`
|
|
121
121
|
display: flex;
|
|
122
122
|
justify-content: center;
|
|
123
123
|
align-items: center;
|
|
@@ -126,7 +126,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
126
126
|
font-size: 12px;
|
|
127
127
|
line-height: 18px;
|
|
128
128
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
129
|
-
`;function
|
|
129
|
+
`;function $o({appearance:e}){return mr.default.createElement(di,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",mr.default.createElement(ei,null))}var sa=mo.default.div`
|
|
130
130
|
${e=>P(e)} {
|
|
131
131
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
132
132
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -141,7 +141,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
141
141
|
width: ${e=>e.width??"1000px"};
|
|
142
142
|
z-index: 1500;
|
|
143
143
|
border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)??8}}px;
|
|
144
|
-
${e=>
|
|
144
|
+
${e=>dt(e)}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
padding: 32px;
|
|
@@ -168,10 +168,10 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
168
168
|
opacity: 1;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
`,
|
|
171
|
+
`,la=mo.default.div`
|
|
172
172
|
position: relative;
|
|
173
173
|
flex: 0 1 auto;
|
|
174
|
-
`,
|
|
174
|
+
`,aa=mo.default.div`
|
|
175
175
|
position: absolute;
|
|
176
176
|
top: 24px;
|
|
177
177
|
right: 24px;
|
|
@@ -181,14 +181,14 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
181
181
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
182
182
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
183
183
|
}
|
|
184
|
-
`,
|
|
184
|
+
`,pa=mo.default.div`
|
|
185
185
|
overflow: scroll;
|
|
186
186
|
flex: 1 1;
|
|
187
187
|
display: flex;
|
|
188
188
|
::-webkit-scrollbar {
|
|
189
189
|
display: none;
|
|
190
190
|
}
|
|
191
|
-
`,
|
|
191
|
+
`,xt=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>((0,Le.useEffect)(()=>{let d=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",d),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),t?Le.default.createElement(ci.Portal,null,Le.default.createElement(Zr,{appearance:n,onClose:()=>{s&&e()}}),Le.default.createElement(sa,{appearance:n,className:l("modalContainer",n),styleOverrides:i},s&&Le.default.createElement(aa,{className:l("modalClose",n),onClick:()=>e(),appearance:n},Le.default.createElement($e,null)),o&&Le.default.createElement(la,null,o),Le.default.createElement(pa,null,r),p&&Le.default.createElement(ai,{appearance:n,className:l("poweredByFrigadeRibbon",n)},Le.default.createElement($o,{appearance:n})))):Le.default.createElement(Le.default.Fragment,null));var Ge=m(require("react")),uo=m(require("styled-components")),mi=require("react-portal");var da=uo.default.div`
|
|
192
192
|
${e=>P(e)} {
|
|
193
193
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
194
194
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -206,10 +206,10 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
206
206
|
bottom: 0;
|
|
207
207
|
margin-right: 28px;
|
|
208
208
|
margin-bottom: 28px;
|
|
209
|
-
`,
|
|
209
|
+
`,ca=uo.default.div`
|
|
210
210
|
position: relative;
|
|
211
211
|
flex: 1;
|
|
212
|
-
`,
|
|
212
|
+
`,ma=uo.default.div`
|
|
213
213
|
position: absolute;
|
|
214
214
|
top: 24px;
|
|
215
215
|
right: 24px;
|
|
@@ -219,13 +219,13 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
221
221
|
}
|
|
222
|
-
`,
|
|
222
|
+
`,ua=uo.default.div`
|
|
223
223
|
overflow: scroll;
|
|
224
224
|
flex: 5;
|
|
225
225
|
::-webkit-scrollbar {
|
|
226
226
|
display: none;
|
|
227
227
|
}
|
|
228
|
-
`,
|
|
228
|
+
`,ui=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r})=>((0,Ge.useEffect)(()=>{let n=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",n),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",n)}},[e,t]),t?Ge.default.createElement(mi.Portal,null,Ge.default.createElement(da,{appearance:r,className:l("cornerModalContainer",r)},Ge.default.createElement(ma,{className:l("cornerModalClose",r),onClick:()=>e()},Ge.default.createElement($e,null)),o&&Ge.default.createElement(ca,null,o),Ge.default.createElement(ua,null,i))):Ge.default.createElement(Ge.default.Fragment,null));var fi=require("react");function le(){let{defaultAppearance:e}=(0,fi.useContext)(Y);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}var ke=m(require("react")),ho=m(require("styled-components"));var Re=m(require("react")),_o=m(require("styled-components"));var fo=m(require("styled-components"));var gi=fo.default.label`
|
|
229
229
|
${e=>P(e)} {
|
|
230
230
|
font-size: 14px;
|
|
231
231
|
line-height: 20px;
|
|
@@ -233,14 +233,14 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
233
233
|
margin-top: 10px;
|
|
234
234
|
}
|
|
235
235
|
display: flex;
|
|
236
|
-
`,
|
|
236
|
+
`,hi=fo.default.label`
|
|
237
237
|
${e=>P(e)} {
|
|
238
238
|
font-size: 12px;
|
|
239
239
|
line-height: 20px;
|
|
240
240
|
margin-bottom: 5px;
|
|
241
241
|
}
|
|
242
242
|
display: flex;
|
|
243
|
-
`,
|
|
243
|
+
`,xi=fo.default.span`
|
|
244
244
|
font-weight: 400;
|
|
245
245
|
font-size: 14px;
|
|
246
246
|
line-height: 22px;
|
|
@@ -248,16 +248,16 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
248
248
|
display: flex;
|
|
249
249
|
margin-right: 5px;
|
|
250
250
|
margin-top: 10px;
|
|
251
|
-
`,
|
|
251
|
+
`,Mo=fo.default.div`
|
|
252
252
|
display: flex;
|
|
253
253
|
align-items: flex-start;
|
|
254
254
|
justify-content: left;
|
|
255
255
|
margin-bottom: 10px;
|
|
256
|
-
`;var
|
|
256
|
+
`;var Uo=m(require("react"));var Ze={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#C7C7C7",colorBorder:"#E5E5E5",colorTextError:"#c00000",borderRadius:20}};function mt({title:e,required:t,appearance:o=Ze}){return e?Uo.default.createElement(Mo,null,t?Uo.default.createElement(xi,{className:l("formLabelRequired",o),appearance:o},"*"):null,Uo.default.createElement(gi,{className:l("formLabel",o)},e)):null}var ur=m(require("react"));function Vt({title:e,appearance:t}){return e?ur.default.createElement(Mo,null,ur.default.createElement(hi,{className:l("formSubLabel",t)},e)):null}var zo=require("zod");function Ci(e,t){try{if(t){if(t.type=="number"){let o=zo.z.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=zo.z.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof zo.z.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var fa=_o.default.div`
|
|
257
257
|
display: flex;
|
|
258
258
|
flex-direction: column;
|
|
259
259
|
width: 100%;
|
|
260
|
-
`,
|
|
260
|
+
`,fr=_o.default.input`
|
|
261
261
|
${e=>P(e)} {
|
|
262
262
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
263
263
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -273,7 +273,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
273
273
|
box-sizing: border-box;
|
|
274
274
|
padding: 0 10px;
|
|
275
275
|
margin-bottom: 10px;
|
|
276
|
-
`,
|
|
276
|
+
`,ga=_o.default.textarea`
|
|
277
277
|
${e=>P(e)} {
|
|
278
278
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
279
279
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -289,13 +289,13 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
289
289
|
min-height: 70px;
|
|
290
290
|
box-sizing: border-box;
|
|
291
291
|
margin-bottom: 10px;
|
|
292
|
-
`;function
|
|
292
|
+
`;function Wo({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=(0,Re.useState)((r==null?void 0:r.text)||""),[d,a]=(0,Re.useState)(!1),C=fr;(0,Re.useEffect)(()=>{s===""&&!d&&(a(!0),c(""))},[]);function c(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let F=Ci(S,n.validation);if(F){i([{id:n.id,message:F}]);return}i([])}n.multiline&&(C=ga);function g(){var S;switch((S=n==null?void 0:n.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Re.default.createElement(fa,null,Re.default.createElement(mt,{title:n.title,required:n.required,appearance:t.appearance}),Re.default.createElement(C,{className:l("inputComponent",t.appearance),value:s,onChange:S=>{c(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:g()}),Re.default.createElement(Vt,{title:n.subtitle,appearance:t.appearance}))}var Fe=m(require("react")),hr=m(require("styled-components"));var gr="",ha=hr.default.div`
|
|
293
293
|
display: flex;
|
|
294
294
|
flex-direction: column;
|
|
295
295
|
width: 100%;
|
|
296
296
|
-webkit-appearance: none;
|
|
297
297
|
appearance: none;
|
|
298
|
-
`,
|
|
298
|
+
`,xa=hr.default.select`
|
|
299
299
|
${e=>P(e)} {
|
|
300
300
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
301
301
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -316,15 +316,15 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
316
316
|
background-repeat: no-repeat;
|
|
317
317
|
background-size: 1.5em 1.5em;
|
|
318
318
|
-webkit-print-color-adjust: exact;
|
|
319
|
-
`;function
|
|
320
|
-
${e=>
|
|
321
|
-
`,
|
|
319
|
+
`;function yi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var C,c,g,S,F,v;let n=e,[s,p]=(0,Fe.useState)(((C=i==null?void 0:i.choice)==null?void 0:C[0])||""),[d,a]=(0,Fe.useState)(!1);return(0,Fe.useEffect)(()=>{var h,B,x,k;if(s===""&&!d){if(a(!0),n.requireSelection){p(gr);return}if(n.defaultValue&&((h=n.props.options)!=null&&h.find(L=>L.id===n.defaultValue))){let L=(B=n.props.options)==null?void 0:B.find(b=>b.id===n.defaultValue);p(L.id),o({choice:[L.id]})}else p(((x=n.props.options)==null?void 0:x[0].id)||""),o({choice:[((k=n.props.options)==null?void 0:k[0].id)||""]})}},[]),(0,Fe.useEffect)(()=>{n.requireSelection&&s===gr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),Fe.default.createElement(ha,null,Fe.default.createElement(mt,{title:n.title,required:!1,appearance:t.appearance}),Fe.default.createElement(xa,{value:s,onChange:h=>{p(h.target.value),o({choice:[h.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},n.requireSelection&&Fe.default.createElement("option",{key:"null-value",value:gr,disabled:!0},n.placeholder??"Select an option"),(c=n.props.options)==null?void 0:c.map(h=>Fe.default.createElement("option",{key:h.id,value:h.id},h.title))),((S=(g=n.props.options)==null?void 0:g.find(h=>h.id===s))==null?void 0:S.isOpenEnded)&&Fe.default.createElement(Fe.default.Fragment,null,Fe.default.createElement(mt,{title:((v=(F=n.props.options)==null?void 0:F.find(h=>h.id===s))==null?void 0:v.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Fe.default.createElement(fr,{type:"text",placeholder:"Enter your answer here",onChange:h=>{o({choice:[h.target.value]})},appearance:t.appearance})),Fe.default.createElement(Vt,{title:n.subtitle,appearance:t.appearance}))}var Me=m(require("react")),xr=m(require("styled-components"));var Gt=m(require("react"));var jt=m(require("react")),bi=require("framer-motion"),Si=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:r,transition:s},show:{strokeDashoffset:n,transition:s}};return jt.default.createElement(bi.motion.circle,{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Ca=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>jt.default.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},jt.default.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},jt.default.createElement(Si,{color:r,size:t}),jt.default.createElement(Si,{color:e,percentage:o,size:t})),i),Et=Ca;var wi=m(require("styled-components")),ya=({color:e="#FFFFFF"})=>Gt.default.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gt.default.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Sa={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ba={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},wa={border:"1px solid #000000",color:"#FFFFFF"},Ta={border:"1px solid #E6E6E6"},Fa={color:"#FFFFFF"},ka={border:"3px solid #D9D9D9"},Pa=e=>e==="square"?Sa:ba,va=(e,t)=>e==="square"?t?wa:Ta:t?Fa:ka,Ba=wi.default.div`
|
|
320
|
+
${e=>dt(e)}
|
|
321
|
+
`,et=({value:e,type:t="square",primaryColor:o="#000000",progress:i,appearance:r=Ze,style:n,className:s})=>{let p=Pa(t),d=va(t,e);return e===!0?p={...p,...d,backgroundColor:o,borderColor:t==="square"?o:"none"}:p={...p,...d},e!==!0&&t==="round"&&i!==void 0&&i!==1?Gt.default.createElement(Et,{fillColor:o,percentage:i,size:22}):Gt.default.createElement(Ba,{styleOverrides:p,style:n,role:"checkbox",className:Ee(l("checkIconContainer",r),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Gt.default.createElement(ya,{color:"#FFFFFF"}))};var Ea=xr.default.div`
|
|
322
322
|
display: flex;
|
|
323
323
|
flex-direction: column;
|
|
324
324
|
width: 100%;
|
|
325
325
|
-webkit-appearance: none;
|
|
326
326
|
appearance: none;
|
|
327
|
-
`,
|
|
327
|
+
`,Aa=xr.default.button`
|
|
328
328
|
${e=>P(e)} {
|
|
329
329
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
330
330
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -349,7 +349,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
349
349
|
height: 60px;
|
|
350
350
|
padding: 0 18px;
|
|
351
351
|
margin-bottom: 10px;
|
|
352
|
-
`;function
|
|
352
|
+
`;function Ti({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var C;let n=e,[s,p]=(0,Me.useState)((i==null?void 0:i.choice)||[]),[d,a]=(0,Me.useState)(!1);return(0,Me.useEffect)(()=>{s.length==0&&!d&&(a(!0),o({choice:[]}))},[]),(0,Me.useEffect)(()=>{o({choice:s})},[s]),(0,Me.useEffect)(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),Me.default.createElement(Ea,null,Me.default.createElement(mt,{title:n.title,required:n.required,appearance:t.appearance}),(C=n.props.options)==null?void 0:C.map(c=>Me.default.createElement(Aa,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(g=>g!==c.id));return}s.length<n.props.maxChoices?p([...s,c.id]):s.length==1&&n.props.maxChoices==1&&p([c.id])}},c.title,Me.default.createElement(et,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),Me.default.createElement(Vt,{title:n.subtitle,appearance:t.appearance}))}var go=m(require("react"));var Cr=m(require("styled-components"));var Fi=m(require("dompurify"));function be(e){return{__html:Fi.default.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Ia=Cr.default.h1`
|
|
353
353
|
${e=>P(e)} {
|
|
354
354
|
font-style: normal;
|
|
355
355
|
font-weight: 600;
|
|
@@ -360,7 +360,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
360
360
|
margin-bottom: 4px;
|
|
361
361
|
color: ${e=>e.appearance.theme.colorText};
|
|
362
362
|
}
|
|
363
|
-
`,
|
|
363
|
+
`,Na=Cr.default.h2`
|
|
364
364
|
${e=>P(e)} {
|
|
365
365
|
font-style: normal;
|
|
366
366
|
font-weight: 400;
|
|
@@ -368,40 +368,40 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
368
368
|
line-height: 20px;
|
|
369
369
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
370
370
|
}
|
|
371
|
-
`;function
|
|
371
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return go.default.createElement(go.default.Fragment,null,go.default.createElement(Ia,{appearance:e,className:l(`${r}${r?co(i):i}Title`,e),dangerouslySetInnerHTML:be(t),size:i}),o&&go.default.createElement(Na,{appearance:e,className:l(`${r}${r?co(i):i}Subtitle`,e),dangerouslySetInnerHTML:be(o),size:i}))}var yr=m(require("react")),ki=e=>yr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},yr.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 Ho=require("framer-motion");var La=ho.default.div`
|
|
372
372
|
display: flex;
|
|
373
373
|
flex-direction: column;
|
|
374
374
|
justify-content: flex-end;
|
|
375
375
|
padding-bottom: 14px;
|
|
376
376
|
overflow: visible;
|
|
377
|
-
`,
|
|
377
|
+
`,Oa=(0,ho.default)(Ho.motion.div)`
|
|
378
378
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
379
379
|
font-size: 12px;
|
|
380
380
|
margin-bottom: 12px;
|
|
381
381
|
display: flex;
|
|
382
382
|
align-items: center;
|
|
383
|
-
`,
|
|
383
|
+
`,Da=ho.default.div`
|
|
384
384
|
margin-right: 4px;
|
|
385
385
|
display: inline-flex;
|
|
386
|
-
|
|
386
|
+
`,$a=ho.default.div`
|
|
387
387
|
padding-left: 1px;
|
|
388
388
|
padding-right: 1px;
|
|
389
|
-
`,
|
|
389
|
+
`,Ma={text:Wo,multipleChoice:yi,multipleChoiceList:Ti};function Pi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s}){var L;let p=t.props,[d,a]=(0,ke.useState)([]),[C,c]=(0,ke.useState)([]),{userId:g}=Ht(),[S,F]=(0,ke.useState)(x()||{}),{readonly:v}=(0,ke.useContext)(Y),h={...Ma,...s};(0,ke.useEffect)(()=>{i(d.length===0)},[d,i]);function B(b,u){let T={...S,[b.id]:u};F(T),r(T),window&&window.localStorage&&!v&&window.localStorage.setItem(k(),JSON.stringify(T))}function x(){if(window&&window.localStorage){let b=window.localStorage.getItem(k());if(b)return JSON.parse(b)}return{}}function k(){return`frigade-multiInputStepTypeData-${e}-${t.id}-${g}`}return ke.default.createElement($a,{className:l("multiInput",n)},ke.default.createElement(Ae,{appearance:n,title:t.title,subtitle:t.subtitle}),ke.default.createElement(La,{className:l("multiInputContainer",n)},(L=p.data)==null?void 0:L.map(b=>{var T;let u=(T=d.reverse().find(y=>y.id===b.id))==null?void 0:T.message;return h[b.type]?ke.default.createElement("span",{key:b.id,"data-field-id":b.id,className:l("multiInputField",n)},h[b.type]({formInput:b,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:y=>{!C.includes(b.id)&&y&&(y==null?void 0:y.text)!==""&&c(E=>[...E,b.id]),B(b,y)},inputData:S[b.id],setFormValidationErrors:y=>{a(E=>y.length===0?E.filter($=>$.id!==b.id):[...E,...y])}}),ke.default.createElement(Ho.AnimatePresence,null,u&&C.includes(b.id)&&ke.default.createElement(Oa,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:b.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:l("multiInputValidationError",n)},ke.default.createElement(Da,{appearance:n,className:l("multiInputValidationErrorIcon",n)},ke.default.createElement(ki,null)),u))):null})))}var Ct=m(require("styled-components")),vi=Ct.default.div`
|
|
390
390
|
align-items: center;
|
|
391
391
|
display: flex;
|
|
392
392
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
393
393
|
padding-top: 14px;
|
|
394
|
-
`,
|
|
394
|
+
`,Bi=Ct.default.div`
|
|
395
395
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
396
396
|
font-size: 12px;
|
|
397
|
-
`,
|
|
397
|
+
`,Ei=Ct.default.div`
|
|
398
398
|
display: flex;
|
|
399
399
|
gap: 12px;
|
|
400
|
-
`,
|
|
400
|
+
`,Ai=Ct.default.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: row;
|
|
403
403
|
flex: 1 1;
|
|
404
|
-
`,
|
|
404
|
+
`,Ii=Ct.default.div`
|
|
405
405
|
display: flex;
|
|
406
406
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
407
407
|
// Otherwise, use 4px padding
|
|
@@ -409,11 +409,11 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
409
409
|
flex-grow: 1;
|
|
410
410
|
flex-basis: 0;
|
|
411
411
|
position: relative;
|
|
412
|
-
`,
|
|
412
|
+
`,Ni=Ct.default.div`
|
|
413
413
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
414
414
|
position: relative;
|
|
415
415
|
overflow-y: auto;
|
|
416
|
-
`,
|
|
416
|
+
`,Li=Ct.default.div`
|
|
417
417
|
display: flex;
|
|
418
418
|
align-self: stretch;
|
|
419
419
|
flex-grow: 1;
|
|
@@ -425,7 +425,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
425
425
|
background-position: center;
|
|
426
426
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
427
427
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
428
|
-
`;var
|
|
428
|
+
`;var ut=m(require("react"));var Oi=m(require("react")),Sr=m(require("styled-components"));var Ua=Sr.default.button`
|
|
429
429
|
justify-content: center;
|
|
430
430
|
align-content: center;
|
|
431
431
|
${e=>P(e)} {
|
|
@@ -443,7 +443,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
443
443
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
444
444
|
line-height: 20px;
|
|
445
445
|
font-weight: 500;
|
|
446
|
-
${e=>
|
|
446
|
+
${e=>dt(e)}
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
font-family: inherit;
|
|
@@ -456,7 +456,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
456
456
|
opacity: 0.3;
|
|
457
457
|
cursor: not-allowed;
|
|
458
458
|
}
|
|
459
|
-
`,
|
|
459
|
+
`,Vo=Sr.default.div`
|
|
460
460
|
${e=>P(e)} {
|
|
461
461
|
display: flex;
|
|
462
462
|
flex-direction: row;
|
|
@@ -466,14 +466,14 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
466
466
|
margin-right: 8px;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
`,ce=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function C(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${
|
|
469
|
+
`,ce=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function C(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${co(c)}`}return Oi.default.createElement(Ua,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:d,size:n,className:l(C(),p)},t)};var Di=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,formType:n,selectedStep:s,steps:p,onBack:d,allowBackNavigation:a,errorMessage:C})=>{let c=n==="inline"?"inline":"full-width",g=p.length>1&&s!=0&&a;return ut.default.createElement(ut.default.Fragment,null,C&&ut.default.createElement(Bi,{appearance:o,className:l("formCTAError",o)},C),ut.default.createElement(vi,{showBackButton:g,className:l("formCTAContainer",o)},g&&ut.default.createElement(ce,{title:e.backButtonTitle??"\u2190",onClick:d,secondary:!0,withMargin:!1,type:c,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),ut.default.createElement(Ei,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?ut.default.createElement(ce,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:c,appearance:o}):null," ",e.primaryButtonTitle?ut.default.createElement(ce,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:c,appearance:o}):null)))};var jo=m(require("react")),$i=m(require("styled-components"));var za=$i.default.div`
|
|
470
470
|
text-align: center;
|
|
471
|
-
`,
|
|
471
|
+
`,Mi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=le().mergeAppearanceWithDefault(i);return jo.default.createElement(za,{className:o},jo.default.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>jo.default.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};var yt=m(require("react")),At=m(require("styled-components"));var Ui=require("react");function fe(){let e=(0,Ui.useContext)(Y);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var _a=At.default.div`
|
|
472
472
|
display: flex;
|
|
473
473
|
flex-wrap: wrap;
|
|
474
474
|
align-content: center;
|
|
475
475
|
justify-content: center;
|
|
476
|
-
`,
|
|
476
|
+
`,Wa=At.default.div`
|
|
477
477
|
align-content: center;
|
|
478
478
|
align-items: center;
|
|
479
479
|
display: flex;
|
|
@@ -487,10 +487,10 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
487
487
|
flex-basis: 255px;
|
|
488
488
|
flex-grow: 0;
|
|
489
489
|
flex-shrink: 0;
|
|
490
|
-
`,
|
|
490
|
+
`,Ha=At.default.img`
|
|
491
491
|
width: 78px;
|
|
492
492
|
height: auto;
|
|
493
|
-
`,
|
|
493
|
+
`,Va=At.default.button`
|
|
494
494
|
font-style: normal;
|
|
495
495
|
font-weight: 600;
|
|
496
496
|
font-size: 13px;
|
|
@@ -503,11 +503,11 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
503
503
|
border-radius: 100px;
|
|
504
504
|
padding: 8px 12px;
|
|
505
505
|
margin-top: 16px;
|
|
506
|
-
`,
|
|
506
|
+
`,ja=At.default.h1`
|
|
507
507
|
font-weight: 700;
|
|
508
508
|
font-size: 28px;
|
|
509
509
|
line-height: 34px;
|
|
510
|
-
`,
|
|
510
|
+
`,Ga=At.default.h2`
|
|
511
511
|
font-style: normal;
|
|
512
512
|
font-weight: 400;
|
|
513
513
|
font-size: 16px;
|
|
@@ -516,7 +516,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
516
516
|
margin-top: 12px;
|
|
517
517
|
margin-bottom: 16px;
|
|
518
518
|
max-width: 70%;
|
|
519
|
-
`;function
|
|
519
|
+
`;function zi({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=fe();return yt.default.createElement("div",null,yt.default.createElement(ja,null,e.title),yt.default.createElement(Ga,null,e.subtitle),yt.default.createElement(_a,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>yt.default.createElement(Wa,{key:n.title},yt.default.createElement(Ha,{src:n.imageUri}),yt.default.createElement(Va,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}var ft=m(require("react")),Co=m(require("styled-components"));var Go=m(require("react")),qo=({style:e,className:t})=>Go.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},Go.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Go.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));var tt=m(require("react")),xo=m(require("styled-components")),qa=xo.default.div`
|
|
520
520
|
display: flex;
|
|
521
521
|
align-items: center;
|
|
522
522
|
justify-content: flex-start;
|
|
@@ -524,7 +524,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
524
524
|
width: 100%;
|
|
525
525
|
height: 100%;
|
|
526
526
|
position: relative;
|
|
527
|
-
`,
|
|
527
|
+
`,Ka=xo.default.div`
|
|
528
528
|
position: absolute;
|
|
529
529
|
display: flex;
|
|
530
530
|
align-items: center;
|
|
@@ -543,57 +543,57 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
543
543
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
544
544
|
border-radius: 50%;
|
|
545
545
|
}
|
|
546
|
-
`,
|
|
546
|
+
`,Ya=xo.default.video`
|
|
547
547
|
width: 100%;
|
|
548
548
|
height: 100%;
|
|
549
549
|
min-height: 200px;
|
|
550
550
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
551
|
-
`,
|
|
551
|
+
`,Xa=xo.default.iframe`
|
|
552
552
|
width: 100%;
|
|
553
553
|
height: 100%;
|
|
554
554
|
min-height: 200px;
|
|
555
555
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
556
|
-
`;function
|
|
556
|
+
`;function qt({appearance:e,videoUri:t}){let o=(0,tt.useRef)(),[i,r]=(0,tt.useState)(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),tt.default.createElement(Xa,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return tt.default.createElement(qa,{appearance:e},!i&&tt.default.createElement(Ka,{onClick:()=>{r(!0),o.current.play()},appearance:e},tt.default.createElement(qo,null)),tt.default.createElement(Ya,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Ja=Co.default.div`
|
|
557
557
|
${e=>P(e)} {
|
|
558
558
|
display: flex;
|
|
559
559
|
flex-direction: column;
|
|
560
560
|
justify-content: center;
|
|
561
561
|
}
|
|
562
|
-
`,
|
|
562
|
+
`,Qa=Co.default.img`
|
|
563
563
|
${e=>P(e)} {
|
|
564
564
|
width: 100%;
|
|
565
565
|
height: auto;
|
|
566
566
|
max-height: 250px;
|
|
567
567
|
margin-bottom: 24px;
|
|
568
568
|
}
|
|
569
|
-
`,
|
|
569
|
+
`,Za=Co.default.div`
|
|
570
570
|
${e=>P(e)} {
|
|
571
571
|
margin-bottom: 24px;
|
|
572
572
|
}
|
|
573
|
-
`,
|
|
573
|
+
`,Ra=Co.default.div`
|
|
574
574
|
${e=>P(e)} {
|
|
575
575
|
width: 100%;
|
|
576
576
|
height: auto;
|
|
577
577
|
max-height: 250px;
|
|
578
578
|
margin-bottom: 24px;
|
|
579
579
|
}
|
|
580
|
-
`;function
|
|
580
|
+
`;function _i({stepData:e,appearance:t,setCanContinue:o}){return(0,ft.useEffect)(()=>{o(!0)},[]),ft.default.createElement(Ja,{className:l("callToActionContainer",t)},ft.default.createElement(Za,{className:l("callToActionTextContainer",t)},ft.default.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&ft.default.createElement(Qa,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&ft.default.createElement(Ra,{appearance:t,className:l("callToActionVideo",t)},ft.default.createElement(qt,{appearance:t,videoUri:e.videoUri})))}var we=m(require("react"));var gt=m(require("styled-components")),Wi=gt.default.div`
|
|
581
581
|
width: auto;
|
|
582
582
|
display: flex;
|
|
583
583
|
flex-direction: column;
|
|
584
584
|
justify-content: center;
|
|
585
585
|
align-items: center;
|
|
586
586
|
padding: 4px;
|
|
587
|
-
`,
|
|
587
|
+
`,Hi=gt.default.div`
|
|
588
588
|
width: 100%;
|
|
589
589
|
text-align: left;
|
|
590
|
-
`,
|
|
590
|
+
`,Vi=gt.default.h1`
|
|
591
591
|
font-style: normal;
|
|
592
592
|
font-weight: 700;
|
|
593
593
|
font-size: 32px;
|
|
594
594
|
line-height: 38px;
|
|
595
595
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
596
|
-
`,
|
|
596
|
+
`,ji=gt.default.h1`
|
|
597
597
|
font-style: normal;
|
|
598
598
|
font-weight: 400;
|
|
599
599
|
font-size: 16px;
|
|
@@ -601,7 +601,7 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
601
601
|
margin-top: 16px;
|
|
602
602
|
margin-bottom: 16px;
|
|
603
603
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
604
|
-
`,
|
|
604
|
+
`,Gi=gt.default.div`
|
|
605
605
|
padding-top: 12px;
|
|
606
606
|
padding-bottom: 12px;
|
|
607
607
|
flex-direction: row;
|
|
@@ -612,17 +612,17 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
612
612
|
cursor: pointer;
|
|
613
613
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
614
614
|
width: 100%;
|
|
615
|
-
`,
|
|
615
|
+
`,qi=gt.default.div`
|
|
616
616
|
padding-top: 10px;
|
|
617
617
|
padding-bottom: 10px;
|
|
618
618
|
flex-direction: row;
|
|
619
619
|
display: flex;
|
|
620
620
|
justify-content: flex-start;
|
|
621
|
-
`,
|
|
621
|
+
`,Ki=gt.default.img`
|
|
622
622
|
width: 42px;
|
|
623
623
|
height: 42px;
|
|
624
624
|
margin-right: 12px;
|
|
625
|
-
`,
|
|
625
|
+
`,Yi=gt.default.p`
|
|
626
626
|
font-style: normal;
|
|
627
627
|
font-weight: 500;
|
|
628
628
|
font-size: 17px;
|
|
@@ -630,8 +630,8 @@ var bl=Object.create;var Fo=Object.defineProperty;var wl=Object.getOwnPropertyDe
|
|
|
630
630
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
631
631
|
display: flex;
|
|
632
632
|
align-self: center;
|
|
633
|
-
`;var
|
|
634
|
-
${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map(([s,p])=>`${er(s)}: ${p};`).join(" ")} }`).join(" ")}`;return qt.default.createElement(o,{inlineStyles:t})}var dr=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:C,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:F="center",repeatable:v=!1,onDismiss:h,showPagination:E=!1,allowBackNavigation:x=!1,validationHandler:k,showFrigadeBranding:L=!1})=>{let{getFlow:b,getFlowSteps:m,isLoading:T,targetingLogicShouldHideFlow:S,getFlowStatus:B,getCurrentStepIndex:$,markFlowCompleted:_,markFlowNotStarted:O}=R(),D=$(e),{mergeAppearanceWithDefault:G}=le(),[U,re]=(0,Ae.useState)(!1),{setOpenFlowState:ie,getOpenFlowState:Z,hasOpenModals:q}=Ie();d=G(d);let[Pe,ae]=i!==void 0&&r!==void 0?[i,r]:[Z(e,!0),Q=>ie(e,Q)];if((0,Ae.useEffect)(()=>{!U&&!T&&(re(!0),B(e)===se&&v&&O(e),re(!0))},[U,re,T]),T)return null;let X=b(e);if(!X||S(X))return null;let ve=m(e);if(!ve||i!==void 0&&i===!1||B(e)===se&&a||(o=="modal"||o=="corner-modal")&&q(e))return null;let Oe=()=>{ae(!1),h&&h(),y===!0&&_(e)};if(F=="center"&&o==="modal"||o==="large-modal"){let Q={padding:"24px"};return o==="large-modal"?(Q.width="85%",Q.height="90%",Q.maxHeight="800px",Q.minHeight="500px",Q.padding="0"):Q.width="400px",Ae.default.createElement(ht,{appearance:d,onClose:Oe,visible:Pe,style:Q,dismissible:g,showFrigadeBranding:L},Ae.default.createElement(me,{appearance:d}),Ae.default.createElement(Vo,{appearance:d,steps:ve,selectedStep:D,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:C,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ae,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:x,validationHandler:k}))}return o==="modal"&&F!=="center"?Ae.default.createElement(ei,{appearance:d,onClose:Oe,visible:Pe},Ae.default.createElement(me,{appearance:d}),Ae.default.createElement(Vo,{appearance:d,steps:ve,selectedStep:D,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:C,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ae,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:x,validationHandler:k})):Ae.default.createElement(Ae.default.Fragment,null,Ae.default.createElement(me,{appearance:d}),Ae.default.createElement(Vo,{appearance:d,steps:ve,selectedStep:D,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:C,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ae,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:x,validationHandler:k}))},Ui=dr;var At=require("react");function jo(){let{organizationId:e,userId:t,setOrganizationId:o}=(0,At.useContext)(Y),{mutateUserFlowState:i}=ze(),{config:r,apiUrl:n}=Xe(),s=$t(),{verifySDKInitiated:p}=Mt();(0,At.useEffect)(()=>{if(t&&e){if(t.startsWith(zt))return;let C=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(C)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(C,"true"))}},[t,e]);let d=(0,At.useCallback)(async C=>{if(p(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let c={foreignUserId:t,foreignUserGroupId:e,properties:C};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(c)}),i()},[e,t,r,i]),a=(0,At.useCallback)(async(C,c)=>{if(p(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,events:[{event:C,properties:c}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(y)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:d,trackEventForOrganization:a}}var _i="frigade-xFrigade_guestUserId",ho="frigade-xFrigade_userId",Wi=({})=>{let{setFlowResponses:e}=_t(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=ze(),{userId:r,setUserId:n}=Wt(),[s,p]=(0,xe.useState)(null),{getFlowStatus:d}=R(),{flows:a,userProperties:C,setIsNewGuestUser:c,flowResponses:g}=(0,xe.useContext)(Y),[y,F]=(0,xe.useState)([]),[v,h]=(0,xe.useState)([]),{organizationId:E}=jo();(0,xe.useEffect)(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let m=t[b],T=a.find(S=>S.slug===(m==null?void 0:m.flowId));if(T&&m&&m.shouldTrigger===!0&&T.type=="FORM"&&T.triggerType==="AUTOMATIC"&&!v.includes(T.slug)){setTimeout(()=>{x(m.flowId)},500);break}}},[o,t]),(0,xe.useEffect)(()=>{g.length>0&&i()},[g]);function x(b){let m=a.find(T=>T.slug===b);m&&m.triggerType==="AUTOMATIC"&&!v.includes(m.slug)&&(h([...v,m.slug]),F([m]))}function k(){if(!r){let b=localStorage.getItem(ho);if(b){n(b);return}let m=localStorage.getItem(_i);if(m){n(m);return}c(!0);let T=zt+(0,zi.v4)();try{localStorage.setItem(_i,T)}catch(S){console.log("Failed to save guest user id locally: Local storage unavailable",S)}n(S=>S||T)}}(0,xe.useEffect)(()=>{try{if(a){let b=[];a.forEach(m=>{if(m.data){let T=m.data.match(/"imageUri":"(.*?)"/g);T&&T.forEach(S=>{let B=S.replace('"imageUri":"',"").replace('"',"");if(b.includes(B))return;let $=new Image;$.src=B,b.push(B)})}})}}catch{}},[a]),(0,xe.useEffect)(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(zt))try{localStorage.setItem(ho,r)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}r===null&&setTimeout(()=>{r===null&&k()},50)},[r,a,C]);function L(){return xe.default.createElement(xe.default.Fragment,null,y.map(b=>d(b.slug)!==He?null:xe.default.createElement("span",{key:b.slug},xe.default.createElement(Ui,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return xe.default.createElement(xe.default.Fragment,null,xe.default.createElement(L,null))};var Vi=require("react-error-boundary"),ji="https://api.frigade.com",Y=(0,J.createContext)({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Qe,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:ji,readonly:!1});function Ia(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Gi=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var ie,Z;let[n,s]=(0,J.useState)(t||null),[p,d]=(0,J.useState)(o||null),[a,C]=(0,J.useState)([]),[c,g]=(0,J.useState)([]),[y,F]=(0,J.useState)([]),[v,h]=(0,J.useState)({}),[E,x]=(0,J.useState)({}),[k,L]=(0,J.useState)([]),[b,m]=(0,J.useState)({}),[T,S]=(0,J.useState)(!1),[B,$]=(0,J.useState)(!1),[_,O]=(0,J.useState)(!U(e)),D=(q,Pe)=>{if(Pe==="_blank"){window.open(q,"_blank");return}setTimeout(()=>{window.location.href=q},50)},G={theme:{...Qe.theme,...((ie=i==null?void 0:i.defaultAppearance)==null?void 0:ie.theme)??{}},styleOverrides:{...Qe.styleOverrides,...((Z=i==null?void 0:i.defaultAppearance)==null?void 0:Z.styleOverrides)??{}}};function U(q){return!!(q&&q.length>10&&q.substring(0,10)==="api_public")}(0,J.useEffect)(()=>{t&&s(t)},[t]),(0,J.useEffect)(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(ho)&&window.localStorage.getItem(ho)!==n&&Ia()},[n]),(0,J.useEffect)(()=>{o&&d(o)},[o]),(0,J.useEffect)(()=>{if(U(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let re={publicApiKey:e,userId:n,setUserId:s,setFlows:C,flows:a,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:F,userProperties:v,setUserProperties:h,openFlowStates:E,setOpenFlowStates:x,completedFlowsToKeepOpenDuringSession:k,setCompletedFlowsToKeepOpenDuringSession:L,customVariables:b,setCustomVariables:m,isNewGuestUser:T,setIsNewGuestUser:S,hasActiveFullPageFlow:B,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:D,defaultAppearance:G,shouldGracefullyDegrade:_,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:ji,readonly:i&&i.readonly?i.readonly:!1};return _?J.default.createElement(Y.Provider,{value:re},r):J.default.createElement(Vi.ErrorBoundary,{fallback:J.default.createElement(J.default.Fragment,null,r)},J.default.createElement(Y.Provider,{value:re},J.default.createElement(Hi.ThemeProvider,{theme:G.theme},r,J.default.createElement(Wi,null))))};var Ts=u(require("react"));var oe=u(require("react"));var Le=u(require("react")),bt=u(require("styled-components"));var xo=u(require("react"));var St=u(require("react")),cr=u(require("styled-components"));var qi=cr.default.span`
|
|
633
|
+
`;var Xi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=(0,we.useState)([]),[p,d]=(0,we.useState)(!1),[a,C]=(0,we.useState)(e.id);return(0,we.useEffect)(()=>{n.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),(0,we.useEffect)(()=>{a!==e.id&&(C(e.id),s([]))},[e]),(0,we.useEffect)(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),we.default.createElement(Wi,{className:l("selectListContainer",i)},we.default.createElement(Hi,null,we.default.createElement(Vi,{className:l("selectListTitle",i)},e.title),we.default.createElement(ji,{appearance:i,className:l("selectListSubtitle",i)},e.subtitle)),r.options.map((c,g)=>{let S=n.includes(c.id);return we.default.createElement(Gi,{key:`select-item-${g}`,onClick:()=>{if(n.includes(c.id)){s(n.filter(F=>F!==c.id));return}n.length<r.maxChoices?s([...n,c.id]):n.length==1&&r.maxChoices==1&&s([c.id])},hideBottomBorder:g===r.options.length-1,className:l("selectListSelectItem",i)},we.default.createElement(qi,{className:l("selectListItemImage",i)},c.imageUri&&we.default.createElement(Ki,{src:c.imageUri,alt:`select-icon-${g}`}),we.default.createElement(Yi,{appearance:i,className:l("selectListSelectItemText",i)},c.title)),we.default.createElement(et,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};var ee=m(require("react"));var Ko=require("framer-motion"),ep=({children:e,id:t,shouldWrap:o=!1})=>ee.default.createElement(ee.default.Fragment,null,o?ee.default.createElement(Ko.AnimatePresence,{initial:!1},ee.default.createElement(Ko.motion.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),Yo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:C,setVisible:c,setShowModal:g,onDismiss:S,showPagination:F=!1,customFormElements:v,allowBackNavigation:h,validationHandler:B})=>{var W;let k={...{linkCollection:zi,multiInput:Pi,callToAction:_i,selectList:Xi},...i},{primaryCTAClickSideEffects:L,secondaryCTAClickSideEffects:b}=fe(),[u,T]=(0,ee.useState)(!1),[y,E]=(0,ee.useState)({}),[$,z]=(0,ee.useState)(!1),[O,D]=(0,ee.useState)(!1),[G,U]=(0,ee.useState)(null),re=t[o]??null,{markStepCompleted:ie,markStepStarted:Z,isLoading:q,updateCustomVariables:Pe,markFlowCompleted:ae}=R();(0,ee.useEffect)(()=>{Pe(r)},[r,q]),(0,ee.useEffect)(()=>{window&&h&&!O&&(window.location.hash=t[o].id,D(!0))},[h,O,D]),(0,ee.useEffect)(()=>{var M;if(window&&((M=window==null?void 0:window.location)!=null&&M.hash)&&window.location.hash.replace("#","")!==t[o].id){let pe=window.location.hash.replace("#",""),K=t.findIndex(de=>de.id===pe);K!==-1&&Z(p,t[K].id)}},[(W=window==null?void 0:window.location)==null?void 0:W.hash,Z,o,t]);function J(){return{data:y[t[o].id]??{},stepId:t[o].id,customVariables:r}}function ve(M,pe,K){let de=o+1<t.length?t[o+1]:null;return s&&s(M,K,de,y,J()),n?n(M,o,pe,de):!0}function De(M,pe){E(K=>{let de={};return de[M.id]=pe,{...K,...de}})}function Q(M){return M.selectedStep.imageUri?ee.default.createElement(Li,{image:M.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let he=ee.default.createElement(Di,{step:t[o],canContinue:u&&!$,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(z(!0),B){let K=await B(t[o],o,t[o+1],y,J());if(K){U(K),z(!1);return}else U(null)}let M={...J()};await ie(p,t[o].id,M),o+1<t.length&&await Z(p,t[o+1].id);let pe=ve(t[o],"primary",o);o+1>=t.length&&(C&&C(),S&&S(),a&&pe&&(c&&c(!1),g(!1)),await ae(p)),L(t[o]),z(!1),window&&h&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{ve(t[o],"secondary",o),b(t[o])},onBack:async()=>{o-1>=0&&(z(!0),await Z(p,t[o-1].id),z(!1))},steps:t,allowBackNavigation:h,errorMessage:G});return ee.default.createElement(ee.default.Fragment,null,ee.default.createElement(Ai,{className:l("formContainer",e)},ee.default.createElement(Ii,null,ee.default.createElement(ep,{id:o,shouldWrap:d==="large-modal"},ee.default.createElement(Ni,{key:re.id,type:d,className:l("formContent",e)},t.map(M=>{let pe=k[M.type];return re.id!==M.id?null:ee.default.createElement(pe,{key:M.id,stepData:M,canContinue:u,setCanContinue:T,onSaveData:K=>{De(M,K)},appearance:e,customFormElements:v,flowId:p})}),F&&ee.default.createElement(Mi,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),he))),d=="large-modal"&&ee.default.createElement(Q,{selectedStep:t[o]})))};var Kt=m(require("react")),Ji=require("styled-components");function me({appearance:e}){if(!e||!e.styleOverrides)return Kt.default.createElement(Kt.default.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return Kt.default.createElement(Kt.default.Fragment,null);let o=Ji.createGlobalStyle`
|
|
634
|
+
${i=>i.inlineStyles.map(([r,n])=>`.${po}${r}.${po}${r} { ${Object.entries(n).map(([s,p])=>`${cr(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Kt.default.createElement(o,{inlineStyles:t})}var br=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:C,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:S=!1,modalPosition:F="center",repeatable:v=!1,onDismiss:h,showPagination:B=!1,allowBackNavigation:x=!1,validationHandler:k,showFrigadeBranding:L=!1})=>{let{getFlow:b,getFlowSteps:u,isLoading:T,targetingLogicShouldHideFlow:y,getFlowStatus:E,getCurrentStepIndex:$,markFlowCompleted:z,markFlowNotStarted:O}=R(),D=$(e),{mergeAppearanceWithDefault:G}=le(),[U,re]=(0,Ie.useState)(!1),{setOpenFlowState:ie,getOpenFlowState:Z,hasOpenModals:q}=Ne();d=G(d);let[Pe,ae]=i!==void 0&&r!==void 0?[i,r]:[Z(e,!0),Q=>ie(e,Q)];if((0,Ie.useEffect)(()=>{!U&&!T&&(re(!0),E(e)===se&&v&&O(e),re(!0))},[U,re,T]),T)return null;let J=b(e);if(!J||y(J))return null;let ve=u(e);if(!ve||i!==void 0&&i===!1||E(e)===se&&a||(o=="modal"||o=="corner-modal")&&q(e))return null;let De=()=>{ae(!1),h&&h(),S===!0&&z(e)};if(F=="center"&&o==="modal"||o==="large-modal"){let Q={padding:"24px"};return o==="large-modal"?(Q.width="85%",Q.height="90%",Q.maxHeight="800px",Q.minHeight="500px",Q.padding="0"):Q.width="400px",Ie.default.createElement(xt,{appearance:d,onClose:De,visible:Pe,style:Q,dismissible:g,showFrigadeBranding:L},Ie.default.createElement(me,{appearance:d}),Ie.default.createElement(Yo,{appearance:d,steps:ve,selectedStep:D,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:C,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ae,onDismiss:h,showPagination:B,customFormElements:s,allowBackNavigation:x,validationHandler:k}))}return o==="modal"&&F!=="center"?Ie.default.createElement(ui,{appearance:d,onClose:De,visible:Pe},Ie.default.createElement(me,{appearance:d}),Ie.default.createElement(Yo,{appearance:d,steps:ve,selectedStep:D,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:C,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ae,onDismiss:h,showPagination:B,customFormElements:s,allowBackNavigation:x,validationHandler:k})):Ie.default.createElement(Ie.default.Fragment,null,Ie.default.createElement(me,{appearance:d}),Ie.default.createElement(Yo,{appearance:d,steps:ve,selectedStep:D,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:C,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ae,onDismiss:h,showPagination:B,customFormElements:s,allowBackNavigation:x,validationHandler:k}))},Qi=br;var It=require("react");function Xo(){let{organizationId:e,userId:t,setOrganizationId:o}=(0,It.useContext)(Y),{mutateUserFlowState:i}=We(),{config:r,apiUrl:n}=Qe(),s=Mt(),{verifySDKInitiated:p}=Ut();(0,It.useEffect)(()=>{if(t&&e){if(t.startsWith(Wt))return;let C=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(C)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(C,"true"))}},[t,e]);let d=(0,It.useCallback)(async C=>{if(p(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let c={foreignUserId:t,foreignUserGroupId:e,properties:C};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(c)}),i()},[e,t,r,i]),a=(0,It.useCallback)(async(C,c)=>{if(p(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:C,properties:c}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:d,trackEventForOrganization:a}}var Zi="frigade-xFrigade_guestUserId",yo="frigade-xFrigade_userId",en=({})=>{let{setFlowResponses:e}=_t(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=We(),{userId:r,setUserId:n}=Ht(),[s,p]=(0,xe.useState)(null),{getFlowStatus:d}=R(),{flows:a,userProperties:C,setIsNewGuestUser:c,flowResponses:g}=(0,xe.useContext)(Y),[S,F]=(0,xe.useState)([]),[v,h]=(0,xe.useState)([]),{organizationId:B}=Xo();(0,xe.useEffect)(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let u=t[b],T=a.find(y=>y.slug===(u==null?void 0:u.flowId));if(T&&u&&u.shouldTrigger===!0&&T.type=="FORM"&&T.triggerType==="AUTOMATIC"&&!v.includes(T.slug)){setTimeout(()=>{x(u.flowId)},500);break}}},[o,t]),(0,xe.useEffect)(()=>{g.length>0&&i()},[g]);function x(b){let u=a.find(T=>T.slug===b);u&&u.triggerType==="AUTOMATIC"&&!v.includes(u.slug)&&(h([...v,u.slug]),F([u]))}function k(){if(!r){let b=localStorage.getItem(yo);if(b){n(b);return}let u=localStorage.getItem(Zi);if(u){n(u);return}c(!0);let T=Wt+(0,Ri.v4)();try{localStorage.setItem(Zi,T)}catch(y){console.log("Failed to save guest user id locally: Local storage unavailable",y)}n(y=>y||T)}}(0,xe.useEffect)(()=>{try{if(a){let b=[];a.forEach(u=>{if(u.data){let T=u.data.match(/"imageUri":"(.*?)"/g);T&&T.forEach(y=>{let E=y.replace('"imageUri":"',"").replace('"',"");if(b.includes(E))return;let $=new Image;$.src=E,b.push(E)})}})}}catch{}},[a]),(0,xe.useEffect)(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Wt))try{localStorage.setItem(yo,r)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}r===null&&setTimeout(()=>{r===null&&k()},50)},[r,a,C]);function L(){return xe.default.createElement(xe.default.Fragment,null,S.map(b=>d(b.slug)!==Ve?null:xe.default.createElement("span",{key:b.slug},xe.default.createElement(Qi,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return xe.default.createElement(xe.default.Fragment,null,xe.default.createElement(L,null))};var dn=require("react-error-boundary"),cn=require("deepmerge-ts");var on=m(require("styled-components")),So=require("styled-system");var wr=m(require("react")),Yt=m(require("styled-components")),Be=require("styled-system"),tn=require("deepmerge-ts"),tp={width:{property:"width",scale:"sizes",transform:(e,t)=>(0,Be.get)(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},op=(0,Yt.default)("div")(({css:e})=>e,(0,Be.compose)(Be.border,Be.color,Be.shadow,Be.space,Be.typography,(0,Be.system)(tp))),Jo=({as:e,children:t,overrides:o,...i})=>{let r=(0,Yt.useTheme)(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>wr.default.createElement(op,{as:e,...n,...i},t);if(o!==void 0){let p=(0,tn.deepmerge)(r,o);return wr.default.createElement(Yt.ThemeProvider,{theme:p},s())}return s()};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"}},rp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},rn=(0,on.default)(Jo)(()=>({whiteSpace:"nowrap"}),(0,So.compose)((0,So.variant)({scale:"components.Button",variants:"components.Button"}),(0,So.variant)({prop:"size",variants:rp})));var nn=m(require("styled-components")),Qo=require("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 sn=(0,nn.default)(Jo)((0,Qo.variant)({scale:"components.Text",variants:"components.Text"}),(0,Qo.system)({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var ln=4,an="px",ip=20,np=Object.fromEntries(Array.from(Array(ip+1),(e,t)=>t===0?[.5,`${.5*ln}${an}`]:[t,`${t*ln}${an}`])),Xt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Ro={colors:{...Xt,neutral:{foreground:Xt.gray300},primary:{background:Xt.blue500,foreground:Xt.white,inverted:Xt.blue500},negative:{foreground:Xt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:np,components:{Button:bo,Text:Zo}};var mn="https://api.frigade.com",Y=(0,X.createContext)({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Ze,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:mn,readonly:!1});function sp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var un=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var ie,Z;let[n,s]=(0,X.useState)(t||null),[p,d]=(0,X.useState)(o||null),[a,C]=(0,X.useState)([]),[c,g]=(0,X.useState)([]),[S,F]=(0,X.useState)([]),[v,h]=(0,X.useState)({}),[B,x]=(0,X.useState)({}),[k,L]=(0,X.useState)([]),[b,u]=(0,X.useState)({}),[T,y]=(0,X.useState)(!1),[E,$]=(0,X.useState)(!1),[z,O]=(0,X.useState)(!U(e)),D=(q,Pe)=>{if(Pe==="_blank"){window.open(q,"_blank");return}setTimeout(()=>{window.location.href=q},50)},G={theme:{...Ze.theme,...((ie=i==null?void 0:i.defaultAppearance)==null?void 0:ie.theme)??{}},styleOverrides:{...Ze.styleOverrides,...((Z=i==null?void 0:i.defaultAppearance)==null?void 0:Z.styleOverrides)??{}}};function U(q){return!!(q&&q.length>10&&q.substring(0,10)==="api_public")}(0,X.useEffect)(()=>{t&&s(t)},[t]),(0,X.useEffect)(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(yo)&&window.localStorage.getItem(yo)!==n&&sp()},[n]),(0,X.useEffect)(()=>{o&&d(o)},[o]),(0,X.useEffect)(()=>{if(U(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let re={publicApiKey:e,userId:n,setUserId:s,setFlows:C,flows:a,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:S,setFlowResponses:F,userProperties:v,setUserProperties:h,openFlowStates:B,setOpenFlowStates:x,completedFlowsToKeepOpenDuringSession:k,setCompletedFlowsToKeepOpenDuringSession:L,customVariables:b,setCustomVariables:u,isNewGuestUser:T,setIsNewGuestUser:y,hasActiveFullPageFlow:E,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:D,defaultAppearance:G,shouldGracefullyDegrade:z,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:mn,readonly:i&&i.readonly?i.readonly:!1};return z?X.default.createElement(Y.Provider,{value:re},r):X.default.createElement(dn.ErrorBoundary,{fallback:X.default.createElement(X.default.Fragment,null,r)},X.default.createElement(Y.Provider,{value:re},X.default.createElement(pn.ThemeProvider,{theme:(0,cn.deepmerge)(G.theme,Ro,(i==null?void 0:i.theme)??{})},r,X.default.createElement(en,null))))};var js=m(require("react"));var oe=m(require("react"));var Oe=m(require("react")),wt=m(require("styled-components"));var wo=m(require("react"));var St=m(require("react")),Tr=m(require("styled-components"));var fn=Tr.default.span`
|
|
635
635
|
font-weight: 400;
|
|
636
636
|
font-size: 15px;
|
|
637
637
|
line-height: 20px;
|
|
@@ -640,7 +640,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
640
640
|
vertical-align: middle;
|
|
641
641
|
margin-left: 12px;
|
|
642
642
|
padding-right: 12px;
|
|
643
|
-
`,
|
|
643
|
+
`,lp=Tr.default.div`
|
|
644
644
|
flex-direction: row;
|
|
645
645
|
justify-content: space-between;
|
|
646
646
|
display: flex;
|
|
@@ -648,24 +648,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
648
648
|
padding-bottom: 20px;
|
|
649
649
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
650
650
|
width: 100%;
|
|
651
|
-
`,
|
|
651
|
+
`,er=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="square",appearance:p})=>St.default.createElement(St.default.Fragment,null,St.default.createElement(lp,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},i==="left"&&e&&St.default.createElement(fn,{className:l("checklistStepLabel",p),style:o},e),St.default.createElement(et,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&St.default.createElement(fn,{className:l("checklistStepLabel",p),style:o},e)),St.default.createElement(me,{appearance:p}));var yn=require("framer-motion");var Jt=m(require("styled-components")),gn=Jt.default.div`
|
|
652
652
|
font-weight: 700;
|
|
653
653
|
font-size: 18px;
|
|
654
654
|
line-height: 22px;
|
|
655
|
-
`,
|
|
655
|
+
`,hn=Jt.default.p`
|
|
656
656
|
font-weight: 700;
|
|
657
657
|
font-size: 18px;
|
|
658
658
|
line-height: 22px;
|
|
659
659
|
margin: 20px 0px 0px 0px;
|
|
660
660
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
661
|
-
`,
|
|
661
|
+
`,xn=Jt.default.p`
|
|
662
662
|
font-weight: 400;
|
|
663
663
|
font-size: 15px;
|
|
664
664
|
line-height: 28px;
|
|
665
665
|
max-width: 540px;
|
|
666
666
|
margin: 8px 0px 0px 0px;
|
|
667
667
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
668
|
-
`,
|
|
668
|
+
`,tr=Jt.default.div`
|
|
669
669
|
width: 4px;
|
|
670
670
|
position: absolute;
|
|
671
671
|
left: 0;
|
|
@@ -673,35 +673,35 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
673
673
|
height: 80%;
|
|
674
674
|
border-top-right-radius: 8px;
|
|
675
675
|
border-bottom-right-radius: 8px;
|
|
676
|
-
`,
|
|
676
|
+
`,Cn=Jt.default.div`
|
|
677
677
|
flex-direction: row;
|
|
678
678
|
justify-content: flex-start;
|
|
679
|
-
`;var
|
|
679
|
+
`;var Sn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,d;return wo.default.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{n()}},o&&wo.default.createElement(tr,{className:l("checklistStepItemSelectedIndicator",s),as:yn.motion.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),wo.default.createElement(Cn,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},wo.default.createElement(er,{value:e.complete,labelPosition:"left",label:e.stepName,style:r,primaryColor:((d=s==null?void 0:s.theme)==null?void 0:d.colorPrimary)??i,appearance:s})))};var bt=m(require("react")),bn=require("framer-motion"),or=m(require("styled-components"));var ap={backgroundColor:"#E6E6E6"},pp=or.default.div`
|
|
680
680
|
display: flex;
|
|
681
681
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
682
682
|
justify-content: flex-start;
|
|
683
683
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
684
684
|
|
|
685
|
-
${e=>
|
|
686
|
-
`,
|
|
685
|
+
${e=>dt(e)}
|
|
686
|
+
`,dp=or.default.div`
|
|
687
687
|
flex-grow: 1;
|
|
688
688
|
position: relative;
|
|
689
689
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
690
|
-
|
|
690
|
+
`,cp=or.default.span`
|
|
691
691
|
font-weight: 500;
|
|
692
692
|
font-size: 15px;
|
|
693
693
|
line-height: 18px;
|
|
694
694
|
padding-right: ${e=>e.padding};
|
|
695
695
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
696
696
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
697
|
-
${e=>
|
|
698
|
-
`,
|
|
697
|
+
${e=>dt(e)}
|
|
698
|
+
`,mp={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},up={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},ot=({count:e,total:t,fillColor:o,bgColor:i=ap.backgroundColor,display:r="count",textLocation:n="left",style:s={},textStyle:p={},appearance:d})=>{var F,v;if(t===0)return bt.default.createElement(bt.default.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,C=r==="compact"?"5px":"10px",c=Math.round(e/t*100),g=r==="compact"?"5px":"20px",S;return r==="count"?S=`${e} of ${t}`:r==="compact"?S=`${c}%`:r==="percent"&&(S=`${c}% complete`),n==="top"&&(g="0px"),bt.default.createElement(pp,{className:l("progressBarContainer",d),textLocation:n,styleOverrides:s},bt.default.createElement(cp,{className:l("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:g,textLocation:n},S),bt.default.createElement(dp,{textLocation:n,className:l("progressBar",d)},bt.default.createElement(bn.motion.div,{style:{...up,width:a,height:C,backgroundColor:((F=d==null?void 0:d.theme)==null?void 0:F.colorPrimary)??o,zIndex:r=="compact"?1:5},className:l("progressBarFill",d)}),bt.default.createElement("div",{className:l("progressBarBackground",d),style:{...mp,height:C,backgroundColor:((v=d==null?void 0:d.theme)==null?void 0:v.colorSecondary)??i}})))};var eo=m(require("react")),Tn=m(require("styled-components"));var Fo=m(require("react"));var To=m(require("react"));var Qt=({stepData:e,appearance:t})=>To.default.createElement(To.default.Fragment,null,To.default.createElement(hn,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:be(e.title)}),To.default.createElement(xn,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:be(e.subtitle)}));var rr=m(require("react"));var Zt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return rr.default.createElement(Vo,{className:l("ctaContainer",t)},e.secondaryButtonTitle&&rr.default.createElement(ce,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}),rr.default.createElement(ce,{appearance:t,title:e.primaryButtonTitle,onClick:o}))};var Rt=({stepData:e,appearance:t})=>Fo.default.createElement(Fo.default.Fragment,null,Fo.default.createElement(Qt,{stepData:e,appearance:t}),Fo.default.createElement(Zt,{stepData:e,appearance:t}));var Fr=m(require("react"));function wn(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),Fr.default.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:l("checklistStepVideo",e.appearance)})}else return Fr.default.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var kr="default",fp=Tn.default.img`
|
|
699
699
|
border-radius: 4px;
|
|
700
700
|
max-height: 260px;
|
|
701
701
|
min-height: 200px;
|
|
702
|
-
`,
|
|
702
|
+
`,Fn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return eo.default.createElement("div",null,o)}return eo.default.createElement(gn,{className:l("checklistStepContent",t)},e.imageUri?eo.default.createElement(fp,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?eo.default.createElement(wn,{videoUri:e.videoUri,appearance:t}):null,eo.default.createElement(Rt,{stepData:e,appearance:t}))};var Te=m(require("react")),Nt=m(require("styled-components"));var kn=Nt.default.div`
|
|
703
703
|
display: block;
|
|
704
|
-
`,
|
|
704
|
+
`,gp=Nt.default.div`
|
|
705
705
|
display: flex;
|
|
706
706
|
flex-direction: row;
|
|
707
707
|
flex-wrap: wrap;
|
|
@@ -711,20 +711,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
711
711
|
align-content: center;
|
|
712
712
|
margin-top: 24px;
|
|
713
713
|
margin-bottom: 24px;
|
|
714
|
-
`,
|
|
714
|
+
`,hp=Nt.default.div`
|
|
715
715
|
display: flex;
|
|
716
716
|
align-items: center;
|
|
717
717
|
justify-content: flex-start;
|
|
718
718
|
flex-direction: column;
|
|
719
719
|
margin-right: 16px;
|
|
720
|
-
`,
|
|
720
|
+
`,xp=Nt.default.video`
|
|
721
721
|
width: 200px;
|
|
722
722
|
height: 120px;
|
|
723
|
-
`,
|
|
723
|
+
`,Cp=Nt.default.div`
|
|
724
724
|
font-size: 14px;
|
|
725
725
|
line-height: 20px;
|
|
726
726
|
text-align: center;
|
|
727
|
-
`,
|
|
727
|
+
`,yp=Nt.default.div`
|
|
728
728
|
position: absolute;
|
|
729
729
|
width: 200px;
|
|
730
730
|
height: 120px;
|
|
@@ -744,9 +744,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
744
744
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
745
745
|
border-radius: 50%;
|
|
746
746
|
}
|
|
747
|
-
`,
|
|
747
|
+
`,Pn="videoCarousel",vn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Te.default.createElement(kn,null,Te.default.createElement(Rt,{stepData:e,appearance:t}));function o({video:n}){let s=(0,Te.useRef)(),[p,d]=(0,Te.useState)(!1);return Te.default.createElement(hp,null,!p&&Te.default.createElement(yp,{onClick:()=>{d(!0),s.current.play()},appearance:t},Te.default.createElement(qo,null)),Te.default.createElement(xp,{controls:p,ref:s,play:p,src:n.uri}),Te.default.createElement(Cp,null,n.title))}let i=e.props;return i.videos?Te.default.createElement(kn,null,Te.default.createElement(Qt,{stepData:e,appearance:t}),Te.default.createElement(gp,null,i.videos.map((n,s)=>Te.default.createElement("span",{key:`${n.uri}-${s}`},Te.default.createElement(o,{video:n})))),Te.default.createElement(Zt,{stepData:e,appearance:t})):null};var rt=m(require("react")),ko=m(require("styled-components"));var Bn=ko.default.div`
|
|
748
748
|
display: block;
|
|
749
|
-
`,
|
|
749
|
+
`,Sp=ko.default.pre`
|
|
750
750
|
display: block;
|
|
751
751
|
background-color: #2a2a2a;
|
|
752
752
|
color: #f8f8f8;
|
|
@@ -762,68 +762,68 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
762
762
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
763
763
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
764
764
|
margin-bottom: 24px;
|
|
765
|
-
`,
|
|
765
|
+
`,bp=ko.default.div`
|
|
766
766
|
font-size: 15px;
|
|
767
767
|
line-height: 20px;
|
|
768
768
|
margin-bottom: 12px;
|
|
769
769
|
margin-top: 12px;
|
|
770
|
-
`,
|
|
770
|
+
`,wp=ko.default.div`
|
|
771
771
|
margin-top: 24px;
|
|
772
|
-
`,
|
|
772
|
+
`,En="codeSnippet",An=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return rt.default.createElement(Bn,null,rt.default.createElement(Rt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?rt.default.createElement(Bn,null,rt.default.createElement(Qt,{stepData:e,appearance:t}),rt.default.createElement(wp,null,o.codeSnippets.map((r,n)=>rt.default.createElement("div",{key:n},r.title?rt.default.createElement(bp,null,r.title):null,r.code?rt.default.createElement(Sp,null,r.code):null))),rt.default.createElement(Zt,{stepData:e,appearance:t})):null};var Tp=wt.default.div`
|
|
773
773
|
display: flex;
|
|
774
774
|
flex-direction: row;
|
|
775
775
|
min-width: ${e=>e.type!="modal"?"1000px":"100%"};
|
|
776
776
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
777
777
|
box-shadow: ${e=>e.type!="modal"?"0px 6px 25px rgba(0, 0, 0, 0.06)":"none"};
|
|
778
778
|
border-radius: 8px;
|
|
779
|
-
`,
|
|
779
|
+
`,Fp=wt.default.h1`
|
|
780
780
|
font-size: 24px;
|
|
781
781
|
font-weight: 600;
|
|
782
782
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
783
|
-
`,
|
|
783
|
+
`,kp=wt.default.h2`
|
|
784
784
|
font-size: 15px;
|
|
785
785
|
line-height: 20px;
|
|
786
786
|
color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary)??"#4d4d4d"}};
|
|
787
787
|
margin: 10px 0px 0px 0px;
|
|
788
|
-
`,
|
|
788
|
+
`,In=wt.default.div`
|
|
789
789
|
padding-bottom: 16px;
|
|
790
|
-
`,
|
|
790
|
+
`,Pp=wt.default.div`
|
|
791
791
|
list-style: none;
|
|
792
792
|
padding: 0;
|
|
793
793
|
margin: 0;
|
|
794
794
|
cursor: pointer;
|
|
795
795
|
width: 300px;
|
|
796
|
-
`,
|
|
796
|
+
`,vp=wt.default.div`
|
|
797
797
|
width: 1px;
|
|
798
798
|
margin: 40px;
|
|
799
799
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
800
|
-
`,
|
|
800
|
+
`,Bp=wt.default.div`
|
|
801
801
|
flex: 2;
|
|
802
802
|
padding: 2rem;
|
|
803
|
-
`,
|
|
803
|
+
`,Ep=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:C}=le();d=C(d);let g={...{[kr]:Fn,[Pn]:vn,[En]:An},...p},[S,F]=(0,Oe.useState)(0),v=r??S,h=n??F,B=o.filter(k=>k.complete===!0).length,x=()=>{var k;return!((k=o[v])!=null&&k.type)||!g[o[v].type]?g[kr]({stepData:o[v],appearance:d}):g[o[v].type]({stepData:o[v],appearance:d})};return Oe.default.createElement(Tp,{type:a,style:i,className:s,appearance:d},Oe.default.createElement(In,{style:{flex:1}},Oe.default.createElement(In,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Oe.default.createElement(Fp,{className:l("checklistTitle",d),appearance:d},e),Oe.default.createElement(kp,{className:l("checklistSubtitle",d),appearance:d},t),Oe.default.createElement(ot,{total:o.length,count:B,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Oe.default.createElement(Pp,{className:l("checklistStepsContainer",d)},o.map((k,L)=>Oe.default.createElement(Sn,{data:k,index:L,key:L,listLength:o.length,isSelected:L===v,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{h(L)}})))),Oe.default.createElement(vp,{appearance:d,className:l("checklistDivider",d)}),Oe.default.createElement(Bp,null,Oe.default.createElement(x,null)))},Pr=Ep;var _=m(require("react"));var vr=m(require("react")),Nn=m(require("styled-components")),Ap=Nn.default.svg`
|
|
804
804
|
transition: 'transform 0.35s ease-in-out';
|
|
805
|
-
`,
|
|
805
|
+
`,to=({color:e="#323232",style:t,className:o})=>vr.default.createElement(Ap,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},vr.default.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));var ps=require("framer-motion");var Ce=m(require("styled-components"));var Br={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Ln=Ce.default.div`
|
|
806
806
|
max-height: 350px;
|
|
807
807
|
padding-bottom: 40px;
|
|
808
|
-
`,
|
|
808
|
+
`,On=Ce.default.div`
|
|
809
809
|
display: flex;
|
|
810
810
|
flex-direction: column;
|
|
811
811
|
margin-top: 20px;
|
|
812
|
-
`,
|
|
812
|
+
`,Dn=Ce.default.h1`
|
|
813
813
|
font-style: normal;
|
|
814
814
|
font-weight: 600;
|
|
815
815
|
font-size: 30px;
|
|
816
816
|
line-height: 36px;
|
|
817
817
|
margin-bottom: 16px;
|
|
818
818
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
819
|
-
|
|
819
|
+
`,$n=Ce.default.h2`
|
|
820
820
|
font-weight: 400;
|
|
821
821
|
font-size: 16px;
|
|
822
822
|
line-height: 20px;
|
|
823
823
|
margin-bottom: 16px;
|
|
824
824
|
padding-left: 1px;
|
|
825
825
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
826
|
-
`,
|
|
826
|
+
`,Mn=Ce.default.div`
|
|
827
827
|
${e=>P(e)} {
|
|
828
828
|
border: 1px solid #fafafa;
|
|
829
829
|
}
|
|
@@ -833,11 +833,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
833
833
|
flex-direction: column;
|
|
834
834
|
min-height: 240px;
|
|
835
835
|
overflow: hidden;
|
|
836
|
-
`,
|
|
836
|
+
`,Un=Ce.default.div`
|
|
837
837
|
display: flex;
|
|
838
838
|
flex-direction: row;
|
|
839
839
|
justify-content: space-between;
|
|
840
|
-
`,
|
|
840
|
+
`,zn=Ce.default.p`
|
|
841
841
|
${e=>P(e)} {
|
|
842
842
|
font-weight: 400;
|
|
843
843
|
font-size: 10px;
|
|
@@ -846,12 +846,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
846
846
|
color: #8c8c8c;
|
|
847
847
|
margin: 20px;
|
|
848
848
|
}
|
|
849
|
-
`,
|
|
849
|
+
`,_n=Ce.default.div`
|
|
850
850
|
display: flex;
|
|
851
851
|
flex-direction: row;
|
|
852
|
-
`,
|
|
852
|
+
`,Wn=Ce.default.div`
|
|
853
853
|
flex: 1;
|
|
854
|
-
`,
|
|
854
|
+
`,Hn=Ce.default.div`
|
|
855
855
|
${e=>P(e)} {
|
|
856
856
|
display: flex;
|
|
857
857
|
justify-content: center;
|
|
@@ -861,7 +861,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
861
861
|
padding-left: 8px;
|
|
862
862
|
padding-right: 8px;
|
|
863
863
|
}
|
|
864
|
-
`,
|
|
864
|
+
`,Vn=Ce.default.p`
|
|
865
865
|
${e=>P(e)} {
|
|
866
866
|
font-style: normal;
|
|
867
867
|
font-weight: 600;
|
|
@@ -873,7 +873,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
873
873
|
margin-top: 20px;
|
|
874
874
|
margin-bottom: 16px;
|
|
875
875
|
}
|
|
876
|
-
`,
|
|
876
|
+
`,jn=Ce.default.p`
|
|
877
877
|
${e=>P(e)} {
|
|
878
878
|
font-weight: 400;
|
|
879
879
|
font-size: 14px;
|
|
@@ -882,14 +882,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
882
882
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
883
883
|
margin-bottom: 8px;
|
|
884
884
|
}
|
|
885
|
-
`,
|
|
885
|
+
`,Gn=Ce.default.div`
|
|
886
886
|
${e=>P(e)} {
|
|
887
887
|
display: flex;
|
|
888
888
|
flex-direction: row;
|
|
889
889
|
justify-content: center;
|
|
890
890
|
gap: 8px;
|
|
891
891
|
}
|
|
892
|
-
`,
|
|
892
|
+
`,qn=Ce.default.div`
|
|
893
893
|
${e=>P(e)} {
|
|
894
894
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
895
895
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -909,7 +909,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
909
909
|
justify-content: space-between;
|
|
910
910
|
position: relative;
|
|
911
911
|
cursor: pointer;
|
|
912
|
-
`,
|
|
912
|
+
`,Kn=Ce.default.p`
|
|
913
913
|
${e=>P(e)} {
|
|
914
914
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
915
915
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -918,12 +918,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
918
918
|
font-size: 14px;
|
|
919
919
|
line-height: 22px;
|
|
920
920
|
margin: 0;
|
|
921
|
-
`,
|
|
921
|
+
`,Yn=Ce.default.div`
|
|
922
922
|
display: flex;
|
|
923
923
|
flex-direction: row;
|
|
924
924
|
justify-content: flex-end;
|
|
925
925
|
align-content: center;
|
|
926
|
-
`,
|
|
926
|
+
`,Xn=Ce.default.div`
|
|
927
927
|
display: flex;
|
|
928
928
|
flex: 1;
|
|
929
929
|
flex-direction: row;
|
|
@@ -931,14 +931,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
931
931
|
align-content: center;
|
|
932
932
|
align-items: center;
|
|
933
933
|
margin-right: 20px;
|
|
934
|
-
`,
|
|
934
|
+
`,Jn=Ce.default.div`
|
|
935
935
|
display: block;
|
|
936
936
|
width: 100%;
|
|
937
|
-
`;var
|
|
937
|
+
`;var Qn=m(require("styled-components")),Zn=Qn.default.div`
|
|
938
938
|
flex-direction: column;
|
|
939
939
|
justify-content: center;
|
|
940
940
|
display: flex;
|
|
941
|
-
`;var
|
|
941
|
+
`;var nt=m(require("react")),as=require("framer-motion");var it=m(require("styled-components"));var Rn=it.default.div`
|
|
942
942
|
border: 1px solid #fafafa;
|
|
943
943
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
944
944
|
border-radius: 14px;
|
|
@@ -946,13 +946,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
946
946
|
display: flex;
|
|
947
947
|
flex-direction: column;
|
|
948
948
|
overflow: hidden;
|
|
949
|
-
`,
|
|
949
|
+
`,es=it.default.div`
|
|
950
950
|
display: flex;
|
|
951
951
|
flex-wrap: wrap;
|
|
952
952
|
justify-content: space-between;
|
|
953
953
|
overflow: hidden;
|
|
954
954
|
row-gap: 10px;
|
|
955
|
-
`,
|
|
955
|
+
`,ts=it.default.div`
|
|
956
956
|
${e=>P(e)} {
|
|
957
957
|
color: #595959;
|
|
958
958
|
}
|
|
@@ -962,7 +962,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
962
962
|
line-height: 12px;
|
|
963
963
|
letter-spacing: 0.09em;
|
|
964
964
|
margin-bottom: 12px;
|
|
965
|
-
`,
|
|
965
|
+
`,os=it.default.div`
|
|
966
966
|
${e=>P(e)} {
|
|
967
967
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
968
968
|
background: #ffffff;
|
|
@@ -975,7 +975,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
975
975
|
|
|
976
976
|
max-width: 150px;
|
|
977
977
|
min-width: 200px;
|
|
978
|
-
|
|
978
|
+
`,rs=it.default.div`
|
|
979
979
|
${e=>P(e)} {
|
|
980
980
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
981
981
|
}
|
|
@@ -987,13 +987,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
987
987
|
justify-content: center;
|
|
988
988
|
align-content: center;
|
|
989
989
|
align-items: center;
|
|
990
|
-
`,
|
|
990
|
+
`,is=it.default.div`
|
|
991
991
|
font-weight: 600;
|
|
992
992
|
font-size: 20px;
|
|
993
993
|
line-height: 24px;
|
|
994
994
|
width: 20px;
|
|
995
995
|
height: 20px;
|
|
996
|
-
`,
|
|
996
|
+
`,ns=it.default.div`
|
|
997
997
|
${e=>P(e)} {
|
|
998
998
|
color: #434343;
|
|
999
999
|
}
|
|
@@ -1002,20 +1002,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1002
1002
|
line-height: 17px;
|
|
1003
1003
|
margin-top: 12px;
|
|
1004
1004
|
margin-bottom: 8px;
|
|
1005
|
-
`,
|
|
1005
|
+
`,ss=it.default.div`
|
|
1006
1006
|
${e=>P(e)} {
|
|
1007
1007
|
color: #8c8c8c;
|
|
1008
1008
|
}
|
|
1009
1009
|
font-weight: 400;
|
|
1010
1010
|
font-size: 12px;
|
|
1011
1011
|
line-height: 14px;
|
|
1012
|
-
`,
|
|
1012
|
+
`,ls=it.default.a`
|
|
1013
1013
|
color: ${e=>e.color};
|
|
1014
1014
|
font-size: 12px;
|
|
1015
1015
|
line-height: 14px;
|
|
1016
1016
|
font-weight: 400;
|
|
1017
1017
|
cursor: pointer;
|
|
1018
|
-
`;var
|
|
1018
|
+
`;var Ip=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=fe();return nt.default.createElement(Rn,{style:t,className:l("guideContainer",r)},nt.default.createElement(ts,{className:l("guideTitle",r)},o),nt.default.createElement(es,{className:l("guideItemContainer",r)},e.map((p,d)=>nt.default.createElement(os,{key:`guide-${p.id??d}`,as:as.motion.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",r)},p.icon&&nt.default.createElement(rs,{className:l("guideIcon",r)},nt.default.createElement(is,null,p.icon)),nt.default.createElement(ns,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:be(p.title)}),nt.default.createElement(ss,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:be(p.subtitle)}),nt.default.createElement(ls,{className:l("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},Po=Ip;var Np=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:C,guideTitle:c,onGuideButtonClick:g})=>{let S=({stepData:u,handleSecondaryCTAClick:T,handleCTAClick:y})=>u?_.default.createElement(Hn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},_.default.createElement(Vn,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:be(u.title)}),_.default.createElement(jn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:be(u.subtitle)}),_.default.createElement(Gn,{className:l("checklistCTAContainer",a)},u.secondaryButtonTitle&&_.default.createElement(ce,{title:u.secondaryButtonTitle,onClick:T,appearance:a,secondary:!0}),_.default.createElement(ce,{title:u.primaryButtonTitle,onClick:y,appearance:a}))):_.default.createElement(_.default.Fragment,null),v={...{default:u=>{var $;if(($=e[x])!=null&&$.StepContent){let z=e[x].StepContent;return _.default.createElement("div",null,z)}let T=e[x];return _.default.createElement(S,{stepData:u,handleCTAClick:()=>{T.handlePrimaryButtonClick&&T.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{T.handleSecondaryButtonClick&&T.handleSecondaryButtonClick()}})}},...d},[h,B]=(0,_.useState)(0),x=s??h,k=p??B,L=()=>{var u;return e?!((u=e[x])!=null&&u.type)||!v[e[x].type]?v.default(e[x]):v[e[x].type]({stepData:e[x],primaryColor:a.theme.colorPrimary}):_.default.createElement(_.default.Fragment,null)},b=e.filter(u=>u.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(Br.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Br),_.default.createElement(xt,{onClose:n,visible:r,appearance:a},_.default.createElement(Jn,null,_.default.createElement(On,null,_.default.createElement(Dn,{appearance:a,className:l("checklistTitle",a)},t),_.default.createElement($n,{appearance:a,className:l("checklistSubtitle",a)},o)),_.default.createElement(Ln,null,e&&e.length>0&&_.default.createElement(Mn,{className:l("stepsContainer",a)},_.default.createElement(Un,null,_.default.createElement("div",{style:{flex:3}},_.default.createElement(zn,{className:l("stepsTitle",a)},i)),_.default.createElement(Xn,null,_.default.createElement(ot,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:b,total:e.length,appearance:a}))),_.default.createElement(_n,null,_.default.createElement(Wn,{className:l("checklistStepListContainer",a),appearance:a},e.map((u,T)=>{let y=x===T;return _.default.createElement(qn,{selected:y,className:l(`checklistStepListItem${y?"Selected":""}`,a),key:`checklist-guide-step-${u.id??T}`,disabled:u.blocked,onClick:()=>{u.blocked||k(T)},title:u.blocked?"Finish remaining steps to continue":void 0},y&&_.default.createElement(tr,{className:l("checklistStepItemSelectedIndicator",a),as:ps.motion.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),_.default.createElement(Kn,{selected:y,className:l(`checklistStepListStepName${y?"Selected":""}`,a)},u.stepName),_.default.createElement(Yn,null,_.default.createElement(et,{value:u.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:u.progress,appearance:a}),_.default.createElement(Zn,null,_.default.createElement(to,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),_.default.createElement(L,null))),C&&C.length>0&&_.default.createElement(Po,{steps:C,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:u=>(g&&g(u),!0)}))))):_.default.createElement(_.default.Fragment,null)},Er=Np;var ir=require("react"),ds=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=(0,ir.useState)(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,a])=>{if(!window)return[d,!1];let C=window.matchMedia(a);return C.addEventListener("change",n),[d,C.matches]}));i(p)};return(0,ir.useEffect)(()=>{s()},[]),o};var ge=m(require("react"));var ye=m(require("react"));var nr=require("framer-motion");var st=m(require("styled-components")),cs=st.default.div`
|
|
1019
1019
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1020
1020
|
border: 1px solid;
|
|
1021
1021
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1027,42 +1027,42 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1027
1027
|
display: flex;
|
|
1028
1028
|
flex-direction: column;
|
|
1029
1029
|
transition: max-height 0.25s;
|
|
1030
|
-
`,
|
|
1030
|
+
`,ms=st.default.div`
|
|
1031
1031
|
display: flex;
|
|
1032
1032
|
margin-bottom: 20px;
|
|
1033
|
-
`,
|
|
1033
|
+
`,us=st.default.img`
|
|
1034
1034
|
border-radius: 4px;
|
|
1035
1035
|
max-height: 260px;
|
|
1036
1036
|
min-height: 200px;
|
|
1037
|
-
`,
|
|
1037
|
+
`,fs=st.default.div`
|
|
1038
1038
|
display: flex;
|
|
1039
1039
|
flex-direction: row;
|
|
1040
1040
|
justify-content: space-between;
|
|
1041
1041
|
align-items: center;
|
|
1042
|
-
`,
|
|
1042
|
+
`,gs=st.default.p`
|
|
1043
1043
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1044
1044
|
font-style: normal;
|
|
1045
1045
|
font-weight: 500;
|
|
1046
1046
|
font-size: 16px;
|
|
1047
1047
|
line-height: 18px;
|
|
1048
1048
|
margin-left: 8px;
|
|
1049
|
-
`,
|
|
1049
|
+
`,hs=st.default.div`
|
|
1050
1050
|
padding: 20px;
|
|
1051
1051
|
cursor: pointer;
|
|
1052
1052
|
:hover {
|
|
1053
1053
|
opacity: 0.8;
|
|
1054
1054
|
}
|
|
1055
|
-
`,
|
|
1055
|
+
`,kg=st.default.div``,xs=st.default.p`
|
|
1056
1056
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1057
1057
|
font-weight: 400;
|
|
1058
1058
|
font-size: 14px;
|
|
1059
1059
|
line-height: 22px;
|
|
1060
|
-
`,
|
|
1060
|
+
`,Cs=st.default.div`
|
|
1061
1061
|
display: flex;
|
|
1062
1062
|
flex-direction: row;
|
|
1063
1063
|
justify-content: flex-start;
|
|
1064
1064
|
align-items: center;
|
|
1065
|
-
`;var
|
|
1065
|
+
`;var ys=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var C,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return ye.default.createElement(ye.default.Fragment,null,e.imageUri||e.videoUri?ye.default.createElement(ms,{className:l("stepMediaContainer",n)},e.imageUri?ye.default.createElement(us,{className:l("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ye.default.createElement(qt,{appearance:n,videoUri:e.videoUri}):null):null,ye.default.createElement(xs,{className:l("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:be(e.subtitle)}),ye.default.createElement(Vo,{className:l("checklistCTAContainer",n)},e.secondaryButtonTitle?ye.default.createElement(ce,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,ye.default.createElement(ce,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function a(){if(!s)return null;let g=s[e.type];return g?g(e,n):null}return ye.default.createElement(cs,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",n),appearance:n},ye.default.createElement(fs,{className:l("stepHeader",n)},ye.default.createElement(Cs,null,ye.default.createElement(er,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(C=n==null?void 0:n.theme)==null?void 0:C.colorPrimary,appearance:n}),ye.default.createElement(gs,{appearance:n,className:l("stepTitle",n),dangerouslySetInnerHTML:be(e.title)})),ye.default.createElement(hs,{className:l("stepChevronContainer",n),onClick:()=>o()},ye.default.createElement(to,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=n==null?void 0:n.theme)==null?void 0:c.colorTextSecondary}))),ye.default.createElement(nr.AnimatePresence,null,!t&&ye.default.createElement(nr.motion.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??d())))};var Lt=m(require("styled-components")),$g=Lt.default.div`
|
|
1066
1066
|
background: #ffffff;
|
|
1067
1067
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1068
1068
|
border-radius: 6px;
|
|
@@ -1076,48 +1076,48 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1076
1076
|
|
|
1077
1077
|
max-width: 800px;
|
|
1078
1078
|
min-width: 350px;
|
|
1079
|
-
`,
|
|
1079
|
+
`,Ss=Lt.default.div`
|
|
1080
1080
|
display: flex;
|
|
1081
1081
|
flex-direction: column;
|
|
1082
|
-
`,
|
|
1082
|
+
`,bs=Lt.default.h1`
|
|
1083
1083
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1084
1084
|
font-style: normal;
|
|
1085
1085
|
font-weight: 700;
|
|
1086
1086
|
font-size: 20px;
|
|
1087
1087
|
line-height: 24px;
|
|
1088
1088
|
margin-bottom: 8px;
|
|
1089
|
-
`,
|
|
1089
|
+
`,ws=Lt.default.h2`
|
|
1090
1090
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1091
1091
|
font-weight: 400;
|
|
1092
1092
|
font-size: 14px;
|
|
1093
1093
|
line-height: 23px;
|
|
1094
1094
|
margin: 2px 0 0 0;
|
|
1095
|
-
`,
|
|
1095
|
+
`,Ts=Lt.default.div`
|
|
1096
1096
|
display: block;
|
|
1097
1097
|
width: 100%;
|
|
1098
|
-
`,
|
|
1098
|
+
`,Fs=Lt.default.div`
|
|
1099
1099
|
display: flex;
|
|
1100
1100
|
width: 100%;
|
|
1101
1101
|
flex-direction: column;
|
|
1102
1102
|
justify-content: space-between;
|
|
1103
1103
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1104
|
-
`;var
|
|
1104
|
+
`;var Lp=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,primaryColor:d="#000000",selectedStep:a,setSelectedStep:C,appearance:c,type:g,className:S,customStepTypes:F,style:v})=>{let h=o.filter(u=>u.complete).length,[B,x]=(0,ge.useState)(Array(o.length).fill(!0));(0,ge.useEffect)(()=>{let u=[...B];if(n){for(let T=0;T<o.length;T++)if(!o[T].complete){u[T]=!1;break}x(u)}},[]),(0,ge.useEffect)(()=>{k(a)},[a]);let k=u=>{let T=[...B];if(s)for(let y=0;y<B.length;++y)y!==u&&(T[y]=!0);T[u]=!T[u],x(T)};if(!r&&g=="modal")return ge.default.createElement(ge.default.Fragment,null);let L=ge.default.createElement(ge.default.Fragment,null,ge.default.createElement(Ss,null,ge.default.createElement(bs,{appearance:c,className:l("checklistTitle",c),dangerouslySetInnerHTML:be(e)}),ge.default.createElement(ws,{appearance:c,className:l("checklistSubtitle",c),dangerouslySetInnerHTML:be(t)})),ge.default.createElement(ot,{display:"percent",count:h,total:o.length,fillColor:d,style:{margin:"14px 0px 8px 0px"},appearance:c})),b=ge.default.createElement(Ts,{className:Ee(l("checklistContainer",c),S)},o.map((u,T)=>{let y=B[T];return ge.default.createElement(ys,{appearance:c,stepData:u,collapsed:y,key:`modal-checklist-${u.id??T}`,onClick:()=>{if(a===T){k(T);return}C(T)},onPrimaryButtonClick:()=>{u.handlePrimaryButtonClick&&u.handlePrimaryButtonClick(),p&&!u.completionCriteria&&T<B.length-1&&B[T+1]&&C(T+1)},onSecondaryButtonClick:()=>{u.handleSecondaryButtonClick&&u.handleSecondaryButtonClick()},customStepTypes:F})}));return g==="inline"?ge.default.createElement(Fs,{appearance:c,className:Ee(l("checklistInlineContainer",c),S),style:v},L,b):ge.default.createElement(ge.default.Fragment,null,ge.default.createElement(xt,{onClose:i,visible:r,appearance:c,style:{maxWidth:"600px"},headerContent:L},b))},Ar=Lp;var H=m(require("react"));var Ot=m(require("react"));var te=m(require("styled-components"));var ks=te.css`
|
|
1105
1105
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1106
|
-
`,
|
|
1106
|
+
`,Op=te.css`
|
|
1107
1107
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1108
|
-
`,
|
|
1108
|
+
`,Dp=te.keyframes`
|
|
1109
1109
|
from {
|
|
1110
1110
|
opacity: 0;
|
|
1111
1111
|
} to {
|
|
1112
1112
|
opacity: 1;
|
|
1113
1113
|
}
|
|
1114
|
-
|
|
1114
|
+
`,$p=te.keyframes`
|
|
1115
1115
|
from {
|
|
1116
1116
|
opacity: 1;
|
|
1117
1117
|
} to {
|
|
1118
1118
|
opacity: 0;
|
|
1119
1119
|
}
|
|
1120
|
-
`,
|
|
1120
|
+
`,Ps=te.default.div`
|
|
1121
1121
|
margin: 0 -20px;
|
|
1122
1122
|
overflow-x: auto;
|
|
1123
1123
|
padding-left: 20px;
|
|
@@ -1134,14 +1134,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1134
1134
|
::-webkit-scrollbar {
|
|
1135
1135
|
display: none;
|
|
1136
1136
|
}
|
|
1137
|
-
`,
|
|
1137
|
+
`,vs=te.default.div`
|
|
1138
1138
|
display: flex;
|
|
1139
1139
|
flex-flow: row nowrap;
|
|
1140
1140
|
gap: 0 16px;
|
|
1141
1141
|
scroll-snap-align: center;
|
|
1142
1142
|
scroll-snap-stop: always;
|
|
1143
|
-
`,
|
|
1144
|
-
animation: ${e=>e.reversed
|
|
1143
|
+
`,Bs=te.default.div`
|
|
1144
|
+
animation: ${e=>e.reversed?$p:Dp} 0.25s ease-out;
|
|
1145
1145
|
background: linear-gradient(
|
|
1146
1146
|
to right,
|
|
1147
1147
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1150,8 +1150,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1150
1150
|
position: absolute;
|
|
1151
1151
|
width: 64px;
|
|
1152
1152
|
z-index: 10;
|
|
1153
|
-
`,
|
|
1154
|
-
${
|
|
1153
|
+
`,Es=te.default.button`
|
|
1154
|
+
${ks}
|
|
1155
1155
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1156
1156
|
align-items: center;
|
|
1157
1157
|
border-radius: 50%;
|
|
@@ -1162,11 +1162,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1162
1162
|
justify-content: center;
|
|
1163
1163
|
position: absolute;
|
|
1164
1164
|
width: 48px;
|
|
1165
|
-
`,
|
|
1165
|
+
`,As=te.default.div`
|
|
1166
1166
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1167
1167
|
padding: 20px;
|
|
1168
|
-
`,
|
|
1169
|
-
${
|
|
1168
|
+
`,Is=(0,te.default)(As)`
|
|
1169
|
+
${ks}
|
|
1170
1170
|
background: ${({theme:e})=>e.colorBackground};
|
|
1171
1171
|
position: relative;
|
|
1172
1172
|
|
|
@@ -1178,95 +1178,95 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1178
1178
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1179
1179
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1180
1180
|
}
|
|
1181
|
-
`,
|
|
1181
|
+
`,Ns=te.default.img`
|
|
1182
1182
|
border-radius: 50%;
|
|
1183
1183
|
height: 40px;
|
|
1184
1184
|
margin-bottom: 12px;
|
|
1185
1185
|
width: 40px;
|
|
1186
|
-
`,
|
|
1186
|
+
`,Ls=(0,te.default)(As)`
|
|
1187
1187
|
${e=>P(e)} {
|
|
1188
|
-
${
|
|
1188
|
+
${Op}
|
|
1189
1189
|
|
|
1190
1190
|
background: ${({theme:e})=>e.colorBackground};
|
|
1191
1191
|
}
|
|
1192
|
-
`,
|
|
1192
|
+
`,Os=te.default.div`
|
|
1193
1193
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1194
1194
|
display: flex;
|
|
1195
1195
|
flex-flow: row nowrap;
|
|
1196
1196
|
align-items: center;
|
|
1197
1197
|
margin-left: 20px;
|
|
1198
|
-
`,
|
|
1198
|
+
`,Ds=te.default.div`
|
|
1199
1199
|
white-space: nowrap;
|
|
1200
|
-
|
|
1200
|
+
`,$s=te.default.div`
|
|
1201
1201
|
background: #d8fed8;
|
|
1202
1202
|
border-radius: 6px;
|
|
1203
1203
|
float: right;
|
|
1204
1204
|
margin-bottom: 12px;
|
|
1205
1205
|
padding: 4px 10px;
|
|
1206
|
-
`,
|
|
1206
|
+
`,Mp=te.default.p`
|
|
1207
1207
|
font-weight: bold;
|
|
1208
1208
|
font-size: 18px;
|
|
1209
1209
|
line-height: 22px;
|
|
1210
1210
|
letter-spacing: calc(18px * -0.01);
|
|
1211
1211
|
margin: 0;
|
|
1212
|
-
`,
|
|
1212
|
+
`,Ms=(0,te.default)(Mp)`
|
|
1213
1213
|
margin-bottom: 4px;
|
|
1214
|
-
`,
|
|
1214
|
+
`,Up=te.default.p`
|
|
1215
1215
|
font-weight: bold;
|
|
1216
1216
|
font-size: 16px;
|
|
1217
1217
|
line-height: 20px;
|
|
1218
1218
|
letter-spacing: calc(16px * -0.01);
|
|
1219
1219
|
margin: 0;
|
|
1220
|
-
`,
|
|
1220
|
+
`,Us=(0,te.default)(Up)`
|
|
1221
1221
|
margin-bottom: 4px;
|
|
1222
1222
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1223
1223
|
`}
|
|
1224
|
-
`,
|
|
1224
|
+
`,lt=te.default.p`
|
|
1225
1225
|
color: ${({theme:e})=>e.colorText};
|
|
1226
1226
|
font-weight: normal;
|
|
1227
1227
|
font-size: 14px;
|
|
1228
1228
|
line-height: 22px;
|
|
1229
1229
|
margin: 0;
|
|
1230
|
-
`,
|
|
1230
|
+
`,zs=te.default.p`
|
|
1231
1231
|
color: ${({theme:e})=>e.colorText};
|
|
1232
1232
|
font-weight: 600;
|
|
1233
1233
|
font-size: 12px;
|
|
1234
1234
|
line-height: 16px;
|
|
1235
1235
|
margin: 0;
|
|
1236
|
-
`;
|
|
1236
|
+
`;lt.Loud=(0,te.default)(lt)`
|
|
1237
1237
|
font-weight: 600;
|
|
1238
|
-
`;
|
|
1238
|
+
`;lt.Quiet=(0,te.default)(lt)`
|
|
1239
1239
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1240
1240
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1241
1241
|
`}
|
|
1242
|
-
`;var
|
|
1242
|
+
`;var _s=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=le(),{primaryCTAClickSideEffects:r}=fe();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:a=!1}=e,C=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{r(e)};return Ot.default.createElement(Is,{className:l("carouselCard",o),onClick:a?null:c,style:t,blocked:a,complete:d},n&&Ot.default.createElement(Ns,{className:l("carouselCardImage",o),src:n,alt:p,style:{opacity:d||a?.4:1}}),(d||!0)&&Ot.default.createElement($s,{className:l("carouselCompletedPill",o)},Ot.default.createElement(zs,{style:{color:"#108E0B"}},"Complete")),p&&Ot.default.createElement(Us,{blocked:a,complete:d,className:l("carouselCardTitle",o)},p),s&&Ot.default.createElement(lt.Quiet,{blocked:a,complete:d,className:l("carouselCardSubtitle",o)},s))};var oo=m(require("react"));var Ws=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let i=t>0?e/t:0,r=200,n=Math.min(r,Math.max(10,Math.round(r*i)));return oo.default.createElement(Os,{className:l("carouselProgressBar",o)},oo.default.createElement(Ds,{as:lt.Loud,style:{marginRight:8}},e," of ",t),oo.default.createElement("svg",{height:10,width:r},oo.default.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),oo.default.createElement("rect",{x:0,y:0,rx:5,width:n,height:10,fill:"currentColor"})))};var zp=()=>H.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},H.default.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),H.default.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),H.default.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Hs=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=(0,H.useState)(!1),[n,s]=(0,H.useState)(!1);(0,H.useEffect)(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?H.default.createElement(Bs,{style:d,reversed:n,onAnimationEnd:n?p:null},H.default.createElement(Es,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},H.default.createElement(zp,null))):null},Vs=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=(0,H.useRef)(null),[n,s]=(0,H.useState)(!1),[p,d]=(0,H.useState)(!1),[a,C]=(0,H.useState)(null),[c,g]=(0,H.useState)([]),[S,F]=(0,H.useState)(0),{getFlowMetadata:v,getFlowSteps:h,getNumberOfStepsCompleted:B,updateCustomVariables:x,getFlowStatus:k,isLoading:L,targetingLogicShouldHideFlow:b,getFlow:u}=R();(0,H.useEffect)(()=>{x(o)},[o,L]),(0,H.useEffect)(()=>{if(L)return;let O=v(e),D=B(e),G=h(e);C(O),O.data!==null&&(g(G.sort((U,re)=>Number(U.complete)-Number(re.complete))),d(G.length>3),F(D))},[L]);let T=[];for(let O=0;O<c.length;O+=3)T.push(c.slice(O,O+3));let y=O=>{let D=O.target,G=D.scrollWidth-D.clientWidth,U=Math.ceil(D.scrollLeft);U>0&&n===!1&&s(!0),U===0&&n===!0&&s(!1),U<G&&p===!1&&d(!0),U===G&&p===!0&&d(!1)},E=(O=!0)=>{let D=O?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*D,behavior:"smooth"})},$=null,z=O=>{$!==null?clearTimeout($):y(O),$=setTimeout(()=>{y(O)},16)};return L?null:H.default.createElement(Ls,{className:Ee(l("carouselContainer",t),i)},H.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},H.default.createElement("div",null,H.default.createElement(Ms,{className:l("carouselTitle",t)},a==null?void 0:a.title),H.default.createElement(lt.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),H.default.createElement(Ws,{numberOfStepsCompleted:S,numberOfSteps:c.length})),H.default.createElement("div",{style:{position:"relative"}},H.default.createElement(Hs,{show:n,onClick:()=>E(!1)}),H.default.createElement(Hs,{side:"right",show:p,onClick:E}),H.default.createElement(Ps,{ref:r,onScroll:z},T.map((O,D)=>H.default.createElement(vs,{key:D,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},O.map((G,U)=>H.default.createElement(_s,{key:U,stepData:G,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))),H.default.createElement(me,{appearance:t}))};var sr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:C,onButtonClick:c,appearance:g,hideOnFlowCompletion:S,setVisible:F,customStepTypes:v,checklistStyle:h="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:x,...k})=>{let{getFlow:L,getFlowSteps:b,markStepCompleted:u,getStepStatus:T,getNumberOfStepsCompleted:y,isLoading:E,targetingLogicShouldHideFlow:$,updateCustomVariables:z,getFlowMetadata:O,isStepBlocked:D,getFlowStatus:G,hasActiveFullPageFlow:U,setHasActiveFullPageFlow:re}=R(),{primaryCTAClickSideEffects:ie,secondaryCTAClickSideEffects:Z}=fe(),{getOpenFlowState:q,setOpenFlowState:Pe}=Ne(),[ae,J]=(0,oe.useState)(r||0),[ve,De]=(0,oe.useState)(!1),Q=d===void 0?q(e):d,he=s==="modal",{mergeAppearanceWithDefault:W}=le(),{isLarge:M}=ds();if(g=W(g),(0,oe.useEffect)(()=>{z(a)},[a,E]),(0,oe.useEffect)(()=>{d!==void 0&&(he&&d===!0?re(!0):he&&d===!1&&re(!1))},[d,F,U]),E)return null;let pe=L(e);if(!pe||$(pe))return null;let K=b(e);if(!K||S===!0&&G(e)===se)return null;let de=O(e);if(de!=null&&de.title&&(t=de.title),de!=null&&de.subtitle&&(o=de.subtitle),!ve&&r===void 0&&y(e)>0){let I=K.findIndex(ne=>ne.complete===!1);J(I>-1?I:K.length-1),De(!0)}function pt(){if(ae+1>=K.length){he&&Pe(e,!1);return}D(e,K[ae+1].id)||J(ae+1)}function Xe(I,ne,kt){let Wr=ae+1<K.length?K[ae+1]:null;c&&c(I,ae,ne,Wr)===!0&&he&&Je(),C&&C(I,kt,Wr),!C&&!c&&(I.primaryButtonUri||I.secondaryButtonUri)&&he&&Je()}function Ft(){return K.map((I,ne)=>({...I,handleSecondaryButtonClick:()=>{pt(),Z(I),I.skippable===!0&&u(e,I.id,{skipped:!0}),Xe(I,"secondary",ne)},handlePrimaryButtonClick:()=>{(!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)||I.completionCriteria&&I.autoMarkCompleted===!0)&&(u(e,I.id),pt()),Xe(I,"primary",ne),ie(I),T(e,I.id)===je&&pt()}}))}function V(){return oe.default.createElement(me,{appearance:g})}let ze={steps:Ft(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:v,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:x};function Je(){Pe(e,!1),p&&p(),F&&F(!1)}function dr(){return oe.default.createElement(oe.default.Fragment,null,oe.default.createElement(V,null),oe.default.createElement(Vs,{flowId:e,appearance:g,customVariables:a,className:n}))}function f(){return oe.default.createElement(oe.default.Fragment,null,oe.default.createElement(V,null),oe.default.createElement(Ar,{visible:Q,onClose:()=>{Je()},selectedStep:ae,setSelectedStep:J,autoExpandNextStep:!0,appearance:g,...ze}))}function w(){if(!M)return f();let I=k.guideFlowId,ne;return I&&L(I)&&(ne=b(I)),oe.default.createElement(oe.default.Fragment,null,oe.default.createElement(V,null),oe.default.createElement(Er,{visible:Q,stepsTitle:de.stepsTitle?de.stepsTitle:"Your quick start guide",onClose:()=>{Je()},selectedStep:ae,setSelectedStep:J,guideData:ne,guideTitle:k.guideTitle??"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:kt=>{Xe(kt,"link",0)},customStepTypes:v,...ze}))}function A(){if(!M)return f();let I=oe.default.createElement(Pr,{flowId:e,style:i,selectedStep:ae,setSelectedStep:J,appearance:g,type:s,...ze});return he?oe.default.createElement(xt,{onClose:()=>{Je()},visible:Q,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},oe.default.createElement(V,null),I):oe.default.createElement(oe.default.Fragment,null,oe.default.createElement(V,null),I)}switch(h){case"condensed":return f();case"with-guide":return w();case"default":return A();case"carousel":return dr();default:return A()}};var Gs=e=>js.default.createElement(sr,{type:"inline",...e});var Ke=m(require("react"));var qe=m(require("react"));var vo=m(require("styled-components")),qs=vo.default.div`
|
|
1243
1243
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1244
1244
|
border-radius: 8px;
|
|
1245
1245
|
padding: 6px 10px 6px 10px;
|
|
1246
1246
|
min-width: 160px;
|
|
1247
1247
|
cursor: pointer;
|
|
1248
1248
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1249
|
-
`,
|
|
1249
|
+
`,Ks=vo.default.div`
|
|
1250
1250
|
display: flex;
|
|
1251
1251
|
flex-direction: row;
|
|
1252
1252
|
justify-content: space-between;
|
|
1253
1253
|
align-items: center;
|
|
1254
1254
|
margin-bottom: 2px;
|
|
1255
1255
|
flex-grow: 2;
|
|
1256
|
-
`,
|
|
1256
|
+
`,Ys=vo.default.div`
|
|
1257
1257
|
text-overflow: ellipsis;
|
|
1258
1258
|
font-weight: 600;
|
|
1259
1259
|
font-size: 12px;
|
|
1260
1260
|
line-height: 15px;
|
|
1261
1261
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1262
1262
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1263
|
-
`,
|
|
1263
|
+
`,Xs=vo.default.div`
|
|
1264
1264
|
width: 20px;
|
|
1265
1265
|
margin-right: 8px;
|
|
1266
1266
|
display: flex;
|
|
1267
1267
|
height: 100%;
|
|
1268
1268
|
align-items: center;
|
|
1269
|
-
`;var
|
|
1269
|
+
`;var Js=require("framer-motion");var Qs=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>qe.default.createElement(qe.default.Fragment,null,qe.default.createElement(me,{appearance:s}),qe.default.createElement(qs,{as:Js.motion.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:Ee(n??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&qe.default.createElement(Xs,{className:l("progressRingContainer",s)},qe.default.createElement(Et,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),qe.default.createElement(Ks,{type:p,className:l("badgeTitleContainer",s)},qe.default.createElement(Ys,{type:p,appearance:s,className:l("badgeTitle",s)},e),i!==void 0&&qe.default.createElement(to,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&qe.default.createElement(ot,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));var ht=m(require("react"));var ro=m(require("styled-components"));var Zs=ro.default.div`
|
|
1270
1270
|
display: flex;
|
|
1271
1271
|
flex-direction: row;
|
|
1272
1272
|
width: 100%;
|
|
@@ -1277,25 +1277,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1277
1277
|
border-width: 1px;
|
|
1278
1278
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1279
1279
|
border-radius: 12px;
|
|
1280
|
-
`,
|
|
1280
|
+
`,Rs=ro.default.div`
|
|
1281
1281
|
${e=>P(e)} {
|
|
1282
1282
|
display: flex;
|
|
1283
1283
|
justify-content: center;
|
|
1284
1284
|
align-items: center;
|
|
1285
1285
|
margin-right: 16px;
|
|
1286
1286
|
}
|
|
1287
|
-
`,
|
|
1287
|
+
`,el=ro.default.div`
|
|
1288
1288
|
display: flex;
|
|
1289
1289
|
flex-direction: column;
|
|
1290
1290
|
flex: 1;
|
|
1291
1291
|
margin-top: 0;
|
|
1292
|
-
`,
|
|
1292
|
+
`,tl=ro.default.div`
|
|
1293
1293
|
display: flex;
|
|
1294
1294
|
flex-direction: column;
|
|
1295
1295
|
justify-content: center;
|
|
1296
1296
|
margin-left: 16px;
|
|
1297
1297
|
min-width: 200px;
|
|
1298
|
-
`,
|
|
1298
|
+
`,Hh=ro.default.div`
|
|
1299
1299
|
display: flex;
|
|
1300
1300
|
justify-content: center;
|
|
1301
1301
|
align-items: flex-end;
|
|
@@ -1304,7 +1304,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1304
1304
|
:hover {
|
|
1305
1305
|
opacity: 0.8;
|
|
1306
1306
|
}
|
|
1307
|
-
`;var
|
|
1307
|
+
`;var ol=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>ht.default.createElement(ht.default.Fragment,null,ht.default.createElement(Zs,{appearance:i,className:Ee(l("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&ht.default.createElement(Rs,{className:l("fullWidthProgressBadgeIcon",i)},o),ht.default.createElement(el,null,ht.default.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),ht.default.createElement(tl,{className:l("fullWidthProgressBadgeProgressContainer",i)},ht.default.createElement(ot,{count:r,total:n,display:"percent",textLocation:"top",fillColor:i.theme.colorPrimary}))));var rl=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:C="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:S,getNumberOfStepsCompleted:F,isLoading:v,targetingLogicShouldHideFlow:h,updateCustomVariables:B}=R(),{mergeAppearanceWithDefault:x}=le();a=x(a);let{setOpenFlowState:k,getOpenFlowState:L}=Ne();if((0,Ke.useEffect)(()=>{B(p)},[p,v]),v)return null;let b=c(e);if(!b||h(b)||d===!0&&S(e)===se)return null;let u=g(e),T=F(e);return C==="full-width"?Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(me,{appearance:a}),Ke.default.createElement(ol,{title:t,subtitle:o,count:T,total:u.length,style:r,className:s,appearance:a,icon:i,onClick:()=>{}})):Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(me,{appearance:a}),Ke.default.createElement(Qs,{count:T,total:u.length,title:t,style:r,onClick:()=>{k(e,!0),n&&n()},type:C,className:s,appearance:a}))};var il=m(require("react"));var nl=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=R(),{mergeAppearanceWithDefault:p}=le();o=p(o);let d=r(e);if(!d||n(d))return null;let a=s(e);return il.default.createElement(Po,{steps:a,style:t,appearance:o,...i})};var Ye=m(require("react"));var N=m(require("react"));var so=m(require("styled-components"));var io=require("react"),Ir=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}},sl={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function _p(e){let t=sl;return e&&(t=e.getBoundingClientRect()),t}function ll(e,t){let[o,i]=(0,io.useState)(sl),r=(0,io.useCallback)(()=>{e&&i(_p(e))},[e]);return(0,io.useEffect)(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}var al=300,pl=100,Wp=500,no=12,Hp=so.default.div`
|
|
1308
1308
|
width: 100%;
|
|
1309
1309
|
height: 100%;
|
|
1310
1310
|
border-radius: 9999px;
|
|
@@ -1327,25 +1327,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1327
1327
|
opacity: 0;
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
|
-
`,
|
|
1331
|
-
width: ${
|
|
1332
|
-
height: ${
|
|
1330
|
+
`,Vp=so.default.div`
|
|
1331
|
+
width: ${no}px;
|
|
1332
|
+
height: ${no}px;
|
|
1333
1333
|
border-radius: 100px;
|
|
1334
1334
|
background-color: ${e=>e.primaryColor};
|
|
1335
1335
|
z-index: 20;
|
|
1336
1336
|
opacity: 1;
|
|
1337
|
-
`,
|
|
1337
|
+
`,jp=so.default.div`
|
|
1338
1338
|
pointer-events: all;
|
|
1339
|
-
`,
|
|
1339
|
+
`,dl=so.default.div`
|
|
1340
1340
|
display: flex;
|
|
1341
1341
|
align-content: center;
|
|
1342
1342
|
justify-content: center;
|
|
1343
1343
|
align-items: center;
|
|
1344
1344
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1345
|
-
`,
|
|
1346
|
-
width: ${
|
|
1347
|
-
height: ${
|
|
1348
|
-
`,
|
|
1345
|
+
`,Gp=(0,so.default)(dl)`
|
|
1346
|
+
width: ${no+12}px;
|
|
1347
|
+
height: ${no+12}px;
|
|
1348
|
+
`,qp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:C,appearance:c,dismissible:g=!1,showHighlightOnly:S,showStepCount:F=!0,completedStepsCount:v=0,showFrigadeBranding:h=!1})=>{var de,pt,Xe,Ft;let[B,x]=(0,N.useState)(),[k,L]=(0,N.useState)(new Date),b=(0,N.useRef)(null),[u,T]=(0,N.useState)(document.querySelector(e[a].selector)),y=ll(u,k),[E,$]=(0,N.useState)(),[z,O]=(0,N.useState)(!S),D=(pt=(de=e[a])==null?void 0:de.props)!=null&&pt.position?e[a].props.position:"absolute",G=((Ft=(Xe=e[a])==null?void 0:Xe.props)==null?void 0:Ft.zIndex)??90,U=(B==null?void 0:B.width)??al,re=(B==null?void 0:B.height)??pl;(0,N.useLayoutEffect)(()=>{b.current&&x({width:b.current.clientWidth,height:b.current.clientHeight})},[a,k,D]),(0,N.useEffect)(()=>{S||O(!0)},[a]);let ie=i==="auto"?"right":i,Z=Ir(y,ie,U,s,D),q=y.right+U>(window.innerWidth||document.documentElement.clientWidth),Pe=y.bottom+pl>(window.innerHeight||document.documentElement.clientHeight);q&&i==="auto"&&(Z=Ir(y,"left",U,s,D),ie="left");let ae=window.location.pathname.split("/").pop(),J=()=>{let V=document.querySelector(e[a].selector);E&&E===JSON.stringify(V==null?void 0:V.getBoundingClientRect())||(T(V),L(new Date),V&&$(JSON.stringify(V.getBoundingClientRect())))};if((0,N.useEffect)(()=>{let V=new MutationObserver(J);return V.observe(document.body,{subtree:!0,childList:!0}),()=>V.disconnect()},[J]),(0,N.useEffect)(()=>{let V=new MutationObserver(J);return V.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>V.disconnect()},[J]),(0,N.useEffect)(()=>{let V=setInterval(()=>{J()},10);return()=>clearInterval(V)},[J]),(0,N.useLayoutEffect)(()=>{setTimeout(()=>{J()},Wp),J()},[a,ae]),u===null)return N.default.createElement(N.default.Fragment,null);if(Z.x==0&&Z.y==0)return N.default.createElement(N.default.Fragment,null);if(!p)return N.default.createElement(N.default.Fragment,null);let ve=()=>{let V=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),O(!1),setTimeout(()=>{J()},30)),v===e.length-1)return o()},ze=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),S&&!e[a].secondaryButtonUri&&O(!1))};return N.default.createElement(N.default.Fragment,null,F&&e.length>1&&N.default.createElement(ni,null,N.default.createElement(li,{className:l("tooltipStepCounter",c)},a+1," of ",e.length)),N.default.createElement(si,{showStepCount:F,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&N.default.createElement(ce,{title:e[a].secondaryButtonTitle,appearance:c,onClick:ze,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&N.default.createElement(ce,{title:e[a].primaryButtonTitle,appearance:c,onClick:V,withMargin:!1,size:"small"})))},De=()=>N.default.createElement(N.default.Fragment,null,g&&N.default.createElement(ti,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",c)},N.default.createElement($e,null)),e[a].imageUri&&N.default.createElement(oi,{dismissible:g,appearance:c,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&N.default.createElement(ri,{dismissible:g,appearance:c,className:l("tooltipVideoContainer",c)},N.default.createElement(qt,{appearance:c,videoUri:e[a].videoUri})),N.default.createElement(Ae,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),N.default.createElement(ii,{className:l("tooltipFooter",c)},N.default.createElement(ve,null))),he={...{default:V=>{var ze;if((ze=e[a])!=null&&ze.StepContent){let Je=e[a].StepContent;return N.default.createElement("div",null,Je)}return N.default.createElement(De,null)}},...C},W=()=>{var V;return e?!((V=e[a])!=null&&V.type)||!he[e[a].type]?he.default(e[a]):he[e[a].type]({stepData:e[a],primaryColor:n}):N.default.createElement(N.default.Fragment,null)};if(S&&e[a].complete===!0)return null;let M={top:(Z==null?void 0:Z.y)-no,left:(ie=="left"?y.x+s.x:(Z==null?void 0:Z.x)-no)??0,cursor:S?"pointer":"default",position:D},pe=()=>{let ze=M.left+(ie=="left"?-U:24);return Math.min(Math.max(ze,20),window.innerWidth-U-20)},K=()=>{S&&(L(new Date),O(!z))};return N.default.createElement(jp,null,N.default.createElement(Gp,{style:M,zIndex:G,className:l("tourHighlightContainer",c)},r&&e[a].showHighlight!==!1&&N.default.createElement(N.default.Fragment,null,N.default.createElement(Vp,{style:{position:D},onClick:K,primaryColor:c.theme.colorPrimary,className:l("tourHighlightInnerCircle",c)}),N.default.createElement(Hp,{style:{position:"absolute"},onClick:K,primaryColor:c.theme.colorPrimary,className:l("tourHighlightOuterCircle",c)}))),N.default.createElement(dl,{style:{...M,left:pe()},zIndex:G+1,className:l("tooltipContainerWrapper",c)},z&&N.default.createElement(N.default.Fragment,null,N.default.createElement(Oo,{ref:b,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:al,zIndex:G+10},N.default.createElement(W,null)),h&&N.default.createElement(pi,{className:l("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:G+10},N.default.createElement($o,{appearance:c})))))},lr=qp;var cl=require("react-portal");var ml=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:C="complete-flow",onComplete:c,skipIfNotFound:g=!1,...S})=>{let{getFlow:F,getFlowSteps:v,isLoading:h,targetingLogicShouldHideFlow:B,markStepCompleted:x,markStepStarted:k,markFlowCompleted:L,updateCustomVariables:b,getCurrentStepIndex:u,getStepStatus:T,isStepBlocked:y,getFlowStatus:E,getNumberOfStepsCompleted:$}=R(),{isLoadingUserFlowStateData:z}=We(),{primaryCTAClickSideEffects:O,secondaryCTAClickSideEffects:D}=fe(),{hasOpenModals:G}=Ne(),U=u(e),{openFlowStates:re}=(0,Ye.useContext)(Y),{mergeAppearanceWithDefault:ie}=le();if(o=ie(o),(0,Ye.useEffect)(()=>{b(t)},[t,h]),z)return null;let Z=F(e);if(!Z||B(Z)||E(e)==se||G())return null;let q=v(e);if(Object.keys(re).length>0){let W=Object.keys(re).find(M=>re[M]===!0);if(W!==void 0&&W!==e)return Ye.default.createElement(Ye.default.Fragment,null)}async function Pe(W){if(await x(e,W.id),q.map(M=>T(e,M.id)).every(M=>M===je)){await L(e);return}if(!a&&U+1<q.length){if(y(e,q[U+1].id))return;await k(e,q[U+1].id)}}function ae(W,M,pe){let K=U+1<q.length?q[U+1]:null;r&&r(W,U,M,K),i&&i(W,pe,K)}function J(){return q.map(W=>({...W,handleSecondaryButtonClick:async()=>{D(W),W.skippable===!0&&await x(e,W.id,{skipped:!0}),ae(W,"secondary",U)},handlePrimaryButtonClick:async()=>{(!W.completionCriteria&&(W.autoMarkCompleted||W.autoMarkCompleted===void 0)||W.completionCriteria&&W.autoMarkCompleted===!0)&&await Pe(W),ae(W,"primary",U),O(W)}}))}async function ve(W){s&&s(),C==="complete-flow"?await L(e):await x(e,W.id)}function De(){c&&c()}let Q=!document.querySelector(q[U].selector);function he(){let W=q.findIndex(M=>!!document.querySelector(M.selector));return q.map((M,pe)=>Q&&!n&&pe!==W&&g?null:Ye.default.createElement(lr,{key:M.id,appearance:o,steps:J(),selectedStep:pe,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>ve(M),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:$(e),onComplete:De,...S}))}return Ye.default.createElement(cl.Portal,null,Ye.default.createElement(me,{appearance:o}),n||Q&&g?he():Ye.default.createElement(lr,{appearance:o,steps:J(),selectedStep:U,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>ve(q[U]),tooltipPosition:d,completedStepsCount:$(e),showHighlightOnly:a,onComplete:De,...S}))};var ue=m(require("react"));var wl=require("react-portal");var Tt=m(require("styled-components"));var ul=Tt.default.button`
|
|
1349
1349
|
${e=>P(e)} {
|
|
1350
1350
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1351
1351
|
|
|
@@ -1363,17 +1363,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1363
1363
|
opacity: 0.8;
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
|
-
`,
|
|
1366
|
+
`,fl=Tt.default.span`
|
|
1367
1367
|
${e=>P(e)} {
|
|
1368
1368
|
font-size: 12px;
|
|
1369
1369
|
display: inline-block;
|
|
1370
1370
|
}
|
|
1371
|
-
`,
|
|
1371
|
+
`,gl=Tt.default.span`
|
|
1372
1372
|
${e=>P(e)} {
|
|
1373
1373
|
font-size: 12px;
|
|
1374
1374
|
display: inline-block;
|
|
1375
1375
|
}
|
|
1376
|
-
`,
|
|
1376
|
+
`,hl=Tt.default.div`
|
|
1377
1377
|
position: fixed;
|
|
1378
1378
|
right: 0;
|
|
1379
1379
|
bottom: 0;
|
|
@@ -1383,7 +1383,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1383
1383
|
flex-direction: column;
|
|
1384
1384
|
align-items: flex-end;
|
|
1385
1385
|
z-index: 50;
|
|
1386
|
-
`,
|
|
1386
|
+
`,xl=Tt.default.button`
|
|
1387
1387
|
${e=>P(e)} {
|
|
1388
1388
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1389
1389
|
background-color: #ffffff;
|
|
@@ -1399,7 +1399,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1399
1399
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1400
1400
|
border-radius: 45px;
|
|
1401
1401
|
cursor: pointer;
|
|
1402
|
-
`,
|
|
1402
|
+
`,Cl=Tt.default.div`
|
|
1403
1403
|
${e=>P(e)} {
|
|
1404
1404
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1405
1405
|
background: #ffffff;
|
|
@@ -1416,7 +1416,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1416
1416
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1417
1417
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1418
1418
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1419
|
-
`,
|
|
1419
|
+
`,yl=Tt.default.button`
|
|
1420
1420
|
${e=>P(e)} {
|
|
1421
1421
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1422
1422
|
color: #434343;
|
|
@@ -1433,7 +1433,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1433
1433
|
font-size: 14px;
|
|
1434
1434
|
|
|
1435
1435
|
padding: 8px 12px;
|
|
1436
|
-
`;var
|
|
1436
|
+
`;var lo=require("framer-motion");var Nr=m(require("react")),Sl=({style:e,className:t})=>Nr.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Nr.default.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));var Lr=m(require("react")),bl=({style:e,className:t})=>Lr.default.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},Lr.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Tl=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:C,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S}=R(),{primaryCTAClickSideEffects:F}=fe(),v=(0,ue.useRef)(null),[h,B]=(0,ue.useState)(!1),{mergeAppearanceWithDefault:x}=le();s=x(s),(0,ue.useEffect)(()=>(document.addEventListener("click",k,!1),()=>{document.removeEventListener("click",k,!1)}),[]);let k=y=>{v.current&&!v.current.contains(y.target)&&B(!1)};if(g)return null;let L=p(e);if(!L||S(L))return null;let b=d(e);if(!b||!i)return null;function u(y,E){!y.completionCriteria&&(y.autoMarkCompleted||y.autoMarkCompleted===void 0)&&a(e,y.id),F(y),o&&o(y,E),B(!1)}function T(){return h&&ue.default.createElement(Cl,{className:l("floatingWidgetMenu",s),as:lo.motion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},b.map((y,E)=>ue.default.createElement(yl,{className:l("floatingWidgetMenuItem",s),key:E,onClick:()=>u(y,E)},y.title)))}return r=="inline"?ue.default.createElement("span",{ref:v},ue.default.createElement(ul,{style:t,onClick:()=>{B(!h)},className:l("supportButton",s)},ue.default.createElement(gl,{className:l("supportIconContainer",s)},ue.default.createElement(bl,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),ue.default.createElement(fl,{className:l("supportButtonTitle",s)},n)),ue.default.createElement(lo.AnimatePresence,null,ue.default.createElement(T,null))):ue.default.createElement(wl.Portal,null,ue.default.createElement(hl,{style:t,ref:v},ue.default.createElement(lo.AnimatePresence,null,ue.default.createElement(T,null)),ue.default.createElement(xl,{onClick:()=>{B(!h)},as:lo.motion.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},ue.default.createElement(Sl,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};var Ue=m(require("react"));var Bo=m(require("styled-components"));var Fl=Bo.default.div`
|
|
1437
1437
|
${e=>P(e)} {
|
|
1438
1438
|
display: flex;
|
|
1439
1439
|
flex-direction: column;
|
|
@@ -1448,17 +1448,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1448
1448
|
border-radius: 12px;
|
|
1449
1449
|
position: relative;
|
|
1450
1450
|
}
|
|
1451
|
-
`,
|
|
1451
|
+
`,kl=Bo.default.div`
|
|
1452
1452
|
display: flex;
|
|
1453
1453
|
flex-direction: column;
|
|
1454
1454
|
flex: 1;
|
|
1455
|
-
`,
|
|
1455
|
+
`,Pl=Bo.default.div`
|
|
1456
1456
|
display: flex;
|
|
1457
1457
|
flex-direction: column;
|
|
1458
1458
|
justify-content: center;
|
|
1459
1459
|
align-items: flex-start;
|
|
1460
1460
|
margin-top: 16px;
|
|
1461
|
-
`,
|
|
1461
|
+
`,vl=Bo.default.div`
|
|
1462
1462
|
${e=>P(e)} {
|
|
1463
1463
|
position: absolute;
|
|
1464
1464
|
top: 16px;
|
|
@@ -1469,7 +1469,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1469
1469
|
opacity: 0.8;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
`;var
|
|
1472
|
+
`;var Bl=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:C,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:S,getFlowSteps:F,getFlowStatus:v,getCurrentStepIndex:h}=R(),{primaryCTAClickSideEffects:B}=fe(),{mergeAppearanceWithDefault:x}=le();if(r=x(r),(0,Ue.useEffect)(()=>{S(o)},[o,c]),c)return null;let k=d(e);if(!k||g(k)||v(e)===se)return null;let b=F(e)[h(e)];return Ue.default.createElement(Ue.default.Fragment,null,Ue.default.createElement(me,{appearance:r}),Ue.default.createElement(Fl,{appearance:r,className:Ee(l("embeddedTipContainer",r),n),style:s},(p===!0||b.dismissible)&&Ue.default.createElement(vl,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},Ue.default.createElement($e,null)),Ue.default.createElement(kl,null,Ue.default.createElement(Ae,{size:"small",appearance:r,title:b.title,subtitle:b.subtitle})),b.primaryButtonTitle&&Ue.default.createElement(Pl,{className:l("embeddedTipCallToActionContainer",r)},Ue.default.createElement(ce,{classPrefix:"embeddedTip",title:b.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{b.handlePrimaryButtonClick(),B(b),!(i&&i(b,h(e),"primary")===!1)&&(await C(e,b.id),await a(e))}}))))};var Se=m(require("react"));var Dt=m(require("styled-components"));var El=Dt.default.div`
|
|
1473
1473
|
// use the :not annotation
|
|
1474
1474
|
${e=>P(e)} {
|
|
1475
1475
|
display: flex;
|
|
@@ -1483,24 +1483,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1483
1483
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1484
1484
|
border-radius: 12px;
|
|
1485
1485
|
}
|
|
1486
|
-
`,
|
|
1486
|
+
`,Al=Dt.default.div`
|
|
1487
1487
|
${e=>P(e)} {
|
|
1488
1488
|
display: flex;
|
|
1489
1489
|
width: 36px;
|
|
1490
1490
|
height: 36px;
|
|
1491
1491
|
}
|
|
1492
|
-
`,
|
|
1492
|
+
`,Il=Dt.default.div`
|
|
1493
1493
|
display: flex;
|
|
1494
1494
|
flex-direction: column;
|
|
1495
1495
|
flex: 1;
|
|
1496
1496
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1497
1497
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1498
|
-
`,
|
|
1498
|
+
`,Nl=Dt.default.div`
|
|
1499
1499
|
display: flex;
|
|
1500
1500
|
flex-direction: column;
|
|
1501
1501
|
justify-content: center;
|
|
1502
1502
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1503
|
-
`,
|
|
1503
|
+
`,Or=Dt.default.div`
|
|
1504
1504
|
display: flex;
|
|
1505
1505
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1506
1506
|
align-items: flex-end;
|
|
@@ -1509,12 +1509,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1509
1509
|
:hover {
|
|
1510
1510
|
opacity: 0.8;
|
|
1511
1511
|
}
|
|
1512
|
-
`,
|
|
1512
|
+
`,Dr=Dt.default.div`
|
|
1513
1513
|
display: flex;
|
|
1514
1514
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1515
1515
|
align-items: flex-end;
|
|
1516
1516
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1517
|
-
`;var
|
|
1517
|
+
`;var $r=m(require("react")),Ll=({style:e,className:t})=>$r.default.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor"},$r.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var Ol=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:a,markFlowCompleted:C,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:S,getFlowMetadata:F,getFlowStatus:v,getFlowSteps:h,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:x}=fe(),{mergeAppearanceWithDefault:k}=le();if(s=k(s),(0,Se.useEffect)(()=>{S(r)},[r,c]),c)return null;let L=a(e);if(!L||g(L)||v(e)===se)return null;let b=h(e),u=b.length>0?b[B(e)]:F(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),Se.default.createElement(Se.default.Fragment,null,Se.default.createElement(me,{appearance:s}),Se.default.createElement(El,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&Se.default.createElement(Al,{className:l("bannerIconContainer",s)},d||Se.default.createElement(Ll,null)),p==="square"&&u.dismissible&&Se.default.createElement(Dr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.default.createElement(Or,{type:p,onClick:async()=>{await C(e),i&&i()},className:l("bannerDismissButton",s)},Se.default.createElement($e,null))),Se.default.createElement(Il,{type:p},Se.default.createElement(Ae,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),Se.default.createElement(Nl,{type:p,className:l("bannerCallToActionContainer",s)},Se.default.createElement(ce,{title:(u==null?void 0:u.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{x(u),n&&n(u,0,"primary")},classPrefix:"banner"})),p!=="square"&&u.dismissible&&Se.default.createElement(Dr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.default.createElement(Or,{type:p,onClick:async()=>{await C(e),i&&i()},className:l("bannerDismissButton",s)},Se.default.createElement($e,null)))))};var j=m(require("react"));var _l=require("react-portal");var at=m(require("styled-components"));var Dl=at.default.div`
|
|
1518
1518
|
${e=>P(e)} {
|
|
1519
1519
|
display: flex;
|
|
1520
1520
|
flex-direction: column;
|
|
@@ -1535,7 +1535,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1535
1535
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1536
1536
|
min-width: 550px;
|
|
1537
1537
|
}
|
|
1538
|
-
|
|
1538
|
+
`,$l=at.default.button`
|
|
1539
1539
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1540
1540
|
border-radius: 8px;
|
|
1541
1541
|
// If selected make border color primary and text color color priamry
|
|
@@ -1556,30 +1556,30 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1556
1556
|
display: flex;
|
|
1557
1557
|
justify-content: center;
|
|
1558
1558
|
align-items: center;
|
|
1559
|
-
`,
|
|
1559
|
+
`,Mr=at.default.div`
|
|
1560
1560
|
display: flex;
|
|
1561
1561
|
justify-content: flex-end;
|
|
1562
1562
|
margin-top: 16px;
|
|
1563
1563
|
gap: 8px;
|
|
1564
|
-
`,
|
|
1564
|
+
`,Ml=at.default.div`
|
|
1565
1565
|
display: flex;
|
|
1566
1566
|
justify-content: space-between;
|
|
1567
1567
|
margin-top: 8px;
|
|
1568
|
-
`,
|
|
1568
|
+
`,Ur=at.default.div`
|
|
1569
1569
|
font-size: 12px;
|
|
1570
1570
|
line-height: 16px;
|
|
1571
1571
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1572
|
-
`,
|
|
1572
|
+
`,zr=at.default.div`
|
|
1573
1573
|
display: flex;
|
|
1574
1574
|
flex-direction: column;
|
|
1575
1575
|
flex: 1;
|
|
1576
|
-
`,
|
|
1576
|
+
`,LC=at.default.div`
|
|
1577
1577
|
display: flex;
|
|
1578
1578
|
flex-direction: column;
|
|
1579
1579
|
justify-content: center;
|
|
1580
1580
|
align-items: flex-start;
|
|
1581
1581
|
margin-top: 16px;
|
|
1582
|
-
`,
|
|
1582
|
+
`,Ul=at.default.textarea`
|
|
1583
1583
|
${e=>P(e)} {
|
|
1584
1584
|
margin-top: 16px;
|
|
1585
1585
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1590,7 +1590,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1590
1590
|
width: 100%;
|
|
1591
1591
|
height: 100px;
|
|
1592
1592
|
}
|
|
1593
|
-
`,
|
|
1593
|
+
`,zl=at.default.div`
|
|
1594
1594
|
${e=>P(e)} {
|
|
1595
1595
|
position: absolute;
|
|
1596
1596
|
top: 16px;
|
|
@@ -1601,5 +1601,5 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${so}${r}.${so}${r} { ${Object.entries(n).map
|
|
|
1601
1601
|
opacity: 0.8;
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
|
-
`;var
|
|
1604
|
+
`;var Wl=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:C,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S,updateCustomVariables:F,getFlowSteps:v,getFlowStatus:h,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:x}=fe(),{mergeAppearanceWithDefault:k}=le(),[L,b]=j.default.useState(null),[u,T]=j.default.useState(""),{hasOpenModals:y,setKeepCompletedFlowOpenDuringSession:E,shouldKeepCompletedFlowOpenDuringSession:$}=Ne();if(r=k(r),(0,j.useEffect)(()=>{F(o)},[o,g]),g)return null;let z=d(e);if(!z||S(z)||h(e)===se||c(e)===1&&!$(e)||y())return null;let D=v(e)[B(e)];function G(){return j.default.createElement(j.default.Fragment,null,j.default.createElement(zr,null,j.default.createElement(Ae,{size:"large",appearance:r,title:D.title,subtitle:D.subtitle})),j.default.createElement(Mr,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(ie=>j.default.createElement($l,{className:l("npsNumberButton",r),selected:L===ie+1,key:ie,onClick:async()=>{E(e),b(ie+1),await C(e,D.id,{score:ie+1})},appearance:r},ie+1))),j.default.createElement(Ml,{appearance:r},j.default.createElement(Ur,{appearance:r},"Not likely at all"),j.default.createElement(Ur,{appearance:r},"Extremely likely")))}function U(){return j.default.createElement(j.default.Fragment,null,j.default.createElement(zr,null,j.default.createElement(Ae,{appearance:r,title:"Why did you choose this score?",size:"large"})),j.default.createElement(Ul,{appearance:r,value:u,onChange:ie=>{T(ie.target.value)},placeHolder:"Add your optional fedback here..."}),j.default.createElement(Mr,{appearance:r,className:l("npsNumberButtonContainer",r)},j.default.createElement(ce,{size:"large",withMargin:!1,onClick:async()=>{await a(e),i&&i(D,1,"primary")},appearance:r,title:D.secondaryButtonTitle||"Skip",secondary:!0}),j.default.createElement(ce,{size:"large",withMargin:!1,onClick:async()=>{await C(e,D.id,{feedbackText:u}),await a(e),i&&i(D,1,"primary")},appearance:r,title:D.primaryButtonTitle||"Submit"})))}function re(){return j.default.createElement(j.default.Fragment,null,j.default.createElement(me,{appearance:r}),j.default.createElement(Dl,{appearance:r,className:Ee(l("npsSurveyContainer",r),n),style:s,type:p},j.default.createElement(zl,{onClick:async()=>{await a(e),t&&t()},className:l("npsSurveyDismissButton",r)},j.default.createElement($e,null)),c(e)==0&&G(),c(e)==1&&U()))}return p==="inline"?re():j.default.createElement(_l.Portal,null,re())};var pr=m(require("react"));var _r=m(require("react"));var Hl=({as:e="span",children:t,variant:o="Body1",...i})=>_r.default.createElement(sn,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),Kp=Object.fromEntries(Object.keys(Zo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>_r.default.createElement(Hl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),ar=Object.assign(Hl,Kp);var Vl=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return pr.createElement(rn,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},pr.createElement(ar,{color:(s=bo[r])==null?void 0:s.color,fontWeight:"semibold"},i))},Yp=Object.fromEntries(Object.keys(bo).map(e=>{let t=o=>pr.createElement(Vl,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),jl=Object.assign(Vl,Yp);0&&(module.exports={Button,CheckBox,FormLabel,FormTextField,FrigadeBanner,FrigadeChecklist,FrigadeDefaultAppearance,FrigadeEmbeddedTip,FrigadeForm,FrigadeGuide,FrigadeHeroChecklist,FrigadeNPSSurvey,FrigadeProgressBadge,FrigadeProvider,FrigadeSupportWidget,FrigadeTour,ProgressRing,Text,tokens,useFlowOpens,useFlowResponses,useFlows,useOrganization,useUser});
|
|
1605
1605
|
//# sourceMappingURL=index.js.map
|