@frigade/react 2.5.8 → 2.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1870,6 +1870,48 @@ interface TourProps extends FlowPropsWithoutChildren, Omit<HintProps, 'anchor'>
1870
1870
  * Defaults to `true`, which means only one step will be rendered at a time in sequential order.
1871
1871
  */
1872
1872
  sequential?: boolean;
1873
+ /**
1874
+ * The alignment of the tooltip relative to the anchor.
1875
+ * Possible values: `after`, `before`, `center`, `end`, `start`.
1876
+ */
1877
+ align?: AlignValue;
1878
+ /**
1879
+ * The offset of the tooltip relative to the anchor along the alignment axis.
1880
+ */
1881
+ alignOffset?: number;
1882
+ /**
1883
+ * The CSS selector or DOM element to anchor the tooltip to.
1884
+ */
1885
+ anchor: string;
1886
+ /**
1887
+ * Whether the tooltip should be open by default.
1888
+ */
1889
+ defaultOpen?: boolean;
1890
+ /**
1891
+ * Whether to render a modal overlay behind the tooltip.
1892
+ */
1893
+ modal?: boolean;
1894
+ /**
1895
+ * Callback function triggered when the open state of the tooltip changes.
1896
+ */
1897
+ onOpenChange?: (open: boolean) => void;
1898
+ /**
1899
+ * Controls the open state of the tooltip. Use this for controlled components.
1900
+ */
1901
+ open?: boolean;
1902
+ /**
1903
+ * The preferred side of the anchor to render the tooltip.
1904
+ * Possible values: `top`, `right`, `bottom`, `left`.
1905
+ */
1906
+ side?: SideValue;
1907
+ /**
1908
+ * The distance in pixels from the tooltip to the anchor element.
1909
+ */
1910
+ sideOffset?: number;
1911
+ /**
1912
+ * Whether to highlight the anchor element with a spotlight/scrim effect.
1913
+ */
1914
+ spotlight?: boolean;
1873
1915
  }
1874
1916
  declare function Tour({ align, alignOffset, as, defaultOpen, dismissible, flowId, modal, part, sequential, side, sideOffset, spotlight, zIndex, ...props }: TourProps): React$1.ReactPortal;
1875
1917
 
package/dist/index.js CHANGED
@@ -5,30 +5,30 @@ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
5
5
  import * as Fo from 'react';
6
6
  import { createContext, useContext, useCallback, useState, useEffect, useRef, useMemo, useSyncExternalStore, useLayoutEffect, Fragment as Fragment$1 } from 'react';
7
7
  import { clsx } from 'clsx';
8
- import on from 'known-css-properties';
9
- import cn from 'dompurify';
8
+ import tn from 'known-css-properties';
9
+ import un 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 oi from 'embla-carousel-react';
13
+ import ti from 'embla-carousel-react';
14
14
  import * as Te from '@radix-ui/react-collapsible';
15
15
  import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
16
16
  import * as De from '@radix-ui/react-radio-group';
17
- import * as L from '@radix-ui/react-select';
18
- import * as no from '@radix-ui/react-checkbox';
17
+ import * as N from '@radix-ui/react-select';
18
+ import * as ro from '@radix-ui/react-checkbox';
19
19
  import { RemoveScroll } from 'react-remove-scroll';
20
20
  import { useFloating, autoUpdate, offset, flip, shift, useClick, useDismiss, useRole, useInteractions } from '@floating-ui/react';
21
21
  import { createPortal } from 'react-dom';
22
22
  import * as re from '@radix-ui/react-popover';
23
23
 
24
- var qo=Object.defineProperty,Xr=Object.defineProperties;var Jr=Object.getOwnPropertyDescriptors;var je=Object.getOwnPropertySymbols;var Zo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable;var Jo=(e,o,t)=>o in e?qo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Zo.call(o,t)&&Jo(e,t,o[t]);if(je)for(var t of je(o))Yo.call(o,t)&&Jo(e,t,o[t]);return e},s=(e,o)=>Xr(e,Jr(o));var qr=(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 n in e)Zo.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&je)for(var n of je(e))o.indexOf(n)<0&&Yo.call(e,n)&&(t[n]=e[n]);return t};var ie=(e,o)=>{for(var t in o)qo(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((n,r)=>{var a=d=>{try{l(t.next(d));}catch(u){r(u);}},p=d=>{try{l(t.throw(d));}catch(u){r(u);}},l=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,p);l((t=t.apply(e,o)).next());});function Fe(e){return jsx("svg",s(i({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 et={borderWidths:{md:"1px"}};var Xe=[5,10,20,35,50,65,80,95,98],ot=[...Xe],ho=[...Xe];ot[4]=40;ho[4]=60;var Zr={blue:{h:213,s:100,l:Xe},gray:{h:220,s:10,l:Xe},green:{h:141,s:90,l:ot},red:{h:9,s:90,l:ho},yellow:{h:50,s:90,l:ho}};var W={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Zr))W[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var tt=s(i({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.blue[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var rt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,nt={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("white"),border:c("neutral-900"),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-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")},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 it={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Yr="px",Qr=e=>typeof e=="number"?`${4*e}${Yr}`:e,en=[-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"],at=Object.fromEntries(en.map(e=>[e,Qr(e)]));var st={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 Je=s(i(s(i({},et),{colors:i(i({},tt),nt)}),st),{radii:rt,shadows:it,space:at});function Ae(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let p=`${o.length?`${o}${t}`:""}${r}`,l=e[r];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(n,Ae(l,p,t)):n[p]=l,n},{})}function bo(e){let o=Ae(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function lt(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=lt(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var Po=bo(Je),D=lt(Je);var tn=new Set(["alt","size","src"]),rn=on.all.filter(e=>e.indexOf("-")!=0&&!tn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),nn=Object.fromEntries(rn),qe=Ae(D.colors),an={color:qe,backgroundColor:qe,borderColor:qe,border:i(i({},D.borderWidths),qe),borderRadius:D.radii,borderWidth:D.borderWidths,boxShadow:D.shadows,fontFamily:D.fontFamilies,fontSize:D.fontSizes,fontWeight:D.fontWeights,gap:D.space,lineHeight:D.lineHeights,margin:D.space,marginBottom:D.space,marginLeft:D.space,marginRight:D.space,marginTop:D.space,padding:D.space,paddingBottom:D.space,paddingLeft:D.space,paddingRight:D.space,paddingTop:D.space},pt=i(i({},nn),an),dt={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"]},ct=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function sn(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 ut=new Map(Object.entries(pt).map(([e,o])=>[e,sn(o)])),ln=new Map(Object.entries(dt).map(([e,o])=>[e,new Set(o)])),pn=new Set(["height","width"]),dn=new Set(["canvas","embed","iframe","img","input","object","video"]);function mt(e){let[o,t]=e.split(":");return [o,ct.has(t)?t:null]}function ft(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let l=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[l]==null&&(n[l]={}),n[l]}return Object.entries(t).forEach(([a,p])=>{let[l,d]=mt(a),u=ln.get(l);u!=null&&(u.forEach(m=>{let y=`${m}${d?":"+d:""}`;t[y]=p;}),delete t[a]);}),Object.entries(t).forEach(([a,p])=>{let[l,d]=mt(a),u=ut.get(l);if(u!=null){if(p==null)delete t[a];else if(typeof p=="string"&&p.indexOf(" ")>-1){let m=p.split(" ");r(d)[l]=m.map(y=>{var h;return (h=u.get(y.toString()))!=null?h:y}).join(" ");}else u.has(p.toString())?r(d)[l]=u.get(p.toString()):r(d)[l]=p;(typeof o!="string"||!dn.has(o)||!pn.has(l))&&delete t[a];}}),Object.keys(t).forEach(a=>{let p=a.substring(1);a.indexOf("_")===0&&ut.has(p)&&(t[p]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function un(){if(typeof window=="undefined"){let{JSDOM:e}=qr("jsdom");return new e("<!DOCTYPE html>").window}return window}function gt(e){return e?{__html:cn(un()).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 fn(e){return e&&`fr-${e}`}function ht(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>ht(o)).join(" "):fn(e))}function gn(l,p){var d=l,{as:e,children:o,className:t,css:n={},part:r}=d,a=f(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:m,unmatchedProps:y}=ft(a,u),h=ht(r),x=t||h?clsx(t,h):void 0,v=[{boxSizing:"border-box"},m,n];return typeof o=="string"?jsx(u,s(i({className:x,css:v},y),{ref:p,dangerouslySetInnerHTML:gt(o)})):jsx(u,s(i({className:x,css:v},y),{ref:p,children:o}))}var g=Fo.forwardRef(gn);var O={};ie(O,{Link:()=>Un,Plain:()=>Gn,Primary:()=>_n,Secondary:()=>zn});var F={};ie(F,{Body1:()=>On,Body2:()=>In,Caption:()=>Hn,Display1:()=>Rn,Display2:()=>Bn,H1:()=>Tn,H2:()=>kn,H3:()=>En,H4:()=>Dn});var Co={};ie(Co,{Body1:()=>Sn,Body2:()=>wn,Caption:()=>Fn,Display1:()=>yn,Display2:()=>xn,H1:()=>hn,H2:()=>bn,H3:()=>Pn,H4:()=>Cn});var ae={color:"neutral.foreground",fontFamily:"default",margin:"0"},yn=s(i({},ae),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),xn=s(i({},ae),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),hn=s(i({},ae),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),bn=s(i({},ae),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Pn=s(i({},ae),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Cn=s(i({},ae),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Sn=s(i({},ae),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),wn=s(i({},ae),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Fn=s(i({},ae),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var vn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],se=Object.fromEntries(vn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Fo.forwardRef((l,p)=>{var d=l,{as:n=o,children:r}=d,a=f(d,["as","children"]);return jsx(g,s(i(i({as:n},Co[e]),a),{ref:p,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Rn=se.Display1,Bn=se.Display2,Tn=se.H1,kn=se.H2,En=se.H3,Dn=se.H4,On=se.Body1,In=se.Body2,Hn=se.Caption;var wo={};ie(wo,{Link:()=>Vn,Plain:()=>Ln,Primary:()=>Mn,Secondary:()=>Wn,loadingCSSStyle:()=>So});var Ze={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Mn=s(i({},Ze),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),Wn=s(i({},Ze),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Vn=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Ln=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Nn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),So={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:Nn+" 1s ease infinite"}};function Ye(p){var l=p,{as:e,children:o,part:t,title:n,variant:r="Primary"}=l,a=f(l,["as","children","part","title","variant"]);var u;let d=r.toLocaleLowerCase();return jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${d}`,t]},wo[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?So:{})}),a),{loading:void 0,children:[o,n&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function _n(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Primary",children:e}))}function zn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Secondary",children:e}))}function Un(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Link",children:e}))}function Gn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Plain",children:e}))}var S={};ie(S,{Column:()=>Xn,Row:()=>jn});var jn=Fo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Xn=Fo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function vo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=f(a,["dismissible","flowId","part"]);return jsx(z,s(i({as:null,flowId:o},n),{children:({handleDismiss:p,handlePrimary:l,handleSecondary:d,parentProps:{containerProps:u},step:m})=>{var R,T,w,P,C;let y=(R=m.props)!=null?R:{},h=(w=(T=m.primaryButton)==null?void 0:T.title)!=null?w:m.primaryButtonTitle,x=(C=(P=m.secondaryButton)==null?void 0:P.title)!=null?C:m.secondaryButtonTitle,v=m.$state.blocked;return jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),y),{children:[m.imageUri&&jsx(g,{as:"img",part:"image",src:m.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:m.title}),jsx(b.Subtitle,{part:"subtitle",children:m.subtitle})]}),jsx(b.Secondary,{disabled:v,title:x,onClick:d}),jsx(b.Primary,{disabled:v,title:h,onClick:l}),e&&jsx(b.Dismiss,{onClick:p})]}))}}))}var to={};ie(to,{Carousel:()=>Vt,Collapsible:()=>oo,CollapsibleStep:()=>Ve});var Re={};ie(Re,{Bar:()=>ve,Dots:()=>Ft,Fraction:()=>Qe,Segments:()=>Rt});function ve(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,p=a===0?"10px":`${100*a}%`;return jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:p},transition:"width 300ms ease-out"})}))}function Ft(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((p,l)=>jsx(g,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?D.colors.blue500:D.colors.blue800},l));return jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Qe(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);return jsx(F.Body2,s(i({part:"progress-fraction"},t),{children:`${e}/${o}`}))}function Rt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=[...Array(o)].map((p,l)=>jsx(g,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsx(S.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Tt(e){return jsx("svg",s(i({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 qn(){return jsx(g,{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 kt(t){var n=t,{checked:e=!1}=n,o=f(n,["checked"]);return jsx(g,s(i({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(g,{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(qn,{})})}))}function le(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(_),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,p,l=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,a,p))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(p,l)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(p,l),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,p)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a,p))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(p),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(p),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Dt({onPrimary:e,onSecondary:o,step:t}){var u,m;let{handlePrimary:n,handleSecondary:r}=le(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:p,skipped:l}=t.$state,d=p||l||!a?jsx(kt,{checked:p||l,marginLeft:"auto"}):jsx(g,{as:Tt,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:a,opacity:a?.5:1,children:[jsxs(S.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(S.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:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(b.Primary,{disabled:a,onClick:n,title:(m=t.primaryButton)==null?void 0:m.title})]})]})}function It(e){return jsx("svg",s(i({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 $t(e){return jsx("svg",s(i({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 At=keyframes`
24
+ var Zo=Object.defineProperty,Jr=Object.defineProperties;var qr=Object.getOwnPropertyDescriptors;var Ke=Object.getOwnPropertySymbols;var Yo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable;var qo=(e,t,o)=>t in e?Zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))Yo.call(t,o)&&qo(e,o,t[o]);if(Ke)for(var o of Ke(t))Qo.call(t,o)&&qo(e,o,t[o]);return e},l=(e,t)=>Jr(e,qr(t));var Zr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,o)=>(typeof require!="undefined"?require:t)[o]}):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,t)=>{var o={};for(var n in e)Yo.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&Ke)for(var n of Ke(e))t.indexOf(n)<0&&Qo.call(e,n)&&(o[n]=e[n]);return o};var ie=(e,t)=>{for(var o in t)Zo(e,o,{get:t[o],enumerable:!0});};var M=(e,t,o)=>new Promise((n,r)=>{var a=d=>{try{s(o.next(d));}catch(u){r(u);}},p=d=>{try{s(o.throw(d));}catch(u){r(u);}},s=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,p);s((o=o.apply(e,t)).next());});function Fe(e){return jsx("svg",l(i({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 ot={borderWidths:{md:"1px"}};var je=[5,10,20,35,50,65,80,95,98],tt=[...je],ho=[...je];tt[4]=40;ho[4]=60;var Yr={blue:{h:213,s:100,l:je},gray:{h:220,s:10,l:je},green:{h:141,s:90,l:tt},red:{h:9,s:90,l:ho},yellow:{h:50,s:90,l:ho}};var W={};for(let[e,{h:t,s:o,l:n}]of Object.entries(Yr))W[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${t} ${o}% ${r}%)`]));var rt=l(i({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.blue[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var nt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,it={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("white"),border:c("neutral-900"),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-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")},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 at={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Qr="px",en=e=>typeof e=="number"?`${4*e}${Qr}`:e,on=[-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"],st=Object.fromEntries(on.map(e=>[e,en(e)]));var lt={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var Xe=l(i(l(i({},ot),{colors:i(i({},rt),it)}),lt),{radii:nt,shadows:at,space:st});function Ae(e,t="",o="."){return Object.keys(e).reduce((n,r)=>{let p=`${t.length?`${t}${o}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(n,Ae(s,p,o)):n[p]=s,n},{})}function bo(e){let t=Ae(e,"--fr","-");for(let[o,n]of Object.entries(t))if(o.indexOf(".")>-1){let r=o.replace(/\./g,"-");t[r]=n,delete t[o];}return t}function pt(e,t="--fr"){let o={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?o[n]=pt(r,`${t}-${n}`):o[n]=`var(${t}-${a})`;}),o}var Po=bo(Xe),D=pt(Xe);var rn=new Set(["alt","size","src"]),nn=tn.all.filter(e=>e.indexOf("-")!=0&&!rn.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),an=Object.fromEntries(nn),Je=Ae(D.colors),sn={color:Je,backgroundColor:Je,borderColor:Je,border:i(i({},D.borderWidths),Je),borderRadius:D.radii,borderWidth:D.borderWidths,boxShadow:D.shadows,fontFamily:D.fontFamilies,fontSize:D.fontSizes,fontWeight:D.fontWeights,gap:D.space,lineHeight:D.lineHeights,margin:D.space,marginBottom:D.space,marginLeft:D.space,marginRight:D.space,marginTop:D.space,padding:D.space,paddingBottom:D.space,paddingLeft:D.space,paddingRight:D.space,paddingTop:D.space},dt=i(i({},an),sn),ct={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"]},ut=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function ln(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var mt=new Map(Object.entries(dt).map(([e,t])=>[e,ln(t)])),pn=new Map(Object.entries(ct).map(([e,t])=>[e,new Set(t)])),dn=new Set(["height","width"]),cn=new Set(["canvas","embed","iframe","img","input","object","video"]);function ft(e){let[t,o]=e.split(":");return [t,ut.has(o)?o:null]}function gt(e,t="div"){let o=Object.assign({},e),n={};function r(a){if(a==null)return n;let s=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[s]==null&&(n[s]={}),n[s]}return Object.entries(o).forEach(([a,p])=>{let[s,d]=ft(a),u=pn.get(s);u!=null&&(u.forEach(m=>{let g=`${m}${d?":"+d:""}`;o[g]=p;}),delete o[a]);}),Object.entries(o).forEach(([a,p])=>{let[s,d]=ft(a),u=mt.get(s);if(u!=null){if(p==null)delete o[a];else if(typeof p=="string"&&p.indexOf(" ")>-1){let m=p.split(" ");r(d)[s]=m.map(g=>{var b;return (b=u.get(g.toString()))!=null?b:g}).join(" ");}else u.has(p.toString())?r(d)[s]=u.get(p.toString()):r(d)[s]=p;(typeof t!="string"||!cn.has(t)||!dn.has(s))&&delete o[a];}}),Object.keys(o).forEach(a=>{let p=a.substring(1);a.indexOf("_")===0&&mt.has(p)&&(o[p]=o[a],delete o[a]);}),{cssFromProps:n,unmatchedProps:o}}function mn(){if(typeof window=="undefined"){let{JSDOM:e}=Zr("jsdom");return new e("<!DOCTYPE html>").window}return window}function yt(e){return e?{__html:un(mn()).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 gn(e){return e&&`fr-${e}`}function bt(e){return e&&(Array.isArray(e)?e.filter(t=>t!=null).map(t=>bt(t)).join(" "):gn(e))}function yn(s,p){var d=s,{as:e,children:t,className:o,css:n={},part:r}=d,a=f(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:m,unmatchedProps:g}=gt(a,u),b=bt(r),x=o||b?clsx(o,b):void 0,T=[{boxSizing:"border-box"},m,n];return typeof t=="string"?jsx(u,l(i({className:x,css:T},g),{ref:p,dangerouslySetInnerHTML:yt(t)})):jsx(u,l(i({className:x,css:T},g),{ref:p,children:t}))}var y=Fo.forwardRef(yn);var O={};ie(O,{Link:()=>Gn,Plain:()=>Kn,Primary:()=>zn,Secondary:()=>Un});var F={};ie(F,{Body1:()=>In,Body2:()=>Hn,Caption:()=>$n,Display1:()=>Bn,Display2:()=>Tn,H1:()=>kn,H2:()=>En,H3:()=>Dn,H4:()=>On});var Co={};ie(Co,{Body1:()=>wn,Body2:()=>Fn,Caption:()=>vn,Display1:()=>xn,Display2:()=>hn,H1:()=>bn,H2:()=>Pn,H3:()=>Cn,H4:()=>Sn});var ae={color:"neutral.foreground",fontFamily:"default",margin:"0"},xn=l(i({},ae),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),hn=l(i({},ae),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),bn=l(i({},ae),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Pn=l(i({},ae),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Cn=l(i({},ae),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Sn=l(i({},ae),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),wn=l(i({},ae),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Fn=l(i({},ae),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),vn=l(i({},ae),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Rn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],se=Object.fromEntries(Rn.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",o=Fo.forwardRef((s,p)=>{var d=s,{as:n=t,children:r}=d,a=f(d,["as","children"]);return jsx(y,l(i(i({as:n},Co[e]),a),{ref:p,children:r}))});return o.displayName=`Text.${e}`,[e,o]})),Bn=se.Display1,Tn=se.Display2,kn=se.H1,En=se.H2,Dn=se.H3,On=se.H4,In=se.Body1,Hn=se.Body2,$n=se.Caption;var wo={};ie(wo,{Link:()=>Ln,Plain:()=>Nn,Primary:()=>Wn,Secondary:()=>Vn,loadingCSSStyle:()=>So});var qe={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Wn=l(i({},qe),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),Vn=l(i({},qe),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Ln=l(i({},qe),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Nn=l(i({},qe),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),_n=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),So={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:_n+" 1s ease infinite"}};function Ze(p){var s=p,{as:e,children:t,part:o,title:n,variant:r="Primary"}=s,a=f(s,["as","children","part","title","variant"]);var u;let d=r.toLocaleLowerCase();return jsxs(y,l(i(l(i({as:e!=null?e:"button",part:[`button-${d}`,o]},wo[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?So:{})}),a),{loading:void 0,children:[t,n&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function zn(o){var n=o,{children:e}=n,t=f(n,["children"]);return jsx(Ze,l(i({},t),{variant:"Primary",children:e}))}function Un(o){var n=o,{children:e}=n,t=f(n,["children"]);return jsx(Ze,l(i({},t),{variant:"Secondary",children:e}))}function Gn(o){var n=o,{children:e}=n,t=f(n,["children"]);return jsx(Ze,l(i({},t),{variant:"Link",children:e}))}function Kn(o){var n=o,{children:e}=n,t=f(n,["children"]);return jsx(Ze,l(i({},t),{variant:"Plain",children:e}))}var S={};ie(S,{Column:()=>Jn,Row:()=>Xn});var Xn=Fo.forwardRef((e,t)=>jsx(y,l(i({display:"flex",flexDirection:"row"},e),{ref:t}))),Jn=Fo.forwardRef((e,t)=>jsx(y,l(i({display:"flex",flexDirection:"column"},e),{ref:t})));function vo(r){var a=r,{dismissible:e,flowId:t,part:o}=a,n=f(a,["dismissible","flowId","part"]);return jsx(z,l(i({as:null,flowId:t},n),{children:({handleDismiss:p,handlePrimary:s,handleSecondary:d,parentProps:{containerProps:u},step:m})=>{var v,B,w,P,C;let g=(v=m.props)!=null?v:{},b=(w=(B=m.primaryButton)==null?void 0:B.title)!=null?w:m.primaryButtonTitle,x=(C=(P=m.secondaryButton)==null?void 0:P.title)!=null?C:m.secondaryButtonTitle,T=m.$state.blocked;return jsxs(h,l(i(i({alignItems:"center","aria-label":"Banner",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",o],role:"complementary"},u),g),{children:[m.imageUri&&jsx(y,{as:"img",part:"image",src:m.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:m.title}),jsx(h.Subtitle,{part:"subtitle",children:m.subtitle})]}),jsx(h.Secondary,{disabled:T,title:x,onClick:d}),jsx(h.Primary,{disabled:T,title:b,onClick:s}),e&&jsx(h.Dismiss,{onClick:p})]}))}}))}var oo={};ie(oo,{Carousel:()=>Lt,Collapsible:()=>eo,CollapsibleStep:()=>Ve});var Re={};ie(Re,{Bar:()=>ve,Dots:()=>vt,Fraction:()=>Ye,Segments:()=>Bt});function ve(n){var r=n,{current:e,total:t}=r,o=f(r,["current","total"]);let a=t>0?Math.min(e/t,1):0,p=a===0?"10px":`${100*a}%`;return jsx(y,l(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},o),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:p},transition:"width 300ms ease-out"})}))}function vt(n){var r=n,{current:e,total:t}=r,o=f(r,["current","total"]);if(t==1)return null;let a=[...Array(t)].map((p,s)=>jsx(y,{as:"circle",r:4,cx:4+16*s,cy:"4px",fill:e-1===s?D.colors.blue500:D.colors.blue800},s));return jsx(y,l(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8},o),{children:a}))}function Ye(n){var r=n,{current:e,total:t}=r,o=f(r,["current","total"]);return jsx(F.Body2,l(i({part:"progress-fraction"},o),{children:`${e}/${t}`}))}function Bt(n){var r=n,{current:e,total:t}=r,o=f(r,["current","total"]);let a=[...Array(t)].map((p,s)=>jsx(y,{backgroundColor:e-1===s?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},s));return jsx(S.Row,l(i({gap:1,height:"10px",part:"progress-segments"},o),{children:a}))}function kt(e){return jsx("svg",l(i({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 Zn(){return jsx(y,{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 Et(o){var n=o,{checked:e=!1}=n,t=f(n,["checked"]);return jsx(y,l(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},t),{children:e&&jsx(y,{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(Zn,{})})}))}function le(e,{onPrimary:t,onSecondary:o}={}){let{navigate:n}=useContext(V),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,p,s=!0)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a,p))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(p,s)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(p,s),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,p)=>M(this,null,function*(){if((yield o==null?void 0:o(e,a,p))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(p),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(p),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Ot({onPrimary:e,onSecondary:t,step:o}){var u,m;let{handlePrimary:n,handleSecondary:r}=le(o,{onPrimary:e,onSecondary:t}),{blocked:a,completed:p,skipped:s}=o.$state,d=p||s||!a?jsx(Et,{checked:p||s,marginLeft:"auto"}):jsx(y,{as:kt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(h,{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:a,opacity:a?.5:1,children:[jsxs(S.Row,{marginBottom:"2",part:"carousel-step-header",children:[o.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:o.iconUri,width:"24px"}),d]}),jsx(h.Title,{children:o.title}),jsx(h.Subtitle,{children:o.subtitle}),jsxs(S.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(h.Secondary,{disabled:a,onClick:r,title:(u=o.secondaryButton)==null?void 0:u.title}),jsx(h.Primary,{disabled:a,onClick:n,title:(m=o.primaryButton)==null?void 0:m.title})]})]})}function Ht(e){return jsx("svg",l(i({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 At(e){return jsx("svg",l(i({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 Mt=keyframes`
25
25
  from {
26
26
  opacity: 0;
27
27
  }
28
28
  to {
29
29
  opacity: 1;
30
30
  }
31
- `;function Mt({flow:e,sort:o,onPrimary:t,onSecondary:n}){var R,T;let[r,a]=useState(),[p]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(R=Array.from(e.steps.values()).find(w=>!w.$state.completed&&!w.$state.skipped))==null?void 0:R.order)!=null?T:0}),[l,d]=oi(p),[u,m]=useState(),[y,h]=useState();useLayoutEffect(()=>{d&&(u==null&&m(d.canScrollNext()),y==null&&h(d.canScrollPrev()),d.on("select",()=>{m(d.canScrollNext()),h(d.canScrollPrev());}));},[d]),useEffect(()=>{if(!r){let w=Array.from(e.steps.values()),P=w.filter(B=>B.$state.completed||B.$state.skipped).sort((B,k)=>B.order-k.order),C=w.filter(B=>!B.$state.completed&&!B.$state.skipped).sort((B,k)=>B.order-k.order);a(o==="completed-last"?[...C,...P].map(B=>B.id):w.map(B=>B.id));}},[]);let x=e.getNumberOfCompletedSteps(),v=e.getNumberOfAvailableSteps();return r?jsxs(Fragment,{children:[jsxs(S.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:D.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(S.Column,{part:"carousel-header-content",children:[jsx(F.H3,{children:e.title}),jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(S.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",v]}),jsx(ve,{current:x,total:v,minWidth:"200px"})]})]}),jsxs(g,{margin:`0 ${D.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:l,children:[jsx(S.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(w=>w.$state.visible).sort((w,P)=>r.indexOf(w.id)-r.indexOf(P.id)).map(w=>jsx(Dt,{onPrimary:t,onSecondary:n,step:w},w.id))}),y&&jsx(S.Column,{animation:`${At} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx($t,{height:"24px",width:"24px"})})}),u&&jsx(S.Column,{animation:`${At} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(It,{height:"24px",width:"24px"})})})]})]}):null}function Vt(o){var e=f(o,[]);return jsx(z,s(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(Mt,i(i({},e),t))}))}var Ve={};ie(Ve,{Content:()=>To,Root:()=>ko,Trigger:()=>Eo});function Nt(e){return jsx("svg",s(i({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 ri=keyframes`
31
+ `;function Wt({flow:e,sort:t,onPrimary:o,onSecondary:n}){var v,B;let[r,a]=useState(),[p]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:t=="completed-last"?0:(B=(v=Array.from(e.steps.values()).find(w=>!w.$state.completed&&!w.$state.skipped))==null?void 0:v.order)!=null?B:0}),[s,d]=ti(p),[u,m]=useState(),[g,b]=useState();useLayoutEffect(()=>{d&&(u==null&&m(d.canScrollNext()),g==null&&b(d.canScrollPrev()),d.on("select",()=>{m(d.canScrollNext()),b(d.canScrollPrev());}));},[d]),useEffect(()=>{if(!r){let w=Array.from(e.steps.values()),P=w.filter(R=>R.$state.completed||R.$state.skipped).sort((R,k)=>R.order-k.order),C=w.filter(R=>!R.$state.completed&&!R.$state.skipped).sort((R,k)=>R.order-k.order);a(t==="completed-last"?[...C,...P].map(R=>R.id):w.map(R=>R.id));}},[]);let x=e.getNumberOfCompletedSteps(),T=e.getNumberOfAvailableSteps();return r?jsxs(Fragment,{children:[jsxs(S.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:D.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(S.Column,{part:"carousel-header-content",children:[jsx(F.H3,{children:e.title}),jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(S.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",T]}),jsx(ve,{current:x,total:T,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${D.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsx(S.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(w=>w.$state.visible).sort((w,P)=>r.indexOf(w.id)-r.indexOf(P.id)).map(w=>jsx(Ot,{onPrimary:o,onSecondary:n,step:w},w.id))}),g&&jsx(S.Column,{animation:`${Mt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(At,{height:"24px",width:"24px"})})}),u&&jsx(S.Column,{animation:`${Mt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(Ht,{height:"24px",width:"24px"})})})]})]}):null}function Lt(t){var e=f(t,[]);return jsx(z,l(i({as:h,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:o=>jsx(Wt,i(i({},e),o))}))}var Ve={};ie(Ve,{Content:()=>To,Root:()=>ko,Trigger:()=>Eo});function _t(e){return jsx("svg",l(i({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 ni=keyframes`
32
32
  from {
33
33
  height: 0;
34
34
  opacity: 0;
@@ -37,7 +37,7 @@ var qo=Object.defineProperty,Xr=Object.defineProperties;var Jr=Object.getOwnProp
37
37
  height: var(--radix-collapsible-content-height);
38
38
  opacity: 1;
39
39
  }
40
- `,ni=keyframes`
40
+ `,ii=keyframes`
41
41
  from {
42
42
  height: var(--radix-collapsible-content-height);
43
43
  opacity: 1;
@@ -46,7 +46,7 @@ var qo=Object.defineProperty,Xr=Object.defineProperties;var Jr=Object.getOwnProp
46
46
  height: 0;
47
47
  opacity: 0;
48
48
  }
49
- `,ii=()=>jsx(g,{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 ai({checked:e=!1}){return jsx(g,{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(g,{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(ii,{})})})}function To({children:e}){return jsx(Te.Content,{asChild:!0,children:jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${ri} 300ms ease-out`},'&[data-state="closed"]':{animation:`${ni} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(g,{}),e]})})}function ko(a){var p=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=p,r=f(p,["children","disabled","onOpenChange","open"]);return jsx(Te.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Eo({isCompleted:e,isBlocked:o,title:t}){return jsx(Te.Trigger,{asChild:!0,children:jsxs(S.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(S.Row,{alignItems:"center",gap:2,children:[jsx(ai,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(g,{as:Nt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var zt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Ut({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var v,R,T,w,P,C;let{$state:{blocked:a,completed:p,skipped:l},subtitle:d,title:u}=r,m=(R=(v=r.primaryButton)==null?void 0:v.title)!=null?R:r.primaryButtonTitle,y=(w=(T=r.secondaryButton)==null?void 0:T.title)!=null?w:r.secondaryButtonTitle,h=(P=r.props)!=null?P:{},x=!!a;return jsxs(ko,s(i({open:t,onOpenChange:n},h),{children:[jsx(Eo,{isBlocked:r.$state.blocked,isCompleted:p||l,title:u}),jsxs(To,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=r.videoUri)!=null?C:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxs(S.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:y,onClick:o}),jsx(b.Primary,{disabled:x,title:m,onClick:e})]})]})]}))}var di={default:Ut};function ci(n){var r=n,{flow:e,step:o}=r,t=f(r,["flow","step"]);var R;let{onPrimary:a,onSecondary:p,openStepId:l,setOpenStepId:d,stepTypes:u}=useContext(zt),{handlePrimary:m,handleSecondary:y}=le(o,{onPrimary:a,onSecondary:p}),h=(l!=null?l:e.getCurrentStep().id)===o.id,x=(R=u[o.type])!=null?R:Ut;function v(T){return M(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(x,s(i({flow:e,onOpenChange:v,open:h,step:o},t),{handlePrimary:m,handleSecondary:y}),o.id)}function oo(l){var d=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=d,p=f(d,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,m]=useState(null),y=i(i({},di),a);return jsx(zt.Provider,{value:{openStepId:u,setOpenStepId:m,onPrimary:t,onSecondary:n,stepTypes:y},children:jsx(z,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},p),{children:R=>{var T=R,{flow:h,handleDismiss:x}=T,v=f(T,["flow","handleDismiss"]);let P=Array.from(h.steps.entries()).filter(([,k])=>k.$state.visible===!0).map(([,k])=>jsx(ci,s(i({flow:h,handleDismiss:x},v),{step:k}),k.id)),C=h.getNumberOfCompletedSteps(),B=h.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(S.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:x,part:"checklist-header",subtitle:h.subtitle,title:h.title}),jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxs(F.Body2,{fontWeight:"demibold",children:[C,"/",B]}),jsx(ve,{current:C,total:B,flexGrow:1})]})]}),P]})}}))})}var Pi=new Set(["required","min","max","minLength","maxLength","pattern"]);function Ci({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=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 a=Object.fromEntries(Object.entries(t).filter(([l])=>Pi.has(l))),p=useController({name:t.id,control:o,rules:a});return jsx(e,s(i({},p),{fieldData:t,formContext:r,submit:n}))}function jt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var C,B,k,$,V;let{__readOnly:p}=useContext(_),l=useMemo(()=>{var E,I;return (I=(E=a.fields)==null?void 0:E.filter(A=>e[A.type]!=null&&A.id))!=null?I:[]},[a.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:l.reduce((E,I)=>{var A;return E[I.id]=(A=I.value)!=null?A:"",E},{})});useEffect(()=>{d.formState.isDirty||d.reset(l.reduce((E,I)=>{var A;return E[I.id]=(A=I.value)!=null?A:"",E},{}));},[l]);let[u,m]=useState(!1),y=[],{control:h,handleSubmit:x}=d,v=(C=a.props)!=null?C:{};function R(E,I){m(!0),t(I,E,p===!0).then(()=>m(!1));}l.forEach(E=>{e[E.type]!=null&&y.push(jsx(Ci,{control:h,fieldComponent:e[E.type],fieldData:E,submit:x(R)},`${a.flow.id}-${E.id}`));});let T=(k=(B=a.primaryButton)==null?void 0:B.title)!=null?k:a.primaryButtonTitle,w=(V=($=a.secondaryButton)==null?void 0:$.title)!=null?V:a.secondaryButtonTitle,P=!!(a.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[a]),jsxs(S.Column,s(i({gap:5,part:"form-step"},v),{children:[jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,s(i({},d),{children:y})),jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[w&&jsx(O.Secondary,{onClick:n,title:w}),jsx(O.Primary,{disabled:P||u,onClick:x(R),title:T!=null?T:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Xt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function Do({children:e,id:o,required:t=!1}){return jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Oo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Le=s(i({},Oo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),ro={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 Y({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:p}=t,{error:l}=n,d=s(i(i(i({id:r},o),p?{placeholder:p}:{}),Le),{"aria-invalid":!!l,value:(u=o.value)!=null?u:""});return jsxs(g,{part:"field",children:[jsx(Do,{id:r,required:!!t.required,children:a}),e(d),jsx(Xt,{error:l})]})}function Ee(e){return jsx("svg",s(i({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 Ri=Fo.forwardRef(({label:e,value:o},t)=>jsxs(g,{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(F.Body2,{part:"field-radio-label",children:e}),jsx(De.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(g,{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(g,s(i({as:De.Indicator},ro),{children:jsx(Ee,{height:"14",width:"14"})}))})})]}));function Io(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:p})=>jsx(Ri,{value:p,label:a},p));return jsx(Y,s(i({},e),{children:()=>jsx(De.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Qt(e){return jsx("svg",s(i({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 or(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=Fo.useState([]);function p(l){let d=[];r.includes(l)?d=[...r.filter(u=>u!==l)]:d=[...r,l],a(d),o(d);}return jsx(Y,s(i({},e),{children:()=>jsx(S.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:l,value:d})=>jsx(no.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>p(d),asChild:!0,children:jsxs(g,{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(F.Body2,{part:"field-check-label",children:l}),jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:d,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(no.Indicator,{asChild:!0,children:jsx(g,s(i({},ro),{children:jsx(Ee,{height:"14",width:"14"})}))})})]})},d))})}))}var ki=Fo.forwardRef(({label:e,value:o},t)=>jsx(L.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(L.ItemText,{asChild:!0,children:jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function Ho(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:p,value:l})=>jsx(ki,{value:l,label:p},l));return e.fieldData.multiple?jsx(or,i({},e)):jsx(Y,s(i({},e),{children:()=>jsxs(L.Root,{value:t,onValueChange:o,children:[jsx(L.Trigger,{asChild:!0,children:jsxs(F.Body2,s(i({},Le),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(L.Value,{placeholder:r!=null?r:"Select one"}),jsx(L.Icon,{children:jsx(g,{as:Qt,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(g,s(i({},Le),{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:a})}))})})]})}))}function $o(e){return jsx(Y,s(i({},e),{children:o=>jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Ao(e){return jsx(Y,s(i({},e),{children:o=>jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function ar(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(no.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(g,s(i({},Oo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsx(no.Indicator,{asChild:!0,children:jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ee,{height:"14",fill:"currentColor"})})})}))}),jsx(F.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var Di={checkbox:ar,radio:Io,select:Ho,text:$o,textarea:Ao};function Ie(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=f(a,["fieldTypes","flowId","part"]);let p=Object.assign({},Di,e);return jsx(z,s(i({flowId:o,part:["form",t]},n),{children:l=>jsx(jt,i({fieldTypes:p},l))}))}var so={};ie(so,{NPS:()=>_e});function pr({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((p,l)=>{let d=e.value===l?O.Primary:O.Secondary;return jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxs(S.Column,{gap:2,children:[jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function _e(a){var p=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=p,r=f(p,["as","flowId","fieldTypes","part"]);let{flow:l}=Se(o);return jsx(Ie,s(i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:pr},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||l.skip();},part:["nps",n]},r),{css:i({},i(s(i({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}}),r.css))}))}function Hi(r,n){var a=r,{children:e,part:o}=a,t=f(a,["children","part"]);return jsx(RemoveScroll,{forwardProps:!0,ref:n,children:jsx(g,s(i({backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",o],position:"absolute"},t),{children:e}))})}var lo=Fo.forwardRef(Hi);var Ai=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function mr(n){var r=n,{clickable:e=!1,part:o=""}=r,t=f(r,["clickable","part"]);return jsxs(g,s(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${o}`,position:"relative",width:"24px",cursor:e?"pointer":void 0},t),{children:[jsx(g,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${Ai}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(g,{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 _i({maxX:e,maxY:o,radius:t,x1:n,x2:r,y1:a,y2:p}){return t>0?`path("${[`M${n+t},${a}`,`H${r-t}`,`A${t} ${t} 0,0,1 ${r} ${a+t}`,`V${p-t}`,`A${t} ${t} 0,0,1 ${r-t} ${p}`,`H${n+t}`,`A${t} ${t} 0,0,1 ${n} ${p-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${n}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${n+t} ${a}`,"Z"].join(" ")}")`:`path("M${n},${a} H${r} V${p} H${n} V${o} H${e} V0 H0 V${o} H${n} Z")`}function zi(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 Mo(r){var a=r,{anchor:e,part:o,style:t={}}=a,n=f(a,["anchor","part","style"]);let[p,l]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=useFloating({middleware:[{name:"clipPath",fn({elements:u,rects:m}){return l({maxX:u.floating.clientWidth,maxY:u.floating.clientHeight,radius:zi(u.reference),x1:m.reference.x,x2:m.reference.x+m.reference.width,y1:m.reference.y,y2:m.reference.y+m.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{let u=document.querySelector(e);u!=null?d.setReference(u):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);},[e]),jsx(lo,i({part:["spotlight",o],ref:d.setFloating,style:i({clipPath:_i(p)},t)},n))}function fr({align:e,side:o}){let t={},n="-12px",r={top:"bottom",right:"left",bottom:"top",left:"right"};return t[r[o]]=n,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=n:t.bottom=n:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=n:t.top=n:["top","bottom"].includes(o)?t.left=`calc(50% + ${n})`:t.top=`calc(50% + ${n})`,t}function yr(e,o){if(e.matches(o))return xr(e)?e:null;let t=e.querySelectorAll(o);return t.length>0&&xr(t[0])?t[0]:null}function xr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function hr(e){let[o,t]=useState(null);return useEffect(()=>{let n=document.querySelector(e);n!=null&&t(n);},[e]),useEffect(()=>{let n=new MutationObserver(r=>{for(let a of r)if(a.type==="childList"){for(let p of a.addedNodes){if(p.nodeType!==Node.ELEMENT_NODE)continue;let l=yr(p,e);if(l!=null){t(l);break}}for(let p of a.removedNodes){if(p.nodeType!==Node.ELEMENT_NODE)continue;if(yr(p,e)!=null){t(null);break}}}});return n.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>n.disconnect()},[e]),{anchorElement:o}}function ta(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function br({align:e,alignOffset:o,anchor:t,onOpenChange:n=()=>{},open:r,side:a,sideOffset:p}){let l=`${a}-${ta(e)}`;function d({rects:B}){let k={alignmentAxis:o,mainAxis:p};return ["after","before"].includes(e)&&(["bottom","top"].includes(a)?k.alignmentAxis=o-B.floating.width:k.alignmentAxis=o-B.floating.height),k}let{context:u,floatingStyles:m,placement:y,refs:h}=useFloating({middleware:[offset(d,[e,o,a,p]),flip(),shift()],onOpenChange:n,open:r,placement:l,whileElementsMounted:autoUpdate}),x=useClick(u),v=useDismiss(u,{outsidePress:!1}),R=useRole(u),{getFloatingProps:T,getReferenceProps:w}=useInteractions([x,v,R]),{anchorElement:P}=hr(t);useEffect(()=>{P!=null?h.setReference(P):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[P]);let C=y.split("-");return e==="before"?C[1]=C[1]==="end"?"after":"before":e==="after"&&(C[1]=C[1]==="start"?"before":"after"),{context:u,getFloatingProps:T,getReferenceProps:w,floatingStyles:m,placement:C.join("-"),refs:h}}function Vo(v){var R=v,{align:e="center",alignOffset:o=0,anchor:t,children:n,defaultOpen:r=!0,modal:a=!1,onOpenChange:p=()=>{},open:l,part:d,side:u="bottom",sideOffset:m=0,spotlight:y=!1,style:h={}}=R,x=f(R,["align","alignOffset","anchor","children","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,w]=useState(r),P=l!=null?l:T,{getFloatingProps:C,getReferenceProps:B,floatingStyles:k,placement:$,refs:V}=br({align:e,alignOffset:o,anchor:t,onOpenChange:he=>{p(he),l==null&&w(he);},open:P,side:u,sideOffset:m}),[E,I]=$.split("-"),A=B();return V.reference.current==null?null:jsxs(Fragment,{children:[y&&P&&jsx(Mo,{anchor:t}),a&&!y&&P&&jsx(lo,{lockScroll:!0}),jsxs(g,s(i(i({part:["hint",d],ref:V.setFloating,style:i(i({},k),h)},C()),x),{children:[P&&n,jsx(mr,s(i({},A),{position:"absolute",style:fr({align:I,side:E}),clickable:r===!1}))]}))]})}var aa=keyframes`
49
+ `,ai=()=>jsx(y,{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 si({checked:e=!1}){return jsx(y,{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(y,{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(ai,{})})})}function To({children:e}){return jsx(Te.Content,{asChild:!0,children:jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${ni} 300ms ease-out`},'&[data-state="closed"]':{animation:`${ii} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function ko(a){var p=a,{children:e,disabled:t=!1,onOpenChange:o=()=>{},open:n=!1}=p,r=f(p,["children","disabled","onOpenChange","open"]);return jsx(Te.Root,{asChild:!0,disabled:t,open:n,onOpenChange:o,children:jsx(h,l(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Eo({isCompleted:e,isBlocked:t,title:o}){return jsx(Te.Trigger,{asChild:!0,children:jsxs(S.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:t?.4:1,disabled:t,pointerEvents:t?"none":"auto",cursor:t?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(S.Row,{alignItems:"center",gap:2,children:[jsx(si,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:o})]}),jsx(y,{as:_t,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ut=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Gt({handlePrimary:e,handleSecondary:t,open:o,onOpenChange:n,step:r}){var T,v,B,w,P,C;let{$state:{blocked:a,completed:p,skipped:s},subtitle:d,title:u}=r,m=(v=(T=r.primaryButton)==null?void 0:T.title)!=null?v:r.primaryButtonTitle,g=(w=(B=r.secondaryButton)==null?void 0:B.title)!=null?w:r.secondaryButtonTitle,b=(P=r.props)!=null?P:{},x=!!a;return jsxs(ko,l(i({open:o,onOpenChange:n},b),{children:[jsx(Eo,{isBlocked:r.$state.blocked,isCompleted:p||s,title:u}),jsxs(To,{children:[jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=r.videoUri)!=null?C:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(h.Subtitle,{color:"neutral.400",children:d}),jsxs(S.Row,{gap:3,part:"collapsible-footer",children:[jsx(h.Secondary,{title:g,onClick:t}),jsx(h.Primary,{disabled:x,title:m,onClick:e})]})]})]}))}var ci={default:Gt};function ui(n){var r=n,{flow:e,step:t}=r,o=f(r,["flow","step"]);var v;let{onPrimary:a,onSecondary:p,openStepId:s,setOpenStepId:d,stepTypes:u}=useContext(Ut),{handlePrimary:m,handleSecondary:g}=le(t,{onPrimary:a,onSecondary:p}),b=(s!=null?s:e.getCurrentStep().id)===t.id,x=(v=u[t.type])!=null?v:Gt;function T(B){return M(this,null,function*(){d(B?t.id:""),B&&!t.$state.completed&&(yield t.start(),d(null));})}return jsx(x,l(i({flow:e,onOpenChange:T,open:b,step:t},o),{handlePrimary:m,handleSecondary:g}),t.id)}function eo(s){var d=s,{dismissible:e,flowId:t,onPrimary:o,onSecondary:n,part:r,stepTypes:a={}}=d,p=f(d,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,m]=useState(null),g=i(i({},ci),a);return jsx(Ut.Provider,{value:{openStepId:u,setOpenStepId:m,onPrimary:o,onSecondary:n,stepTypes:g},children:jsx(z,l(i({as:h,borderWidth:"md",flowId:t,part:["checklist",r]},p),{children:v=>{var B=v,{flow:b,handleDismiss:x}=B,T=f(B,["flow","handleDismiss"]);let P=Array.from(b.steps.entries()).filter(([,k])=>k.$state.visible===!0).map(([,k])=>jsx(ui,l(i({flow:b,handleDismiss:x},T),{step:k}),k.id)),C=b.getNumberOfCompletedSteps(),R=b.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(S.Column,{gap:2,children:[jsx(h.Header,{dismissible:e,handleDismiss:x,part:"checklist-header",subtitle:b.subtitle,title:b.title}),jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxs(F.Body2,{fontWeight:"demibold",children:[C,"/",R]}),jsx(ve,{current:C,total:R,flexGrow:1})]})]}),P]})}}))})}var Ci=new Set(["required","min","max","minLength","maxLength","pattern"]);function Si({fieldComponent:e,control:t,fieldData:o,submit:n}){let r=useFormContext();o.pattern!=null&&(typeof o.pattern=="string"?o.pattern=new RegExp(o.pattern.replace(/^\/|\/$/g,"")):typeof o.pattern=="object"&&typeof o.pattern.value=="string"&&(o.pattern.value=new RegExp(o.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(o).filter(([s])=>Ci.has(s))),p=useController({name:o.id,control:t,rules:a});return jsx(e,l(i({},p),{fieldData:o,formContext:r,submit:n}))}function Xt({fieldTypes:e,handleDismiss:t,handlePrimary:o,handleSecondary:n,parentProps:{dismissible:r},step:a}){var C,R,k,$,L;let{__readOnly:p}=useContext(V),s=useMemo(()=>{var E,I;return (I=(E=a.fields)==null?void 0:E.filter(A=>e[A.type]!=null&&A.id))!=null?I:[]},[a.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:s.reduce((E,I)=>{var A;return E[I.id]=(A=I.value)!=null?A:"",E},{})});useEffect(()=>{d.formState.isDirty||d.reset(s.reduce((E,I)=>{var A;return E[I.id]=(A=I.value)!=null?A:"",E},{}));},[s]);let[u,m]=useState(!1),g=[],{control:b,handleSubmit:x}=d,T=(C=a.props)!=null?C:{};function v(E,I){m(!0),o(I,E,p===!0).then(()=>m(!1));}s.forEach(E=>{e[E.type]!=null&&g.push(jsx(Si,{control:b,fieldComponent:e[E.type],fieldData:E,submit:x(v)},`${a.flow.id}-${E.id}`));});let B=(k=(R=a.primaryButton)==null?void 0:R.title)!=null?k:a.primaryButtonTitle,w=(L=($=a.secondaryButton)==null?void 0:$.title)!=null?L:a.secondaryButtonTitle,P=!!(a.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[a]),jsxs(S.Column,l(i({gap:5,part:"form-step"},T),{children:[jsx(h.Header,{dismissible:r,handleDismiss:t,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,l(i({},d),{children:g})),jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[w&&jsx(O.Secondary,{onClick:n,title:w}),jsx(O.Primary,{disabled:P||u,onClick:x(v),title:B!=null?B:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Jt({error:e}){var t;return (t=e==null?void 0:e.message)!=null&&t.length?jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function Do({children:e,id:t,required:o=!1}){return jsxs(F.Body2,{as:"label",htmlFor:t,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:o&&"*"})]})}var Oo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Le=l(i({},Oo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),to={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 Y({children:e,field:t,fieldData:o,fieldState:n}){var u;let{id:r,label:a,placeholder:p}=o,{error:s}=n,d=l(i(i(i({id:r},t),p?{placeholder:p}:{}),Le),{"aria-invalid":!!s,value:(u=t.value)!=null?u:""});return jsxs(y,{part:"field",children:[jsx(Do,{id:r,required:!!o.required,children:a}),e(d),jsx(Jt,{error:s})]})}function Ee(e){return jsx("svg",l(i({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 Bi=Fo.forwardRef(({label:e,value:t},o)=>jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:t,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(F.Body2,{part:"field-radio-label",children:e}),jsx(De.Item,{id:t,value:t,ref:o,asChild:!0,children:jsx(y,{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(y,l(i({as:De.Indicator},to),{children:jsx(Ee,{height:"14",width:"14"})}))})})]}));function Io(e){let{field:{onChange:t,value:o},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:p})=>jsx(Bi,{value:p,label:a},p));return jsx(Y,l(i({},e),{children:()=>jsx(De.Root,{value:o,onValueChange:t,asChild:!0,children:jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}function er(e){return jsx("svg",l(i({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 tr(e){let{field:{onChange:t,value:o},fieldData:{options:n=[]}}=e,[r,a]=Fo.useState([]);function p(s){let d=[];r.includes(s)?d=[...r.filter(u=>u!==s)]:d=[...r,s],a(d),t(d);}return jsx(Y,l(i({},e),{children:()=>jsx(S.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:s,value:d})=>jsx(ro.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>p(d),asChild:!0,children:jsxs(y,{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(F.Body2,{part:"field-check-label",children:s}),jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:d,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(ro.Indicator,{asChild:!0,children:jsx(y,l(i({},to),{children:jsx(Ee,{height:"14",width:"14"})}))})})]})},d))})}))}var Ei=Fo.forwardRef(({label:e,value:t},o)=>jsx(N.Item,{value:t,ref:o,asChild:!0,children:jsx(y,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(N.ItemText,{asChild:!0,children:jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function Ho(e){let{field:{onChange:t,value:o},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:p,value:s})=>jsx(Ei,{value:s,label:p},s));return e.fieldData.multiple?jsx(tr,i({},e)):jsx(Y,l(i({},e),{children:()=>jsxs(N.Root,{value:o,onValueChange:t,children:[jsx(N.Trigger,{asChild:!0,children:jsxs(F.Body2,l(i({},Le),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(N.Value,{placeholder:r!=null?r:"Select one"}),jsx(N.Icon,{children:jsx(y,{as:er,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(N.Portal,{children:jsx(N.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,l(i({},Le),{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(N.Viewport,{children:a})}))})})]})}))}function $o(e){return jsx(Y,l(i({},e),{children:t=>jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},t))}))}function Ao(e){return jsx(Y,l(i({},e),{children:t=>jsx(F.Body2,i({as:"textarea",part:"field-textarea"},t))}))}function sr(e){let{field:{onChange:t,value:o},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(y,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(ro.Root,{defaultChecked:!0,onCheckedChange:t,value:o,checked:o===!0,asChild:!0,children:jsx(y,l(i({},Oo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsx(ro.Indicator,{asChild:!0,children:jsx(y,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ee,{height:"14",fill:"currentColor"})})})}))}),jsx(F.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var Oi={checkbox:sr,radio:Io,select:Ho,text:$o,textarea:Ao};function Ie(r){var a=r,{fieldTypes:e={},flowId:t,part:o}=a,n=f(a,["fieldTypes","flowId","part"]);let p=Object.assign({},Oi,e);return jsx(z,l(i({flowId:t,part:["form",o]},n),{children:s=>jsx(Xt,i({fieldTypes:p},s))}))}var ao={};ie(ao,{NPS:()=>_e});function dr({field:e,fieldData:t,submit:o}){var r,a;let n=[...Array(11)].map((p,s)=>{let d=e.value===s?O.Primary:O.Secondary;return jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(s),o();},title:`${s}`,css:{".fr-button-title":{fontSize:"15px"}}},s)});return jsxs(S.Column,{gap:2,children:[jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=t.negativeLabel)!=null?r:"Not likely at all"}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=t.positiveLabel)!=null?a:"Extremely likely"})]})]})}function _e(a){var p=a,{as:e=H,flowId:t,fieldTypes:o,part:n}=p,r=f(p,["as","flowId","fieldTypes","part"]);let{flow:s}=Se(t);return jsx(Ie,l(i({alignSelf:"end",as:e,flowId:t,fieldTypes:i({nps:dr},o),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||s.skip();},part:["nps",n]},r),{css:i({},i(l(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}}),r.css))}))}function $i(r,n){var a=r,{children:e,part:t}=a,o=f(a,["children","part"]);return jsx(RemoveScroll,{forwardProps:!0,ref:n,children:jsx(y,l(i({backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",t],position:"absolute"},o),{children:e}))})}var so=Fo.forwardRef($i);var Mi=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function fr(n){var r=n,{clickable:e=!1,part:t=""}=r,o=f(r,["clickable","part"]);return jsxs(y,l(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${t}`,position:"relative",width:"24px",cursor:e?"pointer":void 0},o),{children:[jsx(y,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${Mi}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(y,{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 zi({maxX:e,maxY:t,radius:o,x1:n,x2:r,y1:a,y2:p}){return o>0?`path("${[`M${n+o},${a}`,`H${r-o}`,`A${o} ${o} 0,0,1 ${r} ${a+o}`,`V${p-o}`,`A${o} ${o} 0,0,1 ${r-o} ${p}`,`H${n+o}`,`A${o} ${o} 0,0,1 ${n} ${p-o}`,`V${t}`,`H${e}`,"V0","H0",`V${t}`,`H${n}`,`V${a+o}`,`A${o} ${o} 0,0,1 ${n+o} ${a}`,"Z"].join(" ")}")`:`path("M${n},${a} H${r} V${p} H${n} V${t} H${e} V0 H0 V${t} H${n} Z")`}function Ui(e){if(!window||!("nodeType"in e))return 0;let t=Number(window.getComputedStyle(e).borderRadius.replace(/\D/g,""));return Number.isNaN(t)?0:t}function Mo(r){var a=r,{anchor:e,part:t,style:o={}}=a,n=f(a,["anchor","part","style"]);let[p,s]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=useFloating({middleware:[{name:"clipPath",fn({elements:u,rects:m}){return s({maxX:u.floating.clientWidth,maxY:u.floating.clientHeight,radius:Ui(u.reference),x1:m.reference.x,x2:m.reference.x+m.reference.width,y1:m.reference.y,y2:m.reference.y+m.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{try{let u=document.querySelector(e);u!=null?d.setReference(u):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);}catch(u){}},[e]),jsx(so,i({part:["spotlight",t],ref:d.setFloating,style:i({clipPath:zi(p)},o)},n))}function gr({align:e,side:t}){let o={},n="-12px",r={top:"bottom",right:"left",bottom:"top",left:"right"};return o[r[t]]=n,["before","end"].includes(e)?["top","bottom"].includes(t)?o.right=n:o.bottom=n:["after","start"].includes(e)?["top","bottom"].includes(t)?o.left=n:o.top=n:["top","bottom"].includes(t)?o.left=`calc(50% + ${n})`:o.top=`calc(50% + ${n})`,o}function xr(e,t){try{if(e.matches(t)&&hr(e))return e;let o=e.querySelectorAll(t);if(o.length>0&&hr(o[0]))return o[0]}catch(o){return null}}function hr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function br(e){let[t,o]=useState(null);return useEffect(()=>{try{let n=document.querySelector(e);n!=null&&o(n);}catch(n){}},[e]),useEffect(()=>{let n=new MutationObserver(r=>{for(let a of r)if(a.type==="childList"){for(let p of a.addedNodes){if(p.nodeType!==Node.ELEMENT_NODE)continue;let s=xr(p,e);if(s!=null){o(s);break}}for(let p of a.removedNodes){if(p.nodeType!==Node.ELEMENT_NODE)continue;if(xr(p,e)!=null){o(null);break}}}});return n.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>n.disconnect()},[e]),{anchorElement:t}}function ra(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function Pr({align:e,alignOffset:t,anchor:o,onOpenChange:n=()=>{},open:r,side:a,sideOffset:p}){let s=`${a}-${ra(e)}`;function d({rects:R}){let k={alignmentAxis:t,mainAxis:p};return ["after","before"].includes(e)&&(["bottom","top"].includes(a)?k.alignmentAxis=t-R.floating.width:k.alignmentAxis=t-R.floating.height),k}let{context:u,floatingStyles:m,placement:g,refs:b}=useFloating({middleware:[offset(d,[e,t,a,p]),flip(),shift()],onOpenChange:n,open:r,placement:s,whileElementsMounted:autoUpdate}),x=useClick(u),T=useDismiss(u,{outsidePress:!1}),v=useRole(u),{getFloatingProps:B,getReferenceProps:w}=useInteractions([x,T,v]),{anchorElement:P}=br(o);useEffect(()=>{P!=null?b.setReference(P):console.debug(`[frigade] Hint: No anchor found for selector: ${o}`);},[P]);let C=g.split("-");return e==="before"?C[1]=C[1]==="end"?"after":"before":e==="after"&&(C[1]=C[1]==="start"?"before":"after"),{context:u,getFloatingProps:B,getReferenceProps:w,floatingStyles:m,placement:C.join("-"),refs:b}}function Vo(T){var v=T,{align:e="center",alignOffset:t=0,anchor:o,children:n,defaultOpen:r=!0,modal:a=!1,onOpenChange:p=()=>{},open:s,part:d,side:u="bottom",sideOffset:m=0,spotlight:g=!1,style:b={}}=v,x=f(v,["align","alignOffset","anchor","children","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[B,w]=useState(r),P=s!=null?s:B,{getFloatingProps:C,getReferenceProps:R,floatingStyles:k,placement:$,refs:L}=Pr({align:e,alignOffset:t,anchor:o,onOpenChange:he=>{p(he),s==null&&w(he);},open:P,side:u,sideOffset:m}),[E,I]=$.split("-"),A=R();return L.reference.current==null?null:jsxs(Fragment,{children:[g&&P&&jsx(Mo,{anchor:o}),a&&!g&&P&&jsx(so,{lockScroll:!0}),jsxs(y,l(i(i({part:["hint",d],ref:L.setFloating,style:i(i({},k),b)},C()),x),{children:[P&&n,jsx(fr,l(i({},A),{position:"absolute",style:gr({align:I,side:E}),clickable:r===!1}))]}))]})}var sa=keyframes`
50
50
  from {
51
51
  opacity: 0;
52
52
  }
@@ -56,7 +56,7 @@ var qo=Object.defineProperty,Xr=Object.defineProperties;var Jr=Object.getOwnProp
56
56
  to {
57
57
  opacity: 1;
58
58
  }
59
- `;function po(R){var T=R,{align:e,alignOffset:o,defaultOpen:t,dismissible:n,flow:r,handleDismiss:a,modal:p,onPrimary:l,onSecondary:d,part:u,side:m,sideOffset:y,spotlight:h,step:x}=T,v=f(T,["align","alignOffset","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var $,V,E,I,A;let{handlePrimary:w,handleSecondary:P}=le(x,{onPrimary:l,onSecondary:d}),C=(V=($=x.primaryButton)==null?void 0:$.title)!=null?V:x.primaryButtonTitle,B=(I=(E=x.secondaryButton)==null?void 0:E.title)!=null?I:x.secondaryButtonTitle,k=!!x.$state.blocked;return jsx(Vo,s(i({align:e,alignOffset:o,anchor:x.selector,"data-step-id":x.id,defaultOpen:t,modal:p,part:u,side:m,sideOffset:y,spotlight:h},v),{children:jsxs(b,{animation:`${aa} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(b.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(A=x.videoUri)!=null?A:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image"}),jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:a,subtitle:x.subtitle,title:x.title}),jsxs(b.Footer,{children:[r.getNumberOfAvailableSteps()>1&&jsx(Qe,{current:r.getCurrentStepOrder()+1,marginRight:"auto",total:r.getNumberOfAvailableSteps()}),jsx(b.Secondary,{disabled:k,onClick:P,title:B}),jsx(b.Primary,{disabled:k,onClick:w,title:C})]})]})}))}function Sr(e,o,t){let[n,r]=useState(!1),a=useRef();return useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,r(!0);},[]),n?createPortal(e,a.current,t):null}function co(v){var R=v,{align:e="after",alignOffset:o=0,as:t,defaultOpen:n,dismissible:r=!1,flowId:a,modal:p,part:l,sequential:d=!0,side:u="bottom",sideOffset:m=0,spotlight:y,zIndex:h=9999}=R,x=f(R,["align","alignOffset","as","defaultOpen","dismissible","flowId","modal","part","sequential","side","sideOffset","spotlight","zIndex"]);let{onDismiss:T,onPrimary:w,onSecondary:P}=x;return Sr(jsx(z,s(i({as:t,flowId:a,part:"tour"},x),{children:({flow:C,handleDismiss:B,parentProps:{containerProps:k},step:$})=>{var E,I,A,he;let V=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:B,modal:p,onPrimary:w,onSecondary:P,part:l,side:u,sideOffset:m,spotlight:y,step:$,zIndex:(A=(I=(E=$.props)==null?void 0:E.zIndex)!=null?I:k==null?void 0:k.zIndex)!=null?A:h},(he=$.props)!=null?he:{});return d?jsx(po,i({defaultOpen:n!=null?n:!0},V),$.id):Array.from(C.steps.values()).filter(Q=>{let{blocked:$e,completed:ue,skipped:ee,visible:we}=Q.$state;return !$e&&!ue&&!ee&&we}).map(Q=>{var Ke,K,oe,ne,te;function $e(me){return M(this,null,function*(){return (yield T==null?void 0:T(C,me))===!1?(me.preventDefault(),!1):(Q.skip(),!0)})}let ue=y&&Q.id===$.id,ee=(oe=(K=(Ke=Q.props)==null?void 0:Ke.zIndex)!=null?K:k==null?void 0:k.zIndex)!=null?oe:h,we=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:$e,onPrimary:w,onSecondary:P,part:l,side:u,sideOffset:m,spotlight:y,zIndex:ee},(ne=Q.props)!=null?ne:{});return jsx(po,i({css:{"&:has([aria-expanded=true])":{zIndex:Number(ee)+2},".fr-overlay":{zIndex:Number(ee)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(te=n||ue)!=null?te:!1,step:Q},we),`${Q.id}-${ue}`)})}})),"body")}function wr(e){var u,m,y;let{frigade:o}=useContext(_),[,t]=useState(!1),n,r=useCallback(h=>{o==null||o.getCollection(e).then(()=>{h();});let x=()=>{clearTimeout(n),n=setTimeout(()=>{t(v=>!v),h();},100);};return o==null||o.onStateChange(x),()=>{o==null||o.removeStateChangeHandler(x);}},[e]),a=useSyncExternalStore(r,()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h},()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h}),l=(y=((m=(u=a==null?void 0:a.flows)==null?void 0:u.filter(h=>h.visible).map(h=>s(i({},h),{flow:o==null?void 0:o.getFlowSync(h.flowId)})))!=null?m:[]).find(({flow:h})=>h.isVisible))==null?void 0:y.flowId,{flow:d}=Se(l);return {collection:a,currentFlow:d}}function No(r){var a=r,{collectionId:e,part:o,variables:t={}}=a,n=f(a,["collectionId","part","variables"]);var u,m,y;let p={ANNOUNCEMENT:_o,BANNER:vo,CARD:b,CHECKLIST:oo,EMBEDDED_TIP:b,FORM:Ie,NPS_SURVEY:_e,SURVEY:_e,TOUR:co},{currentFlow:l}=wr(e),d=(m=p[(u=l==null?void 0:l.rawData)==null?void 0:u.flowType])!=null?m:null;return l==null||d==null?null:((y=l==null?void 0:l.rawData)==null?void 0:y.flowType)===FlowType.FORM?jsx(g,s(i({part:["collection",o],"data-collection-id":e},n),{children:jsx(Ie,{flowId:l.id,as:H,variables:t},l.id)})):jsx(g,s(i({part:["collection",o],"data-collection-id":e},n),{children:jsx(d,{flowId:l.id,variables:t},l.id)}))}function ze(){let{frigade:e}=useContext(_);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Fr(){let[e,o]=useState(),{frigade:t}=ze();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(No,{as:null,collectionId:e})}var _=createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});function vr(){let{frigade:e}=ze();return useEffect(()=>{M(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Rr="2.5.8";function Er(p){var l=p,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=l,a=f(l,["children","css","defaultCollection","navigate","theme"]);let d=r?bo(r):{},u=useRef(new Map),m=useRef(),[y,h]=useState(!1),x=useMemo(()=>(h(!1),m.current=void 0,new Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:Rr,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let P=x.getConfig();P.__flowStateOverrides=a.__flowStateOverrides,x.reload(P);}},[a.__flowStateOverrides]);function v(){let P=[...u.current.entries()].map(([C,B])=>[C,B.callback]);x.batchRegister(P),h(!0);}function R(P,C){if(m.current&&clearTimeout(m.current),y){u.current.has(P)?x.getFlow(P).then(B=>C(B.isVisible)):(x.getFlow(P).then(B=>B.register(C)),u.current.set(P,{callback:C}));return}u.current.has(P)||u.current.set(P,{callback:C}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>v(),0);}function T(P){u.current.has(P)&&x.getFlow(P).then(C=>{u.current.delete(P),C==null||C.unregister();});}let w=n!=null?n:(P,C="_self")=>{window.open(P,C);};return useEffect(()=>()=>{x.destroy();},[]),jsxs(_.Provider,{value:s(i({navigate:w},a),{frigade:x,registerComponent:R,unregisterComponent:T,hasInitialized:y,variables:a.variables||{}}),children:[jsx(Global,{styles:{":root":i(i(i({},Po),d),o)}}),jsxs(ThemeProvider,{theme:D,children:[t&&jsx(Fr,{}),e]}),a.preloadImages!==!1&&jsx(vr,{})]})}function Se(e,o){let{frigade:t,variables:n}=useContext(_),[,r]=useState(!1),a=useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=u=>{u.id===e&&setTimeout(()=>{r(m=>!m),l();},0);};return t==null||t.onStateChange(d),()=>{t==null||t.removeStateChangeHandler(d);}},[e,t]),p=useSyncExternalStore(a,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return p==null||p.applyVariables(i(i({},n),o==null?void 0:o.variables)),{flow:p,isLoading:t!=null&&t.hasFailedToLoad()?!1:!p}}function Uo(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{if(e==null)return;function r(){return M(this,null,function*(){e.isCompleted&&n.current===!1&&(yield o==null?void 0:o(e));})}return r(),n.current=e==null?void 0:e.isCompleted,()=>{r();}},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>M(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var de=new Set;function Go(e,o=!0){let t=useCallback(()=>{de.has(e==null?void 0:e.id)&&de.delete(e==null?void 0:e.id);},[de,o]),n=useCallback(()=>{o&&(e!=null&&e.isVisible)&&!de.has(e.id)&&de.add(e.id);},[de,o]);useEffect(()=>()=>{t();},[]),useEffect(()=>{n();let a=()=>{t();};return window.addEventListener("popstate",a),window.addEventListener("beforeunload",a),()=>{t(),window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",a);}},[n,t]),e!=null&&e.isVisible?n():t();let r=de.size>0?de.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||de.size==0:!0}}function z(u){var m=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:p,variables:l}=m,d=f(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var E,A;let{flow:y}=Se(t,{variables:l}),I=i(i({},d),(E=y==null?void 0:y.props)!=null?E:{}),{dismissible:h=!1,forceMount:x=!1}=I,v=f(I,["dismissible","forceMount"]),R=y==null?void 0:y.getCurrentStep(),{handleDismiss:T}=Uo(y,{onComplete:n,onDismiss:r}),{handlePrimary:w,handleSecondary:P}=le(R,{onPrimary:a,onSecondary:p}),C=(v==null?void 0:v.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((A=y==null?void 0:y.rawData)==null?void 0:A.flowType),{isCurrentModal:B}=Go(y,C),k=x&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!k||!k&&!B)return null;(k||!y.isCompleted&&!y.isSkipped)&&R.start();let $=e===null?Fragment$1:e!=null?e:g,V=s(i({},v),{"data-flow-id":y.id});return jsx($,s(i({},e===null?{}:V),{children:o({flow:y,handleDismiss:T,handlePrimary:w,handleSecondary:P,parentProps:{dismissible:h,flowId:t,variables:l,containerProps:V},step:R})}))}function $r(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsx(z,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:p,parentProps:{dismissible:l},step:d})=>{var y,h,x,v;let u=(h=(y=d.primaryButton)==null?void 0:y.title)!=null?h:d.primaryButtonTitle,m=(v=(x=d.secondaryButton)==null?void 0:x.title)!=null?v:d.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:l,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsx(b.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:m,onClick:p}),jsx(b.Primary,{title:u,onClick:a})]})]})}}))}function mo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Wa(e){var o,t,n,r,a;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/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function fo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let a=Wa(o);return a?jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ye(n){var r=n,{src:e,type:o}=r,t=f(r,["src","type"]);return jsx(o==="video"?fo:mo,i({src:e},t))}var b=Fo.forwardRef((a,r)=>{var p=a,{children:e,flowId:o,part:t}=p,n=f(p,["children","flowId","part"]);var d;if(o!=null)return jsx($r,i({flowId:o},n));let l=(d=n.as)!=null?d:S.Column;return jsx(l,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});b.Dismiss=e=>jsx(O.Plain,s(i({part:"dismiss",padding:0},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}));b.Footer=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return jsx(S.Row,s(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=p=>{var l=p,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=l,a=f(l,["dismissible","handleDismiss","part","subtitle","title"]);return jsxs(S.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};b.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ye,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Secondary,i({title:o,onClick:e},t))};b.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(F.Body2,s(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(F.H4,s(i({display:"block",part:["title",o]},t),{children:e}))};var go={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Wr(e){let o=Object.fromEntries(go.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(go.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!go.content.some(a=>a===r)&&!go.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var _a=keyframes`
59
+ `;function lo(v){var B=v,{align:e,alignOffset:t,defaultOpen:o,dismissible:n,flow:r,handleDismiss:a,modal:p,onPrimary:s,onSecondary:d,part:u,side:m,sideOffset:g,spotlight:b,step:x}=B,T=f(B,["align","alignOffset","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var $,L,E,I,A;let{handlePrimary:w,handleSecondary:P}=le(x,{onPrimary:s,onSecondary:d}),C=(L=($=x.primaryButton)==null?void 0:$.title)!=null?L:x.primaryButtonTitle,R=(I=(E=x.secondaryButton)==null?void 0:E.title)!=null?I:x.secondaryButtonTitle,k=!!x.$state.blocked;return jsx(Vo,l(i({align:e,alignOffset:t,anchor:x.selector,"data-step-id":x.id,defaultOpen:o,modal:p,part:u,side:m,sideOffset:g,spotlight:b},T),{children:jsxs(h,{animation:`${sa} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(h.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(A=x.videoUri)!=null?A:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image"}),jsx(h.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:a,subtitle:x.subtitle,title:x.title}),jsxs(h.Footer,{children:[r.getNumberOfAvailableSteps()>1&&jsx(Ye,{current:r.getCurrentStepOrder()+1,marginRight:"auto",total:r.getNumberOfAvailableSteps()}),jsx(h.Secondary,{disabled:k,onClick:P,title:R}),jsx(h.Primary,{disabled:k,onClick:w,title:C})]})]})}))}function wr(e,t,o){let[n,r]=useState(!1),a=useRef();return useEffect(()=>{a.current=typeof t=="string"?document.querySelector(t):t,r(!0);},[]),n?createPortal(e,a.current,o):null}function po(T){var v=T,{align:e="after",alignOffset:t=0,as:o,defaultOpen:n,dismissible:r=!1,flowId:a,modal:p,part:s,sequential:d=!0,side:u="bottom",sideOffset:m=0,spotlight:g,zIndex:b=9999}=v,x=f(v,["align","alignOffset","as","defaultOpen","dismissible","flowId","modal","part","sequential","side","sideOffset","spotlight","zIndex"]);let{onDismiss:B,onPrimary:w,onSecondary:P}=x;return wr(jsx(z,l(i({as:o,flowId:a,part:"tour"},x),{children:({flow:C,handleDismiss:R,parentProps:{containerProps:k},step:$})=>{var E,I,A,he;let L=i({align:e,alignOffset:t,dismissible:r,flow:C,handleDismiss:R,modal:p,onPrimary:w,onSecondary:P,part:s,side:u,sideOffset:m,spotlight:g,step:$,zIndex:(A=(I=(E=$.props)==null?void 0:E.zIndex)!=null?I:k==null?void 0:k.zIndex)!=null?A:b},(he=$.props)!=null?he:{});return d?jsx(lo,i({defaultOpen:n!=null?n:!0},L),$.id):Array.from(C.steps.values()).filter(Q=>{let{blocked:$e,completed:ue,skipped:ee,visible:we}=Q.$state;return !$e&&!ue&&!ee&&we}).map(Q=>{var Ge,K,oe,ne,te;function $e(me){return M(this,null,function*(){return (yield B==null?void 0:B(C,me))===!1?(me.preventDefault(),!1):(Q.skip(),!0)})}let ue=g&&Q.id===$.id,ee=(oe=(K=(Ge=Q.props)==null?void 0:Ge.zIndex)!=null?K:k==null?void 0:k.zIndex)!=null?oe:b,we=i({align:e,alignOffset:t,dismissible:r,flow:C,handleDismiss:$e,onPrimary:w,onSecondary:P,part:s,side:u,sideOffset:m,spotlight:g,zIndex:ee},(ne=Q.props)!=null?ne:{});return jsx(lo,i({css:{"&:has([aria-expanded=true])":{zIndex:Number(ee)+2},".fr-overlay":{zIndex:Number(ee)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(te=n||ue)!=null?te:!1,step:Q},we),`${Q.id}-${ue}`)})}})),"body")}function co(){let{frigade:e}=useContext(V),[,t]=useState(!1),o,n=useCallback(p=>{e==null||e.getCollections().then(()=>{p();});let s=()=>{clearTimeout(o),o=setTimeout(()=>{t(d=>!d),p();},0);};return e==null||e.onStateChange(s),()=>{e==null||e.removeStateChangeHandler(s);}},[]),r=()=>{let p;try{p=e==null?void 0:e.getCollectionsSync();}catch(s){}return p};return {collections:useSyncExternalStore(n,r,r)}}function Fr(e){var s,d,u,m;let{frigade:t}=useContext(V),{collections:o}=co(),n=o==null?void 0:o.get(e),a=(m=((u=(d=(s=o==null?void 0:o.get(e))==null?void 0:s.flows)==null?void 0:d.filter(g=>g.visible).map(g=>l(i({},g),{flow:t==null?void 0:t.getFlowSync(g.flowId)})))!=null?u:[]).find(({flow:g})=>g.isVisible))==null?void 0:m.flowId,{flow:p}=Se(a);return {collection:n,currentFlow:p}}function No(r){var a=r,{collectionId:e,part:t,variables:o={}}=a,n=f(a,["collectionId","part","variables"]);var u,m,g;let p={ANNOUNCEMENT:_o,BANNER:vo,CARD:h,CHECKLIST:eo,EMBEDDED_TIP:h,FORM:Ie,NPS_SURVEY:_e,SURVEY:_e,TOUR:po},{currentFlow:s}=Fr(e),d=(m=p[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?m:null;return s==null||d==null?null:((g=s==null?void 0:s.rawData)==null?void 0:g.flowType)===FlowType.FORM?jsx(y,l(i({part:["collection",t],"data-collection-id":e},n),{children:jsx(Ie,{flowId:s.id,as:H,variables:o},s.id)})):jsx(y,l(i({part:["collection",t],"data-collection-id":e},n),{children:jsx(d,{flowId:s.id,variables:o},s.id)}))}function vr(){var o,n;let{collections:e}=co(),t=(n=Array.from((o=e==null?void 0:e.entries())!=null?o:[]).find(r=>r[1].collectionType==="DEFAULT"))==null?void 0:n[0];return t==null?null:jsx(No,{as:null,collectionId:t})}var V=createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});function zo(){let{frigade:e}=useContext(V);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Rr(){let{frigade:e}=zo();return useEffect(()=>{M(this,null,function*(){(yield e.getFlows()).forEach(o=>{o.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Br="2.5.9";function Dr(p){var s=p,{children:e,css:t={},defaultCollection:o=!0,navigate:n,theme:r}=s,a=f(s,["children","css","defaultCollection","navigate","theme"]);let d=r?bo(r):{},u=useRef(new Map),m=useRef(),[g,b]=useState(!1),x=useMemo(()=>(b(!1),m.current=void 0,new Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:Br,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let P=x.getConfig();P.__flowStateOverrides=a.__flowStateOverrides,x.reload(P);}},[a.__flowStateOverrides]);function T(){let P=[...u.current.entries()].map(([C,R])=>[C,R.callback]);x.batchRegister(P),b(!0);}function v(P,C){if(m.current&&clearTimeout(m.current),g){u.current.has(P)?x.getFlow(P).then(R=>C(R.isVisible)):(x.getFlow(P).then(R=>R.register(C)),u.current.set(P,{callback:C}));return}u.current.has(P)||u.current.set(P,{callback:C}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>T(),0);}function B(P){u.current.has(P)&&x.getFlow(P).then(C=>{u.current.delete(P),C==null||C.unregister();});}let w=n!=null?n:(P,C="_self")=>{window.open(P,C);};return useEffect(()=>()=>{x.destroy();},[]),jsxs(V.Provider,{value:l(i({navigate:w},a),{frigade:x,registerComponent:v,unregisterComponent:B,hasInitialized:g,variables:a.variables||{}}),children:[jsx(Global,{styles:{":root":i(i(i({},Po),d),t)}}),jsxs(ThemeProvider,{theme:D,children:[o&&jsx(vr,{}),e]}),a.preloadImages!==!1&&jsx(Rr,{})]})}function Se(e,t){let{frigade:o,variables:n}=useContext(V),[,r]=useState(!1),a=useCallback(s=>{o==null||o.getFlow(e).then(()=>{s();});let d=u=>{u.id===e&&setTimeout(()=>{r(m=>!m),s();},0);};return o==null||o.onStateChange(d),()=>{o==null||o.removeStateChangeHandler(d);}},[e,o]),p=useSyncExternalStore(a,()=>o==null?void 0:o.getFlowSync(e),()=>o==null?void 0:o.getFlowSync(e));return p==null||p.applyVariables(i(i({},n),t==null?void 0:t.variables)),{flow:p,isLoading:o!=null&&o.hasFailedToLoad()?!1:!p}}function Go(e,{onComplete:t,onDismiss:o}={}){let n=useRef(null);return useEffect(()=>{if(e==null)return;function r(){return M(this,null,function*(){e.isCompleted&&n.current===!1&&(yield t==null?void 0:t(e));})}return r(),n.current=e==null?void 0:e.isCompleted,()=>{r();}},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>M(this,null,function*(){if((yield o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var de=new Set;function Ko(e,t=!0){let o=useCallback(()=>{de.has(e==null?void 0:e.id)&&de.delete(e==null?void 0:e.id);},[de,t]),n=useCallback(()=>{t&&(e!=null&&e.isVisible)&&!de.has(e.id)&&de.add(e.id);},[de,t]);useEffect(()=>()=>{o();},[]),useEffect(()=>{n();let a=()=>{o();};return window.addEventListener("popstate",a),window.addEventListener("beforeunload",a),()=>{o(),window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",a);}},[n,o]),e!=null&&e.isVisible?n():o();let r=de.size>0?de.values().next().value:null;return {isCurrentModal:t?r===(e==null?void 0:e.id)||de.size==0:!0}}function z(u){var m=u,{as:e,children:t,flowId:o,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:p,variables:s}=m,d=f(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var E,A;let{flow:g}=Se(o,{variables:s}),I=i(i({},d),(E=g==null?void 0:g.props)!=null?E:{}),{dismissible:b=!1,forceMount:x=!1}=I,T=f(I,["dismissible","forceMount"]),v=g==null?void 0:g.getCurrentStep(),{handleDismiss:B}=Go(g,{onComplete:n,onDismiss:r}),{handlePrimary:w,handleSecondary:P}=le(v,{onPrimary:a,onSecondary:p}),C=(T==null?void 0:T.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((A=g==null?void 0:g.rawData)==null?void 0:A.flowType),{isCurrentModal:R}=Ko(g,C),k=x&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||!g.isVisible&&!k||!k&&!R)return null;(k||!g.isCompleted&&!g.isSkipped)&&v.start();let $=e===null?Fragment$1:e!=null?e:y,L=l(i({},T),{"data-flow-id":g.id});return jsx($,l(i({},e===null?{}:L),{children:t({flow:g,handleDismiss:B,handlePrimary:w,handleSecondary:P,parentProps:{dismissible:b,flowId:o,variables:s,containerProps:L},step:v})}))}function Ar(o){var n=o,{part:e}=n,t=f(n,["part"]);return jsx(z,l(i({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},t),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:p,parentProps:{dismissible:s},step:d})=>{var g,b,x,T;let u=(b=(g=d.primaryButton)==null?void 0:g.title)!=null?b:d.primaryButtonTitle,m=(T=(x=d.secondaryButton)==null?void 0:x.title)!=null?T:d.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:s,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsx(h.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:m,onClick:p}),jsx(h.Primary,{title:u,onClick:a})]})]})}}))}function mo(n){var r=n,{part:e,src:t}=r,o=f(r,["part","src"]);return jsx(y,i({as:"img",maxWidth:"unset",part:["image",e],src:t},o))}function Wa(e){var t,o,n,r,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(o=e.split("youtu.be/")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function fo(n){var r=n,{part:e,src:t}=r,o=f(r,["part","src"]);let a=Wa(t);return a?jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},o)):t!=null&&t.endsWith(".mp4")?jsx(y,i({as:"video",controls:!0,part:["video",e],src:t},o)):(console.error(`Could not map videoUri ${t} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ye(n){var r=n,{src:e,type:t}=r,o=f(r,["src","type"]);return jsx(t==="video"?fo:mo,i({src:e},o))}var h=Fo.forwardRef((a,r)=>{var p=a,{children:e,flowId:t,part:o}=p,n=f(p,["children","flowId","part"]);var d;if(t!=null)return jsx(Ar,i({flowId:t},n));let s=(d=n.as)!=null?d:S.Column;return jsx(s,l(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",o]},n),{ref:r,children:e}))});h.Dismiss=e=>jsx(O.Plain,l(i({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}));h.Footer=n=>{var r=n,{children:e,part:t}=r,o=f(r,["children","part"]);return jsx(S.Row,l(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",t]},o),{children:e}))};h.Header=p=>{var s=p,{dismissible:e,handleDismiss:t,part:o,subtitle:n,title:r}=s,a=f(s,["dismissible","handleDismiss","part","subtitle","title"]);return jsxs(S.Row,l(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",o]},a),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(h.Dismiss,{onClick:t,marginLeft:"auto"}),jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};h.Media=o=>{var n=o,{src:e}=n,t=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ye,i({borderRadius:"md",src:e},t))};h.Primary=n=>{var r=n,{onClick:e,title:t}=r,o=f(r,["onClick","title"]);return t==null||(t==null?void 0:t.length)===0?null:jsx(O.Primary,i({title:t,onClick:e},o))};h.Secondary=n=>{var r=n,{onClick:e,title:t}=r,o=f(r,["onClick","title"]);return t==null||(t==null?void 0:t.length)===0?null:jsx(O.Secondary,i({title:t,onClick:e},o))};h.Subtitle=n=>{var r=n,{children:e,part:t}=r,o=f(r,["children","part"]);return e==null?null:jsx(F.Body2,l(i({display:"block",color:"neutral.400",part:["subtitle",t]},o),{children:e}))};h.Title=n=>{var r=n,{children:e,part:t}=r,o=f(r,["children","part"]);return e==null?null:jsx(F.H4,l(i({display:"block",part:["title",t]},o),{children:e}))};var go={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Vr(e){let t=Object.fromEntries(go.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),o=Object.fromEntries(go.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!go.content.some(a=>a===r)&&!go.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:t,otherProps:n,rootProps:o}}var _a=keyframes`
60
60
  from {
61
61
  opacity: 0;
62
62
  }
@@ -66,7 +66,7 @@ var qo=Object.defineProperty,Xr=Object.defineProperties;var Jr=Object.getOwnProp
66
66
  to {
67
67
  opacity: 1;
68
68
  }
69
- `;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=f(a,["children","className","modal"]);let{rootProps:p,contentProps:l,otherProps:m}=Wr(n),y=m,{zIndex:d}=y,u=f(y,["zIndex"]);return jsx(j.Root,s(i({defaultOpen:!0,modal:t},p),{children:jsx(j.Portal,{children:jsxs(g,{animation:`${_a} 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(j.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(j.Content,s(i({asChild:!0,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault()},l),{children:jsx(b,s(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}H.Dismiss=e=>jsx(j.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,s(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});H.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(j.Description,{asChild:!0,children:jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))})};H.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(ye,i({borderRadius:"md",src:e},o))};H.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};H.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?D.colors.primary.surface:D.colors.neutral[700],part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};H.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};H.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(j.Title,{asChild:!0,children:jsx(F.H4,s(i({part:"title"},o),{children:e}))})};H.displayName="Dialog";var Vr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function _o(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([l])=>Vr.some(d=>l===d))),p=Object.fromEntries(Object.entries(t).filter(([l])=>Vr.indexOf(l)===-1));return jsx(z,s(i({as:null,flowId:e},a),{children:({flow:l,handleDismiss:d,handlePrimary:u,handleSecondary:m,parentProps:{containerProps:y,dismissible:h},step:x})=>{var P,C,B,k,$,V;let v=(P=x.props)!=null?P:{},R=(B=(C=x.primaryButton)==null?void 0:C.title)!=null?B:x.primaryButtonTitle,T=($=(k=x.secondaryButton)==null?void 0:k.title)!=null?$:x.secondaryButtonTitle,w=x.$state.blocked;return jsx(H,s(i(i({part:["announcement",o],textAlign:"center"},y),p),{onEscapeKeyDown:E=>{if(t.dismissible===!1){E.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(E),E.defaultPrevented||d(E);},children:jsxs(S.Column,s(i({gap:5,part:"announcement-step"},v),{children:[h&&jsx(H.Dismiss,{onClick:d}),jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsx(H.Title,{children:x.title}),jsx(H.Subtitle,{children:x.subtitle})]}),jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(V=x.videoUri)!=null?V:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image",width:"100%"}),jsx(H.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[T&&jsx(H.Secondary,{disabled:w,onClick:m,title:T}),R&&jsx(H.Primary,{disabled:w,onClick:u,title:R})]})]}))}))}}))}function yo(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[n,r]=useState(null),a=useCallback(p=>{r(p);},[]);return useLayoutEffect(()=>{if(!n)return;let p=()=>{let l=n.getBoundingClientRect();t(l);};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]),{node:n,rect:o,ref:a}}var ja=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function _r(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${ja}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function zr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{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"},p="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=p;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=p:r.bottom=p:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=p:r.top=p:["top","bottom"].includes(n)?r.left=`calc(50% + ${p})`:r.top=`calc(50% + ${p})`,r}var xo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Ur(e,o){var a,p,l,d,u;let t=Object.fromEntries(xo.content.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),n=Object.fromEntries(xo.root.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),r={};for(let m of Object.keys(e))!xo.content.includes(m)&&!xo.root.includes(m)&&(r[m]=e[m]);if(t.align=(a=t.align)!=null?a:"after",t.side=(p=t.side)!=null?p:"bottom",["before","after"].includes(t.align)){let m={after:"end",before:"start"},y=(w,P)=>["top","bottom"].includes(P)?w=="after"?"marginLeft":"marginRight":w=="after"?"marginTop":"marginBottom",h=(l=t.alignOffset)!=null?l:0,x=(d=t.style)!=null?d:{},v=(u=t.side)!=null?u:"bottom",R=t.align;t.style=s(i({},x),{[y(R,v)]:h});let T=["top","bottom"].includes(v)?o.width:o.height;t.alignOffset=(T+h)*-1,t.align=m[R];}return {contentProps:t,otherProps:r,rootProps:n}}var Gr=keyframes`
69
+ `;function H(r){var a=r,{children:e,className:t,modal:o=!0}=a,n=f(a,["children","className","modal"]);let{rootProps:p,contentProps:s,otherProps:m}=Vr(n),g=m,{zIndex:d}=g,u=f(g,["zIndex"]);return jsx(j.Root,l(i({defaultOpen:!0,modal:o},p),{children:jsx(j.Portal,{children:jsxs(y,{animation:`${_a} 300ms ease-out`,className:t,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[o&&jsx(j.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(j.Content,l(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},s),{children:jsx(h,l(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}H.Dismiss=e=>jsx(j.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,l(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});H.Subtitle=o=>{var n=o,{children:e}=n,t=f(n,["children"]);return jsx(j.Description,{asChild:!0,children:jsx(F.Body2,l(i({part:"subtitle"},t),{children:e}))})};H.Media=o=>{var n=o,{src:e}=n,t=f(n,["src"]);return e==null?null:jsx(ye,i({borderRadius:"md",src:e},t))};H.Primary=n=>{var r=n,{onClick:e,title:t}=r,o=f(r,["onClick","title"]);return t==null?null:jsx(O.Primary,i({title:t,onClick:e},o))};H.ProgressDots=({current:e,total:t})=>{if(t==1)return null;let o=[...Array(t)].map((n,r)=>jsx(y,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?D.colors.primary.surface:D.colors.neutral[700],part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,children:o})};H.Secondary=n=>{var r=n,{onClick:e,title:t}=r,o=f(r,["onClick","title"]);return t==null?null:jsx(O.Secondary,i({title:t,onClick:e},o))};H.Title=o=>{var n=o,{children:e}=n,t=f(n,["children"]);return jsx(j.Title,{asChild:!0,children:jsx(F.H4,l(i({part:"title"},t),{children:e}))})};H.displayName="Dialog";var Lr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function _o(n){var r=n,{flowId:e,part:t}=r,o=f(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(o).filter(([s])=>Lr.some(d=>s===d))),p=Object.fromEntries(Object.entries(o).filter(([s])=>Lr.indexOf(s)===-1));return jsx(z,l(i({as:null,flowId:e},a),{children:({flow:s,handleDismiss:d,handlePrimary:u,handleSecondary:m,parentProps:{containerProps:g,dismissible:b},step:x})=>{var P,C,R,k,$,L;let T=(P=x.props)!=null?P:{},v=(R=(C=x.primaryButton)==null?void 0:C.title)!=null?R:x.primaryButtonTitle,B=($=(k=x.secondaryButton)==null?void 0:k.title)!=null?$:x.secondaryButtonTitle,w=x.$state.blocked;return jsx(H,l(i(i({part:["announcement",t],textAlign:"center"},g),p),{onEscapeKeyDown:E=>{if(o.dismissible===!1){E.preventDefault();return}typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(E),E.defaultPrevented||d(E);},children:jsxs(S.Column,l(i({gap:5,part:"announcement-step"},T),{children:[b&&jsx(H.Dismiss,{onClick:d}),jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsx(H.Title,{children:x.title}),jsx(H.Subtitle,{children:x.subtitle})]}),jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(L=x.videoUri)!=null?L:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image",width:"100%"}),jsx(H.ProgressDots,{current:s.getCurrentStepIndex(),total:s.getNumberOfAvailableSteps()}),jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsx(H.Secondary,{disabled:w,onClick:m,title:B}),v&&jsx(H.Primary,{disabled:w,onClick:u,title:v})]})]}))}))}}))}function yo(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[n,r]=useState(null),a=useCallback(p=>{r(p);},[]);return useLayoutEffect(()=>{if(!n)return;let p=()=>{let s=n.getBoundingClientRect();o(s);};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]),{node:n,rect:t,ref:a}}var ja=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function zr(n){var r=n,{style:e={},part:t=""}=r,o=f(r,["style","part"]);return jsxs(y,l(i({part:`dot-wrapper ${t}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${ja}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ur({props:e,alignAttr:t,sideAttr:o}){let n=o!=null?o:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (u=e.align)!=null?u:"after"},p="-24px",s={top:"bottom",right:"left",bottom:"top",left:"right"};r[s[n]]=p;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=p:r.bottom=p:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=p:r.top=p:["top","bottom"].includes(n)?r.left=`calc(50% + ${p})`:r.top=`calc(50% + ${p})`,r}var xo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Gr(e,t){var a,p,s,d,u;let o=Object.fromEntries(xo.content.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),n=Object.fromEntries(xo.root.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),r={};for(let m of Object.keys(e))!xo.content.includes(m)&&!xo.root.includes(m)&&(r[m]=e[m]);if(o.align=(a=o.align)!=null?a:"after",o.side=(p=o.side)!=null?p:"bottom",["before","after"].includes(o.align)){let m={after:"end",before:"start"},g=(w,P)=>["top","bottom"].includes(P)?w=="after"?"marginLeft":"marginRight":w=="after"?"marginTop":"marginBottom",b=(s=o.alignOffset)!=null?s:0,x=(d=o.style)!=null?d:{},T=(u=o.side)!=null?u:"bottom",v=o.align;o.style=l(i({},x),{[g(v,T)]:b});let B=["top","bottom"].includes(T)?t.width:t.height;o.alignOffset=(B+b)*-1,o.align=m[v];}return {contentProps:o,otherProps:r,rootProps:n}}var Kr=keyframes`
70
70
  from {
71
71
  opacity: 0;
72
72
  }
@@ -76,8 +76,8 @@ var qo=Object.defineProperty,Xr=Object.defineProperties;var Jr=Object.getOwnProp
76
76
  to {
77
77
  opacity: 1;
78
78
  }
79
- `;function Kr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function xe(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:n=!0,open:r,part:a,spotlight:p=!1,style:l={}}=m,d=f(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:y,rect:h,ref:x}=yo(),{node:v,rect:R,ref:T}=yo(),{contentProps:w,otherProps:P,rootProps:C}=Ur(d,h),[B,k]=useState(n),[$,V]=useState(w.align),[E,I]=useState(w.side),[A,he]=useState(0),[Q,$e]=useState(0);function ue(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",B),B)}if(y!==null){let K=y.getAttribute("data-align"),oe=y.getAttribute("data-side");$!==K&&V(K),E!==oe&&I(oe);}let ee=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(T(K),ee.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function K(ne){if(ne.matches(e))return Kr(ne)?ne:null;let te=ne.querySelectorAll(e);return te.length>0&&Kr(te[0])?te[0]:null}let oe=new MutationObserver(ne=>{for(let te of ne)if(te.type==="childList"){for(let me of te.addedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){T(fe),ee.current=fe,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",fe);break}}for(let me of te.removedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){T(null),ee.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",fe);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),useEffect(()=>{let{scrollX:K,scrollY:oe}=window;he(R.left+K),$e(R.top+oe);},[R.left,R.top]),v==null)return null;let we="0";typeof window!="undefined"&&(we=window.getComputedStyle(v).borderRadius);let Ke=zr({props:d,alignAttr:$,sideAttr:E});return jsxs(re.Root,s(i({defaultOpen:!0},C),{children:[jsx(re.Anchor,{virtualRef:ee}),jsx(re.Portal,{children:jsxs(Fragment,{children:[p&&jsx(g,i({animation:`${Gr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:we,height:R.height,left:A,top:Q,width:R.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(re.Content,s(i({},w),{ref:x,children:jsxs(Fragment,{children:[ue()&&jsx(b,s(i({animation:`${Gr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:l},P),{children:o})),jsx(_r,{onClick:()=>{k(()=>(typeof C.onOpenChange=="function"&&C.onOpenChange(!ue()),!ue()));},style:Ke})]})}),B)]})})]}))}xe.Close=e=>jsx(re.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});xe.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(ye,i({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))};xe.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};xe.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.Body2,s(i({part:"progress"},o),{children:e}))};xe.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};xe.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))};xe.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.H4,s(i({part:"title"},o),{children:e}))};function Ya(){let{userId:e,frigade:o}=useContext(_);function t(r){return M(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return M(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function es(){var r;let{frigade:e}=useContext(_);function o(a){return M(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,p){return M(this,null,function*(){yield e.track(a,p);})}function n(a,p){return M(this,null,function*(){yield e.group(a,p);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
79
+ `;function jr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function xe(u){var m=u,{anchor:e,children:t,className:o,defaultOpen:n=!0,open:r,part:a,spotlight:p=!1,style:s={}}=m,d=f(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:g,rect:b,ref:x}=yo(),{node:T,rect:v,ref:B}=yo(),{contentProps:w,otherProps:P,rootProps:C}=Gr(d,b),[R,k]=useState(n),[$,L]=useState(w.align),[E,I]=useState(w.side),[A,he]=useState(0),[Q,$e]=useState(0);function ue(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",R),R)}if(g!==null){let K=g.getAttribute("data-align"),oe=g.getAttribute("data-side");$!==K&&L(K),E!==oe&&I(oe);}let ee=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(B(K),ee.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function K(ne){if(ne.matches(e))return jr(ne)?ne:null;let te=ne.querySelectorAll(e);return te.length>0&&jr(te[0])?te[0]:null}let oe=new MutationObserver(ne=>{for(let te of ne)if(te.type==="childList"){for(let me of te.addedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){B(fe),ee.current=fe,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",fe);break}}for(let me of te.removedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){B(null),ee.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",fe);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),useEffect(()=>{let{scrollX:K,scrollY:oe}=window;he(v.left+K),$e(v.top+oe);},[v.left,v.top]),T==null)return null;let we="0";typeof window!="undefined"&&(we=window.getComputedStyle(T).borderRadius);let Ge=Ur({props:d,alignAttr:$,sideAttr:E});return jsxs(re.Root,l(i({defaultOpen:!0},C),{children:[jsx(re.Anchor,{virtualRef:ee}),jsx(re.Portal,{children:jsxs(Fragment,{children:[p&&jsx(y,i({animation:`${Kr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:we,height:v.height,left:A,top:Q,width:v.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(re.Content,l(i({},w),{ref:x,children:jsxs(Fragment,{children:[ue()&&jsx(h,l(i({animation:`${Kr} 300ms ease-out`,boxShadow:"md",position:"relative",className:o,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:s},P),{children:t})),jsx(zr,{onClick:()=>{k(()=>(typeof C.onOpenChange=="function"&&C.onOpenChange(!ue()),!ue()));},style:Ge})]})}),R)]})})]}))}xe.Close=e=>jsx(re.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,l(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});xe.Media=o=>{var n=o,{src:e}=n,t=f(n,["src"]);return e==null?null:jsx(ye,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},t))};xe.Primary=n=>{var r=n,{onClick:e,title:t}=r,o=f(r,["onClick","title"]);return t==null?null:jsx(O.Primary,i({title:t,onClick:e},o))};xe.Progress=o=>{var n=o,{children:e}=n,t=f(n,["children"]);return e==null?null:jsx(F.Body2,l(i({part:"progress"},t),{children:e}))};xe.Secondary=n=>{var r=n,{onClick:e,title:t}=r,o=f(r,["onClick","title"]);return t==null?null:jsx(O.Secondary,i({title:t,onClick:e},o))};xe.Subtitle=o=>{var n=o,{children:e}=n,t=f(n,["children"]);return e==null?null:jsx(F.Body2,l(i({part:"subtitle"},t),{children:e}))};xe.Title=o=>{var n=o,{children:e}=n,t=f(n,["children"]);return e==null?null:jsx(F.H4,l(i({part:"title"},t),{children:e}))};function Ya(){let{userId:e,frigade:t}=useContext(V);function o(r){return M(this,null,function*(){yield t.identify(e,r);})}function n(r,a){return M(this,null,function*(){yield t.track(r,a);})}return {userId:e,addProperties:o,track:n}}function es(){var r;let{frigade:e}=useContext(V);function t(a){return M(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function o(a,p){return M(this,null,function*(){yield e.track(a,p);})}function n(a,p){return M(this,null,function*(){yield e.group(a,p);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:t,track:o}}
80
80
 
81
- export { _o as Announcement, vo as Banner, Y as BaseField, g as Box, O as Button, b as Card, to as Checklist, No as Collection, H as Dialog, S as Flex, z as Flow, Ie as Form, Vo as Hint, mo as Image, Do as Label, ye as Media, Re as Progress, Er as Provider, Io as RadioField, Ho as SelectField, Mo as Spotlight, so as Survey, F as Text, $o as TextField, Ao as TextareaField, xe as Tooltip, co as Tour, fo as Video, Po as themeVariables, Je as tokens, yo as useBoundingClientRect, Se as useFlow, Uo as useFlowHandlers, ze as useFrigade, es as useGroup, Go as useModal, le as useStepHandlers, Ya as useUser };
81
+ export { _o as Announcement, vo as Banner, Y as BaseField, y as Box, O as Button, h as Card, oo as Checklist, No as Collection, H as Dialog, S as Flex, z as Flow, Ie as Form, Vo as Hint, mo as Image, Do as Label, ye as Media, Re as Progress, Dr as Provider, Io as RadioField, Ho as SelectField, Mo as Spotlight, ao as Survey, F as Text, $o as TextField, Ao as TextareaField, xe as Tooltip, po as Tour, fo as Video, Po as themeVariables, Xe as tokens, yo as useBoundingClientRect, Se as useFlow, Go as useFlowHandlers, zo as useFrigade, es as useGroup, Ko as useModal, le as useStepHandlers, Ya as useUser };
82
82
  //# sourceMappingURL=out.js.map
83
83
  //# sourceMappingURL=index.js.map