@frigade/react 2.0.16 → 2.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +35 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
var w = require('@radix-ui/react-dialog');
|
|
4
4
|
var solid = require('@heroicons/react/24/solid');
|
|
5
|
-
var
|
|
5
|
+
var Re = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var so = require('known-css-properties');
|
|
8
|
+
var yo = require('dompurify');
|
|
9
9
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
10
10
|
var react = require('@emotion/react');
|
|
11
11
|
var js = require('@frigade/js');
|
|
12
12
|
var outline = require('@heroicons/react/24/outline');
|
|
13
|
-
var
|
|
13
|
+
var te = require('@radix-ui/react-collapsible');
|
|
14
14
|
var reactHookForm = require('react-hook-form');
|
|
15
|
-
var
|
|
15
|
+
var oe = require('@radix-ui/react-radio-group');
|
|
16
16
|
var S = require('@radix-ui/react-select');
|
|
17
|
-
var
|
|
17
|
+
var W = require('@radix-ui/react-popover');
|
|
18
18
|
|
|
19
19
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
|
|
@@ -37,15 +37,15 @@ function _interopNamespace(e) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
var w__namespace = /*#__PURE__*/_interopNamespace(w);
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
40
|
+
var Re__namespace = /*#__PURE__*/_interopNamespace(Re);
|
|
41
|
+
var so__default = /*#__PURE__*/_interopDefault(so);
|
|
42
|
+
var yo__default = /*#__PURE__*/_interopDefault(yo);
|
|
43
|
+
var te__namespace = /*#__PURE__*/_interopNamespace(te);
|
|
44
|
+
var oe__namespace = /*#__PURE__*/_interopNamespace(oe);
|
|
45
45
|
var S__namespace = /*#__PURE__*/_interopNamespace(S);
|
|
46
|
-
var
|
|
46
|
+
var W__namespace = /*#__PURE__*/_interopNamespace(W);
|
|
47
47
|
|
|
48
|
-
var Zo=Object.defineProperty;var et=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var L=(e,o)=>{for(var t in o)Zo(e,t,{get:o[t],enumerable:!0});};var Ae={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Le={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",inherit:"inherit",red500:"#c00000"};var Ve={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,$e={neutral:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray700"),active:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},focus:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},hover:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")}},primary:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500"),active:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")},focus:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500")},hover:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")}},secondary:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray900"),active:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")},focus:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray900")},hover:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")}}};var _e={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var ot="px",tt=e=>typeof e=="number"?`${4*e}${ot}`:e,rt=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Ne=Object.fromEntries(rt.map(e=>[e,tt(e)]));var ze={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var xe={...Ae,colors:{...Le,...$e},...ze,radii:Ve,shadows:_e,space:Ne};function ee(e,o="",t="."){return Object.keys(e).reduce((n,i)=>{let s=`${o.length?`${o}${t}`:""}${i}`,a=e[i];return typeof a=="object"&&a!==null&&!Array.isArray(a)?Object.assign(n,ee(a,s,t)):n[s]=a,n},{})}function ye(e){return ee(e,"--fr","-")}function je(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let i=e[n];typeof i=="object"&&i!==null&&!Array.isArray(i)?t[n]=je(i,`${o}-${n}`):t[n]=`var(${o}-${n})`;}),t}var he=ye(xe),y=je(xe);var it=new Set(["alt","size","src"]),st=nt__default.default.all.filter(e=>e.indexOf("-")!=0&&!it.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),at=Object.fromEntries(st),be=ee(y.colors),lt={color:be,backgroundColor:be,borderColor:be,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},Ke={...at,...lt},Ue={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},Ge=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function pt(e){return Array.isArray(e)?new Map(e.map(o=>[o,o])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var Je=new Map(Object.entries(Ke).map(([e,o])=>[e,pt(o)])),dt=new Map(Object.entries(Ue).map(([e,o])=>[e,new Set(o)])),ct=new Set(["height","width"]),mt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Xe(e){let[o,t]=e.split(":");return [o,Ge.has(t)?t:null]}function qe(e,o="div"){let t=Object.assign({},e),n={};function i(r){if(r==null)return n;let a=`&:${r.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[a]==null&&(n[a]={}),n[a]}return Object.entries(t).forEach(([r,s])=>{let[a,d]=Xe(r),m=dt.get(a);m!=null&&(m.forEach(g=>{let h=`${g}${d?":"+d:""}`;t[h]=s;}),delete t[r]);}),Object.entries(t).forEach(([r,s])=>{let[a,d]=Xe(r),m=Je.get(a);if(m!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");i(d)[a]=g.map(h=>m.get(h.toString())??h).join(" ");}else m.has(s.toString())?i(d)[a]=m.get(s.toString()):i(d)[a]=s;(typeof o!="string"||!mt.has(o)||!ct.has(a))&&delete t[r];}}),Object.keys(t).forEach(r=>{let s=r.substring(1);r.indexOf("_")===0&&Je.has(s)&&(t[s]=t[r],delete t[r]);}),{cssFromProps:n,unmatchedProps:t}}function ft(){if(typeof window>"u"){let{JSDOM:e}=et("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ye(e){return e?{__html:ut__default.default(ft()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function xt(e){return e&&`fr-${e}`}function eo(e){return e&&(Array.isArray(e)?e.map(o=>eo(o)).join(" "):xt(e))}function yt({as:e,children:o,className:t,css:n={},part:i,...r},s){let a=e??"div",{cssFromProps:d,unmatchedProps:m}=qe(r,a),g=eo(i),h=t||g?clsx.clsx(t,g):void 0,c=[{boxSizing:"border-box"},d,n];return typeof o=="string"?jsxRuntime.jsx(a,{className:h,css:c,...m,ref:s,dangerouslySetInnerHTML:Ye(o)}):jsxRuntime.jsx(a,{className:h,css:c,...m,ref:s,children:o})}var l=Se__namespace.forwardRef(yt);var x={};L(x,{Body1:()=>Mt,Body2:()=>Ht,Caption:()=>Wt,Display1:()=>vt,Display2:()=>kt,H1:()=>Dt,H2:()=>Et,H3:()=>Ot,H4:()=>It});var Pe={};L(Pe,{Body1:()=>Tt,Body2:()=>wt,Caption:()=>Rt,Display1:()=>ht,Display2:()=>bt,H1:()=>Pt,H2:()=>Ct,H3:()=>St,H4:()=>Ft});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},ht={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},bt={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},Pt={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},Ct={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},St={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},Ft={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},Tt={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},wt={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Rt={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var Bt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(Bt.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Se__namespace.forwardRef(({as:n=o,children:i,...r},s)=>jsxRuntime.jsx(l,{as:n,...Pe[e],...r,ref:s,children:i}));return t.displayName=`Text.${e}`,[e,t]})),vt=H.Display1,kt=H.Display2,Dt=H.H1,Et=H.H2,Ot=H.H3,It=H.H4,Mt=H.Body1,Ht=H.Body2,Wt=H.Caption;var Ce={};L(Ce,{Link:()=>$t,Plain:()=>_t,Primary:()=>Lt,Secondary:()=>Vt});var se={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},Lt={...se,backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},Vt={...se,backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},$t={...se,backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},_t={...se,backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"};function to({as:e,children:o,part:t,title:n,variant:i="Primary",...r}){let s=i.toLocaleLowerCase();return jsxRuntime.jsxs(l,{as:e??"button",part:[`button-${s}`,t],...Ce[i],...r,children:[o,n&&jsxRuntime.jsx(x.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:n})]})}var Nt=["Primary","Secondary","Link","Plain"],zt=Object.fromEntries(Nt.map(e=>{let o=t=>jsxRuntime.jsx(to,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(to,zt);var f={};L(f,{Column:()=>Ut,Row:()=>Kt});var Kt=Se__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),Ut=Se__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var v=Se.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function er({children:e,navigate:o,theme:t,...n}){let i=t?ye(t):{},[r,s]=Se.useState(new Set),a=Se.useMemo(()=>new js.Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId,__readOnly:n.__readOnly,__flowConfigOverrides:n.__flowConfigOverrides}),[n.userId,n.groupId,n.apiKey]),d=o??((g,h="_self")=>{window.open(g,h);});Se.useEffect(()=>()=>{a.destroy();},[]);let m=r.size>0?r.values().next().value:null;return jsxRuntime.jsxs(v.Provider,{value:{modals:r,setModals:s,currentModal:m,navigate:d,...n,frigade:a},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...he,...i}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function oe(e,o){let[t,n]=Se.useState(),[,i]=Se.useState(""),{frigade:r}=Se.useContext(v),s=a=>{a.id===e&&(o!=null&&o.variables&&a.applyVariables(o.variables),n(a),i(Math.random().toString()));};return Se.useEffect(()=>((async()=>{let a=await r.getFlow(e);if(!a||r.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&a.applyVariables(o.variables),n(a);})(),r.onStateChange(s),()=>{r.removeStateChangeHandler(s);}),[]),{flow:t}}function z(e,{onComplete:o,onDismiss:t}={}){let n=Se.useRef(null);return Se.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&(async()=>await(o==null?void 0:o(e)))(),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Se.useCallback(async i=>{if(await(t==null?void 0:t(e,i))===!1)return i.preventDefault(),!1;await e.skip();},[e])}}function j(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=Se.useContext(v);return {handlePrimary:Se.useCallback(async(i,r)=>await(o==null?void 0:o(e,i))===!1?(i.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:Se.useCallback(async(i,r)=>await(t==null?void 0:t(e,i))===!1?(i.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e,o=!0){let{currentModal:t,modals:n,setModals:i}=Se.useContext(v),[r,s]=Se.useState(!1);Se.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&i(d=>new Set(d).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Se.useEffect(()=>{let d=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&d!==r&&s(d);},[e==null?void 0:e.id,t]);function a(){o&&n.has(e==null?void 0:e.id)&&i(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:r||!o,removeModal:a}}function O({as:e,children:o,container:t,dismissible:n=!1,flowId:i,onComplete:r,onDismiss:s,onPrimary:a,onSecondary:d,variables:m,forceMount:g,...h}){let{flow:c}=oe(i,{variables:m}),F=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=z(c,{onComplete:r,onDismiss:s}),{handlePrimary:N,handleSecondary:ue}=j(F,{onPrimary:a,onSecondary:d}),ne=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:Z,removeModal:fe}=te(c,ne);if(Se.useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&fe();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let ge=g&&c.isCompleted;return !c.isVisible&&!ge?null:(!c.isCompleted&&!c.isSkipped&&F.start(),jsxRuntime.jsx(e??l,{position:"relative",...h,children:o({flow:c,handleDismiss:q,handlePrimary:N,handleSecondary:ue,parentProps:{container:t,dismissible:n,flowId:i,variables:m,...h},step:F})}))}function po(e){return jsxRuntime.jsx(O,{as:u,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:i},step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(f.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsxRuntime.jsx(u.Title,{children:r.title}),i&&jsxRuntime.jsx(u.Dismiss,{onClick:o}),jsxRuntime.jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsxRuntime.jsx(u.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(f.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(u.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsxRuntime.jsx(u.Primary,{title:r.primaryButtonTitle??"Continue",onClick:t})]})]})})}function co({part:e,src:o,...t}){return jsxRuntime.jsx(l,{as:"img",part:["image",e],src:o,...t})}function fr(e){var o,t,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function uo({part:e,src:o,...t}){let n=fr(o);return n?jsxRuntime.jsx(l,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:n,...t}):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(l,{as:"video",controls:!0,part:["video",e],src:o,...t}):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function U({src:e,type:o,...t}){return jsxRuntime.jsx(o==="video"?uo:co,{src:e,...t})}var u=Se__namespace.forwardRef(({children:e,flowId:o,...t},n)=>{if(o!=null)return jsxRuntime.jsx(po,{flowId:o,...t});let i=t.as??f.Column;return jsxRuntime.jsx(i,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:n,children:e})});u.Dismiss=e=>jsxRuntime.jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});u.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});u.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});u.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});u.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body2,{display:"block",part:"subtitle",...o,children:e});u.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});function C({children:e,...o}){return jsxRuntime.jsx(w__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(w__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(w__namespace.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsxRuntime.jsx(u,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}C.Dismiss=e=>jsxRuntime.jsx(w__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});C.Subtitle=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(x.Body2,{part:"subtitle",...o,children:e})});C.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});C.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});C.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,i)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*i,cy:"4px",fill:e===i?y.colors.blue500:y.colors.blue800,part:e===i?"progress-dot-selected":"progress-dot"},i));return jsxRuntime.jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};C.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});C.Title=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(x.H3,{part:"title",...o,children:e})});C.displayName="Dialog";function br({flowId:e,...o}){return jsxRuntime.jsx(O,{as:C,dismissible:!0,flowId:e,textAlign:"center",...o,children:({flow:t,handleDismiss:n,handlePrimary:i,handleSecondary:r,parentProps:{dismissible:s},step:a})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(C.Dismiss,{onClick:n}),jsxRuntime.jsxs(f.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(C.Title,{children:a.title}),jsxRuntime.jsx(C.Subtitle,{children:a.subtitle})]}),jsxRuntime.jsx(C.Media,{src:a.videoUri??a.imageUri,type:a.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(C.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(f.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[a.secondaryButtonTitle&&jsxRuntime.jsx(C.Secondary,{onClick:r,title:a.secondaryButtonTitle}),a.primaryButtonTitle&&jsxRuntime.jsx(C.Primary,{onClick:i,title:a.primaryButtonTitle??"Continue"})]})]})})}function Cr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:u,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:n,handleSecondary:i,step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(f.Row,{gap:3,children:[r.imageUri&&jsxRuntime.jsx(l,{as:"img",part:"image",src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(f.Column,{children:[jsxRuntime.jsx(x.H4,{part:"title",children:r.title}),jsxRuntime.jsx(x.Body2,{part:"subtitle",children:r.subtitle})]})]}),jsxRuntime.jsxs(f.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle,onClick:n}),o.dismissible&&jsxRuntime.jsx(u.Dismiss,{onClick:t})]})]})})}var To={};L(To,{Collapsible:()=>Fo,CollapsibleStep:()=>le});var le={};L(le,{Content:()=>Re,Root:()=>Be,Trigger:()=>ve});var Tr=react.keyframes`
|
|
48
|
+
var oo=Object.defineProperty;var ro=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var N=(e,t)=>{for(var o in t)oo(e,o,{get:t[o],enumerable:!0});};var Ne={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var _e={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",inherit:"inherit",red500:"#c00000"};var ze={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,je={neutral:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray700"),active:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},focus:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},hover:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")}},primary:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500"),active:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")},focus:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500")},hover:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")}},secondary:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray900"),active:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")},focus:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray900")},hover:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")}}};var Ke={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var no="px",io=e=>typeof e=="number"?`${4*e}${no}`:e,ao=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Ue=Object.fromEntries(ao.map(e=>[e,io(e)]));var Ge={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var Pe={...Ne,colors:{..._e,...je},...Ge,radii:ze,shadows:Ke,space:Ue};function ne(e,t="",o="."){return Object.keys(e).reduce((i,n)=>{let a=`${t.length?`${t}${o}`:""}${n}`,s=e[n];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,ne(s,a,o)):i[a]=s,i},{})}function Ce(e){return ne(e,"--fr","-")}function Xe(e,t="--fr"){let o={};return Object.keys(e).forEach(i=>{let n=e[i];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[i]=Xe(n,`${t}-${i}`):o[i]=`var(${t}-${i})`;}),o}var Se=Ce(Pe),y=Xe(Pe);var lo=new Set(["alt","size","src"]),po=so__default.default.all.filter(e=>e.indexOf("-")!=0&&!lo.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),co=Object.fromEntries(po),Fe=ne(y.colors),mo={color:Fe,backgroundColor:Fe,borderColor:Fe,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},Je={...co,...mo},qe={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},Ye=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function uo(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var Qe=new Map(Object.entries(Je).map(([e,t])=>[e,uo(t)])),fo=new Map(Object.entries(qe).map(([e,t])=>[e,new Set(t)])),go=new Set(["height","width"]),xo=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ze(e){let[t,o]=e.split(":");return [t,Ye.has(o)?o:null]}function et(e,t="div"){let o=Object.assign({},e),i={};function n(r){if(r==null)return i;let s=`&:${r.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[s]==null&&(i[s]={}),i[s]}return Object.entries(o).forEach(([r,a])=>{let[s,d]=Ze(r),m=fo.get(s);m!=null&&(m.forEach(x=>{let b=`${x}${d?":"+d:""}`;o[b]=a;}),delete o[r]);}),Object.entries(o).forEach(([r,a])=>{let[s,d]=Ze(r),m=Qe.get(s);if(m!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let x=a.split(" ");n(d)[s]=x.map(b=>m.get(b.toString())??b).join(" ");}else m.has(a.toString())?n(d)[s]=m.get(a.toString()):n(d)[s]=a;(typeof t!="string"||!xo.has(t)||!go.has(s))&&delete o[r];}}),Object.keys(o).forEach(r=>{let a=r.substring(1);r.indexOf("_")===0&&Qe.has(a)&&(o[a]=o[r],delete o[r]);}),{cssFromProps:i,unmatchedProps:o}}function ho(){if(typeof window>"u"){let{JSDOM:e}=ro("jsdom");return new e("<!DOCTYPE html>").window}return window}function tt(e){return e?{__html:yo__default.default(ho()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function Po(e){return e&&`fr-${e}`}function nt(e){return e&&(Array.isArray(e)?e.map(t=>nt(t)).join(" "):Po(e))}function Co({as:e,children:t,className:o,css:i={},part:n,...r},a){let s=e??"div",{cssFromProps:d,unmatchedProps:m}=et(r,s),x=nt(n),b=o||x?clsx.clsx(o,x):void 0,c=[{boxSizing:"border-box"},d,i];return typeof t=="string"?jsxRuntime.jsx(s,{className:b,css:c,...m,ref:a,dangerouslySetInnerHTML:tt(t)}):jsxRuntime.jsx(s,{className:b,css:c,...m,ref:a,children:t})}var l=Re__namespace.forwardRef(Co);var f={};N(f,{Body1:()=>Lo,Body2:()=>Vo,Caption:()=>$o,Display1:()=>Oo,Display2:()=>Mo,H1:()=>Io,H2:()=>Ho,H3:()=>Wo,H4:()=>Ao});var Te={};N(Te,{Body1:()=>vo,Body2:()=>ko,Caption:()=>Do,Display1:()=>So,Display2:()=>Fo,H1:()=>To,H2:()=>wo,H3:()=>Ro,H4:()=>Bo});var A={color:"neutral.foreground",fontFamily:"default",margin:"0"},So={...A,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},Fo={...A,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},To={...A,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},wo={...A,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},Ro={...A,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},Bo={...A,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},vo={...A,fontSize:"md",fontWeight:"regular",lineHeight:"md"},ko={...A,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Do={...A,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var Eo=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],L=Object.fromEntries(Eo.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",o=Re__namespace.forwardRef(({as:i=t,children:n,...r},a)=>jsxRuntime.jsx(l,{as:i,...Te[e],...r,ref:a,children:n}));return o.displayName=`Text.${e}`,[e,o]})),Oo=L.Display1,Mo=L.Display2,Io=L.H1,Ho=L.H2,Wo=L.H3,Ao=L.H4,Lo=L.Body1,Vo=L.Body2,$o=L.Caption;var we={};N(we,{Link:()=>jo,Plain:()=>Ko,Primary:()=>_o,Secondary:()=>zo});var de={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},_o={...de,backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},zo={...de,backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},jo={...de,backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Ko={...de,backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"};function at({as:e,children:t,part:o,title:i,variant:n="Primary",...r}){let a=n.toLocaleLowerCase();return jsxRuntime.jsxs(l,{as:e??"button",part:[`button-${a}`,o],...we[n],...r,children:[t,i&&jsxRuntime.jsx(f.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var Uo=["Primary","Secondary","Link","Plain"],Go=Object.fromEntries(Uo.map(e=>{let t=o=>jsxRuntime.jsx(at,{...o,variant:e,children:o.children});return t.displayName=`Button.${e}`,[e,t]})),h=Object.assign(at,Go);var g={};N(g,{Column:()=>qo,Row:()=>Jo});var Jo=Re__namespace.forwardRef((e,t)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"row",...e,ref:t})),qo=Re__namespace.forwardRef((e,t)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"column",...e,ref:t}));var v=Re.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function nr({children:e,navigate:t,theme:o,...i}){let n=o?Ce(o):{},[r,a]=Re.useState(new Set),s=Re.useMemo(()=>new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,__readOnly:i.__readOnly,__flowConfigOverrides:i.__flowConfigOverrides}),[i.userId,i.groupId,i.apiKey]),d=t??((x,b="_self")=>{window.open(x,b);});Re.useEffect(()=>()=>{s.destroy();},[]);let m=r.size>0?r.values().next().value:null;return jsxRuntime.jsxs(v.Provider,{value:{modals:r,setModals:a,currentModal:m,navigate:d,...i,frigade:s},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...Se,...n}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function ie(e,t){let[o,i]=Re.useState(),[,n]=Re.useState(""),{frigade:r}=Re.useContext(v),a=s=>{s.id===e&&(t!=null&&t.variables&&s.applyVariables(t.variables),i(s),n(Math.random().toString()));};return Re.useEffect(()=>((async()=>{let s=await r.getFlow(e);if(!s||r.hasFailedToLoad()){i(void 0);return}t!=null&&t.variables&&s.applyVariables(t.variables),i(s);})(),r.onStateChange(a),()=>{r.removeStateChangeHandler(a);}),[]),{flow:o}}function U(e,{onComplete:t,onDismiss:o}={}){let i=Re.useRef(null);return Re.useEffect(()=>{e!=null&&(e.isCompleted&&i.current===!1&&(async()=>await(t==null?void 0:t(e)))(),i.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Re.useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function G(e,{onPrimary:t,onSecondary:o}={}){let{navigate:i}=Re.useContext(v);return {handlePrimary:Re.useCallback(async(n,r)=>await(t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:Re.useCallback(async(n,r)=>await(o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function ae(e,t=!0){let{currentModal:o,modals:i,setModals:n}=Re.useContext(v),[r,a]=Re.useState(!1);Re.useEffect(()=>{t&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&n(d=>new Set(d).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Re.useEffect(()=>{let d=o===(e==null?void 0:e.id);t&&(e==null?void 0:e.id)!=null&&d!==r&&a(d);},[e==null?void 0:e.id,o]);function s(){t&&i.has(e==null?void 0:e.id)&&n(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:r||!t,removeModal:s}}function H({as:e,children:t,container:o,dismissible:i=!1,flowId:n,onComplete:r,onDismiss:a,onPrimary:s,onSecondary:d,variables:m,forceMount:x,...b}){let{flow:c}=ie(n,{variables:m}),F=c==null?void 0:c.getCurrentStep(),{handleDismiss:ee}=U(c,{onComplete:r,onDismiss:a}),{handlePrimary:K,handleSecondary:ye}=G(F,{onPrimary:s,onSecondary:d}),le=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:re,removeModal:he}=ae(c,le);if(Re.useEffect(()=>{!(c!=null&&c.isVisible)&&re&&he();},[c==null?void 0:c.isVisible,re]),c==null||!re)return null;let be=x&&c.isCompleted;return !c.isVisible&&!be?null:(!c.isCompleted&&!c.isSkipped&&F.start(),jsxRuntime.jsx(e??l,{position:"relative",...b,children:t({flow:c,handleDismiss:ee,handlePrimary:K,handleSecondary:ye,parentProps:{container:o,dismissible:i,flowId:n,variables:m,...b},step:F})}))}function ut(e){return jsxRuntime.jsx(H,{as:u,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:t,handlePrimary:o,handleSecondary:i,parentProps:{dismissible:n},step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(g.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsxRuntime.jsx(u.Title,{children:r.title}),n&&jsxRuntime.jsx(u.Dismiss,{onClick:t}),jsxRuntime.jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsxRuntime.jsx(u.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(g.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(u.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsxRuntime.jsx(u.Primary,{title:r.primaryButtonTitle??"Continue",onClick:o})]})]})})}function ft({part:e,src:t,...o}){return jsxRuntime.jsx(l,{as:"img",part:["image",e],src:t,...o})}function hr(e){var t,o,i,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(i=e.split("wistia.com/medias/")[1])==null?void 0:i.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function xt({part:e,src:t,...o}){let i=hr(t);return i?jsxRuntime.jsx(l,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i,...o}):t!=null&&t.endsWith(".mp4")?jsxRuntime.jsx(l,{as:"video",controls:!0,part:["video",e],src:t,...o}):(console.error(`Could not map videoUri ${t} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function J({src:e,type:t,...o}){return jsxRuntime.jsx(t==="video"?xt:ft,{src:e,...o})}var u=Re__namespace.forwardRef(({children:e,flowId:t,...o},i)=>{if(t!=null)return jsxRuntime.jsx(ut,{flowId:t,...o});let n=o.as??g.Column;return jsxRuntime.jsx(n,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...o,ref:i,children:e})});u.Dismiss=e=>jsxRuntime.jsx(h.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});u.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(J,{borderRadius:"md",src:e,...t});u.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(h.Primary,{title:t,onClick:e,...o});u.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(h.Secondary,{title:t,onClick:e,...o});u.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.Body2,{display:"block",part:"subtitle",...t,children:e});u.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.Body1,{display:"block",fontWeight:"bold",part:"title",...t,children:e});function C({children:e,...t}){return jsxRuntime.jsx(w__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(w__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(w__namespace.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsxRuntime.jsx(u,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",top:"50%",transform:"translate(-50%, -50%)",...t,children:e})})]})})})}C.Dismiss=e=>jsxRuntime.jsx(w__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(h.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});C.Subtitle=({children:e,...t})=>jsxRuntime.jsx(w__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(f.Body2,{part:"subtitle",...t,children:e})});C.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(J,{borderRadius:"md",src:e,...t});C.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(h.Primary,{title:t,onClick:e,...o});C.ProgressDots=({current:e,total:t})=>{if(t==1)return null;let o=[...Array(t)].map((i,n)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?y.colors.blue500:y.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,children:o})};C.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(h.Secondary,{title:t,onClick:e,...o});C.Title=({children:e,...t})=>jsxRuntime.jsx(w__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(f.H3,{part:"title",...t,children:e})});C.displayName="Dialog";function Fr({flowId:e,...t}){return jsxRuntime.jsx(H,{as:C,dismissible:!0,flowId:e,textAlign:"center",...t,children:({flow:o,handleDismiss:i,handlePrimary:n,handleSecondary:r,parentProps:{dismissible:a},step:s})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx(C.Dismiss,{onClick:i}),jsxRuntime.jsxs(g.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(C.Title,{children:s.title}),jsxRuntime.jsx(C.Subtitle,{children:s.subtitle})]}),jsxRuntime.jsx(C.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(C.ProgressDots,{current:o.getNumberOfCompletedSteps(),total:o.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(g.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsxRuntime.jsx(C.Secondary,{onClick:r,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsxRuntime.jsx(C.Primary,{onClick:n,title:s.primaryButtonTitle??"Continue"})]})]})})}function wr({flowId:e,...t}){return jsxRuntime.jsx(H,{as:u,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...t,children:({handleDismiss:o,handlePrimary:i,handleSecondary:n,step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(g.Row,{gap:3,children:[r.imageUri&&jsxRuntime.jsx(l,{as:"img",part:"image",src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(g.Column,{children:[jsxRuntime.jsx(f.H4,{part:"title",children:r.title}),jsxRuntime.jsx(f.Body2,{part:"subtitle",children:r.subtitle})]})]}),jsxRuntime.jsxs(g.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsxRuntime.jsx(h.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsxRuntime.jsx(h.Primary,{title:r.primaryButtonTitle,onClick:i}),t.dismissible&&jsxRuntime.jsx(u.Dismiss,{onClick:o})]})]})})}var Bt={};N(Bt,{Collapsible:()=>Rt,CollapsibleStep:()=>me});var me={};N(me,{Content:()=>De,Root:()=>Ee,Trigger:()=>Oe});var vr=react.keyframes`
|
|
49
49
|
from {
|
|
50
50
|
height: 0;
|
|
51
51
|
opacity: 0;
|
|
@@ -54,7 +54,7 @@ var Zo=Object.defineProperty;var et=(e=>typeof require<"u"?require:typeof Proxy<
|
|
|
54
54
|
height: var(--radix-collapsible-content-height);
|
|
55
55
|
opacity: 1;
|
|
56
56
|
}
|
|
57
|
-
`,
|
|
57
|
+
`,kr=react.keyframes`
|
|
58
58
|
from {
|
|
59
59
|
height: var(--radix-collapsible-content-height);
|
|
60
60
|
opacity: 1;
|
|
@@ -63,7 +63,7 @@ var Zo=Object.defineProperty;var et=(e=>typeof require<"u"?require:typeof Proxy<
|
|
|
63
63
|
height: 0;
|
|
64
64
|
opacity: 0;
|
|
65
65
|
}
|
|
66
|
-
`,Rr=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Br({checked:e=!1}){return jsxRuntime.jsx(l,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(l,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Rr,{})})})}function Re({children:e}){return jsxRuntime.jsx(Y__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(f.Column,{css:{'&[data-state="open"]':{animation:`${Tr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${wr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(l,{}),e]})})}function Be({children:e,open:o=!1,onOpenChange:t=()=>{}}){return jsxRuntime.jsx(Y__namespace.Root,{asChild:!0,open:o,onOpenChange:t,children:jsxRuntime.jsx(u,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function ve({isCompleted:e,title:o}){return jsxRuntime.jsx(Y__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(f.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(f.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Br,{checked:e}),jsxRuntime.jsx(x.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var ke={};L(ke,{Bar:()=>pe,Dots:()=>ho,Segments:()=>Po});function pe({current:e,total:o,...t}){let n=o>0?Math.min(e/o,1):0,i=n===0?"10px":`${100*n}%`;return jsxRuntime.jsx(l,{part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px",...t,children:jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:i},transition:"width 300ms ease-out"})})}function ho({current:e,total:o,...t}){if(o==1)return null;let n=[...Array(o)].map((i,r)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e-1===r?y.colors.blue500:y.colors.blue800},r));return jsxRuntime.jsx(l,{as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,...t,children:n})}function Po({current:e,total:o,...t}){let n=[...Array(o)].map((i,r)=>jsxRuntime.jsx(l,{backgroundColor:e-1===r?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},r));return jsxRuntime.jsx(f.Row,{gap:1,height:"10px",...t,children:n})}var Co=Se.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function So({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:i}){let{isBlocked:r,isCompleted:s,primaryButtonTitle:a,secondaryButtonTitle:d,subtitle:m,title:g}=i;return jsxRuntime.jsxs(Be,{open:t,onOpenChange:n,children:[jsxRuntime.jsx(ve,{isCompleted:s,title:g}),jsxRuntime.jsxs(Re,{children:[jsxRuntime.jsx(u.Media,{aspectRatio:2.5,objectFit:"cover",src:i.imageUri}),jsxRuntime.jsx(u.Subtitle,{color:"gray500",children:m}),jsxRuntime.jsxs(f.Row,{gap:3,children:[jsxRuntime.jsx(u.Secondary,{disabled:!!(s||r),title:d,onClick:o}),jsxRuntime.jsx(u.Primary,{disabled:!!(s||r),title:a,onClick:e})]})]})]})}var Er={default:So};function Or({flow:e,step:o,...t}){let{onPrimary:n,onSecondary:i,openStepId:r,setOpenStepId:s,stepTypes:a}=Se.useContext(Co),{handlePrimary:d,handleSecondary:m}=j(o,{onPrimary:n,onSecondary:i}),g=(r??e.getCurrentStep().id)===o.id,h=a[o.type]??So;async function c(F){s(F?o.id:""),F&&!o.isCompleted&&await o.start();}return jsxRuntime.jsx(h,{flow:e,onOpenChange:c,open:g,step:o,...t,handlePrimary:d,handleSecondary:m},o.id)}function Fo({dismissible:e,flowId:o,onPrimary:t,onSecondary:n,stepTypes:i={},...r}){let[s,a]=Se.useState(null),d={...Er,...i};return jsxRuntime.jsx(Co.Provider,{value:{openStepId:s,setOpenStepId:a,onPrimary:t,onSecondary:n,stepTypes:d},children:jsxRuntime.jsx(O,{as:u,borderWidth:"md",flowId:o,part:"checklist",...r,children:({flow:m,handleDismiss:g,...h})=>{let c=Array.from(m.steps.entries()).map(([,N])=>jsxRuntime.jsx(Or,{flow:m,handleDismiss:g,...h,step:N},N.id)),F=m.getNumberOfCompletedSteps(),q=m.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(f.Column,{gap:2,children:[jsxRuntime.jsxs(f.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsxRuntime.jsx(u.Title,{children:m.title}),e&&jsxRuntime.jsx(u.Dismiss,{onClick:g}),jsxRuntime.jsx(u.Subtitle,{color:"gray500",flexBasis:"100%",children:m.subtitle})]}),jsxRuntime.jsxs(f.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(x.Body2,{fontWeight:"demibold",children:[F,"/",q]}),jsxRuntime.jsx(pe,{current:F,total:q,flexGrow:1})]})]}),c]})}})})}var Wr=new Set(["required","min","max","minLength","maxLength","pattern"]);function Ar({fieldComponent:e,control:o,fieldData:t}){t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let n=Object.fromEntries(Object.entries(t).filter(([r])=>Wr.has(r))),i=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,{...i,fieldData:t})}function wo({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:i},step:r}){var h;let{control:s,handleSubmit:a}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function m(c,F){t(F,c);}function g(c,F){n(F,c);}return (h=r.fields)==null||h.forEach(c=>{e[c.type]!=null&&d.push(jsxRuntime.jsx(Ar,{control:s,fieldComponent:e[c.type],fieldData:c},c.id));}),jsxRuntime.jsxs(f.Column,{gap:5,part:"form-step",children:[jsxRuntime.jsxs(f.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsxRuntime.jsx(u.Title,{children:r.title}),i&&jsxRuntime.jsx(u.Dismiss,{onClick:o}),jsxRuntime.jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),d,jsxRuntime.jsxs(f.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[r.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:a(g)}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle??"Submit",onClick:a(m)})]},"form-footer")]})}function Ro({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(x.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Bo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(x.H4,{as:"label",htmlFor:o,part:"field-label",children:[e,t&&" *"]})}var re={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function _({children:e,field:o,fieldData:t,fieldState:n}){let{id:i,label:r,placeholder:s}=t,{error:a}=n,d={id:i,...o,...s?{placeholder:s}:{},...re,"aria-invalid":!!a,value:o.value??""};return jsxRuntime.jsxs(l,{part:"field",children:[jsxRuntime.jsx(Bo,{id:i,required:!!t.required,children:r}),e(d),jsxRuntime.jsx(Ro,{error:a})]})}var _r=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nr=Se__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(l,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(x.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Q__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(l,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(l,{as:Q__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(_r,{})})})})]}));function Eo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,i=n.map(({label:r,value:s})=>jsxRuntime.jsx(Nr,{value:s,label:r},s));return jsxRuntime.jsx(_,{...e,children:()=>jsxRuntime.jsx(Q__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(f.Column,{gap:2,part:"field-radio-group",children:i})})})}var Kr=Se__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(S__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(l,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(S__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(x.Body2,{part:"field-select-option-label",children:e})})})}));function Mo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:i}}=e,r=n.map(({label:s,value:a})=>jsxRuntime.jsx(Kr,{value:a,label:s},a));return jsxRuntime.jsx(_,{...e,children:()=>jsxRuntime.jsxs(S__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(S__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(x.Body2,{...re,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(S__namespace.Value,{placeholder:i??"Select one"}),jsxRuntime.jsx(S__namespace.Icon,{children:jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(S__namespace.Portal,{children:jsxRuntime.jsx(S__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(l,{...re,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(S__namespace.Viewport,{children:r})})})})]})})}function Wo(e){return jsxRuntime.jsx(_,{...e,children:o=>jsxRuntime.jsx(x.Body2,{as:"input",part:"field-text",type:"text",...o})})}function Lo(e){return jsxRuntime.jsx(_,{...e,children:o=>jsxRuntime.jsx(x.Body2,{as:"textarea",part:"field-textarea",...o})})}var Ur={radio:Eo,select:Mo,text:Wo,textarea:Lo};function Ee({fieldTypes:e={},flowId:o,...t}){let n=Object.assign({},Ur,e);return jsxRuntime.jsx(O,{flowId:o,part:"form",...t,children:i=>jsxRuntime.jsx(wo,{fieldTypes:n,...i})})}var zo={};L(zo,{NPS:()=>No});function _o({field:e}){let o=[...Array(11)].map((t,n)=>{let i=e.value===n?b.Primary:b.Secondary;return jsxRuntime.jsx(i,{borderWidth:"1px",onClick:()=>e.onChange(n),title:`${n}`},n)});return jsxRuntime.jsx(f.Row,{gap:2,justifyContent:"center",part:"field-nps",children:o})}function No({as:e=u,flowId:o,fieldTypes:t,...n}){return jsxRuntime.jsx(Ee,{as:e,flowId:o,fieldTypes:{nps:_o,...t},maxWidth:"auto",minWidth:"min-content",width:"50vw",...n})}function de(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=Se.useState(e),[n,i]=Se.useState(null),r=Se.useCallback(s=>{i(s);},[]);return Se.useLayoutEffect(()=>{if(!n)return;let s=()=>{let a=n.getBoundingClientRect();t(a);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:r}}var Yr=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Uo({style:e={},part:o="",...t}){return jsxRuntime.jsxs(l,{part:`dot-wrapper ${o}`,style:{height:"48px",position:"absolute",width:"48px",...e},...t,children:[jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Yr}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Go({props:e,alignAttr:o,sideAttr:t}){let n=t??"bottom",i={},r=()=>{if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return e.align??"after"},s="-24px",a={top:"bottom",right:"left",bottom:"top",left:"right"};i[a[n]]=s;let d=r();return ["before","end"].includes(d)?["top","bottom"].includes(n)?i.right=s:i.bottom=s:["after","start"].includes(d)?["top","bottom"].includes(n)?i.left=s:i.top=s:["top","bottom"].includes(n)?i.left=`calc(50% + ${s})`:i.top=`calc(50% + ${s})`,i}var ce={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Jo(e,o){let t=Object.fromEntries(ce.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(ce.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i={};for(let r of Object.keys(e))!ce.content.includes(r)&&!ce.root.includes(r)&&(i[r]=e[r]);if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let r={after:"end",before:"start"},s=(c,F)=>["top","bottom"].includes(F)?c=="after"?"marginLeft":"marginRight":c=="after"?"marginTop":"marginBottom",a=t.alignOffset??0,d=t.style??{},m=t.side??"bottom",g=t.align;t.style={...d,[s(g,m)]:a};let h=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(h+a)*-1,t.align=r[g];}return {contentProps:t,otherProps:i,rootProps:n}}function T({anchor:e,children:o,className:t,spotlight:n=!1,style:i,...r}){let{node:s,rect:a,ref:d}=de(),{node:m,rect:g,ref:h}=de(),{contentProps:c,otherProps:F,rootProps:q}=Jo(r,a),[N,ue]=Se.useState(c.align),[ne,Z]=Se.useState(c.side),[fe,ge]=Se.useState(0),[Me,Yo]=Se.useState(0);if(s!==null){let A=s.getAttribute("data-align"),ie=s.getAttribute("data-side");N!==A&&ue(A),ne!==ie&&Z(ie);}let He=Se.useRef(null);if(Se.useEffect(()=>{let A=document.querySelector(e);A!=null?(h(A),He.current=A):console.debug(`No anchor found for query: ${e}`);},[e]),Se.useEffect(()=>{let{scrollX:A,scrollY:ie}=window;ge(g.left+A),Yo(g.top+ie);},[g.left,g.top]),m==null)return null;let We="0";typeof window<"u"&&(We=window.getComputedStyle(m).borderRadius);let Qo=Go({props:r,alignAttr:N,sideAttr:ne});return jsxRuntime.jsxs(I__namespace.Root,{defaultOpen:!0,...q,children:[jsxRuntime.jsx(I__namespace.Anchor,{virtualRef:He}),jsxRuntime.jsx(I__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:We,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:g.height,left:fe,top:Me,width:g.width}}),jsxRuntime.jsx(I__namespace.Content,{asChild:!0,...c,ref:d,children:jsxRuntime.jsxs(u,{boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:i,...F,children:[jsxRuntime.jsx(Uo,{style:Qo}),o]})})]})})]})}T.Close=e=>jsxRuntime.jsx(I__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});T.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e,...o});T.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});T.Progress=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.H4,{part:"progress",...o,children:e});T.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});T.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body2,{part:"subtitle",...o,children:e});T.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.H4,{part:"title",...o,children:e});function qo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:n,onSecondary:i,step:r,...s}){let{handleDismiss:a}=z(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:m}=j(r,{onPrimary:n,onSecondary:i});return jsxRuntime.jsxs(T,{anchor:r.selector,onOpenAutoFocus:g=>g.preventDefault(),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),...s,children:[e&&jsxRuntime.jsx(T.Close,{onClick:a}),jsxRuntime.jsx(T.Media,{src:r.videoUri??r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsxs(f.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(T.Title,{children:r.title}),jsxRuntime.jsx(T.Subtitle,{color:"gray500",children:r.subtitle})]}),jsxRuntime.jsxs(f.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(T.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(T.Secondary,{title:r.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(T.Primary,{title:r.primaryButtonTitle,onClick:d})]})]},r.id)}function rn({flowId:e,onComplete:o,variables:t,...n}){let{flow:i}=oe(e,{variables:t});z(i,{onComplete:o});let{isCurrentModal:r,removeModal:s}=te(i);if(Se.useEffect(()=>{!(i!=null&&i.isVisible)&&r&&s();},[i==null?void 0:i.isVisible,r]),i==null||i.isVisible===!1||!r)return null;let a=i.getCurrentStep();return a==null||a.start(),jsxRuntime.jsx(qo,{step:a,flow:i,...n})}function an(){let{frigade:e}=Se.useContext(v);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function pn(){let{userId:e,frigade:o}=Se.useContext(v);async function t(i){await o.identify(e,i);}async function n(i,r){await o.track(i,r);}return {userId:e,addProperties:t,track:n}}function cn(){let{groupId:e,frigade:o}=Se.useContext(v);async function t(i){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await o.group(e,i);}async function n(i,r){await o.track(i,r);}return {groupId:e,addProperties:t,track:n}}
|
|
66
|
+
`,Dr=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Er({checked:e=!1}){return jsxRuntime.jsx(l,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(l,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Dr,{})})})}function De({children:e}){return jsxRuntime.jsx(te__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(g.Column,{css:{'&[data-state="open"]':{animation:`${vr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${kr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(l,{}),e]})})}function Ee({children:e,open:t=!1,onOpenChange:o=()=>{}}){return jsxRuntime.jsx(te__namespace.Root,{asChild:!0,open:t,onOpenChange:o,children:jsxRuntime.jsx(u,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function Oe({isCompleted:e,title:t}){return jsxRuntime.jsx(te__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(g.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(g.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Er,{checked:e}),jsxRuntime.jsx(f.Body2,{fontWeight:"demibold",userSelect:"none",children:t})]}),jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Me={};N(Me,{Bar:()=>ue,Dots:()=>Ct,Segments:()=>Ft});function ue({current:e,total:t,...o}){let i=t>0?Math.min(e/t,1):0,n=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(l,{part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px",...o,children:jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:n},transition:"width 300ms ease-out"})})}function Ct({current:e,total:t,...o}){if(t==1)return null;let i=[...Array(t)].map((n,r)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e-1===r?y.colors.blue500:y.colors.blue800},r));return jsxRuntime.jsx(l,{as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,...o,children:i})}function Ft({current:e,total:t,...o}){let i=[...Array(t)].map((n,r)=>jsxRuntime.jsx(l,{backgroundColor:e-1===r?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},r));return jsxRuntime.jsx(g.Row,{gap:1,height:"10px",...o,children:i})}var Tt=Re.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function wt({handlePrimary:e,handleSecondary:t,open:o,onOpenChange:i,step:n}){let{isBlocked:r,isCompleted:a,primaryButtonTitle:s,secondaryButtonTitle:d,subtitle:m,title:x}=n;return jsxRuntime.jsxs(Ee,{open:o,onOpenChange:i,children:[jsxRuntime.jsx(Oe,{isCompleted:a,title:x}),jsxRuntime.jsxs(De,{children:[jsxRuntime.jsx(u.Media,{aspectRatio:2.5,objectFit:"cover",src:n.imageUri}),jsxRuntime.jsx(u.Subtitle,{color:"gray500",children:m}),jsxRuntime.jsxs(g.Row,{gap:3,children:[jsxRuntime.jsx(u.Secondary,{disabled:!!(a||r),title:d,onClick:t}),jsxRuntime.jsx(u.Primary,{disabled:!!(a||r),title:s,onClick:e})]})]})]})}var Hr={default:wt};function Wr({flow:e,step:t,...o}){let{onPrimary:i,onSecondary:n,openStepId:r,setOpenStepId:a,stepTypes:s}=Re.useContext(Tt),{handlePrimary:d,handleSecondary:m}=G(t,{onPrimary:i,onSecondary:n}),x=(r??e.getCurrentStep().id)===t.id,b=s[t.type]??wt;async function c(F){a(F?t.id:""),F&&!t.isCompleted&&await t.start();}return jsxRuntime.jsx(b,{flow:e,onOpenChange:c,open:x,step:t,...o,handlePrimary:d,handleSecondary:m},t.id)}function Rt({dismissible:e,flowId:t,onPrimary:o,onSecondary:i,stepTypes:n={},...r}){let[a,s]=Re.useState(null),d={...Hr,...n};return jsxRuntime.jsx(Tt.Provider,{value:{openStepId:a,setOpenStepId:s,onPrimary:o,onSecondary:i,stepTypes:d},children:jsxRuntime.jsx(H,{as:u,borderWidth:"md",flowId:t,part:"checklist",...r,children:({flow:m,handleDismiss:x,...b})=>{let c=Array.from(m.steps.entries()).map(([,K])=>jsxRuntime.jsx(Wr,{flow:m,handleDismiss:x,...b,step:K},K.id)),F=m.getNumberOfCompletedSteps(),ee=m.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(g.Column,{gap:2,children:[jsxRuntime.jsxs(g.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsxRuntime.jsx(u.Title,{children:m.title}),e&&jsxRuntime.jsx(u.Dismiss,{onClick:x}),jsxRuntime.jsx(u.Subtitle,{color:"gray500",flexBasis:"100%",children:m.subtitle})]}),jsxRuntime.jsxs(g.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(f.Body2,{fontWeight:"demibold",children:[F,"/",ee]}),jsxRuntime.jsx(ue,{current:F,total:ee,flexGrow:1})]})]}),c]})}})})}var $r=new Set(["required","min","max","minLength","maxLength","pattern"]);function Nr({fieldComponent:e,control:t,fieldData:o}){o.pattern!=null&&(typeof o.pattern=="string"?o.pattern=new RegExp(o.pattern.replace(/^\/|\/$/g,"")):typeof o.pattern=="object"&&typeof o.pattern.value=="string"&&(o.pattern.value=new RegExp(o.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(o).filter(([r])=>$r.has(r))),n=reactHookForm.useController({name:o.id,control:t,rules:i});return jsxRuntime.jsx(e,{...n,fieldData:o})}function vt({fieldTypes:e,handleDismiss:t,handlePrimary:o,handleSecondary:i,parentProps:{dismissible:n},step:r}){var b;let{control:a,handleSubmit:s}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function m(c,F){o(F,c);}function x(c,F){i(F,c);}return (b=r.fields)==null||b.forEach(c=>{e[c.type]!=null&&d.push(jsxRuntime.jsx(Nr,{control:a,fieldComponent:e[c.type],fieldData:c},c.id));}),jsxRuntime.jsxs(g.Column,{gap:5,part:"form-step",children:[jsxRuntime.jsxs(g.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsxRuntime.jsx(u.Title,{children:r.title}),n&&jsxRuntime.jsx(u.Dismiss,{onClick:t}),jsxRuntime.jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),d,jsxRuntime.jsxs(g.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[r.secondaryButtonTitle&&jsxRuntime.jsx(h.Secondary,{title:r.secondaryButtonTitle,onClick:s(x)}),jsxRuntime.jsx(h.Primary,{title:r.primaryButtonTitle??"Submit",onClick:s(m)})]},"form-footer")]})}function kt({error:e}){var t;return (t=e==null?void 0:e.message)!=null&&t.length?jsxRuntime.jsx(f.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Dt({children:e,id:t,required:o=!1}){return jsxRuntime.jsxs(f.H4,{as:"label",htmlFor:t,part:"field-label",children:[e,o&&" *"]})}var se={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function j({children:e,field:t,fieldData:o,fieldState:i}){let{id:n,label:r,placeholder:a}=o,{error:s}=i,d={id:n,...t,...a?{placeholder:a}:{},...se,"aria-invalid":!!s,value:t.value??""};return jsxRuntime.jsxs(l,{part:"field",children:[jsxRuntime.jsx(Dt,{id:n,required:!!o.required,children:r}),e(d),jsxRuntime.jsx(kt,{error:s})]})}var Kr=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ur=Re__namespace.forwardRef(({label:e,value:t},o)=>jsxRuntime.jsxs(l,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:t,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(f.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(oe__namespace.Item,{id:t,value:t,ref:o,asChild:!0,children:jsxRuntime.jsx(l,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(l,{as:oe__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Kr,{})})})})]}));function It(e){let{field:{onChange:t,value:o},fieldData:{options:i=[]}}=e,n=i.map(({label:r,value:a})=>jsxRuntime.jsx(Ur,{value:a,label:r},a));return jsxRuntime.jsx(j,{...e,children:()=>jsxRuntime.jsx(oe__namespace.Root,{value:o,onValueChange:t,asChild:!0,children:jsxRuntime.jsx(g.Column,{gap:2,part:"field-radio-group",children:n})})})}var Jr=Re__namespace.forwardRef(({label:e,value:t},o)=>jsxRuntime.jsx(S__namespace.Item,{value:t,ref:o,asChild:!0,children:jsxRuntime.jsx(l,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(S__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(f.Body2,{part:"field-select-option-label",children:e})})})}));function At(e){let{field:{onChange:t,value:o},fieldData:{options:i=[],placeholder:n}}=e,r=i.map(({label:a,value:s})=>jsxRuntime.jsx(Jr,{value:s,label:a},s));return jsxRuntime.jsx(j,{...e,children:()=>jsxRuntime.jsxs(S__namespace.Root,{value:o,onValueChange:t,children:[jsxRuntime.jsx(S__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(f.Body2,{...se,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(S__namespace.Value,{placeholder:n??"Select one"}),jsxRuntime.jsx(S__namespace.Icon,{children:jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(S__namespace.Portal,{children:jsxRuntime.jsx(S__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(l,{...se,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(S__namespace.Viewport,{children:r})})})})]})})}function Vt(e){return jsxRuntime.jsx(j,{...e,children:t=>jsxRuntime.jsx(f.Body2,{as:"input",part:"field-text",type:"text",...t})})}function Nt(e){return jsxRuntime.jsx(j,{...e,children:t=>jsxRuntime.jsx(f.Body2,{as:"textarea",part:"field-textarea",...t})})}var qr={radio:It,select:At,text:Vt,textarea:Nt};function He({fieldTypes:e={},flowId:t,...o}){let i=Object.assign({},qr,e);return jsxRuntime.jsx(H,{flowId:t,part:"form",...o,children:n=>jsxRuntime.jsx(vt,{fieldTypes:i,...n})})}var Ut={};N(Ut,{NPS:()=>Kt});function jt({field:e}){let t=[...Array(11)].map((o,i)=>{let n=e.value===i?h.Primary:h.Secondary;return jsxRuntime.jsx(n,{borderWidth:"1px",onClick:()=>e.onChange(i),title:`${i}`},i)});return jsxRuntime.jsx(g.Row,{gap:2,justifyContent:"space-between",part:"field-nps",children:t})}var O="24px";function Q({children:e,align:t,...o}){function i(){switch(t){case"top":return {top:O,left:"50%",transform:"translate(-50%, 0)"};case"bottom":return {bottom:O,left:"50%",transform:"translate(-50%, 0)"};case"left":return {top:"50%",left:O,transform:"translate(0, -50%)"};case"right":return {top:"50%",right:O,transform:"translate(0, -50%)"};case"top-left":return {top:O,left:O};case"top-right":return {top:O,right:O};case"bottom-left":return {bottom:O,left:O};case"bottom-right":return {bottom:O,right:O}}return {top:"50%",transform:"translate(-50%, -50%)"}}return jsxRuntime.jsx(w__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsx(l,{inset:"0",position:"fixed",zIndex:"9999",width:"100vw",height:"100vh",children:jsxRuntime.jsx(w__namespace.Content,{asChild:!0,onOpenAutoFocus:n=>n.preventDefault(),onPointerDownOutside:n=>n.preventDefault(),children:jsxRuntime.jsx(u,{boxShadow:"md",p:8,part:"modal",...i(),...o,position:"fixed",children:e})})})})})}Q.Dismiss=e=>jsxRuntime.jsx(w__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(h.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});Q.Subtitle=({children:e,...t})=>jsxRuntime.jsx(w__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(f.Body2,{part:"subtitle",...t,children:e})});Q.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(h.Secondary,{title:t,onClick:e,...o});Q.Title=({children:e,...t})=>jsxRuntime.jsx(w__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(f.H3,{part:"title",...t,children:e})});Q.displayName="Modal";function Kt({as:e=Q,flowId:t,fieldTypes:o,...i}){return jsxRuntime.jsx(He,{as:e,flowId:t,fieldTypes:{nps:jt,...o},minWidth:"620px",width:"620px",align:"bottom",...i})}function fe(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=Re.useState(e),[i,n]=Re.useState(null),r=Re.useCallback(a=>{n(a);},[]);return Re.useLayoutEffect(()=>{if(!i)return;let a=()=>{let s=i.getBoundingClientRect();o(s);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[i]),{node:i,rect:t,ref:r}}var on=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Jt({style:e={},part:t="",...o}){return jsxRuntime.jsxs(l,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${on}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function qt({props:e,alignAttr:t,sideAttr:o}){let i=o??"bottom",n={},r=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},a="-24px",s={top:"bottom",right:"left",bottom:"top",left:"right"};n[s[i]]=a;let d=r();return ["before","end"].includes(d)?["top","bottom"].includes(i)?n.right=a:n.bottom=a:["after","start"].includes(d)?["top","bottom"].includes(i)?n.left=a:n.top=a:["top","bottom"].includes(i)?n.left=`calc(50% + ${a})`:n.top=`calc(50% + ${a})`,n}var ge={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Yt(e,t){let o=Object.fromEntries(ge.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i=Object.fromEntries(ge.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!ge.content.includes(r)&&!ge.root.includes(r)&&(n[r]=e[r]);if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let r={after:"end",before:"start"},a=(c,F)=>["top","bottom"].includes(F)?c=="after"?"marginLeft":"marginRight":c=="after"?"marginTop":"marginBottom",s=o.alignOffset??0,d=o.style??{},m=o.side??"bottom",x=o.align;o.style={...d,[a(x,m)]:s};let b=["top","bottom"].includes(m)?t.width:t.height;o.alignOffset=(b+s)*-1,o.align=r[x];}return {contentProps:o,otherProps:n,rootProps:i}}function T({anchor:e,children:t,className:o,spotlight:i=!1,style:n,...r}){let{node:a,rect:s,ref:d}=fe(),{node:m,rect:x,ref:b}=fe(),{contentProps:c,otherProps:F,rootProps:ee}=Yt(r,s),[K,ye]=Re.useState(c.align),[le,re]=Re.useState(c.side),[he,be]=Re.useState(0),[Le,eo]=Re.useState(0);if(a!==null){let $=a.getAttribute("data-align"),pe=a.getAttribute("data-side");K!==$&&ye($),le!==pe&&re(pe);}let Ve=Re.useRef(null);if(Re.useEffect(()=>{let $=document.querySelector(e);$!=null?(b($),Ve.current=$):console.debug(`No anchor found for query: ${e}`);},[e]),Re.useEffect(()=>{let{scrollX:$,scrollY:pe}=window;be(x.left+$),eo(x.top+pe);},[x.left,x.top]),m==null)return null;let $e="0";typeof window<"u"&&($e=window.getComputedStyle(m).borderRadius);let to=qt({props:r,alignAttr:K,sideAttr:le});return jsxRuntime.jsxs(W__namespace.Root,{defaultOpen:!0,...ee,children:[jsxRuntime.jsx(W__namespace.Anchor,{virtualRef:Ve}),jsxRuntime.jsx(W__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&jsxRuntime.jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:$e,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:x.height,left:he,top:Le,width:x.width}}),jsxRuntime.jsx(W__namespace.Content,{asChild:!0,...c,ref:d,children:jsxRuntime.jsxs(u,{boxShadow:"md",part:"tooltip",position:"relative",className:o,css:{maxWidth:"360px",pointerEvents:"auto"},style:n,...F,children:[jsxRuntime.jsx(Jt,{style:to}),t]})})]})})]})}T.Close=e=>jsxRuntime.jsx(W__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(h.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});T.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(J,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e,...t});T.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(h.Primary,{title:t,onClick:e,...o});T.Progress=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.H4,{part:"progress",...t,children:e});T.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(h.Secondary,{title:t,onClick:e,...o});T.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.Body2,{part:"subtitle",...t,children:e});T.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.H4,{part:"title",...t,children:e});function Zt({dismissible:e=!0,flow:t,onDismiss:o,onPrimary:i,onSecondary:n,step:r,...a}){let{handleDismiss:s}=U(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:m}=G(r,{onPrimary:i,onSecondary:n});return jsxRuntime.jsxs(T,{anchor:r.selector,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),...a,children:[e&&jsxRuntime.jsx(T.Close,{onClick:s}),jsxRuntime.jsx(T.Media,{src:r.videoUri??r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsxs(g.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(T.Title,{children:r.title}),jsxRuntime.jsx(T.Subtitle,{color:"gray500",children:r.subtitle})]}),jsxRuntime.jsxs(g.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(T.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(T.Secondary,{title:r.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(T.Primary,{title:r.primaryButtonTitle,onClick:d})]})]},r.id)}function pn({flowId:e,onComplete:t,variables:o,...i}){let{flow:n}=ie(e,{variables:o});U(n,{onComplete:t});let{isCurrentModal:r,removeModal:a}=ae(n);if(Re.useEffect(()=>{!(n!=null&&n.isVisible)&&r&&a();},[n==null?void 0:n.isVisible,r]),n==null||n.isVisible===!1||!r)return null;let s=n.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(Zt,{step:s,flow:n,...i})}function mn(){let{frigade:e}=Re.useContext(v);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function fn(){let{userId:e,frigade:t}=Re.useContext(v);async function o(n){await t.identify(e,n);}async function i(n,r){await t.track(n,r);}return {userId:e,addProperties:o,track:i}}function xn(){let{groupId:e,frigade:t}=Re.useContext(v);async function o(n){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await t.group(e,n);}async function i(n,r){await t.track(n,r);}return {groupId:e,addProperties:o,track:i}}
|
|
67
67
|
|
|
68
68
|
Object.defineProperty(exports, 'Flow', {
|
|
69
69
|
enumerable: true,
|
|
@@ -77,29 +77,29 @@ Object.defineProperty(exports, 'Frigade', {
|
|
|
77
77
|
enumerable: true,
|
|
78
78
|
get: function () { return js.Frigade; }
|
|
79
79
|
});
|
|
80
|
-
exports.Announcement =
|
|
81
|
-
exports.Banner =
|
|
80
|
+
exports.Announcement = Fr;
|
|
81
|
+
exports.Banner = wr;
|
|
82
82
|
exports.Box = l;
|
|
83
|
-
exports.Button =
|
|
83
|
+
exports.Button = h;
|
|
84
84
|
exports.Card = u;
|
|
85
|
-
exports.Checklist =
|
|
85
|
+
exports.Checklist = Bt;
|
|
86
86
|
exports.Dialog = C;
|
|
87
|
-
exports.Flex =
|
|
88
|
-
exports.Form =
|
|
89
|
-
exports.Progress =
|
|
90
|
-
exports.Provider =
|
|
91
|
-
exports.Survey =
|
|
92
|
-
exports.Text =
|
|
87
|
+
exports.Flex = g;
|
|
88
|
+
exports.Form = He;
|
|
89
|
+
exports.Progress = Me;
|
|
90
|
+
exports.Provider = nr;
|
|
91
|
+
exports.Survey = Ut;
|
|
92
|
+
exports.Text = f;
|
|
93
93
|
exports.Tooltip = T;
|
|
94
|
-
exports.Tour =
|
|
95
|
-
exports.themeVariables =
|
|
96
|
-
exports.useBoundingClientRect =
|
|
97
|
-
exports.useFlow =
|
|
98
|
-
exports.useFlowHandlers =
|
|
99
|
-
exports.useFrigade =
|
|
100
|
-
exports.useGroup =
|
|
101
|
-
exports.useModal =
|
|
102
|
-
exports.useStepHandlers =
|
|
103
|
-
exports.useUser =
|
|
94
|
+
exports.Tour = pn;
|
|
95
|
+
exports.themeVariables = Se;
|
|
96
|
+
exports.useBoundingClientRect = fe;
|
|
97
|
+
exports.useFlow = ie;
|
|
98
|
+
exports.useFlowHandlers = U;
|
|
99
|
+
exports.useFrigade = mn;
|
|
100
|
+
exports.useGroup = xn;
|
|
101
|
+
exports.useModal = ae;
|
|
102
|
+
exports.useStepHandlers = G;
|
|
103
|
+
exports.useUser = fn;
|
|
104
104
|
//# sourceMappingURL=out.js.map
|
|
105
105
|
//# sourceMappingURL=index.cjs.map
|