@frigade/react 2.4.4 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var react = require('@emotion/react');
4
- var K = require('@radix-ui/react-dialog');
4
+ var U = require('@radix-ui/react-dialog');
5
5
  var solid = require('@heroicons/react/20/solid');
6
6
  var lo = require('react');
7
7
  var clsx = require('clsx');
@@ -14,7 +14,7 @@ var gn = require('embla-carousel-react');
14
14
  var he = require('@radix-ui/react-collapsible');
15
15
  var reactHookForm = require('react-hook-form');
16
16
  var Ce = require('@radix-ui/react-radio-group');
17
- var N = require('@radix-ui/react-select');
17
+ var L = require('@radix-ui/react-select');
18
18
  var Z = require('@radix-ui/react-popover');
19
19
 
20
20
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -37,7 +37,7 @@ function _interopNamespace(e) {
37
37
  return Object.freeze(n);
38
38
  }
39
39
 
40
- var K__namespace = /*#__PURE__*/_interopNamespace(K);
40
+ var U__namespace = /*#__PURE__*/_interopNamespace(U);
41
41
  var lo__namespace = /*#__PURE__*/_interopNamespace(lo);
42
42
  var mr__default = /*#__PURE__*/_interopDefault(mr);
43
43
  var Sr__default = /*#__PURE__*/_interopDefault(Sr);
@@ -45,17 +45,17 @@ var js__namespace = /*#__PURE__*/_interopNamespace(js);
45
45
  var gn__default = /*#__PURE__*/_interopDefault(gn);
46
46
  var he__namespace = /*#__PURE__*/_interopNamespace(he);
47
47
  var Ce__namespace = /*#__PURE__*/_interopNamespace(Ce);
48
- var N__namespace = /*#__PURE__*/_interopNamespace(N);
48
+ var L__namespace = /*#__PURE__*/_interopNamespace(L);
49
49
  var Z__namespace = /*#__PURE__*/_interopNamespace(Z);
50
50
 
51
- var Do=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var Oo=Object.prototype.hasOwnProperty,Io=Object.prototype.propertyIsEnumerable;var Eo=(e,o,t)=>o in e?Do(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Oo.call(o,t)&&Eo(e,t,o[t]);if(Le)for(var t of Le(o))Io.call(o,t)&&Eo(e,t,o[t]);return e},d=(e,o)=>ar(e,sr(o));var lr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var r in e)Oo.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Le)for(var r of Le(e))o.indexOf(r)<0&&Io.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Do(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{l(t.next(c));}catch(m){n(m);}},s=c=>{try{l(t.throw(c));}catch(m){n(m);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((t=t.apply(e,o)).next());});var Ho={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Wo=[...$e],to=[...$e];Wo[4]=40;to[4]=60;var pr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Wo},red:{h:9,s:90,l:to},yellow:{h:50,s:90,l:to}};var A={};for(let[e,{h:o,s:t,l:r}]of Object.entries(pr))A[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Mo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Ao={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Lo={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 $o={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var dr="px",cr=e=>typeof e=="number"?`${4*e}${dr}`:e,ur=[-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"],No=Object.fromEntries(ur.map(e=>[e,cr(e)]));var Vo={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 Ne=d(a(d(a({},Ho),{colors:a(a({},Mo),Lo)}),Vo),{radii:Ao,shadows:$o,space:No});function ve(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,ve(l,s,t)):r[s]=l,r},{})}function ro(e){let o=ve(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function _o(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=_o(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var no=ro(Ne),v=_o(Ne);var fr=new Set(["alt","size","src"]),gr=mr__default.default.all.filter(e=>e.indexOf("-")!=0&&!fr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),yr=Object.fromEntries(gr),Ve=ve(v.colors),xr={color:Ve,backgroundColor:Ve,borderColor:Ve,border:a(a({},v.borderWidths),Ve),borderRadius:v.radii,borderWidth:v.borderWidths,boxShadow:v.shadows,fontFamily:v.fontFamilies,fontSize:v.fontSizes,fontWeight:v.fontWeights,gap:v.space,lineHeight:v.lineHeights,margin:v.space,marginBottom:v.space,marginLeft:v.space,marginRight:v.space,marginTop:v.space,padding:v.space,paddingBottom:v.space,paddingLeft:v.space,paddingRight:v.space,paddingTop:v.space},zo=a(a({},yr),xr),Ko={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"]},Uo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function br(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 jo=new Map(Object.entries(zo).map(([e,o])=>[e,br(o)])),hr=new Map(Object.entries(Ko).map(([e,o])=>[e,new Set(o)])),Pr=new Set(["height","width"]),Cr=new Set(["canvas","embed","iframe","img","input","object","video"]);function Go(e){let[o,t]=e.split(":");return [o,Uo.has(t)?t:null]}function Jo(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([i,s])=>{let[l,c]=Go(i),m=hr.get(l);m!=null&&(m.forEach(g=>{let P=`${g}${c?":"+c:""}`;t[P]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,c]=Go(i),m=jo.get(l);if(m!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(P=>{var x;return (x=m.get(P.toString()))!=null?x:P}).join(" ");}else m.has(s.toString())?n(c)[l]=m.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!Cr.has(o)||!Pr.has(l))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&jo.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Fr(){if(typeof window=="undefined"){let{JSDOM:e}=lr("jsdom");return new e("<!DOCTYPE html>").window}return window}function Xo(e){return e?{__html:Sr__default.default(Fr()).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"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Tr(e){return e&&`fr-${e}`}function Qo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Qo(o)).join(" "):Tr(e))}function vr(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,i=f(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:g,unmatchedProps:P}=Jo(i,m),x=Qo(n),u=t||x?clsx.clsx(t,x):void 0,w=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsxRuntime.jsx(m,d(a({className:u,css:w},P),{ref:s,dangerouslySetInnerHTML:Xo(o)})):jsxRuntime.jsx(m,d(a({className:u,css:w},P),{ref:s,children:o}))}var y=lo__namespace.forwardRef(vr);var O={};ee(O,{Link:()=>on,Plain:()=>tn,Primary:()=>Zr,Secondary:()=>en});var F={};ee(F,{Body1:()=>zr,Body2:()=>Kr,Caption:()=>Ur,Display1:()=>Ar,Display2:()=>Lr,H1:()=>$r,H2:()=>Nr,H3:()=>Vr,H4:()=>_r});var io={};ee(io,{Body1:()=>Ir,Body2:()=>Hr,Caption:()=>Wr,Display1:()=>Br,Display2:()=>Rr,H1:()=>kr,H2:()=>Er,H3:()=>Dr,H4:()=>Or});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Br=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Rr=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),kr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Er=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Dr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Or=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Ir=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Hr=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Wr=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Mr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Mr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=lo__namespace.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,i=f(c,["as","children"]);return jsxRuntime.jsx(y,d(a(a({as:r},io[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Ar=te.Display1,Lr=te.Display2,$r=te.H1,Nr=te.H2,Vr=te.H3,_r=te.H4,zr=te.Body1,Kr=te.Body2,Ur=te.Caption;var so={};ee(so,{Link:()=>qr,Plain:()=>Yr,Primary:()=>Jr,Secondary:()=>Xr,loadingCSSStyle:()=>ao});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Jr=d(a({},_e),{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"}),Xr=d(a({},_e),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),qr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Yr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Qr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),ao={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:Qr+" 1s ease infinite"}};function ze(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,i=f(l,["as","children","part","title","variant"]);var m;let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(y,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},so[n]),{css:a(a({},(m=i.css)!=null?m:{}),i.loading?ao:{})}),i),{loading:void 0,children:[o,r&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Zr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function en(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function on(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Link",children:e}))}function tn(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var C={};ee(C,{Column:()=>an,Row:()=>nn});var nn=lo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),an=lo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function po(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=f(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(U,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:m},step:g})=>{var S,B,k,T,E;let P=(S=g.props)!=null?S:{},x=(k=(B=g.primaryButton)==null?void 0:B.title)!=null?k:g.primaryButtonTitle,u=(E=(T=g.secondaryButton)==null?void 0:T.title)!=null?E:g.secondaryButtonTitle,w=g.$state.blocked;return jsxRuntime.jsxs(h,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},m),P),{children:[g.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(h.Title,{part:"title",children:g.title}),jsxRuntime.jsx(h.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsxRuntime.jsx(h.Secondary,{disabled:w,title:u,onClick:c}),jsxRuntime.jsx(h.Primary,{disabled:w,title:x,onClick:l}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:s})]}))}}))}var je={};ee(je,{Carousel:()=>mt,Collapsible:()=>Ue,CollapsibleStep:()=>Ee});var Re={};ee(Re,{Bar:()=>xe,Dots:()=>nt,Segments:()=>at});function xe(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(y,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function nt(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?v.colors.blue500:v.colors.blue800},l));return jsxRuntime.jsx(y,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function at(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsxRuntime.jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function sn(){return jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function st(t){var r=t,{checked:e=!1}=r,o=f(r,["checked"]);return jsxRuntime.jsx(y,d(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsxRuntime.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:jsxRuntime.jsx(sn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=lo.useContext(I),n={"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:lo.useCallback((i,s,l=!0)=>W(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:lo.useCallback((i,s)=>W(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function pt({onPrimary:e,onSecondary:o,step:t}){var m,g;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s,skipped:l}=t.$state,c=s||l||!i?jsxRuntime.jsx(st,{checked:s||l,marginLeft:"auto"}):jsxRuntime.jsx(y,{as:outline.LockClosedIcon,height:"22px",marginLeft:"auto",width:"22px"});return jsxRuntime.jsxs(h,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:i,opacity:i?.5:1,children:[jsxRuntime.jsxs(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsxRuntime.jsx(h.Title,{children:t.title}),jsxRuntime.jsx(h.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(C.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:[jsxRuntime.jsx(h.Secondary,{disabled:i,onClick:n,title:(m=t.secondaryButton)==null?void 0:m.title}),jsxRuntime.jsx(h.Primary,{disabled:i,onClick:r,title:(g=t.primaryButton)==null?void 0:g.title})]})]})}var dt=react.keyframes`
51
+ var Oo=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var Io=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable;var Do=(e,o,t)=>o in e?Oo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Io.call(o,t)&&Do(e,t,o[t]);if(Le)for(var t of Le(o))Ho.call(o,t)&&Do(e,t,o[t]);return e},d=(e,o)=>ar(e,sr(o));var lr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var r in e)Io.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Le)for(var r of Le(e))o.indexOf(r)<0&&Ho.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Oo(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{l(t.next(c));}catch(m){n(m);}},s=c=>{try{l(t.throw(c));}catch(m){n(m);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((t=t.apply(e,o)).next());});var Wo={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Mo=[...$e],to=[...$e];Mo[4]=40;to[4]=60;var pr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Mo},red:{h:9,s:90,l:to},yellow:{h:50,s:90,l:to}};var A={};for(let[e,{h:o,s:t,l:r}]of Object.entries(pr))A[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Ao=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Lo={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,$o={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 No={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var dr="px",cr=e=>typeof e=="number"?`${4*e}${dr}`:e,ur=[-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"],Vo=Object.fromEntries(ur.map(e=>[e,cr(e)]));var _o={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 Ne=d(a(d(a({},Wo),{colors:a(a({},Ao),$o)}),_o),{radii:Lo,shadows:No,space:Vo});function ve(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,ve(l,s,t)):r[s]=l,r},{})}function ro(e){let o=ve(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function zo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=zo(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var no=ro(Ne),v=zo(Ne);var fr=new Set(["alt","size","src"]),gr=mr__default.default.all.filter(e=>e.indexOf("-")!=0&&!fr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),yr=Object.fromEntries(gr),Ve=ve(v.colors),xr={color:Ve,backgroundColor:Ve,borderColor:Ve,border:a(a({},v.borderWidths),Ve),borderRadius:v.radii,borderWidth:v.borderWidths,boxShadow:v.shadows,fontFamily:v.fontFamilies,fontSize:v.fontSizes,fontWeight:v.fontWeights,gap:v.space,lineHeight:v.lineHeights,margin:v.space,marginBottom:v.space,marginLeft:v.space,marginRight:v.space,marginTop:v.space,padding:v.space,paddingBottom:v.space,paddingLeft:v.space,paddingRight:v.space,paddingTop:v.space},Ko=a(a({},yr),xr),Uo={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"]},jo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function br(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 Go=new Map(Object.entries(Ko).map(([e,o])=>[e,br(o)])),hr=new Map(Object.entries(Uo).map(([e,o])=>[e,new Set(o)])),Pr=new Set(["height","width"]),Cr=new Set(["canvas","embed","iframe","img","input","object","video"]);function Jo(e){let[o,t]=e.split(":");return [o,jo.has(t)?t:null]}function Xo(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([i,s])=>{let[l,c]=Jo(i),m=hr.get(l);m!=null&&(m.forEach(g=>{let P=`${g}${c?":"+c:""}`;t[P]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,c]=Jo(i),m=Go.get(l);if(m!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(P=>{var x;return (x=m.get(P.toString()))!=null?x:P}).join(" ");}else m.has(s.toString())?n(c)[l]=m.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!Cr.has(o)||!Pr.has(l))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&Go.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Fr(){if(typeof window=="undefined"){let{JSDOM:e}=lr("jsdom");return new e("<!DOCTYPE html>").window}return window}function qo(e){return e?{__html:Sr__default.default(Fr()).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"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Tr(e){return e&&`fr-${e}`}function Zo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Zo(o)).join(" "):Tr(e))}function vr(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,i=f(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:g,unmatchedProps:P}=Xo(i,m),x=Zo(n),u=t||x?clsx.clsx(t,x):void 0,w=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsxRuntime.jsx(m,d(a({className:u,css:w},P),{ref:s,dangerouslySetInnerHTML:qo(o)})):jsxRuntime.jsx(m,d(a({className:u,css:w},P),{ref:s,children:o}))}var y=lo__namespace.forwardRef(vr);var O={};ee(O,{Link:()=>on,Plain:()=>tn,Primary:()=>Zr,Secondary:()=>en});var F={};ee(F,{Body1:()=>zr,Body2:()=>Kr,Caption:()=>Ur,Display1:()=>Ar,Display2:()=>Lr,H1:()=>$r,H2:()=>Nr,H3:()=>Vr,H4:()=>_r});var io={};ee(io,{Body1:()=>Ir,Body2:()=>Hr,Caption:()=>Wr,Display1:()=>Br,Display2:()=>Rr,H1:()=>kr,H2:()=>Er,H3:()=>Dr,H4:()=>Or});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Br=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Rr=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),kr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Er=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Dr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Or=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Ir=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Hr=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Wr=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Mr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Mr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=lo__namespace.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,i=f(c,["as","children"]);return jsxRuntime.jsx(y,d(a(a({as:r},io[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Ar=te.Display1,Lr=te.Display2,$r=te.H1,Nr=te.H2,Vr=te.H3,_r=te.H4,zr=te.Body1,Kr=te.Body2,Ur=te.Caption;var so={};ee(so,{Link:()=>qr,Plain:()=>Yr,Primary:()=>Jr,Secondary:()=>Xr,loadingCSSStyle:()=>ao});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Jr=d(a({},_e),{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"}),Xr=d(a({},_e),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),qr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Yr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Qr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),ao={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:Qr+" 1s ease infinite"}};function ze(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,i=f(l,["as","children","part","title","variant"]);var m;let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(y,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},so[n]),{css:a(a({},(m=i.css)!=null?m:{}),i.loading?ao:{})}),i),{loading:void 0,children:[o,r&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Zr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function en(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function on(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Link",children:e}))}function tn(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var C={};ee(C,{Column:()=>an,Row:()=>nn});var nn=lo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),an=lo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function po(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=f(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(j,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:m},step:g})=>{var S,B,E,T,k;let P=(S=g.props)!=null?S:{},x=(E=(B=g.primaryButton)==null?void 0:B.title)!=null?E:g.primaryButtonTitle,u=(k=(T=g.secondaryButton)==null?void 0:T.title)!=null?k:g.secondaryButtonTitle,w=g.$state.blocked;return jsxRuntime.jsxs(h,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},m),P),{children:[g.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(h.Title,{part:"title",children:g.title}),jsxRuntime.jsx(h.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsxRuntime.jsx(h.Secondary,{disabled:w,title:u,onClick:c}),jsxRuntime.jsx(h.Primary,{disabled:w,title:x,onClick:l}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:s})]}))}}))}var je={};ee(je,{Carousel:()=>ft,Collapsible:()=>Ue,CollapsibleStep:()=>Ee});var Re={};ee(Re,{Bar:()=>xe,Dots:()=>it,Segments:()=>st});function xe(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(y,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function it(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?v.colors.blue500:v.colors.blue800},l));return jsxRuntime.jsx(y,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function st(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsxRuntime.jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function sn(){return jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function lt(t){var r=t,{checked:e=!1}=r,o=f(r,["checked"]);return jsxRuntime.jsx(y,d(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsxRuntime.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:jsxRuntime.jsx(sn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=lo.useContext(I),n={"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:lo.useCallback((i,s,l=!0)=>W(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:lo.useCallback((i,s)=>W(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function dt({onPrimary:e,onSecondary:o,step:t}){var m,g;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s,skipped:l}=t.$state,c=s||l||!i?jsxRuntime.jsx(lt,{checked:s||l,marginLeft:"auto"}):jsxRuntime.jsx(y,{as:outline.LockClosedIcon,height:"22px",marginLeft:"auto",width:"22px"});return jsxRuntime.jsxs(h,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:i,opacity:i?.5:1,children:[jsxRuntime.jsxs(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsxRuntime.jsx(h.Title,{children:t.title}),jsxRuntime.jsx(h.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(C.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:[jsxRuntime.jsx(h.Secondary,{disabled:i,onClick:n,title:(m=t.secondaryButton)==null?void 0:m.title}),jsxRuntime.jsx(h.Primary,{disabled:i,onClick:r,title:(g=t.primaryButton)==null?void 0:g.title})]})]})}var ct=react.keyframes`
52
52
  from {
53
53
  opacity: 0;
54
54
  }
55
55
  to {
56
56
  opacity: 1;
57
57
  }
58
- `;function ct({flow:e,sort:o,parentProps:{containerProps:t}}){var B,k;let[r,n]=lo.useState(),[i]=lo.useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(k=(B=Array.from(e.steps.values()).find(T=>!T.$state.completed&&!T.$state.skipped))==null?void 0:B.order)!=null?k:0}),[s,l]=gn__default.default(i),[c,m]=lo.useState(),[g,P]=lo.useState();lo.useLayoutEffect(()=>{l&&(c==null&&m(l.canScrollNext()),g==null&&P(l.canScrollPrev()),l.on("select",()=>{m(l.canScrollNext()),P(l.canScrollPrev());}));},[l]),lo.useEffect(()=>{if(!r){let T=Array.from(e.steps.values()),E=T.filter(b=>b.$state.completed||b.$state.skipped).sort((b,R)=>b.order-R.order),H=T.filter(b=>!b.$state.completed&&!b.$state.skipped).sort((b,R)=>b.order-R.order);n(o==="completed-last"?[...H,...E].map(b=>b.id):T.map(b=>b.id));}},[]);let x=e.getNumberOfCompletedSteps(),u=e.getNumberOfAvailableSteps(),{onPrimary:w,onSecondary:S}=t;return r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:v.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxRuntime.jsxs(C.Column,{part:"carousel-header-content",children:[jsxRuntime.jsx(F.H3,{children:e.title}),jsxRuntime.jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",u]}),jsxRuntime.jsx(xe,{current:x,total:u,minWidth:"200px"})]})]}),jsxRuntime.jsxs(y,{margin:`0 ${v.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsxRuntime.jsx(C.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((T,E)=>r.indexOf(T.id)-r.indexOf(E.id)).map(T=>jsxRuntime.jsx(pt,{onPrimary:w,onSecondary:S,step:T},T.id))}),g&&jsxRuntime.jsx(C.Column,{animation:`${dt} 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:jsxRuntime.jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollPrev(),padding:"2",children:jsxRuntime.jsx(outline.ArrowLeftIcon,{height:"24px",width:"24px"})})}),c&&jsxRuntime.jsx(C.Column,{animation:`${dt} 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:jsxRuntime.jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollNext(),padding:"2",children:jsxRuntime.jsx(outline.ArrowRightIcon,{height:"24px",width:"24px"})})})]})]}):null}function mt(o){var e=f(o,[]);return jsxRuntime.jsx(U,d(a({as:h,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsxRuntime.jsx(ct,a(a({},e),t))}))}var Ee={};ee(Ee,{Content:()=>mo,Root:()=>fo,Trigger:()=>go});var bn=react.keyframes`
58
+ `;function ut({flow:e,sort:o,parentProps:{containerProps:t}}){var B,E;let[r,n]=lo.useState(),[i]=lo.useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(E=(B=Array.from(e.steps.values()).find(T=>!T.$state.completed&&!T.$state.skipped))==null?void 0:B.order)!=null?E:0}),[s,l]=gn__default.default(i),[c,m]=lo.useState(),[g,P]=lo.useState();lo.useLayoutEffect(()=>{l&&(c==null&&m(l.canScrollNext()),g==null&&P(l.canScrollPrev()),l.on("select",()=>{m(l.canScrollNext()),P(l.canScrollPrev());}));},[l]),lo.useEffect(()=>{if(!r){let T=Array.from(e.steps.values()),k=T.filter(b=>b.$state.completed||b.$state.skipped).sort((b,R)=>b.order-R.order),H=T.filter(b=>!b.$state.completed&&!b.$state.skipped).sort((b,R)=>b.order-R.order);n(o==="completed-last"?[...H,...k].map(b=>b.id):T.map(b=>b.id));}},[]);let x=e.getNumberOfCompletedSteps(),u=e.getNumberOfAvailableSteps(),{onPrimary:w,onSecondary:S}=t;return r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:v.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxRuntime.jsxs(C.Column,{part:"carousel-header-content",children:[jsxRuntime.jsx(F.H3,{children:e.title}),jsxRuntime.jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",u]}),jsxRuntime.jsx(xe,{current:x,total:u,minWidth:"200px"})]})]}),jsxRuntime.jsxs(y,{margin:`0 ${v.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsxRuntime.jsx(C.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((T,k)=>r.indexOf(T.id)-r.indexOf(k.id)).map(T=>jsxRuntime.jsx(dt,{onPrimary:w,onSecondary:S,step:T},T.id))}),g&&jsxRuntime.jsx(C.Column,{animation:`${ct} 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:jsxRuntime.jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollPrev(),padding:"2",children:jsxRuntime.jsx(outline.ArrowLeftIcon,{height:"24px",width:"24px"})})}),c&&jsxRuntime.jsx(C.Column,{animation:`${ct} 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:jsxRuntime.jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollNext(),padding:"2",children:jsxRuntime.jsx(outline.ArrowRightIcon,{height:"24px",width:"24px"})})})]})]}):null}function ft(o){var e=f(o,[]);return jsxRuntime.jsx(j,d(a({as:h,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsxRuntime.jsx(ut,a(a({},e),t))}))}var Ee={};ee(Ee,{Content:()=>mo,Root:()=>fo,Trigger:()=>go});var bn=react.keyframes`
59
59
  from {
60
60
  height: 0;
61
61
  opacity: 0;
@@ -73,7 +73,7 @@ var Do=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnProp
73
73
  height: 0;
74
74
  opacity: 0;
75
75
  }
76
- `,Pn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Cn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(Pn,{})})})}function mo({children:e}){return jsxRuntime.jsx(he__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${bn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${hn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsxRuntime.jsx(y,{}),e]})})}function fo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(he__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(h,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function go({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(he__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.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:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Cn,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var gt=lo.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function yt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var w,S,B,k,T,E;let{$state:{blocked:i,completed:s,skipped:l},subtitle:c,title:m}=n,g=(S=(w=n.primaryButton)==null?void 0:w.title)!=null?S:n.primaryButtonTitle,P=(k=(B=n.secondaryButton)==null?void 0:B.title)!=null?k:n.secondaryButtonTitle,x=(T=n.props)!=null?T:{},u=!!i;return jsxRuntime.jsxs(fo,d(a({open:t,onOpenChange:r},x),{children:[jsxRuntime.jsx(go,{isBlocked:n.$state.blocked,isCompleted:s||l,title:m}),jsxRuntime.jsxs(mo,{children:[jsxRuntime.jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(E=n.videoUri)!=null?E:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(h.Subtitle,{color:"neutral.400",children:c}),jsxRuntime.jsxs(C.Row,{gap:3,part:"collapsible-footer",children:[jsxRuntime.jsx(h.Secondary,{title:P,onClick:o}),jsxRuntime.jsx(h.Primary,{disabled:u,title:g,onClick:e})]})]})]}))}var Tn={default:yt};function vn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:m}=lo.useContext(gt),{handlePrimary:g,handleSecondary:P}=re(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,u=(S=m[o.type])!=null?S:yt;function w(B){return W(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(u,d(a({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:g,handleSecondary:P}),o.id)}function Ue(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,g]=lo.useState(null),P=a(a({},Tn),i);return jsxRuntime.jsx(gt.Provider,{value:{openStepId:m,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:P},children:jsxRuntime.jsx(U,d(a({as:h,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:u}=B,w=f(B,["flow","handleDismiss"]);let T=Array.from(x.steps.entries()).filter(([,b])=>b.$state.visible===!0).map(([,b])=>jsxRuntime.jsx(vn,d(a({flow:x,handleDismiss:u},w),{step:b}),b.id)),E=x.getNumberOfCompletedSteps(),H=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(h.Header,{dismissible:e,handleDismiss:u,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[E,"/",H]}),jsxRuntime.jsx(xe,{current:E,total:H,flexGrow:1})]})]}),T]})}}))})}var Hn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Wn({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([l])=>Hn.has(l))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function bt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var T,E,H,b,R,D;let{__readOnly:s}=lo.useContext(I),l=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,m]=lo.useState(!1),g=[],{control:P,handleSubmit:x}=l,u=(T=i.props)!=null?T:{};function w(V,Se){m(!0),t(Se,V,s===!0).then(()=>m(!1));}(E=i.fields)==null||E.forEach(V=>{e[V.type]!=null&&g.push(jsxRuntime.jsx(Wn,{control:P,fieldComponent:e[V.type],fieldData:V,submit:x(w)},`${i.flow.id}-${V.id}`));});let S=(b=(H=i.primaryButton)==null?void 0:H.title)!=null?b:i.primaryButtonTitle,B=(D=(R=i.secondaryButton)==null?void 0:R.title)!=null?D:i.secondaryButtonTitle,k=!!(i.$state.blocked||!l.formState.isValid);return jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"form-step"},u),{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},l),{children:g})),jsxRuntime.jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(O.Secondary,{disabled:k,onClick:r,title:B}),jsxRuntime.jsx(O.Primary,{disabled:k||c,onClick:x(w),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function ht({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function yo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var De={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ne({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:i,placeholder:s}=t,{error:l}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),De),{"aria-invalid":!!l,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(yo,{id:n,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(ht,{error:l})]})}var Nn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Vn=lo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Ce__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.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:jsxRuntime.jsx(y,{as:Ce__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Nn,{})})})})]}));function xo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsxRuntime.jsx(Vn,{value:s,label:i},s));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsx(Ce__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Kn=lo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(N__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(N__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function bo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:l})=>jsxRuntime.jsx(Kn,{value:l,label:s},l));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsxs(N__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(N__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,d(a({},De),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(N__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(N__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(N__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,d(a({},De),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(N__namespace.Viewport,{children:i})}))})]})}))}function ho(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Bt(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var Un={radio:xo,select:bo,text:ho,textarea:Bt};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let s=Object.assign({},Un,e);return jsxRuntime.jsx(U,d(a({flowId:o,part:["form",t]},r),{children:l=>jsxRuntime.jsx(bt,a({fieldTypes:s},l))}))}var Xe={};ee(Xe,{NPS:()=>Je});function Et({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?O.Primary:O.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxRuntime.jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Je(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsxRuntime.jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Et},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:d(a({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},n))}function fe(e,{onComplete:o,onDismiss:t}={}){let r=lo.useRef(null);return lo.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&W(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:lo.useCallback(n=>W(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function qe(){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]=lo.useState(e),[r,n]=lo.useState(null),i=lo.useCallback(s=>{n(s);},[]);return lo.useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var Zn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function It(r){var n=r,{style:e={},part:o=""}=n,t=f(n,["style","part"]);return jsxRuntime.jsxs(y,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Zn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ye(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ti(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Qe(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let i=ti(o);return i?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,a({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 le(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Qe:Ye,a({src:e},t))}function Wt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var Ze={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Mt(e,o){var i,s,l,c,m;let t=Object.fromEntries(Ze.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(Ze.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!Ze.content.includes(g)&&!Ze.root.includes(g)&&(n[g]=e[g]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},P=(k,T)=>["top","bottom"].includes(T)?k=="after"?"marginLeft":"marginRight":k=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,u=(c=t.style)!=null?c:{},w=(m=t.side)!=null?m:"bottom",S=t.align;t.style=d(a({},u),{[P(S,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var At=react.keyframes`
76
+ `,Pn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Cn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(Pn,{})})})}function mo({children:e}){return jsxRuntime.jsx(he__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${bn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${hn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsxRuntime.jsx(y,{}),e]})})}function fo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(he__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(h,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function go({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(he__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.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:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Cn,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var yt=lo.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function xt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var w,S,B,E,T,k;let{$state:{blocked:i,completed:s,skipped:l},subtitle:c,title:m}=n,g=(S=(w=n.primaryButton)==null?void 0:w.title)!=null?S:n.primaryButtonTitle,P=(E=(B=n.secondaryButton)==null?void 0:B.title)!=null?E:n.secondaryButtonTitle,x=(T=n.props)!=null?T:{},u=!!i;return jsxRuntime.jsxs(fo,d(a({open:t,onOpenChange:r},x),{children:[jsxRuntime.jsx(go,{isBlocked:n.$state.blocked,isCompleted:s||l,title:m}),jsxRuntime.jsxs(mo,{children:[jsxRuntime.jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(k=n.videoUri)!=null?k:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(h.Subtitle,{color:"neutral.400",children:c}),jsxRuntime.jsxs(C.Row,{gap:3,part:"collapsible-footer",children:[jsxRuntime.jsx(h.Secondary,{title:P,onClick:o}),jsxRuntime.jsx(h.Primary,{disabled:u,title:g,onClick:e})]})]})]}))}var Tn={default:xt};function vn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:m}=lo.useContext(yt),{handlePrimary:g,handleSecondary:P}=re(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,u=(S=m[o.type])!=null?S:xt;function w(B){return W(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(u,d(a({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:g,handleSecondary:P}),o.id)}function Ue(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,g]=lo.useState(null),P=a(a({},Tn),i);return jsxRuntime.jsx(yt.Provider,{value:{openStepId:m,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:P},children:jsxRuntime.jsx(j,d(a({as:h,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:u}=B,w=f(B,["flow","handleDismiss"]);let T=Array.from(x.steps.entries()).filter(([,b])=>b.$state.visible===!0).map(([,b])=>jsxRuntime.jsx(vn,d(a({flow:x,handleDismiss:u},w),{step:b}),b.id)),k=x.getNumberOfCompletedSteps(),H=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(h.Header,{dismissible:e,handleDismiss:u,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[k,"/",H]}),jsxRuntime.jsx(xe,{current:k,total:H,flexGrow:1})]})]}),T]})}}))})}var Hn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Wn({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([l])=>Hn.has(l))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function ht({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var T,k,H,b,R,D;let{__readOnly:s}=lo.useContext(I),l=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,m]=lo.useState(!1),g=[],{control:P,handleSubmit:x}=l,u=(T=i.props)!=null?T:{};function w(V,Se){m(!0),t(Se,V,s===!0).then(()=>m(!1));}(k=i.fields)==null||k.forEach(V=>{e[V.type]!=null&&g.push(jsxRuntime.jsx(Wn,{control:P,fieldComponent:e[V.type],fieldData:V,submit:x(w)},`${i.flow.id}-${V.id}`));});let S=(b=(H=i.primaryButton)==null?void 0:H.title)!=null?b:i.primaryButtonTitle,B=(D=(R=i.secondaryButton)==null?void 0:R.title)!=null?D:i.secondaryButtonTitle,E=!!(i.$state.blocked||!l.formState.isValid);return jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"form-step"},u),{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},l),{children:g})),jsxRuntime.jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(O.Secondary,{onClick:r,title:B}),jsxRuntime.jsx(O.Primary,{disabled:E||c,onClick:x(w),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function Pt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function yo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var De={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ne({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:i,placeholder:s}=t,{error:l}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),De),{"aria-invalid":!!l,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(yo,{id:n,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(Pt,{error:l})]})}var Nn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Vn=lo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Ce__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.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:jsxRuntime.jsx(y,{as:Ce__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Nn,{})})})})]}));function xo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsxRuntime.jsx(Vn,{value:s,label:i},s));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsx(Ce__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Kn=lo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(L__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(L__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function bo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:l})=>jsxRuntime.jsx(Kn,{value:l,label:s},l));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsxs(L__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(L__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,d(a({},De),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(L__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(L__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(L__namespace.Portal,{children:jsxRuntime.jsx(L__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,d(a({},De),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(L__namespace.Viewport,{children:i})}))})})]})}))}function ho(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Po(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var Un={radio:xo,select:bo,text:ho,textarea:Po};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let s=Object.assign({},Un,e);return jsxRuntime.jsx(j,d(a({flowId:o,part:["form",t]},r),{children:l=>jsxRuntime.jsx(ht,a({fieldTypes:s},l))}))}var Xe={};ee(Xe,{NPS:()=>Je});function Et({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?O.Primary:O.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxRuntime.jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Je(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsxRuntime.jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Et},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:d(a({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},n))}function fe(e,{onComplete:o,onDismiss:t}={}){let r=lo.useRef(null);return lo.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&W(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:lo.useCallback(n=>W(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function qe(){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]=lo.useState(e),[r,n]=lo.useState(null),i=lo.useCallback(s=>{n(s);},[]);return lo.useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var Zn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function It(r){var n=r,{style:e={},part:o=""}=n,t=f(n,["style","part"]);return jsxRuntime.jsxs(y,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Zn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ye(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ti(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Qe(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let i=ti(o);return i?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,a({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 le(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Qe:Ye,a({src:e},t))}function Wt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var Ze={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Mt(e,o){var i,s,l,c,m;let t=Object.fromEntries(Ze.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(Ze.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!Ze.content.includes(g)&&!Ze.root.includes(g)&&(n[g]=e[g]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},P=(E,T)=>["top","bottom"].includes(T)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,u=(c=t.style)!=null?c:{},w=(m=t.side)!=null?m:"bottom",S=t.align;t.style=d(a({},u),{[P(S,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var At=react.keyframes`
77
77
  from {
78
78
  opacity: 0;
79
79
  }
@@ -83,7 +83,7 @@ var Do=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnProp
83
83
  to {
84
84
  opacity: 1;
85
85
  }
86
- `;function Lt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,i=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:g}=qe(),{node:P,rect:x,ref:u}=qe(),ko=Mt(i,m),{contentProps:w,otherProps:Ae}=ko,we=Ae,{part:S}=we,B=f(we,["part"]),{rootProps:k}=ko,[T,E]=lo.useState(w.align),[H,b]=lo.useState(w.side),[R,D]=lo.useState(0),[V,Se]=lo.useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");T!==_&&E(_),H!==Q&&b(Q);}let se=lo.useRef(null);if(lo.useEffect(()=>{let _=document.querySelector(e);_!=null?(u(_),se.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),lo.useEffect(()=>{function _(ye){if(ye.matches(e))return Lt(ye)?ye:null;let pe=ye.querySelectorAll(e);return pe.length>0&&Lt(pe[0])?pe[0]:null}let Q=new MutationObserver(ye=>{for(let pe of ye)if(pe.type==="childList"){for(let Te of pe.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(de),se.current=de,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",de);break}}for(let Te of pe.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",de);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),lo.useEffect(()=>{let{scrollX:_,scrollY:Q}=window;D(x.left+_),Se(x.top+Q);},[x.left,x.top]),P==null)return null;let Me="0";typeof window!="undefined"&&(Me=window.getComputedStyle(P).borderRadius);let Fe=Wt({props:i,alignAttr:T,sideAttr:H});return jsxRuntime.jsxs(Z__namespace.Root,d(a({defaultOpen:!0},k),{children:[jsxRuntime.jsx(Z__namespace.Anchor,{virtualRef:se}),jsxRuntime.jsx(Z__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(y,a({animation:`${At} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Me,height:x.height,left:R,top:V,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Z__namespace.Content,d(a({asChild:!0},w),{ref:g,children:jsxRuntime.jsxs(h,d(a({animation:`${At} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:n},B),{children:[jsxRuntime.jsx(It,{style:Fe}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(Z__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsxRuntime.jsx(le,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({part:"title"},o),{children:e}))};function $t(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=m,l=f(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var k,T,E,H,b,R;let{handleDismiss:g}=fe(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),u=(k=s.props)!=null?k:{},w=(E=(T=s.primaryButton)==null?void 0:T.title)!=null?E:s.primaryButtonTitle,S=(b=(H=s.secondaryButton)==null?void 0:H.title)!=null?b:s.secondaryButtonTitle,B=s.$state.blocked;return jsxRuntime.jsxs($,d(a(a({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:D=>D.preventDefault(),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault()},l),u),{onEscapeKeyDown:D=>{typeof r=="function"&&r(D),D.defaultPrevented||g(D);},children:[e&&jsxRuntime.jsx($.Close,{onClick:g}),jsxRuntime.jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:s.title}),jsxRuntime.jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsxRuntime.jsx($.Primary,{disabled:B,onClick:P,title:w})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=lo.useContext(I),[i,s]=lo.useState(!1);lo.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),lo.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function l(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:i||!o,removeModal:l}}function Fo(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=lo.useState(!1),{flow:m}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:P,unregisterComponent:x}=lo.useContext(I);fe(m,{onComplete:o});let{isCurrentModal:u,removeModal:w}=Ie(m);if(lo.useEffect(()=>{!(m!=null&&m.isVisible)&&u&&w();},[m==null?void 0:m.isVisible,u]),lo.useEffect(()=>()=>{x(e);},[]),m==null||m.isVisible===!1||!u||(P(e,()=>{l||c(!0);}),!g||!l))return null;let S=m.getCurrentStep();return S==null||S.start(),jsxRuntime.jsx($t,a({"data-flow-id":m.id,flow:m,part:["tour",r],step:S},n))}function zt(e){let[o,t]=lo.useState(),[r,n]=lo.useState(),{flow:i}=ie(r),{frigade:s}=lo.useContext(I);return lo.useEffect(()=>{W(this,null,function*(){var m;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(m=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:m.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,i==null?void 0:i.isVisible]),{collection:o,currentFlow:i}}function wo(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,m;let i={ANNOUNCEMENT:To,BANNER:po,CARD:h,CHECKLIST:Ue,EMBEDDED_TIP:h,FORM:Oe,NPS_SURVEY:Je,TOUR:Fo},{currentFlow:s}=zt(e),l=(m=i[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?m:null;return s==null||l==null?null:jsxRuntime.jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(l,{flowId:s.id},s.id)}))}function He(){let{frigade:e}=lo.useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Ut(){let[e,o]=lo.useState(),{frigade:t}=He();return lo.useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(wo,{as:null,collectionId:e})}var I=lo.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function jt(){let{frigade:e}=He();return lo.useEffect(()=>{W(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function Yt(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?ro(n):{},[m,g]=lo.useState(new Set),P=lo.useRef(new Map),x=lo.useRef(),[u,w]=lo.useState(!1),S=lo.useMemo(()=>(w(!1),x.current=void 0,g(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);lo.useEffect(()=>{if(i.__flowStateOverrides){let b=S.getConfig();b.__flowStateOverrides=i.__flowStateOverrides,S.reload(b);}},[i.__flowStateOverrides]);function B(){let b=[...P.current.entries()].map(([R,D])=>[R,D.callback]);S.batchRegister(b),w(!0);}function k(b,R){if(x.current&&clearTimeout(x.current),u){P.current.has(b)?S.getFlow(b).then(D=>R(D.isVisible)):(S.getFlow(b).then(D=>D.register(R)),P.current.set(b,{callback:R}));return}P.current.has(b)||P.current.set(b,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function T(b){P.current.has(b)&&S.getFlow(b).then(R=>{P.current.delete(b),R==null||R.unregister();});}let E=r!=null?r:(b,R="_self")=>{window.open(b,R);};lo.useEffect(()=>()=>{S.destroy();},[]);let H=m.size>0?m.values().next().value:null;return jsxRuntime.jsxs(I.Provider,{value:d(a({modals:m,setModals:g,currentModal:H,navigate:E},i),{frigade:S,registerComponent:k,unregisterComponent:T,hasInitialized:u}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},no),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:v,children:[t&&jsxRuntime.jsx(Ut,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(jt,{})]})}function ie(e,o){let[t,r]=lo.useState(),[,n]=lo.useState(""),{frigade:i}=lo.useContext(I),s=lo.useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,i]);return lo.useEffect(()=>{if(!(!(i!=null&&i.isReady())||e==null))return W(this,null,function*(){let l=yield i.getFlow(e);if(!l||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[e,i,s]),lo.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function U(m){var g=m,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var we,Q;let[P,x]=lo.useState(!1),{flow:u}=ie(t,{variables:l}),_=a(a({},(we=u==null?void 0:u.props)!=null?we:{}),c),{dismissible:w=!1,forceMount:S=!1,modal:B=!1}=_,k=f(_,["dismissible","forceMount","modal"]),{hasInitialized:T,registerComponent:E,unregisterComponent:H}=lo.useContext(I),b=u==null?void 0:u.getCurrentStep(),{handleDismiss:R}=fe(u,{onComplete:r,onDismiss:n}),{handlePrimary:D,handleSecondary:V}=re(b,{onPrimary:i,onSecondary:s}),Se=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((Q=u==null?void 0:u.rawData)==null?void 0:Q.flowType),{isCurrentModal:se,removeModal:Me}=Ie(u,Se);lo.useEffect(()=>{!(u!=null&&u.isVisible)&&se&&Me();},[u==null?void 0:u.isVisible,se]),lo.useEffect(()=>()=>{H(t);},[]),lo.useEffect(()=>{(u!=null&&u.isCompleted||u!=null&&u.isSkipped)&&H(t);},[u==null?void 0:u.isCompleted,u==null?void 0:u.isSkipped]);let Fe=S&&((u==null?void 0:u.isCompleted)||(u==null?void 0:u.isSkipped));if(!u||!Fe&&!se||(E(t,()=>{P||x(!0);}),!u.isVisible&&!Fe)||!T||!P)return null;(Fe||!u.isCompleted&&!u.isSkipped)&&b.start();let ko=e===null?lo.Fragment:e!=null?e:y,Ae=d(a({},k),{"data-flow-id":u.id});return jsxRuntime.jsx(ko,d(a({},e===null?{}:Ae),{children:o({flow:u,handleDismiss:R,handlePrimary:D,handleSecondary:V,parentProps:{dismissible:w,flowId:t,variables:l,containerProps:Ae},step:b})}))}function tr(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsxRuntime.jsx(U,d(a({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:c})=>{var P,x,u,w;let m=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,g=(w=(u=c.secondaryButton)==null?void 0:u.title)!=null?w:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(h.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(h.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(h.Secondary,{title:g,onClick:s}),jsxRuntime.jsx(h.Primary,{title:m,onClick:i})]})]})}}))}var h=lo__namespace.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=f(i,["children","flowId"]);var l;if(o!=null)return jsxRuntime.jsx(tr,a({flowId:o},t));let s=(l=t.as)!=null?l:C.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});h.Dismiss=e=>jsxRuntime.jsx(O.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));h.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsxRuntime.jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(le,a({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Primary,a({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Secondary,a({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({display:"block",part:"title"},o),{children:e}))};var oo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function nr(e){let o=Object.fromEntries(oo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(oo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!oo.content.some(i=>i===n)&&!oo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Mi=react.keyframes`
86
+ `;function Lt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function N(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,i=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:g}=qe(),{node:P,rect:x,ref:u}=qe(),Eo=Mt(i,m),{contentProps:w,otherProps:Ae}=Eo,we=Ae,{part:S}=we,B=f(we,["part"]),{rootProps:E}=Eo,[T,k]=lo.useState(w.align),[H,b]=lo.useState(w.side),[R,D]=lo.useState(0),[V,Se]=lo.useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");T!==_&&k(_),H!==Q&&b(Q);}let se=lo.useRef(null);if(lo.useEffect(()=>{let _=document.querySelector(e);_!=null?(u(_),se.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),lo.useEffect(()=>{function _(ye){if(ye.matches(e))return Lt(ye)?ye:null;let pe=ye.querySelectorAll(e);return pe.length>0&&Lt(pe[0])?pe[0]:null}let Q=new MutationObserver(ye=>{for(let pe of ye)if(pe.type==="childList"){for(let Te of pe.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(de),se.current=de,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",de);break}}for(let Te of pe.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",de);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),lo.useEffect(()=>{let{scrollX:_,scrollY:Q}=window;D(x.left+_),Se(x.top+Q);},[x.left,x.top]),P==null)return null;let Me="0";typeof window!="undefined"&&(Me=window.getComputedStyle(P).borderRadius);let Fe=Wt({props:i,alignAttr:T,sideAttr:H});return jsxRuntime.jsxs(Z__namespace.Root,d(a({defaultOpen:!0},E),{children:[jsxRuntime.jsx(Z__namespace.Anchor,{virtualRef:se}),jsxRuntime.jsx(Z__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(y,a({animation:`${At} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Me,height:x.height,left:R,top:V,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Z__namespace.Content,d(a({asChild:!0},w),{ref:g,children:jsxRuntime.jsxs(h,d(a({animation:`${At} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:n},B),{children:[jsxRuntime.jsx(It,{style:Fe}),o]}))}))]})})]}))}N.Close=e=>jsxRuntime.jsx(Z__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});N.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsxRuntime.jsx(le,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};N.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,a({title:o,onClick:e},t))};N.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"progress"},o),{children:e}))};N.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,a({title:o,onClick:e},t))};N.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))};N.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({part:"title"},o),{children:e}))};function $t(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=m,l=f(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,T,k,H,b,R;let{handleDismiss:g}=fe(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),u=(E=s.props)!=null?E:{},w=(k=(T=s.primaryButton)==null?void 0:T.title)!=null?k:s.primaryButtonTitle,S=(b=(H=s.secondaryButton)==null?void 0:H.title)!=null?b:s.secondaryButtonTitle,B=s.$state.blocked;return jsxRuntime.jsxs(N,d(a(a({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:D=>D.preventDefault(),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault()},l),u),{onEscapeKeyDown:D=>{typeof r=="function"&&r(D),D.defaultPrevented||g(D);},children:[e&&jsxRuntime.jsx(N.Close,{onClick:g}),jsxRuntime.jsx(N.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(N.Title,{children:s.title}),jsxRuntime.jsx(N.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(N.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(N.Secondary,{disabled:B,onClick:x,title:S}),jsxRuntime.jsx(N.Primary,{disabled:B,onClick:P,title:w})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=lo.useContext(I),[i,s]=lo.useState(!1);lo.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),lo.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function l(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:i||!o,removeModal:l}}function wo(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=lo.useState(!1),{flow:m}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:P,unregisterComponent:x}=lo.useContext(I);fe(m,{onComplete:o});let{isCurrentModal:u,removeModal:w}=Ie(m);if(lo.useEffect(()=>{!(m!=null&&m.isVisible)&&u&&w();},[m==null?void 0:m.isVisible,u]),lo.useEffect(()=>()=>{x(e);},[]),m==null||m.isVisible===!1||!u||(P(e,()=>{l||c(!0);}),!g||!l))return null;let S=m.getCurrentStep();return S==null||S.start(),jsxRuntime.jsx($t,a({"data-flow-id":m.id,flow:m,part:["tour",r],step:S},n))}function zt(e){let[o,t]=lo.useState(),[r,n]=lo.useState(),{flow:i}=ie(r),{frigade:s}=lo.useContext(I);return lo.useEffect(()=>{W(this,null,function*(){var m;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(m=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:m.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,i==null?void 0:i.isVisible]),{collection:o,currentFlow:i}}function To(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,m;let i={ANNOUNCEMENT:vo,BANNER:po,CARD:h,CHECKLIST:Ue,EMBEDDED_TIP:h,FORM:Oe,NPS_SURVEY:Je,TOUR:wo},{currentFlow:s}=zt(e),l=(m=i[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?m:null;return s==null||l==null?null:jsxRuntime.jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(l,{flowId:s.id},s.id)}))}function He(){let{frigade:e}=lo.useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Ut(){let[e,o]=lo.useState(),{frigade:t}=He();return lo.useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(To,{as:null,collectionId:e})}var I=lo.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function jt(){let{frigade:e}=He();return lo.useEffect(()=>{W(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function Yt(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?ro(n):{},[m,g]=lo.useState(new Set),P=lo.useRef(new Map),x=lo.useRef(),[u,w]=lo.useState(!1),S=lo.useMemo(()=>(w(!1),x.current=void 0,g(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);lo.useEffect(()=>{if(i.__flowStateOverrides){let b=S.getConfig();b.__flowStateOverrides=i.__flowStateOverrides,S.reload(b);}},[i.__flowStateOverrides]);function B(){let b=[...P.current.entries()].map(([R,D])=>[R,D.callback]);S.batchRegister(b),w(!0);}function E(b,R){if(x.current&&clearTimeout(x.current),u){P.current.has(b)?S.getFlow(b).then(D=>R(D.isVisible)):(S.getFlow(b).then(D=>D.register(R)),P.current.set(b,{callback:R}));return}P.current.has(b)||P.current.set(b,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function T(b){P.current.has(b)&&S.getFlow(b).then(R=>{P.current.delete(b),R==null||R.unregister();});}let k=r!=null?r:(b,R="_self")=>{window.open(b,R);};lo.useEffect(()=>()=>{S.destroy();},[]);let H=m.size>0?m.values().next().value:null;return jsxRuntime.jsxs(I.Provider,{value:d(a({modals:m,setModals:g,currentModal:H,navigate:k},i),{frigade:S,registerComponent:E,unregisterComponent:T,hasInitialized:u}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},no),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:v,children:[t&&jsxRuntime.jsx(Ut,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(jt,{})]})}function ie(e,o){let[t,r]=lo.useState(),[,n]=lo.useState(""),{frigade:i}=lo.useContext(I),s=lo.useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,i]);return lo.useEffect(()=>{if(!(!(i!=null&&i.isReady())||e==null))return W(this,null,function*(){let l=yield i.getFlow(e);if(!l||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[e,i,s]),lo.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function j(m){var g=m,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var we,Q;let[P,x]=lo.useState(!1),{flow:u}=ie(t,{variables:l}),_=a(a({},(we=u==null?void 0:u.props)!=null?we:{}),c),{dismissible:w=!1,forceMount:S=!1,modal:B=!1}=_,E=f(_,["dismissible","forceMount","modal"]),{hasInitialized:T,registerComponent:k,unregisterComponent:H}=lo.useContext(I),b=u==null?void 0:u.getCurrentStep(),{handleDismiss:R}=fe(u,{onComplete:r,onDismiss:n}),{handlePrimary:D,handleSecondary:V}=re(b,{onPrimary:i,onSecondary:s}),Se=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((Q=u==null?void 0:u.rawData)==null?void 0:Q.flowType),{isCurrentModal:se,removeModal:Me}=Ie(u,Se);lo.useEffect(()=>{!(u!=null&&u.isVisible)&&se&&Me();},[u==null?void 0:u.isVisible,se]),lo.useEffect(()=>()=>{H(t);},[]),lo.useEffect(()=>{(u!=null&&u.isCompleted||u!=null&&u.isSkipped)&&H(t);},[u==null?void 0:u.isCompleted,u==null?void 0:u.isSkipped]);let Fe=S&&((u==null?void 0:u.isCompleted)||(u==null?void 0:u.isSkipped));if(!u||!Fe&&!se||(k(t,()=>{P||x(!0);}),!u.isVisible&&!Fe)||!T||!P)return null;(Fe||!u.isCompleted&&!u.isSkipped)&&b.start();let Eo=e===null?lo.Fragment:e!=null?e:y,Ae=d(a({},E),{"data-flow-id":u.id});return jsxRuntime.jsx(Eo,d(a({},e===null?{}:Ae),{children:o({flow:u,handleDismiss:R,handlePrimary:D,handleSecondary:V,parentProps:{dismissible:w,flowId:t,variables:l,containerProps:Ae},step:b})}))}function tr(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsxRuntime.jsx(j,d(a({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:c})=>{var P,x,u,w;let m=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,g=(w=(u=c.secondaryButton)==null?void 0:u.title)!=null?w:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(h.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(h.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(h.Secondary,{title:g,onClick:s}),jsxRuntime.jsx(h.Primary,{title:m,onClick:i})]})]})}}))}var h=lo__namespace.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=f(i,["children","flowId"]);var l;if(o!=null)return jsxRuntime.jsx(tr,a({flowId:o},t));let s=(l=t.as)!=null?l:C.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});h.Dismiss=e=>jsxRuntime.jsx(O.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));h.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsxRuntime.jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(le,a({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Primary,a({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Secondary,a({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({display:"block",part:"title"},o),{children:e}))};var oo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function nr(e){let o=Object.fromEntries(oo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(oo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!oo.content.some(i=>i===n)&&!oo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Mi=react.keyframes`
87
87
  from {
88
88
  opacity: 0;
89
89
  }
@@ -93,20 +93,20 @@ var Do=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnProp
93
93
  to {
94
94
  opacity: 1;
95
95
  }
96
- `;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:g}=nr(r),P=g,{zIndex:c}=P,m=f(P,["zIndex"]);return jsxRuntime.jsx(K__namespace.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(K__namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${Mi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(K__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(K__namespace.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},l),{children:jsxRuntime.jsx(h,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}M.Dismiss=e=>jsxRuntime.jsx(K__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,d(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(K__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsxRuntime.jsx(le,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,a({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?v.colors.blue500:v.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(K__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(F.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var ir=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function To(r){var n=r,{flowId:e,part:o}=n,t=f(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([l])=>ir.some(c=>l===c))),s=Object.fromEntries(Object.entries(t).filter(([l])=>ir.indexOf(l)===-1));return jsxRuntime.jsx(U,d(a({as:null,flowId:e},i),{children:({flow:l,handleDismiss:c,handlePrimary:m,handleSecondary:g,parentProps:{containerProps:P,dismissible:x},step:u})=>{var T,E,H,b,R,D;let w=(T=u.props)!=null?T:{},S=(H=(E=u.primaryButton)==null?void 0:E.title)!=null?H:u.primaryButtonTitle,B=(R=(b=u.secondaryButton)==null?void 0:b.title)!=null?R:u.secondaryButtonTitle,k=u.$state.blocked;return jsxRuntime.jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},P),s),{onEscapeKeyDown:V=>{if(t.dismissible===!1){V.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(V),V.defaultPrevented||c(V);},children:jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"announcement-step"},w),{children:[x&&jsxRuntime.jsx(M.Dismiss,{onClick:c}),jsxRuntime.jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(M.Title,{children:u.title}),jsxRuntime.jsx(M.Subtitle,{children:u.subtitle})]}),jsxRuntime.jsx(M.Media,{src:(D=u.videoUri)!=null?D:u.imageUri,type:u.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(M.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx(M.Secondary,{disabled:k,onClick:g,title:B}),S&&jsxRuntime.jsx(M.Primary,{disabled:k,onClick:m,title:S})]})]}))}))}}))}function $i(){let{userId:e,frigade:o}=lo.useContext(I);function t(n){return W(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return W(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function Vi(){var n;let{frigade:e}=lo.useContext(I);function o(i){return W(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,i);})}function t(i,s){return W(this,null,function*(){yield e.track(i,s);})}function r(i,s){return W(this,null,function*(){yield e.group(i,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
96
+ `;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:g}=nr(r),P=g,{zIndex:c}=P,m=f(P,["zIndex"]);return jsxRuntime.jsx(U__namespace.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(U__namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${Mi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(U__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(U__namespace.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},l),{children:jsxRuntime.jsx(h,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}M.Dismiss=e=>jsxRuntime.jsx(U__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,d(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(U__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsxRuntime.jsx(le,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,a({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?v.colors.blue500:v.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(U__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(F.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var ir=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function vo(r){var n=r,{flowId:e,part:o}=n,t=f(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([l])=>ir.some(c=>l===c))),s=Object.fromEntries(Object.entries(t).filter(([l])=>ir.indexOf(l)===-1));return jsxRuntime.jsx(j,d(a({as:null,flowId:e},i),{children:({flow:l,handleDismiss:c,handlePrimary:m,handleSecondary:g,parentProps:{containerProps:P,dismissible:x},step:u})=>{var T,k,H,b,R,D;let w=(T=u.props)!=null?T:{},S=(H=(k=u.primaryButton)==null?void 0:k.title)!=null?H:u.primaryButtonTitle,B=(R=(b=u.secondaryButton)==null?void 0:b.title)!=null?R:u.secondaryButtonTitle,E=u.$state.blocked;return jsxRuntime.jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},P),s),{onEscapeKeyDown:V=>{if(t.dismissible===!1){V.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(V),V.defaultPrevented||c(V);},children:jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"announcement-step"},w),{children:[x&&jsxRuntime.jsx(M.Dismiss,{onClick:c}),jsxRuntime.jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(M.Title,{children:u.title}),jsxRuntime.jsx(M.Subtitle,{children:u.subtitle})]}),jsxRuntime.jsx(M.Media,{src:(D=u.videoUri)!=null?D:u.imageUri,type:u.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(M.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx(M.Secondary,{disabled:E,onClick:g,title:B}),S&&jsxRuntime.jsx(M.Primary,{disabled:E,onClick:m,title:S})]})]}))}))}}))}function $i(){let{userId:e,frigade:o}=lo.useContext(I);function t(n){return W(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return W(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function Vi(){var n;let{frigade:e}=lo.useContext(I);function o(i){return W(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,i);})}function t(i,s){return W(this,null,function*(){yield e.track(i,s);})}function r(i,s){return W(this,null,function*(){yield e.group(i,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
97
97
 
98
98
  exports.FrigadeJS = js__namespace;
99
- exports.Announcement = To;
99
+ exports.Announcement = vo;
100
100
  exports.Banner = po;
101
101
  exports.BaseField = ne;
102
102
  exports.Box = y;
103
103
  exports.Button = O;
104
104
  exports.Card = h;
105
105
  exports.Checklist = je;
106
- exports.Collection = wo;
106
+ exports.Collection = To;
107
107
  exports.Dialog = M;
108
108
  exports.Flex = C;
109
- exports.Flow = U;
109
+ exports.Flow = j;
110
110
  exports.Form = Oe;
111
111
  exports.Image = Ye;
112
112
  exports.Label = yo;
@@ -118,8 +118,9 @@ exports.SelectField = bo;
118
118
  exports.Survey = Xe;
119
119
  exports.Text = F;
120
120
  exports.TextField = ho;
121
- exports.Tooltip = $;
122
- exports.Tour = Fo;
121
+ exports.TextareaField = Po;
122
+ exports.Tooltip = N;
123
+ exports.Tour = wo;
123
124
  exports.Video = Qe;
124
125
  exports.themeVariables = no;
125
126
  exports.tokens = Ne;