@frigade/react 2.0.0-alpha.37 → 2.0.0-alpha.39

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,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var C = require('@radix-ui/react-dialog');
3
+ var F = require('@radix-ui/react-dialog');
4
4
  var solid = require('@heroicons/react/24/solid');
5
- var le = require('react');
5
+ var ue = require('react');
6
6
  var clsx = require('clsx');
7
- var So = require('known-css-properties');
8
- var Do = require('dompurify');
7
+ var Ro = require('known-css-properties');
8
+ var Ao = 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 reactHookForm = require('react-hook-form');
13
13
  var $ = require('@radix-ui/react-radio-group');
14
- var g = require('@radix-ui/react-select');
14
+ var y = require('@radix-ui/react-select');
15
15
  var outline = require('@heroicons/react/24/outline');
16
16
  var v = require('@radix-ui/react-popover');
17
17
 
@@ -35,32 +35,32 @@ function _interopNamespace(e) {
35
35
  return Object.freeze(n);
36
36
  }
37
37
 
38
- var C__namespace = /*#__PURE__*/_interopNamespace(C);
39
- var le__namespace = /*#__PURE__*/_interopNamespace(le);
40
- var So__default = /*#__PURE__*/_interopDefault(So);
41
- var Do__default = /*#__PURE__*/_interopDefault(Do);
38
+ var F__namespace = /*#__PURE__*/_interopNamespace(F);
39
+ var ue__namespace = /*#__PURE__*/_interopNamespace(ue);
40
+ var Ro__default = /*#__PURE__*/_interopDefault(Ro);
41
+ var Ao__default = /*#__PURE__*/_interopDefault(Ao);
42
42
  var $__namespace = /*#__PURE__*/_interopNamespace($);
43
- var g__namespace = /*#__PURE__*/_interopNamespace(g);
43
+ var y__namespace = /*#__PURE__*/_interopNamespace(y);
44
44
  var v__namespace = /*#__PURE__*/_interopNamespace(v);
45
45
 
46
- var xo=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 X=(e,o)=>{for(var t in o)xo(e,t,{get:o[t],enumerable:!0});};var me={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var ue={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 fe={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,ge={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 xe={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var ho="px",bo=e=>typeof e=="number"?`${4*e}${ho}`:e,Po=[-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"],ye=Object.fromEntries(Po.map(e=>[e,bo(e)]));var he={fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{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 re={...me,colors:{...ue,...ge},...he,radii:fe,shadows:xe,space:ye};function K(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let a=`${o.length?`${o}${t}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(n,K(s,a,t)):n[a]=s,n},{})}function ne(e){return K(e,"--fr","-")}function be(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=be(r,`${o}-${n}`):t[n]=`var(${o}-${n})`;}),t}var Pe=ne(re),u=be(re);var Co=new Set(["alt","size","src"]),Fo=So__default.default.all.filter(e=>e.indexOf("-")!=0&&!Co.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),To=Object.fromEntries(Fo),ie=K(u.colors),wo={color:ie,backgroundColor:ie,borderColor:ie,border:u.borders,borderRadius:u.radii,borderWidth:u.borderWidths,boxShadow:u.shadows,fontFamily:u.fontFamilies,fontSize:u.fontSizes,fontWeight:u.fontWeights,gap:u.space,lineHeight:u.lineHeights,margin:u.space,marginBottom:u.space,marginLeft:u.space,marginRight:u.space,marginTop:u.space,padding:u.space,paddingBottom:u.space,paddingLeft:u.space,paddingRight:u.space,paddingTop:u.space},Se={...To,...wo},Ce={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"]},Fe=new Set(["active","focus","focusVisible","focusWithin","hover"]);function Ro(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 Te=new Map(Object.entries(Se).map(([e,o])=>[e,Ro(o)])),Bo=new Map(Object.entries(Ce).map(([e,o])=>[e,new Set(o)])),vo=new Set(["height","width"]),ko=new Set(["canvas","embed","iframe","img","input","object","video"]);function we(e){let[o,t]=e.split(":");return [o,Fe.has(t)?t:null]}function Re(e,o="div"){let t=Object.assign({},e),n={};function r(i){if(i==null)return n;let s=`&:${i.replace(/[A-Z]/g,m=>`-${m.toLocaleLowerCase()}`)}`;return n[s]==null&&(n[s]={}),n[s]}return Object.entries(t).forEach(([i,a])=>{let[s,m]=we(i),c=Bo.get(s);c!=null&&(c.forEach(P=>{let x=`${P}${m?":"+m:""}`;t[x]=a;}),delete t[i]);}),Object.entries(t).forEach(([i,a])=>{let[s,m]=we(i),c=Te.get(s);if(c!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let P=a.split(" ");r(m)[s]=P.map(x=>c.get(x.toString())??x).join(" ");}else c.has(a.toString())?r(m)[s]=c.get(a.toString()):r(m)[s]=a;(typeof o!="string"||!ko.has(o)||!vo.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let a=i.substring(1);i.indexOf("_")===0&&Te.has(a)&&(t[a]=t[i],delete t[i]);}),{cssFromProps:n,unmatchedProps:t}}function Oo(){if(typeof window>"u"){let{JSDOM:e}=yo("jsdom");return new e("<!DOCTYPE html>").window}return window}function Be(e){return e?{__html:Do__default.default(Oo()).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 Ho(e){return e&&`fr-${e}`}function De(e){return e&&(Array.isArray(e)?e.map(o=>De(o)).join(" "):Ho(e))}function Mo({as:e,children:o,className:t,css:n={},part:r,...i},a){let s=e??"div",{cssFromProps:m,unmatchedProps:c}=Re(i,s),P=De(r),x=t||P?clsx.clsx(t,P):void 0,B=[{boxSizing:"border-box"},m,n];return typeof o=="string"?jsxRuntime.jsx(s,{className:x,css:B,...c,ref:a,dangerouslySetInnerHTML:Be(o)}):jsxRuntime.jsx(s,{className:x,css:B,...c,ref:a,children:o})}var p=le__namespace.forwardRef(Mo);var d={};X(d,{Body1:()=>Yo,Body2:()=>Qo,Caption:()=>Zo,Display1:()=>jo,Display2:()=>Uo,H1:()=>Go,H2:()=>qo,H3:()=>Jo,H4:()=>Xo});var ae={};X(ae,{Body1:()=>zo,Body2:()=>_o,Caption:()=>Ko,Display1:()=>Ao,Display2:()=>Io,H1:()=>Lo,H2:()=>Vo,H3:()=>Wo,H4:()=>$o});var k={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ao={...k,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},Io={...k,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},Lo={...k,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},Vo={...k,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},Wo={...k,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},$o={...k,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},zo={...k,fontSize:"md",fontWeight:"regular",lineHeight:"md"},_o={...k,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},Ko={...k,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};var No=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],D=Object.fromEntries(No.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=le__namespace.forwardRef(({as:n=o,children:r,...i},a)=>jsxRuntime.jsx(p,{as:n,...ae[e],...i,ref:a,children:r}));return t.displayName=`Text.${e}`,[e,t]})),jo=D.Display1,Uo=D.Display2,Go=D.H1,qo=D.H2,Jo=D.H3,Xo=D.H4,Yo=D.Body1,Qo=D.Body2,Zo=D.Caption;var se={};X(se,{Link:()=>rt,Plain:()=>nt,Primary:()=>ot,Secondary:()=>tt});var Y={borderWidth:"0",borderRadius:"md",padding:"2 4"},ot={...Y,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},tt={...Y,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},rt={...Y,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},nt={...Y,backgroundColor:"transparent",color:"neutral.foreground"};function Ee({as:e,children:o,part:t,title:n,variant:r="Primary",...i}){let a=r.toLocaleLowerCase();return jsxRuntime.jsxs(p,{as:e??"button",part:[`button-${a}`,t],...se[r],...i,children:[o,n&&jsxRuntime.jsx(d.Body2,{fontWeight:"demibold",color:"inherit",children:n})]})}var it=["Primary","Secondary","Link","Plain"],at=Object.fromEntries(it.map(e=>{let o=t=>jsxRuntime.jsx(Ee,{...t,variant:e,children:t.children});return o.displayName=`Text.${e}`,[e,o]})),S=Object.assign(Ee,at);var y={};X(y,{Column:()=>pt,Row:()=>lt});var lt=le__namespace.forwardRef(({children:e,css:o,...t},n)=>jsxRuntime.jsx(p,{css:[{display:"flex",flexDirection:"row"},o],...t,ref:n,children:e})),pt=le__namespace.forwardRef(({children:e,css:o,...t},n)=>jsxRuntime.jsx(p,{css:[{display:"flex",flexDirection:"column"},o],...t,ref:n,children:e}));var M=le__namespace.forwardRef(({as:e,children:o,...t},n)=>{let r=e??y.Column;return jsxRuntime.jsx(r,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...t,ref:n,children:o})});function Ie({part:e,src:o,...t}){return jsxRuntime.jsx(p,{as:"img",part:["image",e],src:o,...t})}function mt(e){var o,t,n;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Le({part:e,src:o,...t}){let n=mt(o);return 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,...t})}function N({src:e,type:o,...t}){return jsxRuntime.jsx(o==="video"?Le:Ie,{src:e,...t})}function h({children:e,...o}){return jsxRuntime.jsx(C__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(C__namespace.Portal,{children:jsxRuntime.jsxs(p,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(C__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(p,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(C__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-content",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}h.Close=e=>jsxRuntime.jsx(C__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(S.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});h.Subtitle=({children:e,...o})=>jsxRuntime.jsx(C__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(d.Body2,{mb:5,part:"subtitle",...o,children:e})});h.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(N,{borderRadius:"md",src:e,...o});h.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(S.Primary,{title:o,onClick:e,...t});h.ProgressDots=({current:e,total:o})=>{let t=[...Array(o)].map((n,r)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?u.colors.blue500:u.colors.blue800},r));return o==0?null:jsxRuntime.jsx(p,{as:"svg",height:"8px",margin:"5 auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};h.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(S.Secondary,{title:o,onClick:e,...t});h.Title=({children:e,...o})=>jsxRuntime.jsx(C__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(d.H3,{mb:1,part:"title",...o,children:e})});var O=le.createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function Tt({children:e,navigate:o,theme:t,...n}){let r=t?ne(t):{},[i,a]=le.useState([]),s=le.useRef(new js.Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId,__readOnly:n.__readOnly,__flowConfigOverrides:n.__flowConfigOverrides})),m=o??((c,P="_self")=>{window.open(c,P);});return le.useEffect(()=>()=>{var c;(c=s.current)==null||c.destroy();},[]),jsxRuntime.jsxs(O.Provider,{value:{modals:i,setModals:a,navigate:m,...n,frigade:s.current},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...Pe,...r}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:u,children:e})]})}function j(e,o){let[t,n]=le.useState(),[,r]=le.useState(""),{frigade:i}=le.useContext(O),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),n(s),r(Math.random().toString()));};return le.useEffect(()=>((async()=>{let s=await i.getFlow(e);if(!s||i.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),n(s);})(),i.onStateChange(a),()=>{i.removeStateChangeHandler(a);}),[]),{flow:t}}function A(e,{onComplete:o,onDismiss:t}={}){let n=le.useRef(null);return le.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:le.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function U(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=le.useContext(O);return {handlePrimary:le.useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:le.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function W({container:e,dismissible:o=!0,flowId:t,onComplete:n,onDismiss:r,onPrimary:i,onSecondary:a,variables:s,...m}){let c=e==="dialog"?h:p;return {FlowComponent:function({children:B,...oe}){let{flow:w}=j(t,{variables:s}),z=w==null?void 0:w.getCurrentStep(),{handleDismiss:_}=A(w,{onComplete:n,onDismiss:r}),{handlePrimary:te,handleSecondary:q}=U(z,{onPrimary:i,onSecondary:a});if(w==null||w.isVisible===!1)return null;let J=o&&e==="dialog"?jsxRuntime.jsx(h.Close,{onClick:_}):null;return w.start(),z.start(),jsxRuntime.jsxs(c,{...oe,...m,children:[J,B({flow:w,handleDismiss:_,handlePrimary:te,handleSecondary:q,step:z})]})}}}function Mt(e){let{FlowComponent:o}=W({...e,container:"dialog"});return jsxRuntime.jsx(o,{children:({flow:t,handlePrimary:n,handleSecondary:r,step:i})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(h.Title,{children:i.title}),jsxRuntime.jsx(h.Subtitle,{children:i.subtitle}),jsxRuntime.jsx(h.Media,{src:i.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(h.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(y.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[i.secondaryButtonTitle&&jsxRuntime.jsx(h.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsxRuntime.jsx(h.Primary,{title:i.primaryButtonTitle??"Continue",onClick:n})]})]})})}function Lt(e){let{FlowComponent:o}=W(e);return jsxRuntime.jsx(o,{as:M,border:"md",borderColor:"gray900",display:"flex",flexDirection:"row",justifyContent:"space-between",children:({handleDismiss:t,handlePrimary:n,handleSecondary:r,step:i})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(y.Row,{gap:3,children:[i.imageUri&&jsxRuntime.jsx("img",{src:i.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(y.Column,{children:[jsxRuntime.jsx(d.H4,{mb:1,children:i.title}),jsxRuntime.jsx(d.Body2,{children:i.subtitle})]})]}),jsxRuntime.jsxs(y.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[i.secondaryButtonTitle&&jsxRuntime.jsx(S.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsxRuntime.jsx(S.Primary,{title:i.primaryButtonTitle,onClick:n}),e.dismissible&&e.container!="dialog"&&jsxRuntime.jsx(S.Plain,{part:"banner-close",onClick:t,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})]})]})})}var zt=new Set(["required","min","max","minLength","maxLength","pattern"]);function _t({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(([i])=>zt.has(i))),r=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,{...r,fieldData:t})}function _e({fieldTypes:e,step:o}){var a;let{control:t,handleSubmit:n}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),r=[];function i(s){o.complete(s);}return (a=o.fields)==null||a.forEach(s=>{e[s.type]!=null&&r.push(jsxRuntime.jsx(_t,{control:t,fieldComponent:e[s.type],fieldData:s},s.id));}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r,jsxRuntime.jsx(y.Row,{justifyContent:"flex-end",children:jsxRuntime.jsx(S.Primary,{title:o.primaryButtonTitle??"Submit",onClick:n(i)})},"form-footer")]})}function Ke({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(d.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Ne({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(d.Body2,{as:"label",htmlFor:o,fontWeight:"demibold",part:"field-label",children:[e,t&&" *"]})}var je={marginBottom:"5"},G={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function H({children:e,field:o,fieldData:t,fieldState:n}){let{id:r,label:i,placeholder:a}=t,{error:s}=n,m={id:r,...o,...a?{placeholder:a}:{},...G,"aria-invalid":!!s,value:o.value??""};return jsxRuntime.jsxs(p,{...je,part:"field",children:[jsxRuntime.jsx(Ne,{id:r,required:!!t.required,children:i}),e(m),jsxRuntime.jsx(Ke,{error:s})]})}var qt=()=>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"})}),Jt=le__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(p,{as:"label",htmlFor:o,display:"flex",justifyContent:"space-between",part:"field-radio",px:4,py:2,borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"md",children:[jsxRuntime.jsx(d.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx($__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(p,{as:"button",backgroundColor:"neutral.background",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:$__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(qt,{})})})})]}));function Je(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:a})=>jsxRuntime.jsx(Jt,{value:a,label:i},a));return jsxRuntime.jsx(H,{...e,children:()=>jsxRuntime.jsx($__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(y.Column,{gap:2,part:"field-radio-group",children:r})})})}var Qt=le__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(g__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(p,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(g__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(d.Body2,{part:"field-select-option-label",children:e})})})}));function Qe(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:a,value:s})=>jsxRuntime.jsx(Qt,{value:s,label:a},s));return jsxRuntime.jsx(H,{...e,children:()=>jsxRuntime.jsxs(g__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(g__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(d.Body2,{...G,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(g__namespace.Value,{placeholder:r??"Select one"}),jsxRuntime.jsx(g__namespace.Icon,{children:jsxRuntime.jsx(p,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(g__namespace.Portal,{children:jsxRuntime.jsx(g__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(p,{...G,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(g__namespace.Viewport,{children:i})})})})]})})}function eo(e){return jsxRuntime.jsx(H,{...e,children:o=>jsxRuntime.jsx(d.Body2,{as:"input",part:"field-text",type:"text",...o})})}function to(e){return jsxRuntime.jsx(H,{...e,children:o=>jsxRuntime.jsx(d.Body2,{as:"textarea",part:"field-textarea",...o})})}var Zt={radio:Je,select:Qe,text:eo,textarea:to};function er({fieldTypes:e={},...o}){let{FlowComponent:t}=W(o),n=Object.assign({},Zt,e);return jsxRuntime.jsx(t,{children:({step:r})=>jsxRuntime.jsx(_e,{fieldTypes:n,step:r,...o})})}function ee(){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]=le.useState(e),[n,r]=le.useState(null),i=le.useCallback(a=>{r(a);},[]);return le.useLayoutEffect(()=>{if(!n)return;let a=()=>{let s=n.getBoundingClientRect();t(s);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[n]),{node:n,rect:o,ref:i}}var nr=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ao({style:e={},part:o="",...t}){return jsxRuntime.jsxs(p,{part:`dot-wrapper ${o}`,style:{height:"48px",position:"absolute",width:"48px",...e},...t,children:[jsxRuntime.jsx(p,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${nr}`,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 so({props:e,alignAttr:o,sideAttr:t}){let n=t??"bottom",r={},i=()=>{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"};r[s[n]]=a;let m=i();return ["before","end"].includes(m)?["top","bottom"].includes(n)?r.right=a:r.bottom=a:["after","start"].includes(m)?["top","bottom"].includes(n)?r.left=a:r.top=a:["top","bottom"].includes(n)?r.left=`calc(50% + ${a})`:r.top=`calc(50% + ${a})`,r}var lo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function po(e,o){let t=Object.fromEntries(lo.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(lo.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let r={after:"end",before:"start"},i=(x,B)=>["top","bottom"].includes(B)?x=="after"?"marginLeft":"marginRight":x=="after"?"marginTop":"marginBottom",a=t.alignOffset??0,s=t.style??{},m=t.side??"bottom",c=t.align;t.style={...s,[i(c,m)]:a};let P=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(P+a)*-1,t.align=r[c];}return {contentProps:t,rootProps:n}}function b({anchor:e,children:o,className:t,spotlight:n=!1,style:r,...i}){let{node:a,rect:s,ref:m}=ee(),{node:c,rect:P,ref:x}=ee(),{contentProps:B,rootProps:oe}=po(i,s),[w,z]=le.useState(B.align),[_,te]=le.useState(B.side);if(a!==null){let V=a.getAttribute("data-align"),ce=a.getAttribute("data-side");w!==V&&z(V),_!==ce&&te(ce);}let q=le.useRef(null);if(le.useEffect(()=>{let V=document.querySelector(e);V!=null&&(x(V),q.current=V);},[e]),c==null)return null;let J="0";typeof window<"u"&&(J=window.getComputedStyle(c).borderRadius);let go=so({props:i,alignAttr:w,sideAttr:_});return jsxRuntime.jsxs(v__namespace.Root,{defaultOpen:!0,...oe,children:[jsxRuntime.jsx(v__namespace.Anchor,{virtualRef:q}),jsxRuntime.jsx(v__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:t,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[n&&jsxRuntime.jsx(p,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:J,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:P.height,left:c.offsetLeft,top:c.offsetTop,width:P.width}}),jsxRuntime.jsx(v__namespace.Content,{asChild:!0,...B,ref:m,children:jsxRuntime.jsxs(M,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...r},children:[jsxRuntime.jsx(ao,{style:go}),o]})})]})})]})}b.Close=e=>jsxRuntime.jsx(v__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(S.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});b.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(N,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...o});b.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(S.Primary,{title:o,onClick:e,...t});b.Progress=({children:e,...o})=>e==null?null:jsxRuntime.jsx(d.Body2,{fontWeight:"demibold",part:"progress",...o,children:e});b.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(S.Secondary,{title:o,onClick:e,...t});b.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(d.Body2,{part:"subtitle",...o,children:e});b.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(d.Body1,{fontWeight:"bold",mb:1,part:"title",...o,children:e});function de(e){let{modals:o,setModals:t}=le.useContext(O),[n,r]=le.useState(!1);return le.useEffect(()=>(t([...o,e]),()=>t(o.filter(i=>i!==e))),[]),le.useEffect(()=>{let i=o[0]===e;i!==n&&r(i);},[o]),{isCurrentModal:n}}function fo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:n,onSecondary:r,step:i,...a}){let{isCurrentModal:s}=de(`${o.id}-${i.id}`),{handleDismiss:m}=A(o,{onDismiss:t}),{handlePrimary:c,handleSecondary:P}=U(i,{onPrimary:n,onSecondary:r});return s?jsxRuntime.jsxs(b,{anchor:i.selector,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),...a,children:[e&&jsxRuntime.jsx(b.Close,{onClick:m}),jsxRuntime.jsx(b.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsxRuntime.jsx(b.Title,{children:i.title}),jsxRuntime.jsx(b.Subtitle,{children:i.subtitle}),jsxRuntime.jsxs(y.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(b.Progress,{children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(b.Secondary,{marginLeft:"auto",title:i.secondaryButtonTitle,onClick:P}),jsxRuntime.jsx(b.Primary,{title:i.primaryButtonTitle,onClick:c})]})]},i.id):null}function cr({flowId:e,onComplete:o,variables:t,...n}){let{flow:r}=j(e,{variables:t});if(A(r,{onComplete:o}),r==null||r.isVisible===!1)return null;r.start();let i=r.getCurrentStep();return i==null||i.start(),jsxRuntime.jsx(fo,{step:i,flow:r,...n})}function fr(){let{frigade:e}=le.useContext(O);return {frigade:e}}
46
+ var So=Object.defineProperty;var Co=(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 Y=(e,o)=>{for(var t in o)So(e,t,{get:o[t],enumerable:!0});};var ye={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var he={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 be={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Pe={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 Se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Fo="px",To=e=>typeof e=="number"?`${4*e}${Fo}`:e,wo=[-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"],Ce=Object.fromEntries(wo.map(e=>[e,To(e)]));var Fe={fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{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 le={...ye,colors:{...he,...Pe},...Fe,radii:be,shadows:Se,space:Ce};function N(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let a=`${o.length?`${o}${t}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(n,N(s,a,t)):n[a]=s,n},{})}function pe(e){return N(e,"--fr","-")}function Te(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=Te(r,`${o}-${n}`):t[n]=`var(${o}-${n})`;}),t}var we=pe(le),m=Te(le);var Bo=new Set(["alt","size","src"]),vo=Ro__default.default.all.filter(e=>e.indexOf("-")!=0&&!Bo.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),ko=Object.fromEntries(vo),de=N(m.colors),Do={color:de,backgroundColor:de,borderColor:de,border:m.borders,borderRadius:m.radii,borderWidth:m.borderWidths,boxShadow:m.shadows,fontFamily:m.fontFamilies,fontSize:m.fontSizes,fontWeight:m.fontWeights,gap:m.space,lineHeight:m.lineHeights,margin:m.space,marginBottom:m.space,marginLeft:m.space,marginRight:m.space,marginTop:m.space,padding:m.space,paddingBottom:m.space,paddingLeft:m.space,paddingRight:m.space,paddingTop:m.space},Re={...ko,...Do},Be={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"]},ve=new Set(["active","focus","focusVisible","focusWithin","hover"]);function Oo(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 ke=new Map(Object.entries(Re).map(([e,o])=>[e,Oo(o)])),Eo=new Map(Object.entries(Be).map(([e,o])=>[e,new Set(o)])),Ho=new Set(["height","width"]),Mo=new Set(["canvas","embed","iframe","img","input","object","video"]);function De(e){let[o,t]=e.split(":");return [o,ve.has(t)?t:null]}function Oe(e,o="div"){let t=Object.assign({},e),n={};function r(i){if(i==null)return n;let s=`&:${i.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[s]==null&&(n[s]={}),n[s]}return Object.entries(t).forEach(([i,a])=>{let[s,d]=De(i),f=Eo.get(s);f!=null&&(f.forEach(u=>{let S=`${u}${d?":"+d:""}`;t[S]=a;}),delete t[i]);}),Object.entries(t).forEach(([i,a])=>{let[s,d]=De(i),f=ke.get(s);if(f!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let u=a.split(" ");r(d)[s]=u.map(S=>f.get(S.toString())??S).join(" ");}else f.has(a.toString())?r(d)[s]=f.get(a.toString()):r(d)[s]=a;(typeof o!="string"||!Mo.has(o)||!Ho.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let a=i.substring(1);i.indexOf("_")===0&&ke.has(a)&&(t[a]=t[i],delete t[i]);}),{cssFromProps:n,unmatchedProps:t}}function Vo(){if(typeof window>"u"){let{JSDOM:e}=Co("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ee(e){return e?{__html:Ao__default.default(Vo()).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 Io(e){return e&&`fr-${e}`}function Ae(e){return e&&(Array.isArray(e)?e.map(o=>Ae(o)).join(" "):Io(e))}function Wo({as:e,children:o,className:t,css:n={},part:r,...i},a){let s=e??"div",{cssFromProps:d,unmatchedProps:f}=Oe(i,s),u=Ae(r),S=t||u?clsx.clsx(t,u):void 0,B=[{boxSizing:"border-box"},d,n];return typeof o=="string"?jsxRuntime.jsx(s,{className:S,css:B,...f,ref:a,dangerouslySetInnerHTML:Ee(o)}):jsxRuntime.jsx(s,{className:S,css:B,...f,ref:a,children:o})}var p=ue__namespace.forwardRef(Wo);var c={};Y(c,{Body1:()=>tt,Body2:()=>rt,Caption:()=>nt,Display1:()=>Xo,Display2:()=>Yo,H1:()=>Qo,H2:()=>Zo,H3:()=>et,H4:()=>ot});var ce={};Y(ce,{Body1:()=>Uo,Body2:()=>Go,Caption:()=>qo,Display1:()=>$o,Display2:()=>zo,H1:()=>_o,H2:()=>Ko,H3:()=>No,H4:()=>jo});var k={color:"neutral.foreground",fontFamily:"default",margin:"0"},$o={...k,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},zo={...k,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},_o={...k,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},Ko={...k,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},No={...k,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},jo={...k,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},Uo={...k,fontSize:"md",fontWeight:"regular",lineHeight:"md"},Go={...k,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},qo={...k,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};var Jo=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],D=Object.fromEntries(Jo.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ue__namespace.forwardRef(({as:n=o,children:r,...i},a)=>jsxRuntime.jsx(p,{as:n,...ce[e],...i,ref:a,children:r}));return t.displayName=`Text.${e}`,[e,t]})),Xo=D.Display1,Yo=D.Display2,Qo=D.H1,Zo=D.H2,et=D.H3,ot=D.H4,tt=D.Body1,rt=D.Body2,nt=D.Caption;var me={};Y(me,{Link:()=>lt,Plain:()=>pt,Primary:()=>st,Secondary:()=>at});var Q={borderWidth:"0",borderRadius:"md",padding:"2 4"},st={...Q,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},at={...Q,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},lt={...Q,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},pt={...Q,backgroundColor:"transparent",color:"neutral.foreground"};function Le({as:e,children:o,part:t,title:n,variant:r="Primary",...i}){let a=r.toLocaleLowerCase();return jsxRuntime.jsxs(p,{as:e??"button",part:[`button-${a}`,t],...me[r],...i,children:[o,n&&jsxRuntime.jsx(c.Body2,{fontWeight:"demibold",color:"inherit",children:n})]})}var dt=["Primary","Secondary","Link","Plain"],ct=Object.fromEntries(dt.map(e=>{let o=t=>jsxRuntime.jsx(Le,{...t,variant:e,children:t.children});return o.displayName=`Text.${e}`,[e,o]})),C=Object.assign(Le,ct);var h={};Y(h,{Column:()=>ft,Row:()=>ut});var ut=ue__namespace.forwardRef(({children:e,css:o,...t},n)=>jsxRuntime.jsx(p,{css:[{display:"flex",flexDirection:"row"},o],...t,ref:n,children:e})),ft=ue__namespace.forwardRef(({children:e,css:o,...t},n)=>jsxRuntime.jsx(p,{css:[{display:"flex",flexDirection:"column"},o],...t,ref:n,children:e}));var A=ue__namespace.forwardRef(({as:e,children:o,...t},n)=>{let r=e??h.Column;return jsxRuntime.jsx(r,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...t,ref:n,children:o})});function ze({part:e,src:o,...t}){return jsxRuntime.jsx(p,{as:"img",part:["image",e],src:o,...t})}function yt(e){var o,t,n;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function _e({part:e,src:o,...t}){let n=yt(o);return 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,...t})}function j({src:e,type:o,...t}){return jsxRuntime.jsx(o==="video"?_e:ze,{src:e,...t})}function b({children:e,...o}){return jsxRuntime.jsx(F__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(F__namespace.Portal,{children:jsxRuntime.jsxs(p,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(F__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(p,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(F__namespace.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsxRuntime.jsx(A,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog-content",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}b.Close=e=>jsxRuntime.jsx(F__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(C.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});b.Subtitle=({children:e,...o})=>jsxRuntime.jsx(F__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(c.Body2,{mb:5,part:"subtitle",...o,children:e})});b.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(j,{borderRadius:"md",src:e,...o});b.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(C.Primary,{title:o,onClick:e,...t});b.ProgressDots=({current:e,total:o})=>{if(o==0)return null;let t=[...Array(o)].map((n,r)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?m.colors.blue500:m.colors.blue800},r));return jsxRuntime.jsx(p,{as:"svg",height:"8px",margin:"5 auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};b.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(C.Secondary,{title:o,onClick:e,...t});b.Title=({children:e,...o})=>jsxRuntime.jsx(F__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(c.H3,{mb:1,part:"title",...o,children:e})});var O=ue.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function kt({children:e,navigate:o,theme:t,...n}){let r=t?pe(t):{},[i,a]=ue.useState(new Set),s=ue.useRef(new js.Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId,__readOnly:n.__readOnly,__flowConfigOverrides:n.__flowConfigOverrides})),d=o??((u,S="_self")=>{window.open(u,S);});ue.useEffect(()=>()=>{var u;(u=s.current)==null||u.destroy();},[]);let f=i.size>0?i.values().next().value:null;return jsxRuntime.jsxs(O.Provider,{value:{modals:i,setModals:a,currentModal:f,navigate:d,...n,frigade:s.current},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...we,...r}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:m,children:e})]})}function U(e,o){let[t,n]=ue.useState(),[,r]=ue.useState(""),{frigade:i}=ue.useContext(O),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),n(s),r(Math.random().toString()));};return ue.useEffect(()=>((async()=>{let s=await i.getFlow(e);if(!s||i.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),n(s);})(),i.onStateChange(a),()=>{i.removeStateChangeHandler(a);}),[]),{flow:t}}function V(e,{onComplete:o,onDismiss:t}={}){let n=ue.useRef(null);return ue.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:ue.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function G(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=ue.useContext(O);return {handlePrimary:ue.useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:ue.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function q(e){let{currentModal:o,modals:t,setModals:n}=ue.useContext(O),[r,i]=ue.useState(!1);ue.useEffect(()=>{e!=null&&!t.has(e)&&n(s=>new Set(s).add(e));},[e]),ue.useEffect(()=>{let s=o===e;e!=null&&s!==r&&i(s);},[e,o]);function a(){t.has(e)&&n(s=>{let d=new Set(s);return d.delete(e),d});}return {isCurrentModal:r,removeModal:a}}function W({container:e,dismissible:o=!0,flowId:t,onComplete:n,onDismiss:r,onPrimary:i,onSecondary:a,variables:s,...d}){let f=e==="dialog"?b:p;return {FlowComponent:function({children:B,...re}){let{flow:g}=U(t,{variables:s}),z=g==null?void 0:g.getCurrentStep(),{handleDismiss:_}=V(g,{onComplete:n,onDismiss:r}),{handlePrimary:ne,handleSecondary:ie}=G(z,{onPrimary:i,onSecondary:a}),{isCurrentModal:K,removeModal:se}=q(g==null?void 0:g.id);if(ue.useEffect(()=>{!(g!=null&&g.isVisible)&&K&&se();},[g==null?void 0:g.isVisible,K]),g==null||!g.isVisible||!K)return null;let ae=o&&e==="dialog"?jsxRuntime.jsx(b.Close,{onClick:_}):null;return g.start(),z.start(),jsxRuntime.jsxs(f,{...re,...d,children:[ae,B({flow:g,handleDismiss:_,handlePrimary:ne,handleSecondary:ie,step:z})]})}}}function _t(e){let{FlowComponent:o}=W({...e,container:"dialog"});return jsxRuntime.jsx(o,{children:({flow:t,handlePrimary:n,handleSecondary:r,step:i})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Title,{children:i.title}),jsxRuntime.jsx(b.Subtitle,{children:i.subtitle}),jsxRuntime.jsx(b.Media,{src:i.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(b.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(h.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[i.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsxRuntime.jsx(b.Primary,{title:i.primaryButtonTitle??"Continue",onClick:n})]})]})})}function jt(e){let{FlowComponent:o}=W(e);return jsxRuntime.jsx(o,{as:A,border:"md",borderColor:"gray900",display:"flex",flexDirection:"row",justifyContent:"space-between",children:({handleDismiss:t,handlePrimary:n,handleSecondary:r,step:i})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(h.Row,{gap:3,children:[i.imageUri&&jsxRuntime.jsx("img",{src:i.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(h.Column,{children:[jsxRuntime.jsx(c.H4,{mb:1,children:i.title}),jsxRuntime.jsx(c.Body2,{children:i.subtitle})]})]}),jsxRuntime.jsxs(h.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[i.secondaryButtonTitle&&jsxRuntime.jsx(C.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsxRuntime.jsx(C.Primary,{title:i.primaryButtonTitle,onClick:n}),e.dismissible&&e.container!="dialog"&&jsxRuntime.jsx(C.Plain,{part:"banner-close",onClick:t,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})]})]})})}var Jt=new Set(["required","min","max","minLength","maxLength","pattern"]);function Xt({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(([i])=>Jt.has(i))),r=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,{...r,fieldData:t})}function qe({fieldTypes:e,step:o}){var a;let{control:t,handleSubmit:n}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),r=[];function i(s){o.complete(s);}return (a=o.fields)==null||a.forEach(s=>{e[s.type]!=null&&r.push(jsxRuntime.jsx(Xt,{control:t,fieldComponent:e[s.type],fieldData:s},s.id));}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r,jsxRuntime.jsx(h.Row,{justifyContent:"flex-end",children:jsxRuntime.jsx(C.Primary,{title:o.primaryButtonTitle??"Submit",onClick:n(i)})},"form-footer")]})}function Je({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(c.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Xe({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(c.Body2,{as:"label",htmlFor:o,fontWeight:"demibold",part:"field-label",children:[e,t&&" *"]})}var Ye={marginBottom:"5"},J={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function M({children:e,field:o,fieldData:t,fieldState:n}){let{id:r,label:i,placeholder:a}=t,{error:s}=n,d={id:r,...o,...a?{placeholder:a}:{},...J,"aria-invalid":!!s,value:o.value??""};return jsxRuntime.jsxs(p,{...Ye,part:"field",children:[jsxRuntime.jsx(Xe,{id:r,required:!!t.required,children:i}),e(d),jsxRuntime.jsx(Je,{error:s})]})}var tr=()=>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=ue__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(p,{as:"label",htmlFor:o,display:"flex",justifyContent:"space-between",part:"field-radio",px:4,py:2,borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"md",children:[jsxRuntime.jsx(c.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx($__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(p,{as:"button",backgroundColor:"neutral.background",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:$__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(tr,{})})})})]}));function oo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:a})=>jsxRuntime.jsx(rr,{value:a,label:i},a));return jsxRuntime.jsx(M,{...e,children:()=>jsxRuntime.jsx($__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(h.Column,{gap:2,part:"field-radio-group",children:r})})})}var sr=ue__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(y__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(p,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(y__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(c.Body2,{part:"field-select-option-label",children:e})})})}));function no(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:a,value:s})=>jsxRuntime.jsx(sr,{value:s,label:a},s));return jsxRuntime.jsx(M,{...e,children:()=>jsxRuntime.jsxs(y__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(y__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(c.Body2,{...J,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(y__namespace.Value,{placeholder:r??"Select one"}),jsxRuntime.jsx(y__namespace.Icon,{children:jsxRuntime.jsx(p,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(y__namespace.Portal,{children:jsxRuntime.jsx(y__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(p,{...J,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(y__namespace.Viewport,{children:i})})})})]})})}function so(e){return jsxRuntime.jsx(M,{...e,children:o=>jsxRuntime.jsx(c.Body2,{as:"input",part:"field-text",type:"text",...o})})}function lo(e){return jsxRuntime.jsx(M,{...e,children:o=>jsxRuntime.jsx(c.Body2,{as:"textarea",part:"field-textarea",...o})})}var ar={radio:oo,select:no,text:so,textarea:lo};function lr({fieldTypes:e={},...o}){let{FlowComponent:t}=W(o),n=Object.assign({},ar,e);return jsxRuntime.jsx(t,{children:({step:r})=>jsxRuntime.jsx(qe,{fieldTypes:n,step:r,...o})})}function oe(){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]=ue.useState(e),[n,r]=ue.useState(null),i=ue.useCallback(a=>{r(a);},[]);return ue.useLayoutEffect(()=>{if(!n)return;let a=()=>{let s=n.getBoundingClientRect();t(s);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[n]),{node:n,rect:o,ref:i}}var mr=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(p,{part:`dot-wrapper ${o}`,style:{height:"48px",position:"absolute",width:"48px",...e},...t,children:[jsxRuntime.jsx(p,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${mr}`,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 fo({props:e,alignAttr:o,sideAttr:t}){let n=t??"bottom",r={},i=()=>{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"};r[s[n]]=a;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=a:r.bottom=a:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=a:r.top=a:["top","bottom"].includes(n)?r.left=`calc(50% + ${a})`:r.top=`calc(50% + ${a})`,r}var go={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function xo(e,o){let t=Object.fromEntries(go.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(go.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let r={after:"end",before:"start"},i=(S,B)=>["top","bottom"].includes(B)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",a=t.alignOffset??0,s=t.style??{},d=t.side??"bottom",f=t.align;t.style={...s,[i(f,d)]:a};let u=["top","bottom"].includes(d)?o.width:o.height;t.alignOffset=(u+a)*-1,t.align=r[f];}return {contentProps:t,rootProps:n}}function P({anchor:e,children:o,className:t,spotlight:n=!1,style:r,...i}){let{node:a,rect:s,ref:d}=oe(),{node:f,rect:u,ref:S}=oe(),{contentProps:B,rootProps:re}=xo(i,s),[g,z]=ue.useState(B.align),[_,ne]=ue.useState(B.side),[ie,K]=ue.useState(0),[se,ae]=ue.useState(0);if(a!==null){let E=a.getAttribute("data-align"),X=a.getAttribute("data-side");g!==E&&z(E),_!==X&&ne(X);}let ge=ue.useRef(null);if(ue.useEffect(()=>{let E=document.querySelector(e);E!=null&&(S(E),ge.current=E);},[e]),ue.useEffect(()=>{let{scrollX:E,scrollY:X}=window;K(u.left+E),ae(u.top+X);},[u.left,u.top]),f==null)return null;let xe="0";typeof window<"u"&&(xe=window.getComputedStyle(f).borderRadius);let Po=fo({props:i,alignAttr:g,sideAttr:_});return jsxRuntime.jsxs(v__namespace.Root,{defaultOpen:!0,...re,children:[jsxRuntime.jsx(v__namespace.Anchor,{virtualRef:ge}),jsxRuntime.jsx(v__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:t,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[n&&jsxRuntime.jsx(p,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:xe,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:u.height,left:ie,top:se,width:u.width}}),jsxRuntime.jsx(v__namespace.Content,{asChild:!0,...B,ref:d,children:jsxRuntime.jsxs(A,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...r},children:[jsxRuntime.jsx(uo,{style:Po}),o]})})]})})]})}P.Close=e=>jsxRuntime.jsx(v__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(C.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});P.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(j,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...o});P.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(C.Primary,{title:o,onClick:e,...t});P.Progress=({children:e,...o})=>e==null?null:jsxRuntime.jsx(c.Body2,{fontWeight:"demibold",part:"progress",...o,children:e});P.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(C.Secondary,{title:o,onClick:e,...t});P.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(c.Body2,{part:"subtitle",...o,children:e});P.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(c.Body1,{fontWeight:"bold",mb:1,part:"title",...o,children:e});function bo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:n,onSecondary:r,step:i,...a}){let{handleDismiss:s}=V(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:f}=G(i,{onPrimary:n,onSecondary:r});return jsxRuntime.jsxs(P,{anchor:i.selector,onOpenAutoFocus:u=>u.preventDefault(),onPointerDownOutside:u=>u.preventDefault(),...a,children:[e&&jsxRuntime.jsx(P.Close,{onClick:s}),jsxRuntime.jsx(P.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsxRuntime.jsx(P.Title,{children:i.title}),jsxRuntime.jsx(P.Subtitle,{children:i.subtitle}),jsxRuntime.jsxs(h.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(P.Progress,{children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(P.Secondary,{marginLeft:"auto",title:i.secondaryButtonTitle,onClick:f}),jsxRuntime.jsx(P.Primary,{title:i.primaryButtonTitle,onClick:d})]})]},i.id)}function yr({flowId:e,onComplete:o,variables:t,...n}){let{flow:r}=U(e,{variables:t});V(r,{onComplete:o});let{isCurrentModal:i,removeModal:a}=q(r==null?void 0:r.id);if(ue.useEffect(()=>{!(r!=null&&r.isVisible)&&i&&a();},[r==null?void 0:r.isVisible,i]),r==null||r.isVisible===!1||!i)return null;r.start();let s=r.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(bo,{step:s,flow:r,...n})}function Pr(){let{frigade:e}=ue.useContext(O);return {frigade:e}}
47
47
 
48
- exports.Announcement = Mt;
49
- exports.Banner = Lt;
48
+ exports.Announcement = _t;
49
+ exports.Banner = jt;
50
50
  exports.Box = p;
51
- exports.Button = S;
52
- exports.Card = M;
53
- exports.Flex = y;
54
- exports.Form = er;
55
- exports.Provider = Tt;
56
- exports.Text = d;
57
- exports.Tooltip = b;
58
- exports.Tour = cr;
59
- exports.useBoundingClientRect = ee;
60
- exports.useFlow = j;
61
- exports.useFlowHandlers = A;
62
- exports.useFrigade = fr;
63
- exports.useModal = de;
64
- exports.useStepHandlers = U;
51
+ exports.Button = C;
52
+ exports.Card = A;
53
+ exports.Flex = h;
54
+ exports.Form = lr;
55
+ exports.Provider = kt;
56
+ exports.Text = c;
57
+ exports.Tooltip = P;
58
+ exports.Tour = yr;
59
+ exports.useBoundingClientRect = oe;
60
+ exports.useFlow = U;
61
+ exports.useFlowHandlers = V;
62
+ exports.useFrigade = Pr;
63
+ exports.useModal = q;
64
+ exports.useStepHandlers = G;
65
65
  //# sourceMappingURL=out.js.map
66
66
  //# sourceMappingURL=index.cjs.map