@frigade/react 1.35.34 → 1.35.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +304 -304
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +304 -304
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import{ThemeProvider as td}from"styled-components";import St,{useContext as Ep,useEffect as po,useState as Mo}from"react";import{useCallback as ht,useContext as oa,useEffect as ra}from"react";import Jo,{useMemo as qr}from"react";var Kr="1.35.34 ";var Ue="NOT_STARTED_STEP",q="COMPLETED_FLOW",yo="ABORTED_FLOW",xt="STARTED_FLOW",Ne="NOT_STARTED_FLOW",We="COMPLETED_STEP",So="STARTED_STEP";function je(){let{publicApiKey:e,userId:t,apiUrl:o}=Jo.useContext(G);return{config:qr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Kr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:qr(()=>`${o}/v1/public/`,[o])}}var Vl="frigade-last-call-at-",Gl="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Jo.useContext(G);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=Vl+o,n=Gl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Jo.useContext(G);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Rl,useState as Yr}from"react";import{useContext as ql,useEffect as Yl,useState as Xl}from"react";import Jl from"swr";import{useContext as Kl}from"react";function Fe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Kl(G);function n(d,x=!1){return e[d]??x}function s(d,x){t(k=>({...k,[d]:x}))}function p(d){t(x=>{let{[d]:k,...S}=x;return{...S}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,k])=>k&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Ql from"swr/immutable";import Zt from"core-js-pure/actual/structured-clone";function Qo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fe(...e){let t=e.shift(),o=e.length===1?e[0]:fe(...e);if(!Qo(t)||!Qo(o))throw new Error("deepmerge can only merge Objects");let i=Zt(t);return Object.entries(o).forEach(([r,n])=>{Qo(n)?i[r]!==void 0?Object.assign(i,{[r]:fe(i[r],Zt(n))}):Object.assign(i,{[r]:Zt(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...Zt(n)]}):Object.assign(i,{[r]:Zt(n)}):Object.assign(i,{[r]:n})}),i}var Zl="unknown";function Oe(){let{config:e,apiUrl:t}=je(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=ql(G),{resetOpenFlowState:c}=Fe(),[l,g]=Xl(!1),d={data:n.map(f=>({flowId:f.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=f=>fetch(f,e).then(F=>{if(F.ok)return F.json();throw new Error("Failed to fetch user flow states")}).catch(F=>(console.log(`Error fetching ${f}: ${F}. Will gracefully degrade and hide Frigade`),s(!0),d)),k=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:S,isLoading:b,mutate:u,error:v}=p?Ql(k,x):Jl(k,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),T=S==null?void 0:S.data;Yl(()=>{!l&&!b&&T&&g(!0)},[T,l,b]);async function C(f){if(T&&!p){let F=T.find(I=>I.flowId===f);F&&F.flowState!==q&&(F.flowState=q),await u(Promise.resolve(fe(S,{data:T})),{optimisticData:fe(S,{data:T}),revalidate:!1,rollbackOnError:!1})}}async function N(f,F,I){if(T){let O=T.find(E=>E.flowId===f);O&&(O.stepStates[F]=I,O.flowState=xt),await u(Promise.resolve(fe(S,{data:T})),{optimisticData:fe(S,{data:T}),revalidate:!1,rollbackOnError:!1})}}async function A(f,F,I){if(T){let O=T.find(E=>E.flowId===f);O&&(O.lastStepId=F,O.stepStates[F]=I,O.flowState=xt),await u(fe(S,{data:T}),{optimisticData:fe(S,{data:T}),revalidate:!1,rollbackOnError:!1})}}async function h(f){if(T){let F=T.find(I=>I.flowId===f);F&&F.flowState!==Ne&&(F.flowState=Ne,F.lastStepId=Zl,Object.keys(F.stepStates).forEach(I=>{F.stepStates[I].actionType=Ue,F.stepStates[I].createdAt=new Date().toISOString()}),await u(fe(S,{data:T}),{optimisticData:fe(S,{data:T}),revalidate:!1,rollbackOnError:!1}),c(f))}}async function w(f,F){if(T){let I=T.find(O=>O.flowId===f);I&&I.stepStates[F]!==Ue&&(I.stepStates[F]=Ue),await u(fe(S,{data:T}),{optimisticData:fe(S,{data:T}),revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:u,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowNotStarted:h,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:A,error:v}}function Rt(){let{config:e,apiUrl:t}=je(),{userFlowStatesData:o,mutateUserFlowState:i}=Oe(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Rl(G),[c,l]=Yr(new Set),[g,d]=Yr(new Set),x=Nt();function k(u){let v=JSON.stringify(u);if(c.has(v))return null;c.add(v),l(c),g.add(u),d(g);let T=s==null?void 0:s.find(C=>C.flowSlug===u.flowSlug&&C.stepId===u.stepId&&C.actionType===u.actionType&&C.createdAt===u.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:v}).then(C=>{C.status!==200&&C.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),n([...r,u])):T||p(N=>[...N??[],u])})}async function S(u){u.foreignUserId&&(u.actionType===xt||u.actionType===Ne?await k(u):u.actionType===q?await k(u):u.actionType===So?await k(u):u.actionType===We?await k(u):u.actionType===yo?await k(u):u.actionType===Ue&&await k(u))}function b(){let u=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let T in v.stepStates){let C=v.stepStates[T];u.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:C.stepId,actionType:C.actionType,data:{},createdAt:new Date(C.createdAt),blocked:C.blocked,hidden:C.hidden})}}),[...u,...s]}return{addResponse:S,setFlowResponses:p,getFlowResponses:b}}import ia from"swr";var ea=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Xr=e=>{let t=ea.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=ta(i,"'","");n.startsWith("flow_")&&(o=n)}),o},ta=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Zo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Ro=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Ro||{});function J(){let{config:e,apiUrl:t}=je(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=oa(G),k={data:[]},{verifySDKInitiated:S}=Ot(),{addResponse:b,getFlowResponses:u}=Rt(),v=m=>fetch(m,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${m} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),k)).catch(y=>(console.log(`Error fetching ${m}: ${y}. Will gracefully degrade and hide Frigade`),d(!0),k)),{mutateUserFlowState:T,userFlowStatesData:C,isLoadingUserFlowStateData:N,optimisticallyMarkFlowCompleted:A,optimisticallyMarkFlowNotStarted:h,optimisticallyMarkStepCompleted:w,optimisticallyMarkStepNotStarted:f,optimisticallyMarkStepStarted:F}=Oe(),{data:I,error:O,isLoading:E}=ia(n?`${t}flows${x?"?readonly=true":""}`:null,v,{keepPreviousData:!0});ra(()=>{if(O){console.error(O);return}I&&I.data&&i(I.data)},[I,O]);function D(m){if(E)return null;let y=o.find(B=>B.slug===m);return!y&&o.length>0&&!N&&!E?(console.log(`Flow with id ${m} not found`),null):(y==null?void 0:y.active)===!1&&!x?null:y}function $(m){var z;if(!D(m))return[];let y=D(m).data;return y?(y=V(y),(((z=Zo(y))==null?void 0:z.data)??[]).map(ue=>{let Qt=H(ue);return{handleSecondaryButtonClick:()=>{ue.skippable===!0&&te(m,ue.id,{skipped:!0})},...ue,complete:ne(m,ue.id)===We||Qt>=1,blocked:Te(m,ue.id),hidden:L(m,ue.id),handlePrimaryButtonClick:()=>{(!ue.completionCriteria&&(ue.autoMarkCompleted||ue.autoMarkCompleted===void 0)||ue.completionCriteria&&ue.autoMarkCompleted===!0)&&te(m,ue.id)},progress:Qt}}).filter(ue=>ue.hidden!==!0)):[]}function V(m){return m.replaceAll(/\${(.*?)}/g,(y,B)=>s[B]===void 0?"":String(s[B]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function j(m){if(!D(m))return[];let y=D(m).data;return y?(y=V(y),JSON.parse(y)??{}):[]}function Y(m,y){p(B=>({...B,[m]:y}))}function de(m){!N&&!E&&m&&JSON.stringify(s)!=JSON.stringify({...s,...m})&&Object.keys(m).forEach(y=>{Y(y,m[y])})}let he=ht(async(m,y,B)=>{if(!S())return;let z={foreignUserId:r,flowSlug:m,stepId:y,actionType:So,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};re(z)&&(await F(m,y,z),b(z))},[r,C]),K=ht(async(m,y,B)=>{if(!S())return;let z={foreignUserId:r,flowSlug:m,stepId:y,actionType:Ue,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};re(z)&&(await f(m,y),b(z))},[r,C]),te=ht(async(m,y,B)=>{if(!S())return;let z={foreignUserId:r,flowSlug:m,stepId:y,actionType:We,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};re(z)&&(await w(m,y,z),b(z))},[r,C]),Q=ht(async(m,y)=>{if(!S()||se(m)===Ne)return;let B={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:Ne,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await h(m),re(B)&&b(B)},[r,C]),Se=ht(async(m,y)=>{if(!S())return;let B={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:xt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(B)&&b(B)},[r,C]),me=ht(async(m,y)=>{if(!S())return;let B={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:q,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(B)&&(await A(m),b(B))},[r,C]),Ee=ht(async(m,y)=>{if(!S())return;let B={foreignUserId:r,flowSlug:m,stepId:"unknown",actionType:yo,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};re(B)&&(await A(m),b(B))},[r,C]);function re(m){var y;if(!C&&m.actionType===Ue)return!1;if(C){let B=C.find(z=>z.flowId===m.flowSlug);if(m.actionType===Ue&&(!(B!=null&&B.stepStates[m.stepId])||B.stepStates[m.stepId].actionType===Ue)||B&&((y=B.stepStates[m.stepId])==null?void 0:y.actionType)===m.actionType||B&&B.flowState===q&&m.actionType===q)return!1}return!0}function ne(m,y){let B=U(m,y);return N?null:B?B.actionType:Ue}function Te(m,y){let B=U(m,y);return B?B.blocked:!1}function L(m,y){let B=U(m,y);return B?B.hidden:!1}function U(m,y){if(N)return null;let B=C==null?void 0:C.find(z=>z.flowId===m);return!B||!B.stepStates[y]?null:B.stepStates[y]??null}function _(m){var B;if(N||!C)return null;if(se(m)===Ne)return $(m)[0]??null;let y=(B=C.find(z=>z.flowId===m))==null?void 0:B.lastStepId;return y?$(m).find(z=>z.id===y):null}function X(m){let y=_(m);if(!y)return 0;let B=$(m).findIndex(z=>z.id===y.id)??0;return ne(m,y.id)===We&&B<$(m).length-1?B+1:B}function H(m){if(!m.completionCriteria)return;let y=Xr(m.completionCriteria);if(y===null)return;let B=Ae(y),z=Ie(y);return z===0?void 0:B/z}function se(m){let y=C==null?void 0:C.find(B=>B.flowId===m);return y?y.flowState:null}function Ae(m){let y=$(m);return y.length===0?0:y.filter(z=>ne(m,z.id)===We).length}function Ie(m){return $(m).length}function Et(m){let y=o.find(B=>B.slug===m);return y?Zo(y.data):null}function ft(m){if(x)return!1;if(N)return!0;if(m!=null&&m.targetingLogic&&C){let y=C.find(B=>B.flowId===m.slug);if(y)return y.shouldTrigger===!1}return!!(m!=null&&m.targetingLogic&&r&&r.startsWith("guest_"))}function At(m){return!ft(D(m))}function gt(){r&&T()}return{getFlow:D,getFlowData:Et,isLoading:N||E,getStepStatus:ne,getFlowSteps:$,getCurrentStepIndex:X,markStepStarted:he,markStepCompleted:te,markFlowNotStarted:Q,markFlowStarted:Se,markFlowCompleted:me,markFlowAborted:Ee,markStepNotStarted:K,getFlowStatus:se,getNumberOfStepsCompleted:Ae,getNumberOfSteps:Ie,targetingLogicShouldHideFlow:ft,setCustomVariable:Y,updateCustomVariables:de,customVariables:s,getStepOptionalProgress:H,getFlowMetadata:j,isStepBlocked:Te,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as er,useContext as na,useEffect as sa}from"react";var Lt="guest_";function eo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=na(G),{config:n,apiUrl:s}=je(),{mutateUserFlowState:p}=Oe(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(S){return`frigade-user-registered-${S}`}sa(()=>{if(e&&!t){if(e.startsWith(Lt))return;let S=g(e);localStorage.getItem(S)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(S,"true"))}},[e,r,t]);let d=er(async S=>{if(!l())return;let b={foreignId:e,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(b)}),i(u=>({...u,...S})),p()},[e,n,r,p]),x=er(async(S,b)=>{if(!l())return;let v={foreignId:e,events:[{event:S,properties:b}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),p()},[e,n,p]),k=er(async(S,b)=>{if(l())if(b){let u=g(S);localStorage.setItem(u,"true"),o(S);let v={foreignId:S,properties:b};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),i(T=>({...T,...b})),p()}else o(S)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:k,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as Ap}from"uuid";import qe,{useEffect as br,useState as Zi}from"react";import _e,{useEffect as ir,useState as ga}from"react";import Fo from"styled-components";import la from"react";import aa from"styled-components";var Jr="fr-",to="cfr-";function a(e,t){let o=`${Jr}${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 P(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(Jr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function bo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ve(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${bo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function oo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var pa=aa.div`
|
|
2
|
+
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var Fo=Object.getOwnPropertySymbols;var ri=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable;var oi=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,P=(e,t)=>{for(var o in t||(t={}))ri.call(t,o)&&oi(e,o,t[o]);if(Fo)for(var o of Fo(t))ii.call(t,o)&&oi(e,o,t[o]);return e},H=(e,t)=>na(e,sa(t));var ni=e=>typeof e=="symbol"?e:e+"",Oe=(e,t)=>{var o={};for(var i in e)ri.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Fo)for(var i of Fo(e))t.indexOf(i)<0&&ii.call(e,i)&&(o[i]=e[i]);return o};var $=(e,t,o)=>new Promise((i,r)=>{var n=d=>{try{p(o.next(d))}catch(l){r(l)}},s=d=>{try{p(o.throw(d))}catch(l){r(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(n,s);p((o=o.apply(e,t)).next())});import Pt,{createContext as hd,useEffect as Go,useState as je}from"react";import{ThemeProvider as Cd}from"styled-components";import kt,{useContext as Kp,useEffect as go,useState as jo}from"react";import{useCallback as wt,useContext as ya,useEffect as Sa}from"react";import or,{useMemo as li}from"react";var si="1.35.35 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",ko="ABORTED_FLOW",bt="STARTED_FLOW",$e="NOT_STARTED_FLOW",Ke="COMPLETED_STEP",Po="STARTED_STEP";function Xe(){let{publicApiKey:e,userId:t,apiUrl:o}=or.useContext(J);return{config:li(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":si,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:li(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Ut(){let{shouldGracefullyDegrade:e,readonly:t}=or.useContext(J);return(o,i)=>$(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Mt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Mt();let r=la+o,n=aa+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),d=window.localStorage.getItem(n);if(p&&d&&d==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Mt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=yield fetch(o,i)}catch(p){return Mt(p)}return s?s.ok?s:Mt(s.statusText):Mt()})}function Mt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function zt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=or.useContext(J);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as ai}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=pa(J);function n(c,f=!1){var S;return(S=e[c])!=null?S:f}function s(c,f){t(S=>H(P({},S),{[c]:f}))}function p(c){t(f=>{let b=f,{[c]:S}=b,T=Oe(b,[ni(c)]);return P({},T)})}function d(c){r.includes(c)||i(f=>[...f,c])}function l(c){return r.includes(c)}function m(c){return Object.entries(e).some(([f,S])=>S&&f!=c)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import ro from"core-js-pure/actual/structured-clone";function rr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ge(...e){let t=e.shift(),o=e.length===1?e[0]:ge(...e);if(!rr(t)||!rr(o))throw new Error("deepmerge can only merge Objects");let i=ro(t);return Object.entries(o).forEach(([r,n])=>{rr(n)?i[r]!==void 0?Object.assign(i,{[r]:ge(i[r],ro(n))}):Object.assign(i,{[r]:ro(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...ro(n)]}):Object.assign(i,{[r]:ro(n)}):Object.assign(i,{[r]:n})}),i}var ga="unknown";function Me(){let{config:e,apiUrl:t}=Xe(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=da(J),{resetOpenFlowState:d}=Be(),[l,m]=ma(!1),c={data:n.map(u=>({flowId:u.id,flowState:Z,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=u=>fetch(u,e).then(v=>{if(v.ok)return v.json();throw new Error("Failed to fetch user flow states")}).catch(v=>(console.log(`Error fetching ${u}: ${v}. Will gracefully degrade and hide Frigade`),s(!0),c)),S=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:T,isLoading:b,mutate:h,error:B}=p?fa(S,f):ua(S,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),y=T==null?void 0:T.data;ca(()=>{!l&&!b&&y&&m(!0)},[y,l,b]);function F(u){return $(this,null,function*(){if(y&&!p){let v=y.find(I=>I.flowId===u);v&&v.flowState!==Z&&(v.flowState=Z),yield h(Promise.resolve(ge(T,{data:y})),{optimisticData:ge(T,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function L(u,v,I){return $(this,null,function*(){if(y){let N=y.find(O=>O.flowId===u);N&&(N.stepStates[v]=I,N.flowState=bt),yield h(Promise.resolve(ge(T,{data:y})),{optimisticData:ge(T,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function A(u,v,I){return $(this,null,function*(){if(y){let N=y.find(O=>O.flowId===u);N&&(N.lastStepId=v,N.stepStates[v]=I,N.flowState=bt),yield h(ge(T,{data:y}),{optimisticData:ge(T,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function x(u){return $(this,null,function*(){if(y){let v=y.find(I=>I.flowId===u);v&&v.flowState!==$e&&(v.flowState=$e,v.lastStepId=ga,Object.keys(v.stepStates).forEach(I=>{v.stepStates[I].actionType=He,v.stepStates[I].createdAt=new Date().toISOString()}),yield h(ge(T,{data:y}),{optimisticData:ge(T,{data:y}),revalidate:!1,rollbackOnError:!1}),d(u))}})}function k(u,v){return $(this,null,function*(){if(y){let I=y.find(N=>N.flowId===u);I&&I.stepStates[v]!==He&&(I.stepStates[v]=He),yield h(ge(T,{data:y}),{optimisticData:ge(T,{data:y}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:y,isLoadingUserFlowStateData:!l,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:A,error:B}}function io(){let{config:e,apiUrl:t}=Xe(),{userFlowStatesData:o,mutateUserFlowState:i}=Me(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=xa(J),[d,l]=ai(new Set),[m,c]=ai(new Set),f=Ut();function S(h){let B=JSON.stringify(h);if(d.has(B))return null;d.add(B),l(d),m.add(h),c(m);let y=s==null?void 0:s.find(F=>F.flowSlug===h.flowSlug&&F.stepId===h.stepId&&F.actionType===h.actionType&&F.createdAt===h.createdAt);return f(`${t}flowResponses`,H(P({},e),{method:"POST",body:B})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),n([...r,h])):y||p(L=>[...L!=null?L:[],h])})}function T(h){return $(this,null,function*(){h.foreignUserId&&(h.actionType===bt||h.actionType===$e?yield S(h):h.actionType===Z?yield S(h):h.actionType===Po?yield S(h):h.actionType===Ke?yield S(h):h.actionType===ko?yield S(h):h.actionType===He&&(yield S(h)))})}function b(){let h=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let y in B.stepStates){let F=B.stepStates[y];h.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...h,...s]}return{addResponse:T,setFlowResponses:p,getFlowResponses:b}}import ba from"swr";var ha=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,pi=e=>{let t=ha.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Ca(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function ir(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var nr=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(nr||{});function R(){let{config:e,apiUrl:t}=Xe(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:l,setFlowResponses:m,setShouldGracefullyDegrade:c,readonly:f}=ya(J),S={data:[]},{verifySDKInitiated:T}=zt(),{addResponse:b,getFlowResponses:h}=io(),B=C=>fetch(C,e).then(w=>w.ok?w.json():(console.log(`Error fetching ${C} (${w.status}): ${w.statusText}. .Will gracefully degrade and hide Frigade`),c(!0),S)).catch(w=>(console.log(`Error fetching ${C}: ${w}. Will gracefully degrade and hide Frigade`),c(!0),S)),{mutateUserFlowState:y,userFlowStatesData:F,isLoadingUserFlowStateData:L,optimisticallyMarkFlowCompleted:A,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:u,optimisticallyMarkStepStarted:v}=Me(),{data:I,error:N,isLoading:O}=ba(n?`${t}flows${f?"?readonly=true":""}`:null,B,{keepPreviousData:!0});Sa(()=>{if(N){console.error(N);return}I&&I.data&&i(I.data)},[I,N]);function z(C){if(O)return null;let w=o.find(g=>g.slug===C);return!w&&o.length>0&&!L&&!O?(console.log(`Flow with id ${C} not found`),null):(w==null?void 0:w.active)===!1&&!f?null:w}function W(C){var U,Se;if(!z(C))return[];let w=z(C).data;return w?(w=q(w),((Se=(U=ir(w))==null?void 0:U.data)!=null?Se:[]).map(se=>{let $t=_(se);return H(P({handleSecondaryButtonClick:()=>{se.skippable===!0&&ue(C,se.id,{skipped:!0})}},se),{complete:ne(C,se.id)===Ke||$t>=1,blocked:Ce(C,se.id),hidden:Ie(C,se.id),handlePrimaryButtonClick:()=>{(!se.completionCriteria&&(se.autoMarkCompleted||se.autoMarkCompleted===void 0)||se.completionCriteria&&se.autoMarkCompleted===!0)&&ue(C,se.id)},progress:$t})}).filter(se=>se.hidden!==!0)):[]}function q(C){return C.replaceAll(/\${(.*?)}/g,(w,g)=>s[g]===void 0?"":String(s[g]).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 ae(C){var g;if(!z(C))return[];let w=z(C).data;return w?(w=q(w),(g=JSON.parse(w))!=null?g:{}):[]}function Q(C,w){p(g=>H(P({},g),{[C]:w}))}function K(C){!L&&!O&&C&&JSON.stringify(s)!=JSON.stringify(P(P({},s),C))&&Object.keys(C).forEach(w=>{Q(w,C[w])})}let he=wt((C,w,g)=>$(this,null,function*(){if(!T())return;let U={foreignUserId:r,flowSlug:C,stepId:w,actionType:Po,data:g!=null?g:{},createdAt:new Date,blocked:!1,hidden:!1};fe(U)&&(yield v(C,w,U),b(U))}),[r,F]),ve=wt((C,w,g)=>$(this,null,function*(){if(!T())return;let U={foreignUserId:r,flowSlug:C,stepId:w,actionType:He,data:g!=null?g:{},createdAt:new Date,blocked:!1,hidden:!1};fe(U)&&(yield u(C,w),b(U))}),[r,F]),ue=wt((C,w,g)=>$(this,null,function*(){if(!T())return;let U={foreignUserId:r,flowSlug:C,stepId:w,actionType:Ke,data:g!=null?g:{},createdAt:new Date,blocked:!1,hidden:!1};fe(U)&&(yield k(C,w,U),b(U))}),[r,F]),G=wt((C,w)=>$(this,null,function*(){if(!T()||X(C)===$e)return;let g={foreignUserId:r,flowSlug:C,stepId:"unknown",actionType:$e,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};yield x(C),fe(g)&&b(g)}),[r,F]),Y=wt((C,w)=>$(this,null,function*(){if(!T())return;let g={foreignUserId:r,flowSlug:C,stepId:"unknown",actionType:bt,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};fe(g)&&b(g)}),[r,F]),ee=wt((C,w)=>$(this,null,function*(){if(!T())return;let g={foreignUserId:r,flowSlug:C,stepId:"unknown",actionType:Z,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};fe(g)&&(yield A(C),b(g))}),[r,F]),Ve=wt((C,w)=>$(this,null,function*(){if(!T())return;let g={foreignUserId:r,flowSlug:C,stepId:"unknown",actionType:ko,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};fe(g)&&(yield A(C),b(g))}),[r,F]);function fe(C){var w;if(!F&&C.actionType===He)return!1;if(F){let g=F.find(U=>U.flowId===C.flowSlug);if(C.actionType===He&&(!(g!=null&&g.stepStates[C.stepId])||g.stepStates[C.stepId].actionType===He)||g&&((w=g.stepStates[C.stepId])==null?void 0:w.actionType)===C.actionType||g&&g.flowState===Z&&C.actionType===Z)return!1}return!0}function ne(C,w){let g=ye(C,w);return L?null:g?g.actionType:He}function Ce(C,w){let g=ye(C,w);return g?g.blocked:!1}function Ie(C,w){let g=ye(C,w);return g?g.hidden:!1}function ye(C,w){var U;if(L)return null;let g=F==null?void 0:F.find(Se=>Se.flowId===C);return!g||!g.stepStates[w]?null:(U=g.stepStates[w])!=null?U:null}function M(C){var g,U;if(L||!F)return null;if(X(C)===$e)return(g=W(C)[0])!=null?g:null;let w=(U=F.find(Se=>Se.flowId===C))==null?void 0:U.lastStepId;return w?W(C).find(Se=>Se.id===w):null}function D(C){var U;let w=M(C);if(!w)return 0;let g=(U=W(C).findIndex(Se=>Se.id===w.id))!=null?U:0;return ne(C,w.id)===Ke&&g<W(C).length-1?g+1:g}function _(C){if(!C.completionCriteria)return;let w=pi(C.completionCriteria);if(w===null)return;let g=we(w),U=De(w);return U===0?void 0:g/U}function X(C){let w=F==null?void 0:F.find(g=>g.flowId===C);return w?w.flowState:null}function we(C){let w=W(C);return w.length===0?0:w.filter(U=>ne(C,U.id)===Ke).length}function De(C){return W(C).length}function mt(C){let w=o.find(g=>g.slug===C);return w?ir(w.data):null}function Ge(C){if(f)return!1;if(L)return!0;if(C!=null&&C.targetingLogic&&F){let w=F.find(g=>g.flowId===C.slug);if(w)return w.shouldTrigger===!1}return!!(C!=null&&C.targetingLogic&&r&&r.startsWith("guest_"))}function Lt(C){return!Ge(z(C))}function Dt(){r&&y()}return{getFlow:z,getFlowData:mt,isLoading:L||O,getStepStatus:ne,getFlowSteps:W,getCurrentStepIndex:D,markStepStarted:he,markStepCompleted:ue,markFlowNotStarted:G,markFlowStarted:Y,markFlowCompleted:ee,markFlowAborted:Ve,markStepNotStarted:ve,getFlowStatus:X,getNumberOfStepsCompleted:we,getNumberOfSteps:De,targetingLogicShouldHideFlow:Ge,setCustomVariable:Q,updateCustomVariables:K,customVariables:s,getStepOptionalProgress:_,getFlowMetadata:ae,isStepBlocked:Ce,isStepHidden:Ie,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:l,isFlowAvailableToUser:Lt,refresh:Dt}}import{useCallback as sr,useContext as wa,useEffect as Ta}from"react";var Wt="guest_";function no(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=wa(J),{config:n,apiUrl:s}=Xe(),{mutateUserFlowState:p}=Me(),d=Ut(),{verifySDKInitiated:l}=zt();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(Wt))return;let T=m(e);localStorage.getItem(T)||(d(`${s}users`,H(P({},n),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,r,t]);let c=sr(T=>$(this,null,function*(){if(!l())return;let b={foreignId:e,properties:T};yield d(`${s}users`,H(P({},n),{method:"POST",body:JSON.stringify(b)})),i(h=>P(P({},h),T)),p()}),[e,n,r,p]),f=sr((T,b)=>$(this,null,function*(){if(!l())return;let B={foreignId:e,events:[{event:T,properties:b}]};yield d(`${s}users`,H(P({},n),{method:"POST",body:JSON.stringify(B)})),p()}),[e,n,p]),S=sr((T,b)=>$(this,null,function*(){if(l())if(b){let h=m(T);localStorage.setItem(h,"true"),o(T);let B={foreignId:T,properties:b};yield d(`${s}users`,H(P({},n),{method:"POST",body:JSON.stringify(B)})),i(y=>P(P({},y),b)),p()}else o(T)}),[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as qp}from"uuid";import Re,{useEffect as vr,useState as un}from"react";import qe,{useEffect as dr,useState as Oa}from"react";import Ao from"styled-components";import Fa from"react";import ka from"styled-components";var di="fr-",so="cfr-";function a(e,t){let o=`${di}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+so+e}return o}function E(e){if(!e.className||e.className.indexOf(so)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(di)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function vo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ne(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 lo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>E(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,ci=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import lr from"react";import va from"styled-components";var Ba=va.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
31
|
-
${e=>
|
|
30
|
+
`,Ee=()=>lr.createElement(Ba,null,lr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},lr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Na}from"react-portal";import Fi from"react";import ar from"react";function Ea({style:e,className:t}){return ar.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},ar.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"}),ar.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 mi=Ea;import pr from"styled-components";import ot from"styled-components";var Bo=ot.div`
|
|
31
|
+
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,Aa=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -51,58 +51,58 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
51
51
|
box-sizing: border-box;
|
|
52
52
|
:hover {
|
|
53
53
|
opacity: 0.8;
|
|
54
|
-
}`,
|
|
54
|
+
}`,Ia=`
|
|
55
55
|
display: block;
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
|
-
`,
|
|
61
|
-
${e=>
|
|
62
|
-
${e=>e.hasImage?
|
|
60
|
+
`,ui=ot.div`
|
|
61
|
+
${e=>E(e)} {
|
|
62
|
+
${e=>e.hasImage?Aa:Ia};
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
65
|
-
${e=>
|
|
64
|
+
`,fi=ot.img`
|
|
65
|
+
${e=>E(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
68
68
|
height: auto;
|
|
69
69
|
min-height: 200px;
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
|
-
`,
|
|
73
|
-
${e=>
|
|
72
|
+
`,gi=ot.div`
|
|
73
|
+
${e=>E(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
76
76
|
height: auto;
|
|
77
77
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
78
78
|
object-fit: cover;
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`,xi=ot.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
align-content: center;
|
|
85
|
-
`,
|
|
85
|
+
`,hi=ot.div`
|
|
86
86
|
padding: 22px 22px 12px;
|
|
87
|
-
`,
|
|
87
|
+
`,Ci=ot.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
justify-content: center;
|
|
92
|
-
`,
|
|
92
|
+
`,yi=ot.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
flex: 2;
|
|
95
95
|
flex-shrink: 1;
|
|
96
96
|
gap: 8px;
|
|
97
97
|
height: 64px;
|
|
98
|
-
${e=>
|
|
98
|
+
${e=>E(e)} {
|
|
99
99
|
flex-direction: row;
|
|
100
100
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
|
-
`,
|
|
105
|
-
${e=>
|
|
104
|
+
`,Si=ot.p`
|
|
105
|
+
${e=>E(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
108
108
|
font-size: 15px;
|
|
@@ -110,7 +110,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
110
110
|
color: #808080;
|
|
111
111
|
}
|
|
112
112
|
margin: 0;
|
|
113
|
-
`;var
|
|
113
|
+
`;var bi=pr.div`
|
|
114
114
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
115
115
|
position: absolute;
|
|
116
116
|
bottom: -47px;
|
|
@@ -121,7 +121,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
121
121
|
align-items: center;
|
|
122
122
|
justify-content: center;
|
|
123
123
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
124
|
-
`,
|
|
124
|
+
`,wi=pr(Bo)`
|
|
125
125
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
126
126
|
position: absolute;
|
|
127
127
|
bottom: -60px;
|
|
@@ -134,7 +134,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
134
134
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
135
135
|
padding: 0;
|
|
136
136
|
z-index: ${e=>e.zIndex};
|
|
137
|
-
`,
|
|
137
|
+
`,Ti=pr.div`
|
|
138
138
|
display: flex;
|
|
139
139
|
justify-content: center;
|
|
140
140
|
align-items: center;
|
|
@@ -143,8 +143,8 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
143
143
|
font-size: 12px;
|
|
144
144
|
line-height: 18px;
|
|
145
145
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
146
|
-
`;function
|
|
147
|
-
${e=>
|
|
146
|
+
`;function Eo({appearance:e}){return Fi.createElement(Ti,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Fi.createElement(mi,null))}var La=Ao.div`
|
|
147
|
+
${e=>E(e)} {
|
|
148
148
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
149
149
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
150
150
|
/* Mobile */
|
|
@@ -155,10 +155,10 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
155
155
|
left: 50%;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
width: ${e=>e.width
|
|
158
|
+
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
159
159
|
z-index: 1500;
|
|
160
|
-
border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)
|
|
161
|
-
${e=>
|
|
160
|
+
border-radius: ${e=>{var t,o,i;return(i=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?i:8}}px;
|
|
161
|
+
${e=>Ne(e)}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
padding: 32px;
|
|
@@ -185,27 +185,27 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,
|
|
188
|
+
`,Da=Ao.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
|
|
191
|
+
`,$a=Ao.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
195
195
|
cursor: pointer;
|
|
196
196
|
z-index: 1501;
|
|
197
|
-
${e=>
|
|
197
|
+
${e=>E(e)} {
|
|
198
198
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
200
|
}
|
|
201
|
-
`,
|
|
201
|
+
`,Ma=Ao.div`
|
|
202
202
|
overflow: scroll;
|
|
203
203
|
flex: 1 1;
|
|
204
204
|
display: flex;
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Je=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Oa("");return dr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),dr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),dr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement(Na,null,qe.createElement(ci,{appearance:n,onClose:()=>{s&&e()}}),qe.createElement(La,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&qe.createElement($a,{className:a("modalClose",n),onClick:()=>e(),appearance:n},qe.createElement(Ee,null)),o&&qe.createElement(Da,null,o),qe.createElement(Ma,null,r),p&&qe.createElement(bi,{appearance:n,className:a("poweredByFrigadeRibbon",n)},qe.createElement(Eo,{appearance:n})))):qe.createElement(qe.Fragment,null)};import ft,{useEffect as cr,useState as Ua}from"react";import Io from"styled-components";import{Portal as za}from"react-portal";function Wa(e){switch(e){case"top-left":return`
|
|
209
209
|
top: 0;
|
|
210
210
|
left: 0;
|
|
211
211
|
`;case"top-right":return`
|
|
@@ -214,8 +214,8 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
214
214
|
`;case"bottom-left":return`
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var
|
|
218
|
-
${e=>
|
|
217
|
+
`}return"right: 0; bottom: 0;"}var _a=Io.div`
|
|
218
|
+
${e=>E(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
221
221
|
position: fixed;
|
|
@@ -228,29 +228,29 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
228
228
|
width: 350px;
|
|
229
229
|
padding: 24px;
|
|
230
230
|
}
|
|
231
|
-
${e=>
|
|
231
|
+
${e=>Wa(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
|
-
`,
|
|
233
|
+
`,Ha=Io.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,
|
|
236
|
+
`,ja=Io.div`
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 16px;
|
|
239
239
|
right: 16px;
|
|
240
240
|
cursor: pointer;
|
|
241
241
|
z-index: 1501;
|
|
242
|
-
${e=>
|
|
242
|
+
${e=>E(e)} {
|
|
243
243
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
244
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
245
|
}
|
|
246
|
-
`,
|
|
246
|
+
`,Va=Io.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
253
|
-
${e=>
|
|
252
|
+
`,Oo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,d]=Ua("");return cr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),cr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),cr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?ft.createElement(za,null,ft.createElement(_a,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&ft.createElement(ja,{className:a("cornerModalClose",r),onClick:()=>e()},ft.createElement(Ee,null)),o&&ft.createElement(Ha,null,o),ft.createElement(Va,null,i))):ft.createElement(ft.Fragment,null)};import{useContext as Ga}from"react";function te(){let{defaultAppearance:e}=Ga(J);function t(o){var r,n,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((r=i.styleOverrides)!=null?r:{},(n=o.styleOverrides)!=null?n:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import Tt,{useContext as up,useEffect as _i,useState as br}from"react";import Mo from"styled-components";import Do,{useEffect as Ai,useState as fr}from"react";import gr from"styled-components";import No from"styled-components";var ki=No.label`
|
|
253
|
+
${e=>E(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
256
256
|
margin-bottom: 5px;
|
|
@@ -260,14 +260,14 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
260
260
|
letter-spacing: 0.24px;
|
|
261
261
|
}
|
|
262
262
|
display: flex;
|
|
263
|
-
`,
|
|
264
|
-
${e=>
|
|
263
|
+
`,Pi=No.label`
|
|
264
|
+
${e=>E(e)} {
|
|
265
265
|
font-size: 12px;
|
|
266
266
|
line-height: 20px;
|
|
267
267
|
margin-bottom: 5px;
|
|
268
268
|
}
|
|
269
269
|
display: flex;
|
|
270
|
-
`,
|
|
270
|
+
`,vi=No.span`
|
|
271
271
|
font-weight: 400;
|
|
272
272
|
font-size: 14px;
|
|
273
273
|
line-height: 22px;
|
|
@@ -275,17 +275,17 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
275
275
|
display: flex;
|
|
276
276
|
margin-right: 5px;
|
|
277
277
|
margin-top: 10px;
|
|
278
|
-
`,
|
|
278
|
+
`,Lo=No.div`
|
|
279
279
|
display: flex;
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import
|
|
283
|
+
`;import mr from"react";var rt={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function gt({title:e,required:t,appearance:o=rt}){return e?mr.createElement(Lo,{className:a("formLabelWrapper",o)},t?mr.createElement(vi,{className:a("formLabelRequired",o),appearance:o},"*"):null,mr.createElement(ki,{className:a("formLabel",o)},e)):null}import Bi from"react";function _t({title:e,appearance:t}){return e?Bi.createElement(Lo,null,Bi.createElement(Pi,{className:a("formSubLabel",t)},e)):null}import{z as ur}from"zod";function Ei(e,t){var o,i,r,n,s,p,d;try{if(t){if(t.type=="number"){let l=ur.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?l=l.positive((r=m.message)!=null?r:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((n=m.message)!=null?n:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=ur.string();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(s=m.message)!=null?s:"Value is too short"):m.requirement=="max"?l=l.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(l=l.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof ur.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var Ka=gr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,
|
|
288
|
-
${e=>
|
|
287
|
+
`,xr=gr.input`
|
|
288
|
+
${e=>E(e)} {
|
|
289
289
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
290
290
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
291
291
|
font-size: 14px;
|
|
@@ -300,8 +300,8 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
|
-
`,
|
|
304
|
-
${e=>
|
|
303
|
+
`,qa=gr.textarea`
|
|
304
|
+
${e=>E(e)} {
|
|
305
305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
306
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
307
307
|
font-size: 14px;
|
|
@@ -316,14 +316,14 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
316
316
|
min-height: 70px;
|
|
317
317
|
box-sizing: border-box;
|
|
318
318
|
margin-bottom: 10px;
|
|
319
|
-
`;function
|
|
319
|
+
`;function hr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=fr((r==null?void 0:r.text)||""),[d,l]=fr(!1),[m,c]=fr(!1),f=xr;Ai(()=>{s===""&&!d&&(l(!0),S(""))},[]),Ai(()=>{if(m){S(s);return}},[m]);function S(b){var B;if(p(b),o({text:b}),n.required===!0&&b.trim()===""){i([{id:n.id,message:`${(B=n.title)!=null?B:"Field"} is required`,hidden:!m}]);return}let h=Ei(b,n.validation);if(h&&(b.trim()!==""||n.required===!0)){i([{id:n.id,message:h,hidden:!m}]);return}i([])}n.multiline&&(f=qa);function T(){var b;switch((b=n==null?void 0:n.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Do.createElement(Ka,null,Do.createElement(gt,{title:n.title,required:n.required,appearance:t.appearance}),Do.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:b=>{S(b.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:T(),onBlur:()=>{c(!0)}}),Do.createElement(_t,{title:n.subtitle,appearance:t.appearance}))}import Qe,{useEffect as Ii,useState as Oi}from"react";import Ni from"styled-components";var Cr="",Ya=Ni.div`
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: column;
|
|
322
322
|
width: 100%;
|
|
323
323
|
-webkit-appearance: none;
|
|
324
324
|
appearance: none;
|
|
325
|
-
`,
|
|
326
|
-
${e=>
|
|
325
|
+
`,Xa=Ni.select`
|
|
326
|
+
${e=>E(e)} {
|
|
327
327
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
328
328
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
329
329
|
font-size: 14px;
|
|
@@ -343,16 +343,16 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
343
343
|
background-repeat: no-repeat;
|
|
344
344
|
background-size: 1.5em 1.5em;
|
|
345
345
|
-webkit-print-color-adjust: exact;
|
|
346
|
-
`;function
|
|
347
|
-
${e=>
|
|
348
|
-
`,
|
|
346
|
+
`;function Li({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var m,c,f,S,T,b,h,B;let n=e,[s,p]=Oi(((m=i==null?void 0:i.choice)==null?void 0:m[0])||""),[d,l]=Oi(!1);return Ii(()=>{var y,F,L,A;if(s===""&&!d){if(l(!0),n.requireSelection){p(Cr);return}if(n.defaultValue&&((y=n.props.options)!=null&&y.find(x=>x.id===n.defaultValue))){let x=(F=n.props.options)==null?void 0:F.find(k=>k.id===n.defaultValue);p(x.id),o({choice:[x.id]})}else p(((L=n.props.options)==null?void 0:L[0].id)||""),o({choice:[((A=n.props.options)==null?void 0:A[0].id)||""]})}},[]),Ii(()=>{n.requireSelection&&s===Cr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),Qe.createElement(Ya,null,Qe.createElement(gt,{title:n.title,required:!1,appearance:t.appearance}),Qe.createElement(Xa,{value:s,onChange:y=>{p(y.target.value),o({choice:[y.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&Qe.createElement("option",{key:"null-value",value:Cr,disabled:!0},(c=n.placeholder)!=null?c:"Select an option"),(f=n.props.options)==null?void 0:f.map(y=>Qe.createElement("option",{key:y.id,value:y.id},y.title))),((T=(S=n.props.options)==null?void 0:S.find(y=>y.id===s))==null?void 0:T.isOpenEnded)&&Qe.createElement(Qe.Fragment,null,Qe.createElement(gt,{title:(B=(h=(b=n.props.options)==null?void 0:b.find(y=>y.id===s))==null?void 0:h.openEndedLabel)!=null?B:"Please specify",required:!1,appearance:t.appearance}),Qe.createElement(xr,{type:"text",placeholder:"Enter your answer here",onChange:y=>{o({choice:[y.target.value]})},appearance:t.appearance})),Qe.createElement(_t,{title:n.subtitle,appearance:t.appearance}))}import co,{useEffect as yr,useState as $i}from"react";import Mi from"styled-components";import po from"react";import ao from"react";var Di=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return ao.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},Ja=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>ao.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},ao.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},ao.createElement(Di,{color:r,size:t}),ao.createElement(Di,{color:e,percentage:o,size:t})),i),Ht=Ja;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>po.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},po.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ra={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ep={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},tp={border:"1px solid #000000",color:"#FFFFFF"},op={border:"1px solid #C5CBD3"},rp={color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np=e=>e==="square"?Ra:ep,sp=(e,t)=>e==="square"?t?tp:op:t?rp:ip,lp=Qa.div`
|
|
347
|
+
${e=>Ne(e)}
|
|
348
|
+
`,it=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=rt,style:n,className:s})=>{let p=np(t),d=sp(t,e);return e===!0?p=H(P(P({},p),d),{backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=P(P({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?po.createElement(Ht,{fillColor:o,percentage:i,size:22}):po.createElement(lp,{styleOverrides:p,style:n,role:"checkbox",className:Te(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&po.createElement(Za,{color:"#FFFFFF"}))};var ap=Mi.div`
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
351
351
|
width: 100%;
|
|
352
352
|
-webkit-appearance: none;
|
|
353
353
|
appearance: none;
|
|
354
|
-
`,
|
|
355
|
-
${e=>
|
|
354
|
+
`,pp=Mi.button`
|
|
355
|
+
${e=>E(e)} {
|
|
356
356
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
357
357
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
358
358
|
font-size: 14px;
|
|
@@ -376,8 +376,8 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
376
376
|
height: 48px;
|
|
377
377
|
padding: 0 18px;
|
|
378
378
|
margin-bottom: 10px;
|
|
379
|
-
`;function
|
|
380
|
-
${e=>
|
|
379
|
+
`;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var m;let n=e,[s,p]=$i((i==null?void 0:i.choice)||[]),[d,l]=$i(!1);return yr(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),yr(()=>{o({choice:s})},[s]),yr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),co.createElement(ap,null,co.createElement(gt,{title:n.title,required:n.required,appearance:t.appearance}),(m=n.props.options)==null?void 0:m.map(c=>co.createElement(pp,{appearance:t.appearance,className:a(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(f=>f!==c.id));return}s.length<n.props.maxChoices?p([...s,c.id]):s.length==1&&n.props.maxChoices==1&&p([c.id])}},c.title,co.createElement(it,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),co.createElement(_t,{title:n.subtitle,appearance:t.appearance}))}import $o from"react";import zi from"styled-components";import dp from"dompurify";function de(e){return{__html:dp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var cp=zi.h1`
|
|
380
|
+
${e=>E(e)} {
|
|
381
381
|
font-style: normal;
|
|
382
382
|
font-weight: 700;
|
|
383
383
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -388,8 +388,8 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
388
388
|
margin-bottom: 4px;
|
|
389
389
|
color: ${e=>e.appearance.theme.colorText};
|
|
390
390
|
}
|
|
391
|
-
`,
|
|
392
|
-
${e=>
|
|
391
|
+
`,mp=zi.h2`
|
|
392
|
+
${e=>E(e)} {
|
|
393
393
|
font-style: normal;
|
|
394
394
|
font-weight: 400;
|
|
395
395
|
font-size: 14px;
|
|
@@ -397,38 +397,38 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
397
397
|
letter-spacing: 0.28px;
|
|
398
398
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
399
399
|
}
|
|
400
|
-
`;function
|
|
400
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return $o.createElement($o.Fragment,null,$o.createElement(cp,{appearance:e,className:a(`${r}${r?lo(i):i}Title`,e),dangerouslySetInnerHTML:de(t),size:i}),o&&$o.createElement(mp,{appearance:e,className:a(`${r}${r?lo(i):i}Subtitle`,e),dangerouslySetInnerHTML:de(o),size:i}))}import*as Sr from"react";var Wi=e=>Sr.createElement("svg",P({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Sr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var fp=Mo.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: column;
|
|
403
403
|
justify-content: flex-end;
|
|
404
404
|
overflow: visible;
|
|
405
405
|
padding-top: 14px;
|
|
406
|
-
`,
|
|
406
|
+
`,gp=Mo.div`
|
|
407
407
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
408
408
|
font-size: 12px;
|
|
409
409
|
margin-bottom: 12px;
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: center;
|
|
412
|
-
`,
|
|
412
|
+
`,xp=Mo.div`
|
|
413
413
|
margin-right: 4px;
|
|
414
414
|
display: inline-flex;
|
|
415
|
-
`,
|
|
415
|
+
`,hp=Mo.div`
|
|
416
416
|
padding-left: 1px;
|
|
417
417
|
padding-right: 1px;
|
|
418
|
-
`,
|
|
418
|
+
`,Cp={text:hr,multipleChoice:Li,multipleChoiceList:Ui},wr="frigade-multiInputStepTypeData";function Hi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var A;let d=t.props,[l,m]=br([]),[c,f]=br([]),{userId:S}=no(),[T,b]=br(F()||(p?p[t.id]:null)||{}),{readonly:h}=up(J),B=P(P({},Cp),s);_i(()=>{i(l.length===0)},[l,i]),_i(()=>{r(T)},[T]);function y(x,k){b(u=>{let v=H(P({},u),{[x.id]:k});return window&&window.localStorage&&!h&&window.localStorage.setItem(L(),JSON.stringify(v)),v})}function F(){if(window&&window.localStorage){let x=window.localStorage.getItem(L());if(x)return JSON.parse(x)}return null}function L(){return`${wr}-${e}-${t.id}-${S}`}return Tt.createElement(hp,{className:a("multiInput",n)},Tt.createElement(Ae,{appearance:n,title:t.title,subtitle:t.subtitle}),Tt.createElement(fp,{className:a("multiInputContainer",n)},(A=d.data)==null?void 0:A.map(x=>{let k=l.reverse().find(u=>u.id===x.id);return B[x.type]?Tt.createElement("span",{key:x.id,"data-field-id":x.id,className:a("multiInputField",n)},B[x.type]({formInput:x,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:u=>{!c.includes(x.id)&&u&&(u==null?void 0:u.text)!==""&&f(v=>[...v,x.id]),y(x,u)},inputData:T[x.id],setFormValidationErrors:u=>{m(v=>u.length===0?v.filter(I=>I.id!==x.id):[...v,...u])}}),k&&k.message&&c.includes(x.id)&&k.hidden!==!0&&Tt.createElement(gp,{key:x.id,style:{overflow:"hidden"},appearance:n,className:a("multiInputValidationError",n)},Tt.createElement(xp,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Tt.createElement(Wi,null)),k.message)):null})))}import jt from"styled-components";var ji=jt.div`
|
|
419
419
|
align-items: center;
|
|
420
420
|
display: flex;
|
|
421
421
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
422
422
|
padding-top: 14px;
|
|
423
|
-
`,
|
|
423
|
+
`,Vi=jt.div`
|
|
424
424
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
425
425
|
font-size: 12px;
|
|
426
|
-
`,
|
|
426
|
+
`,Gi=jt.div`
|
|
427
427
|
display: flex;
|
|
428
428
|
gap: 12px;
|
|
429
429
|
width: 100%;
|
|
430
430
|
justify-content: flex-end;
|
|
431
|
-
`,
|
|
431
|
+
`,Ki=jt.div`
|
|
432
432
|
display: flex;
|
|
433
433
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
434
434
|
// Otherwise, use 4px padding
|
|
@@ -436,11 +436,11 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
436
436
|
flex-grow: 1;
|
|
437
437
|
flex-basis: 0;
|
|
438
438
|
position: relative;
|
|
439
|
-
`,
|
|
439
|
+
`,qi=jt.div`
|
|
440
440
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
441
441
|
position: relative;
|
|
442
442
|
overflow-y: auto;
|
|
443
|
-
`,
|
|
443
|
+
`,Yi=jt.div`
|
|
444
444
|
display: flex;
|
|
445
445
|
align-self: stretch;
|
|
446
446
|
flex-grow: 1;
|
|
@@ -452,7 +452,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
452
452
|
background-position: center;
|
|
453
453
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
454
454
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
455
|
-
`;import
|
|
455
|
+
`;import xt from"react";import Ji from"react";import Qi from"styled-components";import yp from"styled-components";var Xi=yp.div`
|
|
456
456
|
width: 24px;
|
|
457
457
|
height: 24px;
|
|
458
458
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -470,10 +470,10 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
470
470
|
transform: rotate(360deg);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
`;var
|
|
473
|
+
`;var Sp=Qi.button`
|
|
474
474
|
justify-content: center;
|
|
475
475
|
align-content: center;
|
|
476
|
-
${e=>
|
|
476
|
+
${e=>E(e)} {
|
|
477
477
|
display: flex;
|
|
478
478
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
479
479
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -488,7 +488,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
488
488
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
489
489
|
line-height: 20px;
|
|
490
490
|
font-weight: 500;
|
|
491
|
-
${e=>
|
|
491
|
+
${e=>Ne(e)}
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
font-family: inherit;
|
|
@@ -502,8 +502,8 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
502
502
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
503
503
|
cursor: not-allowed;
|
|
504
504
|
}
|
|
505
|
-
`,
|
|
506
|
-
${e=>
|
|
505
|
+
`,Uo=Qi.div`
|
|
506
|
+
${e=>E(e)} {
|
|
507
507
|
display: flex;
|
|
508
508
|
flex-direction: row;
|
|
509
509
|
justify-content: flex-start;
|
|
@@ -513,14 +513,14 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
513
513
|
margin-right: 8px;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
`,
|
|
516
|
+
`,oe=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var f;function c(){let S=s?"buttonSecondary":"button";return l===""?S:`${l}${lo(S)}`}return Ji.createElement(Sp,{secondary:s,appearance:p,disabled:i||m,loading:(f=m==null?void 0:m.toString())!=null?f:"",onClick:e,styleOverrides:o,type:r,withMargin:d,size:n,className:a(c(),p)},m?Ji.createElement(Xi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var Zi=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var S;let c=s.length>1&&n!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return xt.createElement(xt.Fragment,null,l!==null&&l!=null&&xt.createElement(Vi,{appearance:o,className:a("formCTAError",o)},l),xt.createElement(ji,{showBackButton:c,className:a("formCTAContainer",o)},c&&xt.createElement(oe,{title:(S=e.backButtonTitle)!=null?S:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),xt.createElement(Gi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?xt.createElement(oe,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?xt.createElement(oe,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};import Tr from"react";import bp from"styled-components";var wp=bp.div`
|
|
517
517
|
text-align: center;
|
|
518
|
-
`,
|
|
518
|
+
`,Ri=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=te().mergeAppearanceWithDefault(i);return Tr.createElement(wp,{className:o},Tr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>Tr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import Ft from"react";import Vt from"styled-components";import{useContext as Tp}from"react";function pe(){let e=Tp(J);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Fp=Vt.div`
|
|
519
519
|
display: flex;
|
|
520
520
|
flex-wrap: wrap;
|
|
521
521
|
align-content: center;
|
|
522
522
|
justify-content: center;
|
|
523
|
-
`,
|
|
523
|
+
`,kp=Vt.div`
|
|
524
524
|
align-content: center;
|
|
525
525
|
align-items: center;
|
|
526
526
|
display: flex;
|
|
@@ -534,10 +534,10 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
534
534
|
flex-basis: 255px;
|
|
535
535
|
flex-grow: 0;
|
|
536
536
|
flex-shrink: 0;
|
|
537
|
-
`,
|
|
537
|
+
`,Pp=Vt.img`
|
|
538
538
|
width: 78px;
|
|
539
539
|
height: auto;
|
|
540
|
-
`,
|
|
540
|
+
`,vp=Vt.button`
|
|
541
541
|
font-style: normal;
|
|
542
542
|
font-weight: 600;
|
|
543
543
|
font-size: 13px;
|
|
@@ -550,11 +550,11 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
550
550
|
border-radius: 100px;
|
|
551
551
|
padding: 8px 12px;
|
|
552
552
|
margin-top: 16px;
|
|
553
|
-
`,
|
|
553
|
+
`,Bp=Vt.h1`
|
|
554
554
|
font-weight: 700;
|
|
555
555
|
font-size: 28px;
|
|
556
556
|
line-height: 34px;
|
|
557
|
-
`,
|
|
557
|
+
`,Ep=Vt.h2`
|
|
558
558
|
font-style: normal;
|
|
559
559
|
font-weight: 400;
|
|
560
560
|
font-size: 16px;
|
|
@@ -563,7 +563,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
563
563
|
margin-top: 12px;
|
|
564
564
|
margin-bottom: 16px;
|
|
565
565
|
max-width: 70%;
|
|
566
|
-
`;function
|
|
566
|
+
`;function en({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=pe();return Ft.createElement("div",null,Ft.createElement(Bp,null,e.title),Ft.createElement(Ep,null,e.subtitle),Ft.createElement(Fp,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>Ft.createElement(kp,{key:n.title},Ft.createElement(Pp,{src:n.imageUri}),Ft.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;n.uri&&o(n.uri,(s=n.uriTarget)!=null?s:"_blank")}},n.title)))))}import Gt,{useEffect as $p}from"react";import _o from"styled-components";import Fr from"react";var zo=({style:e,className:t})=>Fr.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},Fr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Fr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import mo,{useRef as Ap,useState as Ip}from"react";import Wo from"styled-components";var Op=Wo.div`
|
|
567
567
|
display: flex;
|
|
568
568
|
align-items: center;
|
|
569
569
|
justify-content: flex-start;
|
|
@@ -571,7 +571,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
571
571
|
width: 100%;
|
|
572
572
|
height: 100%;
|
|
573
573
|
position: relative;
|
|
574
|
-
`,
|
|
574
|
+
`,Np=Wo.div`
|
|
575
575
|
position: absolute;
|
|
576
576
|
display: flex;
|
|
577
577
|
align-items: center;
|
|
@@ -590,56 +590,56 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
590
590
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
591
591
|
border-radius: 50%;
|
|
592
592
|
}
|
|
593
|
-
`,
|
|
593
|
+
`,Lp=Wo.video`
|
|
594
594
|
width: 100%;
|
|
595
595
|
height: 100%;
|
|
596
596
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
597
|
-
`,
|
|
597
|
+
`,Dp=Wo.iframe`
|
|
598
598
|
width: 100%;
|
|
599
599
|
height: 100%;
|
|
600
600
|
min-height: 260px;
|
|
601
601
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
602
|
-
`;function
|
|
603
|
-
${e=>
|
|
602
|
+
`;function Ze({appearance:e,videoUri:t}){let o=Ap(),[i,r]=Ip(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),mo.createElement(Dp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return mo.createElement(Op,{className:a("videoPlayerWrapper",e),appearance:e},!i&&mo.createElement(Np,{onClick:()=>{r(!0),o.current.play()},appearance:e},mo.createElement(zo,null)),mo.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Mp=_o.div`
|
|
603
|
+
${e=>E(e)} {
|
|
604
604
|
display: flex;
|
|
605
605
|
flex-direction: column;
|
|
606
606
|
justify-content: center;
|
|
607
607
|
}
|
|
608
|
-
`,
|
|
609
|
-
${e=>
|
|
608
|
+
`,Up=_o.img`
|
|
609
|
+
${e=>E(e)} {
|
|
610
610
|
width: 100%;
|
|
611
611
|
height: auto;
|
|
612
612
|
max-height: 250px;
|
|
613
613
|
margin-bottom: 24px;
|
|
614
614
|
}
|
|
615
|
-
`,
|
|
616
|
-
${e=>
|
|
615
|
+
`,zp=_o.div`
|
|
616
|
+
${e=>E(e)} {
|
|
617
617
|
margin-bottom: 24px;
|
|
618
618
|
}
|
|
619
|
-
`,
|
|
620
|
-
${e=>
|
|
619
|
+
`,Wp=_o.div`
|
|
620
|
+
${e=>E(e)} {
|
|
621
621
|
width: 100%;
|
|
622
622
|
height: auto;
|
|
623
623
|
max-height: 250px;
|
|
624
624
|
margin-bottom: 24px;
|
|
625
625
|
}
|
|
626
|
-
`;function
|
|
626
|
+
`;function tn({stepData:e,appearance:t,setCanContinue:o}){return $p(()=>{o(!0)},[]),Gt.createElement(Mp,{className:a("callToActionContainer",t)},Gt.createElement(zp,{className:a("callToActionTextContainer",t)},Gt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Gt.createElement(Up,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Gt.createElement(Wp,{appearance:t,className:a("callToActionVideo",t)},Gt.createElement(Ze,{appearance:t,videoUri:e.videoUri})))}import nt,{useEffect as kr,useState as Pr}from"react";import ht from"styled-components";var on=ht.div`
|
|
627
627
|
width: auto;
|
|
628
628
|
display: flex;
|
|
629
629
|
flex-direction: column;
|
|
630
630
|
justify-content: center;
|
|
631
631
|
align-items: center;
|
|
632
632
|
padding: 4px;
|
|
633
|
-
`,
|
|
633
|
+
`,rn=ht.div`
|
|
634
634
|
width: 100%;
|
|
635
635
|
text-align: left;
|
|
636
|
-
`,
|
|
636
|
+
`,nn=ht.h1`
|
|
637
637
|
font-style: normal;
|
|
638
638
|
font-weight: 700;
|
|
639
639
|
font-size: 32px;
|
|
640
640
|
line-height: 38px;
|
|
641
641
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
642
|
-
`,
|
|
642
|
+
`,sn=ht.h1`
|
|
643
643
|
font-style: normal;
|
|
644
644
|
font-weight: 400;
|
|
645
645
|
font-size: 16px;
|
|
@@ -647,7 +647,7 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
647
647
|
margin-top: 16px;
|
|
648
648
|
margin-bottom: 16px;
|
|
649
649
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
650
|
-
`,
|
|
650
|
+
`,ln=ht.div`
|
|
651
651
|
padding-top: 12px;
|
|
652
652
|
padding-bottom: 12px;
|
|
653
653
|
flex-direction: row;
|
|
@@ -658,17 +658,17 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
658
658
|
cursor: pointer;
|
|
659
659
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
660
660
|
width: 100%;
|
|
661
|
-
`,
|
|
661
|
+
`,an=ht.div`
|
|
662
662
|
padding-top: 10px;
|
|
663
663
|
padding-bottom: 10px;
|
|
664
664
|
flex-direction: row;
|
|
665
665
|
display: flex;
|
|
666
666
|
justify-content: flex-start;
|
|
667
|
-
`,
|
|
667
|
+
`,pn=ht.img`
|
|
668
668
|
width: 42px;
|
|
669
669
|
height: 42px;
|
|
670
670
|
margin-right: 12px;
|
|
671
|
-
`,
|
|
671
|
+
`,dn=ht.p`
|
|
672
672
|
font-style: normal;
|
|
673
673
|
font-weight: 500;
|
|
674
674
|
font-size: 17px;
|
|
@@ -676,8 +676,8 @@ import bt,{createContext as ed,useEffect as zo,useState as ze}from"react";import
|
|
|
676
676
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
677
677
|
display: flex;
|
|
678
678
|
align-self: center;
|
|
679
|
-
`;var
|
|
680
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map(([i,r])=>typeof r=="object"?`${i} { ${Object.entries(r).map(([s,p])=>`${bo(s)}: ${p};`).join(" ")} }`:`${bo(i)}: ${r};`).join(" ")} }`).join(" ")}`;function oe({appearance:e}){if(!e||!e.styleOverrides)return ao.createElement(ao.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?ao.createElement(ao.Fragment,null):ao.createElement(Pp,{inlineStyles:t})}var Ri=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:k=!1,modalPosition:S="center",repeatable:b=!1,onDismiss:u,showPagination:v=!1,allowBackNavigation:T=!1,validationHandler:C,showFrigadeBranding:N=!1,onFormDataChange:A,showFooter:h=!0,prefillData:w={},updateUrlOnPageChange:f=!1})=>{var X;let{getFlow:F,getFlowSteps:I,isLoading:O,targetingLogicShouldHideFlow:E,getFlowStatus:D,getCurrentStepIndex:$,markFlowCompleted:V,markFlowNotStarted:j,markStepStarted:Y}=J(),de=$(e),{mergeAppearanceWithDefault:he}=Z(),[K,te]=Zi(!1),[Q,Se]=Zi(!1),{setOpenFlowState:me,getOpenFlowState:Ee,hasOpenModals:re}=Fe(),ne=I(e);c=he(c);let[Te,L]=i!==void 0&&r!==void 0?[i,r]:[Ee(e,!0),H=>me(e,H)];if(br(()=>{!K&&!O&&(te(!0),(D(e)===q&&b||D(e)===Ne)&&(D(e)===q&&b&&j(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(se=>{se.startsWith(xr)&&window.localStorage.removeItem(se)})),te(!0))},[K,te,O]),br(()=>{window&&T&&!Q&&(window.location.hash=ne[de].id,Se(!0))},[T,Q,Se]),br(()=>{var H;if(window&&((H=window==null?void 0:window.location)!=null&&H.hash)&&window.location.hash.replace("#","")!==ne[de].id){let se=window.location.hash.replace("#",""),Ae=ne.findIndex(Ie=>Ie.id===se);Ae!==-1&&Ae!==de&&Y(e,ne[Ae].id)}},[(X=window==null?void 0:window.location)==null?void 0:X.hash]),O)return null;let U=F(e);if(!U||E(U)||!ne||i!==void 0&&i===!1||D(e)===q&&l||(o=="modal"||o=="corner-modal")&&re(e))return null;let _=()=>{L(!1),u&&u(),k===!0&&V(e)};if(S=="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",qe.createElement(Ve,{appearance:c,onClose:_,visible:Te,style:H,dismissible:x,showFrigadeBranding:N},qe.createElement(oe,{appearance:c}),qe.createElement($o,{appearance:c,steps:ne,selectedStep:de,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:L,onDismiss:u,showPagination:v,customFormElements:s,allowBackNavigation:T,validationHandler:C,onFormDataChange:A,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))}return o==="modal"&&S!=="center"?qe.createElement(Po,{appearance:c,onClose:_,visible:Te,modalPosition:S},qe.createElement(oe,{appearance:c}),qe.createElement($o,{appearance:c,steps:ne,selectedStep:de,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:L,onDismiss:u,showPagination:v,customFormElements:s,allowBackNavigation:T,validationHandler:C,onFormDataChange:A,showFooter:h,prefillData:w,updateUrlOnPageChange:f})):qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:c}),qe.createElement($o,{appearance:c,steps:ne,selectedStep:de,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:L,onDismiss:u,showPagination:v,customFormElements:s,allowBackNavigation:T,validationHandler:C,onFormDataChange:A,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))},en=Ri;import{useCallback as wr,useContext as vp,useEffect as Bp}from"react";function Tr(){let{organizationId:e,userId:t,setOrganizationId:o}=vp(G),{mutateUserFlowState:i}=Oe(),{config:r,apiUrl:n}=je(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,k){return`frigade-user-group-registered-${x}-${k}`}Bp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=wr(async x=>{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 k={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(k)}),i()},[e,t,r,i]),g=wr(async(x,k)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:k}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()},[e,t,r,i]),d=wr(async(x,k)=>{if(p())if(k){let S=c(t,x);localStorage.setItem(S,"true"),o(x);let b={foreignUserId:t,foreignUserGroupId:x,properties:k};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var tn="frigade-xFrigade_guestUserId",co="frigade-xFrigade_userId",on=({})=>{let{setFlowResponses:e}=Rt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Oe(),{userId:r,setUserId:n}=eo(),[s,p]=Mo(r),{getFlowStatus:c}=J(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Ep(G),[k,S]=Mo([]),[b,u]=Mo([]),{organizationId:v}=Tr(),[T,C]=Mo(v);po(()=>{if(!o&&t)for(let w=0;w<t.length;w++){let f=t[w],F=l.find(I=>I.slug===(f==null?void 0:f.flowId));if(F&&f&&f.shouldTrigger===!0&&F.type=="FORM"&&F.triggerType==="AUTOMATIC"&&!b.includes(F.slug)){setTimeout(()=>{N(f.flowId)},500);break}}},[o,t]),po(()=>{x.length>0&&i()},[x]);function N(w){let f=l.find(F=>F.slug===w);f&&f.triggerType==="AUTOMATIC"&&!b.includes(f.slug)&&(u([...b,f.slug]),S([f]))}function A(){if(!r){let w=localStorage.getItem(co);if(w){n(w);return}let f=localStorage.getItem(tn);if(f){n(f);return}d(!0);let F=Lt+Ap();try{localStorage.setItem(tn,F)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}n(I=>I||F)}}po(()=>{try{if(l){let w=[];l.forEach(f=>{if(f.data){let F=f.data.match(/"imageUri":"(.*?)"/g);F&&F.forEach(I=>{let O=I.replace('"imageUri":"',"").replace('"',"");if(w.includes(O))return;let E=new Image;E.src=O,w.push(O)})}})}}catch{}},[l]),po(()=>{if(r!==s&&(e([]),i()),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(co,r)}catch(w){console.log("Failed to save user id locally: Local storage available",w)}r===null&&setTimeout(()=>{r===null&&A()},50)},[r,l,g]),po(()=>{v!=T&&(C(v),e([]),i())},[v,T,C]);function h(){return St.createElement(St.Fragment,null,k.map(w=>c(w.slug)!==Ne?null:St.createElement("span",{key:w.slug},St.createElement(en,{flowId:w.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(h,null))};import{ErrorBoundary as od}from"react-error-boundary";var rn={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 Ip(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(rn[o]){let r=rn[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Np(e){if(!e)return;let t=fe({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function nn(e){let{theme:t,styleOverrides:o}=e,i=Ip(t),r=Np(o);return{overrides:i,css:r}}import Kp from"styled-components";import{compose as qp,variant as ln}from"styled-system";import sn from"react";import Op,{ThemeProvider as Lp,useTheme as Dp}from"styled-components";import{border as $p,color as Mp,compose as Up,get as zp,shadow as Wp,space as _p,system as Hp,typography as jp}from"styled-system";var Vp={width:{property:"width",scale:"sizes",transform:(e,t)=>zp(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},Gp=Op("div")(({css:e})=>e,Up($p,Mp,Wp,_p,jp,Hp(Vp))),mo=({as:e,children:t,overrides:o,...i})=>{let r=Dp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>sn.createElement(Gp,{as:e,...n,...i},t);if(o!==void 0){let p=fe(r,o);return sn.createElement(Lp,{theme:p},s())}return s()};var uo={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"}},Yp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},an=Kp(mo)(()=>({whiteSpace:"nowrap"}),qp(ln({scale:"components.Button",variants:"components.Button"}),ln({prop:"size",variants:Yp})));import Xp from"styled-components";import{variant as Jp,system as Qp}from"styled-system";var Uo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var pn=Xp(mo)(Jp({scale:"components.Text",variants:"components.Text"}),Qp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var dn=4,cn="px",Zp=20,Rp=Object.fromEntries(Array.from(Array(Zp+1),(e,t)=>t===0?[.5,`${.5*dn}${cn}`]:[t,`${t*dn}${cn}`])),Wt={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"},Fr={colors:{...Wt,neutral:{foreground:Wt.gray300},primary:{background:Wt.blue500,foreground:Wt.white,inverted:Wt.blue500},negative:{foreground:Wt.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:Rp,components:{Button:uo,Text:Uo}};var mn="https://api.frigade.com",G=ed({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Qe,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:mn,readonly:!1,debug:!1});function rd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var id=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var de,he;let[n,s]=ze(t||null),[p,c]=ze(o||null),[l,g]=ze([]),[d,x]=ze([]),[k,S]=ze([]),[b,u]=ze({}),[v,T]=ze({}),[C,N]=ze([]),[A,h]=ze({}),[w,f]=ze(!1),[F,I]=ze(!1),[O,E]=ze(!V(e)),D=(K,te)=>{if(te==="_blank"){window.open(K,"_blank");return}setTimeout(()=>{window.location.href=K},50)},$={theme:{...Qe.theme,...((de=i==null?void 0:i.defaultAppearance)==null?void 0:de.theme)??{}},styleOverrides:{...Qe.styleOverrides,...((he=i==null?void 0:i.defaultAppearance)==null?void 0:he.styleOverrides)??{}}};function V(K){return!!(K&&K.length>10&&K.substring(0,10)==="api_public")}zo(()=>{t&&s(t)},[t]),zo(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(co)&&window.localStorage.getItem(co)!==n&&rd()},[n]),zo(()=>{o&&c(o)},[o]),zo(()=>{if(V(e))E(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),E(!0);return}},[e,E]);let j={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:k,setFlowResponses:S,userProperties:b,setUserProperties:u,openFlowStates:v,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:C,setCompletedFlowsToKeepOpenDuringSession:N,customVariables:A,setCustomVariables:h,isNewGuestUser:w,setIsNewGuestUser:f,hasActiveFullPageFlow:F,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:D,defaultAppearance:$,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:E,apiUrl:i&&i.apiUrl?i.apiUrl:mn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return bt.createElement(G.Provider,{value:j},r);let{overrides:Y}=nn($);return bt.createElement(od,{fallback:bt.createElement(bt.Fragment,null,r)},bt.createElement(G.Provider,{value:j},bt.createElement(td,{theme:fe($.theme,Fr,Y??{},(i==null?void 0:i.theme)??{})},r,bt.createElement(on,null))))};import Kd from"react";import ge,{useEffect as Hs,useState as js}from"react";import He,{useState as wd}from"react";import Ft from"styled-components";import Ho from"react";import wt from"react";import fn from"styled-components";var un=fn.span`
|
|
679
|
+
`;var cn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=Pr([]),[p,d]=Pr(!1),[l,m]=Pr(e.id);return kr(()=>{n.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),kr(()=>{l!==e.id&&(m(e.id),s([]))},[e]),kr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),nt.createElement(on,{className:a("selectListContainer",i)},nt.createElement(rn,null,nt.createElement(nn,{className:a("selectListTitle",i)},e.title),nt.createElement(sn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((c,f)=>{let S=n.includes(c.id);return nt.createElement(ln,{key:`select-item-${f}`,onClick:()=>{if(n.includes(c.id)){s(n.filter(T=>T!==c.id));return}n.length<r.maxChoices?s([...n,c.id]):n.length==1&&r.maxChoices==1&&s([c.id])},hideBottomBorder:f===r.options.length-1,className:a("selectListSelectItem",i)},nt.createElement(an,{className:a("selectListItemImage",i)},c.imageUri&&nt.createElement(pn,{src:c.imageUri,alt:`select-icon-${f}`}),nt.createElement(dn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),nt.createElement(it,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};import Ue,{useEffect as mn,useState as uo}from"react";var _p=({children:e,id:t,shouldWrap:o=!1})=>Ue.createElement(Ue.Fragment,null,o?Ue.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Ho=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:f,onDismiss:S,showPagination:T=!1,customFormElements:b,allowBackNavigation:h,validationHandler:B,onFormDataChange:y,showFooter:F,prefillData:L,updateUrlOnPageChange:A})=>{var M;let k=P(P({},{linkCollection:en,multiInput:Hi,callToAction:tn,selectList:cn}),i),{primaryCTAClickSideEffects:u,secondaryCTAClickSideEffects:v}=pe(),[I,N]=uo(!1),[O,z]=uo({}),[W,q]=uo(!1),[ae,Q]=uo(!1),[K,he]=uo(null),ve=(M=t[o])!=null?M:null,{markStepCompleted:ue,markStepStarted:G,isLoading:Y,updateCustomVariables:ee,markFlowCompleted:Ve}=R();mn(()=>{ee(r)},[r,Y]),mn(()=>{y&&y(O,fe(),t[o],o)},[O]);function fe(){var _;return{data:(_=O[t[o].id])!=null?_:{},stepId:t[o].id,customVariables:r}}function ne(D,_,X){let we=o+1<t.length?t[o+1]:null;return s&&s(D,X,we,O,fe()),n?n(D,o,_,we):!0}function Ce(D,_){z(X=>{let we={};return we[D.id]=_,P(P({},X),we)})}function Ie(D){return D.selectedStep.imageUri?Ue.createElement(Yi,{image:D.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let ye=F&&Ue.createElement(Zi,{step:t[o],canContinue:I&&!W,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>$(void 0,null,function*(){if(q(!0),B){let X=yield B(t[o],o,t[o+1],O,fe());if(X!==!0){he(typeof X=="string"?X:null),q(!1);return}else he(null)}let D=P({},fe());yield ue(p,t[o].id,D),o+1<t.length&&(yield G(p,t[o+1].id));let _=ne(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),S&&S(),l&&_&&(c&&c(!1),f(!1)),yield Ve(p)),u(t[o]),q(!1),window&&h&&o+1<t.length&&(window.location.hash=t[o+1].id),window&&!h&&A&&o+1<t.length){let X=new URL(window.location.href);X.searchParams.set("p",t[o+1].id),window.history.pushState({},"",X.toString())}}),onSecondaryClick:()=>{ne(t[o],"secondary",o),v(t[o])},onBack:()=>$(void 0,null,function*(){o-1>=0&&(q(!0),yield G(p,t[o-1].id),q(!1))}),steps:t,allowBackNavigation:h,errorMessage:K,isSaving:W});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Ki,{className:a("formContainer",e)},Ue.createElement(_p,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(qi,{key:ve.id,type:d,className:a("formContent",e)},t.map(D=>{let _=k[D.type];return ve.id!==D.id?null:Ue.createElement(_,{key:D.id,stepData:D,canContinue:I,setCanContinue:N,onSaveData:X=>{Ce(D,X)},appearance:e,customFormElements:b,flowId:p,prefillData:L})}),T&&Ue.createElement(Ri,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ye)),d=="large-modal"&&Ue.createElement(Ie,{selectedStep:t[o]})))};import fo from"react";import{createGlobalStyle as Hp}from"styled-components";var jp=Hp`
|
|
680
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${so}${t}.${so}${t} { ${Object.entries(o).map(([i,r])=>typeof r=="object"?`${i} { ${Object.entries(r).map(([s,p])=>`${vo(s)}: ${p};`).join(" ")} }`:`${vo(i)}: ${r};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return fo.createElement(fo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?fo.createElement(fo.Fragment,null):fo.createElement(jp,{inlineStyles:t})}var fn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:S=!1,modalPosition:T="center",repeatable:b=!1,onDismiss:h,showPagination:B=!1,allowBackNavigation:y=!1,validationHandler:F,showFrigadeBranding:L=!1,onFormDataChange:A,showFooter:x=!0,prefillData:k={},updateUrlOnPageChange:u=!1})=>{var D;let{getFlow:v,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:O,getFlowStatus:z,getCurrentStepIndex:W,markFlowCompleted:q,markFlowNotStarted:ae,markStepStarted:Q}=R(),K=W(e),{mergeAppearanceWithDefault:he}=te(),[ve,ue]=un(!1),[G,Y]=un(!1),{setOpenFlowState:ee,getOpenFlowState:Ve,hasOpenModals:fe}=Be(),ne=I(e);d=he(d);let[Ce,Ie]=i!==void 0&&r!==void 0?[i,r]:[Ve(e,!0),_=>ee(e,_)];if(vr(()=>{!ve&&!N&&(ue(!0),(z(e)===Z&&b||z(e)===$e)&&(z(e)===Z&&b&&ae(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(X=>{X.startsWith(wr)&&window.localStorage.removeItem(X)})),ue(!0))},[ve,ue,N]),vr(()=>{window&&y&&!G&&(window.location.hash=ne[K].id,Y(!0))},[y,G,Y]),vr(()=>{var _;if(window&&((_=window==null?void 0:window.location)!=null&&_.hash)&&window.location.hash.replace("#","")!==ne[K].id){let X=window.location.hash.replace("#",""),we=ne.findIndex(De=>De.id===X);we!==-1&&we!==K&&Q(e,ne[we].id)}},[(D=window==null?void 0:window.location)==null?void 0:D.hash]),N)return null;let ye=v(e);if(!ye||O(ye)||!ne||i!==void 0&&i===!1||z(e)===Z&&l||(o=="modal"||o=="corner-modal")&&fe(e))return null;let M=()=>{Ie(!1),h&&h(),S===!0&&q(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let _={padding:"24px"};return o==="large-modal"?(_.width="85%",_.height="90%",_.maxHeight="800px",_.minHeight="500px",_.padding="0"):_.width="400px",Re.createElement(Je,{appearance:d,onClose:M,visible:Ce,style:_,dismissible:f,showFrigadeBranding:L},Re.createElement(ie,{appearance:d}),Re.createElement(Ho,{appearance:d,steps:ne,selectedStep:K,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Ie,onDismiss:h,showPagination:B,customFormElements:s,allowBackNavigation:y,validationHandler:F,onFormDataChange:A,showFooter:x,prefillData:k,updateUrlOnPageChange:u}))}return o==="modal"&&T!=="center"?Re.createElement(Oo,{appearance:d,onClose:M,visible:Ce,modalPosition:T},Re.createElement(ie,{appearance:d}),Re.createElement(Ho,{appearance:d,steps:ne,selectedStep:K,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Ie,onDismiss:h,showPagination:B,customFormElements:s,allowBackNavigation:y,validationHandler:F,onFormDataChange:A,showFooter:x,prefillData:k,updateUrlOnPageChange:u})):Re.createElement(Re.Fragment,null,Re.createElement(ie,{appearance:d}),Re.createElement(Ho,{appearance:d,steps:ne,selectedStep:K,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Ie,onDismiss:h,showPagination:B,customFormElements:s,allowBackNavigation:y,validationHandler:F,onFormDataChange:A,showFooter:x,prefillData:k,updateUrlOnPageChange:u}))},gn=fn;import{useCallback as Br,useContext as Vp,useEffect as Gp}from"react";function Er(){let{organizationId:e,userId:t,setOrganizationId:o}=Vp(J),{mutateUserFlowState:i}=Me(),{config:r,apiUrl:n}=Xe(),s=Ut(),{verifySDKInitiated:p}=zt();function d(f,S){return`frigade-user-group-registered-${f}-${S}`}Gp(()=>{if(t&&e){if(t.startsWith(Wt))return;let f=d(t,e);localStorage.getItem(f)||(s(`${n}userGroups`,H(P({},r),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Br(f=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:f};yield s(`${n}userGroups`,H(P({},r),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,r,i]),m=Br((f,S)=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:S}]};yield s(`${n}userGroups`,H(P({},r),{method:"POST",body:JSON.stringify(b)})),i()}),[e,t,r,i]),c=Br((f,S)=>$(this,null,function*(){if(p())if(S){let T=d(t,f);localStorage.setItem(T,"true"),o(f);let b={foreignUserId:t,foreignUserGroupId:f,properties:S};yield s(`${n}userGroups`,H(P({},r),{method:"POST",body:JSON.stringify(b)})),i()}else o(f)}),[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var xn="frigade-xFrigade_guestUserId",xo="frigade-xFrigade_userId",hn=({})=>{let{setFlowResponses:e}=io(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Me(),{userId:r,setUserId:n}=no(),[s,p]=jo(r),{getFlowStatus:d}=R(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Kp(J),[S,T]=jo([]),[b,h]=jo([]),{organizationId:B}=Er(),[y,F]=jo(B);go(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let u=t[k],v=l.find(I=>I.slug===(u==null?void 0:u.flowId));if(v&&u&&u.shouldTrigger===!0&&v.type=="FORM"&&v.triggerType==="AUTOMATIC"&&!b.includes(v.slug)){setTimeout(()=>{L(u.flowId)},500);break}}},[o,t]),go(()=>{f.length>0&&i()},[f]);function L(k){let u=l.find(v=>v.slug===k);u&&u.triggerType==="AUTOMATIC"&&!b.includes(u.slug)&&(h([...b,u.slug]),T([u]))}function A(){if(!r){let k=localStorage.getItem(xo);if(k){n(k);return}let u=localStorage.getItem(xn);if(u){n(u);return}c(!0);let v=Wt+qp();try{localStorage.setItem(xn,v)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}n(I=>I||v)}}go(()=>{try{if(l){let k=[];l.forEach(u=>{if(u.data){let v=u.data.match(/"imageUri":"(.*?)"/g);v&&v.forEach(I=>{let N=I.replace('"imageUri":"',"").replace('"',"");if(k.includes(N))return;let O=new Image;O.src=N,k.push(N)})}})}}catch(k){}},[l]),go(()=>{if(r!==s&&(e([]),i()),p(r),r&&!r.startsWith(Wt))try{localStorage.setItem(xo,r)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}r===null&&setTimeout(()=>{r===null&&A()},50)},[r,l,m]),go(()=>{B!=y&&(F(B),e([]),i())},[B,y,F]);function x(){return kt.createElement(kt.Fragment,null,S.map(k=>d(k.slug)!==$e?null:kt.createElement("span",{key:k.slug},kt.createElement(gn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return kt.createElement(kt.Fragment,null,kt.createElement(x,null))};import{ErrorBoundary as yd}from"react-error-boundary";var Cn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function Yp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Cn[o]){let r=Cn[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Xp(e){if(!e)return;let t=ge({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function yn(e){let{theme:t,styleOverrides:o}=e,i=Yp(t),r=Xp(o);return{overrides:i,css:r}}import pd from"styled-components";import{compose as dd,variant as bn}from"styled-system";import Sn from"react";import Jp,{ThemeProvider as Qp,useTheme as Zp}from"styled-components";import{border as Rp,color as ed,compose as td,get as od,shadow as rd,space as id,system as nd,typography as sd}from"styled-system";var ld={width:{property:"width",scale:"sizes",transform:(e,t)=>od(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},ad=Jp("div")(({css:e})=>e,td(Rp,ed,rd,id,sd,nd(ld))),ho=r=>{var n=r,{as:e,children:t,overrides:o}=n,i=Oe(n,["as","children","overrides"]);let s=Zp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(ad,P(P({as:e},p),i),t);if(o!==void 0){let l=ge(s,o);return Sn.createElement(Qp,{theme:l},d())}return d()};var Co={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"}},cd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},wn=pd(ho)(()=>({whiteSpace:"nowrap"}),dd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:cd})));import md from"styled-components";import{variant as ud,system as fd}from"styled-system";var Vo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Tn=md(ho)(ud({scale:"components.Text",variants:"components.Text"}),fd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",gd=20,xd=Object.fromEntries(Array.from(Array(gd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),Kt={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"},Ar={colors:H(P({},Kt),{neutral:{foreground:Kt.gray300},primary:{background:Kt.blue500,foreground:Kt.white,inverted:Kt.blue500},negative:{foreground:Kt.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:xd,components:{Button:Co,Text:Vo}};var Pn="https://api.frigade.com",J=hd({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:rt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Pn,readonly:!1,debug:!1});function Sd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var bd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var K,he,ve,ue,G;let[n,s]=je(t||null),[p,d]=je(o||null),[l,m]=je([]),[c,f]=je([]),[S,T]=je([]),[b,h]=je({}),[B,y]=je({}),[F,L]=je([]),[A,x]=je({}),[k,u]=je(!1),[v,I]=je(!1),[N,O]=je(!q(e)),z=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},W={theme:P(P({},rt.theme),(he=(K=i==null?void 0:i.defaultAppearance)==null?void 0:K.theme)!=null?he:{}),styleOverrides:P(P({},rt.styleOverrides),(ue=(ve=i==null?void 0:i.defaultAppearance)==null?void 0:ve.styleOverrides)!=null?ue:{})};function q(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}Go(()=>{t&&s(t)},[t]),Go(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(xo)&&window.localStorage.getItem(xo)!==n&&Sd()},[n]),Go(()=>{o&&d(o)},[o]),Go(()=>{if(q(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let ae={publicApiKey:e,userId:n,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:S,setFlowResponses:T,userProperties:b,setUserProperties:h,openFlowStates:B,setOpenFlowStates:y,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:L,customVariables:A,setCustomVariables:x,isNewGuestUser:k,setIsNewGuestUser:u,hasActiveFullPageFlow:v,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:z,defaultAppearance:W,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:Pn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(N)return Pt.createElement(J.Provider,{value:ae},r);let{overrides:Q}=yn(W);return Pt.createElement(yd,{fallback:Pt.createElement(Pt.Fragment,null,r)},Pt.createElement(J.Provider,{value:ae},Pt.createElement(Cd,{theme:ge(W.theme,Ar,Q!=null?Q:{},(G=i==null?void 0:i.theme)!=null?G:{})},r,Pt.createElement(hn,null))))};import pc from"react";import xe,{useEffect as ol,useState as rl}from"react";import Ye,{useState as zd}from"react";import Et from"styled-components";import Yo from"react";import vt from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
681
681
|
font-weight: 600;
|
|
682
682
|
font-size: 14px;
|
|
683
683
|
font-style: normal;
|
|
@@ -688,8 +688,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
688
688
|
vertical-align: middle;
|
|
689
689
|
margin-left: 32px;
|
|
690
690
|
padding-right: 12px;
|
|
691
|
-
${e=>
|
|
692
|
-
`,
|
|
691
|
+
${e=>Ne(e)}
|
|
692
|
+
`,wd=Bn.div`
|
|
693
693
|
flex-direction: row;
|
|
694
694
|
justify-content: space-between;
|
|
695
695
|
display: flex;
|
|
@@ -697,12 +697,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
697
697
|
padding-bottom: 20px;
|
|
698
698
|
padding-right: 8px;
|
|
699
699
|
width: 100%;
|
|
700
|
-
${e=>
|
|
701
|
-
`,
|
|
700
|
+
${e=>Ne(e)}
|
|
701
|
+
`,Ko=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>vt.createElement(vt.Fragment,null,vt.createElement(wd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:P({},r)},i==="left"&&e&&vt.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),vt.createElement(it,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&vt.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),vt.createElement(ie,{appearance:p}));import yo from"styled-components";var En=yo.div`
|
|
702
702
|
font-weight: 700;
|
|
703
703
|
font-size: 18px;
|
|
704
704
|
line-height: 22px;
|
|
705
|
-
`,
|
|
705
|
+
`,An=yo.p`
|
|
706
706
|
font-weight: 600;
|
|
707
707
|
font-size: 16px;
|
|
708
708
|
line-height: 24px;
|
|
@@ -710,7 +710,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
710
710
|
letter-spacing: 0.32px;
|
|
711
711
|
font-style: normal;
|
|
712
712
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
713
|
-
`,
|
|
713
|
+
`,In=yo.p`
|
|
714
714
|
font-weight: 400;
|
|
715
715
|
font-size: 14px;
|
|
716
716
|
font-style: normal;
|
|
@@ -719,45 +719,45 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
719
719
|
letter-spacing: 0.28px;
|
|
720
720
|
margin: 8px 0px 0px 0px;
|
|
721
721
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
722
|
-
`,
|
|
722
|
+
`,qo=yo.div`
|
|
723
723
|
width: 6px;
|
|
724
724
|
position: absolute;
|
|
725
725
|
left: 0;
|
|
726
726
|
height: 100%;
|
|
727
727
|
border-top-right-radius: 4px;
|
|
728
728
|
border-bottom-right-radius: 4px;
|
|
729
|
-
`,
|
|
729
|
+
`,On=yo.div`
|
|
730
730
|
flex-direction: row;
|
|
731
731
|
justify-content: flex-start;
|
|
732
732
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
733
733
|
padding-right: 16px;
|
|
734
|
-
`;var
|
|
734
|
+
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,d,l,m,c;return Yo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&Yo.createElement(qo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Yo.createElement(On,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Yo.createElement(Ko,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:r,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:s})))};import Bt from"react";import Ir from"styled-components";import st from"styled-components";var oC=st.div`
|
|
735
735
|
background: #ffffff;
|
|
736
736
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
737
737
|
border-radius: 20px;
|
|
738
738
|
width: 385px;
|
|
739
739
|
padding: 24px 16px 16px 16px;
|
|
740
|
-
`,
|
|
740
|
+
`,rC=st.div`
|
|
741
741
|
/* Border bottom only on collapsable */
|
|
742
|
-
`,
|
|
742
|
+
`,iC=st.div`
|
|
743
743
|
display: flex;
|
|
744
744
|
flex-direction: row;
|
|
745
745
|
justify-content: space-between;
|
|
746
746
|
align-content: flex-start;
|
|
747
|
-
`,
|
|
747
|
+
`,nC=st.h1`
|
|
748
748
|
display: flex;
|
|
749
749
|
margin: 0;
|
|
750
750
|
font-size: 18px;
|
|
751
|
-
`,
|
|
751
|
+
`,sC=st.h2`
|
|
752
752
|
font-size: 15px;
|
|
753
753
|
color: #4d4d4d;
|
|
754
|
-
`,
|
|
754
|
+
`,lC=st.ul`
|
|
755
755
|
list-style: none;
|
|
756
|
-
`,
|
|
756
|
+
`,aC=st.li`
|
|
757
757
|
display: flex;
|
|
758
758
|
justify-content: flex-start;
|
|
759
759
|
flex-direction: row;
|
|
760
|
-
`,
|
|
760
|
+
`,Ln=st.div`
|
|
761
761
|
position: absolute;
|
|
762
762
|
left: 0;
|
|
763
763
|
top: 0;
|
|
@@ -765,7 +765,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
765
765
|
width: ${e=>e.fgWidth};
|
|
766
766
|
border-radius: 20px;
|
|
767
767
|
background-color: ${e=>e.theme.colorPrimary};
|
|
768
|
-
`,
|
|
768
|
+
`,Dn=st.div`
|
|
769
769
|
position: relative;
|
|
770
770
|
left: 0;
|
|
771
771
|
top: 0;
|
|
@@ -775,33 +775,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
775
775
|
border-radius: 20px;
|
|
776
776
|
background-color: ${e=>e.theme.colorPrimary};
|
|
777
777
|
opacity: 0.12;
|
|
778
|
-
`;var
|
|
778
|
+
`;var Td=Ir.div`
|
|
779
779
|
display: flex;
|
|
780
780
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
781
781
|
justify-content: flex-start;
|
|
782
782
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
783
783
|
width: 100%;
|
|
784
784
|
|
|
785
|
-
${e=>
|
|
786
|
-
`,
|
|
785
|
+
${e=>Ne(e)}
|
|
786
|
+
`,Fd=Ir.div`
|
|
787
787
|
flex-grow: 1;
|
|
788
788
|
position: relative;
|
|
789
789
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
790
|
-
`,
|
|
790
|
+
`,kd=Ir.span`
|
|
791
791
|
font-weight: 600;
|
|
792
792
|
font-size: 14px;
|
|
793
793
|
line-height: 18px;
|
|
794
794
|
padding-right: ${e=>e.padding};
|
|
795
795
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
796
796
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
797
|
-
${e=>
|
|
798
|
-
`;var
|
|
797
|
+
${e=>Ne(e)}
|
|
798
|
+
`;var ze=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Bt.createElement(Bt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"5px":"10px",l=Math.round(e/t*100),m=o==="compact"?"5px":"14px",c;return o==="count"?c=`${e}/${t}`:o==="compact"?c=`${l}%`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(m="0px"),Bt.createElement(Td,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Bt.createElement(kd,{className:a("progressBarStepText",s),style:H(P({},n),{fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600}),appearance:s,padding:m,textLocation:i},c),Bt.createElement(Fd,{textLocation:i,className:a("progressBar",s)},Bt.createElement(Ln,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:a("progressBarFill",s)}),Bt.createElement(Dn,{className:a("progressBarBackground",s),barHeight:d,appearance:s})))};import So from"react";import vd from"styled-components";import Jo from"react";import Xo from"react";var qt=({stepData:e,appearance:t})=>Xo.createElement(Xo.Fragment,null,Xo.createElement(An,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:de(e.title)}),Xo.createElement(In,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:de(e.subtitle)}));import Or from"react";var Yt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Or.createElement(Uo,{className:a("ctaContainer",t)},Or.createElement(oe,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Or.createElement(oe,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Xt=({stepData:e,appearance:t})=>Jo.createElement(Jo.Fragment,null,Jo.createElement(qt,{stepData:e,appearance:t}),Jo.createElement(Yt,{stepData:e,appearance:t}));import Pd from"react";function $n(e){return Pd.createElement(Ze,{appearance:e.appearance,videoUri:e.videoUri})}var Nr="default",Bd=vd.img`
|
|
799
799
|
border-radius: 4px;
|
|
800
800
|
max-height: 260px;
|
|
801
801
|
min-height: 200px;
|
|
802
|
-
`,
|
|
802
|
+
`,Mn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return So.createElement("div",null,o)}return So.createElement(En,{className:a("checklistStepContent",t)},e.imageUri?So.createElement(Bd,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?So.createElement($n,{videoUri:e.videoUri,appearance:t}):null,So.createElement(Xt,{stepData:e,appearance:t}))};import We,{useRef as Ed,useState as Ad}from"react";import Jt from"styled-components";var Un=Jt.div`
|
|
803
803
|
display: block;
|
|
804
|
-
`,
|
|
804
|
+
`,Id=Jt.div`
|
|
805
805
|
display: flex;
|
|
806
806
|
flex-direction: row;
|
|
807
807
|
flex-wrap: wrap;
|
|
@@ -811,20 +811,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
811
811
|
align-content: center;
|
|
812
812
|
margin-top: 24px;
|
|
813
813
|
margin-bottom: 24px;
|
|
814
|
-
`,
|
|
814
|
+
`,Od=Jt.div`
|
|
815
815
|
display: flex;
|
|
816
816
|
align-items: center;
|
|
817
817
|
justify-content: flex-start;
|
|
818
818
|
flex-direction: column;
|
|
819
819
|
margin-right: 16px;
|
|
820
|
-
`,
|
|
820
|
+
`,Nd=Jt.video`
|
|
821
821
|
width: 200px;
|
|
822
822
|
height: 120px;
|
|
823
|
-
`,
|
|
823
|
+
`,Ld=Jt.div`
|
|
824
824
|
font-size: 14px;
|
|
825
825
|
line-height: 20px;
|
|
826
826
|
text-align: center;
|
|
827
|
-
`,
|
|
827
|
+
`,Dd=Jt.div`
|
|
828
828
|
position: absolute;
|
|
829
829
|
width: 200px;
|
|
830
830
|
height: 120px;
|
|
@@ -844,9 +844,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
844
844
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
845
845
|
border-radius: 50%;
|
|
846
846
|
}
|
|
847
|
-
`,
|
|
847
|
+
`,zn="videoCarousel",Wn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return We.createElement(Un,null,We.createElement(Xt,{stepData:e,appearance:t}));function o({video:n}){let s=Ed(),[p,d]=Ad(!1);return We.createElement(Od,null,!p&&We.createElement(Dd,{onClick:()=>{d(!0),s.current.play()},appearance:t},We.createElement(zo,null)),We.createElement(Nd,{controls:p,ref:s,play:p,src:n.uri}),We.createElement(Ld,null,n.title))}let i=e.props;return i.videos?We.createElement(Un,null,We.createElement(qt,{stepData:e,appearance:t}),We.createElement(Id,null,i.videos.map((n,s)=>We.createElement("span",{key:`${n.uri}-${s}`},We.createElement(o,{video:n})))),We.createElement(Yt,{stepData:e,appearance:t})):null};import lt from"react";import Qo from"styled-components";var _n=Qo.div`
|
|
848
848
|
display: block;
|
|
849
|
-
|
|
849
|
+
`,$d=Qo.pre`
|
|
850
850
|
display: block;
|
|
851
851
|
background-color: #2a2a2a;
|
|
852
852
|
color: #f8f8f8;
|
|
@@ -862,29 +862,29 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
862
862
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
863
863
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
864
864
|
margin-bottom: 24px;
|
|
865
|
-
`,
|
|
865
|
+
`,Md=Qo.div`
|
|
866
866
|
font-size: 15px;
|
|
867
867
|
line-height: 20px;
|
|
868
868
|
margin-bottom: 12px;
|
|
869
869
|
margin-top: 12px;
|
|
870
|
-
`,
|
|
870
|
+
`,Ud=Qo.div`
|
|
871
871
|
margin-top: 24px;
|
|
872
|
-
`,
|
|
872
|
+
`,Hn="codeSnippet",jn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(_n,null,lt.createElement(Xt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?lt.createElement(_n,null,lt.createElement(qt,{stepData:e,appearance:t}),lt.createElement(Ud,null,o.codeSnippets.map((r,n)=>lt.createElement("div",{key:n},r.title?lt.createElement(Md,null,r.title):null,r.code?lt.createElement($d,null,r.code):null))),lt.createElement(Yt,{stepData:e,appearance:t})):null};var Wd=Et.div`
|
|
873
873
|
display: flex;
|
|
874
874
|
flex-direction: row;
|
|
875
875
|
overflow: hidden;
|
|
876
876
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
877
877
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
878
878
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
879
|
-
${e=>
|
|
880
|
-
`,
|
|
879
|
+
${e=>Ne(e)}
|
|
880
|
+
`,_d=Et.h1`
|
|
881
881
|
font-size: 18px;
|
|
882
882
|
font-style: normal;
|
|
883
883
|
font-weight: 700;
|
|
884
884
|
line-height: 24px;
|
|
885
885
|
letter-spacing: 0.36px;
|
|
886
886
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
887
|
-
`,
|
|
887
|
+
`,Hd=Et.h2`
|
|
888
888
|
font-size: 14px;
|
|
889
889
|
font-style: normal;
|
|
890
890
|
font-weight: 400;
|
|
@@ -892,44 +892,44 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
892
892
|
letter-spacing: 0.28px;
|
|
893
893
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
894
894
|
margin: 10px 0px 0px 0px;
|
|
895
|
-
`,
|
|
895
|
+
`,Vn=Et.div``,jd=Et.div`
|
|
896
896
|
list-style: none;
|
|
897
897
|
padding: 0;
|
|
898
898
|
margin: 0;
|
|
899
899
|
cursor: pointer;
|
|
900
900
|
width: 300px;
|
|
901
|
-
`,
|
|
901
|
+
`,Vd=Et.div`
|
|
902
902
|
width: 1px;
|
|
903
903
|
margin-right: 40px;
|
|
904
904
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
905
|
-
`,
|
|
905
|
+
`,Gd=Et.div`
|
|
906
906
|
flex: 2;
|
|
907
907
|
padding: 2rem 2rem 2rem 0rem;
|
|
908
|
-
`,
|
|
908
|
+
`,Kd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=te();d=m(d);let c={[Nr]:Mn,[zn]:Wn,[Hn]:jn},f=P(P({},c),p),[S,T]=zd(0),b=r!=null?r:S,h=n!=null?n:T,B=o.filter(F=>F.complete===!0).length,y=()=>{var F;return!((F=o[b])!=null&&F.type)||!f[o[b].type]?f[Nr]({stepData:o[b],appearance:d}):f[o[b].type]({stepData:o[b],appearance:d})};return Ye.createElement(Wd,{type:l,styleOverrides:i,className:s,appearance:d},Ye.createElement(Vn,{style:{flex:1}},Ye.createElement(Vn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(_d,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(Hd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(ze,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(jd,{className:a("checklistStepsContainer",d)},o.map((F,L)=>Ye.createElement(Nn,{data:F,index:L,key:L,listLength:o.length,isSelected:L===b,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{h(L)},appearance:d})))),Ye.createElement(Vd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Gd,null,Ye.createElement(y,null)))},Lr=Kd;import j,{useState as Qd}from"react";import Gn from"react";import qd from"styled-components";var Yd=qd.svg`
|
|
909
909
|
transition: 'transform 0.35s ease-in-out';
|
|
910
|
-
`,
|
|
910
|
+
`,Qt=({style:e,className:t})=>Gn.createElement(Yd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Gn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var Dr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Kn=be.div`
|
|
911
911
|
max-height: 350px;
|
|
912
912
|
padding-bottom: 40px;
|
|
913
|
-
`,
|
|
913
|
+
`,qn=be.div`
|
|
914
914
|
display: flex;
|
|
915
915
|
flex-direction: column;
|
|
916
916
|
margin-top: 20px;
|
|
917
|
-
`,
|
|
917
|
+
`,Yn=be.h1`
|
|
918
918
|
font-style: normal;
|
|
919
919
|
font-weight: 600;
|
|
920
920
|
font-size: 30px;
|
|
921
921
|
line-height: 36px;
|
|
922
922
|
margin-bottom: 16px;
|
|
923
923
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
924
|
-
`,
|
|
924
|
+
`,Xn=be.h2`
|
|
925
925
|
font-weight: 400;
|
|
926
926
|
font-size: 16px;
|
|
927
927
|
line-height: 20px;
|
|
928
928
|
margin-bottom: 16px;
|
|
929
929
|
padding-left: 1px;
|
|
930
930
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
931
|
-
|
|
932
|
-
${e=>
|
|
931
|
+
`,Jn=be.div`
|
|
932
|
+
${e=>E(e)} {
|
|
933
933
|
border: 1px solid #fafafa;
|
|
934
934
|
}
|
|
935
935
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -938,12 +938,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
938
938
|
flex-direction: column;
|
|
939
939
|
min-height: 240px;
|
|
940
940
|
overflow: hidden;
|
|
941
|
-
`,
|
|
941
|
+
`,Qn=be.div`
|
|
942
942
|
display: flex;
|
|
943
943
|
flex-direction: row;
|
|
944
944
|
justify-content: space-between;
|
|
945
|
-
`,
|
|
946
|
-
${e=>
|
|
945
|
+
`,Zn=be.p`
|
|
946
|
+
${e=>E(e)} {
|
|
947
947
|
font-weight: 400;
|
|
948
948
|
font-size: 10px;
|
|
949
949
|
line-height: 12px;
|
|
@@ -951,13 +951,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
951
951
|
color: #8c8c8c;
|
|
952
952
|
margin: 20px;
|
|
953
953
|
}
|
|
954
|
-
`,
|
|
954
|
+
`,Rn=be.div`
|
|
955
955
|
display: flex;
|
|
956
956
|
flex-direction: row;
|
|
957
|
-
`,
|
|
957
|
+
`,es=be.div`
|
|
958
958
|
flex: 1;
|
|
959
|
-
`,
|
|
960
|
-
${e=>
|
|
959
|
+
`,ts=be.div`
|
|
960
|
+
${e=>E(e)} {
|
|
961
961
|
display: flex;
|
|
962
962
|
justify-content: center;
|
|
963
963
|
align-content: center;
|
|
@@ -966,8 +966,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
966
966
|
padding-left: 8px;
|
|
967
967
|
padding-right: 8px;
|
|
968
968
|
}
|
|
969
|
-
`,
|
|
970
|
-
${e=>
|
|
969
|
+
`,os=be.p`
|
|
970
|
+
${e=>E(e)} {
|
|
971
971
|
font-style: normal;
|
|
972
972
|
font-weight: 600;
|
|
973
973
|
font-size: 22px;
|
|
@@ -978,8 +978,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
978
978
|
margin-top: 20px;
|
|
979
979
|
margin-bottom: 16px;
|
|
980
980
|
}
|
|
981
|
-
`,
|
|
982
|
-
${e=>
|
|
981
|
+
`,rs=be.p`
|
|
982
|
+
${e=>E(e)} {
|
|
983
983
|
font-weight: 400;
|
|
984
984
|
font-size: 14px;
|
|
985
985
|
line-height: 18px;
|
|
@@ -987,15 +987,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
987
987
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
988
988
|
margin-bottom: 8px;
|
|
989
989
|
}
|
|
990
|
-
`,
|
|
991
|
-
${e=>
|
|
990
|
+
`,is=be.div`
|
|
991
|
+
${e=>E(e)} {
|
|
992
992
|
display: flex;
|
|
993
993
|
flex-direction: row;
|
|
994
994
|
justify-content: center;
|
|
995
995
|
gap: 8px;
|
|
996
996
|
}
|
|
997
|
-
`,
|
|
998
|
-
${e=>
|
|
997
|
+
`,ns=be.div`
|
|
998
|
+
${e=>E(e)} {
|
|
999
999
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1000
1000
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
1001
1001
|
:hover {
|
|
@@ -1014,8 +1014,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1014
1014
|
justify-content: space-between;
|
|
1015
1015
|
position: relative;
|
|
1016
1016
|
cursor: pointer;
|
|
1017
|
-
`,
|
|
1018
|
-
${e=>
|
|
1017
|
+
`,ss=be.p`
|
|
1018
|
+
${e=>E(e)} {
|
|
1019
1019
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1020
1020
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1021
1021
|
}
|
|
@@ -1023,12 +1023,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1023
1023
|
font-size: 14px;
|
|
1024
1024
|
line-height: 22px;
|
|
1025
1025
|
margin: 0;
|
|
1026
|
-
`,
|
|
1026
|
+
`,ls=be.div`
|
|
1027
1027
|
display: flex;
|
|
1028
1028
|
flex-direction: row;
|
|
1029
1029
|
justify-content: flex-end;
|
|
1030
1030
|
align-content: center;
|
|
1031
|
-
`,
|
|
1031
|
+
`,as=be.div`
|
|
1032
1032
|
display: flex;
|
|
1033
1033
|
flex: 1;
|
|
1034
1034
|
flex-direction: row;
|
|
@@ -1036,14 +1036,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1036
1036
|
align-content: center;
|
|
1037
1037
|
align-items: center;
|
|
1038
1038
|
margin-right: 20px;
|
|
1039
|
-
`,
|
|
1039
|
+
`,ps=be.div`
|
|
1040
1040
|
display: block;
|
|
1041
1041
|
width: 100%;
|
|
1042
|
-
`;import
|
|
1042
|
+
`;import Xd from"styled-components";var ds=Xd.div`
|
|
1043
1043
|
flex-direction: column;
|
|
1044
1044
|
justify-content: center;
|
|
1045
1045
|
display: flex;
|
|
1046
|
-
`;import
|
|
1046
|
+
`;import pt from"react";import at from"styled-components";var cs=at.div`
|
|
1047
1047
|
border: 1px solid #fafafa;
|
|
1048
1048
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1049
1049
|
border-radius: 14px;
|
|
@@ -1051,14 +1051,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1051
1051
|
display: flex;
|
|
1052
1052
|
flex-direction: column;
|
|
1053
1053
|
overflow: hidden;
|
|
1054
|
-
`,
|
|
1054
|
+
`,ms=at.div`
|
|
1055
1055
|
display: flex;
|
|
1056
1056
|
flex-wrap: wrap;
|
|
1057
1057
|
justify-content: space-between;
|
|
1058
1058
|
overflow: hidden;
|
|
1059
1059
|
row-gap: 10px;
|
|
1060
|
-
`,
|
|
1061
|
-
${e=>
|
|
1060
|
+
`,us=at.div`
|
|
1061
|
+
${e=>E(e)} {
|
|
1062
1062
|
color: #595959;
|
|
1063
1063
|
}
|
|
1064
1064
|
text-transform: uppercase;
|
|
@@ -1067,8 +1067,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1067
1067
|
line-height: 12px;
|
|
1068
1068
|
letter-spacing: 0.09em;
|
|
1069
1069
|
margin-bottom: 12px;
|
|
1070
|
-
`,
|
|
1071
|
-
${e=>
|
|
1070
|
+
`,fs=at.div`
|
|
1071
|
+
${e=>E(e)} {
|
|
1072
1072
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1073
1073
|
background: #ffffff;
|
|
1074
1074
|
border: 1px solid #fafafa;
|
|
@@ -1080,8 +1080,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1080
1080
|
|
|
1081
1081
|
max-width: 150px;
|
|
1082
1082
|
min-width: 200px;
|
|
1083
|
-
`,
|
|
1084
|
-
${e=>
|
|
1083
|
+
`,gs=at.div`
|
|
1084
|
+
${e=>E(e)} {
|
|
1085
1085
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1086
1086
|
}
|
|
1087
1087
|
width: 40px;
|
|
@@ -1092,14 +1092,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1092
1092
|
justify-content: center;
|
|
1093
1093
|
align-content: center;
|
|
1094
1094
|
align-items: center;
|
|
1095
|
-
`,
|
|
1095
|
+
`,xs=at.div`
|
|
1096
1096
|
font-weight: 600;
|
|
1097
1097
|
font-size: 20px;
|
|
1098
1098
|
line-height: 24px;
|
|
1099
1099
|
width: 20px;
|
|
1100
1100
|
height: 20px;
|
|
1101
|
-
`,
|
|
1102
|
-
${e=>
|
|
1101
|
+
`,hs=at.div`
|
|
1102
|
+
${e=>E(e)} {
|
|
1103
1103
|
color: #434343;
|
|
1104
1104
|
}
|
|
1105
1105
|
font-weight: 600;
|
|
@@ -1107,20 +1107,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1107
1107
|
line-height: 17px;
|
|
1108
1108
|
margin-top: 12px;
|
|
1109
1109
|
margin-bottom: 8px;
|
|
1110
|
-
`,
|
|
1111
|
-
${e=>
|
|
1110
|
+
`,Cs=at.div`
|
|
1111
|
+
${e=>E(e)} {
|
|
1112
1112
|
color: #8c8c8c;
|
|
1113
1113
|
}
|
|
1114
1114
|
font-weight: 400;
|
|
1115
1115
|
font-size: 12px;
|
|
1116
1116
|
line-height: 14px;
|
|
1117
|
-
`,
|
|
1117
|
+
`,ys=at.a`
|
|
1118
1118
|
color: ${e=>e.color};
|
|
1119
1119
|
font-size: 12px;
|
|
1120
1120
|
line-height: 14px;
|
|
1121
1121
|
font-weight: 400;
|
|
1122
1122
|
cursor: pointer;
|
|
1123
|
-
`;var
|
|
1123
|
+
`;var Jd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=pe();return pt.createElement(cs,{style:t,className:a("guideContainer",r)},pt.createElement(us,{className:a("guideTitle",r)},o),pt.createElement(ms,{className:a("guideItemContainer",r)},e.map((p,d)=>{var l;return pt.createElement(fs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",r)},p.icon&&pt.createElement(gs,{className:a("guideIcon",r)},pt.createElement(xs,null,p.icon)),pt.createElement(hs,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:de(p.title)}),pt.createElement(Cs,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:de(p.subtitle)}),pt.createElement(ys,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle))})))},bo=Jd;var Zd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let S=({stepData:x,handleSecondaryCTAClick:k,handleCTAClick:u})=>x?j.createElement(ts,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},j.createElement(os,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:de(x.title)}),j.createElement(rs,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:de(x.subtitle)}),j.createElement(is,{className:a("checklistCTAContainer",l)},x.secondaryButtonTitle&&j.createElement(oe,{title:x.secondaryButtonTitle,onClick:k,appearance:l,secondary:!0}),j.createElement(oe,{title:x.primaryButtonTitle,onClick:u,appearance:l}))):j.createElement(j.Fragment,null),b=P(P({},{default:x=>{var I;if((I=e[y])!=null&&I.StepContent){let N=e[y].StepContent;return j.createElement("div",null,N)}let k=e[y];return j.createElement(S,{stepData:x,handleCTAClick:()=>{k.handlePrimaryButtonClick&&k.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{k.handleSecondaryButtonClick&&k.handleSecondaryButtonClick()}})}}),d),[h,B]=Qd(0),y=s!=null?s:h,F=p!=null?p:B,L=()=>{var x;return e?!((x=e[y])!=null&&x.type)||!b[e[y].type]?b.default(e[y]):b[e[y].type]({stepData:e[y],primaryColor:l.theme.colorPrimary}):j.createElement(j.Fragment,null)},A=e.filter(x=>x.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Dr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Dr),j.createElement(Je,{onClose:n,visible:r,appearance:l},j.createElement(ps,null,j.createElement(qn,null,j.createElement(Yn,{appearance:l,className:a("checklistTitle",l)},t),j.createElement(Xn,{appearance:l,className:a("checklistSubtitle",l)},o)),j.createElement(Kn,null,e&&e.length>0&&j.createElement(Jn,{className:a("stepsContainer",l)},j.createElement(Qn,null,j.createElement("div",{style:{flex:3}},j.createElement(Zn,{className:a("stepsTitle",l)},i)),j.createElement(as,null,j.createElement(ze,{style:{width:"100%"},count:A,total:e.length,appearance:l}))),j.createElement(Rn,null,j.createElement(es,{className:a("checklistStepListContainer",l),appearance:l},e.map((x,k)=>{var v;let u=y===k;return j.createElement(ns,{selected:u,className:a(`checklistStepListItem${u?"Selected":""}`,l),key:`checklist-guide-step-${(v=x.id)!=null?v:k}`,disabled:x.blocked,onClick:()=>{x.blocked||F(k)},title:x.blocked?"Finish remaining steps to continue":void 0},u&&j.createElement(qo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),j.createElement(ss,{selected:u,className:a(`checklistStepListStepName${u?"Selected":""}`,l)},x.stepName),j.createElement(ls,null,j.createElement(it,{value:x.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:x.progress,appearance:l}),j.createElement(ds,null,j.createElement(Qt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),j.createElement(L,null))),m&&m.length>0&&j.createElement(bo,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:x=>(f&&f(x),!0)}))))):j.createElement(j.Fragment,null)},$r=Zd;import Le,{useEffect as Ls,useState as Ds}from"react";import Fe from"react";import dt from"styled-components";var Ss=dt.div`
|
|
1124
1124
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1125
1125
|
border: 1px solid;
|
|
1126
1126
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1132,19 +1132,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1132
1132
|
display: flex;
|
|
1133
1133
|
flex-direction: column;
|
|
1134
1134
|
transition: max-height 0.25s;
|
|
1135
|
-
`,
|
|
1135
|
+
`,bs=dt.div`
|
|
1136
1136
|
display: flex;
|
|
1137
1137
|
margin-bottom: 20px;
|
|
1138
|
-
`,
|
|
1138
|
+
`,ws=dt.img`
|
|
1139
1139
|
border-radius: 4px;
|
|
1140
1140
|
max-height: 260px;
|
|
1141
1141
|
min-height: 200px;
|
|
1142
|
-
`,
|
|
1142
|
+
`,Ts=dt.div`
|
|
1143
1143
|
display: flex;
|
|
1144
1144
|
flex-direction: row;
|
|
1145
1145
|
justify-content: space-between;
|
|
1146
1146
|
align-items: center;
|
|
1147
|
-
`,
|
|
1147
|
+
`,Fs=dt.p`
|
|
1148
1148
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1149
1149
|
font-style: normal;
|
|
1150
1150
|
font-weight: 500;
|
|
@@ -1155,23 +1155,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1155
1155
|
:hover {
|
|
1156
1156
|
opacity: 0.8;
|
|
1157
1157
|
}
|
|
1158
|
-
`,
|
|
1158
|
+
`,ks=dt.div`
|
|
1159
1159
|
cursor: pointer;
|
|
1160
1160
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1161
1161
|
:hover {
|
|
1162
1162
|
opacity: 0.8;
|
|
1163
1163
|
}
|
|
1164
|
-
`,
|
|
1164
|
+
`,i0=dt.div``,Ps=dt.p`
|
|
1165
1165
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1166
1166
|
font-weight: 400;
|
|
1167
1167
|
font-size: 14px;
|
|
1168
1168
|
line-height: 22px;
|
|
1169
|
-
`,
|
|
1169
|
+
`,vs=dt.div`
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
flex-direction: row;
|
|
1172
1172
|
justify-content: flex-start;
|
|
1173
1173
|
align-items: center;
|
|
1174
|
-
`;var
|
|
1174
|
+
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var c,f;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){var S;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(bs,{className:a("stepMediaContainer",n)},e.imageUri?Fe.createElement(ws,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(Ze,{appearance:n,videoUri:e.videoUri}):null):null,Fe.createElement(Ps,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:de(e.subtitle)}),Fe.createElement(Uo,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?Fe.createElement(oe,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,Fe.createElement(oe,{title:(S=e.primaryButtonTitle)!=null?S:"Continue",onClick:()=>i(),appearance:n})))}function m(){if(!s)return null;let S=s[e.type];return S?S(e,n):null}return Fe.createElement(Ss,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},Fe.createElement(Ts,{className:a("stepHeader",n)},Fe.createElement(vs,null,Fe.createElement(Ko,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=n==null?void 0:n.theme)==null?void 0:c.colorPrimary,appearance:n}),Fe.createElement(Fs,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:de(e.title),onClick:()=>o()})),Fe.createElement(ks,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},Fe.createElement(Qt,{style:H(P({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:P({},d)},(f=m())!=null?f:l()))};import Zt from"styled-components";var C0=Zt.div`
|
|
1175
1175
|
background: #ffffff;
|
|
1176
1176
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1177
1177
|
border-radius: 6px;
|
|
@@ -1185,26 +1185,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1185
1185
|
|
|
1186
1186
|
max-width: 800px;
|
|
1187
1187
|
min-width: 350px;
|
|
1188
|
-
`,
|
|
1188
|
+
`,Es=Zt.div`
|
|
1189
1189
|
display: flex;
|
|
1190
1190
|
flex-direction: column;
|
|
1191
|
-
`,
|
|
1191
|
+
`,As=Zt.h1`
|
|
1192
1192
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1193
1193
|
font-style: normal;
|
|
1194
1194
|
font-weight: 700;
|
|
1195
1195
|
font-size: 20px;
|
|
1196
1196
|
line-height: 24px;
|
|
1197
1197
|
margin-bottom: 8px;
|
|
1198
|
-
`,
|
|
1198
|
+
`,Is=Zt.h2`
|
|
1199
1199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1200
1200
|
font-weight: 400;
|
|
1201
1201
|
font-size: 14px;
|
|
1202
1202
|
line-height: 23px;
|
|
1203
1203
|
margin: 2px 0 0 0;
|
|
1204
|
-
`,
|
|
1204
|
+
`,Os=Zt.div`
|
|
1205
1205
|
display: block;
|
|
1206
1206
|
width: 100%;
|
|
1207
|
-
`,
|
|
1207
|
+
`,Ns=Zt.div`
|
|
1208
1208
|
display: flex;
|
|
1209
1209
|
width: 100%;
|
|
1210
1210
|
flex-direction: column;
|
|
@@ -1212,23 +1212,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1212
1212
|
padding: 24px;
|
|
1213
1213
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1214
1214
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1215
|
-
`;var
|
|
1215
|
+
`;var Rd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:f,customStepTypes:S,style:T})=>{let b=o.filter(k=>k.complete).length,[h,B]=Ds(Array(o.length).fill(!0)),[y,F]=Ds(!1);Ls(()=>{let k=[...h];if(n){for(let u=0;u<o.length;u++)if(!o[u].complete){k[u]=!1;break}B(k)}},[]),Ls(()=>{if(!y&&!n){F(!0);return}L(d)},[d]);let L=k=>{let u=[...h];if(s)for(let v=0;v<h.length;++v)v!==k&&(u[v]=!0);u[k]=!u[k],B(u)};if(!r&&c=="modal")return Le.createElement(Le.Fragment,null);let A=Le.createElement(Le.Fragment,null,Le.createElement(Es,null,Le.createElement(As,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:de(e)}),Le.createElement(Is,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:de(t)})),Le.createElement(ze,{display:"percent",count:b,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),x=Le.createElement(Os,{className:Te(a("checklistContainer",m),f)},o.map((k,u)=>{var I;let v=h[u];return Le.createElement(Bs,{appearance:m,stepData:k,collapsed:v,key:`modal-checklist-${(I=k.id)!=null?I:u}`,onClick:()=>{if(d===u){L(u);return}l(u)},onPrimaryButtonClick:()=>{k.handlePrimaryButtonClick&&k.handlePrimaryButtonClick(),p&&!k.completionCriteria&&u<h.length-1&&h[u+1]&&l(u+1)},onSecondaryButtonClick:()=>{k.handleSecondaryButtonClick&&k.handleSecondaryButtonClick()},customStepTypes:S})}));return c==="inline"?Le.createElement(Ns,{appearance:m,className:Te(a("checklistInlineContainer",m),f),style:T},A,x):Le.createElement(Le.Fragment,null,Le.createElement(Je,{onClose:i,visible:r,appearance:m,style:{maxWidth:"600px"},headerContent:A},x))},Mr=Rd;import ce,{useEffect as Ur,useRef as lc,useState as At}from"react";import{useEffect as ec,useState as tc}from"react";var $s=()=>{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]=tc(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",n),[d,m.matches]}));i(p)};return ec(()=>{s()},[]),o};import Rt from"react";import me,{css as Ms,keyframes as Us}from"styled-components";var zs=Ms`
|
|
1216
1216
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1217
|
-
`,
|
|
1217
|
+
`,oc=Ms`
|
|
1218
1218
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1219
|
-
`,
|
|
1219
|
+
`,rc=Us`
|
|
1220
1220
|
from {
|
|
1221
1221
|
opacity: 0;
|
|
1222
1222
|
} to {
|
|
1223
1223
|
opacity: 1;
|
|
1224
1224
|
}
|
|
1225
|
-
`,
|
|
1225
|
+
`,ic=Us`
|
|
1226
1226
|
from {
|
|
1227
1227
|
opacity: 1;
|
|
1228
1228
|
} to {
|
|
1229
1229
|
opacity: 0;
|
|
1230
1230
|
}
|
|
1231
|
-
`,
|
|
1231
|
+
`,Ws=me.div`
|
|
1232
1232
|
margin: 0 -20px;
|
|
1233
1233
|
overflow-x: auto;
|
|
1234
1234
|
padding-left: 20px;
|
|
@@ -1245,14 +1245,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1245
1245
|
::-webkit-scrollbar {
|
|
1246
1246
|
display: none;
|
|
1247
1247
|
}
|
|
1248
|
-
`,
|
|
1248
|
+
`,_s=me.div`
|
|
1249
1249
|
display: flex;
|
|
1250
1250
|
flex-flow: row nowrap;
|
|
1251
1251
|
gap: 0 16px;
|
|
1252
1252
|
scroll-snap-align: center;
|
|
1253
1253
|
scroll-snap-stop: always;
|
|
1254
|
-
`,
|
|
1255
|
-
animation: ${e=>e.reversed?
|
|
1254
|
+
`,Hs=me.div`
|
|
1255
|
+
animation: ${e=>e.reversed?ic:rc} 0.25s ease-out;
|
|
1256
1256
|
background: linear-gradient(
|
|
1257
1257
|
to right,
|
|
1258
1258
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1261,8 +1261,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1261
1261
|
position: absolute;
|
|
1262
1262
|
width: 64px;
|
|
1263
1263
|
z-index: 10;
|
|
1264
|
-
`,
|
|
1265
|
-
${
|
|
1264
|
+
`,js=me.button`
|
|
1265
|
+
${zs}
|
|
1266
1266
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1267
1267
|
align-items: center;
|
|
1268
1268
|
border-radius: 50%;
|
|
@@ -1273,11 +1273,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1273
1273
|
justify-content: center;
|
|
1274
1274
|
position: absolute;
|
|
1275
1275
|
width: 48px;
|
|
1276
|
-
`,
|
|
1276
|
+
`,Vs=me.div`
|
|
1277
1277
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1278
1278
|
padding: 20px;
|
|
1279
|
-
`,
|
|
1280
|
-
${
|
|
1279
|
+
`,Gs=me(Vs)`
|
|
1280
|
+
${zs}
|
|
1281
1281
|
background: ${({theme:e})=>e.colorBackground};
|
|
1282
1282
|
position: relative;
|
|
1283
1283
|
|
|
@@ -1289,86 +1289,86 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1289
1289
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1290
1290
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1291
1291
|
}
|
|
1292
|
-
`,
|
|
1292
|
+
`,Ks=me.img`
|
|
1293
1293
|
border-radius: 50%;
|
|
1294
1294
|
height: 40px;
|
|
1295
1295
|
margin-bottom: 12px;
|
|
1296
1296
|
width: 40px;
|
|
1297
|
-
`,
|
|
1298
|
-
${e=>
|
|
1299
|
-
${
|
|
1297
|
+
`,qs=me(Vs)`
|
|
1298
|
+
${e=>E(e)} {
|
|
1299
|
+
${oc}
|
|
1300
1300
|
|
|
1301
1301
|
background: ${({theme:e})=>e.colorBackground};
|
|
1302
1302
|
}
|
|
1303
|
-
`,
|
|
1303
|
+
`,D0=me.div`
|
|
1304
1304
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1305
1305
|
display: flex;
|
|
1306
1306
|
flex-flow: row nowrap;
|
|
1307
1307
|
align-items: center;
|
|
1308
|
-
|
|
1308
|
+
`,$0=me.div`
|
|
1309
1309
|
white-space: nowrap;
|
|
1310
|
-
`,
|
|
1310
|
+
`,Ys=me.div`
|
|
1311
1311
|
background: #d8fed8;
|
|
1312
1312
|
border-radius: 6px;
|
|
1313
1313
|
float: right;
|
|
1314
1314
|
margin-bottom: 12px;
|
|
1315
1315
|
padding: 4px 10px;
|
|
1316
|
-
`,
|
|
1316
|
+
`,nc=me.p`
|
|
1317
1317
|
font-weight: bold;
|
|
1318
1318
|
font-size: 18px;
|
|
1319
1319
|
line-height: 22px;
|
|
1320
1320
|
letter-spacing: calc(18px * -0.01);
|
|
1321
1321
|
margin: 0;
|
|
1322
|
-
`,
|
|
1322
|
+
`,Xs=me(nc)`
|
|
1323
1323
|
margin-bottom: 4px;
|
|
1324
|
-
|
|
1324
|
+
`,Js=me.div`
|
|
1325
1325
|
display: flex;
|
|
1326
1326
|
flex-flow: row nowrap;
|
|
1327
1327
|
align-items: center;
|
|
1328
1328
|
min-width: 50%;
|
|
1329
|
-
`,
|
|
1329
|
+
`,sc=me.p`
|
|
1330
1330
|
font-weight: bold;
|
|
1331
1331
|
font-size: 16px;
|
|
1332
1332
|
line-height: 20px;
|
|
1333
1333
|
letter-spacing: calc(16px * -0.01);
|
|
1334
1334
|
margin: 0;
|
|
1335
|
-
`,
|
|
1335
|
+
`,Qs=me(sc)`
|
|
1336
1336
|
margin-bottom: 4px;
|
|
1337
1337
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1338
1338
|
`}
|
|
1339
|
-
`,
|
|
1339
|
+
`,Ct=me.p`
|
|
1340
1340
|
color: ${({theme:e})=>e.colorText};
|
|
1341
1341
|
font-weight: normal;
|
|
1342
1342
|
font-size: 14px;
|
|
1343
1343
|
line-height: 22px;
|
|
1344
1344
|
margin: 0;
|
|
1345
|
-
`,
|
|
1345
|
+
`,Zs=me.p`
|
|
1346
1346
|
color: ${({theme:e})=>e.colorText};
|
|
1347
1347
|
font-weight: 600;
|
|
1348
1348
|
font-size: 12px;
|
|
1349
1349
|
line-height: 16px;
|
|
1350
1350
|
margin: 0;
|
|
1351
|
-
`;
|
|
1351
|
+
`;Ct.Loud=me(Ct)`
|
|
1352
1352
|
font-weight: 600;
|
|
1353
|
-
`;
|
|
1353
|
+
`;Ct.Quiet=me(Ct)`
|
|
1354
1354
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1355
1355
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1356
1356
|
`}
|
|
1357
|
-
`;var
|
|
1357
|
+
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=te(),{primaryCTAClickSideEffects:r}=pe();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{r(e)};return Rt.createElement(Gs,{className:a("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},n&&Rt.createElement(Ks,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:d||l?.4:1}}),d&&Rt.createElement(Ys,{className:a("carouselCompletedPill",o)},Rt.createElement(Zs,{style:{color:"#108E0B"}},"Complete")),p&&Rt.createElement(Qs,{blocked:l,complete:d,className:a("carouselCardTitle",o)},p),s&&Rt.createElement(Ct.Quiet,{blocked:l,complete:d,className:a("carouselCardSubtitle",o)},s))};var ac=()=>ce.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ce.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ce.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ce.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),el=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=At(!1),[n,s]=At(!1);Ur(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ce.createElement(Hs,{style:d,reversed:n,onAnimationEnd:n?p:null},ce.createElement(js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ce.createElement(ac,null))):null},tl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=lc(null),[n,s]=At(!1),[p,d]=At(!1),[l,m]=At(null),[c,f]=At([]),[S,T]=At(0),{isSmall:b}=$s(),h=b?1:3,{getFlowMetadata:B,getFlowSteps:y,getNumberOfStepsCompleted:F,updateCustomVariables:L,isLoading:A}=R();Ur(()=>{L(o)},[o,A]),Ur(()=>{if(A)return;let N=B(e),O=F(e),z=y(e);m(N),N.data!==null&&(f(z.sort((W,q)=>Number(W.complete)-Number(q.complete))),d(z.length>h),T(O))},[A]);let x=[];for(let N=0;N<c.length;N+=h)x.push(c.slice(N,N+h));let k=N=>{let O=N.target,z=O.scrollWidth-O.clientWidth,W=Math.ceil(O.scrollLeft);W>0&&n===!1&&s(!0),W===0&&n===!0&&s(!1),W<z&&p===!1&&d(!0),W===z&&p===!0&&d(!1)},u=(N=!0)=>{let O=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*O,behavior:"smooth"})},v=null,I=N=>{v!==null?clearTimeout(v):k(N),v=setTimeout(()=>{k(N)},16)};return A?null:ce.createElement(qs,{className:Te(a("carouselContainer",t),i)},ce.createElement("div",{style:{display:"flex",justifyContent:b?"center":"space-between",marginBottom:20,flexWrap:b?"wrap":"nowrap",gap:b?16:20}},ce.createElement("div",null,ce.createElement(Xs,{className:a("carouselTitle",t)},l==null?void 0:l.title),ce.createElement(Ct.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ce.createElement(Js,{className:a("progressWrapper",t)},ce.createElement(ze,{count:S,total:c.length,appearance:t}))),ce.createElement("div",{style:{position:"relative"}},ce.createElement(el,{show:n,onClick:()=>u(!1)}),ce.createElement(el,{side:"right",show:p,onClick:u}),ce.createElement(Ws,{ref:r,onScroll:I},x.map((N,O)=>ce.createElement(_s,{key:O,style:{flex:`0 0 calc(100% - ${c.length>h?36:0}px)`}},N.map((z,W)=>ce.createElement(Rs,{key:W,stepData:z,style:{flex:c.length>h?`0 1 calc(100% / ${h} - 16px * 2 / ${h})`:1},appearance:t})))))),ce.createElement(ie,{appearance:t}))};var zr=L=>{var A=L,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:f,hideOnFlowCompletion:S,setVisible:T,customStepTypes:b,checklistStyle:h="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:y}=A,F=Oe(A,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:x,getFlowSteps:k,markStepCompleted:u,getStepStatus:v,getNumberOfStepsCompleted:I,isLoading:N,targetingLogicShouldHideFlow:O,updateCustomVariables:z,getFlowMetadata:W,isStepBlocked:q,getFlowStatus:ae,hasActiveFullPageFlow:Q,setHasActiveFullPageFlow:K}=R(),{primaryCTAClickSideEffects:he,secondaryCTAClickSideEffects:ve}=pe(),{getOpenFlowState:ue,setOpenFlowState:G}=Be(),[Y,ee]=rl(r||0),[Ve,fe]=rl(!1),ne=d===void 0?ue(e):d,Ce=s==="modal",{mergeAppearanceWithDefault:Ie}=te();if(f=Ie(f),ol(()=>{z(l)},[l,N]),ol(()=>{d!==void 0&&(Ce&&d===!0?K(!0):Ce&&d===!1&&K(!1))},[d,T,Q]),N)return null;let ye=x(e);if(!ye||O(ye))return null;let M=k(e);if(!M||S===!0&&ae(e)===Z)return null;let D=W(e);if(D!=null&&D.title&&(t=D.title),D!=null&&D.subtitle&&(o=D.subtitle),!Ve&&r===void 0&&I(e)>0){let g=M.findIndex(U=>U.complete===!1);ee(g>-1?g:M.length-1),fe(!0)}function _(){if(Y+1>=M.length){Ce&&G(e,!1);return}q(e,M[Y+1].id)||ee(Y+1)}function X(g,U,Se){let se=Y+1<M.length?M[Y+1]:null;c&&c(g,Y,U,se)===!0&&Ce&&Ge(),m&&m(g,Se,se),!m&&!c&&(g.primaryButtonUri||g.secondaryButtonUri)&&Ce&&Ge()}function we(){return M.map((g,U)=>H(P({},g),{handleSecondaryButtonClick:()=>{_(),ve(g),g.skippable===!0&&u(e,g.id,{skipped:!0}),X(g,"secondary",U)},handlePrimaryButtonClick:()=>{(!g.completionCriteria&&(g.autoMarkCompleted||g.autoMarkCompleted===void 0)||g.completionCriteria&&g.autoMarkCompleted===!0)&&(u(e,g.id),_()),X(g,"primary",U),he(g),v(e,g.id)===Ke&&_()}}))}function De(){return xe.createElement(ie,{appearance:f})}let mt={steps:we(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:b,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:y};function Ge(){G(e,!1),p&&p(),T&&T(!1)}function Lt(){return xe.createElement(xe.Fragment,null,xe.createElement(De,null),xe.createElement(tl,{flowId:e,appearance:f,customVariables:l,className:n}))}function Dt(){return xe.createElement(xe.Fragment,null,xe.createElement(De,null),xe.createElement(Mr,P({visible:ne,onClose:()=>{Ge()},selectedStep:Y,setSelectedStep:ee,autoExpandNextStep:!0,appearance:f},mt)))}function C(){var Se;let g=F.guideFlowId,U;return g&&x(g)&&(U=k(g)),xe.createElement(xe.Fragment,null,xe.createElement(De,null),xe.createElement($r,P({visible:ne,stepsTitle:D.stepsTitle?D.stepsTitle:"Your quick start guide",onClose:()=>{Ge()},selectedStep:Y,setSelectedStep:ee,guideData:U,guideTitle:(Se=F.guideTitle)!=null?Se:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:se=>{X(se,"link",0)},customStepTypes:b},mt)))}function w(){let g=xe.createElement(Lr,P({flowId:e,style:i,selectedStep:Y,setSelectedStep:ee,appearance:f,type:s},mt));return Ce?xe.createElement(Je,{onClose:()=>{Ge()},visible:ne,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},xe.createElement(De,null),g):xe.createElement(xe.Fragment,null,xe.createElement(De,null),g)}switch(h){case"condensed":return Dt();case"with-guide":return C();case"default":return w();case"carousel":return Lt();default:return w()}};var dc=e=>pc.createElement(zr,P({type:"inline"},e));import St,{useEffect as cc}from"react";import et from"react";import Zo from"styled-components";var il=Zo.div`
|
|
1358
1358
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1359
1359
|
border-radius: 8px;
|
|
1360
1360
|
padding: 6px 10px 6px 10px;
|
|
1361
1361
|
min-width: 160px;
|
|
1362
1362
|
cursor: pointer;
|
|
1363
1363
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1364
|
-
`,
|
|
1364
|
+
`,nl=Zo.div`
|
|
1365
1365
|
display: flex;
|
|
1366
1366
|
flex-direction: row;
|
|
1367
1367
|
justify-content: space-between;
|
|
1368
1368
|
align-items: center;
|
|
1369
1369
|
margin-bottom: 2px;
|
|
1370
1370
|
flex-grow: 2;
|
|
1371
|
-
`,
|
|
1371
|
+
`,sl=Zo.div`
|
|
1372
1372
|
text-overflow: ellipsis;
|
|
1373
1373
|
font-weight: 600;
|
|
1374
1374
|
font-size: 12px;
|
|
@@ -1376,13 +1376,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1376
1376
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1377
1377
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1378
1378
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1379
|
-
`,
|
|
1379
|
+
`,ll=Zo.div`
|
|
1380
1380
|
width: 20px;
|
|
1381
1381
|
margin-right: 8px;
|
|
1382
1382
|
display: flex;
|
|
1383
1383
|
height: 100%;
|
|
1384
1384
|
align-items: center;
|
|
1385
|
-
`;var
|
|
1385
|
+
`;var al=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>et.createElement(et.Fragment,null,et.createElement(ie,{appearance:s}),et.createElement(il,{onClick:()=>i!==void 0&&i(),style:P(P({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),r),className:Te(n!=null?n:"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&et.createElement(ll,{className:a("progressRingContainer",s)},et.createElement(Ht,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),et.createElement(nl,{type:p,className:a("badgeTitleContainer",s)},et.createElement(sl,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&et.createElement(Qt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&et.createElement(ze,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import yt from"react";import wo from"styled-components";var pl=wo.div`
|
|
1386
1386
|
display: flex;
|
|
1387
1387
|
flex-direction: row;
|
|
1388
1388
|
width: 100%;
|
|
@@ -1393,25 +1393,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1393
1393
|
border-width: 1px;
|
|
1394
1394
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1395
1395
|
border-radius: 12px;
|
|
1396
|
-
`,
|
|
1397
|
-
${e=>
|
|
1396
|
+
`,dl=wo.div`
|
|
1397
|
+
${e=>E(e)} {
|
|
1398
1398
|
display: flex;
|
|
1399
1399
|
justify-content: center;
|
|
1400
1400
|
align-items: center;
|
|
1401
1401
|
margin-right: 16px;
|
|
1402
1402
|
}
|
|
1403
|
-
`,
|
|
1403
|
+
`,cl=wo.div`
|
|
1404
1404
|
display: flex;
|
|
1405
1405
|
flex-direction: column;
|
|
1406
1406
|
flex: 1;
|
|
1407
1407
|
margin-top: 0;
|
|
1408
|
-
`,
|
|
1408
|
+
`,ml=wo.div`
|
|
1409
1409
|
display: flex;
|
|
1410
1410
|
flex-direction: column;
|
|
1411
1411
|
justify-content: center;
|
|
1412
1412
|
margin-left: 16px;
|
|
1413
1413
|
min-width: 200px;
|
|
1414
|
-
|
|
1414
|
+
`,$S=wo.div`
|
|
1415
1415
|
display: flex;
|
|
1416
1416
|
justify-content: center;
|
|
1417
1417
|
align-items: flex-end;
|
|
@@ -1420,7 +1420,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1420
1420
|
:hover {
|
|
1421
1421
|
opacity: 0.8;
|
|
1422
1422
|
}
|
|
1423
|
-
`;var
|
|
1423
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>yt.createElement(yt.Fragment,null,yt.createElement(pl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:p},o&&yt.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),yt.createElement(cl,null,yt.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),yt.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},yt.createElement(ze,{count:r,total:n,display:"percent",textLocation:"top"}))));var mc=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:S,getNumberOfStepsCompleted:T,isLoading:b,targetingLogicShouldHideFlow:h,updateCustomVariables:B}=R(),{mergeAppearanceWithDefault:y}=te();l=y(l);let{setOpenFlowState:F,getOpenFlowState:L}=Be();if(cc(()=>{B(p)},[p,b]),b)return null;let A=c(e);if(!A||h(A)||d===!0&&S(e)===Z)return null;let x=f(e),k=T(e);return m==="full-width"?St.createElement(St.Fragment,null,St.createElement(ie,{appearance:l}),St.createElement(ul,{title:t,subtitle:o,count:k,total:x.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):St.createElement(St.Fragment,null,St.createElement(ie,{appearance:l}),St.createElement(al,{count:k,total:x.length,title:t,style:r,onClick:()=>{F(e,!0),n&&n()},type:m,className:s,appearance:l}))};import uc from"react";var fc=r=>{var n=r,{flowId:e,style:t,appearance:o}=n,i=Oe(n,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:p,getFlowSteps:d}=R(),{mergeAppearanceWithDefault:l}=te();o=l(o);let m=s(e);if(!m||p(m))return null;let c=d(e);return uc.createElement(bo,P({steps:c,style:t,appearance:o},i))};import It,{useContext as vc,useEffect as Bc}from"react";import V,{useEffect as Ro,useLayoutEffect as xl,useRef as Sc,useState as eo}from"react";import To from"styled-components";import{useCallback as gc,useEffect as xc,useState as hc}from"react";var Wr=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function fl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=hc(o),n=gc(()=>{e&&r(e.getBoundingClientRect())},[e]);return xc(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}import{useContext as Cc,useState as yc}from"react";function gl(){let{debug:e}=Cc(J),[t,o]=yc([]);function i(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.log(n)))}function r(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.warn(n)))}return{logIfDebugMode:i,logErrorIfDebugMode:r}}var hl=300,Cl=100,bc=500,to=12,wc=To.div`
|
|
1424
1424
|
width: 100%;
|
|
1425
1425
|
height: 100%;
|
|
1426
1426
|
border-radius: 9999px;
|
|
@@ -1443,26 +1443,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1443
1443
|
opacity: 0;
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
|
-
`,
|
|
1447
|
-
width: ${
|
|
1448
|
-
height: ${
|
|
1446
|
+
`,Tc=To.div`
|
|
1447
|
+
width: ${to}px;
|
|
1448
|
+
height: ${to}px;
|
|
1449
1449
|
border-radius: 100px;
|
|
1450
1450
|
background-color: ${e=>e.primaryColor};
|
|
1451
1451
|
z-index: 20;
|
|
1452
1452
|
opacity: 1;
|
|
1453
|
-
`,
|
|
1453
|
+
`,Fc=To.div`
|
|
1454
1454
|
pointer-events: all;
|
|
1455
|
-
`,
|
|
1455
|
+
`,yl=To.div`
|
|
1456
1456
|
display: flex;
|
|
1457
1457
|
align-content: center;
|
|
1458
1458
|
justify-content: center;
|
|
1459
1459
|
align-items: center;
|
|
1460
1460
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1461
|
-
`,
|
|
1462
|
-
width: ${
|
|
1463
|
-
height: ${
|
|
1464
|
-
`,
|
|
1465
|
-
${e=>
|
|
1461
|
+
`,kc=To(yl)`
|
|
1462
|
+
width: ${to+12}px;
|
|
1463
|
+
height: ${to+12}px;
|
|
1464
|
+
`,Pc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:S,showStepCount:T=!0,completedStepsCount:b=0,showFrigadeBranding:h=!1,cssPosition:B="absolute"})=>{var De,mt,Ge,Lt,Dt,C,w,g,U,Se,se,$t,Xr,Jr,Qr,Zr,Rr,ei,ti;let{logErrorIfDebugMode:y}=gl(),[F,L]=eo(),[A,x]=eo(new Date),k=Sc(null),[u,v]=eo(document.querySelector(e[l].selector)),I=fl(u,A),[N,O]=eo(),[z,W]=eo(!S),q=(mt=(De=e[l])==null?void 0:De.props)!=null&&mt.position?e[l].props.position:B,ae=(Dt=(Lt=(Ge=e[l])==null?void 0:Ge.props)==null?void 0:Lt.zIndex)!=null?Dt:90,Q=(C=F==null?void 0:F.width)!=null?C:hl,K=(w=F==null?void 0:F.height)!=null?w:Cl,[he,ve]=eo(new Date().getTime());s=(Se=(U=(g=e[l])==null?void 0:g.props)==null?void 0:U.offset)!=null?Se:s;let ue=window.location.pathname.split("/").pop();xl(()=>{k.current&&L({width:k.current.clientWidth,height:k.current.clientHeight})},[l,A,q]),Ro(()=>{S||W(!0)},[l]);let G=()=>{let le=document.querySelector(e[l].selector);if(!le){O(void 0),v(null),y(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}N&&N===JSON.stringify(le==null?void 0:le.getBoundingClientRect())||(v(le),x(new Date),le&&O(JSON.stringify(le.getBoundingClientRect())))};if(Ro(()=>{let le=new MutationObserver(G);return le.observe(document.body,{subtree:!0,childList:!0}),()=>le.disconnect()},[G]),Ro(()=>{let le=new MutationObserver(G);return le.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>le.disconnect()},[G]),Ro(()=>{let le=setInterval(()=>{G()},10);return()=>clearInterval(le)},[G]),xl(()=>{setTimeout(()=>{G()},bc),G()},[l,ue]),u===null||!p||I.height===0&&I.width===0&&q!=="fixed"&&B!=="static")return null;let Y=i==="auto"?"right":i,ee=Wr(I,Y,Q,s,q),Ve=I.right+Q>(window.innerWidth||document.documentElement.clientWidth),fe=I.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Ve&&i==="auto"&&(ee=Wr(I,"left",Q,s,q),Y="left"),($t=(se=e[l])==null?void 0:se.props)!=null&&$t.tooltipPosition&&((Jr=(Xr=e[l])==null?void 0:Xr.props)==null?void 0:Jr.tooltipPosition)!=="auto"&&(((Zr=(Qr=e[l])==null?void 0:Qr.props)==null?void 0:Zr.tooltipPosition)==="left"||((ei=(Rr=e[l])==null?void 0:Rr.props)==null?void 0:ei.tooltipPosition)==="right")&&(Y=e[l].props.tooltipPosition);let ne=()=>{let le=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),W(!1),setTimeout(()=>{G()},30)),b===e.length-1)return o()},ut=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),S&&!e[l].secondaryButtonUri&&W(!1))};return V.createElement(V.Fragment,null,T&&e.length>1&&V.createElement(Ci,null,V.createElement(Si,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&V.createElement(yi,{showStepCount:T,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&V.createElement(oe,{title:e[l].secondaryButtonTitle,appearance:c,onClick:ut,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&V.createElement(oe,{title:e[l].primaryButtonTitle,appearance:c,onClick:le,withMargin:!1,size:"small"})))},Ce=()=>V.createElement(V.Fragment,null,f&&V.createElement(ui,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri},V.createElement(Ee,null)),e[l].imageUri&&V.createElement(fi,{dismissible:f,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&V.createElement(gi,{dismissible:f,appearance:c,className:a("tooltipVideoContainer",c)},V.createElement(Ze,{appearance:c,videoUri:e[l].videoUri})),V.createElement(hi,{className:a("tooltipContentContainer",c)},V.createElement(Ae,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),V.createElement(xi,{className:a("tooltipFooter",c)},V.createElement(ne,null)))),ye=P(P({},{default:le=>{var ut;if((ut=e[l])!=null&&ut.StepContent){let ra=e[l].StepContent;return V.createElement("div",null,ra)}return V.createElement(Ce,null)}}),m),M=()=>{var le;return e?!((le=e[l])!=null&&le.type)||!ye[e[l].type]?ye.default(e[l]):ye[e[l].type]({stepData:e[l],primaryColor:n}):V.createElement(V.Fragment,null)};if(e[l].complete===!0||ee.x==0&&ee.y==0&&new Date().getTime()-he<100)return null;let D={top:(ee==null?void 0:ee.y)-to,left:(ti=Y=="left"?I.x+s.x:(ee==null?void 0:ee.x)-to)!=null?ti:0,cursor:S?"pointer":"default",position:q},_=()=>{let ut=D.left+(Y=="left"?-Q:24);return Math.min(Math.max(ut,20),window.innerWidth-Q-20)},X=()=>{if(q==="fixed")return D.top;let le=D.top+K,ut=20;return le>window.innerHeight-ut?D.top+-K:D.top},we=()=>{S&&(x(new Date),W(!z))};return V.createElement(Fc,null,V.createElement(kc,{style:D,zIndex:ae,className:a("tourHighlightContainer",c)},r&&e[l].showHighlight!==!1&&B!=="static"&&V.createElement(V.Fragment,null,V.createElement(Tc,{style:{position:q},onClick:we,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),V.createElement(wc,{style:{position:"absolute"},onClick:we,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),V.createElement(yl,{style:H(P({},D),{left:_(),top:X()}),zIndex:ae+1,className:a("tooltipContainerWrapper",c)},z&&V.createElement(V.Fragment,null,V.createElement(Bo,{ref:k,layoutId:"tooltip-container",style:P({position:"relative",width:"max-content",right:0,top:B!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:hl,zIndex:ae+10},V.createElement(M,null)),h&&V.createElement(wi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:ae+10},V.createElement(Eo,{appearance:c})))))},_r=Pc;import{Portal as Ec}from"react-portal";var Ac=b=>{var h=b,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:S="absolute"}=h,T=Oe(h,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:B,getFlowSteps:y,isLoading:F,targetingLogicShouldHideFlow:L,markStepCompleted:A,markStepStarted:x,markFlowCompleted:k,updateCustomVariables:u,getCurrentStepIndex:v,getStepStatus:I,isStepBlocked:N,getFlowStatus:O,getNumberOfStepsCompleted:z}=R(),{isLoadingUserFlowStateData:W}=Me(),{primaryCTAClickSideEffects:q,secondaryCTAClickSideEffects:ae}=pe(),{hasOpenModals:Q}=Be(),K=v(e),{openFlowStates:he}=vc(J),{mergeAppearanceWithDefault:ve}=te();if(o=ve(o),Bc(()=>{u(t)},[t,F]),W)return null;let ue=B(e);if(!ue||L(ue)||O(e)==Z||Q())return null;let G=y(e);if(Object.keys(he).length>0){let M=Object.keys(he).find(D=>he[D]===!0);if(M!==void 0&&M!==e)return It.createElement(It.Fragment,null)}function Y(M){return $(this,null,function*(){if(yield A(e,M.id),G.map(D=>I(e,D.id)).every(D=>D===Ke)){yield k(e);return}if(!l&&K+1<G.length&&!n){if(N(e,G[K+1].id))return;yield x(e,G[K+1].id)}})}function ee(M,D,_){let X=K+1<G.length?G[K+1]:null;r&&r(M,K,D,X),i&&i(M,_,X)}function Ve(){return G.map(M=>H(P({},M),{handleSecondaryButtonClick:()=>$(this,null,function*(){ae(M),M.skippable===!0&&(yield A(e,M.id,{skipped:!0})),ee(M,"secondary",K)}),handlePrimaryButtonClick:()=>$(this,null,function*(){(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&(yield Y(M)),ee(M,"primary",K),q(M)})}))}function fe(M){return $(this,null,function*(){s&&s(),m==="complete-flow"?yield k(e):yield A(e,M.id)})}function ne(){c&&c()}let Ce=!document.querySelector(G[K].selector);function Ie(){let M=G.findIndex(D=>!!document.querySelector(D.selector));return G.map((D,_)=>Ce&&!n&&_!==M&&f||!n&&_!==K?null:It.createElement(_r,P({key:D.id,appearance:o,steps:Ve(),selectedStep:_,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>fe(D),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:z(e),onComplete:ne,cssPosition:S},T)))}function ye(){return It.createElement(It.Fragment,null,It.createElement(ie,{appearance:o}),Ie())}return S==="static"?ye():It.createElement(Ec,null,ye())};import _e,{useEffect as Ic,useRef as Oc,useState as Nc}from"react";import{Portal as Lc}from"react-portal";import Ot from"styled-components";var Sl=Ot.button`
|
|
1465
|
+
${e=>E(e)} {
|
|
1466
1466
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1467
1467
|
|
|
1468
1468
|
display: flex;
|
|
@@ -1479,17 +1479,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1479
1479
|
opacity: 0.8;
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
|
-
`,
|
|
1483
|
-
${e=>
|
|
1482
|
+
`,bl=Ot.span`
|
|
1483
|
+
${e=>E(e)} {
|
|
1484
1484
|
font-size: 12px;
|
|
1485
1485
|
display: inline-block;
|
|
1486
1486
|
}
|
|
1487
|
-
`,
|
|
1488
|
-
${e=>
|
|
1487
|
+
`,wl=Ot.span`
|
|
1488
|
+
${e=>E(e)} {
|
|
1489
1489
|
font-size: 12px;
|
|
1490
1490
|
display: inline-block;
|
|
1491
1491
|
}
|
|
1492
|
-
`,
|
|
1492
|
+
`,Tl=Ot.div`
|
|
1493
1493
|
position: fixed;
|
|
1494
1494
|
right: 0;
|
|
1495
1495
|
bottom: 0;
|
|
@@ -1499,8 +1499,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1499
1499
|
flex-direction: column;
|
|
1500
1500
|
align-items: flex-end;
|
|
1501
1501
|
z-index: 50;
|
|
1502
|
-
`,
|
|
1503
|
-
${e=>
|
|
1502
|
+
`,Fl=Ot.button`
|
|
1503
|
+
${e=>E(e)} {
|
|
1504
1504
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1505
1505
|
background-color: #ffffff;
|
|
1506
1506
|
border: 1px solid #f5f5f5;
|
|
@@ -1515,8 +1515,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1515
1515
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1516
1516
|
border-radius: 45px;
|
|
1517
1517
|
cursor: pointer;
|
|
1518
|
-
`,
|
|
1519
|
-
${e=>
|
|
1518
|
+
`,kl=Ot.div`
|
|
1519
|
+
${e=>E(e)} {
|
|
1520
1520
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1521
1521
|
background: #ffffff;
|
|
1522
1522
|
}
|
|
@@ -1532,8 +1532,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1532
1532
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1533
1533
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1534
1534
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1535
|
-
`,
|
|
1536
|
-
${e=>
|
|
1535
|
+
`,Pl=Ot.button`
|
|
1536
|
+
${e=>E(e)} {
|
|
1537
1537
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1538
1538
|
color: #434343;
|
|
1539
1539
|
:hover {
|
|
@@ -1549,8 +1549,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1549
1549
|
font-size: 14px;
|
|
1550
1550
|
|
|
1551
1551
|
padding: 8px 12px;
|
|
1552
|
-
`;import
|
|
1553
|
-
${e=>
|
|
1552
|
+
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import El from"react";var Al=({style:e,className:t})=>El.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},El.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Dc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:S}=R(),{primaryCTAClickSideEffects:T}=pe(),b=Oc(null),[h,B]=Nc(!1),{mergeAppearanceWithDefault:y}=te();s=y(s),Ic(()=>(document.addEventListener("click",F,!1),()=>{document.removeEventListener("click",F,!1)}),[]);let F=u=>{b.current&&!b.current.contains(u.target)&&B(!1)};if(f)return null;let L=p(e);if(!L||S(L))return null;let A=d(e);if(!A||!i)return null;function x(u,v){!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)&&l(e,u.id),T(u),o&&o(u,v),B(!1)}function k(){return h&&_e.createElement(kl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},A.map((u,v)=>_e.createElement(Pl,{className:a("floatingWidgetMenuItem",s),key:v,onClick:()=>x(u,v)},u.title)))}return r=="inline"?_e.createElement("span",{ref:b},_e.createElement(Sl,{style:t,onClick:()=>{B(!h)},className:a("supportButton",s)},_e.createElement(wl,{className:a("supportIconContainer",s)},_e.createElement(Al,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),_e.createElement(bl,{className:a("supportButtonTitle",s)},n)),_e.createElement(k,null)):_e.createElement(Lc,null,_e.createElement(Tl,{style:t,ref:b},_e.createElement(k,null),_e.createElement(Fl,{onClick:()=>{B(!h)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},_e.createElement(Bl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import tt,{useEffect as $c}from"react";import er from"styled-components";var Il=er.div`
|
|
1553
|
+
${e=>E(e)} {
|
|
1554
1554
|
display: flex;
|
|
1555
1555
|
flex-direction: column;
|
|
1556
1556
|
width: 100%;
|
|
@@ -1564,18 +1564,18 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1564
1564
|
border-radius: 12px;
|
|
1565
1565
|
position: relative;
|
|
1566
1566
|
}
|
|
1567
|
-
`,
|
|
1567
|
+
`,Ol=er.div`
|
|
1568
1568
|
display: flex;
|
|
1569
1569
|
flex-direction: column;
|
|
1570
1570
|
flex: 1;
|
|
1571
|
-
`,
|
|
1571
|
+
`,Nl=er.div`
|
|
1572
1572
|
display: flex;
|
|
1573
1573
|
flex-direction: column;
|
|
1574
1574
|
justify-content: center;
|
|
1575
1575
|
align-items: flex-start;
|
|
1576
1576
|
margin-top: 16px;
|
|
1577
|
-
`,
|
|
1578
|
-
${e=>
|
|
1577
|
+
`,Ll=er.div`
|
|
1578
|
+
${e=>E(e)} {
|
|
1579
1579
|
position: absolute;
|
|
1580
1580
|
top: 16px;
|
|
1581
1581
|
right: 16px;
|
|
@@ -1585,9 +1585,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1585
1585
|
opacity: 0.8;
|
|
1586
1586
|
}
|
|
1587
1587
|
}
|
|
1588
|
-
`;var
|
|
1588
|
+
`;var Mc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:S,getFlowSteps:T,getFlowStatus:b,getCurrentStepIndex:h}=R(),{primaryCTAClickSideEffects:B}=pe(),{mergeAppearanceWithDefault:y}=te();if(r=y(r),$c(()=>{S(o)},[o,c]),c)return null;let F=d(e);if(!F||f(F)||b(e)===Z)return null;let A=T(e)[h(e)];return tt.createElement(tt.Fragment,null,tt.createElement(ie,{appearance:r}),tt.createElement(Il,{appearance:r,className:Te(a("embeddedTipContainer",r),n),style:s},(p===!0||A.dismissible)&&tt.createElement(Ll,{onClick:()=>$(void 0,null,function*(){yield l(e),t&&t()}),className:a("embeddedTipDismissButton",r)},tt.createElement(Ee,null)),tt.createElement(Ol,null,tt.createElement(Ae,{size:"small",appearance:r,title:A.title,subtitle:A.subtitle})),A.primaryButtonTitle&&tt.createElement(Nl,{className:a("embeddedTipCallToActionContainer",r)},tt.createElement(oe,{classPrefix:"embeddedTip",title:A.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:()=>$(void 0,null,function*(){A.handlePrimaryButtonClick(),B(A),!(i&&i(A,h(e),"primary")===!1)&&(yield m(e,A.id),yield l(e))})}))))};import ke,{useEffect as Uc}from"react";import oo from"styled-components";var Dl=oo.div`
|
|
1589
1589
|
// use the :not annotation
|
|
1590
|
-
${e=>
|
|
1590
|
+
${e=>E(e)} {
|
|
1591
1591
|
display: flex;
|
|
1592
1592
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1593
1593
|
width: 100%;
|
|
@@ -1597,24 +1597,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1597
1597
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1598
1598
|
border-radius: 12px;
|
|
1599
1599
|
}
|
|
1600
|
-
|
|
1601
|
-
${e=>
|
|
1600
|
+
`,$l=oo.div`
|
|
1601
|
+
${e=>E(e)} {
|
|
1602
1602
|
display: flex;
|
|
1603
1603
|
width: 46px;
|
|
1604
1604
|
height: 46px;
|
|
1605
1605
|
}
|
|
1606
|
-
`,
|
|
1606
|
+
`,Ml=oo.div`
|
|
1607
1607
|
display: flex;
|
|
1608
1608
|
flex-direction: column;
|
|
1609
1609
|
flex: 1;
|
|
1610
1610
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1611
1611
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1612
|
-
`,
|
|
1612
|
+
`,Ul=oo.div`
|
|
1613
1613
|
display: flex;
|
|
1614
1614
|
flex-direction: column;
|
|
1615
1615
|
justify-content: center;
|
|
1616
1616
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1617
|
-
|
|
1617
|
+
`,Hr=oo.div`
|
|
1618
1618
|
display: flex;
|
|
1619
1619
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1620
1620
|
align-items: flex-end;
|
|
@@ -1622,12 +1622,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1622
1622
|
:hover {
|
|
1623
1623
|
opacity: 0.8;
|
|
1624
1624
|
}
|
|
1625
|
-
`,
|
|
1625
|
+
`,jr=oo.div`
|
|
1626
1626
|
display: flex;
|
|
1627
1627
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1628
1628
|
align-items: flex-end;
|
|
1629
1629
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1630
|
-
`;import
|
|
1630
|
+
`;import Vr from"react";var zl=({style:e,className:t})=>Vr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Vr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Vr.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 zc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:S,getFlowMetadata:T,getFlowStatus:b,getFlowSteps:h,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:y}=pe(),{mergeAppearanceWithDefault:F}=te();if(s=F(s),Uc(()=>{S(r)},[r,c]),c)return null;let L=l(e);if(!L||f(L)||b(e)===Z)return null;let A=h(e),x=A.length>0?A[B(e)]:T(e);return x!=null&&x.title&&(t=x.title),x!=null&&x.subtitle&&(o=x.subtitle),ke.createElement(ke.Fragment,null,ke.createElement(ie,{appearance:s}),ke.createElement(Dl,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ke.createElement($l,{className:a("bannerIconContainer",s)},d||ke.createElement(zl,null)),p==="square"&&x.dismissible&&ke.createElement(jr,{type:p,className:a("bannerDismissButtonContainer",s)},ke.createElement(Hr,{type:p,onClick:()=>$(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},ke.createElement(Ee,null))),ke.createElement(Ml,{type:p},ke.createElement(Ae,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(x==null?void 0:x.primaryButtonTitle)&&ke.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",s)},ke.createElement(oe,{title:x==null?void 0:x.primaryButtonTitle,appearance:s,onClick:()=>{y(x),n&&n(x,0,"primary")},classPrefix:"banner"})),p!=="square"&&x.dismissible&&ke.createElement(jr,{type:p,className:a("bannerDismissButtonContainer",s)},ke.createElement(Hr,{type:p,onClick:()=>$(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},ke.createElement(Ee,null)))))};import re,{useEffect as Wc}from"react";import{Portal as _c}from"react-portal";import ct from"styled-components";var Wl=ct.div`
|
|
1631
1631
|
display: flex;
|
|
1632
1632
|
flex-direction: column;
|
|
1633
1633
|
width: 100%;
|
|
@@ -1646,7 +1646,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1646
1646
|
z-index: 1000;
|
|
1647
1647
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1648
1648
|
min-width: 550px;
|
|
1649
|
-
`,
|
|
1649
|
+
`,_l=ct.button`
|
|
1650
1650
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1651
1651
|
border-radius: 8px;
|
|
1652
1652
|
// If selected make border color primary and text color color priamry
|
|
@@ -1667,34 +1667,34 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1667
1667
|
display: flex;
|
|
1668
1668
|
justify-content: center;
|
|
1669
1669
|
align-items: center;
|
|
1670
|
-
`,
|
|
1670
|
+
`,Gr=ct.div`
|
|
1671
1671
|
display: flex;
|
|
1672
1672
|
justify-content: space-between;
|
|
1673
1673
|
margin-top: 16px;
|
|
1674
1674
|
gap: 8px;
|
|
1675
|
-
`,
|
|
1675
|
+
`,Hl=ct.div`
|
|
1676
1676
|
display: flex;
|
|
1677
1677
|
justify-content: space-between;
|
|
1678
1678
|
margin-top: 8px;
|
|
1679
|
-
`,
|
|
1679
|
+
`,Kr=ct.div`
|
|
1680
1680
|
font-size: 12px;
|
|
1681
1681
|
line-height: 18px;
|
|
1682
1682
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1683
1683
|
font-style: normal;
|
|
1684
1684
|
font-weight: 400;
|
|
1685
1685
|
letter-spacing: 0.24px;
|
|
1686
|
-
`,
|
|
1686
|
+
`,qr=ct.div`
|
|
1687
1687
|
display: flex;
|
|
1688
1688
|
flex-direction: column;
|
|
1689
1689
|
flex: 1;
|
|
1690
|
-
`,
|
|
1690
|
+
`,tw=ct.div`
|
|
1691
1691
|
display: flex;
|
|
1692
1692
|
flex-direction: column;
|
|
1693
1693
|
justify-content: center;
|
|
1694
1694
|
align-items: flex-start;
|
|
1695
1695
|
margin-top: 16px;
|
|
1696
|
-
`,
|
|
1697
|
-
${e=>
|
|
1696
|
+
`,jl=ct.textarea`
|
|
1697
|
+
${e=>E(e)} {
|
|
1698
1698
|
margin-top: 16px;
|
|
1699
1699
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1700
1700
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1704,8 +1704,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1704
1704
|
width: 100%;
|
|
1705
1705
|
height: 100px;
|
|
1706
1706
|
}
|
|
1707
|
-
`,
|
|
1708
|
-
${e=>
|
|
1707
|
+
`,Vl=ct.div`
|
|
1708
|
+
${e=>E(e)} {
|
|
1709
1709
|
position: absolute;
|
|
1710
1710
|
top: 16px;
|
|
1711
1711
|
right: 16px;
|
|
@@ -1715,8 +1715,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1715
1715
|
opacity: 0.8;
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
`;var
|
|
1719
|
-
${e=>
|
|
1718
|
+
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:S,updateCustomVariables:T,getFlowSteps:b,getFlowStatus:h,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:y}=pe(),{mergeAppearanceWithDefault:F}=te(),[L,A]=re.useState(null),[x,k]=re.useState(""),{hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:v,shouldKeepCompletedFlowOpenDuringSession:I}=Be();if(r=F(r),Wc(()=>{T(o)},[o,f]),f)return null;let N=d(e);if(!N||S(N)||h(e)===Z||c(e)===1&&!I(e)||u())return null;let z=b(e)[c(e)];function W(){return re.createElement(re.Fragment,null,re.createElement(qr,null,re.createElement(Ae,{size:"large",appearance:r,title:z.title,subtitle:z.subtitle})),re.createElement(Gr,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(Q=>re.createElement(_l,{className:a("npsNumberButton",r),selected:L===Q+1,key:Q,onClick:()=>$(this,null,function*(){v(e),A(Q+1),yield m(e,z.id,{score:Q+1})}),appearance:r},Q+1))),re.createElement(Hl,{appearance:r},re.createElement(Kr,{appearance:r},"Not likely at all"),re.createElement(Kr,{appearance:r},"Extremely likely")))}function q(){var Q;return re.createElement(re.Fragment,null,re.createElement(qr,null,re.createElement(Ae,{appearance:r,title:(Q=z.title)!=null?Q:"Why did you choose this score?",size:"large"})),re.createElement(jl,{appearance:r,value:x,onChange:K=>{k(K.target.value)},placeHolder:"Add your optional fedback here..."}),re.createElement(Gr,{appearance:r,className:a("npsNumberButtonContainer",r)},re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield l(e),i&&i(z,1,"primary")}),appearance:r,title:z.secondaryButtonTitle||"Skip",secondary:!0}),re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield m(e,z.id,{feedbackText:x}),yield l(e),i&&i(z,1,"primary")}),appearance:r,title:z.primaryButtonTitle||"Submit"})))}function ae(){return c(e)>=2?null:re.createElement(re.Fragment,null,re.createElement(ie,{appearance:r}),re.createElement(Wl,{appearance:r,className:Te(a("npsSurveyContainer",r),n),style:s,type:p},re.createElement(Vl,{onClick:()=>$(this,null,function*(){yield l(e),t&&t()}),className:a("npsSurveyDismissButton",r)},re.createElement(Ee,null)),c(e)==0&&W(),c(e)==1&&q()))}return p==="inline"?ae():re.createElement(_c,null,ae())};import Pe,{useEffect as Gc}from"react";import Nt from"styled-components";var Gl=Nt.div`
|
|
1719
|
+
${e=>E(e)} {
|
|
1720
1720
|
display: flex;
|
|
1721
1721
|
flex-direction: column;
|
|
1722
1722
|
width: 100%;
|
|
@@ -1726,22 +1726,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1726
1726
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1727
1727
|
position: relative;
|
|
1728
1728
|
}
|
|
1729
|
-
`,
|
|
1729
|
+
`,Kl=Nt.div`
|
|
1730
1730
|
display: flex;
|
|
1731
1731
|
flex-direction: column;
|
|
1732
1732
|
flex: 1;
|
|
1733
|
-
`,
|
|
1733
|
+
`,ql=Nt.div`
|
|
1734
1734
|
display: flex;
|
|
1735
1735
|
flex-direction: row;
|
|
1736
1736
|
justify-content: center;
|
|
1737
1737
|
align-items: stretch;
|
|
1738
1738
|
gap: 16px;
|
|
1739
1739
|
margin-top: 8px;
|
|
1740
|
-
`,
|
|
1740
|
+
`,Yl=Nt.div`
|
|
1741
1741
|
margin-top: 16px;
|
|
1742
1742
|
margin-bottom: 16px;
|
|
1743
|
-
`,
|
|
1744
|
-
${e=>
|
|
1743
|
+
`,Xl=Nt.div`
|
|
1744
|
+
${e=>E(e)} {
|
|
1745
1745
|
position: absolute;
|
|
1746
1746
|
top: -16px;
|
|
1747
1747
|
right: -16px;
|
|
@@ -1751,8 +1751,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1751
1751
|
opacity: 0.8;
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
1754
|
-
|
|
1755
|
-
${e=>
|
|
1754
|
+
`,Jl=Nt.h1`
|
|
1755
|
+
${e=>E(e)} {
|
|
1756
1756
|
font-style: normal;
|
|
1757
1757
|
justify-content: center;
|
|
1758
1758
|
text-align: center;
|
|
@@ -1765,8 +1765,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1765
1765
|
color: ${e=>e.appearance.theme.colorText};
|
|
1766
1766
|
margin-bottom: 8px;
|
|
1767
1767
|
}
|
|
1768
|
-
`,
|
|
1769
|
-
${e=>
|
|
1768
|
+
`,Ql=Nt.h2`
|
|
1769
|
+
${e=>E(e)} {
|
|
1770
1770
|
font-style: normal;
|
|
1771
1771
|
justify-content: center;
|
|
1772
1772
|
text-align: center;
|
|
@@ -1777,10 +1777,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${to}${t}.${to}${t} { ${Object.entries(o).map
|
|
|
1777
1777
|
letter-spacing: 0.28px;
|
|
1778
1778
|
margin-bottom: 8px;
|
|
1779
1779
|
}
|
|
1780
|
-
`;import
|
|
1780
|
+
`;import Zl from"react";import jc from"styled-components";var Vc=jc.img`
|
|
1781
1781
|
width: 100%;
|
|
1782
1782
|
height: 100%;
|
|
1783
1783
|
min-height: 200px;
|
|
1784
1784
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1785
|
-
`;function
|
|
1785
|
+
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Ze,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Vc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Kc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:d})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:S,updateCustomVariables:T,getFlowSteps:b,getFlowStatus:h,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:y,secondaryCTAClickSideEffects:F}=pe(),{mergeAppearanceWithDefault:L}=te(),{setOpenFlowState:A,getOpenFlowState:x,hasOpenModals:k}=Be(),[u,v]=[x(e,!0),ae=>A(e,ae)];if(r=L(r),Gc(()=>{T(o)},[o,f]),f)return null;let I=l(e);if(!I||S(I)||h(e)===Z||k())return null;let O=b(e)[B(e)],z=()=>{v(!1),t&&t(),m(e)};function W(){return Pe.createElement(Pe.Fragment,null,Pe.createElement(ie,{appearance:r}),Pe.createElement(Gl,{appearance:r,className:Te(a("announcementContainer",r),n),style:s},(p===!0||O.dismissible)&&d=="inline"&&Pe.createElement(Xl,{onClick:()=>$(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",r)},Pe.createElement(Ee,null)),Pe.createElement(Kl,null,Pe.createElement(Jl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:de(O.title)}),O.subtitle&&Pe.createElement(Ql,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:de(O.subtitle)})),(O.imageUri||O.videoUri)&&Pe.createElement(Yl,{className:a("announcementMediaContainer",r)},Pe.createElement(Rl,{appearance:r,stepData:O})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&Pe.createElement(ql,{className:a("announcementCTAContainer",r)},O.secondaryButtonTitle&&Pe.createElement(oe,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){O.handleSecondaryButtonClick(),F(O),i&&i(O,B(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&Pe.createElement(oe,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){O.handlePrimaryButtonClick(),y(O),!(i&&i(O,B(e),"primary")===!1)&&(yield c(e,O.id),yield m(e))})}))))}let q={padding:"24px",maxWidth:"400px"};return d==="inline"?W():d!=="center"?Pe.createElement(Oo,{modalPosition:d,onClose:z,visible:u,dismissible:p,appearance:r},W()):Pe.createElement(Je,{appearance:r,onClose:z,visible:u,style:q,dismissible:p},W())};import*as tr from"react";import ea from"react";var ta=r=>{var n=r,{as:e="span",children:t,variant:o="Body1"}=n,i=Oe(n,["as","children","variant"]);return ea.createElement(Tn,P({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},qc=Object.fromEntries(Object.keys(Vo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ea.createElement(ta,H(P({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),Yr=Object.assign(ta,qc);var oa=s=>{var p=s,{as:e="button",className:t,size:o="md",title:i,variant:r="Primary"}=p,n=Oe(p,["as","className","size","title","variant"]);var d;return tr.createElement(wn,P({className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md"},n),tr.createElement(Yr,{color:(d=Co[r])==null?void 0:d.color,fontWeight:"semibold"},i))},Yc=Object.fromEntries(Object.keys(Co).map(e=>{let t=o=>tr.createElement(oa,H(P({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),Xc=Object.assign(oa,Yc);export{ho as Box,Xc as Button,it as CheckBox,nr as FlowType,gt as FormLabel,hr as FormTextField,Kc as FrigadeAnnouncement,zc as FrigadeBanner,zr as FrigadeChecklist,rt as FrigadeDefaultAppearance,Mc as FrigadeEmbeddedTip,fn as FrigadeForm,fc as FrigadeGuide,dc as FrigadeHeroChecklist,Hc as FrigadeNPSSurvey,mc as FrigadeProgressBadge,bd as FrigadeProvider,Dc as FrigadeSupportWidget,Ac as FrigadeTour,ze as ProgressBar,Ht as ProgressRing,Yr as Text,Ar as tokens,Be as useFlowOpens,io as useFlowResponses,R as useFlows,Er as useOrganization,no as useUser,Me as useUserFlowStates};
|
|
1786
1786
|
//# sourceMappingURL=index.mjs.map
|