@frigade/react 2.4.20 → 2.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,30 +2,30 @@
2
2
  import { keyframes, Global, ThemeProvider } from '@emotion/react';
3
3
  import * as G from '@radix-ui/react-dialog';
4
4
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
5
- import * as yo from 'react';
5
+ import * as go from 'react';
6
6
  import { createContext, useContext, useCallback, useState, useRef, useEffect, useLayoutEffect, useMemo, useSyncExternalStore, Fragment as Fragment$1 } from 'react';
7
7
  import { clsx } from 'clsx';
8
- import Er from 'known-css-properties';
9
- import $r from 'dompurify';
8
+ import kr from 'known-css-properties';
9
+ import Lr 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 Dn from 'embla-carousel-react';
13
+ import Rn from 'embla-carousel-react';
14
14
  import * as we from '@radix-ui/react-collapsible';
15
15
  import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
16
16
  import * as Te from '@radix-ui/react-radio-group';
17
17
  import * as A from '@radix-ui/react-select';
18
- import * as Ze from '@radix-ui/react-checkbox';
18
+ import * as Ye from '@radix-ui/react-checkbox';
19
19
  import * as ee from '@radix-ui/react-popover';
20
20
 
21
- var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnPropertyDescriptors;var ze=Object.getOwnPropertySymbols;var $o=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable;var Lo=(e,o,t)=>o in e?Vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))$o.call(o,t)&&Lo(e,t,o[t]);if(ze)for(var t of ze(o))No.call(o,t)&&Lo(e,t,o[t]);return e},l=(e,o)=>Fr(e,vr(o));var Tr=(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 m=(e,o)=>{var t={};for(var n in e)$o.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ze)for(var n of ze(e))o.indexOf(n)<0&&No.call(e,n)&&(t[n]=e[n]);return t};var oe=(e,o)=>{for(var t in o)Vo(e,t,{get:o[t],enumerable:!0});};var $=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{d(t.next(c));}catch(u){r(u);}},s=c=>{try{d(t.throw(c));}catch(u){r(u);}},d=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});function Pe(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 _o={borderWidths:{md:"1px"}};var _e=[5,10,20,35,50,65,80,95,98],Go=[..._e],po=[..._e];Go[4]=40;po[4]=60;var Br={blue:{h:213,s:100,l:_e},gray:{h:220,s:10,l:_e},green:{h:141,s:90,l:Go},red:{h:9,s:90,l:po},yellow:{h:50,s:90,l:po}};var W={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Br))W[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var Uo=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 Ko={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,jo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var Jo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Rr="px",kr=e=>typeof e=="number"?`${4*e}${Rr}`:e,Dr=[-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"],Xo=Object.fromEntries(Dr.map(e=>[e,kr(e)]));var qo={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 Ge=l(i(l(i({},_o),{colors:i(i({},Uo),jo)}),qo),{radii:Ko,shadows:Jo,space:Xo});function De(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,d=e[r];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(n,De(d,s,t)):n[s]=d,n},{})}function co(e){let o=De(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 Yo(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]=Yo(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var uo=co(Ge),R=Yo(Ge);var Or=new Set(["alt","size","src"]),Ir=Er.all.filter(e=>e.indexOf("-")!=0&&!Or.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Hr=Object.fromEntries(Ir),Ue=De(R.colors),Mr={color:Ue,backgroundColor:Ue,borderColor:Ue,border:i(i({},R.borderWidths),Ue),borderRadius:R.radii,borderWidth:R.borderWidths,boxShadow:R.shadows,fontFamily:R.fontFamilies,fontSize:R.fontSizes,fontWeight:R.fontWeights,gap:R.space,lineHeight:R.lineHeights,margin:R.space,marginBottom:R.space,marginLeft:R.space,marginRight:R.space,marginTop:R.space,padding:R.space,paddingBottom:R.space,paddingLeft:R.space,paddingRight:R.space,paddingTop:R.space},Zo=i(i({},Hr),Mr),Qo={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},et=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Wr(e){return Array.isArray(e)?new Map(e.map(o=>[o,o])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var ot=new Map(Object.entries(Zo).map(([e,o])=>[e,Wr(o)])),Ar=new Map(Object.entries(Qo).map(([e,o])=>[e,new Set(o)])),Lr=new Set(["height","width"]),Vr=new Set(["canvas","embed","iframe","img","input","object","video"]);function tt(e){let[o,t]=e.split(":");return [o,et.has(t)?t:null]}function rt(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[d]==null&&(n[d]={}),n[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=tt(a),u=Ar.get(d);u!=null&&(u.forEach(g=>{let f=`${g}${c?":"+c:""}`;t[f]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=tt(a),u=ot.get(d);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");r(c)[d]=g.map(f=>{var x;return (x=u.get(f.toString()))!=null?x:f}).join(" ");}else u.has(s.toString())?r(c)[d]=u.get(s.toString()):r(c)[d]=s;(typeof o!="string"||!Vr.has(o)||!Lr.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&ot.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function Nr(){if(typeof window=="undefined"){let{JSDOM:e}=Tr("jsdom");return new e("<!DOCTYPE html>").window}return window}function nt(e){return e?{__html:$r(Nr()).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 _r(e){return e&&`fr-${e}`}function st(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>st(o)).join(" "):_r(e))}function Gr(d,s){var c=d,{as:e,children:o,className:t,css:n={},part:r}=c,a=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:f}=rt(a,u),x=st(r),h=t||x?clsx(t,x):void 0,F=[{boxSizing:"border-box"},g,n];return typeof o=="string"?jsx(u,l(i({className:h,css:F},f),{ref:s,dangerouslySetInnerHTML:nt(o)})):jsx(u,l(i({className:h,css:F},f),{ref:s,children:o}))}var y=yo.forwardRef(Gr);var I={};oe(I,{Link:()=>Pn,Plain:()=>Cn,Primary:()=>hn,Secondary:()=>bn});var C={};oe(C,{Body1:()=>ln,Body2:()=>pn,Caption:()=>dn,Display1:()=>on,Display2:()=>tn,H1:()=>rn,H2:()=>nn,H3:()=>an,H4:()=>sn});var mo={};oe(mo,{Body1:()=>Yr,Body2:()=>Zr,Caption:()=>Qr,Display1:()=>Ur,Display2:()=>Kr,H1:()=>jr,H2:()=>Jr,H3:()=>Xr,H4:()=>qr});var te={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ur=l(i({},te),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Kr=l(i({},te),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),jr=l(i({},te),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Jr=l(i({},te),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Xr=l(i({},te),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),qr=l(i({},te),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Yr=l(i({},te),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Zr=l(i({},te),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Qr=l(i({},te),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var en=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],re=Object.fromEntries(en.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=yo.forwardRef((d,s)=>{var c=d,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsx(y,l(i(i({as:n},mo[e]),a),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),on=re.Display1,tn=re.Display2,rn=re.H1,nn=re.H2,an=re.H3,sn=re.H4,ln=re.Body1,pn=re.Body2,dn=re.Caption;var go={};oe(go,{Link:()=>gn,Plain:()=>yn,Primary:()=>mn,Secondary:()=>fn,loadingCSSStyle:()=>fo});var Ke={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},mn=l(i({},Ke),{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"}),fn=l(i({},Ke),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),gn=l(i({},Ke),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),yn=l(i({},Ke),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),xn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),fo={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:xn+" 1s ease infinite"}};function je(s){var d=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=d,a=m(d,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxs(y,l(i(l(i({as:e!=null?e:"button",part:[`button-${c}`,t]},go[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?fo:{})}),a),{loading:void 0,children:[o,n&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function hn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,l(i({},o),{variant:"Primary",children:e}))}function bn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,l(i({},o),{variant:"Secondary",children:e}))}function Pn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,l(i({},o),{variant:"Link",children:e}))}function Cn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,l(i({},o),{variant:"Plain",children:e}))}var P={};oe(P,{Column:()=>Fn,Row:()=>wn});var wn=yo.forwardRef((e,o)=>jsx(y,l(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Fn=yo.forwardRef((e,o)=>jsx(y,l(i({display:"flex",flexDirection:"column"},e),{ref:o})));function xo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsx(U,l(i({as:null,flowId:o},n),{children:({handleDismiss:s,handlePrimary:d,handleSecondary:c,parentProps:{containerProps:u},step:g})=>{var S,T,v,k,E;let f=(S=g.props)!=null?S:{},x=(v=(T=g.primaryButton)==null?void 0:T.title)!=null?v:g.primaryButtonTitle,h=(E=(k=g.secondaryButton)==null?void 0:k.title)!=null?E:g.secondaryButtonTitle,F=g.$state.blocked;return jsxs(b,l(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),f),{children:[g.imageUri&&jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:g.title}),jsx(b.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsx(b.Secondary,{disabled:F,title:h,onClick:c}),jsx(b.Primary,{disabled:F,title:x,onClick:d}),e&&jsx(b.Dismiss,{onClick:s})]}))}}))}var qe={};oe(qe,{Carousel:()=>Rt,Collapsible:()=>Xe,CollapsibleStep:()=>He});var Oe={};oe(Oe,{Bar:()=>Ce,Dots:()=>mt,Segments:()=>gt});function Ce(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(y,l(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function mt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsx(y,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?R.colors.blue500:R.colors.blue800},d));return jsx(y,l(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function gt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((s,d)=>jsx(y,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsx(P.Row,l(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function xt(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 vn(){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 ht(t){var n=t,{checked:e=!1}=n,o=m(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"},o),{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(vn,{})})}))}function ne(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(M),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,s,d=!0)=>$(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!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(s,d)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,d),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,s)=>$(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Pt({onPrimary:e,onSecondary:o,step:t}){var u,g;let{handlePrimary:n,handleSecondary:r}=ne(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:s,skipped:d}=t.$state,c=s||d||!a?jsx(ht,{checked:s||d,marginLeft:"auto"}):jsx(y,{as:xt,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(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(P.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:(g=t.primaryButton)==null?void 0:g.title})]})]})}function St(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 Ft(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 vt=keyframes`
21
+ var Lo=Object.defineProperty,Sr=Object.defineProperties;var wr=Object.getOwnPropertyDescriptors;var Ne=Object.getOwnPropertySymbols;var Vo=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable;var Ao=(e,o,t)=>o in e?Lo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Vo.call(o,t)&&Ao(e,t,o[t]);if(Ne)for(var t of Ne(o))$o.call(o,t)&&Ao(e,t,o[t]);return e},s=(e,o)=>Sr(e,wr(o));var Fr=(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 m=(e,o)=>{var t={};for(var n in e)Vo.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Ne)for(var n of Ne(e))o.indexOf(n)<0&&$o.call(e,n)&&(t[n]=e[n]);return t};var oe=(e,o)=>{for(var t in o)Lo(e,t,{get:o[t],enumerable:!0});};var $=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{p(t.next(c));}catch(u){r(u);}},l=c=>{try{p(t.throw(c));}catch(u){r(u);}},p=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,l);p((t=t.apply(e,o)).next());});function Pe(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 zo={borderWidths:{md:"1px"}};var ze=[5,10,20,35,50,65,80,95,98],_o=[...ze],so=[...ze];_o[4]=40;so[4]=60;var vr={blue:{h:213,s:100,l:ze},gray:{h:220,s:10,l:ze},green:{h:141,s:90,l:_o},red:{h:9,s:90,l:so},yellow:{h:50,s:90,l:so}};var W={};for(let[e,{h:o,s:t,l:n}]of Object.entries(vr))W[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var Go=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 Uo={md:"8px",lg:"20px",round:"50%"};var d=e=>`var(--fr-colors-${e})`,Ko={negative:{100:d("red-100"),200:d("red-200"),300:d("red-300"),400:d("red-400"),500:d("red-500"),600:d("red-600"),700:d("red-700"),800:d("red-800"),900:d("red-900"),background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500"),active:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")},focus:{background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500")},hover:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")}},neutral:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("neutral-800"),foreground:d("black"),surface:d("neutral-700"),active:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},focus:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},hover:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")}},positive:{100:d("green-100"),200:d("green-200"),300:d("green-300"),400:d("green-400"),500:d("green-500"),600:d("green-600"),700:d("green-700"),800:d("green-800"),900:d("green-900"),background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500"),active:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")},focus:{background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500")},hover:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")}},primary:{100:d("blue-100"),200:d("blue-200"),300:d("blue-300"),400:d("blue-400"),500:d("blue-500"),600:d("blue-600"),700:d("blue-700"),800:d("blue-800"),900:d("blue-900"),background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500"),active:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")},focus:{background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500")},hover:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")}},secondary:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900"),active:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")},focus:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900")},hover:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")}}};var jo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Tr="px",Br=e=>typeof e=="number"?`${4*e}${Tr}`:e,Rr=[-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"],Jo=Object.fromEntries(Rr.map(e=>[e,Br(e)]));var Xo={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 _e=s(i(s(i({},zo),{colors:i(i({},Go),Ko)}),Xo),{radii:Uo,shadows:jo,space:Jo});function De(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let l=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,De(p,l,t)):n[l]=p,n},{})}function po(e){let o=De(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 qo(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]=qo(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var co=po(_e),R=qo(_e);var Dr=new Set(["alt","size","src"]),Er=kr.all.filter(e=>e.indexOf("-")!=0&&!Dr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Or=Object.fromEntries(Er),Ge=De(R.colors),Ir={color:Ge,backgroundColor:Ge,borderColor:Ge,border:i(i({},R.borderWidths),Ge),borderRadius:R.radii,borderWidth:R.borderWidths,boxShadow:R.shadows,fontFamily:R.fontFamilies,fontSize:R.fontSizes,fontWeight:R.fontWeights,gap:R.space,lineHeight:R.lineHeights,margin:R.space,marginBottom:R.space,marginLeft:R.space,marginRight:R.space,marginTop:R.space,padding:R.space,paddingBottom:R.space,paddingLeft:R.space,paddingRight:R.space,paddingTop:R.space},Yo=i(i({},Or),Ir),Zo={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"]},Qo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Hr(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 et=new Map(Object.entries(Yo).map(([e,o])=>[e,Hr(o)])),Mr=new Map(Object.entries(Zo).map(([e,o])=>[e,new Set(o)])),Wr=new Set(["height","width"]),Ar=new Set(["canvas","embed","iframe","img","input","object","video"]);function ot(e){let[o,t]=e.split(":");return [o,Qo.has(t)?t:null]}function tt(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let p=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([a,l])=>{let[p,c]=ot(a),u=Mr.get(p);u!=null&&(u.forEach(f=>{let g=`${f}${c?":"+c:""}`;t[g]=l;}),delete t[a]);}),Object.entries(t).forEach(([a,l])=>{let[p,c]=ot(a),u=et.get(p);if(u!=null){if(l==null)delete t[a];else if(typeof l=="string"&&l.indexOf(" ")>-1){let f=l.split(" ");r(c)[p]=f.map(g=>{var x;return (x=u.get(g.toString()))!=null?x:g}).join(" ");}else u.has(l.toString())?r(c)[p]=u.get(l.toString()):r(c)[p]=l;(typeof o!="string"||!Ar.has(o)||!Wr.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let l=a.substring(1);a.indexOf("_")===0&&et.has(l)&&(t[l]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function Vr(){if(typeof window=="undefined"){let{JSDOM:e}=Fr("jsdom");return new e("<!DOCTYPE html>").window}return window}function rt(e){return e?{__html:Lr(Vr()).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 Nr(e){return e&&`fr-${e}`}function at(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>at(o)).join(" "):Nr(e))}function zr(p,l){var c=p,{as:e,children:o,className:t,css:n={},part:r}=c,a=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:g}=tt(a,u),x=at(r),h=t||x?clsx(t,x):void 0,S=[{boxSizing:"border-box"},f,n];return typeof o=="string"?jsx(u,s(i({className:h,css:S},g),{ref:l,dangerouslySetInnerHTML:rt(o)})):jsx(u,s(i({className:h,css:S},g),{ref:l,children:o}))}var y=go.forwardRef(zr);var I={};oe(I,{Link:()=>hn,Plain:()=>bn,Primary:()=>yn,Secondary:()=>xn});var C={};oe(C,{Body1:()=>an,Body2:()=>ln,Caption:()=>sn,Display1:()=>Qr,Display2:()=>en,H1:()=>on,H2:()=>tn,H3:()=>rn,H4:()=>nn});var uo={};oe(uo,{Body1:()=>Xr,Body2:()=>qr,Caption:()=>Yr,Display1:()=>_r,Display2:()=>Gr,H1:()=>Ur,H2:()=>Kr,H3:()=>jr,H4:()=>Jr});var te={color:"neutral.foreground",fontFamily:"default",margin:"0"},_r=s(i({},te),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Gr=s(i({},te),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Ur=s(i({},te),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Kr=s(i({},te),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),jr=s(i({},te),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Jr=s(i({},te),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Xr=s(i({},te),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),qr=s(i({},te),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Yr=s(i({},te),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Zr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],re=Object.fromEntries(Zr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=go.forwardRef((p,l)=>{var c=p,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsx(y,s(i(i({as:n},uo[e]),a),{ref:l,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Qr=re.Display1,en=re.Display2,on=re.H1,tn=re.H2,rn=re.H3,nn=re.H4,an=re.Body1,ln=re.Body2,sn=re.Caption;var fo={};oe(fo,{Link:()=>mn,Plain:()=>fn,Primary:()=>cn,Secondary:()=>un,loadingCSSStyle:()=>mo});var Ue={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},cn=s(i({},Ue),{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"}),un=s(i({},Ue),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),mn=s(i({},Ue),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),fn=s(i({},Ue),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),gn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),mo={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:gn+" 1s ease infinite"}};function Ke(l){var p=l,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,a=m(p,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxs(y,s(i(s(i({as:e!=null?e:"button",part:[`button-${c}`,t]},fo[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?mo:{})}),a),{loading:void 0,children:[o,n&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function yn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(Ke,s(i({},o),{variant:"Primary",children:e}))}function xn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(Ke,s(i({},o),{variant:"Secondary",children:e}))}function hn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(Ke,s(i({},o),{variant:"Link",children:e}))}function bn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(Ke,s(i({},o),{variant:"Plain",children:e}))}var P={};oe(P,{Column:()=>Sn,Row:()=>Cn});var Cn=go.forwardRef((e,o)=>jsx(y,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Sn=go.forwardRef((e,o)=>jsx(y,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function yo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsx(U,s(i({as:null,flowId:o},n),{children:({handleDismiss:l,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var w,T,v,k,E;let g=(w=f.props)!=null?w:{},x=(v=(T=f.primaryButton)==null?void 0:T.title)!=null?v:f.primaryButtonTitle,h=(E=(k=f.secondaryButton)==null?void 0:k.title)!=null?E:f.secondaryButtonTitle,S=f.$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),g),{children:[f.imageUri&&jsx(y,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:f.title}),jsx(b.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsx(b.Secondary,{disabled:S,title:h,onClick:c}),jsx(b.Primary,{disabled:S,title:x,onClick:p}),e&&jsx(b.Dismiss,{onClick:l})]}))}}))}var Xe={};oe(Xe,{Carousel:()=>Bt,Collapsible:()=>Je,CollapsibleStep:()=>He});var Oe={};oe(Oe,{Bar:()=>Ce,Dots:()=>ut,Segments:()=>ft});function Ce(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,l=a===0?"10px":`${100*a}%`;return jsx(y,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function ut(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((l,p)=>jsx(y,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?R.colors.blue500:R.colors.blue800},p));return jsx(y,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function ft(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((l,p)=>jsx(y,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(P.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function yt(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 wn(){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 xt(t){var n=t,{checked:e=!1}=n,o=m(n,["checked"]);return jsx(y,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(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(wn,{})})}))}function ne(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(M),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,l,p=!0)=>$(this,null,function*(){if((yield o==null?void 0:o(e,a,l))===!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(l,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,l)=>$(this,null,function*(){if((yield t==null?void 0:t(e,a,l))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(l),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function bt({onPrimary:e,onSecondary:o,step:t}){var u,f;let{handlePrimary:n,handleSecondary:r}=ne(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:l,skipped:p}=t.$state,c=l||p||!a?jsx(xt,{checked:l||p,marginLeft:"auto"}):jsx(y,{as:yt,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(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(P.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:(f=t.primaryButton)==null?void 0:f.title})]})]})}function Ct(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 wt(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 Ft=keyframes`
22
22
  from {
23
23
  opacity: 0;
24
24
  }
25
25
  to {
26
26
  opacity: 1;
27
27
  }
28
- `;function Tt({flow:e,sort:o,onPrimary:t,onSecondary:n}){var S,T;let[r,a]=useState(),[s]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(S=Array.from(e.steps.values()).find(v=>!v.$state.completed&&!v.$state.skipped))==null?void 0:S.order)!=null?T:0}),[d,c]=Dn(s),[u,g]=useState(),[f,x]=useState();useLayoutEffect(()=>{c&&(u==null&&g(c.canScrollNext()),f==null&&x(c.canScrollPrev()),c.on("select",()=>{g(c.canScrollNext()),x(c.canScrollPrev());}));},[c]),useEffect(()=>{if(!r){let v=Array.from(e.steps.values()),k=v.filter(B=>B.$state.completed||B.$state.skipped).sort((B,w)=>B.order-w.order),E=v.filter(B=>!B.$state.completed&&!B.$state.skipped).sort((B,w)=>B.order-w.order);a(o==="completed-last"?[...E,...k].map(B=>B.id):v.map(B=>B.id));}},[]);let h=e.getNumberOfCompletedSteps(),F=e.getNumberOfAvailableSteps();return r?jsxs(Fragment,{children:[jsxs(P.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:R.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(P.Column,{part:"carousel-header-content",children:[jsx(C.H3,{children:e.title}),jsx(C.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(C.Body2,{fontWeight:"demibold",part:"progress-text",children:[h,"/",F]}),jsx(Ce,{current:h,total:F,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${R.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:d,children:[jsx(P.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((v,k)=>r.indexOf(v.id)-r.indexOf(k.id)).map(v=>jsx(Pt,{onPrimary:t,onSecondary:n,step:v},v.id))}),f&&jsx(P.Column,{animation:`${vt} 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(I.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>c.scrollPrev(),padding:"2",children:jsx(Ft,{height:"24px",width:"24px"})})}),u&&jsx(P.Column,{animation:`${vt} 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(I.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>c.scrollNext(),padding:"2",children:jsx(St,{height:"24px",width:"24px"})})})]})]}):null}function Rt(o){var e=m(o,[]);return jsx(U,l(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(Tt,i(i({},e),t))}))}var He={};oe(He,{Content:()=>Po,Root:()=>Co,Trigger:()=>So});function Dt(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 On=keyframes`
28
+ `;function vt({flow:e,sort:o,onPrimary:t,onSecondary:n}){var w,T;let[r,a]=useState(),[l]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(w=Array.from(e.steps.values()).find(v=>!v.$state.completed&&!v.$state.skipped))==null?void 0:w.order)!=null?T:0}),[p,c]=Rn(l),[u,f]=useState(),[g,x]=useState();useLayoutEffect(()=>{c&&(u==null&&f(c.canScrollNext()),g==null&&x(c.canScrollPrev()),c.on("select",()=>{f(c.canScrollNext()),x(c.canScrollPrev());}));},[c]),useEffect(()=>{if(!r){let v=Array.from(e.steps.values()),k=v.filter(B=>B.$state.completed||B.$state.skipped).sort((B,F)=>B.order-F.order),E=v.filter(B=>!B.$state.completed&&!B.$state.skipped).sort((B,F)=>B.order-F.order);a(o==="completed-last"?[...E,...k].map(B=>B.id):v.map(B=>B.id));}},[]);let h=e.getNumberOfCompletedSteps(),S=e.getNumberOfAvailableSteps();return r?jsxs(Fragment,{children:[jsxs(P.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:R.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(P.Column,{part:"carousel-header-content",children:[jsx(C.H3,{children:e.title}),jsx(C.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(C.Body2,{fontWeight:"demibold",part:"progress-text",children:[h,"/",S]}),jsx(Ce,{current:h,total:S,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${R.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:p,children:[jsx(P.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((v,k)=>r.indexOf(v.id)-r.indexOf(k.id)).map(v=>jsx(bt,{onPrimary:t,onSecondary:n,step:v},v.id))}),g&&jsx(P.Column,{animation:`${Ft} 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(I.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>c.scrollPrev(),padding:"2",children:jsx(wt,{height:"24px",width:"24px"})})}),u&&jsx(P.Column,{animation:`${Ft} 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(I.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>c.scrollNext(),padding:"2",children:jsx(Ct,{height:"24px",width:"24px"})})})]})]}):null}function Bt(o){var e=m(o,[]);return jsx(U,s(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(vt,i(i({},e),t))}))}var He={};oe(He,{Content:()=>bo,Root:()=>Po,Trigger:()=>Co});function kt(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 Dn=keyframes`
29
29
  from {
30
30
  height: 0;
31
31
  opacity: 0;
@@ -34,7 +34,7 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
34
34
  height: var(--radix-collapsible-content-height);
35
35
  opacity: 1;
36
36
  }
37
- `,In=keyframes`
37
+ `,En=keyframes`
38
38
  from {
39
39
  height: var(--radix-collapsible-content-height);
40
40
  opacity: 1;
@@ -43,7 +43,7 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
43
43
  height: 0;
44
44
  opacity: 0;
45
45
  }
46
- `,Hn=()=>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 Mn({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(Hn,{})})})}function Po({children:e}){return jsx(we.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${On} 300ms ease-out`},'&[data-state="closed"]':{animation:`${In} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function Co(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=m(s,["children","disabled","onOpenChange","open"]);return jsx(we.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(b,l(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function So({isCompleted:e,isBlocked:o,title:t}){return jsx(we.Trigger,{asChild:!0,children:jsxs(P.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(P.Row,{alignItems:"center",gap:2,children:[jsx(Mn,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:Dt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ot=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function It({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var F,S,T,v,k,E;let{$state:{blocked:a,completed:s,skipped:d},subtitle:c,title:u}=r,g=(S=(F=r.primaryButton)==null?void 0:F.title)!=null?S:r.primaryButtonTitle,f=(v=(T=r.secondaryButton)==null?void 0:T.title)!=null?v:r.secondaryButtonTitle,x=(k=r.props)!=null?k:{},h=!!a;return jsxs(Co,l(i({open:t,onOpenChange:n},x),{children:[jsx(So,{isBlocked:r.$state.blocked,isCompleted:s||d,title:u}),jsxs(Po,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(E=r.videoUri)!=null?E:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:c}),jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:f,onClick:o}),jsx(b.Primary,{disabled:h,title:g,onClick:e})]})]})]}))}var Vn={default:It};function $n(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var S;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:u}=useContext(Ot),{handlePrimary:g,handleSecondary:f}=ne(o,{onPrimary:a,onSecondary:s}),x=(d!=null?d:e.getCurrentStep().id)===o.id,h=(S=u[o.type])!=null?S:It;function F(T){return $(this,null,function*(){c(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(h,l(i({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:g,handleSecondary:f}),o.id)}function Xe(d){var c=d,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=useState(null),f=i(i({},Vn),a);return jsx(Ot.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:n,stepTypes:f},children:jsx(U,l(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:S=>{var T=S,{flow:x,handleDismiss:h}=T,F=m(T,["flow","handleDismiss"]);let k=Array.from(x.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx($n,l(i({flow:x,handleDismiss:h},F),{step:w}),w.id)),E=x.getNumberOfCompletedSteps(),B=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[E,"/",B]}),jsx(Ce,{current:E,total:B,flexGrow:1})]})]}),k]})}}))})}var Xn=new Set(["required","min","max","minLength","maxLength","pattern"]);function qn({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(([d])=>Xn.has(d))),s=useController({name:t.id,control:o,rules:a});return jsx(e,l(i({},s),{fieldData:t,formContext:r,submit:n}))}function Mt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var E,B,w,O,D,X;let{__readOnly:s}=useContext(M),d=((E=a.fields)!=null?E:[]).filter(V=>e[V.type]!=null&&V.id),c=useForm({delayError:2e3,mode:"onChange",defaultValues:d.reduce((V,j)=>{var le;return V[j.id]=(le=j.value)!=null?le:"",V},{})}),[u,g]=useState(!1),f=[],{control:x,handleSubmit:h}=c,F=(B=a.props)!=null?B:{};function S(V,j){g(!0),t(j,V,s===!0).then(()=>g(!1));}d.forEach(V=>{e[V.type]!=null&&f.push(jsx(qn,{control:x,fieldComponent:e[V.type],fieldData:V,submit:h(S)},`${a.flow.id}-${V.id}`));});let T=(O=(w=a.primaryButton)==null?void 0:w.title)!=null?O:a.primaryButtonTitle,v=(X=(D=a.secondaryButton)==null?void 0:D.title)!=null?X:a.secondaryButtonTitle,k=!!(a.$state.blocked||!c.formState.isValid);return useEffect(()=>{c.reset();},[a]),jsxs(P.Column,l(i({gap:5,part:"form-step"},F),{children:[jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,l(i({},c),{children:f})),jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[v&&jsx(I.Secondary,{onClick:n,title:v}),jsx(I.Primary,{disabled:k||u,onClick:h(S),title:T!=null?T:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Wt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function wo({children:e,id:o,required:t=!1}){return jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Fo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Me=l(i({},Fo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),Ye={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 Q({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:s}=t,{error:d}=n,c=l(i(i(i({id:r},o),s?{placeholder:s}:{}),Me),{"aria-invalid":!!d,value:(u=o.value)!=null?u:""});return jsxs(y,{part:"field",children:[jsx(wo,{id:r,required:!!t.required,children:a}),e(c),jsx(Wt,{error:d})]})}function ve(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 oi=yo.forwardRef(({label:e,value:o},t)=>jsxs(y,{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(C.Body2,{part:"field-radio-label",children:e}),jsx(Te.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(y,l(i({as:Te.Indicator},Ye),{children:jsx(ve,{height:"14",width:"14"})}))})})]}));function vo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:s})=>jsx(oi,{value:s,label:a},s));return jsx(Q,l(i({},e),{children:()=>jsx(Te.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Nt(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 _t(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=yo.useState([]);function s(d){let c=[];r.includes(d)?c=[...r.filter(u=>u!==d)]:c=[...r,d],a(c),o(c);}return jsx(Q,l(i({},e),{children:()=>jsx(P.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:d,value:c})=>jsx(Ze.Root,{value:r.includes(c)?c:void 0,onCheckedChange:()=>s(c),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(C.Body2,{part:"field-check-label",children:d}),jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(Ze.Indicator,{asChild:!0,children:jsx(y,l(i({},Ye),{children:jsx(ve,{height:"14",width:"14"})}))})})]})},c))})}))}var ni=yo.forwardRef(({label:e,value:o},t)=>jsx(A.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(A.ItemText,{asChild:!0,children:jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function To(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:s,value:d})=>jsx(ni,{value:d,label:s},d));return e.fieldData.multiple?jsx(_t,i({},e)):jsx(Q,l(i({},e),{children:()=>jsxs(A.Root,{value:t,onValueChange:o,children:[jsx(A.Trigger,{asChild:!0,children:jsxs(C.Body2,l(i({},Me),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(A.Value,{placeholder:r!=null?r:"Select one"}),jsx(A.Icon,{children:jsx(y,{as:Nt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(A.Portal,{children:jsx(A.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,l(i({},Me),{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(A.Viewport,{children:a})}))})})]})}))}function Bo(e){return jsx(Q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Ro(e){return jsx(Q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function Jt(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(y,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(Ze.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(y,l(i({},Fo),{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(Ze.Indicator,{asChild:!0,children:jsx(y,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(ve,{height:"14",fill:"currentColor"})})})}))}),jsx(C.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var ai={checkbox:Jt,radio:vo,select:To,text:Bo,textarea:Ro};function Re(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let s=Object.assign({},ai,e);return jsx(U,l(i({flowId:o,part:["form",t]},n),{children:d=>jsx(Mt,i({fieldTypes:s},d))}))}var oo={};oe(oo,{NPS:()=>Ae});function Yt({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((s,d)=>{let c=e.value===d?I.Primary:I.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(d),t();},title:`${d}`,css:{".fr-button-title":{fontSize:"15px"}}},d)});return jsxs(P.Column,{gap:2,children:[jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(C.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(C.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Ae(a){var s=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=s,r=m(s,["as","flowId","fieldTypes","part"]);let{flow:d}=ae(o);return jsx(Re,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Yt},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||d.skip();},part:["nps",n],css:l(i({},!d||d.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))}function xe(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&$(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>$(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function to(){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(s=>{r(s);},[]);return useLayoutEffect(()=>{if(!n)return;let s=()=>{let d=n.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:a}}var fi=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function er(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxs(y,l(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${fi}`,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 ro(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsx(y,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function xi(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 no(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=xi(o);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},t)):o!=null&&o.endsWith(".mp4")?jsx(y,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 de(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsx(o==="video"?no:ro,i({src:e},t))}function tr({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"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};r[d[n]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var io={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function rr(e,o){var a,s,d,c,u;let t=Object.fromEntries(io.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n=Object.fromEntries(io.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r={};for(let g of Object.keys(e))!io.content.includes(g)&&!io.root.includes(g)&&(r[g]=e[g]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},f=(v,k)=>["top","bottom"].includes(k)?v=="after"?"marginLeft":"marginRight":v=="after"?"marginTop":"marginBottom",x=(d=t.alignOffset)!=null?d:0,h=(c=t.style)!=null?c:{},F=(u=t.side)!=null?u:"bottom",S=t.align;t.style=l(i({},h),{[f(S,F)]:x});let T=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(T+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:r,rootProps:n}}var nr=keyframes`
46
+ `,On=()=>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 In({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(On,{})})})}function bo({children:e}){return jsx(we.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${Dn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${En} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function Po(a){var l=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=l,r=m(l,["children","disabled","onOpenChange","open"]);return jsx(we.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 Co({isCompleted:e,isBlocked:o,title:t}){return jsx(we.Trigger,{asChild:!0,children:jsxs(P.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(P.Row,{alignItems:"center",gap:2,children:[jsx(In,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:kt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Et=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Ot({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var S,w,T,v,k,E;let{$state:{blocked:a,completed:l,skipped:p},subtitle:c,title:u}=r,f=(w=(S=r.primaryButton)==null?void 0:S.title)!=null?w:r.primaryButtonTitle,g=(v=(T=r.secondaryButton)==null?void 0:T.title)!=null?v:r.secondaryButtonTitle,x=(k=r.props)!=null?k:{},h=!!a;return jsxs(Po,s(i({open:t,onOpenChange:n},x),{children:[jsx(Co,{isBlocked:r.$state.blocked,isCompleted:l||p,title:u}),jsxs(bo,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(E=r.videoUri)!=null?E:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:c}),jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:g,onClick:o}),jsx(b.Primary,{disabled:h,title:f,onClick:e})]})]})]}))}var An={default:Ot};function Ln(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var w;let{onPrimary:a,onSecondary:l,openStepId:p,setOpenStepId:c,stepTypes:u}=useContext(Et),{handlePrimary:f,handleSecondary:g}=ne(o,{onPrimary:a,onSecondary:l}),x=(p!=null?p:e.getCurrentStep().id)===o.id,h=(w=u[o.type])!=null?w:Ot;function S(T){return $(this,null,function*(){c(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(h,s(i({flow:e,onOpenChange:S,open:x,step:o},t),{handlePrimary:f,handleSecondary:g}),o.id)}function Je(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,l=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=useState(null),g=i(i({},An),a);return jsx(Et.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:n,stepTypes:g},children:jsx(U,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},l),{children:w=>{var T=w,{flow:x,handleDismiss:h}=T,S=m(T,["flow","handleDismiss"]);let k=Array.from(x.steps.entries()).filter(([,F])=>F.$state.visible===!0).map(([,F])=>jsx(Ln,s(i({flow:x,handleDismiss:h},S),{step:F}),F.id)),E=x.getNumberOfCompletedSteps(),B=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[E,"/",B]}),jsx(Ce,{current:E,total:B,flexGrow:1})]})]}),k]})}}))})}var jn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Jn({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(([p])=>jn.has(p))),l=useController({name:t.id,control:o,rules:a});return jsx(e,s(i({},l),{fieldData:t,formContext:r,submit:n}))}function Ht({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var E,B,F,D,O,j;let{__readOnly:l}=useContext(M),p=((E=a.fields)!=null?E:[]).filter(V=>e[V.type]!=null&&V.id),c=useForm({delayError:2e3,mode:"onChange",defaultValues:p.reduce((V,J)=>{var se;return V[J.id]=(se=J.value)!=null?se:"",V},{})}),[u,f]=useState(!1),g=[],{control:x,handleSubmit:h}=c,S=(B=a.props)!=null?B:{};function w(V,J){f(!0),t(J,V,l===!0).then(()=>f(!1));}p.forEach(V=>{e[V.type]!=null&&g.push(jsx(Jn,{control:x,fieldComponent:e[V.type],fieldData:V,submit:h(w)},`${a.flow.id}-${V.id}`));});let T=(D=(F=a.primaryButton)==null?void 0:F.title)!=null?D:a.primaryButtonTitle,v=(j=(O=a.secondaryButton)==null?void 0:O.title)!=null?j:a.secondaryButtonTitle,k=!!(a.$state.blocked||!c.formState.isValid);return useEffect(()=>{c.reset();},[a]),jsxs(P.Column,s(i({gap:5,part:"form-step"},S),{children:[jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,s(i({},c),{children:g})),jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[v&&jsx(I.Secondary,{onClick:n,title:v}),jsx(I.Primary,{disabled:k||u,onClick:h(w),title:T!=null?T:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Mt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function So({children:e,id:o,required:t=!1}){return jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var wo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Me=s(i({},wo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),qe={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 Q({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:l}=t,{error:p}=n,c=s(i(i(i({id:r},o),l?{placeholder:l}:{}),Me),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxs(y,{part:"field",children:[jsx(So,{id:r,required:!!t.required,children:a}),e(c),jsx(Mt,{error:p})]})}function ve(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 Qn=go.forwardRef(({label:e,value:o},t)=>jsxs(y,{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(C.Body2,{part:"field-radio-label",children:e}),jsx(Te.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(y,s(i({as:Te.Indicator},qe),{children:jsx(ve,{height:"14",width:"14"})}))})})]}));function Fo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:l})=>jsx(Qn,{value:l,label:a},l));return jsx(Q,s(i({},e),{children:()=>jsx(Te.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:r})})}))}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:"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 zt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=go.useState([]);function l(p){let c=[];r.includes(p)?c=[...r.filter(u=>u!==p)]:c=[...r,p],a(c),o(c);}return jsx(Q,s(i({},e),{children:()=>jsx(P.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:p,value:c})=>jsx(Ye.Root,{value:r.includes(c)?c:void 0,onCheckedChange:()=>l(c),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(C.Body2,{part:"field-check-label",children:p}),jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(Ye.Indicator,{asChild:!0,children:jsx(y,s(i({},qe),{children:jsx(ve,{height:"14",width:"14"})}))})})]})},c))})}))}var ti=go.forwardRef(({label:e,value:o},t)=>jsx(A.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(A.ItemText,{asChild:!0,children:jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function vo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:l,value:p})=>jsx(ti,{value:p,label:l},p));return e.fieldData.multiple?jsx(zt,i({},e)):jsx(Q,s(i({},e),{children:()=>jsxs(A.Root,{value:t,onValueChange:o,children:[jsx(A.Trigger,{asChild:!0,children:jsxs(C.Body2,s(i({},Me),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(A.Value,{placeholder:r!=null?r:"Select one"}),jsx(A.Icon,{children:jsx(y,{as:$t,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(A.Portal,{children:jsx(A.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,s(i({},Me),{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(A.Viewport,{children:a})}))})})]})}))}function To(e){return jsx(Q,s(i({},e),{children:o=>jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Bo(e){return jsx(Q,s(i({},e),{children:o=>jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function jt(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(y,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(Ye.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(y,s(i({},wo),{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(Ye.Indicator,{asChild:!0,children:jsx(y,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(ve,{height:"14",fill:"currentColor"})})})}))}),jsx(C.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var ni={checkbox:jt,radio:Fo,select:vo,text:To,textarea:Bo};function Re(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let l=Object.assign({},ni,e);return jsx(U,s(i({flowId:o,part:["form",t]},n),{children:p=>jsx(Ht,i({fieldTypes:l},p))}))}var eo={};oe(eo,{NPS:()=>Ae});function qt({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((l,p)=>{let c=e.value===p?I.Primary:I.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxs(P.Column,{gap:2,children:[jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(C.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(C.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Ae(a){var l=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=l,r=m(l,["as","flowId","fieldTypes","part"]);let{flow:p}=ae(o);return jsx(Re,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:qt},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",n],css:s(i({},!p||p.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))}function xe(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&$(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>$(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function oo(){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(l=>{r(l);},[]);return useLayoutEffect(()=>{if(!n)return;let l=()=>{let p=n.getBoundingClientRect();t(p);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),{node:n,rect:o,ref:a}}var ui=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Qt(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxs(y,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${ui}`,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 to(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsx(y,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function gi(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 ro(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=gi(o);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},t)):o!=null&&o.endsWith(".mp4")?jsx(y,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 de(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsx(o==="video"?ro:to,i({src:e},t))}function or({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"},l="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=l;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=l:r.bottom=l:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=l:r.top=l:["top","bottom"].includes(n)?r.left=`calc(50% + ${l})`:r.top=`calc(50% + ${l})`,r}var no={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function tr(e,o){var a,l,p,c,u;let t=Object.fromEntries(no.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n=Object.fromEntries(no.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r={};for(let f of Object.keys(e))!no.content.includes(f)&&!no.root.includes(f)&&(r[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},g=(v,k)=>["top","bottom"].includes(k)?v=="after"?"marginLeft":"marginRight":v=="after"?"marginTop":"marginBottom",x=(p=t.alignOffset)!=null?p:0,h=(c=t.style)!=null?c:{},S=(u=t.side)!=null?u:"bottom",w=t.align;t.style=s(i({},h),{[g(w,S)]:x});let T=["top","bottom"].includes(S)?o.width:o.height;t.alignOffset=(T+x)*-1,t.align=f[w];}return {contentProps:t,otherProps:r,rootProps:n}}var rr=keyframes`
47
47
  from {
48
48
  opacity: 0;
49
49
  }
@@ -53,7 +53,7 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
53
53
  to {
54
54
  opacity: 1;
55
55
  }
56
- `;function ir(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function N(s){var d=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=d,a=m(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=to(),{node:f,rect:x,ref:h}=to(),ia=rr(a,u),{contentProps:F,otherProps:wr}=ia,Ao=wr,{part:S}=Ao,T=m(Ao,["part"]),{rootProps:v}=ia,[k,E]=useState(F.align),[B,w]=useState(F.side),[O,D]=useState(0),[X,V]=useState(0);if(c!==null){let q=c.getAttribute("data-align"),ce=c.getAttribute("data-side");k!==q&&E(q),B!==ce&&w(ce);}let j=useRef(null);if(useEffect(()=>{let q=document.querySelector(e);q!=null?(h(q),j.current=q):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function q(be){if(be.matches(e))return ir(be)?be:null;let ue=be.querySelectorAll(e);return ue.length>0&&ir(ue[0])?ue[0]:null}let ce=new MutationObserver(be=>{for(let ue of be)if(ue.type==="childList"){for(let ke of ue.addedNodes){if(ke.nodeType!==Node.ELEMENT_NODE)continue;let me=q(ke);if(me!=null){h(me),j.current=me,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",me);break}}for(let ke of ue.removedNodes){if(ke.nodeType!==Node.ELEMENT_NODE)continue;let me=q(ke);if(me!=null){h(null),j.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",me);break}}}});return ce.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ce.disconnect()},[]),useEffect(()=>{let{scrollX:q,scrollY:ce}=window;D(x.left+q),V(x.top+ce);},[x.left,x.top]),f==null)return null;let le="0";typeof window!="undefined"&&(le=window.getComputedStyle(f).borderRadius);let Ne=tr({props:a,alignAttr:k,sideAttr:B});return jsxs(ee.Root,l(i({defaultOpen:!0},v),{children:[jsx(ee.Anchor,{virtualRef:j}),jsx(ee.Portal,{children:jsxs(Fragment,{children:[n&&jsx(y,i({animation:`${nr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:le,height:x.height,left:O,top:X,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(ee.Content,l(i({asChild:!0},F),{ref:g,children:jsxs(b,l(i({animation:`${nr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:r},T),{children:[jsx(er,{style:Ne}),o]}))}))]})})]}))}N.Close=e=>jsx(ee.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,l(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});N.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsx(de,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))};N.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.Primary,i({title:o,onClick:e},t))};N.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"progress"},o),{children:e}))};N.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};N.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))};N.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.H4,l(i({part:"title"},o),{children:e}))};function ar(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:s}=u,d=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var v,k,E,B,w,O;let{handleDismiss:g}=xe(o,{onDismiss:t}),{handlePrimary:f,handleSecondary:x}=ne(s,{onPrimary:r,onSecondary:a}),h=(v=s.props)!=null?v:{},F=(E=(k=s.primaryButton)==null?void 0:k.title)!=null?E:s.primaryButtonTitle,S=(w=(B=s.secondaryButton)==null?void 0:B.title)!=null?w:s.secondaryButtonTitle,T=s.$state.blocked;return jsxs(N,l(i(i({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:D=>D.preventDefault(),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault()},d),h),{onEscapeKeyDown:D=>{typeof n=="function"&&n(D),D.defaultPrevented||g(D);},children:[e&&jsx(N.Close,{onClick:g}),jsx(N.Media,{src:(O=s.videoUri)!=null?O:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsx(N.Title,{children:s.title}),jsx(N.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx(N.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(N.Secondary,{disabled:T,onClick:x,title:S}),jsx(N.Primary,{disabled:T,onClick:f,title:F})]})]}),s.id)}function Le(e,o=!0){let{currentModal:t,modals:n,setModals:r}=useContext(M),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function d(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:a||!o,removeModal:d}}function Oo(a){var s=a,{flowId:e,onComplete:o,variables:t,part:n}=s,r=m(s,["flowId","onComplete","variables","part"]);let[d,c]=useState(!1),{flow:u}=ae(e,{variables:t}),{hasInitialized:g,registerComponent:f,unregisterComponent:x}=useContext(M);xe(u,{onComplete:o});let{isCurrentModal:h,removeModal:F}=Le(u);if(useEffect(()=>{!(u!=null&&u.isVisible)&&h&&F();},[u==null?void 0:u.isVisible,h]),useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!h||(f(e,()=>{d||c(!0);}),!g||!d))return null;let S=u.getCurrentStep();return S==null||S.start(),jsx(ar,i({"data-flow-id":u.id,flow:u,part:["tour",n],step:S},r))}function pr(e){var u,g,f;let{frigade:o}=useContext(M),[,t]=useState(!1),n,r=useCallback(x=>{o.getCollection(e).then(()=>{x();});let h=()=>{clearTimeout(n),n=setTimeout(()=>{t(F=>!F),x();},100);};return o.onStateChange(h),()=>{o.removeStateChangeHandler(h);}},[e]),a=useSyncExternalStore(r,()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x},()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x}),d=(f=((g=(u=a==null?void 0:a.flows)==null?void 0:u.map(x=>l(i({},x),{flow:o.getFlowSync(x.flowId)})))!=null?g:[]).find(({flow:x})=>x.isVisible))==null?void 0:f.flowId,{flow:c}=ae(d);return {collection:a,currentFlow:c}}function Io(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var c,u,g;let a={ANNOUNCEMENT:Ho,BANNER:xo,CARD:b,CHECKLIST:Xe,EMBEDDED_TIP:b,FORM:Re,NPS_SURVEY:Ae,SURVEY:Ae,TOUR:Oo},{currentFlow:s}=pr(e),d=(u=a[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?u: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",o],"data-collection-id":e},t),{children:jsx(Re,{flowId:s.id,as:H},s.id)})):jsx(y,l(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(d,{flowId:s.id},s.id)}))}function Ve(){let{frigade:e}=useContext(M);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function dr(){let[e,o]=useState(),{frigade:t}=Ve();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(Io,{as:null,collectionId:e})}var M=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function cr(){let{frigade:e}=Ve();return useEffect(()=>{$(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}function yr(s){var d=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=d,a=m(d,["children","css","defaultCollection","navigate","theme"]);let c=r?co(r):{},[u,g]=useState(new Set),f=useRef(new Map),x=useRef(),[h,F]=useState(!1),S=useMemo(()=>(F(!1),x.current=void 0,g(new Set),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})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let w=S.getConfig();w.__flowStateOverrides=a.__flowStateOverrides,S.reload(w);}},[a.__flowStateOverrides]);function T(){let w=[...f.current.entries()].map(([O,D])=>[O,D.callback]);S.batchRegister(w),F(!0);}function v(w,O){if(x.current&&clearTimeout(x.current),h){f.current.has(w)?S.getFlow(w).then(D=>O(D.isVisible)):(S.getFlow(w).then(D=>D.register(O)),f.current.set(w,{callback:O}));return}f.current.has(w)||f.current.set(w,{callback:O}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>T(),0);}function k(w){f.current.has(w)&&S.getFlow(w).then(O=>{f.current.delete(w),O==null||O.unregister();});}let E=n!=null?n:(w,O="_self")=>{window.open(w,O);};useEffect(()=>()=>{S.destroy();},[]);let B=u.size>0?u.values().next().value:null;return jsxs(M.Provider,{value:l(i({modals:u,setModals:g,currentModal:B,navigate:E},a),{frigade:S,registerComponent:v,unregisterComponent:k,hasInitialized:h}),children:[jsx(Global,{styles:{":root":i(i(i({},uo),c),o)}}),jsxs(ThemeProvider,{theme:R,children:[t&&jsx(dr,{}),e]}),a.preloadImages!==!1&&jsx(cr,{})]})}function ae(e,o){let{frigade:t}=useContext(M),[,n]=useState(!1),r=useCallback(s=>{t==null||t.getFlow(e).then(()=>{s();});let d=c=>{c.id===e&&setTimeout(()=>{n(u=>!u),s();},0);};return t==null||t.onStateChange(d),()=>{t.removeStateChangeHandler(d);}},[e]),a=useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a}}function U(u){var g=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:s,variables:d}=g,c=m(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var j,Ne;let{flow:f}=ae(t,{variables:d}),le=i(i({},(j=f==null?void 0:f.props)!=null?j:{}),c),{dismissible:x=!1,forceMount:h=!1,modal:F=!1}=le,S=m(le,["dismissible","forceMount","modal"]),T=f==null?void 0:f.getCurrentStep(),{handleDismiss:v}=xe(f,{onComplete:n,onDismiss:r}),{handlePrimary:k,handleSecondary:E}=ne(T,{onPrimary:a,onSecondary:s}),B=F||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Ne=f==null?void 0:f.rawData)==null?void 0:Ne.flowType),{isCurrentModal:w,removeModal:O}=Le(f,B);useEffect(()=>{!(f!=null&&f.isVisible)&&w&&O();},[f==null?void 0:f.isVisible,w]);let D=h&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||!D&&!w||!f.isVisible&&!D)return null;(D||!f.isCompleted&&!f.isSkipped)&&T.start();let X=e===null?Fragment$1:e!=null?e:y,V=l(i({},S),{"data-flow-id":f.id});return jsx(X,l(i({},e===null?{}:V),{children:o({flow:f,handleDismiss:v,handlePrimary:k,handleSecondary:E,parentProps:{dismissible:x,flowId:t,variables:d,containerProps:V},step:T})}))}function br(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsx(U,l(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:d},step:c})=>{var f,x,h,F;let u=(x=(f=c.primaryButton)==null?void 0:f.title)!=null?x:c.primaryButtonTitle,g=(F=(h=c.secondaryButton)==null?void 0:h.title)!=null?F:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:d,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:g,onClick:s}),jsx(b.Primary,{title:u,onClick:a})]})]})}}))}var b=yo.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=m(a,["children","flowId"]);var d;if(o!=null)return jsx(br,i({flowId:o},t));let s=(d=t.as)!=null?d:P.Column;return jsx(s,l(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});b.Dismiss=e=>jsx(I.Plain,l(i({part:"dismiss",padding:0},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}));b.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(P.Row,l(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(de,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Secondary,i({title:o,onClick:e},t))};b.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.Body2,l(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.H4,l(i({display:"block",part:"title"},o),{children:e}))};var lo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Cr(e){let o=Object.fromEntries(lo.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(lo.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!lo.content.some(a=>a===r)&&!lo.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Zi=keyframes`
56
+ `;function nr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function N(l){var p=l,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=p,a=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:f}=oo(),{node:g,rect:x,ref:h}=oo(),ra=tr(a,u),{contentProps:S,otherProps:Cr}=ra,Wo=Cr,{part:w}=Wo,T=m(Wo,["part"]),{rootProps:v}=ra,[k,E]=useState(S.align),[B,F]=useState(S.side),[D,O]=useState(0),[j,V]=useState(0);if(c!==null){let q=c.getAttribute("data-align"),ce=c.getAttribute("data-side");k!==q&&E(q),B!==ce&&F(ce);}let J=useRef(null);if(useEffect(()=>{let q=document.querySelector(e);q!=null?(h(q),J.current=q):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function q(be){if(be.matches(e))return nr(be)?be:null;let ue=be.querySelectorAll(e);return ue.length>0&&nr(ue[0])?ue[0]:null}let ce=new MutationObserver(be=>{for(let ue of be)if(ue.type==="childList"){for(let ke of ue.addedNodes){if(ke.nodeType!==Node.ELEMENT_NODE)continue;let me=q(ke);if(me!=null){h(me),J.current=me,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",me);break}}for(let ke of ue.removedNodes){if(ke.nodeType!==Node.ELEMENT_NODE)continue;let me=q(ke);if(me!=null){h(null),J.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",me);break}}}});return ce.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ce.disconnect()},[]),useEffect(()=>{let{scrollX:q,scrollY:ce}=window;O(x.left+q),V(x.top+ce);},[x.left,x.top]),g==null)return null;let se="0";typeof window!="undefined"&&(se=window.getComputedStyle(g).borderRadius);let Pr=or({props:a,alignAttr:k,sideAttr:B});return jsxs(ee.Root,s(i({defaultOpen:!0},v),{children:[jsx(ee.Anchor,{virtualRef:J}),jsx(ee.Portal,{children:jsxs(Fragment,{children:[n&&jsx(y,i({animation:`${rr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:se,height:x.height,left:D,top:j,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(ee.Content,s(i({asChild:!0},S),{ref:f,children:jsxs(b,s(i({animation:`${rr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",w],pointerEvents:"auto",style:r},T),{children:[jsx(Qt,{style:Pr}),o]}))}))]})})]}))}N.Close=e=>jsx(ee.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});N.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsx(de,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))};N.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.Primary,i({title:o,onClick:e},t))};N.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.Body2,s(i({part:"progress"},o),{children:e}))};N.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};N.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.Body2,s(i({part:"subtitle"},o),{children:e}))};N.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.H4,s(i({part:"title"},o),{children:e}))};function ir(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:l}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var v,k,E,B,F,D;let{handleDismiss:f}=xe(o,{onDismiss:t}),{handlePrimary:g,handleSecondary:x}=ne(l,{onPrimary:r,onSecondary:a}),h=(v=l.props)!=null?v:{},S=(E=(k=l.primaryButton)==null?void 0:k.title)!=null?E:l.primaryButtonTitle,w=(F=(B=l.secondaryButton)==null?void 0:B.title)!=null?F:l.secondaryButtonTitle,T=l.$state.blocked;return jsxs(N,s(i(i({anchor:l.selector,collisionPadding:12,onOpenAutoFocus:O=>O.preventDefault(),onPointerDownOutside:O=>O.preventDefault(),onInteractOutside:O=>O.preventDefault()},p),h),{onEscapeKeyDown:O=>{typeof n=="function"&&n(O),O.defaultPrevented||f(O);},children:[e&&jsx(N.Close,{onClick:f}),jsx(N.Media,{src:(D=l.videoUri)!=null?D:l.imageUri,type:l.videoUri?"video":"image"}),jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsx(N.Title,{children:l.title}),jsx(N.Subtitle,{color:"neutral.400",children:l.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx(N.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(N.Secondary,{disabled:T,onClick:x,title:w}),jsx(N.Primary,{disabled:T,onClick:g,title:S})]})]}),l.id)}function Le(e,o=!0){let{currentModal:t,modals:n,setModals:r}=useContext(M);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(l=>new Set(l).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]);function a(){n.has(e==null?void 0:e.id)&&setTimeout(()=>{r(l=>{let p=new Set(l);return p.delete(e==null?void 0:e.id),p});},0);}return {isCurrentModal:o?t===(e==null?void 0:e.id):!0,removeModal:a}}function Eo(a){var l=a,{flowId:e,onComplete:o,variables:t,part:n}=l,r=m(l,["flowId","onComplete","variables","part"]);let[p,c]=useState(!1),{flow:u}=ae(e,{variables:t}),{hasInitialized:f,registerComponent:g,unregisterComponent:x}=useContext(M);xe(u,{onComplete:o});let{isCurrentModal:h,removeModal:S}=Le(u);if(useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!h||(g(e,()=>{p||c(!0);}),!f||!p))return null;u!=null&&u.isVisible||S();let w=u.getCurrentStep();return w==null||w.start(),jsx(ir,i({"data-flow-id":u.id,flow:u,part:["tour",n],step:w},r))}function ar(e){var u,f,g;let{frigade:o}=useContext(M),[,t]=useState(!1),n,r=useCallback(x=>{o.getCollection(e).then(()=>{x();});let h=()=>{clearTimeout(n),n=setTimeout(()=>{t(S=>!S),x();},100);};return o.onStateChange(h),()=>{o.removeStateChangeHandler(h);}},[e]),a=useSyncExternalStore(r,()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x},()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x}),p=(g=((f=(u=a==null?void 0:a.flows)==null?void 0:u.map(x=>s(i({},x),{flow:o.getFlowSync(x.flowId)})))!=null?f:[]).find(({flow:x})=>x.isVisible))==null?void 0:g.flowId,{flow:c}=ae(p);return {collection:a,currentFlow:c}}function Oo(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var c,u,f;let a={ANNOUNCEMENT:Io,BANNER:yo,CARD:b,CHECKLIST:Je,EMBEDDED_TIP:b,FORM:Re,NPS_SURVEY:Ae,SURVEY:Ae,TOUR:Eo},{currentFlow:l}=ar(e),p=(u=a[(c=l==null?void 0:l.rawData)==null?void 0:c.flowType])!=null?u:null;return l==null||p==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(y,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(Re,{flowId:l.id,as:H},l.id)})):jsx(y,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(p,{flowId:l.id},l.id)}))}function Ve(){let{frigade:e}=useContext(M);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function lr(){let[e,o]=useState(),{frigade:t}=Ve();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(Oo,{as:null,collectionId:e})}var M=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function sr(){let{frigade:e}=Ve();return useEffect(()=>{$(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}function mr(l){var p=l,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,a=m(p,["children","css","defaultCollection","navigate","theme"]);let c=r?po(r):{},[u,f]=useState(new Set),g=useRef(new Map),x=useRef(),[h,S]=useState(!1),w=useMemo(()=>(S(!1),x.current=void 0,f(new Set),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})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let F=w.getConfig();F.__flowStateOverrides=a.__flowStateOverrides,w.reload(F);}},[a.__flowStateOverrides]);function T(){let F=[...g.current.entries()].map(([D,O])=>[D,O.callback]);w.batchRegister(F),S(!0);}function v(F,D){if(x.current&&clearTimeout(x.current),h){g.current.has(F)?w.getFlow(F).then(O=>D(O.isVisible)):(w.getFlow(F).then(O=>O.register(D)),g.current.set(F,{callback:D}));return}g.current.has(F)||g.current.set(F,{callback:D}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>T(),0);}function k(F){g.current.has(F)&&w.getFlow(F).then(D=>{g.current.delete(F),D==null||D.unregister();});}let E=n!=null?n:(F,D="_self")=>{window.open(F,D);};useEffect(()=>()=>{w.destroy();},[]);let B=u.size>0?u.values().next().value:null;return jsxs(M.Provider,{value:s(i({modals:u,setModals:f,currentModal:B,navigate:E},a),{frigade:w,registerComponent:v,unregisterComponent:k,hasInitialized:h}),children:[jsx(Global,{styles:{":root":i(i(i({},co),c),o)}}),jsxs(ThemeProvider,{theme:R,children:[t&&jsx(lr,{}),e]}),a.preloadImages!==!1&&jsx(sr,{})]})}function ae(e,o){let{frigade:t}=useContext(M),[,n]=useState(!1),r=useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let p=c=>{c.id===e&&setTimeout(()=>{n(u=>!u),l();},0);};return t==null||t.onStateChange(p),()=>{t.removeStateChangeHandler(p);}},[e]),a=useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a}}function U(u){var f=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:l,variables:p}=f,c=m(f,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var V,se;let{flow:g}=ae(t,{variables:p}),J=i(i({},(V=g==null?void 0:g.props)!=null?V:{}),c),{dismissible:x=!1,forceMount:h=!1}=J,S=m(J,["dismissible","forceMount"]),w=g==null?void 0:g.getCurrentStep(),{handleDismiss:T}=xe(g,{onComplete:n,onDismiss:r}),{handlePrimary:v,handleSecondary:k}=ne(w,{onPrimary:a,onSecondary:l}),E=(S==null?void 0:S.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((se=g==null?void 0:g.rawData)==null?void 0:se.flowType),{isCurrentModal:B,removeModal:F}=Le(g,E),D=h&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||!D&&!B)return null;if(!g.isVisible&&!D)return F(),null;(D||!g.isCompleted&&!g.isSkipped)&&w.start();let O=e===null?Fragment$1:e!=null?e:y,j=s(i({},S),{"data-flow-id":g.id});return jsx(O,s(i({},e===null?{}:j),{children:o({flow:g,handleDismiss:T,handlePrimary:v,handleSecondary:k,parentProps:{dismissible:x,flowId:t,variables:p,containerProps:j},step:w})}))}function yr(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsx(U,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:l,parentProps:{dismissible:p},step:c})=>{var g,x,h,S;let u=(x=(g=c.primaryButton)==null?void 0:g.title)!=null?x:c.primaryButtonTitle,f=(S=(h=c.secondaryButton)==null?void 0:h.title)!=null?S:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:p,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:f,onClick:l}),jsx(b.Primary,{title:u,onClick:a})]})]})}}))}var b=go.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=m(a,["children","flowId"]);var p;if(o!=null)return jsx(yr,i({flowId:o},t));let l=(p=t.as)!=null?p:P.Column;return jsx(l,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});b.Dismiss=e=>jsx(I.Plain,s(i({part:"dismiss",padding:0},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}));b.Header=a=>{var l=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=l,r=m(l,["dismissible","handleDismiss","subtitle","title"]);return jsxs(P.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(de,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Secondary,i({title:o,onClick:e},t))};b.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.Body2,s(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(C.H4,s(i({display:"block",part:"title"},o),{children:e}))};var lo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function hr(e){let o=Object.fromEntries(lo.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(lo.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!lo.content.some(a=>a===r)&&!lo.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var qi=keyframes`
57
57
  from {
58
58
  opacity: 0;
59
59
  }
@@ -63,8 +63,8 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
63
63
  to {
64
64
  opacity: 1;
65
65
  }
66
- `;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:g}=Cr(n),f=g,{zIndex:c}=f,u=m(f,["zIndex"]);return jsx(G.Root,l(i({defaultOpen:!0,modal:t},s),{children:jsx(G.Portal,{children:jsxs(y,{animation:`${Zi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c!=null?c:10,children:[jsx(G.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(G.Content,l(i({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},d),{children:jsx(b,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(G.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,l(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});H.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsx(G.Description,{asChild:!0,children:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))})};H.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsx(de,i({borderRadius:"md",src:e},o))};H.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.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(y,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?R.colors.primary.surface:R.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*o-8} 8`,width:16*o-8,children:t})};H.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};H.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsx(G.Title,{asChild:!0,children:jsx(C.H4,l(i({part:"title"},o),{children:e}))})};H.displayName="Dialog";var Sr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Ho(n){var r=n,{flowId:e,part:o}=r,t=m(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([d])=>Sr.some(c=>d===c))),s=Object.fromEntries(Object.entries(t).filter(([d])=>Sr.indexOf(d)===-1));return jsx(U,l(i({as:null,flowId:e},a),{children:({flow:d,handleDismiss:c,handlePrimary:u,handleSecondary:g,parentProps:{containerProps:f,dismissible:x},step:h})=>{var k,E,B,w,O,D;let F=(k=h.props)!=null?k:{},S=(B=(E=h.primaryButton)==null?void 0:E.title)!=null?B:h.primaryButtonTitle,T=(O=(w=h.secondaryButton)==null?void 0:w.title)!=null?O:h.secondaryButtonTitle,v=h.$state.blocked;return jsx(H,l(i(i({part:["announcement",o],textAlign:"center"},f),s),{onEscapeKeyDown:X=>{if(t.dismissible===!1){X.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(X),X.defaultPrevented||c(X);},children:jsxs(P.Column,l(i({gap:5,part:"announcement-step"},F),{children:[x&&jsx(H.Dismiss,{onClick:c}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(H.Title,{children:h.title}),jsx(H.Subtitle,{children:h.subtitle})]}),jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(D=h.videoUri)!=null?D:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image",width:"100%"}),jsx(H.ProgressDots,{current:d.getCurrentStepIndex(),total:d.getNumberOfAvailableSteps()}),jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[T&&jsx(H.Secondary,{disabled:v,onClick:g,title:T}),S&&jsx(H.Primary,{disabled:v,onClick:u,title:S})]})]}))}))}}))}function oa(){let{userId:e,frigade:o}=useContext(M);function t(r){return $(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return $(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function ra(){var r;let{frigade:e}=useContext(M);function o(a){return $(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,s){return $(this,null,function*(){yield e.track(a,s);})}function n(a,s){return $(this,null,function*(){yield e.group(a,s);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
66
+ `;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:l,contentProps:p,otherProps:f}=hr(n),g=f,{zIndex:c}=g,u=m(g,["zIndex"]);return jsx(G.Root,s(i({defaultOpen:!0,modal:t},l),{children:jsx(G.Portal,{children:jsxs(y,{animation:`${qi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c!=null?c:10,children:[t&&jsx(G.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(G.Content,s(i({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},p),{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(G.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,s(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});H.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsx(G.Description,{asChild:!0,children:jsx(C.Body2,s(i({part:"subtitle"},o),{children:e}))})};H.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsx(de,i({borderRadius:"md",src:e},o))};H.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.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(y,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?R.colors.primary.surface:R.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*o-8} 8`,width:16*o-8,children:t})};H.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};H.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsx(G.Title,{asChild:!0,children:jsx(C.H4,s(i({part:"title"},o),{children:e}))})};H.displayName="Dialog";var br=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Io(n){var r=n,{flowId:e,part:o}=r,t=m(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([p])=>br.some(c=>p===c))),l=Object.fromEntries(Object.entries(t).filter(([p])=>br.indexOf(p)===-1));return jsx(U,s(i({as:null,flowId:e},a),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:f,parentProps:{containerProps:g,dismissible:x},step:h})=>{var k,E,B,F,D,O;let S=(k=h.props)!=null?k:{},w=(B=(E=h.primaryButton)==null?void 0:E.title)!=null?B:h.primaryButtonTitle,T=(D=(F=h.secondaryButton)==null?void 0:F.title)!=null?D:h.secondaryButtonTitle,v=h.$state.blocked;return jsx(H,s(i(i({part:["announcement",o],textAlign:"center"},g),l),{onEscapeKeyDown:j=>{if(t.dismissible===!1){j.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(j),j.defaultPrevented||c(j);},children:jsxs(P.Column,s(i({gap:5,part:"announcement-step"},S),{children:[x&&jsx(H.Dismiss,{onClick:c}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(H.Title,{children:h.title}),jsx(H.Subtitle,{children:h.subtitle})]}),jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(O=h.videoUri)!=null?O:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image",width:"100%"}),jsx(H.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[T&&jsx(H.Secondary,{disabled:v,onClick:f,title:T}),w&&jsx(H.Primary,{disabled:v,onClick:u,title:w})]})]}))}))}}))}function Qi(){let{userId:e,frigade:o}=useContext(M);function t(r){return $(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return $(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function oa(){var r;let{frigade:e}=useContext(M);function o(a){return $(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,l){return $(this,null,function*(){yield e.track(a,l);})}function n(a,l){return $(this,null,function*(){yield e.group(a,l);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
67
67
 
68
- export { Ho as Announcement, xo as Banner, Q as BaseField, y as Box, I as Button, b as Card, qe as Checklist, Io as Collection, H as Dialog, P as Flex, U as Flow, Re as Form, ro as Image, wo as Label, de as Media, Oe as Progress, yr as Provider, vo as RadioField, To as SelectField, oo as Survey, C as Text, Bo as TextField, Ro as TextareaField, N as Tooltip, Oo as Tour, no as Video, uo as themeVariables, Ge as tokens, to as useBoundingClientRect, ae as useFlow, xe as useFlowHandlers, Ve as useFrigade, ra as useGroup, Le as useModal, ne as useStepHandlers, oa as useUser };
68
+ export { Io as Announcement, yo as Banner, Q as BaseField, y as Box, I as Button, b as Card, Xe as Checklist, Oo as Collection, H as Dialog, P as Flex, U as Flow, Re as Form, to as Image, So as Label, de as Media, Oe as Progress, mr as Provider, Fo as RadioField, vo as SelectField, eo as Survey, C as Text, To as TextField, Bo as TextareaField, N as Tooltip, Eo as Tour, ro as Video, co as themeVariables, _e as tokens, oo as useBoundingClientRect, ae as useFlow, xe as useFlowHandlers, Ve as useFrigade, oa as useGroup, Le as useModal, ne as useStepHandlers, Qi as useUser };
69
69
  //# sourceMappingURL=out.js.map
70
70
  //# sourceMappingURL=index.js.map