@frigade/react 2.7.6 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,34 +2,36 @@
2
2
  import { keyframes, Global, ThemeProvider } from '@emotion/react';
3
3
  import * as q from '@radix-ui/react-dialog';
4
4
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
5
- import * as Do from 'react';
5
+ import * as jo from 'react';
6
6
  import { createContext, useContext, useMemo, useCallback, useState, useEffect, useLayoutEffect, useRef, Fragment as Fragment$1 } from 'react';
7
7
  import { clsx } from 'clsx';
8
- import Sn from 'known-css-properties';
9
- import On from 'dompurify';
8
+ import Mn from 'known-css-properties';
9
+ import jn from 'dompurify';
10
10
  import { FlowType, Frigade } from '@frigade/js';
11
11
  import * as js from '@frigade/js';
12
12
  export { js as FrigadeJS };
13
- import wi from 'embla-carousel-react';
14
- import * as Ie from '@radix-ui/react-collapsible';
13
+ import Li from 'embla-carousel-react';
14
+ import * as Ve from '@radix-ui/react-collapsible';
15
+ import { useFloating, autoUpdate, useFloatingNodeId, FloatingNode, FloatingTree, offset, flip, shift, useClick, useDismiss, useFocus, useRole, useTransitionStatus, useInteractions } from '@floating-ui/react';
16
+ import * as react from '@floating-ui/react';
17
+ export { react as FloatingUI };
18
+ import { RemoveScroll } from 'react-remove-scroll';
15
19
  import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
16
- import * as Me from '@radix-ui/react-radio-group';
17
- import * as L from '@radix-ui/react-select';
18
- import * as lo from '@radix-ui/react-checkbox';
20
+ import * as _e from '@radix-ui/react-radio-group';
21
+ import * as _ from '@radix-ui/react-select';
22
+ import * as Ro from '@radix-ui/react-checkbox';
19
23
  import { createPortal } from 'react-dom';
20
- import { RemoveScroll } from 'react-remove-scroll';
21
- import { useFloating, autoUpdate, offset, flip, shift, useClick, useDismiss, useRole, useTransitionStatus, useInteractions } from '@floating-ui/react';
22
- import * as Ur from 'use-sync-external-store/shim/index.js';
23
- import * as ue from '@radix-ui/react-popover';
24
+ import * as sn from 'use-sync-external-store/shim/index.js';
25
+ import * as me from '@radix-ui/react-popover';
24
26
 
25
- var gt=Object.defineProperty,gn=Object.defineProperties;var yn=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable;var ft=(e,o,t)=>o in e?gt(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))yt.call(o,t)&&ft(e,t,o[t]);if(qe)for(var t of qe(o))xt.call(o,t)&&ft(e,t,o[t]);return e},p=(e,o)=>gn(e,yn(o));var xn=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var y=(e,o)=>{var t={};for(var r in e)yt.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&qe)for(var r of qe(e))o.indexOf(r)<0&&xt.call(e,r)&&(t[r]=e[r]);return t};var me=(e,o)=>{for(var t in o)gt(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((r,n)=>{var i=d=>{try{s(t.next(d));}catch(u){n(u);}},l=d=>{try{s(t.throw(d));}catch(u){n(u);}},s=d=>d.done?r(d.value):Promise.resolve(d.value).then(i,l);s((t=t.apply(e,o)).next());});function Be(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var bt={borderWidths:{md:"1px"}};var Ze=[5,10,20,35,50,65,80,95,98],Pt=[...Ze],Ro=[...Ze];Pt[4]=40;Ro[4]=60;var hn={blue:{h:213,s:100,l:Ze},gray:{h:220,s:10,l:Ze},green:{h:141,s:90,l:Pt},red:{h:9,s:90,l:Ro},yellow:{h:50,s:90,l:Ro}};var V={};for(let[e,{h:o,s:t,l:r}]of Object.entries(hn))V[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Ct=p(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},V),{gray100:V.gray[100],gray200:V.gray[200],gray300:V.gray[300],gray400:V.gray[400],gray500:V.gray[500],gray600:V.gray[600],gray700:V.gray[700],gray800:V.gray[800],gray900:V.gray[900],blue400:V.blue[400],blue500:V.blue[500],blue800:V.blue[800],blue900:V.blue[900],green400:V.green[400],green500:V.green[500],green800:V.green[800],red500:V.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var St={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,wt={negative:{100:c("red-100"),200:c("red-200"),300:c("red-300"),400:c("red-400"),500:c("red-500"),600:c("red-600"),700:c("red-700"),800:c("red-800"),900:c("red-900"),background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500"),active:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")},focus:{background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500")},hover:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")}},neutral:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700"),active:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},focus:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},hover:{background:c("neutral-900"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700")}},positive:{100:c("green-100"),200:c("green-200"),300:c("green-300"),400:c("green-400"),500:c("green-500"),600:c("green-600"),700:c("green-700"),800:c("green-800"),900:c("green-900"),background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500"),active:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")},focus:{background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500")},hover:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")}},primary:{100:c("blue-100"),200:c("blue-200"),300:c("blue-300"),400:c("blue-400"),500:c("blue-500"),600:c("blue-600"),700:c("blue-700"),800:c("blue-800"),900:c("blue-900"),background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500"),active:{background:c("primary-300"),border:c("primary-300"),foreground:c("white"),surface:c("primary-300")},focus:{background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500")},hover:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")}},secondary:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900"),active:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")},focus:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900")},hover:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")}}};var vt={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var bn="px",Pn=e=>typeof e=="number"?`${4*e}${bn}`:e,Cn=[-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"],Ft=Object.fromEntries(Cn.map(e=>[e,Pn(e)]));var Rt={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 Ye=p(a(p(a({},bt),{colors:a(a({},Ct),wt)}),Rt),{radii:St,shadows:vt,space:Ft});function We(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let l=`${o.length?`${o}${t}`:""}${n}`,s=e[n];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(r,We(s,l,t)):r[l]=s,r},{})}function To(e){let o=We(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Tt(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Tt(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var ko=To(Ye),O=Tt(Ye);var wn=new Set(["alt","size","src"]),vn=Sn.all.filter(e=>e.indexOf("-")!=0&&!wn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Fn=Object.fromEntries(vn),Qe=We(O.colors),Rn={color:Qe,backgroundColor:Qe,borderColor:Qe,border:a(a({},O.borderWidths),Qe),borderRadius:O.radii,borderWidth:O.borderWidths,boxShadow:O.shadows,fontFamily:O.fontFamilies,fontSize:O.fontSizes,fontWeight:O.fontWeights,gap:O.space,lineHeight:O.lineHeights,margin:O.space,marginBottom:O.space,marginLeft:O.space,marginRight:O.space,marginTop:O.space,padding:O.space,paddingBottom:O.space,paddingLeft:O.space,paddingRight:O.space,paddingTop:O.space},kt=a(a({},Fn),Rn),Bt={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"]},Et=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Tn(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 Ot=new Map(Object.entries(kt).map(([e,o])=>[e,Tn(o)])),kn=new Map(Object.entries(Bt).map(([e,o])=>[e,new Set(o)])),Bn=new Set(["height","width"]),En=new Set(["canvas","embed","iframe","img","input","object","video"]);function Dt(e){let[o,t]=e.split(":");return [o,Et.has(t)?t:null]}function It(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let s=`&:${i.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return r[s]==null&&(r[s]={}),r[s]}return Object.entries(t).forEach(([i,l])=>{let[s,d]=Dt(i),u=kn.get(s);u!=null&&(u.forEach(m=>{let f=`${m}${d?":"+d:""}`;t[f]=l;}),delete t[i]);}),Object.entries(t).forEach(([i,l])=>{let[s,d]=Dt(i),u=Ot.get(s);if(u!=null){if(l==null)delete t[i];else if(typeof l=="string"&&l.indexOf(" ")>-1){let m=l.split(" ");n(d)[s]=m.map(f=>{var g;return (g=u.get(f.toString()))!=null?g:f}).join(" ");}else u.has(l.toString())?n(d)[s]=u.get(l.toString()):n(d)[s]=l;(typeof o!="string"||!En.has(o)||!Bn.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let l=i.substring(1);i.indexOf("_")===0&&Ot.has(l)&&(t[l]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Dn(){if(typeof window=="undefined"){let{JSDOM:e}=xn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ht(e){return e?{__html:On(Dn()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Hn(e){return e&&`fr-${e}`}function At(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>At(o)).join(" "):Hn(e))}function $n(s,l){var d=s,{as:e,children:o,className:t,css:r={},part:n}=d,i=y(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:m,unmatchedProps:f}=It(i,u),g=At(n),C=t||g?clsx(t,g):void 0,T=[{boxSizing:"border-box"},m,r];return typeof o=="string"?jsx(u,p(a({className:C,css:T},f),{ref:l,dangerouslySetInnerHTML:Ht(o)})):jsx(u,p(a({className:C,css:T},f),{ref:l,children:o}))}var x=Do.forwardRef($n);var D={};me(D,{Link:()=>di,Plain:()=>ci,Primary:()=>li,Secondary:()=>pi});var R={};me(R,{Body1:()=>Yn,Body2:()=>Qn,Caption:()=>ei,Display1:()=>Kn,Display2:()=>jn,H1:()=>Xn,H2:()=>Jn,H3:()=>qn,H4:()=>Zn});var Bo={};me(Bo,{Body1:()=>_n,Body2:()=>zn,Caption:()=>Un,Display1:()=>Mn,Display2:()=>An,H1:()=>Vn,H2:()=>Ln,H3:()=>Wn,H4:()=>Nn});var fe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Mn=p(a({},fe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),An=p(a({},fe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Vn=p(a({},fe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Ln=p(a({},fe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Wn=p(a({},fe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Nn=p(a({},fe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),_n=p(a({},fe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),zn=p(a({},fe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Un=p(a({},fe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Gn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ge=Object.fromEntries(Gn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Do.forwardRef((s,l)=>{var d=s,{as:r=o,children:n}=d,i=y(d,["as","children"]);return jsx(x,p(a(a({as:r},Bo[e]),i),{ref:l,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Kn=ge.Display1,jn=ge.Display2,Xn=ge.H1,Jn=ge.H2,qn=ge.H3,Zn=ge.H4,Yn=ge.Body1,Qn=ge.Body2,ei=ge.Caption;var Oo={};me(Oo,{Link:()=>ii,Plain:()=>ai,Primary:()=>ri,Secondary:()=>ni,loadingCSSStyle:()=>Eo});var eo={alignItems:"center",borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit","opacity:disabled":"0.6","pointerEvents:disabled":"none"},ri=p(a({},eo),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:active":"primary.active.surface","backgroundColor:disabled":"primary.surface"}),ni=p(a({},eo),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:active":"secondary.active.surface","backgroundColor:disabled":"secondary.background"}),ii=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),ai=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),si=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Eo={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:si+" 1s ease infinite"}};function oo(l){var s=l,{as:e,children:o,part:t,title:r,variant:n="Primary"}=s,i=y(s,["as","children","part","title","variant"]);var u;let d=n.toLocaleLowerCase();return jsxs(x,p(a(p(a({as:e!=null?e:"button",part:[`button-${d}`,t]},Oo[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?Eo:{})}),i),{loading:void 0,children:[o,r&&jsx(R.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function li(t){var r=t,{children:e}=r,o=y(r,["children"]);return jsx(oo,p(a({},o),{variant:"Primary",children:e}))}function pi(t){var r=t,{children:e}=r,o=y(r,["children"]);return jsx(oo,p(a({},o),{variant:"Secondary",children:e}))}function di(t){var r=t,{children:e}=r,o=y(r,["children"]);return jsx(oo,p(a({},o),{variant:"Link",children:e}))}function ci(t){var r=t,{children:e}=r,o=y(r,["children"]);return jsx(oo,p(a({},o),{variant:"Plain",children:e}))}var F={};me(F,{Column:()=>fi,Row:()=>mi});var mi=Do.forwardRef((e,o)=>jsx(x,p(a({display:"flex",flexDirection:"row"},e),{ref:o}))),fi=Do.forwardRef((e,o)=>jsx(x,p(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Io(r){var n=r,{flowId:e,part:o}=n,t=y(n,["flowId","part"]);return jsx(z,p(a({alignItems:"center","aria-label":"Banner",as:P,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"flex-start",part:["banner",o],role:"complementary"},t),{children:({handleDismiss:i,handlePrimary:l,handleSecondary:s,parentProps:{dismissible:d},step:u})=>{var C,T,h,S;let m=(T=(C=u.primaryButton)==null?void 0:C.title)!=null?T:u.primaryButtonTitle,f=(S=(h=u.secondaryButton)==null?void 0:h.title)!=null?S:u.secondaryButtonTitle,g=u.$state.blocked;return jsxs(Fragment,{children:[u.imageUri&&jsx(x,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(F.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(P.Title,{part:"title",children:u.title}),jsx(P.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(P.Secondary,{disabled:g,title:f,onClick:s}),jsx(P.Primary,{disabled:g,title:m,onClick:l}),d&&jsx(P.Dismiss,{onClick:i})]})}}))}var io={};me(io,{Carousel:()=>rr,Collapsible:()=>no,CollapsibleStep:()=>ze});var ve={};me(ve,{Bar:()=>Ee,Dots:()=>zt,Fraction:()=>Oe,Segments:()=>to});function Ee(r){var n=r,{current:e,total:o}=n,t=y(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,l=i===0?"10px":`${100*i}%`;return jsx(x,p(a({"aria-description":"Progress represented as a bar","aria-label":"Progress Bar","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,backgroundColor:"neutral.800",borderRadius:"md",height:"10px",part:"progress-bar",role:"meter"},t),{children:jsx(x,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function zt(r){var n=r,{current:e,total:o}=n,t=y(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((l,s)=>jsx(x,{as:"circle",cx:4+16*s,cy:"4px",fill:e-1===s?O.colors.blue500:O.colors.blue800,part:["progress-dot",e-1===s?"progress-dot-filled":null],r:4},s));return jsx(x,p(a({"aria-description":"Progress represented as dots","aria-label":"Progress Dots","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,as:"svg",height:"8px",part:"progress-dots",role:"meter",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function Oe(r){var n=r,{current:e,total:o}=n,t=y(n,["current","total"]);return jsx(R.Body2,p(a({"aria-description":"Progress represented as a fraction of a total","aria-label":"Progress Fraction","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,part:"progress-fraction",role:"meter"},t),{children:`${e}/${o}`}))}function to(r){var n=r,{current:e,total:o}=n,t=y(n,["current","total"]);let i=[...Array(o)].map((l,s)=>jsx(x,{backgroundColor:e-1>=s?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%",minWidth:"10px",part:["progress-segment",e-1===s?"progress-segment-filled":null]},s));return jsx(F.Row,p(a({"aria-description":"Progress represented as a segmented bar","aria-label":"Progress Segments","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,gap:1,height:"10px",part:"progress-segments",role:"meter"},t),{children:i}))}function Kt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function xi(){return jsx(x,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function jt(t){var r=t,{checked:e=!1}=r,o=y(r,["checked"]);return jsx(x,p(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(x,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(xi,{})})}))}function ye(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(M),n=useMemo(()=>e==null?{}:{"flow.back":i=>e.flow.back(i),"flow.complete":i=>e.flow.complete(i),"flow.forward":i=>e.flow.forward(i),"flow.restart":()=>e.flow.restart(),"flow.skip":i=>e.flow.skip(i),"flow.start":i=>e.flow.start(i),"step.complete":(i,l)=>e.complete(i,l),"step.skip":(i,l)=>e.skip(i,l),"step.reset":()=>e.reset(),"step.start":i=>e.start(i)},[e]);return {handlePrimary:useCallback((i,l,s=!0)=>A(this,null,function*(){if((yield o==null?void 0:o(e,i,l))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?yield u(l,s):u!==!1&&(yield e.complete(l,s)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[r,o,e,n]),handleSecondary:useCallback((i,l)=>A(this,null,function*(){if((yield t==null?void 0:t(e,i,l))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(l),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[r,t,e,n])}}function Jt({onPrimary:e,onSecondary:o,step:t}){var u,m;let{handlePrimary:r,handleSecondary:n}=ye(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:l,skipped:s}=t.$state,d=l||s||!i?jsx(jt,{checked:l||s,marginLeft:"auto"}):jsx(x,{as:Kt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(P,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:i,opacity:i?.5:1,children:[jsxs(F.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(P.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(P.Title,{children:t.title}),jsx(P.Subtitle,{children:t.subtitle}),jsxs(F.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(P.Secondary,{disabled:i,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(P.Primary,{disabled:i,onClick:r,title:(m=t.primaryButton)==null?void 0:m.title})]})]})}function Zt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Qt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var er=keyframes`
27
+ var It=Object.defineProperty,En=Object.defineProperties;var In=Object.getOwnPropertyDescriptors;var ao=Object.getOwnPropertySymbols;var Dt=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable;var Et=(e,o,t)=>o in e?It(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Dt.call(o,t)&&Et(e,t,o[t]);if(ao)for(var t of ao(o))Ht.call(o,t)&&Et(e,t,o[t]);return e},p=(e,o)=>En(e,In(o));var Dn=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var r in e)Dt.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&ao)for(var r of ao(e))o.indexOf(r)<0&&Ht.call(e,r)&&(t[r]=e[r]);return t};var ue=(e,o)=>{for(var t in o)It(e,t,{get:o[t],enumerable:!0});};var V=(e,o,t)=>new Promise((r,n)=>{var i=d=>{try{s(t.next(d));}catch(u){n(u);}},l=d=>{try{s(t.throw(d));}catch(u){n(u);}},s=d=>d.done?r(d.value):Promise.resolve(d.value).then(i,l);s((t=t.apply(e,o)).next());});function Ie(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var $t={borderWidths:{md:"1px"}};var so=[5,10,20,35,50,65,80,95,98],At=[...so],No=[...so];At[4]=40;No[4]=60;var Hn={blue:{h:213,s:100,l:so},gray:{h:220,s:10,l:so},green:{h:141,s:90,l:At},red:{h:9,s:90,l:No},yellow:{h:50,s:90,l:No}};var W={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Hn))W[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Mt=p(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.green[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Wt={md:"8px",lg:"20px",round:"50%"};var m=e=>`var(--fr-colors-${e})`,Lt={negative:{100:m("red-100"),200:m("red-200"),300:m("red-300"),400:m("red-400"),500:m("red-500"),600:m("red-600"),700:m("red-700"),800:m("red-800"),900:m("red-900"),background:m("negative-500"),border:m("negative-500"),foreground:m("white"),surface:m("negative-500"),active:{background:m("negative-400"),border:m("negative-400"),foreground:m("white"),surface:m("negative-400")},focus:{background:m("negative-500"),border:m("negative-500"),foreground:m("white"),surface:m("negative-500")},hover:{background:m("negative-400"),border:m("negative-400"),foreground:m("white"),surface:m("negative-400")}},neutral:{100:m("gray-100"),200:m("gray-200"),300:m("gray-300"),400:m("gray-400"),500:m("gray-500"),600:m("gray-600"),700:m("gray-700"),800:m("gray-800"),900:m("gray-900"),background:m("white"),border:m("neutral-800"),foreground:m("black"),surface:m("neutral-700"),active:{background:m("white"),border:m("neutral-900"),foreground:m("black"),surface:m("neutral-700")},focus:{background:m("white"),border:m("neutral-900"),foreground:m("black"),surface:m("neutral-700")},hover:{background:m("neutral-900"),border:m("neutral-800"),foreground:m("black"),surface:m("neutral-700")}},positive:{100:m("green-100"),200:m("green-200"),300:m("green-300"),400:m("green-400"),500:m("green-500"),600:m("green-600"),700:m("green-700"),800:m("green-800"),900:m("green-900"),background:m("positive-500"),border:m("positive-500"),foreground:m("white"),surface:m("positive-500"),active:{background:m("positive-400"),border:m("positive-400"),foreground:m("white"),surface:m("positive-400")},focus:{background:m("positive-500"),border:m("positive-500"),foreground:m("white"),surface:m("positive-500")},hover:{background:m("positive-400"),border:m("positive-400"),foreground:m("white"),surface:m("positive-400")}},primary:{100:m("blue-100"),200:m("blue-200"),300:m("blue-300"),400:m("blue-400"),500:m("blue-500"),600:m("blue-600"),700:m("blue-700"),800:m("blue-800"),900:m("blue-900"),background:m("primary-500"),border:m("primary-500"),foreground:m("white"),surface:m("primary-500"),active:{background:m("primary-300"),border:m("primary-300"),foreground:m("white"),surface:m("primary-300")},focus:{background:m("primary-500"),border:m("primary-500"),foreground:m("white"),surface:m("primary-500")},hover:{background:m("primary-400"),border:m("primary-400"),foreground:m("white"),surface:m("primary-400")}},secondary:{100:m("gray-100"),200:m("gray-200"),300:m("gray-300"),400:m("gray-400"),500:m("gray-500"),600:m("gray-600"),700:m("gray-700"),800:m("gray-800"),900:m("gray-900"),background:m("white"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-900"),active:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-800")},focus:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-900")},hover:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-800")}}};var Nt={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Vn="px",$n=e=>typeof e=="number"?`${4*e}${Vn}`:e,An=[-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"],_t=Object.fromEntries(An.map(e=>[e,$n(e)]));var Ut={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 lo=p(a(p(a({},$t),{colors:a(a({},Mt),Lt)}),Ut),{radii:Wt,shadows:Nt,space:_t});function Ke(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let l=`${o.length?`${o}${t}`:""}${n}`,s=e[n];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(r,Ke(s,l,t)):r[l]=s,r},{})}function _o(e){let o=Ke(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function zt(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=zt(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var Uo=_o(lo),E=zt(lo);var Wn=new Set(["alt","size","src"]),Ln=Mn.all.filter(e=>e.indexOf("-")!=0&&!Wn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Nn=Object.fromEntries(Ln),po=Ke(E.colors),_n={color:po,backgroundColor:po,borderColor:po,border:a(a({},E.borderWidths),po),borderRadius:E.radii,borderWidth:E.borderWidths,boxShadow:E.shadows,fontFamily:E.fontFamilies,fontSize:E.fontSizes,fontWeight:E.fontWeights,gap:E.space,lineHeight:E.lineHeights,margin:E.space,marginBottom:E.space,marginLeft:E.space,marginRight:E.space,marginTop:E.space,padding:E.space,paddingBottom:E.space,paddingLeft:E.space,paddingRight:E.space,paddingTop:E.space},Gt=a(a({},Nn),_n),Kt={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"]},jt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Un(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 Xt=new Map(Object.entries(Gt).map(([e,o])=>[e,Un(o)])),zn=new Map(Object.entries(Kt).map(([e,o])=>[e,new Set(o)])),Gn=new Set(["height","width"]),Kn=new Set(["canvas","embed","iframe","img","input","object","video"]);function Jt(e){let[o,t]=e.split(":");return [o,jt.has(t)?t:null]}function qt(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let s=`&:${i.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return r[s]==null&&(r[s]={}),r[s]}return Object.entries(t).forEach(([i,l])=>{let[s,d]=Jt(i),u=zn.get(s);u!=null&&(u.forEach(c=>{let g=`${c}${d?":"+d:""}`;t[g]=l;}),delete t[i]);}),Object.entries(t).forEach(([i,l])=>{let[s,d]=Jt(i),u=Xt.get(s);if(u!=null){if(l==null)delete t[i];else if(typeof l=="string"&&l.indexOf(" ")>-1){let c=l.split(" ");n(d)[s]=c.map(g=>{var y;return (y=u.get(g.toString()))!=null?y:g}).join(" ");}else u.has(l.toString())?n(d)[s]=u.get(l.toString()):n(d)[s]=l;(typeof o!="string"||!Kn.has(o)||!Gn.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let l=i.substring(1);i.indexOf("_")===0&&Xt.has(l)&&(t[l]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Xn(){if(typeof window=="undefined"){let{JSDOM:e}=Dn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Zt(e){return e?{__html:jn(Xn()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function qn(e){return e&&`fr-${e}`}function er(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>er(o)).join(" "):qn(e))}function Zn(s,l){var d=s,{as:e,children:o,className:t,css:r={},part:n}=d,i=f(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:c,unmatchedProps:g}=qt(i,u),y=er(n),P=t||y?clsx(t,y):void 0,w=[{boxSizing:"border-box"},c,r];return typeof o=="string"?jsx(u,p(a({className:P,css:w},g),{ref:l,dangerouslySetInnerHTML:Zt(o)})):jsx(u,p(a({className:P,css:w},g),{ref:l,children:o}))}var x=jo.forwardRef(Zn);var D={};ue(D,{Link:()=>Ri,Plain:()=>Ti,Primary:()=>wi,Secondary:()=>Fi});var T={};ue(T,{Body1:()=>fi,Body2:()=>gi,Caption:()=>yi,Display1:()=>li,Display2:()=>pi,H1:()=>di,H2:()=>ci,H3:()=>ui,H4:()=>mi});var zo={};ue(zo,{Body1:()=>ni,Body2:()=>ii,Caption:()=>ai,Display1:()=>Yn,Display2:()=>Qn,H1:()=>ei,H2:()=>oi,H3:()=>ti,H4:()=>ri});var fe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Yn=p(a({},fe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Qn=p(a({},fe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),ei=p(a({},fe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),oi=p(a({},fe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),ti=p(a({},fe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),ri=p(a({},fe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),ni=p(a({},fe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),ii=p(a({},fe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),ai=p(a({},fe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var si=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ge=Object.fromEntries(si.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=jo.forwardRef((s,l)=>{var d=s,{as:r=o,children:n}=d,i=f(d,["as","children"]);return jsx(x,p(a(a({as:r},zo[e]),i),{ref:l,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),li=ge.Display1,pi=ge.Display2,di=ge.H1,ci=ge.H2,ui=ge.H3,mi=ge.H4,fi=ge.Body1,gi=ge.Body2,yi=ge.Caption;var Ko={};ue(Ko,{Link:()=>Ci,Plain:()=>Si,Primary:()=>bi,Secondary:()=>Pi,loadingCSSStyle:()=>Go});var co={alignItems:"center",borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit","opacity:disabled":"0.6","pointerEvents:disabled":"none"},bi=p(a({},co),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:active":"primary.active.surface","backgroundColor:disabled":"primary.surface"}),Pi=p(a({},co),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:active":"secondary.active.surface","backgroundColor:disabled":"secondary.background"}),Ci=p(a({},co),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),Si=p(a({},co),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),vi=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Go={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:vi+" 1s ease infinite"}};function uo(l){var s=l,{as:e,children:o,part:t,title:r,variant:n="Primary"}=s,i=f(s,["as","children","part","title","variant"]);var u;let d=n.toLocaleLowerCase();return jsxs(x,p(a(p(a({as:e!=null?e:"button",part:[`button-${d}`,t]},Ko[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?Go:{})}),i),{loading:void 0,children:[o,r&&jsx(T.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function wi(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(uo,p(a({},o),{variant:"Primary",children:e}))}function Fi(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(uo,p(a({},o),{variant:"Secondary",children:e}))}function Ri(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(uo,p(a({},o),{variant:"Link",children:e}))}function Ti(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(uo,p(a({},o),{variant:"Plain",children:e}))}var R={};ue(R,{Column:()=>Oi,Row:()=>Bi});var Bi=jo.forwardRef((e,o)=>jsx(x,p(a({display:"flex",flexDirection:"row"},e),{ref:o}))),Oi=jo.forwardRef((e,o)=>jsx(x,p(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Xo(r){var n=r,{flowId:e,part:o}=n,t=f(n,["flowId","part"]);return jsx(L,p(a({alignItems:"center","aria-label":"Banner",as:b,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"flex-start",part:["banner",o],role:"complementary"},t),{children:({handleDismiss:i,handlePrimary:l,handleSecondary:s,parentProps:{dismissible:d},step:u})=>{var P,w,h,S;let c=(w=(P=u.primaryButton)==null?void 0:P.title)!=null?w:u.primaryButtonTitle,g=(S=(h=u.secondaryButton)==null?void 0:h.title)!=null?S:u.secondaryButtonTitle,y=u.$state.blocked;return jsxs(Fragment,{children:[u.imageUri&&jsx(x,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(R.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:u.title}),jsx(b.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(b.Secondary,{disabled:y,title:g,onClick:s}),jsx(b.Primary,{disabled:y,title:c,onClick:l}),d&&jsx(b.Dismiss,{onClick:i})]})}}))}var vo={};ue(vo,{Carousel:()=>br,Collapsible:()=>xo,CollapsibleStep:()=>Je,Floating:()=>Hr});var be={};ue(be,{Bar:()=>he,Dots:()=>ar,Fraction:()=>De,Ring:()=>mo,Segments:()=>fo});function he(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,l=i===0?"10px":`${100*i}%`;return jsx(x,p(a({"aria-description":"Progress represented as a bar","aria-label":"Progress Bar","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,backgroundColor:"neutral.800",borderRadius:"md",height:"10px",part:"progress-bar",role:"meter"},t),{children:jsx(x,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function ar(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((l,s)=>jsx(x,{as:"circle",cx:4+16*s,cy:"4px",fill:e-1===s?E.colors.blue500:E.colors.blue800,part:["progress-dot",e-1===s?"progress-dot-filled":null],r:4},s));return jsx(x,p(a({"aria-description":"Progress represented as dots","aria-label":"Progress Dots","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,as:"svg",height:"8px",part:"progress-dots",role:"meter",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function De(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);return jsx(T.Body2,p(a({"aria-description":"Progress represented as a fraction of a total","aria-label":"Progress Fraction","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,part:"progress-fraction",role:"meter"},t),{children:`${e}/${o}`}))}function mo(d){var u=d,{css:e,current:o,height:t="48px",showLabel:r=!1,strokeWidth:n="8px",total:i,width:l="48px"}=u,s=f(u,["css","current","height","showLabel","strokeWidth","total","width"]);if(i==1)return null;let c=i>0?Math.min(Math.round(o/i*100)/100,1):0;return jsxs(x,p(a({"aria-description":"Progress represented as a ring","aria-label":"Progress Ring","aria-valuemin":"0","aria-valuemax":i,"aria-valuenow":o,as:"svg",css:a({"--progress-percent":c,"--radius":`calc((min(${t}, ${l}) - ${n}) / 2)`,"--circumference":"calc(var(--radius) * pi * 2)","--dash-length":"calc(var(--circumference) * var(--progress-percent))","--gap-length":"calc(var(--circumference) - var(--dash-length))"},e),height:t,part:"progress-ring",position:"relative",role:"meter",width:l},s),{children:[jsx(x,{as:"circle",cx:"50%",cy:"50%",fill:"transparent",part:"progress-ring-track",r:"var(--radius)",stroke:E.colors.primary[800],strokeWidth:n}),jsx(x,{as:"circle",cx:"50%",cy:"50%",fill:"transparent",part:"progress-ring-filled",r:"var(--radius)",stroke:E.colors.primary.surface,strokeWidth:n,style:{strokeDasharray:"var(--dash-length) var(--gap-length)"},transform:"rotate(-90deg)",transformOrigin:"50% 50%",transition:"stroke-dasharray 0.2s ease-out"}),r&&jsx(T.Caption,{as:"text",dominantBaseline:"middle",fontWeight:"medium",textAnchor:"middle",_x:"50%",_y:"52%",children:c*100})]}))}function fo(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((l,s)=>jsx(x,{backgroundColor:e-1>=s?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%",minWidth:"10px",part:["progress-segment",e-1===s?"progress-segment-filled":null]},s));return jsx(R.Row,p(a({"aria-description":"Progress represented as a segmented bar","aria-label":"Progress Segments","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,gap:1,height:"10px",part:"progress-segments",role:"meter"},t),{children:i}))}function pr(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function Hi(){return jsx(x,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function go(r){var n=r,{checked:e=!1,size:o="22px"}=n,t=f(n,["checked","size"]);return jsx(x,p(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:o,width:o},t),{children:e&&jsx(x,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Hi,{})})}))}function ae(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(A),n=useMemo(()=>e==null?{}:{"flow.back":i=>e.flow.back(i),"flow.complete":i=>e.flow.complete(i),"flow.forward":i=>e.flow.forward(i),"flow.restart":()=>e.flow.restart(),"flow.skip":i=>e.flow.skip(i),"flow.start":i=>e.flow.start(i),"step.complete":(i,l)=>e.complete(i,l),"step.skip":(i,l)=>e.skip(i,l),"step.reset":()=>e.reset(),"step.start":i=>e.start(i)},[e]);return {handlePrimary:useCallback((i,l,s=!0)=>V(this,null,function*(){if((yield o==null?void 0:o(e,i,l))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?yield u(l,s):u!==!1&&(yield e.complete(l,s)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[r,o,e,n]),handleSecondary:useCallback((i,l)=>V(this,null,function*(){if((yield t==null?void 0:t(e,i,l))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(l),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[r,t,e,n])}}function cr({onPrimary:e,onSecondary:o,step:t}){var u,c;let{handlePrimary:r,handleSecondary:n}=ae(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:l,skipped:s}=t.$state,d=l||s||!i?jsx(go,{checked:l||s,marginLeft:"auto"}):jsx(x,{as:pr,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:i,opacity:i?.5:1,children:[jsxs(R.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(R.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(b.Secondary,{disabled:i,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(b.Primary,{disabled:i,onClick:r,title:(c=t.primaryButton)==null?void 0:c.title})]})]})}function mr(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function gr(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var yr=keyframes`
26
28
  from {
27
29
  opacity: 0;
28
30
  }
29
31
  to {
30
32
  opacity: 1;
31
33
  }
32
- `;function or({flow:e,sort:o,onPrimary:t,onSecondary:r}){var h,S;let[n,i]=useState(),[l]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(S=(h=Array.from(e.steps.values()).find(w=>!w.$state.completed&&!w.$state.skipped))==null?void 0:h.order)!=null?S:0}),[s,d]=wi(l),[u,m]=useState(),[f,g]=useState();useLayoutEffect(()=>{d&&(u==null&&m(d.canScrollNext()),f==null&&g(d.canScrollPrev()),d.on("select",()=>{m(d.canScrollNext()),g(d.canScrollPrev());}));},[d,u,f]),useEffect(()=>{if(!n){let w=Array.from(e.steps.values()),B=w.filter(b=>b.$state.completed||b.$state.skipped).sort((b,k)=>b.order-k.order),E=w.filter(b=>!b.$state.completed&&!b.$state.skipped).sort((b,k)=>b.order-k.order);i(o==="completed-last"?[...E,...B].map(b=>b.id):w.map(b=>b.id));}},[e.steps,o,n]);let C=e.getNumberOfCompletedSteps(),T=e.getNumberOfAvailableSteps();return n?jsxs(Fragment,{children:[jsxs(F.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:O.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(F.Column,{part:"carousel-header-content",children:[jsx(R.H3,{children:e.title}),jsx(R.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(F.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(R.Body2,{fontWeight:"demibold",part:"progress-text",children:[C,"/",T]}),jsx(Ee,{current:C,total:T,minWidth:"200px"})]})]}),jsxs(x,{margin:`0 ${O.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsx(F.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(w=>w.$state.visible).sort((w,B)=>n.indexOf(w.id)-n.indexOf(B.id)).map(w=>jsx(Jt,{onPrimary:t,onSecondary:r,step:w},w.id))}),f&&jsx(F.Column,{animation:`${er} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(Qt,{height:"24px",width:"24px"})})}),u&&jsx(F.Column,{animation:`${er} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(Zt,{height:"24px",width:"24px"})})})]})]}):null}function rr(o){var e=y(o,[]);return jsx(z,p(a({as:P,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(or,a(a({},e),t))}))}var ze={};me(ze,{Content:()=>Mo,Root:()=>Ao,Trigger:()=>Vo});function ir(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var Fi=keyframes`
34
+ `;function xr({flow:e,sort:o,onPrimary:t,onSecondary:r}){var h,S;let[n,i]=useState(),[l]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(S=(h=Array.from(e.steps.values()).find(v=>!v.$state.completed&&!v.$state.skipped))==null?void 0:h.order)!=null?S:0}),[s,d]=Li(l),[u,c]=useState(),[g,y]=useState();useLayoutEffect(()=>{d&&(u==null&&c(d.canScrollNext()),g==null&&y(d.canScrollPrev()),d.on("select",()=>{c(d.canScrollNext()),y(d.canScrollPrev());}));},[d,u,g]),useEffect(()=>{if(!n){let v=Array.from(e.steps.values()),k=v.filter(C=>C.$state.completed||C.$state.skipped).sort((C,B)=>C.order-B.order),O=v.filter(C=>!C.$state.completed&&!C.$state.skipped).sort((C,B)=>C.order-B.order);i(o==="completed-last"?[...O,...k].map(C=>C.id):v.map(C=>C.id));}},[e.steps,o,n]);let P=e.getNumberOfCompletedSteps(),w=e.getNumberOfAvailableSteps();return n?jsxs(Fragment,{children:[jsxs(R.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:E.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(R.Column,{part:"carousel-header-content",children:[jsx(T.H3,{children:e.title}),jsx(T.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(R.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(T.Body2,{fontWeight:"demibold",part:"progress-text",children:[P,"/",w]}),jsx(he,{current:P,total:w,minWidth:"200px"})]})]}),jsxs(x,{margin:`0 ${E.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsx(R.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(v=>v.$state.visible).sort((v,k)=>n.indexOf(v.id)-n.indexOf(k.id)).map(v=>jsx(cr,{onPrimary:t,onSecondary:r,step:v},v.id))}),g&&jsx(R.Column,{animation:`${yr} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(gr,{height:"24px",width:"24px"})})}),u&&jsx(R.Column,{animation:`${yr} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(mr,{height:"24px",width:"24px"})})})]})]}):null}function br(o){var e=f(o,[]);return jsx(L,p(a({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(xr,a(a({},e),t))}))}var Je={};ue(Je,{Content:()=>Yo,Root:()=>Qo,Trigger:()=>et});function Cr(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var _i=keyframes`
33
35
  from {
34
36
  height: 0;
35
37
  opacity: 0;
@@ -38,7 +40,7 @@ var gt=Object.defineProperty,gn=Object.defineProperties;var yn=Object.getOwnProp
38
40
  height: var(--radix-collapsible-content-height);
39
41
  opacity: 1;
40
42
  }
41
- `,Ri=keyframes`
43
+ `,Ui=keyframes`
42
44
  from {
43
45
  height: var(--radix-collapsible-content-height);
44
46
  opacity: 1;
@@ -47,14 +49,14 @@ var gt=Object.defineProperty,gn=Object.defineProperties;var yn=Object.getOwnProp
47
49
  height: 0;
48
50
  opacity: 0;
49
51
  }
50
- `,Ti=()=>jsx(x,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function ki({checked:e=!1}){return jsx(x,{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&&jsx(x,{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:jsx(Ti,{})})})}function Mo({children:e}){return jsx(Ie.Content,{asChild:!0,children:jsxs(F.Column,{css:{'&[data-state="open"]':{animation:`${Fi} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Ri} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(x,{}),e]})})}function Ao(i){var l=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=l,n=y(l,["children","disabled","onOpenChange","open"]);return jsx(Ie.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(P,p(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function Vo({isCompleted:e,isBlocked:o,title:t}){return jsx(Ie.Trigger,{asChild:!0,children:jsxs(F.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(F.Row,{alignItems:"center",gap:2,children:[jsx(ki,{checked:e}),jsx(R.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(x,{as:ir,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Bi=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function ce(e){let o={},t={};for(let[r,n]of Object.entries(e))Bi.some(i=>i===r)?o[r]=n:t[r]=n;return {otherProps:t,videoProps:o}}var sr=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function lr({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,S,w,B,E,b;let{$state:{blocked:i,completed:l,skipped:s},subtitle:d,title:u}=n,m=(S=(h=n.primaryButton)==null?void 0:h.title)!=null?S:n.primaryButtonTitle,f=(B=(w=n.secondaryButton)==null?void 0:w.title)!=null?B:n.secondaryButtonTitle,g=(E=n.props)!=null?E:{},C=!!i,{videoProps:T}=ce(g);return jsxs(Ao,p(a({open:t,onOpenChange:r},g),{children:[jsx(Vo,{isBlocked:n.$state.blocked,isCompleted:l||s,title:u}),jsxs(Mo,{children:[jsx(P.Media,a({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(b=n.videoUri)!=null?b:n.imageUri,transform:"translate3d(0, 0, 1px)",type:n.videoUri?"video":"image"},T)),jsx(P.Subtitle,{color:"neutral.400",children:d}),jsxs(F.Row,{gap:3,part:"collapsible-footer",children:[jsx(P.Secondary,{title:f,onClick:o}),jsx(P.Primary,{disabled:C,title:m,onClick:e})]})]})]}))}var Ii={default:lr};function Hi(r){var n=r,{flow:e,step:o}=n,t=y(n,["flow","step"]);var h;let{onPrimary:i,onSecondary:l,openStepId:s,setOpenStepId:d,stepTypes:u}=useContext(sr),{handlePrimary:m,handleSecondary:f}=ye(o,{onPrimary:i,onSecondary:l}),g=(s!=null?s:e.getCurrentStep().id)===o.id,C=(h=u[o.type])!=null?h:lr;function T(S){return A(this,null,function*(){d(S?o.id:""),S&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(C,p(a({flow:e,onOpenChange:T,open:g,step:o},t),{handlePrimary:m,handleSecondary:f}),o.id)}function no(l){var s=l,{flowId:e,onPrimary:o,onSecondary:t,part:r,stepTypes:n={}}=s,i=y(s,["flowId","onPrimary","onSecondary","part","stepTypes"]);let[d,u]=useState(null),m=a(a({},Ii),n);return jsx(sr.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:m},children:jsx(z,p(a({as:P,borderWidth:"md",flowId:e,part:["checklist",r]},i),{children:T=>{var h=T,{flow:f,handleDismiss:g}=h,C=y(h,["flow","handleDismiss"]);var k;let w=Array.from(f.steps.entries()).filter(([,v])=>v.$state.visible===!0).map(([,v])=>jsx(Hi,p(a({flow:f,handleDismiss:g},C),{step:v}),v.id)),B=f.getNumberOfCompletedSteps(),E=f.getNumberOfAvailableSteps(),b=i.dismissible||!!((k=f==null?void 0:f.props)!=null&&k.dismissible);return jsxs(Fragment,{children:[jsxs(F.Column,{gap:2,children:[jsx(P.Header,{dismissible:b,handleDismiss:g,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxs(F.Row,{alignItems:"center",gap:2,children:[jsxs(R.Body2,{fontWeight:"demibold",children:[B,"/",E]}),jsx(Ee,{current:B,total:E,flexGrow:1})]})]}),w]})}}))})}var zi=new Set(["required","min","max","minLength","maxLength","pattern"]);function Ui({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=useFormContext();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(([s])=>zi.has(s))),l=useController({name:t.id,control:o,rules:i});return jsx(e,p(a({},l),{fieldData:t,formContext:n,submit:r}))}function dr({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var B,E,b,k;let{__readOnly:l}=useContext(M),s=useMemo(()=>{var v,I;return (I=(v=i.fields)==null?void 0:v.filter(H=>e[H.type]!=null&&H.id))!=null?I:[]},[i.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:s.reduce((v,I)=>{var H;return v[I.id]=(H=I.value)!=null?H:"",v},{})});useEffect(()=>{d.formState.isDirty||d.reset(s.reduce((v,I)=>{var H;return v[I.id]=(H=I.value)!=null?H:"",v},{}));},[s,d]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(v=>s.some(I=>I.id===v))&&d.trigger();},[s,d,i.id]);let[u,m]=useState(!1),f=[],{control:g,handleSubmit:C}=d;function T(v,I){m(!0),t(I,v,l===!0).then(()=>m(!1));}s.forEach(v=>{e[v.type]!=null&&f.push(jsx(Ui,{control:g,fieldComponent:e[v.type],fieldData:v,submit:C(T)},`${i.flow.id}-${v.id}`));});let h=(E=(B=i.primaryButton)==null?void 0:B.title)!=null?E:i.primaryButtonTitle,S=(k=(b=i.secondaryButton)==null?void 0:b.title)!=null?k:i.secondaryButtonTitle,w=!!(i.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[d,i]),jsxs(Fragment,{children:[jsx(P.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,p(a({},d),{children:f})),jsxs(F.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[S&&jsx(D.Secondary,{onClick:r,title:S}),jsx(D.Primary,{disabled:w||u,onClick:C(T),title:h!=null?h:"Submit",loading:u})]},`form-footer-${i.id}`)]})}function cr({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(R.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function Wo({children:e,id:o,required:t=!1}){return jsxs(R.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(x,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var No={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Ue=p(a({},No),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),ao={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function pe({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:i,placeholder:l,props:s}=t,{error:d}=r,u=a(p(a(a(a({id:n},o),l?{placeholder:l}:{}),Ue),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""}),s);return jsxs(x,{part:"field",children:[jsx(Wo,{id:n,required:!!t.required,children:i}),e(u),jsx(cr,{error:d})]})}function $e(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var qi=Do.forwardRef(({label:e,value:o},t)=>jsxs(x,{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:[jsx(R.Body2,{part:"field-radio-label",children:e}),jsx(Me.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(x,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(x,p(a({as:Me.Indicator},ao),{children:jsx($e,{height:"14",width:"14"})}))})})]}));function _o(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:l})=>jsx(qi,{value:l,label:i},l));return jsx(pe,p(a({},e),{children:()=>jsx(Me.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(F.Column,{gap:2,part:"field-radio-group",children:n})})}))}function so(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function xr(e){let{field:{onChange:o},fieldData:{options:t=[]}}=e,[r,n]=Do.useState([]);function i(l){let s=[];r.includes(l)?s=[...r.filter(d=>d!==l)]:s=[...r,l],n(s),o(s);}return jsx(pe,p(a({},e),{children:()=>jsx(F.Column,{gap:2,part:"field-select-multiple",children:t.map(({label:l,value:s})=>jsx(lo.Root,{value:r.includes(s)?s:void 0,onCheckedChange:()=>i(s),asChild:!0,children:jsxs(x,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(R.Body2,{part:"field-check-label",children:l}),jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:s,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(lo.Indicator,{asChild:!0,children:jsx(x,p(a({},ao),{children:jsx($e,{height:"14",width:"14"})}))})})]})},s))})}))}var Qi=Do.forwardRef(({label:e,value:o},t)=>jsx(L.Item,{value:o,ref:t,asChild:!0,children:jsx(x,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(L.ItemText,{asChild:!0,children:jsx(R.Body2,{part:"field-select-option-label",children:e})})})}));function zo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:l,value:s})=>jsx(Qi,{value:s,label:l},s));return e.fieldData.multiple?jsx(xr,a({},e)):jsx(pe,p(a({},e),{children:()=>jsxs(L.Root,{value:t,onValueChange:o,children:[jsx(L.Trigger,{asChild:!0,children:jsxs(R.Body2,p(a({},Ue),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(L.Value,{placeholder:n!=null?n:"Select one"}),jsx(L.Icon,{children:jsx(x,{as:so,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(L.Portal,{children:jsx(L.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(x,p(a({},Ue),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(L.Viewport,{children:i})}))})})]})}))}function Uo(e){return jsx(pe,p(a({},e),{children:o=>jsx(R.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Go(e){return jsx(pe,p(a({},e),{children:o=>jsx(R.Body2,a({as:"textarea",part:"field-textarea"},o))}))}function Sr(e){let{field:{onChange:o,value:t},fieldData:{label:r,id:n=[]}}=e;return jsxs(x,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(lo.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(x,p(a({},No),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:n,children:jsx(lo.Indicator,{asChild:!0,children:jsx(x,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx($e,{height:"14",fill:"currentColor"})})})}))}),jsx(R.Body2,{part:"field-checkbox-label",as:"label",htmlFor:n,children:r})]})}var oa={checkbox:Sr,radio:_o,select:zo,text:Uo,textarea:Go};function Ve(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=y(i,["fieldTypes","flowId","part"]);let l=Object.assign({},oa,e);return jsx(z,p(a({as:P,flowId:o,part:["form",t]},r),{children:s=>jsx(dr,a({fieldTypes:l},s))}))}var uo={};me(uo,{NPS:()=>Ke});function Fr({field:e,fieldData:o,submit:t,options:r,positiveLabel:n,negativeLabel:i}){var s,d;let l=r.map(u=>{let m=e.value===u.value?D.Primary:D.Secondary;return jsx(m,{borderWidth:"1px",onClick:()=>{e.onChange(u.value),t();},title:u.label,css:{".fr-button-title":{fontSize:"15px"}}},u.value)});return jsxs(F.Column,{gap:2,children:[jsx(F.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:l}),jsxs(F.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(R.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(s=o.negativeLabel)!=null?s:i}),jsx(R.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(d=o.positiveLabel)!=null?d:n})]})]})}function Ke(d){var u=d,{as:e=$,flowId:o,fieldTypes:t,part:r,options:n,positiveLabel:i,negativeLabel:l}=u,s=y(u,["as","flowId","fieldTypes","part","options","positiveLabel","negativeLabel"]);var C,T,h;let{flow:m}=Te(o),f=(T=(C=m==null?void 0:m.props)==null?void 0:C.options)!=null?T:[...Array(11)].map((S,w)=>({label:`${w}`,value:`${w}`})),g=n||f;return jsx(Ve,p(a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:S=>{var w,B,E,b,k,v;return jsx(Fr,p(a({},S),{options:g,positiveLabel:(E=(B=(w=m==null?void 0:m.props)==null?void 0:w.positiveLabel)!=null?B:i)!=null?E:"Extremely likely",negativeLabel:(v=(k=(b=m==null?void 0:m.props)==null?void 0:b.negativeLabel)!=null?k:l)!=null?v:"Not likely at all"}))}},t),modal:!1,onEscapeKeyDown:S=>{typeof s.onEscapeKeyDown=="function"&&s.onEscapeKeyDown(S),S.defaultPrevented||m.skip();},part:["nps",r]},s),{css:a({},a(p(a({},!m||m.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{".fr-card-header":{minWidth:g.length*51}}),{".fr-form":{padding:"20px","@media (max-width: 660px)":{minWidth:"100%"}},".fr-nps-field":{"@media (min-width: 660px)":{minWidth:"fit-content"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}},".fr-nps":{maxWidth:"min-content"}}),(h=s.css)!=null?h:{}))}))}function Tr(e,o,t){let[r,n]=useState(!1),i=useRef();return useEffect(()=>{i.current=typeof o=="string"?document.querySelector(o):o,n(!0);},[o]),r?createPortal(e,i.current,t):null}function Ko({children:e,container:o="body"}){return Tr(e,o)}function da(l,i){var s=l,{children:e,lockScroll:o=!0,part:t,opacity:r=.5}=s,n=y(s,["children","lockScroll","part","opacity"]);let d=keyframes`
52
+ `,zi=()=>jsx(x,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Gi({checked:e=!1}){return jsx(x,{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&&jsx(x,{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:jsx(zi,{})})})}function Yo({children:e}){return jsx(Ve.Content,{asChild:!0,children:jsxs(R.Column,{css:{'&[data-state="open"]':{animation:`${_i} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Ui} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(x,{}),e]})})}function Qo(i){var l=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=l,n=f(l,["children","disabled","onOpenChange","open"]);return jsx(Ve.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(b,p(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function et({isCompleted:e,isBlocked:o,title:t}){return jsx(Ve.Trigger,{asChild:!0,children:jsxs(R.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(R.Row,{alignItems:"center",gap:2,children:[jsx(Gi,{checked:e}),jsx(T.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(x,{as:Cr,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ki=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function re(e){let o={},t={};for(let[r,n]of Object.entries(e))Ki.some(i=>i===r)?o[r]=n:t[r]=n;return {otherProps:t,videoProps:o}}var vr=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function wr({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,S,v,k,O,C;let{$state:{blocked:i,completed:l,skipped:s},subtitle:d,title:u}=n,c=(S=(h=n.primaryButton)==null?void 0:h.title)!=null?S:n.primaryButtonTitle,g=(k=(v=n.secondaryButton)==null?void 0:v.title)!=null?k:n.secondaryButtonTitle,y=(O=n.props)!=null?O:{},P=!!i,{videoProps:w}=re(y);return jsxs(Qo,p(a({open:t,onOpenChange:r},y),{children:[jsx(et,{isBlocked:n.$state.blocked,isCompleted:l||s,title:u}),jsxs(Yo,{children:[jsx(b.Media,a({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=n.videoUri)!=null?C:n.imageUri,transform:"translate3d(0, 0, 1px)",type:n.videoUri?"video":"image"},w)),jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxs(R.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:g,onClick:o}),jsx(b.Primary,{disabled:P,title:c,onClick:e})]})]})]}))}var qi={default:wr};function Zi(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var h;let{onPrimary:i,onSecondary:l,openStepId:s,setOpenStepId:d,stepTypes:u}=useContext(vr),{handlePrimary:c,handleSecondary:g}=ae(o,{onPrimary:i,onSecondary:l}),y=(s!=null?s:e.getCurrentStep().id)===o.id,P=(h=u[o.type])!=null?h:wr;function w(S){return V(this,null,function*(){d(S?o.id:""),S&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(P,p(a({flow:e,onOpenChange:w,open:y,step:o},t),{handlePrimary:c,handleSecondary:g}),o.id)}function xo(l){var s=l,{flowId:e,onPrimary:o,onSecondary:t,part:r,stepTypes:n={}}=s,i=f(s,["flowId","onPrimary","onSecondary","part","stepTypes"]);let[d,u]=useState(null),c=a(a({},qi),n);return jsx(vr.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:c},children:jsx(L,p(a({as:b,borderWidth:"md",flowId:e,part:["checklist",r]},i),{children:w=>{var h=w,{flow:g,handleDismiss:y}=h,P=f(h,["flow","handleDismiss"]);var B;let v=Array.from(g.steps.entries()).filter(([,F])=>F.$state.visible===!0).map(([,F])=>jsx(Zi,p(a({flow:g,handleDismiss:y},P),{step:F}),F.id)),k=g.getNumberOfCompletedSteps(),O=g.getNumberOfAvailableSteps(),C=i.dismissible||!!((B=g==null?void 0:g.props)!=null&&B.dismissible);return jsxs(Fragment,{children:[jsxs(R.Column,{gap:2,children:[jsx(b.Header,{dismissible:C,handleDismiss:y,part:"checklist-header",subtitle:g.subtitle,title:g.title}),jsxs(R.Row,{alignItems:"center",gap:2,children:[jsxs(T.Body2,{fontWeight:"demibold",children:[k,"/",O]}),jsx(he,{current:k,total:O,flexGrow:1})]})]}),v]})}}))})}var Qe={};ue(Qe,{Content:()=>Me,Root:()=>Ae,Trigger:()=>We});function ra(l,i){var s=l,{children:e,lockScroll:o=!0,part:t,opacity:r=.5}=s,n=f(s,["children","lockScroll","part","opacity"]);let d=keyframes`
51
53
  from {
52
54
  opacity: 0;
53
55
  }
54
56
  to {
55
57
  opacity: ${r}
56
58
  }
57
- `,[u,m]=useState(!1);return useEffect(()=>{if(!o){let f=()=>{u||(m(!0),window.removeEventListener("scroll",f));};return window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f);}}},[o,u]),!o&&u?jsx(Fragment,{children:e}):jsx(RemoveScroll,{forwardProps:!0,ref:i,enabled:o,children:jsx(x,p(a({animation:`${d} 300ms ease-out`,backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",t],position:"fixed"},n),{children:e}))})}var mo=Do.forwardRef(da);var ga=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Er(n){var i=n,{clickable:e=!1,part:o="",style:t={}}=i,r=y(i,["clickable","part","style"]);let[l,s]=useState(!1);return useEffect(()=>{s(!0);},[]),jsxs(x,p(a({borderRadius:"24px",height:"24px",part:`ping-wrapper ${o}`,position:"relative",width:"24px",cursor:e?"pointer":void 0,style:a({opacity:l?1:0},t),transition:"opacity 0.2s ease-out"},r),{children:[jsx(x,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${ga}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(x,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px","backgroundColor:hover":e?"primary.hover.surface":void 0})]}))}function Ca({maxX:e,maxY:o,radius:t,x1:r,x2:n,y1:i,y2:l}){return t>0?`path("${[`M${r+t},${i}`,`H${n-t}`,`A${t} ${t} 0,0,1 ${n} ${i+t}`,`V${l-t}`,`A${t} ${t} 0,0,1 ${n-t} ${l}`,`H${r+t}`,`A${t} ${t} 0,0,1 ${r} ${l-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${r}`,`V${i+t}`,`A${t} ${t} 0,0,1 ${r+t} ${i}`,"Z"].join(" ")}")`:`path("M${r},${i} H${n} V${l} H${r} V${o} H${e} V0 H0 V${o} H${r} Z")`}function Sa(e){if(!window||!("nodeType"in e))return 0;let o=Number(window.getComputedStyle(e).borderRadius.replace(/\D/g,""));return Number.isNaN(o)?0:o}function Xo(i){var l=i,{anchor:e,lockScroll:o=!0,part:t,style:r={}}=l,n=y(l,["anchor","lockScroll","part","style"]);let[s,d]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:u}=useFloating({middleware:[{name:"clipPath",fn({elements:m,rects:f}){return d({maxX:m.floating.clientWidth,maxY:m.floating.clientHeight,radius:Sa(m.reference),x1:f.reference.x,x2:f.reference.x+f.reference.width,y1:f.reference.y,y2:f.reference.y+f.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{try{let m=document.querySelector(e);m!=null?u.setReference(m):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);}catch(m){}},[e,u]),jsx(mo,a({lockScroll:o,part:["spotlight",t],ref:u.setFloating,style:a({clipPath:Ca(s)},r)},n))}function Or({align:e,side:o}){let t={},r="-12px",n={top:"bottom",right:"left",bottom:"top",left:"right"};return t[n[o]]=r,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=r:t.bottom=r:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=r:t.top=r:["top","bottom"].includes(o)?t.left=`calc(50% + ${r})`:t.top=`calc(50% + ${r})`,t}function Ir(e,o){try{if(e.matches(o)&&Hr(e))return e;let t=e.querySelectorAll(o);if(t.length>0&&Hr(t[0]))return t[0]}catch(t){return null}}function Hr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $r(e){let[o,t]=useState(null);return useEffect(()=>{try{let r=document.querySelector(e);r!=null?(console.debug(`[frigade] Found anchor: ${e}`),t(r)):console.debug(`[frigade] No anchor found for selector: ${e}`);}catch(r){console.debug(`[frigade] Invalid selector for anchor: ${e}`);}},[e]),useEffect(()=>{let r=new MutationObserver(n=>{for(let i of n)if(i.type==="childList"){for(let l of i.addedNodes){if(l.nodeType!==Node.ELEMENT_NODE)continue;let s=Ir(l,e);if(s!=null){console.debug(`[frigade] Found anchor: ${e}`),t(s);break}}for(let l of i.removedNodes){if(l.nodeType!==Node.ELEMENT_NODE)continue;if(Ir(l,e)!=null){console.debug(`[frigade] Removed anchor: ${e}`),t(null);break}}}});return r.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),{anchorElement:o}}function Ma(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function Mr({align:e,alignOffset:o,anchor:t,onOpenChange:r=()=>{},open:n,side:i,sideOffset:l}){let s=`${i}-${Ma(e)}`;function d({rects:k}){let v={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(i)?v.alignmentAxis=o-k.floating.width:v.alignmentAxis=o-k.floating.height),v}let{context:u,floatingStyles:m,placement:f,refs:g}=useFloating({middleware:[offset(d,[e,o,i,l]),flip(),shift()],onOpenChange:r,open:n,placement:s,whileElementsMounted:autoUpdate}),C=useClick(u),T=useDismiss(u,{outsidePress:!1}),h=useRole(u),S=useTransitionStatus(u),{getFloatingProps:w,getReferenceProps:B}=useInteractions([C,T,h]),{anchorElement:E}=$r(t);useEffect(()=>{E!=null&&g.setReference(E);},[t,E,g]);let b=f.split("-");return e==="before"?b[1]=b[1]==="end"?"after":"before":e==="after"&&(b[1]=b[1]==="start"?"before":"after"),{context:u,getFloatingProps:w,getReferenceProps:B,floatingStyles:m,placement:b.join("-"),refs:g,status:S}}var Jo={height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}};function fo(){let e="DOMRect"in globalThis?new DOMRect:Jo,[o,t]=useState(e),[r,n]=useState(null),i=useCallback(l=>{n(l);},[]);return useLayoutEffect(()=>{if(!r)return;let l=()=>{let s=r.getBoundingClientRect();t(s);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[r]),{node:r,rect:o,ref:i}}function Lr(e){let[o,t]=useState(!1),[r,n]=useState(Jo),i=r.height>0&&r.width>0;return useEffect(()=>{if(e==null)return;let l=new IntersectionObserver(s=>{let d=s[0];n(d.boundingClientRect),t(d.isIntersecting);},{root:null});return l.observe(e),()=>{l.disconnect();}},[e]),{isVisible:o&&i}}function Zo(B){var E=B,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,css:i={},defaultOpen:l=!0,lockScroll:s=!0,modal:d=!1,onMount:u,onOpenChange:m=()=>{},open:f,part:g,side:C="bottom",sideOffset:T=0,spotlight:h=!1,style:S={}}=E,w=y(E,["align","alignOffset","anchor","autoScroll","children","css","defaultOpen","lockScroll","modal","onMount","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[b,k]=useState(l),[v,I]=useState(!1),H=f!=null?f:b,{getFloatingProps:J,getReferenceProps:Z,floatingStyles:Y,placement:Q,refs:U,status:ee}=Mr({align:e,alignOffset:o,anchor:t,onOpenChange:K=>{m(K),f==null&&k(K);},open:H,side:C,sideOffset:T}),[ne,de]=Q.split("-"),N=Z(),{isVisible:_}=Lr(U.reference.current),G=useRef(!1);if(useEffect(()=>{if(!v&&r&&U.reference.current instanceof Element){let K=typeof r!="boolean"?r:{behavior:"smooth",block:"center"},ae;window.addEventListener("scroll",function ie(){clearTimeout(ae),ae=setTimeout(()=>{window.removeEventListener("scroll",ie),I(!0);},100);},!0),U.reference.current.scrollIntoView(K);}else r||I(!0);},[r,U.reference,v]),U.reference.current!==null&&v&&_)G.current===!1&&(G.current=!0,u==null||u());else return G.current=!1,null;return jsxs(Fragment,{children:[h&&H&&jsx(Xo,{anchor:t,lockScroll:s}),d&&!h&&H&&jsx(mo,{lockScroll:s}),jsxs(x,p(a(a({css:a({'&[data-status="open"]':{transition:"transform 0.2s ease-out"}},i),"data-placement":Q,"data-status":ee.status,part:["hint",g],ref:U.setFloating,style:a(a({},Y),S)},J()),w),{children:[H&&n,jsx(Er,p(a({},N),{position:"absolute",style:Or({align:de,side:ne}),clickable:l===!1}))]}))]})}var Ua=keyframes`
59
+ `,[u,c]=useState(!1);return useEffect(()=>{if(!o){let g=()=>{u||(c(!0),window.removeEventListener("scroll",g));};return window.addEventListener("scroll",g),()=>{window.removeEventListener("scroll",g);}}},[o,u]),!o&&u?jsx(Fragment,{children:e}):jsx(RemoveScroll,{forwardProps:!0,ref:i,enabled:o,children:jsx(x,p(a({animation:`${d} 300ms ease-out`,backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",t],position:"fixed"},n),{children:e}))})}var $e=jo.forwardRef(ra);function pa({maxX:e,maxY:o,radius:t,x1:r,x2:n,y1:i,y2:l}){return t>0?`path("${[`M${r+t},${i}`,`H${n-t}`,`A${t} ${t} 0,0,1 ${n} ${i+t}`,`V${l-t}`,`A${t} ${t} 0,0,1 ${n-t} ${l}`,`H${r+t}`,`A${t} ${t} 0,0,1 ${r} ${l-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${r}`,`V${i+t}`,`A${t} ${t} 0,0,1 ${r+t} ${i}`,"Z"].join(" ")}")`:`path("M${r},${i} H${n} V${l} H${r} V${o} H${e} V0 H0 V${o} H${r} Z")`}function da(e){if(!window||!("nodeType"in e))return 0;let o=Number(window.getComputedStyle(e).borderRadius.replace(/\D/g,""));return Number.isNaN(o)?0:o}function qe(i){var l=i,{anchor:e,lockScroll:o=!0,part:t,style:r={}}=l,n=f(l,["anchor","lockScroll","part","style"]);let[s,d]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:u}=useFloating({middleware:[{name:"clipPath",fn({elements:c,rects:g}){return d({maxX:c.floating.clientWidth,maxY:c.floating.clientHeight,radius:da(c.reference),x1:g.reference.x,x2:g.reference.x+g.reference.width,y1:g.reference.y,y2:g.reference.y+g.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{try{let c=document.querySelector(e);c!=null?u.setReference(c):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);}catch(c){}},[e,u]),jsx($e,a({lockScroll:o,part:["spotlight",t],ref:u.setFloating,style:a({clipPath:pa(s)},r)},n))}function Ze(e,o=!0){let[t,r]=useState(!1);useEffect(()=>{if(!t&&o&&e instanceof Element){let n=typeof o!="boolean"?o:{behavior:"smooth",block:"center"},i;window.addEventListener("scroll",function l(){clearTimeout(i),i=setTimeout(()=>{window.removeEventListener("scroll",l),r(!0);},100);},!0),e.scrollIntoView(n);}else o||r(!0);},[o,e,t]);}function Tr(e,o){try{if(e.matches(o)&&kr(e))return e;let t=e.querySelectorAll(o);if(t.length>0&&kr(t[0]))return t[0]}catch(t){return null}}function kr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Br(e){let[o,t]=useState(null);return useEffect(()=>{if(typeof e=="string")try{let r=document.querySelector(e);r!=null?(console.debug(`[frigade] Found anchor: ${e}`),t(r)):console.debug(`[frigade] No anchor found for selector: ${e}`);}catch(r){console.debug(`[frigade] Invalid selector for anchor: ${e}`);}},[e]),useEffect(()=>{if(typeof e!="string")return;let r=new MutationObserver(n=>{for(let i of n)if(i.type==="childList"){for(let l of i.addedNodes){if(l.nodeType!==Node.ELEMENT_NODE)continue;let s=Tr(l,e);if(s!=null){console.debug(`[frigade] Found anchor: ${e}`),t(s);break}}for(let l of i.removedNodes){if(l.nodeType!==Node.ELEMENT_NODE)continue;if(Tr(l,e)!=null){console.debug(`[frigade] Removed anchor: ${e}`),t(null);break}}}});return r.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),{anchorElement:o}}function Ta(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function ho({align:e,alignOffset:o,anchor:t,nodeId:r,onOpenChange:n=()=>{},open:i,side:l,sideOffset:s}){let d=`${l}-${Ta(e)}`;function u({rects:z}){let N={alignmentAxis:o,mainAxis:s};return ["after","before"].includes(e)&&(["bottom","top"].includes(l)?N.alignmentAxis=o-z.floating.width:N.alignmentAxis=o-z.floating.height),N}let H=useFloating({middleware:[offset(u,[e,o,l,s]),flip(),shift()],nodeId:r,onOpenChange:n,open:i,placement:d,whileElementsMounted:autoUpdate}),{context:c,floatingStyles:g,placement:y,refs:P}=H,w=f(H,["context","floatingStyles","placement","refs"]),h=useClick(c),S=useDismiss(c,{outsidePress:!1}),v=useFocus(c),k=useRole(c),O=useTransitionStatus(c),{getFloatingProps:C,getReferenceProps:B}=useInteractions([h,S,v,k]),{anchorElement:F}=Br(t);useEffect(()=>{F!=null&&P.setReference(F);},[t,F,P]);let I=y.split("-");return e==="before"?I[1]=I[1]==="end"?"after":"before":e==="after"&&(I[1]=I[1]==="start"?"before":"after"),a({context:c,getFloatingProps:C,getReferenceProps:B,floatingStyles:g,placement:I.join("-"),refs:P,status:O},w)}var Ye=createContext({floatingNodeId:null,isOpen:!1,setIsOpen:()=>{}});function Ae(P){var w=P,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,defaultOpen:i=!1,modal:l=!1,onOpenChange:s=()=>{},open:d,side:u="bottom",sideOffset:c=0,spotlight:g=!1}=w,y=f(w,["align","alignOffset","anchor","autoScroll","children","defaultOpen","modal","onOpenChange","open","side","sideOffset","spotlight"]);let[h,S]=useState(i),v=d!=null?d:h,k=useFloatingNodeId(),O=ho(a({align:e,alignOffset:o,anchor:t,nodeId:k,onOpenChange:B=>{s(B),d==null&&S(B);},open:v,side:u,sideOffset:c},y)),{refs:C}=O;return Ze(C.reference.current,r),jsxs(Ye.Provider,{value:{floating:O,floatingNodeId:k,isOpen:v,setIsOpen:S},children:[g&&v&&jsx(qe,{anchor:t}),l&&!g&&v&&jsx($e,{lockScroll:!0}),n]})}var tt={height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}};function bo(){let e="DOMRect"in globalThis?new DOMRect:tt,[o,t]=useState(e),[r,n]=useState(null),i=useCallback(l=>{n(l);},[]);return useLayoutEffect(()=>{if(!r)return;let l=()=>{let s=r.getBoundingClientRect();t(s);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[r]),{node:r,rect:o,ref:i}}function Po(e){let[o,t]=useState(!1),[r,n]=useState(tt),i=r.height>0&&r.width>0;return useEffect(()=>{if(e==null)return;let l=new IntersectionObserver(s=>{let d=s[0];n(d.boundingClientRect),t(d.isIntersecting);},{root:null});return l.observe(e),()=>{l.disconnect();}},[e]),{isVisible:o&&i}}function Me(i){var l=i,{children:e,css:o,part:t,style:r}=l,n=f(l,["children","css","part","style"]);let{floating:s,floatingNodeId:d}=useContext(Ye),{isVisible:u}=Po(s==null?void 0:s.refs.reference.current);if(s==null)return null;let{floatingStyles:c,getFloatingProps:g,placement:y,refs:P,status:w}=s;return P.reference.current==null||!u||(w==null?void 0:w.isMounted)===!1?null:jsx(FloatingNode,{id:d,children:jsx(x,p(a(a({autoFocus:!0,css:a({'&[data-status="unmounted"]':{display:"none"}},o),"data-placement":y,"data-status":w.status,part:["popover-content",t],ref:P.setFloating,style:a(a({},c),r)},g()),n),{children:jsx(x,{part:"popover-transition-container",children:e})}))})}function We(r){var n=r,{children:e,part:o}=n,t=f(n,["children","part"]);var d;let{floating:{getReferenceProps:i,refs:l},setIsOpen:s}=useContext(Ye);return jsx(x,p(a(a({ref:l==null?void 0:l.setReference,onClick:()=>s(u=>!u),part:["popover-trigger",o]},t),(d=i==null?void 0:i())!=null?d:{}),{children:e}))}var Co={'&[data-status="open"]':{opacity:1,zIndex:1},'&[data-status="close"]':{opacity:0,zIndex:0,'& [data-status="close"]':{display:"none"}},'&[data-status="initial"]':{opacity:.8},'&[data-status="open"], &[data-status="close"]':{transition:"transform 0.2s ease-out, opacity 0.2s ease-out"},'&[data-status="initial"] .fr-popover-transition-container':{transform:"scale(0.8)"},'&[data-status="close"] .fr-popover-transition-container':{transform:"scale(0.3)"},'&[data-status="open"] .fr-popover-transition-container':{transform:"scale(1)"},"& .fr-popover-transition-container":{transformOrigin:"left",transition:"transform 0.2s ease-out"}};function Dr({onPrimary:e,onSecondary:o,openStepId:t,setOpenStepId:r,step:n}){var S,v,k,O,C,B;let i=useRef(),{handlePrimary:l,handleSecondary:s}=ae(n,{onPrimary:e,onSecondary:o}),d=t===n.id;function u(...F){return V(this,null,function*(){(yield l(...F))&&r(null);})}function c(...F){return V(this,null,function*(){(yield s(...F))&&r(null);})}function g(){clearTimeout(i.current),d||(i.current=setTimeout(()=>r(n.id),300));}function y(){clearTimeout(i.current);}let P=(v=(S=n.primaryButton)==null?void 0:S.title)!=null?v:n.primaryButtonTitle,w=(O=(k=n.secondaryButton)==null?void 0:k.title)!=null?O:n.secondaryButtonTitle,{videoProps:h}=re((C=n.props)!=null?C:{});return jsxs(Ae,{align:"start",open:d,side:"right",sideOffset:8,children:[jsxs(We,{as:R.Row,alignItems:"center",borderRadius:"md",gap:"2",justifyContent:"space-between",onPointerEnter:g,onPointerLeave:y,padding:"1 2",part:"floating-checklist-step-list-item",style:{backgroundColor:d?"var(--fr-colors-neutral-800)":"transparent"},userSelect:"none",children:[jsx(T.Body2,{part:"floating-checklist-step-title",children:n.title}),jsx(go,{checked:n.$state.completed||n.$state.skipped,size:"18px"})]}),jsx(Me,{css:Co,part:"floating-step",children:jsxs(b,{backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",gap:"3",minWidth:"400px",p:"2",children:[jsx(b.Media,a({src:(B=n.videoUri)!=null?B:n.imageUri,type:n.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},h)),jsx(b.Header,{dismissible:!1,padding:"0 1",subtitle:n.subtitle}),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{disabled:n.$state.blocked,onClick:c,padding:"1 2",title:w}),jsx(b.Primary,{disabled:n.$state.blocked,onClick:u,padding:"1 2",title:P})]})]})})]})}function Hr(l){var s=l,{children:e,flowId:o,onPrimary:t,onSecondary:r,part:n}=s,i=f(s,["children","flowId","onPrimary","onSecondary","part"]);let[d,u]=useState(null),c=useRef();function g(){clearTimeout(c.current);}function y(){clearTimeout(c.current),d!=null&&(c.current=setTimeout(()=>u(null),300));}function P(w){!w&&d!=null&&u(null);}return jsx(L,p(a({flowId:o,part:["floating-checklist",n]},i),{children:({flow:w})=>{let h=w.getNumberOfCompletedSteps(),S=w.getNumberOfAvailableSteps(),v=e!=null?e:jsxs(R.Row,{alignItems:"center",backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",cursor:"pointer",gap:"2",padding:"1 2",part:"floating-checklist-anchor",userSelect:"none",children:[jsx(T.Body2,{fontWeight:"medium",part:"floating-checklist-title",children:w.title}),jsx(mo,{current:h,height:"24px",strokeWidth:"4px",total:S,width:"24px"})]});return jsx(FloatingTree,{children:jsxs(Ae,{align:"start",onOpenChange:P,sideOffset:4,children:[jsx(We,{display:"inline-block",children:v}),jsx(Me,{css:p(a({},Co),{'&[data-status="initial"]':{opacity:.3},"& .fr-popover-transition-container":{transformOrigin:"top left",transition:"transform 0.2s ease-out"},'&[data-placement^="top"] .fr-popover-transition-container':{transformOrigin:"bottom left"}}),children:jsxs(b,{backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",gap:"0",onPointerEnter:g,onPointerLeave:y,p:"0 1 1",part:"floating-checklist-step-list",children:[jsx(he,{borderRadius:"md md 0 0",clipPath:"border-box",css:{"& .fr-progress-bar-fill":{borderRadius:0}},current:h,height:"5px",total:S,flexGrow:1,margin:"0 -1 2"}),Array.from(w.steps.values()).map(k=>jsx(Dr,{onPrimary:t,onSecondary:r,openStepId:d,setOpenStepId:u,step:k},k.id))]})})]})})}}))}var qa=new Set(["required","min","max","minLength","maxLength","pattern"]);function Za({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=useFormContext();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(([s])=>qa.has(s))),l=useController({name:t.id,control:o,rules:i});return jsx(e,p(a({},l),{fieldData:t,formContext:n,submit:r}))}function $r({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var k,O,C,B;let{__readOnly:l}=useContext(A),s=useMemo(()=>{var F,I;return (I=(F=i.fields)==null?void 0:F.filter(H=>e[H.type]!=null&&H.id))!=null?I:[]},[i.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:s.reduce((F,I)=>{var H;return F[I.id]=(H=I.value)!=null?H:"",F},{})});useEffect(()=>{d.formState.isDirty||d.reset(s.reduce((F,I)=>{var H;return F[I.id]=(H=I.value)!=null?H:"",F},{}));},[s,d]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(F=>s.some(I=>I.id===F))&&d.trigger();},[s,d,i.id]);let[u,c]=useState(!1),g=[],{control:y,handleSubmit:P}=d;function w(F,I){c(!0),t(I,F,l===!0).then(()=>c(!1));}s.forEach(F=>{e[F.type]!=null&&g.push(jsx(Za,{control:y,fieldComponent:e[F.type],fieldData:F,submit:P(w)},`${i.flow.id}-${F.id}`));});let h=(O=(k=i.primaryButton)==null?void 0:k.title)!=null?O:i.primaryButtonTitle,S=(B=(C=i.secondaryButton)==null?void 0:C.title)!=null?B:i.secondaryButtonTitle,v=!!(i.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[d,i]),jsxs(Fragment,{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,p(a({},d),{children:g})),jsxs(R.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[S&&jsx(D.Secondary,{onClick:r,title:S}),jsx(D.Primary,{disabled:v||u,onClick:P(w),title:h!=null?h:"Submit",loading:u})]},`form-footer-${i.id}`)]})}function Ar({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(T.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function at({children:e,id:o,required:t=!1}){return jsxs(T.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(x,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var st={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},eo=p(a({},st),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),wo={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function pe({children:e,field:o,fieldData:t,fieldState:r}){var c;let{id:n,label:i,placeholder:l,props:s}=t,{error:d}=r,u=a(p(a(a(a({id:n},o),l?{placeholder:l}:{}),eo),{"aria-invalid":!!d,value:(c=o.value)!=null?c:""}),s);return jsxs(x,{part:"field",children:[jsx(at,{id:n,required:!!t.required,children:i}),e(u),jsx(Ar,{error:d})]})}function Ne(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var rs=jo.forwardRef(({label:e,value:o},t)=>jsxs(x,{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:[jsx(T.Body2,{part:"field-radio-label",children:e}),jsx(_e.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(x,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(x,p(a({as:_e.Indicator},wo),{children:jsx(Ne,{height:"14",width:"14"})}))})})]}));function lt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:l})=>jsx(rs,{value:l,label:i},l));return jsx(pe,p(a({},e),{children:()=>jsx(_e.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(R.Column,{gap:2,part:"field-radio-group",children:n})})}))}function Fo(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function Ur(e){let{field:{onChange:o},fieldData:{options:t=[]}}=e,[r,n]=jo.useState([]);function i(l){let s=[];r.includes(l)?s=[...r.filter(d=>d!==l)]:s=[...r,l],n(s),o(s);}return jsx(pe,p(a({},e),{children:()=>jsx(R.Column,{gap:2,part:"field-select-multiple",children:t.map(({label:l,value:s})=>jsx(Ro.Root,{value:r.includes(s)?s:void 0,onCheckedChange:()=>i(s),asChild:!0,children:jsxs(x,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(T.Body2,{part:"field-check-label",children:l}),jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:s,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(Ro.Indicator,{asChild:!0,children:jsx(x,p(a({},wo),{children:jsx(Ne,{height:"14",width:"14"})}))})})]})},s))})}))}var as=jo.forwardRef(({label:e,value:o},t)=>jsx(_.Item,{value:o,ref:t,asChild:!0,children:jsx(x,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(_.ItemText,{asChild:!0,children:jsx(T.Body2,{part:"field-select-option-label",children:e})})})}));function pt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:l,value:s})=>jsx(as,{value:s,label:l},s));return e.fieldData.multiple?jsx(Ur,a({},e)):jsx(pe,p(a({},e),{children:()=>jsxs(_.Root,{value:t,onValueChange:o,children:[jsx(_.Trigger,{asChild:!0,children:jsxs(T.Body2,p(a({},eo),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(_.Value,{placeholder:n!=null?n:"Select one"}),jsx(_.Icon,{children:jsx(x,{as:Fo,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(_.Portal,{children:jsx(_.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(x,p(a({},eo),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(_.Viewport,{children:i})}))})})]})}))}function dt(e){return jsx(pe,p(a({},e),{children:o=>jsx(T.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function ct(e){return jsx(pe,p(a({},e),{children:o=>jsx(T.Body2,a({as:"textarea",part:"field-textarea"},o))}))}function Xr(e){let{field:{onChange:o,value:t},fieldData:{label:r,id:n=[]}}=e;return jsxs(x,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(Ro.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(x,p(a({},st),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:n,children:jsx(Ro.Indicator,{asChild:!0,children:jsx(x,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ne,{height:"14",fill:"currentColor"})})})}))}),jsx(T.Body2,{part:"field-checkbox-label",as:"label",htmlFor:n,children:r})]})}var ls={checkbox:Xr,radio:lt,select:pt,text:dt,textarea:ct};function ze(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let l=Object.assign({},ls,e);return jsx(L,p(a({as:b,flowId:o,part:["form",t]},r),{children:s=>jsx($r,a({fieldTypes:l},s))}))}var Bo={};ue(Bo,{NPS:()=>to});function Zr({field:e,fieldData:o,submit:t,options:r,positiveLabel:n,negativeLabel:i}){var s,d;let l=r.map(u=>{let c=e.value===u.value?D.Primary:D.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(u.value),t();},title:u.label,css:{".fr-button-title":{fontSize:"15px"}}},u.value)});return jsxs(R.Column,{gap:2,children:[jsx(R.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:l}),jsxs(R.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(T.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(s=o.negativeLabel)!=null?s:i}),jsx(T.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(d=o.positiveLabel)!=null?d:n})]})]})}function to(d){var u=d,{as:e=$,flowId:o,fieldTypes:t,part:r,options:n,positiveLabel:i,negativeLabel:l}=u,s=f(u,["as","flowId","fieldTypes","part","options","positiveLabel","negativeLabel"]);var P,w,h;let{flow:c}=Oe(o),g=(w=(P=c==null?void 0:c.props)==null?void 0:P.options)!=null?w:[...Array(11)].map((S,v)=>({label:`${v}`,value:`${v}`})),y=n||g;return jsx(ze,p(a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:S=>{var v,k,O,C,B,F;return jsx(Zr,p(a({},S),{options:y,positiveLabel:(O=(k=(v=c==null?void 0:c.props)==null?void 0:v.positiveLabel)!=null?k:i)!=null?O:"Extremely likely",negativeLabel:(F=(B=(C=c==null?void 0:c.props)==null?void 0:C.negativeLabel)!=null?B:l)!=null?F:"Not likely at all"}))}},t),modal:!1,onEscapeKeyDown:S=>{typeof s.onEscapeKeyDown=="function"&&s.onEscapeKeyDown(S),S.defaultPrevented||c.skip();},part:["nps",r]},s),{css:a({},a(p(a({},!c||c.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{".fr-card-header":{minWidth:y.length*51}}),{".fr-form":{padding:"20px","@media (max-width: 660px)":{minWidth:"100%"}},".fr-nps-field":{"@media (min-width: 660px)":{minWidth:"fit-content"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}},".fr-nps":{maxWidth:"min-content"}}),(h=s.css)!=null?h:{}))}))}function Qr(e,o,t){let[r,n]=useState(!1),i=useRef();return useEffect(()=>{i.current=typeof o=="string"?document.querySelector(o):o,n(!0);},[o]),r?createPortal(e,i.current,t):null}function ut({children:e,container:o="body"}){return Qr(e,o)}var ys=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function on(n){var i=n,{clickable:e=!1,part:o="",style:t={}}=i,r=f(i,["clickable","part","style"]);let[l,s]=useState(!1);return useEffect(()=>{s(!0);},[]),jsxs(x,p(a({borderRadius:"24px",height:"24px",part:`ping-wrapper ${o}`,position:"relative",width:"24px",cursor:e?"pointer":void 0,style:a({opacity:l?1:0},t),transition:"opacity 0.2s ease-out"},r),{children:[jsx(x,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${ys}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(x,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px","backgroundColor:hover":e?"primary.hover.surface":void 0})]}))}function tn({align:e,side:o}){let t={},r="-12px",n={top:"bottom",right:"left",bottom:"top",left:"right"};return t[n[o]]=r,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=r:t.bottom=r:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=r:t.top=r:["top","bottom"].includes(o)?t.left=`calc(50% + ${r})`:t.top=`calc(50% + ${r})`,t}function ft(k){var O=k,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,css:i={},defaultOpen:l=!0,lockScroll:s=!0,modal:d=!1,onMount:u,onOpenChange:c=()=>{},open:g,part:y,side:P="bottom",sideOffset:w=0,spotlight:h=!1,style:S={}}=O,v=f(O,["align","alignOffset","anchor","autoScroll","children","css","defaultOpen","lockScroll","modal","onMount","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[C,B]=useState(l),F=g!=null?g:C,{getFloatingProps:I,getReferenceProps:H,floatingStyles:z,placement:N,refs:G,status:ee}=ho({align:e,alignOffset:o,anchor:t,onOpenChange:j=>{c(j),g==null&&B(j);},open:F,side:P,sideOffset:w}),[ne,Z]=N.split("-"),oe=H(),{isVisible:de}=Po(G.reference.current),M=useRef(!1);if(Ze(G.reference.current,r),G.reference.current!==null&&de)M.current===!1&&(console.log("HINT: shouldMount"),M.current=!0,u==null||u());else return console.log("HINT: !shouldMount"),M.current=!1,null;return jsxs(Fragment,{children:[h&&F&&jsx(qe,{anchor:t,lockScroll:s}),d&&!h&&F&&jsx($e,{lockScroll:s}),jsxs(x,p(a(a({css:a({'&[data-status="open"]':{transition:"transform 0.2s ease-out"}},i),"data-placement":N,"data-status":ee.status,part:["hint",y],ref:G.setFloating,style:a(a({},z),S)},I()),v),{children:[F&&n,jsx(on,p(a({},oe),{position:"absolute",style:tn({align:Z,side:ne}),clickable:l===!1}))]}))]})}var Ss=keyframes`
58
60
  from {
59
61
  opacity: 0;
60
62
  }
@@ -64,7 +66,7 @@ var gt=Object.defineProperty,gn=Object.defineProperties;var yn=Object.getOwnProp
64
66
  to {
65
67
  opacity: 1;
66
68
  }
67
- `;function go(w){var B=w,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:i,handleDismiss:l,lockScroll:s,modal:d,onPrimary:u,onSecondary:m,part:f,side:g,sideOffset:C,spotlight:T,step:h}=B,S=y(B,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","lockScroll","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var Z,Y,Q,U,ee;let{handlePrimary:E,handleSecondary:b}=ye(h,{onPrimary:u,onSecondary:m}),{videoProps:k,otherProps:v}=ce(S),I=(Y=(Z=h.primaryButton)==null?void 0:Z.title)!=null?Y:h.primaryButtonTitle,H=(U=(Q=h.secondaryButton)==null?void 0:Q.title)!=null?U:h.secondaryButtonTitle,J=!!h.$state.blocked;return jsx(Zo,p(a({align:e,alignOffset:o,anchor:h.selector,autoScroll:t,"data-step-id":h.id,defaultOpen:r,lockScroll:s,modal:d,part:f,side:g,sideOffset:C,spotlight:T,onMount:()=>{r&&!J&&(h==null||h.start());}},v),{children:jsxs(P,{animation:`${Ua} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(P.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(ee=h.videoUri)!=null?ee:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image"},k)),jsx(P.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:l,subtitle:h.subtitle,title:h.title}),jsxs(P.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsx(Oe,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsx(P.Secondary,{disabled:J,onClick:b,title:H}),jsx(P.Primary,{disabled:J,onClick:E,title:I})]})]})}))}function zr(n){var i=n,{children:e,container:o,flowId:t}=i,r=y(i,["children","container","flowId"]);return jsx(Ko,{container:o,children:jsx(x,p(a({"data-flow-id":t,part:"tour"},r),{children:e}))})}function yo(r){var n=r,{as:e,flowId:o}=n,t=y(n,["as","flowId"]);let{onDismiss:i,onPrimary:l,onSecondary:s}=t;return jsx(z,p(a({as:null,flowId:o,autoStart:!1},t),{children:({flow:d,handleDismiss:u,parentProps:m,step:f})=>{var de;let ne=m.containerProps,{align:g="after",alignOffset:C=0,autoScroll:T=!1,container:h="body",defaultOpen:S,lockScroll:w=!0,modal:B,onOpenChange:E,open:b,part:k,sequential:v=!0,side:I="bottom",sideOffset:H=0,spotlight:J,zIndex:Z=9999}=ne,Y=y(ne,["align","alignOffset","autoScroll","container","defaultOpen","lockScroll","modal","onOpenChange","open","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:Q}=m,U=a({align:g,alignOffset:C,autoScroll:T,dismissible:Q,flow:d,handleDismiss:u,modal:B,onPrimary:l,onSecondary:s,onOpenChange:E,open:b,part:k,side:I,sideOffset:H,spotlight:J,step:f,zIndex:Z},(de=f.props)!=null?de:{});if(v)return jsx(zr,p(a({as:e,container:h,flowId:o,part:"tour",zIndex:Z},Y),{children:jsx(go,a({defaultOpen:S!=null?S:!0,lockScroll:w},U),f.id)}));let ee=Array.from(d.steps.values()).filter(N=>{let{blocked:_,completed:G,skipped:oe,visible:K}=N.$state;return !_&&!G&&!oe&&K}).map(N=>{var ae,ie,ct,ut;function _(mt){return A(this,null,function*(){return (yield i==null?void 0:i(d,mt))===!1?(mt.preventDefault(),!1):(N.skip(),!0)})}let G=J&&N.id===f.id,oe=(ie=(ae=N.props)==null?void 0:ae.zIndex)!=null?ie:Z,K=a({align:g,alignOffset:C,dismissible:Q,flow:d,handleDismiss:_,onPrimary:l,onSecondary:s,onOpenChange:E,open:b,part:k,side:I,sideOffset:H,spotlight:J,zIndex:oe},(ct=N.props)!=null?ct:{});return jsx(go,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(oe)+2},".fr-overlay":{zIndex:Number(oe)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(ut=S||G)!=null?ut:!1,lockScroll:w,step:N},K),`${N.id}-${G}`)});return jsx(zr,p(a({as:e,container:h,flowId:o,part:"tour",zIndex:Z},Y),{children:ee}))}}))}var xo="useSyncExternalStore"in Do?Do.useSyncExternalStore:Ur.useSyncExternalStore;function ho(){let{frigade:e}=useContext(M),[,o]=useState(!1),t=useRef(),r=useCallback(l=>{e==null||e.getCollections().then(()=>{l();});let s=()=>{clearTimeout(t.current),t.current=setTimeout(()=>{o(d=>!d),l();},0);};return e==null||e.on("flow.any",s),()=>{e==null||e.off("flow.any",s);};},[e]),n=()=>{let l;try{l=e==null?void 0:e.getCollectionsSync();}catch(s){}return l};return {collections:xo(r,n,n)}}function bo(e){var s,d,u,m;let{frigade:o}=useContext(M),{collections:t}=ho(),r=t==null?void 0:t.get(e),i=(m=((u=(d=(s=t==null?void 0:t.get(e))==null?void 0:s.flows)==null?void 0:d.filter(f=>f.visible).map(f=>p(a({},f),{flow:o==null?void 0:o.getFlowSync(f.flowId)})))!=null?u:[]).find(({flow:f})=>f.isVisible))==null?void 0:m.flowId,{flow:l}=Te(i);return useEffect(()=>{o==null||o.registerCollection(e);},[e,o]),{collection:r,currentFlow:l}}function Qo(n){var i=n,{collectionId:e,part:o,variables:t={}}=i,r=y(i,["collectionId","part","variables"]);var u,m,f;let l={ANNOUNCEMENT:et,BANNER:Io,CARD:P,CHECKLIST:no,EMBEDDED_TIP:P,FORM:Ve,NPS_SURVEY:Ke,SURVEY:Ke,TOUR:yo},{currentFlow:s}=bo(e),d=(m=l[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?m:null;return s==null||d==null?null:((f=s==null?void 0:s.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(x,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx(Ve,{flowId:s.id,as:$,variables:t},s.id)})):jsx(x,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx(d,{flowId:s.id,variables:t},s.id)}))}function Gr(){var t,r;let{collections:e}=ho(),o=(r=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(n=>n[1].collectionType==="DEFAULT"))==null?void 0:r[0];return bo(o),o==null?null:jsx(Qo,{as:null,collectionId:o})}var M=createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});var be=(e,o="log")=>{let t=`__frigade_logged_${e}`;globalThis[t]||(globalThis[t]=!0,console[o](e));};function ot(){let e=useContext(M);(!e||!e.frigade)&&be("useFrigade() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function Kr(){let{frigade:e}=ot();return useEffect(()=>{A(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[e]),null}var jr="2.7.6";function Yr(l){var s=l,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=s,i=y(s,["children","css","defaultCollection","navigate","theme"]);let d=n?To(n):{},u=useRef(new Map),m=useRef(),[f,g]=useState(!1),[C,T]=useState(null),h=useMemo(()=>(g(!1),m.current=void 0,new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides,__platformVersion:jr,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);useEffect(()=>{if(i.__flowStateOverrides){let b=h.getConfig();b.__flowStateOverrides=i.__flowStateOverrides,h.reload(b);}},[h,i.__flowStateOverrides]);function S(){let b=[...u.current.entries()].map(([k,v])=>[k,v.callback]);h.batchRegister(b),g(!0);}function w(b,k){if(m.current&&clearTimeout(m.current),f){u.current.has(b)?h.getFlow(b).then(v=>k(v.isVisible)):(h.getFlow(b).then(v=>v.register(k)),u.current.set(b,{callback:k}));return}u.current.has(b)||u.current.set(b,{callback:k}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>S(),0);}function B(b){u.current.has(b)&&h.getFlow(b).then(k=>{u.current.delete(b),k==null||k.unregister();});}let E=r!=null?r:(b,k="_self")=>{window.open(b,k);};return useEffect(()=>()=>{h.destroy();},[h]),jsxs(M.Provider,{value:p(a({currentModal:C,setCurrentModal:T,navigate:E},i),{frigade:h,registerComponent:w,unregisterComponent:B,hasInitialized:f,variables:i.variables||{}}),children:[jsx(Global,{styles:{":root":a(a(a({},ko),d),o)}}),jsxs(ThemeProvider,{theme:O,children:[t&&jsx(Gr,{}),e]}),i.preloadImages!==!1&&jsx(Kr,{})]})}function Te(e,o){let t=useContext(M);(!t||!t.frigade)&&be(`useFlow('${e}') must be used in a child of the Frigade Provider`,"warn");let{frigade:r,variables:n}=t!=null?t:{},[,i]=useState(!1),l=useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=(m,f)=>{f.id===e&&setTimeout(()=>{i(g=>!g),d();},0);};return r==null||r.on("flow.any",u),()=>{r==null||r.off("flow.any",u);}},[e,r]),s=xo(l,()=>r==null?void 0:r.getFlowSync(e),()=>r==null?void 0:r.getFlowSync(e));return useEffect(()=>{s==null||s.applyVariables(a(a({},n),o==null?void 0:o.variables));},[o==null?void 0:o.variables,s,e,n]),{flow:s,isLoading:r!=null&&r.hasFailedToLoad()?!1:!s}}function rt(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{if(e==null)return;function n(){return A(this,null,function*(){e.isCompleted&&r.current===!1&&(r.current=!0,yield o==null?void 0:o(e));})}return n(),r.current=e==null?void 0:e.isCompleted,()=>{n();}},[e,o]),{handleDismiss:useCallback(n=>A(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e,t])}}function on(e,o=!0){let{currentModal:t,setCurrentModal:r}=useContext(M),n=useCallback(l=>{o&&(e!=null&&e.isVisible)&&r(l);},[o,e==null?void 0:e.isVisible,r]),i=useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e,r]);return useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),i),[n,t,e,i]),useEffect(()=>{e!=null&&(!o||!e.isVisible)&&i();},[e,o,i]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function it(e){return typeof e=="function"&&e.displayName==="Dialog"}function z(m){var f=m,{as:e,autoStart:o=!0,children:t,flowId:r,onComplete:n,onDismiss:i,onPrimary:l,onSecondary:s,variables:d}=f,u=y(f,["as","autoStart","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var Q,U,ee,de;let{flow:g}=Te(r,{variables:d}),C=g==null?void 0:g.getCurrentStep(),T=(Q=C==null?void 0:C.props)!=null?Q:{},{otherProps:h}=ce(T),ne=a(a(a({},u),(U=g==null?void 0:g.props)!=null?U:{}),((ee=g==null?void 0:g.rawData)==null?void 0:ee.flowType)===FlowType.CHECKLIST?{}:h),{dismissible:S=!!it(e),forceMount:w=!1}=ne,B=y(ne,["dismissible","forceMount"]),{handleDismiss:E}=rt(g,{onComplete:n,onDismiss:i}),{handlePrimary:b,handleSecondary:k}=ye(C,{onPrimary:l,onSecondary:s}),v=(B==null?void 0:B.modal)||it(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((de=g==null?void 0:g.rawData)==null?void 0:de.flowType),{hasModalCollision:I}=on(g,v);function H(N){if(S===!1){N.preventDefault();return}typeof u.onEscapeKeyDown=="function"&&u.onEscapeKeyDown(N),N.defaultPrevented||E(N);}let J=w&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||(!g.isVisible||I)&&!J)return null;(J||!g.isCompleted&&!g.isSkipped&&o)&&(C==null||C.start());let Z=e===null?Fragment$1:e!=null?e:x,Y=p(a({},B),{"data-flow-id":g.id});return it(e)&&(Y.onEscapeKeyDown=H),jsx(Z,p(a({},e===null?{}:Y),{children:t({flow:g,handleDismiss:E,handlePrimary:b,handleSecondary:k,parentProps:{dismissible:S,flowId:r,variables:d,containerProps:Y},step:C})}))}function rn(t){var r=t,{part:e}=r,o=y(r,["part"]);return jsx(z,p(a({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:l,parentProps:{dismissible:s},step:d})=>{var g,C,T,h,S,w;let u=(C=(g=d.primaryButton)==null?void 0:g.title)!=null?C:d.primaryButtonTitle,m=(h=(T=d.secondaryButton)==null?void 0:T.title)!=null?h:d.secondaryButtonTitle,{videoProps:f}=ce((S=d.props)!=null?S:{});return jsxs(Fragment,{children:[jsx(P.Header,{dismissible:s,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsx(P.Media,a({src:(w=d.videoUri)!=null?w:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxs(F.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(P.Secondary,{title:m,onClick:l}),jsx(P.Primary,{title:u,onClick:i})]})]})}}))}function Co(r){var n=r,{part:e,src:o}=n,t=y(n,["part","src"]);return jsx(x,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function hs(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function So(T){var h=T,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s,playsInline:d,poster:u,preload:m,part:f,src:g}=h,C=y(h,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let S=hs(g);return S?jsx(x,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",f],src:S},C)):g!=null&&g.endsWith(".mp4")?jsx(x,a({as:"video",part:["video",f],src:g,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s!=null?s:e,playsInline:d,poster:u,preload:m},C)):(console.error(`Could not map videoUri ${g} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function Pe(r){var n=r,{src:e,type:o}=n,t=y(n,["src","type"]);return jsx(o==="video"?So:Co,a({src:e},t))}var P=Do.forwardRef((i,n)=>{var l=i,{children:e,flowId:o,part:t}=l,r=y(l,["children","flowId","part"]);var d;if(o!=null)return jsx(rn,a({flowId:o},r));let s=(d=r.as)!=null?d:F.Column;return jsx(s,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},r),{ref:n,children:e}))});P.Dismiss=e=>jsx(D.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}));P.Footer=r=>{var n=r,{children:e,part:o}=n,t=y(n,["children","part"]);return jsx(F.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};P.Header=l=>{var s=l,{dismissible:e,handleDismiss:o,part:t,subtitle:r,title:n}=s,i=y(s,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(n==null||(n==null?void 0:n.length)===0)&&(r==null||(r==null?void 0:r.length)===0)?null:jsxs(F.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(P.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};P.Media=t=>{var r=t,{src:e}=r,o=y(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(Pe,a({borderRadius:"md",src:e},o))};P.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=y(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Primary,a({title:o,onClick:e},t))};P.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=y(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Secondary,a({title:o,onClick:e},t))};P.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=y(n,["children","part"]);return e==null?null:jsx(R.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};P.Title=r=>{var n=r,{children:e,part:o}=n,t=y(n,["children","part"]);return e==null?null:jsx(R.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var wo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function sn(e){let o=Object.fromEntries(wo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(wo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!wo.content.some(i=>i===n)&&!wo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Ss=keyframes`
69
+ `;function Oo(v){var k=v,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:i,handleDismiss:l,lockScroll:s,modal:d,onPrimary:u,onSecondary:c,part:g,side:y,sideOffset:P,spotlight:w,step:h}=k,S=f(k,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","lockScroll","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var N,G,ee,ne,Z;let{handlePrimary:O,handleSecondary:C}=ae(h,{onPrimary:u,onSecondary:c}),{videoProps:B,otherProps:F}=re(S),I=(G=(N=h.primaryButton)==null?void 0:N.title)!=null?G:h.primaryButtonTitle,H=(ne=(ee=h.secondaryButton)==null?void 0:ee.title)!=null?ne:h.secondaryButtonTitle,z=!!h.$state.blocked;return jsx(ft,p(a({align:e,alignOffset:o,anchor:h.selector,autoScroll:t,"data-step-id":h.id,defaultOpen:r,lockScroll:s,modal:d,part:g,side:y,sideOffset:P,spotlight:w,onMount:()=>{r&&!z&&(h==null||h.start());}},F),{children:jsxs(b,{animation:`${Ss} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(b.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(Z=h.videoUri)!=null?Z:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image"},B)),jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:l,subtitle:h.subtitle,title:h.title}),jsxs(b.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsx(De,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsx(b.Secondary,{disabled:z,onClick:C,title:H}),jsx(b.Primary,{disabled:z,onClick:O,title:I})]})]})}))}function an(n){var i=n,{children:e,container:o,flowId:t}=i,r=f(i,["children","container","flowId"]);return jsx(ut,{container:o,children:jsx(x,p(a({"data-flow-id":t,part:"tour"},r),{children:e}))})}function Eo(r){var n=r,{as:e,flowId:o}=n,t=f(n,["as","flowId"]);let{onDismiss:i,onPrimary:l,onSecondary:s}=t;return jsx(L,p(a({as:null,flowId:o,autoStart:!1},t),{children:({flow:d,handleDismiss:u,parentProps:c,step:g})=>{var de;let oe=c.containerProps,{align:y="after",alignOffset:P=0,autoScroll:w=!1,container:h="body",defaultOpen:S,lockScroll:v=!0,modal:k,onOpenChange:O,open:C,part:B,sequential:F=!0,side:I="bottom",sideOffset:H=0,spotlight:z,zIndex:N=9999}=oe,G=f(oe,["align","alignOffset","autoScroll","container","defaultOpen","lockScroll","modal","onOpenChange","open","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:ee}=c,ne=a({align:y,alignOffset:P,autoScroll:w,dismissible:ee,flow:d,handleDismiss:u,modal:k,onPrimary:l,onSecondary:s,onOpenChange:O,open:C,part:B,side:I,sideOffset:H,spotlight:z,step:g,zIndex:N},(de=g.props)!=null?de:{});if(F)return jsx(an,p(a({as:e,container:h,flowId:o,part:"tour",zIndex:N},G),{children:jsx(Oo,a({defaultOpen:S!=null?S:!0,lockScroll:v},ne),g.id)}));let Z=Array.from(d.steps.values()).filter(M=>{let{blocked:K,completed:j,skipped:te,visible:ie}=M.$state;return !K&&!j&&!te&&ie}).map(M=>{var xe,ce,kt,Bt;function K(Ot){return V(this,null,function*(){return (yield i==null?void 0:i(d,Ot))===!1?(Ot.preventDefault(),!1):(M.skip(),!0)})}let j=z&&M.id===g.id,te=(ce=(xe=M.props)==null?void 0:xe.zIndex)!=null?ce:N,ie=a({align:y,alignOffset:P,dismissible:ee,flow:d,handleDismiss:K,onPrimary:l,onSecondary:s,onOpenChange:O,open:C,part:B,side:I,sideOffset:H,spotlight:z,zIndex:te},(kt=M.props)!=null?kt:{});return jsx(Oo,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(te)+2},".fr-overlay":{zIndex:Number(te)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(Bt=S||j)!=null?Bt:!1,lockScroll:v,step:M},ie),`${M.id}-${j}`)});return jsx(an,p(a({as:e,container:h,flowId:o,part:"tour",zIndex:N},G),{children:Z}))}}))}var Io="useSyncExternalStore"in jo?jo.useSyncExternalStore:sn.useSyncExternalStore;function Do(){let{frigade:e}=useContext(A),[,o]=useState(!1),t=useRef(),r=useCallback(l=>{e==null||e.getCollections().then(()=>{l();});let s=()=>{clearTimeout(t.current),t.current=setTimeout(()=>{o(d=>!d),l();},0);};return e==null||e.on("flow.any",s),()=>{e==null||e.off("flow.any",s);};},[e]),n=()=>{let l;try{l=e==null?void 0:e.getCollectionsSync();}catch(s){}return l};return {collections:Io(r,n,n)}}function Ho(e){var s,d,u,c;let{frigade:o}=useContext(A),{collections:t}=Do(),r=t==null?void 0:t.get(e),i=(c=((u=(d=(s=t==null?void 0:t.get(e))==null?void 0:s.flows)==null?void 0:d.filter(g=>g.visible).map(g=>p(a({},g),{flow:o==null?void 0:o.getFlowSync(g.flowId)})))!=null?u:[]).find(({flow:g})=>g.isVisible))==null?void 0:c.flowId,{flow:l}=Oe(i);return useEffect(()=>{o==null||o.registerCollection(e);},[e,o]),{collection:r,currentFlow:l}}function yt(n){var i=n,{collectionId:e,part:o,variables:t={}}=i,r=f(i,["collectionId","part","variables"]);var u,c,g;let l={ANNOUNCEMENT:xt,BANNER:Xo,CARD:b,CHECKLIST:xo,EMBEDDED_TIP:b,FORM:ze,NPS_SURVEY:to,SURVEY:to,TOUR:Eo},{currentFlow:s}=Ho(e),d=(c=l[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?c:null;return s==null||d==null?null:((g=s==null?void 0:s.rawData)==null?void 0:g.flowType)===FlowType.FORM?jsx(x,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx(ze,{flowId:s.id,as:$,variables:t},s.id)})):jsx(x,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx(d,{flowId:s.id,variables:t},s.id)}))}function ln(){var t,r;let{collections:e}=Do(),o=(r=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(n=>n[1].collectionType==="DEFAULT"))==null?void 0:r[0];return Ho(o),o==null?null:jsx(yt,{as:null,collectionId:o})}var A=createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});var Se=(e,o="log")=>{let t=`__frigade_logged_${e}`;globalThis[t]||(globalThis[t]=!0,console[o](e));};function ht(){let e=useContext(A);(!e||!e.frigade)&&Se("useFrigade() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function pn(){let{frigade:e}=ht();return useEffect(()=>{V(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[e]),null}var dn="2.8.0";function gn(l){var s=l,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=s,i=f(s,["children","css","defaultCollection","navigate","theme"]);let d=n?_o(n):{},u=useRef(new Map),c=useRef(),[g,y]=useState(!1),[P,w]=useState(null),h=useMemo(()=>(y(!1),c.current=void 0,new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides,__platformVersion:dn,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);useEffect(()=>{if(i.__flowStateOverrides){let C=h.getConfig();C.__flowStateOverrides=i.__flowStateOverrides,h.reload(C);}},[h,i.__flowStateOverrides]);function S(){let C=[...u.current.entries()].map(([B,F])=>[B,F.callback]);h.batchRegister(C),y(!0);}function v(C,B){if(c.current&&clearTimeout(c.current),g){u.current.has(C)?h.getFlow(C).then(F=>B(F.isVisible)):(h.getFlow(C).then(F=>F.register(B)),u.current.set(C,{callback:B}));return}u.current.has(C)||u.current.set(C,{callback:B}),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>S(),0);}function k(C){u.current.has(C)&&h.getFlow(C).then(B=>{u.current.delete(C),B==null||B.unregister();});}let O=r!=null?r:(C,B="_self")=>{window.open(C,B);};return useEffect(()=>()=>{h.destroy();},[h]),jsxs(A.Provider,{value:p(a({currentModal:P,setCurrentModal:w,navigate:O},i),{frigade:h,registerComponent:v,unregisterComponent:k,hasInitialized:g,variables:i.variables||{}}),children:[jsx(Global,{styles:{":root":a(a(a({},Uo),d),o)}}),jsxs(ThemeProvider,{theme:E,children:[t&&jsx(ln,{}),e]}),i.preloadImages!==!1&&jsx(pn,{})]})}function Oe(e,o){let t=useContext(A);(!t||!t.frigade)&&Se(`useFlow('${e}') must be used in a child of the Frigade Provider`,"warn");let{frigade:r,variables:n}=t!=null?t:{},[,i]=useState(!1),l=useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=(c,g)=>{g.id===e&&setTimeout(()=>{i(y=>!y),d();},0);};return r==null||r.on("flow.any",u),()=>{r==null||r.off("flow.any",u);}},[e,r]),s=Io(l,()=>r==null?void 0:r.getFlowSync(e),()=>r==null?void 0:r.getFlowSync(e));return useEffect(()=>{s==null||s.applyVariables(a(a({},n),o==null?void 0:o.variables));},[o==null?void 0:o.variables,s,e,n]),{flow:s,isLoading:r!=null&&r.hasFailedToLoad()?!1:!s}}function Pt(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{if(e==null)return;function n(){return V(this,null,function*(){e.isCompleted&&r.current===!1&&(r.current=!0,yield o==null?void 0:o(e));})}return n(),r.current=e==null?void 0:e.isCompleted,()=>{n();}},[e,o]),{handleDismiss:useCallback(n=>V(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e,t])}}function hn(e,o=!0){let{currentModal:t,setCurrentModal:r}=useContext(A),n=useCallback(l=>{o&&(e!=null&&e.isVisible)&&r(l);},[o,e==null?void 0:e.isVisible,r]),i=useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e,r]);return useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),i),[n,t,e,i]),useEffect(()=>{e!=null&&(!o||!e.isVisible)&&i();},[e,o,i]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function St(e){return typeof e=="function"&&e.displayName==="Dialog"}function L(c){var g=c,{as:e,autoStart:o=!0,children:t,flowId:r,onComplete:n,onDismiss:i,onPrimary:l,onSecondary:s,variables:d}=g,u=f(g,["as","autoStart","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var ee,ne,Z,de;let{flow:y}=Oe(r,{variables:d}),P=y==null?void 0:y.getCurrentStep(),w=(ee=P==null?void 0:P.props)!=null?ee:{},{otherProps:h}=re(w),oe=a(a(a({},u),(ne=y==null?void 0:y.props)!=null?ne:{}),((Z=y==null?void 0:y.rawData)==null?void 0:Z.flowType)===FlowType.CHECKLIST?{}:h),{dismissible:S=!!St(e),forceMount:v=!1}=oe,k=f(oe,["dismissible","forceMount"]),{handleDismiss:O}=Pt(y,{onComplete:n,onDismiss:i}),{handlePrimary:C,handleSecondary:B}=ae(P,{onPrimary:l,onSecondary:s}),F=(k==null?void 0:k.modal)||St(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((de=y==null?void 0:y.rawData)==null?void 0:de.flowType),{hasModalCollision:I}=hn(y,F);function H(M){if(S===!1){M.preventDefault();return}typeof u.onEscapeKeyDown=="function"&&u.onEscapeKeyDown(M),M.defaultPrevented||O(M);}let z=v&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||(!y.isVisible||I)&&!z)return null;(z||!y.isCompleted&&!y.isSkipped&&o)&&(P==null||P.start());let N=e===null?Fragment$1:e!=null?e:x,G=p(a({},k),{"data-flow-id":y.id});return St(e)&&(G.onEscapeKeyDown=H),jsx(N,p(a({},e===null?{}:G),{children:t({flow:y,handleDismiss:O,handlePrimary:C,handleSecondary:B,parentProps:{dismissible:S,flowId:r,variables:d,containerProps:G},step:P})}))}function Pn(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsx(L,p(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:l,parentProps:{dismissible:s},step:d})=>{var y,P,w,h,S,v;let u=(P=(y=d.primaryButton)==null?void 0:y.title)!=null?P:d.primaryButtonTitle,c=(h=(w=d.secondaryButton)==null?void 0:w.title)!=null?h:d.secondaryButtonTitle,{videoProps:g}=re((S=d.props)!=null?S:{});return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:s,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsx(b.Media,a({src:(v=d.videoUri)!=null?v:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},g)),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:c,onClick:l}),jsx(b.Primary,{title:u,onClick:i})]})]})}}))}function $o(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsx(x,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function qs(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ao(w){var h=w,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s,playsInline:d,poster:u,preload:c,part:g,src:y}=h,P=f(h,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let S=qs(y);return S?jsx(x,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",g],src:S},P)):y!=null&&y.endsWith(".mp4")?jsx(x,a({as:"video",part:["video",g],src:y,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s!=null?s:e,playsInline:d,poster:u,preload:c},P)):(console.error(`Could not map videoUri ${y} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ve(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsx(o==="video"?Ao:$o,a({src:e},t))}var b=jo.forwardRef((i,n)=>{var l=i,{children:e,flowId:o,part:t}=l,r=f(l,["children","flowId","part"]);var d;if(o!=null)return jsx(Pn,a({flowId:o},r));let s=(d=r.as)!=null?d:R.Column;return jsx(s,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},r),{ref:n,children:e}))});b.Dismiss=e=>jsx(D.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}));b.Footer=r=>{var n=r,{children:e,part:o}=n,t=f(n,["children","part"]);return jsx(R.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=l=>{var s=l,{dismissible:e,handleDismiss:o,part:t,subtitle:r,title:n}=s,i=f(s,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(n==null||(n==null?void 0:n.length)===0)&&(r==null||(r==null?void 0:r.length)===0)?null:jsxs(R.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};b.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ve,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=f(n,["children","part"]);return e==null?null:jsx(T.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=r=>{var n=r,{children:e,part:o}=n,t=f(n,["children","part"]);return e==null?null:jsx(T.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var Mo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function vn(e){let o=Object.fromEntries(Mo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Mo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Mo.content.some(i=>i===n)&&!Mo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var el=keyframes`
68
70
  from {
69
71
  opacity: 0;
70
72
  }
@@ -74,7 +76,7 @@ var gt=Object.defineProperty,gn=Object.defineProperties;var yn=Object.getOwnProp
74
76
  to {
75
77
  opacity: 1;
76
78
  }
77
- `;function $(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=y(i,["children","className","modal"]);let{rootProps:l,contentProps:s,otherProps:m}=sn(r),f=m,{zIndex:d}=f,u=y(f,["zIndex"]);return jsx(q.Root,p(a({defaultOpen:!0,modal:t},l),{children:jsx(q.Portal,{children:jsxs(x,{animation:`${Ss} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsx(q.Overlay,{asChild:!0,children:jsx(x,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(q.Content,p(a({asChild:!0,onOpenAutoFocus:g=>g.preventDefault(),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault()},s),{children:jsx(P,p(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}$.Dismiss=e=>jsx(q.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}))});$.Subtitle=t=>{var r=t,{children:e}=r,o=y(r,["children"]);return jsx(q.Description,{asChild:!0,children:jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))})};$.Media=t=>{var r=t,{src:e}=r,o=y(r,["src"]);return e==null?null:jsx(Pe,a({borderRadius:"md",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=y(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};$.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(x,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?O.colors.primary.surface:O.colors.neutral[700],part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(x,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=y(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};$.Title=t=>{var r=t,{children:e}=r,o=y(r,["children"]);return jsx(q.Title,{asChild:!0,children:jsx(R.H4,p(a({part:"title"},o),{children:e}))})};$.displayName="Dialog";function et(r){var n=r,{flowId:e,part:o}=n,t=y(n,["flowId","part"]);return jsx(z,p(a({as:$,display:"flex",flexDirection:"column",flowId:e,gap:5,part:["announcement",o],textAlign:"center"},t),{children:({flow:i,handleDismiss:l,handlePrimary:s,handleSecondary:d,parentProps:{dismissible:u},step:m})=>{var h,S,w,B,E,b;let f=(S=(h=m.primaryButton)==null?void 0:h.title)!=null?S:m.primaryButtonTitle,g=(B=(w=m.secondaryButton)==null?void 0:w.title)!=null?B:m.secondaryButtonTitle,C=m.$state.blocked,{videoProps:T}=ce((E=m.props)!=null?E:{});return jsxs(Fragment,{children:[u&&jsx($.Dismiss,{onClick:l}),jsxs(F.Column,{gap:1,part:"announcement-header",children:[jsx($.Title,{children:m.title}),jsx($.Subtitle,{children:m.subtitle})]}),jsx($.Media,a({aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(b=m.videoUri)!=null?b:m.imageUri,transform:"translate3d(0, 0, 1px)",type:m.videoUri?"video":"image",width:"100%"},T)),jsx($.ProgressDots,{current:i.getCurrentStepIndex(),total:i.getNumberOfAvailableSteps()}),jsxs(F.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[g&&jsx($.Secondary,{disabled:C,onClick:d,title:g}),f&&jsx($.Primary,{disabled:C,onClick:s,title:f})]})]})}}))}function st(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vo(...e){let o=e.shift(),t=e.length===1?e[0]:vo(...e);if(!st(o)||!st(t))throw new Error("deepmerge can only merge Objects");let r=structuredClone(o);return Object.entries(t).forEach(([n,i])=>{st(i)?r[n]!==void 0?Object.assign(r,{[n]:vo(r[n],structuredClone(i))}):Object.assign(r,{[n]:structuredClone(i)}):Array.isArray(i)?r[n]!==void 0?Object.assign(r,{[n]:[...r[n],...structuredClone(i)]}):Object.assign(r,{[n]:structuredClone(i)}):Object.assign(r,{[n]:i});}),r}function Fs(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function Rs(t){var r=t,{title:e}=r,o=y(r,["title"]);return jsx(z,p(a({as:null},o),{children:({flow:n,parentProps:{containerProps:i},step:l})=>{var f,g,C;let s=Fs(e,n.title,l.title),d=(f=n==null?void 0:n.getNumberOfCompletedSteps())!=null?f:0,u=(g=n==null?void 0:n.getNumberOfAvailableSteps())!=null?g:1,m=i.onClick!=null;return m&&(i.css=vo({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(C=i.css)!=null?C:{})),jsxs(P,p(a({"aria-label":"Progress Badge",borderWidth:"md",cursor:m?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},i),{children:[jsxs(F.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsx(P.Title,{fontSize:"sm",lineHeight:"sm",children:s}),jsx(x,{as:so,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxs(F.Row,{alignItems:"center",gap:"2",part:"progress-badge-footer",children:[jsx(Oe,{current:d,fontSize:"xs",fontWeight:"medium",lineHeight:"xs",total:u}),jsx(to,{current:d,flexGrow:"1",total:u})]})]}))}}))}var ks=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function pn(r){var n=r,{style:e={},part:o=""}=n,t=y(n,["style","part"]);return jsxs(x,p(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(x,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${ks}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(x,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function dn({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},l="-24px",s={top:"bottom",right:"left",bottom:"top",left:"right"};n[s[r]]=l;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=l:n.bottom=l:["after","start"].includes(d)?["top","bottom"].includes(r)?n.left=l:n.top=l:["top","bottom"].includes(r)?n.left=`calc(50% + ${l})`:n.top=`calc(50% + ${l})`,n}var Fo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function cn(e,o){var i,l,s,d,u;let t=Object.fromEntries(Fo.content.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),r=Object.fromEntries(Fo.root.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),n={};for(let m of Object.keys(e))!Fo.content.includes(m)&&!Fo.root.includes(m)&&(n[m]=e[m]);if(t.align=(i=t.align)!=null?i:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let m={after:"end",before:"start"},f=(w,B)=>["top","bottom"].includes(B)?w=="after"?"marginLeft":"marginRight":w=="after"?"marginTop":"marginBottom",g=(s=t.alignOffset)!=null?s:0,C=(d=t.style)!=null?d:{},T=(u=t.side)!=null?u:"bottom",h=t.align;t.style=p(a({},C),{[f(h,T)]:g});let S=["top","bottom"].includes(T)?o.width:o.height;t.alignOffset=(S+g)*-1,t.align=m[h];}return {contentProps:t,otherProps:n,rootProps:r}}var un=keyframes`
79
+ `;function $(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=f(i,["children","className","modal"]);let{rootProps:l,contentProps:s,otherProps:c}=vn(r),g=c,{zIndex:d}=g,u=f(g,["zIndex"]);return jsx(q.Root,p(a({defaultOpen:!0,modal:t},l),{children:jsx(q.Portal,{children:jsxs(x,{animation:`${el} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsx(q.Overlay,{asChild:!0,children:jsx(x,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(q.Content,p(a({asChild:!0,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault()},s),{children:jsx(b,p(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}$.Dismiss=e=>jsx(q.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}))});$.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsx(q.Description,{asChild:!0,children:jsx(T.Body2,p(a({part:"subtitle"},o),{children:e}))})};$.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsx(ve,a({borderRadius:"md",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};$.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(x,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?E.colors.primary.surface:E.colors.neutral[700],part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(x,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};$.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsx(q.Title,{asChild:!0,children:jsx(T.H4,p(a({part:"title"},o),{children:e}))})};$.displayName="Dialog";function xt(r){var n=r,{flowId:e,part:o}=n,t=f(n,["flowId","part"]);return jsx(L,p(a({as:$,display:"flex",flexDirection:"column",flowId:e,gap:5,part:["announcement",o],textAlign:"center"},t),{children:({flow:i,handleDismiss:l,handlePrimary:s,handleSecondary:d,parentProps:{dismissible:u},step:c})=>{var h,S,v,k,O,C;let g=(S=(h=c.primaryButton)==null?void 0:h.title)!=null?S:c.primaryButtonTitle,y=(k=(v=c.secondaryButton)==null?void 0:v.title)!=null?k:c.secondaryButtonTitle,P=c.$state.blocked,{videoProps:w}=re((O=c.props)!=null?O:{});return jsxs(Fragment,{children:[u&&jsx($.Dismiss,{onClick:l}),jsxs(R.Column,{gap:1,part:"announcement-header",children:[jsx($.Title,{children:c.title}),jsx($.Subtitle,{children:c.subtitle})]}),jsx($.Media,a({aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(C=c.videoUri)!=null?C:c.imageUri,transform:"translate3d(0, 0, 1px)",type:c.videoUri?"video":"image",width:"100%"},w)),jsx($.ProgressDots,{current:i.getCurrentStepIndex(),total:i.getNumberOfAvailableSteps()}),jsxs(R.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[y&&jsx($.Secondary,{disabled:P,onClick:d,title:y}),g&&jsx($.Primary,{disabled:P,onClick:s,title:g})]})]})}}))}function wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wo(...e){let o=e.shift(),t=e.length===1?e[0]:Wo(...e);if(!wt(o)||!wt(t))throw new Error("deepmerge can only merge Objects");let r=structuredClone(o);return Object.entries(t).forEach(([n,i])=>{wt(i)?r[n]!==void 0?Object.assign(r,{[n]:Wo(r[n],structuredClone(i))}):Object.assign(r,{[n]:structuredClone(i)}):Array.isArray(i)?r[n]!==void 0?Object.assign(r,{[n]:[...r[n],...structuredClone(i)]}):Object.assign(r,{[n]:structuredClone(i)}):Object.assign(r,{[n]:i});}),r}function rl(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function nl(t){var r=t,{title:e}=r,o=f(r,["title"]);return jsx(L,p(a({as:null},o),{children:({flow:n,parentProps:{containerProps:i},step:l})=>{var g,y,P;let s=rl(e,n.title,l.title),d=(g=n==null?void 0:n.getNumberOfCompletedSteps())!=null?g:0,u=(y=n==null?void 0:n.getNumberOfAvailableSteps())!=null?y:1,c=i.onClick!=null;return c&&(i.css=Wo({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(P=i.css)!=null?P:{})),jsxs(b,p(a({"aria-label":"Progress Badge",borderWidth:"md",cursor:c?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},i),{children:[jsxs(R.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsx(b.Title,{fontSize:"sm",lineHeight:"sm",children:s}),jsx(x,{as:Fo,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxs(R.Row,{alignItems:"center",gap:"2",part:"progress-badge-footer",children:[jsx(De,{current:d,fontSize:"xs",fontWeight:"medium",lineHeight:"xs",total:u}),jsx(fo,{current:d,flexGrow:"1",total:u})]})]}))}}))}var al=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Fn(r){var n=r,{style:e={},part:o=""}=n,t=f(n,["style","part"]);return jsxs(x,p(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(x,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${al}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(x,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Rn({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},l="-24px",s={top:"bottom",right:"left",bottom:"top",left:"right"};n[s[r]]=l;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=l:n.bottom=l:["after","start"].includes(d)?["top","bottom"].includes(r)?n.left=l:n.top=l:["top","bottom"].includes(r)?n.left=`calc(50% + ${l})`:n.top=`calc(50% + ${l})`,n}var Lo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Tn(e,o){var i,l,s,d,u;let t=Object.fromEntries(Lo.content.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),r=Object.fromEntries(Lo.root.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),n={};for(let c of Object.keys(e))!Lo.content.includes(c)&&!Lo.root.includes(c)&&(n[c]=e[c]);if(t.align=(i=t.align)!=null?i:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let c={after:"end",before:"start"},g=(v,k)=>["top","bottom"].includes(k)?v=="after"?"marginLeft":"marginRight":v=="after"?"marginTop":"marginBottom",y=(s=t.alignOffset)!=null?s:0,P=(d=t.style)!=null?d:{},w=(u=t.side)!=null?u:"bottom",h=t.align;t.style=p(a({},P),{[g(h,w)]:y});let S=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(S+y)*-1,t.align=c[h];}return {contentProps:t,otherProps:n,rootProps:r}}var kn=keyframes`
78
80
  from {
79
81
  opacity: 0;
80
82
  }
@@ -84,8 +86,8 @@ var gt=Object.defineProperty,gn=Object.defineProperties;var yn=Object.getOwnProp
84
86
  to {
85
87
  opacity: 1;
86
88
  }
87
- `;function mn(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Se(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:i,spotlight:l=!1,style:s={}}=m,d=y(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:f,rect:g,ref:C}=fo(),{node:T,rect:h,ref:S}=fo(),{contentProps:w,otherProps:B,rootProps:E}=cn(d,g),[b,k]=useState(r),[v,I]=useState(w.align),[H,J]=useState(w.side),[Z,Y]=useState(0),[Q,U]=useState(0);function ee(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",b),b)}if(f!==null){let _=f.getAttribute("data-align"),G=f.getAttribute("data-side");v!==_&&I(_),H!==G&&J(G);}let ne=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(S(_),ne.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e,S]),useEffect(()=>{function _(oe){if(oe.matches(e))return mn(oe)?oe:null;let K=oe.querySelectorAll(e);return K.length>0&&mn(K[0])?K[0]:null}let G=new MutationObserver(oe=>{for(let K of oe)if(K.type==="childList"){for(let ae of K.addedNodes){if(ae.nodeType!==Node.ELEMENT_NODE)continue;let ie=_(ae);if(ie!=null){S(ie),ne.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let ae of K.removedNodes){if(ae.nodeType!==Node.ELEMENT_NODE)continue;let ie=_(ae);if(ie!=null){S(null),ne.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return G.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>G.disconnect()},[e,S]),useEffect(()=>{let{scrollX:_,scrollY:G}=window;Y(h.left+_),U(h.top+G);},[h.left,h.top]),T==null)return null;let de="0";typeof window!="undefined"&&(de=window.getComputedStyle(T).borderRadius);let N=dn({props:d,alignAttr:v,sideAttr:H});return jsxs(ue.Root,p(a({defaultOpen:!0},E),{children:[jsx(ue.Anchor,{virtualRef:ne}),jsx(ue.Portal,{children:jsxs(Fragment,{children:[l&&jsx(x,a({animation:`${un} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:de,height:h.height,left:Z,top:Q,width:h.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(ue.Content,p(a({},w),{ref:C,children:jsxs(Fragment,{children:[ee()&&jsx(P,p(a({animation:`${un} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:s},B),{children:o})),jsx(pn,{onClick:()=>{k(()=>(typeof E.onOpenChange=="function"&&E.onOpenChange(!ee()),!ee()));},style:N})]})}),b)]})})]}))}Se.Close=e=>jsx(ue.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}))});Se.Media=t=>{var r=t,{src:e}=r,o=y(r,["src"]);return e==null?null:jsx(Pe,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};Se.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=y(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};Se.Progress=t=>{var r=t,{children:e}=r,o=y(r,["children"]);return e==null?null:jsx(R.Body2,p(a({part:"progress"},o),{children:e}))};Se.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=y(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};Se.Subtitle=t=>{var r=t,{children:e}=r,o=y(r,["children"]);return e==null?null:jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))};Se.Title=t=>{var r=t,{children:e}=r,o=y(r,["children"]);return e==null?null:jsx(R.H4,p(a({part:"title"},o),{children:e}))};function Is(){let e=useContext(M);(!e||!e.frigade)&&be("useUser() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=o==null?void 0:o.config.userId;function r(i){return A(this,null,function*(){yield o.identify(t,i);})}function n(i,l){return A(this,null,function*(){yield o.track(i,l);})}return {userId:t,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}function $s(){var l;let e=useContext(M);(!e||!e.frigade)&&be("useGroup() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=(l=o==null?void 0:o.getConfig())==null?void 0:l.groupId;function r(s){return A(this,null,function*(){if(!o.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(o.config.groupId,s);})}function n(s,d){return A(this,null,function*(){yield o.track(s,d);})}function i(s,d){return A(this,null,function*(){yield o.group(s,d);})}return {groupId:t,setGroupId:i,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}
89
+ `;function Bn(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Fe(u){var c=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:i,spotlight:l=!1,style:s={}}=c,d=f(c,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:g,rect:y,ref:P}=bo(),{node:w,rect:h,ref:S}=bo(),{contentProps:v,otherProps:k,rootProps:O}=Tn(d,y),[C,B]=useState(r),[F,I]=useState(v.align),[H,z]=useState(v.side),[N,G]=useState(0),[ee,ne]=useState(0);function Z(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",C),C)}if(g!==null){let K=g.getAttribute("data-align"),j=g.getAttribute("data-side");F!==K&&I(K),H!==j&&z(j);}let oe=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(S(K),oe.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e,S]),useEffect(()=>{function K(te){if(te.matches(e))return Bn(te)?te:null;let ie=te.querySelectorAll(e);return ie.length>0&&Bn(ie[0])?ie[0]:null}let j=new MutationObserver(te=>{for(let ie of te)if(ie.type==="childList"){for(let xe of ie.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ce=K(xe);if(ce!=null){S(ce),oe.current=ce,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ce);break}}for(let xe of ie.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ce=K(xe);if(ce!=null){S(null),oe.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ce);break}}}});return j.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>j.disconnect()},[e,S]),useEffect(()=>{let{scrollX:K,scrollY:j}=window;G(h.left+K),ne(h.top+j);},[h.left,h.top]),w==null)return null;let de="0";typeof window!="undefined"&&(de=window.getComputedStyle(w).borderRadius);let M=Rn({props:d,alignAttr:F,sideAttr:H});return jsxs(me.Root,p(a({defaultOpen:!0},O),{children:[jsx(me.Anchor,{virtualRef:oe}),jsx(me.Portal,{children:jsxs(Fragment,{children:[l&&jsx(x,a({animation:`${kn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:de,height:h.height,left:N,top:ee,width:h.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(me.Content,p(a({},v),{ref:P,children:jsxs(Fragment,{children:[Z()&&jsx(b,p(a({animation:`${kn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:s},k),{children:o})),jsx(Fn,{onClick:()=>{B(()=>(typeof O.onOpenChange=="function"&&O.onOpenChange(!Z()),!Z()));},style:M})]})}),C)]})})]}))}Fe.Close=e=>jsx(me.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}))});Fe.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsx(ve,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};Fe.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};Fe.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(T.Body2,p(a({part:"progress"},o),{children:e}))};Fe.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};Fe.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(T.Body2,p(a({part:"subtitle"},o),{children:e}))};Fe.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(T.H4,p(a({part:"title"},o),{children:e}))};function cl(){let e=useContext(A);(!e||!e.frigade)&&Se("useUser() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=o==null?void 0:o.config.userId;function r(i){return V(this,null,function*(){yield o.identify(t,i);})}function n(i,l){return V(this,null,function*(){yield o.track(i,l);})}return {userId:t,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}function ml(){var l;let e=useContext(A);(!e||!e.frigade)&&Se("useGroup() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=(l=o==null?void 0:o.getConfig())==null?void 0:l.groupId;function r(s){return V(this,null,function*(){if(!o.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(o.config.groupId,s);})}function n(s,d){return V(this,null,function*(){yield o.track(s,d);})}function i(s,d){return V(this,null,function*(){yield o.group(s,d);})}return {groupId:t,setGroupId:i,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}
88
90
 
89
- export { et as Announcement, Io as Banner, pe as BaseField, x as Box, D as Button, P as Card, io as Checklist, Ko as ClientPortal, Qo as Collection, $ as Dialog, F as Flex, z as Flow, Ve as Form, Zo as Hint, Co as Image, Wo as Label, Pe as Media, ve as Progress, Rs as ProgressBadge, Yr as Provider, _o as RadioField, zo as SelectField, Xo as Spotlight, uo as Survey, R as Text, Uo as TextField, Go as TextareaField, Se as Tooltip, yo as Tour, So as Video, ko as themeVariables, Ye as tokens, fo as useBoundingClientRect, Te as useFlow, rt as useFlowHandlers, ot as useFrigade, $s as useGroup, ye as useStepHandlers, Is as useUser };
91
+ export { xt as Announcement, Xo as Banner, pe as BaseField, x as Box, D as Button, b as Card, vo as Checklist, ut as ClientPortal, yt as Collection, $ as Dialog, R as Flex, L as Flow, ze as Form, ft as Hint, $o as Image, at as Label, ve as Media, Qe as Popover, be as Progress, nl as ProgressBadge, gn as Provider, lt as RadioField, pt as SelectField, qe as Spotlight, Bo as Survey, T as Text, dt as TextField, ct as TextareaField, Fe as Tooltip, Eo as Tour, Ao as Video, Uo as themeVariables, lo as tokens, Ze as useAutoScroll, bo as useBoundingClientRect, Oe as useFlow, Pt as useFlowHandlers, ht as useFrigade, ml as useGroup, ae as useStepHandlers, cl as useUser };
90
92
  //# sourceMappingURL=out.js.map
91
93
  //# sourceMappingURL=index.js.map