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