@frigade/react 2.0.7 → 2.0.9

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var T = require('@radix-ui/react-dialog');
3
+ var R = require('@radix-ui/react-dialog');
4
4
  var solid = require('@heroicons/react/24/solid');
5
- var ye = require('react');
5
+ var Pe = require('react');
6
6
  var clsx = require('clsx');
7
- var jt = require('known-css-properties');
8
- var Qt = require('dompurify');
7
+ var ot = require('known-css-properties');
8
+ var dt = 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');
@@ -15,7 +15,7 @@ var reactHookForm = require('react-hook-form');
15
15
  var Y = require('@radix-ui/react-radio-group');
16
16
  var C = require('@radix-ui/react-select');
17
17
  var outline = require('@heroicons/react/24/outline');
18
- var M = require('@radix-ui/react-popover');
18
+ var I = require('@radix-ui/react-popover');
19
19
 
20
20
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
21
21
 
@@ -37,16 +37,16 @@ function _interopNamespace(e) {
37
37
  return Object.freeze(n);
38
38
  }
39
39
 
40
- var T__namespace = /*#__PURE__*/_interopNamespace(T);
41
- var ye__namespace = /*#__PURE__*/_interopNamespace(ye);
42
- var jt__default = /*#__PURE__*/_interopDefault(jt);
43
- var Qt__default = /*#__PURE__*/_interopDefault(Qt);
40
+ var R__namespace = /*#__PURE__*/_interopNamespace(R);
41
+ var Pe__namespace = /*#__PURE__*/_interopNamespace(Pe);
42
+ var ot__default = /*#__PURE__*/_interopDefault(ot);
43
+ var dt__default = /*#__PURE__*/_interopDefault(dt);
44
44
  var q__namespace = /*#__PURE__*/_interopNamespace(q);
45
45
  var Y__namespace = /*#__PURE__*/_interopNamespace(Y);
46
46
  var C__namespace = /*#__PURE__*/_interopNamespace(C);
47
- var M__namespace = /*#__PURE__*/_interopNamespace(M);
47
+ var I__namespace = /*#__PURE__*/_interopNamespace(I);
48
48
 
49
- var Lt=Object.defineProperty;var Vt=(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 X=(e,t)=>{for(var o in t)Lt(e,o,{get:t[o],enumerable:!0});};var Ee={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var De={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 Oe={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Me={neutral:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray700"),active:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},focus:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},hover:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")}},primary:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500"),active:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")},focus:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500")},hover:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")}},secondary:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray900"),active:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")},focus:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray900")},hover:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")}}};var He={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var $t="px",_t=e=>typeof e=="number"?`${4*e}${$t}`:e,zt=[-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"],Ie=Object.fromEntries(zt.map(e=>[e,_t(e)]));var We={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 ce={...Ee,colors:{...De,...Me},...We,radii:Oe,shadows:He,space:Ie};function Q(e,t="",o="."){return Object.keys(e).reduce((n,r)=>{let s=`${t.length?`${t}${o}`:""}${r}`,a=e[r];return typeof a=="object"&&a!==null&&!Array.isArray(a)?Object.assign(n,Q(a,s,o)):n[s]=a,n},{})}function me(e){return Q(e,"--fr","-")}function Ae(e,t="--fr"){let o={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?o[n]=Ae(r,`${t}-${n}`):o[n]=`var(${t}-${n})`;}),o}var ue=me(ce),y=Ae(ce);var Kt=new Set(["alt","size","src"]),Nt=jt__default.default.all.filter(e=>e.indexOf("-")!=0&&!Kt.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ut=Object.fromEntries(Nt),fe=Q(y.colors),Gt={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},Le={...Ut,...Gt},Ve={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"]},$e=new Set(["active","focus","focusVisible","focusWithin","hover"]);function Jt(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 _e=new Map(Object.entries(Le).map(([e,t])=>[e,Jt(t)])),Xt=new Map(Object.entries(Ve).map(([e,t])=>[e,new Set(t)])),qt=new Set(["height","width"]),Yt=new Set(["canvas","embed","iframe","img","input","object","video"]);function ze(e){let[t,o]=e.split(":");return [t,$e.has(o)?o:null]}function je(e,t="div"){let o=Object.assign({},e),n={};function r(i){if(i==null)return n;let a=`&:${i.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[a]==null&&(n[a]={}),n[a]}return Object.entries(o).forEach(([i,s])=>{let[a,d]=ze(i),m=Xt.get(a);m!=null&&(m.forEach(x=>{let u=`${x}${d?":"+d:""}`;o[u]=s;}),delete o[i]);}),Object.entries(o).forEach(([i,s])=>{let[a,d]=ze(i),m=_e.get(a);if(m!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let x=s.split(" ");r(d)[a]=x.map(u=>m.get(u.toString())??u).join(" ");}else m.has(s.toString())?r(d)[a]=m.get(s.toString()):r(d)[a]=s;(typeof t!="string"||!Yt.has(t)||!qt.has(a))&&delete o[i];}}),Object.keys(o).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&_e.has(s)&&(o[s]=o[i],delete o[i]);}),{cssFromProps:n,unmatchedProps:o}}function Zt(){if(typeof window>"u"){let{JSDOM:e}=Vt("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ke(e){return e?{__html:Qt__default.default(Zt()).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 to(e){return e&&`fr-${e}`}function Ge(e){return e&&(Array.isArray(e)?e.map(t=>Ge(t)).join(" "):to(e))}function oo({as:e,children:t,className:o,css:n={},part:r,...i},s){let a=e??"div",{cssFromProps:d,unmatchedProps:m}=je(i,a),x=Ge(r),u=o||x?clsx.clsx(o,x):void 0,h=[{boxSizing:"border-box"},d,n];return typeof t=="string"?jsxRuntime.jsx(a,{className:u,css:h,...m,ref:s,dangerouslySetInnerHTML:Ke(t)}):jsxRuntime.jsx(a,{className:u,css:h,...m,ref:s,children:t})}var p=ye__namespace.forwardRef(oo);var f={};X(f,{Body1:()=>Po,Body2:()=>Co,Caption:()=>So,Display1:()=>fo,Display2:()=>go,H1:()=>xo,H2:()=>yo,H3:()=>ho,H4:()=>bo});var ge={};X(ge,{Body1:()=>po,Body2:()=>co,Caption:()=>mo,Display1:()=>ro,Display2:()=>no,H1:()=>io,H2:()=>ao,H3:()=>so,H4:()=>lo});var H={color:"neutral.foreground",fontFamily:"default",margin:"0"},ro={...H,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},no={...H,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},io={...H,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},ao={...H,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},so={...H,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},lo={...H,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},po={...H,fontSize:"md",fontWeight:"regular",lineHeight:"md"},co={...H,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},mo={...H,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var uo=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],I=Object.fromEntries(uo.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",o=ye__namespace.forwardRef(({as:n=t,children:r,...i},s)=>jsxRuntime.jsx(p,{as:n,...ge[e],...i,ref:s,children:r}));return o.displayName=`Text.${e}`,[e,o]})),fo=I.Display1,go=I.Display2,xo=I.H1,yo=I.H2,ho=I.H3,bo=I.H4,Po=I.Body1,Co=I.Body2,So=I.Caption;var xe={};X(xe,{Link:()=>Ro,Plain:()=>Bo,Primary:()=>To,Secondary:()=>wo});var ie={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},To={...ie,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},wo={...ie,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},Ro={...ie,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Bo={...ie,backgroundColor:"transparent",color:"neutral.foreground"};function Xe({as:e,children:t,part:o,title:n,variant:r="Primary",...i}){let s=r.toLocaleLowerCase();return jsxRuntime.jsxs(p,{as:e??"button",part:[`button-${s}`,o],...xe[r],...i,children:[t,n&&jsxRuntime.jsx(f.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:n})]})}var vo=["Primary","Secondary","Link","Plain"],ko=Object.fromEntries(vo.map(e=>{let t=o=>jsxRuntime.jsx(Xe,{...o,variant:e,children:o.children});return t.displayName=`Button.${e}`,[e,t]})),b=Object.assign(Xe,ko);var g={};X(g,{Column:()=>Oo,Row:()=>Do});var Do=ye__namespace.forwardRef((e,t)=>jsxRuntime.jsx(p,{display:"flex",flexDirection:"row",...e,ref:t})),Oo=ye__namespace.forwardRef((e,t)=>jsxRuntime.jsx(p,{display:"flex",flexDirection:"column",...e,ref:t}));var B=ye.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function $o({children:e,navigate:t,theme:o,...n}){let r=o?me(o):{},[i,s]=ye.useState(new Set),a=ye.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=t??((x,u="_self")=>{window.open(x,u);});ye.useEffect(()=>()=>{a.destroy();},[]);let m=i.size>0?i.values().next().value:null;return jsxRuntime.jsxs(B.Provider,{value:{modals:i,setModals:s,currentModal:m,navigate:d,...n,frigade:a},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...ue,...r}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function Z(e,t){let[o,n]=ye.useState(),[,r]=ye.useState(""),{frigade:i}=ye.useContext(B),s=a=>{a.id===e&&(t!=null&&t.variables&&a.applyVariables(t.variables),n(a),r(Math.random().toString()));};return ye.useEffect(()=>((async()=>{let a=await i.getFlow(e);if(!a||i.hasFailedToLoad()){n(void 0);return}t!=null&&t.variables&&a.applyVariables(t.variables),n(a);})(),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}),[]),{flow:o}}function _(e,{onComplete:t,onDismiss:o}={}){let n=ye.useRef(null);return ye.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&(async()=>await(t==null?void 0:t(e)))(),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:ye.useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function ee(e,{onPrimary:t,onSecondary:o}={}){let{navigate:n}=ye.useContext(B);return {handlePrimary:ye.useCallback(async(r,i)=>await(t==null?void 0:t(e,r))===!1?(r.preventDefault(),!1):(await e.complete(i),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:ye.useCallback(async(r,i)=>await(o==null?void 0:o(e,r))===!1?(r.preventDefault(),!1):(await e.complete(i),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e){let{currentModal:t,modals:o,setModals:n}=ye.useContext(B),[r,i]=ye.useState(!1);ye.useEffect(()=>{e!=null&&e.isVisible&&e&&!o.has(e.id)&&n(a=>new Set(a).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),ye.useEffect(()=>{let a=t===(e==null?void 0:e.id);(e==null?void 0:e.id)!=null&&a!==r&&i(a);},[e==null?void 0:e.id,t]);function s(){o.has(e==null?void 0:e.id)&&n(a=>{let d=new Set(a);return d.delete(e==null?void 0:e.id),d});}return {isCurrentModal:r,removeModal:s}}function D({as:e,children:t,container:o,dismissible:n=!1,flowId:r,onComplete:i,onDismiss:s,onPrimary:a,onSecondary:d,variables:m,...x}){let{flow:u}=Z(r,{variables:m}),h=u==null?void 0:u.getCurrentStep(),{handleDismiss:E}=_(u,{onComplete:i,onDismiss:s}),{handlePrimary:$,handleSecondary:G}=ee(h,{onPrimary:a,onSecondary:d}),{isCurrentModal:J,removeModal:de}=te(u);return ye.useEffect(()=>{!(u!=null&&u.isVisible)&&J&&de();},[u==null?void 0:u.isVisible,J]),u==null||!u.isVisible||!J?null:(u.start(),h.start(),jsxRuntime.jsx(e??p,{position:"relative",...x,children:t({flow:u,handleDismiss:E,handlePrimary:$,handleSecondary:G,parentProps:{container:o,dismissible:n,flowId:r,variables:m,...x},step:h})}))}function ot(e){return jsxRuntime.jsx(D,{as:c,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:t,handlePrimary:o,handleSecondary:n,parentProps:{dismissible:r},step:i})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(g.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsxRuntime.jsx(c.Title,{children:i.title}),r&&jsxRuntime.jsx(c.Dismiss,{onClick:t}),jsxRuntime.jsx(c.Subtitle,{flexBasis:"100%",children:i.subtitle})]}),jsxRuntime.jsx(c.Media,{src:i.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(g.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(c.Secondary,{title:i.secondaryButtonTitle,onClick:n}),jsxRuntime.jsx(c.Primary,{title:i.primaryButtonTitle??"Continue",onClick:o})]})]})})}function rt({part:e,src:t,...o}){return jsxRuntime.jsx(p,{as:"img",part:["image",e],src:t,...o})}function er(e){var t,o,n,r;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/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function it({part:e,src:t,...o}){let n=er(t);return n?jsxRuntime.jsx(p,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:n,...o}):t!=null&&t.endsWith(".mp4")?jsxRuntime.jsx(p,{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"?it:rt,{src:e,...o})}var c=ye__namespace.forwardRef(({children:e,flowId:t,...o},n)=>{if(t!=null)return jsxRuntime.jsx(ot,{flowId:t,...o});let r=o.as??g.Column;return jsxRuntime.jsx(r,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...o,ref:n,children:e})});c.Dismiss=e=>jsxRuntime.jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});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(b.Primary,{title:t,onClick:e,...o});c.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Secondary,{title:t,onClick:e,...o});c.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.Body2,{display:"block",part:"subtitle",...t,children:e});c.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.Body1,{display:"block",fontWeight:"bold",part:"title",...t,children:e});function F({children:e,...t}){return jsxRuntime.jsx(T__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(T__namespace.Portal,{children:jsxRuntime.jsxs(p,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(T__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(p,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(T__namespace.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsxRuntime.jsx(c,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...t,children:e})})]})})})}F.Dismiss=e=>jsxRuntime.jsx(T__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"})})});F.Subtitle=({children:e,...t})=>jsxRuntime.jsx(T__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(f.Body2,{part:"subtitle",...t,children:e})});F.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(j,{borderRadius:"md",src:e,...t});F.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Primary,{title:t,onClick:e,...o});F.ProgressDots=({current:e,total:t})=>{if(t==1)return null;let o=[...Array(t)].map((n,r)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?y.colors.blue500:y.colors.blue800},r));return jsxRuntime.jsx(p,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,children:o})};F.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Secondary,{title:t,onClick:e,...o});F.Title=({children:e,...t})=>jsxRuntime.jsx(T__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(f.H3,{part:"title",...t,children:e})});function ir({flowId:e,...t}){return jsxRuntime.jsx(D,{as:F,dismissible:!0,flowId:e,...t,children:({flow:o,handleDismiss:n,handlePrimary:r,handleSecondary:i,parentProps:{dismissible:s},step:a})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(F.Dismiss,{onClick:n}),jsxRuntime.jsxs(g.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(F.Title,{children:a.title}),jsxRuntime.jsx(F.Subtitle,{children:a.subtitle})]}),jsxRuntime.jsx(F.Media,{src:a.videoUri??a.imageUri,type:a.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(F.ProgressDots,{current:o.getNumberOfCompletedSteps(),total:o.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(g.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[a.secondaryButtonTitle&&jsxRuntime.jsx(F.Secondary,{onClick:i,title:a.secondaryButtonTitle}),a.primaryButtonTitle&&jsxRuntime.jsx(F.Primary,{onClick:r,title:a.primaryButtonTitle??"Continue"})]})]})})}function sr({flowId:e,...t}){return jsxRuntime.jsx(D,{as:c,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...t,children:({handleDismiss:o,handlePrimary:n,handleSecondary:r,step:i})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(g.Row,{gap:3,children:[i.imageUri&&jsxRuntime.jsx("img",{src:i.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(g.Column,{children:[jsxRuntime.jsx(f.H4,{mb:1,children:i.title}),jsxRuntime.jsx(f.Body2,{color:"gray500",children:i.subtitle})]})]}),jsxRuntime.jsxs(g.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[i.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsxRuntime.jsx(b.Primary,{title:i.primaryButtonTitle,onClick:n}),t.dismissible&&jsxRuntime.jsx(c.Dismiss,{onClick:o})]})]})})}var dt={};X(dt,{Collapsible:()=>pt,CollapsibleStep:()=>se});var se={};X(se,{Content:()=>Ce,Root:()=>Se,Trigger:()=>Fe});var dr=react.keyframes`
49
+ var qo=Object.defineProperty;var Yo=(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 $=(e,o)=>{for(var t in o)qo(e,t,{get:o[t],enumerable:!0});};var Ie={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Me={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 He={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,We={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 Ae={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Qo="px",Zo=e=>typeof e=="number"?`${4*e}${Qo}`:e,et=[-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"],Le=Object.fromEntries(et.map(e=>[e,Zo(e)]));var Ve={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 fe={...Ie,colors:{...Me,...We},...Ve,radii:He,shadows:Ae,space:Le};function Q(e,o="",t="."){return Object.keys(e).reduce((i,n)=>{let a=`${o.length?`${o}${t}`:""}${n}`,s=e[n];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,Q(s,a,t)):i[a]=s,i},{})}function ge(e){return Q(e,"--fr","-")}function $e(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let n=e[i];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[i]=$e(n,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var xe=ge(fe),y=$e(fe);var tt=new Set(["alt","size","src"]),rt=ot__default.default.all.filter(e=>e.indexOf("-")!=0&&!tt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),nt=Object.fromEntries(rt),ye=Q(y.colors),it={color:ye,backgroundColor:ye,borderColor:ye,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},_e={...nt,...it},ze={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"]},je=new Set(["active","focus","focusVisible","focusWithin","hover"]);function st(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 Ne=new Map(Object.entries(_e).map(([e,o])=>[e,st(o)])),at=new Map(Object.entries(ze).map(([e,o])=>[e,new Set(o)])),lt=new Set(["height","width"]),pt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ke(e){let[o,t]=e.split(":");return [o,je.has(t)?t:null]}function Ue(e,o="div"){let t=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(t).forEach(([r,a])=>{let[s,d]=Ke(r),x=at.get(s);x!=null&&(x.forEach(g=>{let c=`${g}${d?":"+d:""}`;t[c]=a;}),delete t[r]);}),Object.entries(t).forEach(([r,a])=>{let[s,d]=Ke(r),x=Ne.get(s);if(x!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let g=a.split(" ");n(d)[s]=g.map(c=>x.get(c.toString())??c).join(" ");}else x.has(a.toString())?n(d)[s]=x.get(a.toString()):n(d)[s]=a;(typeof o!="string"||!pt.has(o)||!lt.has(s))&&delete t[r];}}),Object.keys(t).forEach(r=>{let a=r.substring(1);r.indexOf("_")===0&&Ne.has(a)&&(t[a]=t[r],delete t[r]);}),{cssFromProps:i,unmatchedProps:t}}function ct(){if(typeof window>"u"){let{JSDOM:e}=Yo("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ge(e){return e?{__html:dt__default.default(ct()).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 ut(e){return e&&`fr-${e}`}function qe(e){return e&&(Array.isArray(e)?e.map(o=>qe(o)).join(" "):ut(e))}function ft({as:e,children:o,className:t,css:i={},part:n,...r},a){let s=e??"div",{cssFromProps:d,unmatchedProps:x}=Ue(r,s),g=qe(n),c=t||g?clsx.clsx(t,g):void 0,h=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsxRuntime.jsx(s,{className:c,css:h,...x,ref:a,dangerouslySetInnerHTML:Ge(o)}):jsxRuntime.jsx(s,{className:c,css:h,...x,ref:a,children:o})}var l=Pe__namespace.forwardRef(ft);var u={};$(u,{Body1:()=>Et,Body2:()=>Ot,Caption:()=>It,Display1:()=>wt,Display2:()=>Rt,H1:()=>Bt,H2:()=>vt,H3:()=>kt,H4:()=>Dt});var he={};$(he,{Body1:()=>Ct,Body2:()=>St,Caption:()=>Ft,Display1:()=>gt,Display2:()=>xt,H1:()=>yt,H2:()=>ht,H3:()=>bt,H4:()=>Pt});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},gt={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},xt={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},yt={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},ht={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},bt={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},Pt={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},Ct={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},St={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Ft={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var Tt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(Tt.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Pe__namespace.forwardRef(({as:i=o,children:n,...r},a)=>jsxRuntime.jsx(l,{as:i,...he[e],...r,ref:a,children:n}));return t.displayName=`Text.${e}`,[e,t]})),wt=H.Display1,Rt=H.Display2,Bt=H.H1,vt=H.H2,kt=H.H3,Dt=H.H4,Et=H.Body1,Ot=H.Body2,It=H.Caption;var be={};$(be,{Link:()=>At,Plain:()=>Lt,Primary:()=>Ht,Secondary:()=>Wt});var re={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},Ht={...re,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},Wt={...re,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},At={...re,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Lt={...re,backgroundColor:"transparent",color:"neutral.foreground"};function Qe({as:e,children:o,part:t,title:i,variant:n="Primary",...r}){let a=n.toLocaleLowerCase();return jsxRuntime.jsxs(l,{as:e??"button",part:[`button-${a}`,t],...be[n],...r,children:[o,i&&jsxRuntime.jsx(u.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var Vt=["Primary","Secondary","Link","Plain"],$t=Object.fromEntries(Vt.map(e=>{let o=t=>jsxRuntime.jsx(Qe,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(Qe,$t);var f={};$(f,{Column:()=>jt,Row:()=>zt});var zt=Pe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),jt=Pe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var w=Pe.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},debug:!1});function Yt({children:e,navigate:o,theme:t,...i}){let n=t?ge(t):{},[r,a]=Pe.useState(new Set),s=Pe.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=o??((g,c="_self")=>{window.open(g,c);});Pe.useEffect(()=>()=>{s.destroy();},[]);let x=r.size>0?r.values().next().value:null;return jsxRuntime.jsxs(w.Provider,{value:{modals:r,setModals:a,currentModal:x,navigate:d,...i,frigade:s},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...xe,...n}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function Z(e,o){let[t,i]=Pe.useState(),[,n]=Pe.useState(""),{frigade:r}=Pe.useContext(w),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),i(s),n(Math.random().toString()));};return Pe.useEffect(()=>((async()=>{let s=await r.getFlow(e);if(!s||r.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),i(s);})(),r.onStateChange(a),()=>{r.removeStateChangeHandler(a);}),[]),{flow:t}}function _(e,{onComplete:o,onDismiss:t}={}){let i=Pe.useRef(null);return Pe.useEffect(()=>{e!=null&&(e.isCompleted&&i.current===!1&&(async()=>await(o==null?void 0:o(e)))(),i.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Pe.useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function z(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=Pe.useContext(w);return {handlePrimary:Pe.useCallback(async(n,r)=>await(o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:Pe.useCallback(async(n,r)=>await(t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function ee(e){let{currentModal:o,modals:t,setModals:i}=Pe.useContext(w),[n,r]=Pe.useState(!1);Pe.useEffect(()=>{e!=null&&e.isVisible&&e&&!t.has(e.id)&&i(s=>new Set(s).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Pe.useEffect(()=>{let s=o===(e==null?void 0:e.id);(e==null?void 0:e.id)!=null&&s!==n&&r(s);},[e==null?void 0:e.id,o]);function a(){t.has(e==null?void 0:e.id)&&i(s=>{let d=new Set(s);return d.delete(e==null?void 0:e.id),d});}return {isCurrentModal:n,removeModal:a}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:n,onComplete:r,onDismiss:a,onPrimary:s,onSecondary:d,variables:x,...g}){let{flow:c}=Z(n,{variables:x}),h=c==null?void 0:c.getCurrentStep(),{handleDismiss:T}=_(c,{onComplete:r,onDismiss:a}),{handlePrimary:de,handleSecondary:ce}=z(h,{onPrimary:s,onSecondary:d}),{isCurrentModal:X,removeModal:me}=ee(c);return Pe.useEffect(()=>{!(c!=null&&c.isVisible)&&X&&me();},[c==null?void 0:c.isVisible,X]),c==null||!c.isVisible||!X?null:(c.start(),h.start(),jsxRuntime.jsx(e??l,{position:"relative",...g,children:o({flow:c,handleDismiss:T,handlePrimary:de,handleSecondary:ce,parentProps:{container:t,dismissible:i,flowId:n,variables:x,...g},step:h})}))}function io(e){return jsxRuntime.jsx(O,{as:m,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},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(m.Title,{children:r.title}),n&&jsxRuntime.jsx(m.Dismiss,{onClick:o}),jsxRuntime.jsx(m.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsxRuntime.jsx(m.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(f.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(m.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsxRuntime.jsx(m.Primary,{title:r.primaryButtonTitle??"Continue",onClick:t})]})]})})}function so({part:e,src:o,...t}){return jsxRuntime.jsx(l,{as:"img",part:["image",e],src:o,...t})}function cr(e){var o,t,i,n;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/${(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 lo({part:e,src:o,...t}){let i=cr(o);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,...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 N({src:e,type:o,...t}){return jsxRuntime.jsx(o==="video"?lo:so,{src:e,...t})}var m=Pe__namespace.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsxRuntime.jsx(io,{flowId:o,...t});let n=t.as??f.Column;return jsxRuntime.jsx(n,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});m.Dismiss=e=>jsxRuntime.jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});m.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(N,{borderRadius:"md",src:e,...o});m.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});m.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});m.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(u.Body2,{display:"block",part:"subtitle",...o,children:e});m.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(u.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});function F({children:e,...o}){return jsxRuntime.jsx(R__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(R__namespace.Portal,{children:jsxRuntime.jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(R__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(R__namespace.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsxRuntime.jsx(m,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}F.Dismiss=e=>jsxRuntime.jsx(R__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"})})});F.Subtitle=({children:e,...o})=>jsxRuntime.jsx(R__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(u.Body2,{part:"subtitle",...o,children:e})});F.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(N,{borderRadius:"md",src:e,...o});F.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});F.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,n)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?y.colors.blue500:y.colors.blue800},n));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})};F.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});F.Title=({children:e,...o})=>jsxRuntime.jsx(R__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(u.H3,{part:"title",...o,children:e})});function xr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:F,dismissible:!0,flowId:e,...o,children:({flow:t,handleDismiss:i,handlePrimary:n,handleSecondary:r,parentProps:{dismissible:a},step:s})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx(F.Dismiss,{onClick:i}),jsxRuntime.jsxs(f.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(F.Title,{children:s.title}),jsxRuntime.jsx(F.Subtitle,{children:s.subtitle})]}),jsxRuntime.jsx(F.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(F.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(f.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsxRuntime.jsx(F.Secondary,{onClick:r,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsxRuntime.jsx(F.Primary,{onClick:n,title:s.primaryButtonTitle??"Continue"})]})]})})}function hr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:m,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:n,step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(f.Row,{gap:3,children:[r.imageUri&&jsxRuntime.jsx("img",{src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(f.Column,{children:[jsxRuntime.jsx(u.H4,{mb:1,children:r.title}),jsxRuntime.jsx(u.Body2,{color:"gray500",children:r.subtitle})]})]}),jsxRuntime.jsxs(f.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle,onClick:i}),o.dismissible&&jsxRuntime.jsx(m.Dismiss,{onClick:t})]})]})})}var Po={};$(Po,{Collapsible:()=>bo,CollapsibleStep:()=>ie});var ie={};$(ie,{Content:()=>Te,Root:()=>we,Trigger:()=>Re});var Cr=react.keyframes`
50
50
  from {
51
51
  height: 0;
52
52
  opacity: 0;
@@ -55,7 +55,7 @@ var Lt=Object.defineProperty;var Vt=(e=>typeof require<"u"?require:typeof Proxy<
55
55
  height: var(--radix-collapsible-content-height);
56
56
  opacity: 1;
57
57
  }
58
- `,cr=react.keyframes`
58
+ `,Sr=react.keyframes`
59
59
  from {
60
60
  height: var(--radix-collapsible-content-height);
61
61
  opacity: 1;
@@ -64,7 +64,7 @@ var Lt=Object.defineProperty;var Vt=(e=>typeof require<"u"?require:typeof Proxy<
64
64
  height: 0;
65
65
  opacity: 0;
66
66
  }
67
- `,mr=()=>jsxRuntime.jsx(p,{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 ur({checked:e=!1}){return jsxRuntime.jsx(p,{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(p,{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(mr,{})})})}function Ce({children:e}){return jsxRuntime.jsx(q__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(g.Column,{css:{'&[data-state="open"]':{animation:`${dr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${cr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(p,{}),e]})})}function Se({children:e,open:t=!1,onOpenChange:o=()=>{}}){return jsxRuntime.jsx(q__namespace.Root,{asChild:!0,open:t,onOpenChange:o,children:jsxRuntime.jsx(c,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function Fe({isCompleted:e,title:t}){return jsxRuntime.jsx(q__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(g.Row,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntime.jsxs(g.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(ur,{checked:e}),jsxRuntime.jsx(f.Body2,{fontWeight:"demibold",children:t})]}),jsxRuntime.jsx(p,{as:solid$1.ChevronDownIcon,color:"gray100",display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}function lt({handlePrimary:e,handleSecondary:t,open:o,onOpenChange:n,step:r}){let{isCompleted:i,primaryButtonTitle:s,secondaryButtonTitle:a,subtitle:d,title:m}=r;return jsxRuntime.jsxs(Se,{open:o,onOpenChange:n,children:[jsxRuntime.jsx(Fe,{isCompleted:i,title:m}),jsxRuntime.jsxs(Ce,{children:[jsxRuntime.jsx(c.Media,{aspectRatio:2.5,objectFit:"cover",src:r.imageUri}),jsxRuntime.jsx(c.Subtitle,{color:"gray500",children:d}),jsxRuntime.jsxs(g.Row,{gap:3,children:[jsxRuntime.jsx(c.Secondary,{title:a,onClick:t}),jsxRuntime.jsx(c.Primary,{title:s,onClick:e})]})]})]})}var gr={default:lt};function xr({flow:e,step:t,stepTypes:o,...n}){var d;let[r,i]=ye.useState(t.id),s={...gr,...o},a=Array.from((d=e.steps)==null?void 0:d.entries()).map(([,m])=>{let x=s[m.type]??lt;function u(h){var E,$,G;i(h?m.id:null),h&&!((E=e.steps.get(m.id))!=null&&E.isCompleted)&&((G=($=e.steps)==null?void 0:$.get(m.id))==null||G.start());}return jsxRuntime.jsx(x,{flow:e,onOpenChange:u,open:m.id===r,step:m,...n},m.id)});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(g.Column,{gap:2,children:[jsxRuntime.jsx(c.Title,{children:e.title}),jsxRuntime.jsx(c.Subtitle,{color:"gray500",children:e.subtitle})]}),a]})}function pt({flowId:e,stepTypes:t={},...o}){return jsxRuntime.jsx(D,{as:c,borderWidth:"md",flowId:e,part:"checklist",...o,children:n=>jsxRuntime.jsx(xr,{stepTypes:t,...n})})}var Pr=new Set(["required","min","max","minLength","maxLength","pattern"]);function Cr({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 n=Object.fromEntries(Object.entries(o).filter(([i])=>Pr.has(i))),r=reactHookForm.useController({name:o.id,control:t,rules:n});return jsxRuntime.jsx(e,{...r,fieldData:o})}function ct({fieldTypes:e,handleDismiss:t,handlePrimary:o,handleSecondary:n,parentProps:{dismissible:r},step:i}){var u;let{control:s,handleSubmit:a}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function m(h,E){o(E,h);}function x(h,E){n(E,h);}return (u=i.fields)==null||u.forEach(h=>{e[h.type]!=null&&d.push(jsxRuntime.jsx(Cr,{control:s,fieldComponent:e[h.type],fieldData:h},h.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(c.Title,{children:i.title}),r&&jsxRuntime.jsx(c.Dismiss,{onClick:t}),jsxRuntime.jsx(c.Subtitle,{flexBasis:"100%",children:i.subtitle})]}),d,jsxRuntime.jsxs(g.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[i.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:i.secondaryButtonTitle,onClick:a(x)}),jsxRuntime.jsx(b.Primary,{title:i.primaryButtonTitle??"Submit",onClick:a(m)})]},"form-footer")]})}function mt({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 ut({children:e,id:t,required:o=!1}){return jsxRuntime.jsxs(f.H4,{as:"label",htmlFor:t,part:"field-label",children:[e,o&&" *"]})}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 V({children:e,field:t,fieldData:o,fieldState:n}){let{id:r,label:i,placeholder:s}=o,{error:a}=n,d={id:r,...t,...s?{placeholder:s}:{},...re,"aria-invalid":!!a,value:t.value??""};return jsxRuntime.jsxs(p,{part:"field",children:[jsxRuntime.jsx(ut,{id:r,required:!!o.required,children:i}),e(d),jsxRuntime.jsx(mt,{error:a})]})}var wr=()=>jsxRuntime.jsx(p,{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"})}),Rr=ye__namespace.forwardRef(({label:e,value:t},o)=>jsxRuntime.jsxs(p,{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(Y__namespace.Item,{id:t,value:t,ref:o,asChild:!0,children:jsxRuntime.jsx(p,{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(p,{as:Y__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(wr,{})})})})]}));function yt(e){let{field:{onChange:t,value:o},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:s})=>jsxRuntime.jsx(Rr,{value:s,label:i},s));return jsxRuntime.jsx(V,{...e,children:()=>jsxRuntime.jsx(Y__namespace.Root,{value:o,onValueChange:t,asChild:!0,children:jsxRuntime.jsx(g.Column,{gap:2,part:"field-radio-group",children:r})})})}var kr=ye__namespace.forwardRef(({label:e,value:t},o)=>jsxRuntime.jsx(C__namespace.Item,{value:t,ref:o,asChild:!0,children:jsxRuntime.jsx(p,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(C__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(f.Body2,{part:"field-select-option-label",children:e})})})}));function Pt(e){let{field:{onChange:t,value:o},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:s,value:a})=>jsxRuntime.jsx(kr,{value:a,label:s},a));return jsxRuntime.jsx(V,{...e,children:()=>jsxRuntime.jsxs(C__namespace.Root,{value:o,onValueChange:t,children:[jsxRuntime.jsx(C__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(f.Body2,{...re,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(C__namespace.Value,{placeholder:r??"Select one"}),jsxRuntime.jsx(C__namespace.Icon,{children:jsxRuntime.jsx(p,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(C__namespace.Portal,{children:jsxRuntime.jsx(C__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(p,{...re,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(C__namespace.Viewport,{children:i})})})})]})})}function St(e){return jsxRuntime.jsx(V,{...e,children:t=>jsxRuntime.jsx(f.Body2,{as:"input",part:"field-text",type:"text",...t})})}function Tt(e){return jsxRuntime.jsx(V,{...e,children:t=>jsxRuntime.jsx(f.Body2,{as:"textarea",part:"field-textarea",...t})})}var Er={radio:yt,select:Pt,text:St,textarea:Tt};function Dr({fieldTypes:e={},flowId:t,...o}){let n=Object.assign({},Er,e);return jsxRuntime.jsx(D,{flowId:t,part:"form",...o,children:r=>jsxRuntime.jsx(ct,{fieldTypes:n,...r})})}function le(){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]=ye.useState(e),[n,r]=ye.useState(null),i=ye.useCallback(s=>{r(s);},[]);return ye.useLayoutEffect(()=>{if(!n)return;let s=()=>{let a=n.getBoundingClientRect();o(a);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:t,ref:i}}var Ir=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function vt({style:e={},part:t="",...o}){return jsxRuntime.jsxs(p,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsxRuntime.jsx(p,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Ir}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(p,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function kt({props:e,alignAttr:t,sideAttr:o}){let n=o??"bottom",r={},i=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},s="-24px",a={top:"bottom",right:"left",bottom:"top",left:"right"};r[a[n]]=s;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var Et={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Dt(e,t){let o=Object.fromEntries(Et.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(Et.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let r={after:"end",before:"start"},i=(u,h)=>["top","bottom"].includes(h)?u=="after"?"marginLeft":"marginRight":u=="after"?"marginTop":"marginBottom",s=o.alignOffset??0,a=o.style??{},d=o.side??"bottom",m=o.align;o.style={...a,[i(m,d)]:s};let x=["top","bottom"].includes(d)?t.width:t.height;o.alignOffset=(x+s)*-1,o.align=r[m];}return {contentProps:o,rootProps:n}}function S({anchor:e,children:t,className:o,spotlight:n=!1,style:r,...i}){let{node:s,rect:a,ref:d}=le(),{node:m,rect:x,ref:u}=le(),{contentProps:h,rootProps:E}=Dt(i,a),[$,G]=ye.useState(h.align),[J,de]=ye.useState(h.side),[Be,Ht]=ye.useState(0),[It,Wt]=ye.useState(0);if(s!==null){let A=s.getAttribute("data-align"),ne=s.getAttribute("data-side");$!==A&&G(A),J!==ne&&de(ne);}let ve=ye.useRef(null);if(ye.useEffect(()=>{let A=document.querySelector(e);A!=null&&(u(A),ve.current=A);},[e]),ye.useEffect(()=>{let{scrollX:A,scrollY:ne}=window;Ht(x.left+A),Wt(x.top+ne);},[x.left,x.top]),m==null)return null;let ke="0";typeof window<"u"&&(ke=window.getComputedStyle(m).borderRadius);let At=kt({props:i,alignAttr:$,sideAttr:J});return jsxRuntime.jsxs(M__namespace.Root,{defaultOpen:!0,...E,children:[jsxRuntime.jsx(M__namespace.Anchor,{virtualRef:ve}),jsxRuntime.jsx(M__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999,pointerEvents:"none"},children:[n&&jsxRuntime.jsx(p,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:ke,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:x.height,left:Be,top:It,width:x.width}}),jsxRuntime.jsx(M__namespace.Content,{asChild:!0,...h,ref:d,children:jsxRuntime.jsxs(c,{boxShadow:"md",part:"tooltip",position:"relative",css:{maxWidth:"360px",pointerEvents:"auto",...r},children:[jsxRuntime.jsx(vt,{style:At}),t]})})]})})]})}S.Close=e=>jsxRuntime.jsx(M__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"})})});S.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});S.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Primary,{title:t,onClick:e,...o});S.Progress=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.H4,{part:"progress",...t,children:e});S.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Secondary,{title:t,onClick:e,...o});S.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.Body2,{part:"subtitle",...t,children:e});S.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(f.H4,{part:"title",...t,children:e});function Mt({dismissible:e=!0,flow:t,onDismiss:o,onPrimary:n,onSecondary:r,step:i,...s}){let{handleDismiss:a}=_(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:m}=ee(i,{onPrimary:n,onSecondary:r});return jsxRuntime.jsxs(S,{anchor:i.selector,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),...s,children:[e&&jsxRuntime.jsx(S.Close,{onClick:a}),jsxRuntime.jsx(S.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsxRuntime.jsxs(g.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(S.Title,{children:i.title}),jsxRuntime.jsx(S.Subtitle,{color:"gray500",children:i.subtitle})]}),jsxRuntime.jsxs(g.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(S.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(S.Secondary,{title:i.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(S.Primary,{title:i.primaryButtonTitle,onClick:d})]})]},i.id)}function $r({flowId:e,onComplete:t,variables:o,...n}){let{flow:r}=Z(e,{variables:o});_(r,{onComplete:t});let{isCurrentModal:i,removeModal:s}=te(r);if(ye.useEffect(()=>{!(r!=null&&r.isVisible)&&i&&s();},[r==null?void 0:r.isVisible,i]),r==null||r.isVisible===!1||!i)return null;r.start();let a=r.getCurrentStep();return a==null||a.start(),jsxRuntime.jsx(Mt,{step:a,flow:r,...n})}function jr(){let{frigade:e}=ye.useContext(B);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Nr(){let{userId:e,frigade:t}=ye.useContext(B);async function o(r){await t.identify(e,r);}async function n(r,i){await t.track(r,i);}return {userId:e,addProperties:o,track:n}}function Gr(){let{groupId:e,frigade:t}=ye.useContext(B);async function o(r){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await t.group(e,r);}async function n(r,i){await t.track(r,i);}return {groupId:e,addProperties:o,track:n}}
67
+ `,Fr=()=>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 Tr({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(Fr,{})})})}function Te({children:e}){return jsxRuntime.jsx(q__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(f.Column,{css:{'&[data-state="open"]':{animation:`${Cr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Sr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(l,{}),e]})})}function we({children:e,open:o=!1,onOpenChange:t=()=>{}}){return jsxRuntime.jsx(q__namespace.Root,{asChild:!0,open:o,onOpenChange:t,children:jsxRuntime.jsx(m,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function Re({isCompleted:e,title:o}){return jsxRuntime.jsx(q__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(Tr,{checked:e}),jsxRuntime.jsx(u.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(l,{as:solid$1.ChevronDownIcon,color:"gray100",display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Be={};$(Be,{Bar:()=>se,Dots:()=>fo,Segments:()=>xo});function se({current:e,total:o,...t}){let i=o>0?Math.min(e/o,1):0,n=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(l,{backgroundColor:"blue800",borderRadius:"md",height:"10px",...t,children:jsxRuntime.jsx(l,{backgroundColor:"primary.surface",borderRadius:"md",height:"100%",style:{width:n},transition:"width 300ms ease-out"})})}function fo({current:e,total:o,...t}){if(o==1)return null;let i=[...Array(o)].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*o-8} 8`,width:16*o-8,...t,children:i})}function xo({current:e,total:o,...t}){let i=[...Array(o)].map((n,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:i})}var yo=Pe.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ho({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:i,step:n}){let{isCompleted:r,primaryButtonTitle:a,secondaryButtonTitle:s,subtitle:d,title:x}=n;return jsxRuntime.jsxs(we,{open:t,onOpenChange:i,children:[jsxRuntime.jsx(Re,{isCompleted:r,title:x}),jsxRuntime.jsxs(Te,{children:[jsxRuntime.jsx(m.Media,{aspectRatio:2.5,objectFit:"cover",src:n.imageUri}),jsxRuntime.jsx(m.Subtitle,{color:"gray500",children:d}),jsxRuntime.jsxs(f.Row,{gap:3,children:[jsxRuntime.jsx(m.Secondary,{title:s,onClick:o}),jsxRuntime.jsx(m.Primary,{title:a,onClick:e})]})]})]})}var vr={default:ho};function kr({flow:e,step:o,...t}){let{onPrimary:i,onSecondary:n,openStepId:r,setOpenStepId:a,stepTypes:s}=Pe.useContext(yo),{handlePrimary:d,handleSecondary:x}=z(o,{onPrimary:i,onSecondary:n}),g=(r??e.getCurrentStep().id)===o.id,c=s[o.type]??ho;async function h(T){a(T?o.id:""),T&&!o.isCompleted&&await o.start();}return jsxRuntime.jsx(c,{flow:e,onOpenChange:h,open:g,step:o,...t,handlePrimary:d,handleSecondary:x},o.id)}function bo({flowId:e,onPrimary:o,onSecondary:t,stepTypes:i={},...n}){let[r,a]=Pe.useState(null),s={...vr,...i};return jsxRuntime.jsx(yo.Provider,{value:{openStepId:r,setOpenStepId:a,onPrimary:o,onSecondary:t,stepTypes:s},children:jsxRuntime.jsx(O,{as:m,borderWidth:"md",flowId:e,part:"checklist",...n,children:({flow:d,...x})=>{let g=Array.from(d.steps.entries()).map(([,T])=>jsxRuntime.jsx(kr,{flow:d,...x,step:T},T.id)),c=d.getNumberOfCompletedSteps(),h=d.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(f.Column,{gap:2,children:[jsxRuntime.jsx(m.Title,{children:d.title}),jsxRuntime.jsx(m.Subtitle,{color:"gray500",children:d.subtitle}),jsxRuntime.jsxs(f.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(u.Body2,{fontWeight:"demibold",children:[c,"/",h]}),jsxRuntime.jsx(se,{current:c,total:h,flexGrow:1})]})]}),g]})}})})}var Ir=new Set(["required","min","max","minLength","maxLength","pattern"]);function Mr({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 i=Object.fromEntries(Object.entries(t).filter(([r])=>Ir.has(r))),n=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,{...n,fieldData:t})}function Co({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r}){var c;let{control:a,handleSubmit:s}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function x(h,T){t(T,h);}function g(h,T){i(T,h);}return (c=r.fields)==null||c.forEach(h=>{e[h.type]!=null&&d.push(jsxRuntime.jsx(Mr,{control:a,fieldComponent:e[h.type],fieldData:h},h.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(m.Title,{children:r.title}),n&&jsxRuntime.jsx(m.Dismiss,{onClick:o}),jsxRuntime.jsx(m.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:s(g)}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle??"Submit",onClick:s(x)})]},"form-footer")]})}function So({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(u.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Fo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(u.H4,{as:"label",htmlFor:o,part:"field-label",children:[e,t&&" *"]})}var oe={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function V({children:e,field:o,fieldData:t,fieldState:i}){let{id:n,label:r,placeholder:a}=t,{error:s}=i,d={id:n,...o,...a?{placeholder:a}:{},...oe,"aria-invalid":!!s,value:o.value??""};return jsxRuntime.jsxs(l,{part:"field",children:[jsxRuntime.jsx(Fo,{id:n,required:!!t.required,children:r}),e(d),jsxRuntime.jsx(So,{error:s})]})}var Lr=()=>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"})}),Vr=Pe__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(u.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Y__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:Y__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(Lr,{})})})})]}));function Bo(e){let{field:{onChange:o,value:t},fieldData:{options:i=[]}}=e,n=i.map(({label:r,value:a})=>jsxRuntime.jsx(Vr,{value:a,label:r},a));return jsxRuntime.jsx(V,{...e,children:()=>jsxRuntime.jsx(Y__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(f.Column,{gap:2,part:"field-radio-group",children:n})})})}var zr=Pe__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(C__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(C__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(u.Body2,{part:"field-select-option-label",children:e})})})}));function Do(e){let{field:{onChange:o,value:t},fieldData:{options:i=[],placeholder:n}}=e,r=i.map(({label:a,value:s})=>jsxRuntime.jsx(zr,{value:s,label:a},s));return jsxRuntime.jsx(V,{...e,children:()=>jsxRuntime.jsxs(C__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(C__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(u.Body2,{...oe,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(C__namespace.Value,{placeholder:n??"Select one"}),jsxRuntime.jsx(C__namespace.Icon,{children:jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(C__namespace.Portal,{children:jsxRuntime.jsx(C__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(l,{...oe,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(C__namespace.Viewport,{children:r})})})})]})})}function Oo(e){return jsxRuntime.jsx(V,{...e,children:o=>jsxRuntime.jsx(u.Body2,{as:"input",part:"field-text",type:"text",...o})})}function Mo(e){return jsxRuntime.jsx(V,{...e,children:o=>jsxRuntime.jsx(u.Body2,{as:"textarea",part:"field-textarea",...o})})}var jr={radio:Bo,select:Do,text:Oo,textarea:Mo};function Nr({fieldTypes:e={},flowId:o,...t}){let i=Object.assign({},jr,e);return jsxRuntime.jsx(O,{flowId:o,part:"form",...t,children:n=>jsxRuntime.jsx(Co,{fieldTypes:i,...n})})}function ae(){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]=Pe.useState(e),[i,n]=Pe.useState(null),r=Pe.useCallback(a=>{n(a);},[]);return Pe.useLayoutEffect(()=>{if(!i)return;let a=()=>{let s=i.getBoundingClientRect();t(s);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[i]),{node:i,rect:o,ref:r}}var Jr=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Lo({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 ${Jr}`,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 Vo({props:e,alignAttr:o,sideAttr:t}){let i=t??"bottom",n={},r=()=>{if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="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 le={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function $o(e,o){let t=Object.fromEntries(le.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i=Object.fromEntries(le.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!le.content.includes(r)&&!le.root.includes(r)&&(n[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"},a=(h,T)=>["top","bottom"].includes(T)?h=="after"?"marginLeft":"marginRight":h=="after"?"marginTop":"marginBottom",s=t.alignOffset??0,d=t.style??{},x=t.side??"bottom",g=t.align;t.style={...d,[a(g,x)]:s};let c=["top","bottom"].includes(x)?o.width:o.height;t.alignOffset=(c+s)*-1,t.align=r[g];}return {contentProps:t,otherProps:n,rootProps:i}}function _o(){let{debug:e}=Pe.useContext(w);return {debug:e,debugLog:o=>{e&&console.log(o);}}}function S({anchor:e,children:o,className:t,spotlight:i=!1,style:n,...r}){let{node:a,rect:s,ref:d}=ae(),{node:x,rect:g,ref:c}=ae(),{contentProps:h,otherProps:T,rootProps:de}=$o(r,s),{debugLog:ce}=_o(),[X,me]=Pe.useState(h.align),[ue,No]=Pe.useState(h.side),[Ko,Uo]=Pe.useState(0),[Go,Jo]=Pe.useState(0);if(a!==null){let A=a.getAttribute("data-align"),te=a.getAttribute("data-side");X!==A&&me(A),ue!==te&&No(te);}let Ee=Pe.useRef(null);if(Pe.useEffect(()=>{let A=document.querySelector(e);A!=null?(c(A),Ee.current=A):ce(`No anchor found for query: ${e}`);},[e]),Pe.useEffect(()=>{let{scrollX:A,scrollY:te}=window;Uo(g.left+A),Jo(g.top+te);},[g.left,g.top]),x==null)return null;let Oe="0";typeof window<"u"&&(Oe=window.getComputedStyle(x).borderRadius);let Xo=Vo({props:r,alignAttr:X,sideAttr:ue});return jsxRuntime.jsxs(I__namespace.Root,{defaultOpen:!0,...de,children:[jsxRuntime.jsx(I__namespace.Anchor,{virtualRef:Ee}),jsxRuntime.jsx(I__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&jsxRuntime.jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:Oe,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:g.height,left:Ko,top:Go,width:g.width}}),jsxRuntime.jsx(I__namespace.Content,{asChild:!0,...h,ref:d,children:jsxRuntime.jsxs(m,{boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n,...T,children:[jsxRuntime.jsx(Lo,{style:Xo}),o]})})]})})]})}S.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"})})});S.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(N,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e,...o});S.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});S.Progress=({children:e,...o})=>e==null?null:jsxRuntime.jsx(u.H4,{part:"progress",...o,children:e});S.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});S.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(u.Body2,{part:"subtitle",...o,children:e});S.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(u.H4,{part:"title",...o,children:e});function jo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:i,onSecondary:n,step:r,...a}){let{handleDismiss:s}=_(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:x}=z(r,{onPrimary:i,onSecondary:n});return jsxRuntime.jsxs(S,{anchor:r.selector,onOpenAutoFocus:g=>g.preventDefault(),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),...a,children:[e&&jsxRuntime.jsx(S.Close,{onClick:s}),jsxRuntime.jsx(S.Media,{src:r.videoUri??r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsxs(f.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(S.Title,{children:r.title}),jsxRuntime.jsx(S.Subtitle,{color:"gray500",children:r.subtitle})]}),jsxRuntime.jsxs(f.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(S.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(S.Secondary,{title:r.secondaryButtonTitle,onClick:x}),jsxRuntime.jsx(S.Primary,{title:r.primaryButtonTitle,onClick:d})]})]},r.id)}function on({flowId:e,onComplete:o,variables:t,...i}){let{flow:n}=Z(e,{variables:t});_(n,{onComplete:o});let{isCurrentModal:r,removeModal:a}=ee(n);if(Pe.useEffect(()=>{!(n!=null&&n.isVisible)&&r&&a();},[n==null?void 0:n.isVisible,r]),n==null||n.isVisible===!1||!r)return null;n.start();let s=n.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(jo,{step:s,flow:n,...i})}function nn(){let{frigade:e}=Pe.useContext(w);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function an(){let{userId:e,frigade:o}=Pe.useContext(w);async function t(n){await o.identify(e,n);}async function i(n,r){await o.track(n,r);}return {userId:e,addProperties:t,track:i}}function pn(){let{groupId:e,frigade:o}=Pe.useContext(w);async function t(n){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await o.group(e,n);}async function i(n,r){await o.track(n,r);}return {groupId:e,addProperties:t,track:i}}
68
68
 
69
69
  Object.defineProperty(exports, 'Flow', {
70
70
  enumerable: true,
@@ -74,26 +74,27 @@ Object.defineProperty(exports, 'Frigade', {
74
74
  enumerable: true,
75
75
  get: function () { return js.Frigade; }
76
76
  });
77
- exports.Announcement = ir;
78
- exports.Banner = sr;
79
- exports.Box = p;
77
+ exports.Announcement = xr;
78
+ exports.Banner = hr;
79
+ exports.Box = l;
80
80
  exports.Button = b;
81
- exports.Card = c;
82
- exports.Checklist = dt;
83
- exports.Flex = g;
84
- exports.Form = Dr;
85
- exports.Provider = $o;
86
- exports.Text = f;
81
+ exports.Card = m;
82
+ exports.Checklist = Po;
83
+ exports.Flex = f;
84
+ exports.Form = Nr;
85
+ exports.Progress = Be;
86
+ exports.Provider = Yt;
87
+ exports.Text = u;
87
88
  exports.Tooltip = S;
88
- exports.Tour = $r;
89
- exports.themeVariables = ue;
90
- exports.useBoundingClientRect = le;
89
+ exports.Tour = on;
90
+ exports.themeVariables = xe;
91
+ exports.useBoundingClientRect = ae;
91
92
  exports.useFlow = Z;
92
93
  exports.useFlowHandlers = _;
93
- exports.useFrigade = jr;
94
- exports.useGroup = Gr;
95
- exports.useModal = te;
96
- exports.useStepHandlers = ee;
97
- exports.useUser = Nr;
94
+ exports.useFrigade = nn;
95
+ exports.useGroup = pn;
96
+ exports.useModal = ee;
97
+ exports.useStepHandlers = z;
98
+ exports.useUser = an;
98
99
  //# sourceMappingURL=out.js.map
99
100
  //# sourceMappingURL=index.cjs.map