@frigade/react 2.1.1 → 2.1.3

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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var $ = require('@radix-ui/react-dialog');
3
+ var L = require('@radix-ui/react-dialog');
4
4
  var solid = require('@heroicons/react/24/solid');
5
5
  var ze = require('react');
6
6
  var clsx = require('clsx');
@@ -13,7 +13,7 @@ var outline = require('@heroicons/react/24/outline');
13
13
  var ce = require('@radix-ui/react-collapsible');
14
14
  var reactHookForm = require('react-hook-form');
15
15
  var ue = require('@radix-ui/react-radio-group');
16
- var A = require('@radix-ui/react-select');
16
+ var W = require('@radix-ui/react-select');
17
17
  var J = require('@radix-ui/react-popover');
18
18
 
19
19
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -36,16 +36,16 @@ function _interopNamespace(e) {
36
36
  return Object.freeze(n);
37
37
  }
38
38
 
39
- var $__namespace = /*#__PURE__*/_interopNamespace($);
39
+ var L__namespace = /*#__PURE__*/_interopNamespace(L);
40
40
  var ze__namespace = /*#__PURE__*/_interopNamespace(ze);
41
41
  var Ot__default = /*#__PURE__*/_interopDefault(Ot);
42
42
  var Nt__default = /*#__PURE__*/_interopDefault(Nt);
43
43
  var ce__namespace = /*#__PURE__*/_interopNamespace(ce);
44
44
  var ue__namespace = /*#__PURE__*/_interopNamespace(ue);
45
- var A__namespace = /*#__PURE__*/_interopNamespace(A);
45
+ var W__namespace = /*#__PURE__*/_interopNamespace(W);
46
46
  var J__namespace = /*#__PURE__*/_interopNamespace(J);
47
47
 
48
- var ao=Object.defineProperty,wt=Object.defineProperties;var vt=Object.getOwnPropertyDescriptors;var Fe=Object.getOwnPropertySymbols;var so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable;var io=(e,o,t)=>o in e?ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))so.call(o,t)&&io(e,t,o[t]);if(Fe)for(var t of Fe(o))lo.call(o,t)&&io(e,t,o[t]);return e},d=(e,o)=>wt(e,vt(o));var Bt=(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 u=(e,o)=>{var t={};for(var r in e)so.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Fe)for(var r of Fe(e))o.indexOf(r)<0&&lo.call(e,r)&&(t[r]=e[r]);return t};var q=(e,o)=>{for(var t in o)ao(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{p(t.next(c));}catch(m){n(m);}},s=c=>{try{p(t.throw(c));}catch(m){n(m);}},p=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);p((t=t.apply(e,o)).next());});var po={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Te=[5,10,20,35,50,65,80,95,98],co=[...Te],Ae=[...Te];co[4]=40;Ae[4]=60;var Rt={blue:{h:213,s:100,l:Te},gray:{h:220,s:10,l:Te},green:{h:141,s:90,l:co},red:{h:9,s:90,l:Ae},yellow:{h:50,s:90,l:Ae}};var D={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Rt))D[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t} ${n})`]));var uo=d(i({black:"hsl(0 0 0)",white:"hsl(0 0 100%)"},D),{gray100:D.gray[100],gray200:D.gray[200],gray300:D.gray[300],gray400:D.gray[400],gray500:D.gray[500],gray600:D.gray[600],gray700:D.gray[700],gray800:D.gray[800],gray900:D.gray[900],blue400:D.blue[400],blue500:D.blue[500],blue800:D.blue[800],blue900:D.blue[900],green400:D.blue[400],green500:D.green[500],green800:D.green[800],red500:D.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var mo={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,fo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var go={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var kt="px",Dt=e=>typeof e=="number"?`${4*e}${kt}`:e,Et=[-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"],yo=Object.fromEntries(Et.map(e=>[e,Dt(e)]));var xo={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var we=d(i(d(i({},po),{colors:i(i({},uo),fo)}),xo),{radii:mo,shadows:go,space:yo});function ye(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,ye(p,s,t)):r[s]=p,r},{})}function Le(e){return ye(e,"--fr","-")}function bo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=bo(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var $e=Le(we),S=bo(we);var It=new Set(["alt","size","src"]),Ht=Ot__default.default.all.filter(e=>e.indexOf("-")!=0&&!It.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Mt=Object.fromEntries(Ht),Ve=ye(S.colors),Wt={color:Ve,backgroundColor:Ve,borderColor:Ve,border:S.borders,borderRadius:S.radii,borderWidth:S.borderWidths,boxShadow:S.shadows,fontFamily:S.fontFamilies,fontSize:S.fontSizes,fontWeight:S.fontWeights,gap:S.space,lineHeight:S.lineHeights,margin:S.space,marginBottom:S.space,marginLeft:S.space,marginRight:S.space,marginTop:S.space,padding:S.space,paddingBottom:S.space,paddingLeft:S.space,paddingRight:S.space,paddingTop:S.space},ho=i(i({},Mt),Wt),Po={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"]},Co=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function At(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 So=new Map(Object.entries(ho).map(([e,o])=>[e,At(o)])),Lt=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),$t=new Set(["height","width"]),Vt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Fo(e){let[o,t]=e.split(":");return [o,Co.has(t)?t:null]}function To(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let p=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(t).forEach(([a,s])=>{let[p,c]=Fo(a),m=Lt.get(p);m!=null&&(m.forEach(y=>{let x=`${y}${c?":"+c:""}`;t[x]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[p,c]=Fo(a),m=So.get(p);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let y=s.split(" ");n(c)[p]=y.map(x=>{var b;return (b=m.get(x.toString()))!=null?b:x}).join(" ");}else m.has(s.toString())?n(c)[p]=m.get(s.toString()):n(c)[p]=s;(typeof o!="string"||!Vt.has(o)||!$t.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&So.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Kt(){if(typeof window=="undefined"){let{JSDOM:e}=Bt("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:Nt__default.default(Kt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function _t(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):_t(e))}function jt(p,s){var c=p,{as:e,children:o,className:t,css:r={},part:n}=c,a=u(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:y,unmatchedProps:x}=To(a,m),b=Ro(n),f=t||b?clsx.clsx(t,b):void 0,F=[{boxSizing:"border-box"},y,r];return typeof o=="string"?jsxRuntime.jsx(m,d(i({className:f,css:F},x),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsxRuntime.jsx(m,d(i({className:f,css:F},x),{ref:s,children:o}))}var g=ze__namespace.forwardRef(jt);var B={};q(B,{Link:()=>br,Plain:()=>hr,Primary:()=>yr,Secondary:()=>xr});var C={};q(C,{Body1:()=>lr,Body2:()=>pr,Caption:()=>dr,Display1:()=>tr,Display2:()=>rr,H1:()=>nr,H2:()=>ir,H3:()=>ar,H4:()=>sr});var Ne={};q(Ne,{Body1:()=>Qt,Body2:()=>Zt,Caption:()=>er,Display1:()=>Ut,Display2:()=>Gt,H1:()=>Xt,H2:()=>Jt,H3:()=>qt,H4:()=>Yt});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ut=d(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Gt=d(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xt=d(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Jt=d(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),qt=d(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Yt=d(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Qt=d(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Zt=d(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),er=d(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var or=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(or.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ze__namespace.forwardRef((p,s)=>{var c=p,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsxRuntime.jsx(g,d(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),tr=Q.Display1,rr=Q.Display2,nr=Q.H1,ir=Q.H2,ar=Q.H3,sr=Q.H4,lr=Q.Body1,pr=Q.Body2,dr=Q.Caption;var Ke={};q(Ke,{Link:()=>fr,Plain:()=>gr,Primary:()=>ur,Secondary:()=>mr});var ve={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},ur=d(i({},ve),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),mr=d(i({},ve),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),fr=d(i({},ve),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),gr=d(i({},ve),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function Be(s){var p=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=p,a=u(p,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(g,d(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsxRuntime.jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function yr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Be,d(i({},o),{variant:"Primary",children:e}))}function xr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Be,d(i({},o),{variant:"Secondary",children:e}))}function br(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Be,d(i({},o),{variant:"Link",children:e}))}function hr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Be,d(i({},o),{variant:"Plain",children:e}))}var P={};q(P,{Column:()=>Sr,Row:()=>Cr});var Cr=ze__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,d(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Sr=ze__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,d(i({display:"flex",flexDirection:"column"},e),{ref:o})));var L=ze.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Oo(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?Le(t):{},[p,c]=ze.useState(new Set),m=ze.useMemo(()=>new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowConfigOverrides:r.__flowConfigOverrides}),[r.userId,r.groupId,r.apiKey]),y=o!=null?o:(b,f="_self")=>{window.open(b,f);};ze.useEffect(()=>()=>{m.destroy();},[]);let x=p.size>0?p.values().next().value:null;return jsxRuntime.jsxs(L.Provider,{value:d(i({modals:p,setModals:c,currentModal:x,navigate:y},r),{frigade:m}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},$e),s)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:S,children:e})]})}function re(e,o){let[t,r]=ze.useState(),[,n]=ze.useState(""),{frigade:a}=ze.useContext(L),s=ze.useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),r(p),n(Math.random().toString()));},[o==null?void 0:o.variables]);return ze.useEffect(()=>(W(this,null,function*(){let p=yield a.getFlow(e);if(!p||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),r(p);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),ze.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function ne(e,{onComplete:o,onDismiss:t}={}){let r=ze.useRef(null);return ze.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:ze.useCallback(n=>W(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=ze.useContext(L),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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:ze.useCallback((a,s)=>W(this,null,function*(){if((yield o==null?void 0:o(e,a))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let c=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:ze.useCallback((a,s)=>W(this,null,function*(){if((yield t==null?void 0:t(e,a))===!1)return a.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 be(e,o=!0){let{currentModal:t,modals:r,setModals:n}=ze.useContext(L),[a,s]=ze.useState(!1);ze.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]),ze.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function p(){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:a||!o,removeModal:p}}function X(x){var b=x,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:p,variables:c,forceMount:m}=b,y=u(b,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let{flow:f}=re(r,{variables:c}),[F,T]=ze.useState(!1),w=f==null?void 0:f.getCurrentStep(),{handleDismiss:R}=ne(f,{onComplete:n,onDismiss:a}),{handlePrimary:O,handleSecondary:H}=ie(w,{onPrimary:s,onSecondary:p}),v=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:M,removeModal:N}=be(f,v);if(ze.useEffect(()=>{!(f!=null&&f.isVisible)&&M&&N();},[f==null?void 0:f.isVisible,M]),ze.useEffect(()=>{f==null||f.register(()=>{T(!0);});},[f]),ze.useEffect(()=>()=>{f==null||f.unregister();},[f]),f==null||!M)return null;let Me=m&&f.isCompleted;if(!f.isVisible&&!Me||!F)return null;!f.isCompleted&&!f.isSkipped&&w.start();let We=e===null?ze.Fragment:e!=null?e:g;return jsxRuntime.jsx(We,d(i({},e===null?{}:y),{children:o({flow:f,handleDismiss:R,handlePrimary:O,handleSecondary:H,parentProps:i({dismissible:t,flowId:r,variables:c},y),step:w})}))}function Lo(e){return jsxRuntime.jsx(X,d(i({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a})=>{var c,m,y,x;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,p=(x=(y=a.secondaryButton)==null?void 0:y.title)!=null?x:a.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(h.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(h.Secondary,{title:p,onClick:r}),jsxRuntime.jsx(h.Primary,{title:s,onClick:t})]})]})}}))}function je(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsxRuntime.jsx(g,i({as:"img",part:["image",e],src:o},t))}function _r(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ue(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);let a=_r(o);return a?jsxRuntime.jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Ue:je,i({src:e},t))}var h=ze__namespace.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var p;if(o!=null)return jsxRuntime.jsx(Lo,i({flowId:o},t));let s=(p=t.as)!=null?p:P.Column;return jsxRuntime.jsx(s,d(i({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(B.Plain,d(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}));h.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=u(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,d(i({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:"gray500",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ae,i({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(B.Primary,i({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(B.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(i({display:"block",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,d(i({display:"block",part:"title"},o),{children:e}))};var Re={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function No(e){let o=Object.fromEntries(Re.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Re.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Re.content.some(a=>a===n)&&!Re.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}function k(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:y}=No(r),x=y,{zIndex:c}=x,m=u(x,["zIndex"]);return jsxRuntime.jsx($__namespace.Root,d(i({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx($__namespace.Portal,{children:jsxRuntime.jsxs(g,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx($__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx($__namespace.Content,d(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},p),{children:jsxRuntime.jsx(h,d(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}k.Dismiss=e=>jsxRuntime.jsx($__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(B.Plain,d(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});k.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx($__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(C.Body2,d(i({part:"subtitle"},o),{children:e}))})};k.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(ae,i({borderRadius:"md",src:e},o))};k.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(B.Primary,i({title:o,onClick:e},t))};k.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?S.colors.blue500:S.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};k.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(B.Secondary,i({title:o,onClick:e},t))};k.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx($__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(C.H3,d(i({part:"title"},o),{children:e}))})};k.displayName="Dialog";var Ko=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function qr(t){var r=t,{flowId:e}=r,o=u(r,["flowId"]);let n=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.some(p=>s===p))),a=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.indexOf(s)===-1));return jsxRuntime.jsx(X,d(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:p,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:y},step:x})=>{var T,w,R,O,H,v;let b=(T=x.props)!=null?T:{},f=(R=(w=x.primaryButton)==null?void 0:w.title)!=null?R:x.primaryButtonTitle,F=(H=(O=x.secondaryButton)==null?void 0:O.title)!=null?H:x.secondaryButtonTitle;return jsxRuntime.jsx(k,d(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:M=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(M),M.defaultPrevented||p(M);},children:jsxRuntime.jsxs(P.Column,d(i({gap:5,part:"announcement-step"},b),{children:[y&&jsxRuntime.jsx(k.Dismiss,{onClick:p}),jsxRuntime.jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(k.Title,{children:x.title}),jsxRuntime.jsx(k.Subtitle,{children:x.subtitle})]}),jsxRuntime.jsx(k.Media,{src:(v=x.videoUri)!=null?v:x.imageUri,type:x.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(k.ProgressDots,{current:s.getNumberOfCompletedSteps(),total:s.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[F&&jsxRuntime.jsx(k.Secondary,{onClick:m,title:F}),f&&jsxRuntime.jsx(k.Primary,{onClick:c,title:f})]})]}))}))}}))}function Yr(t){var r=t,{flowId:e}=r,o=u(r,["flowId"]);return jsxRuntime.jsx(X,{as:null,flowId:e,children:({handleDismiss:n,handlePrimary:a,handleSecondary:s,step:p})=>{var x,b,f,F,T;let c=(x=p.props)!=null?x:{},m=(f=(b=p.primaryButton)==null?void 0:b.title)!=null?f:p.primaryButtonTitle,y=(T=(F=p.secondaryButton)==null?void 0:F.title)!=null?T:p.secondaryButtonTitle;return jsxRuntime.jsxs(h,d(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},o),c),{children:[p.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:p.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(h.Title,{part:"title",children:p.title}),jsxRuntime.jsx(h.Subtitle,{part:"subtitle",children:p.subtitle})]}),jsxRuntime.jsx(h.Secondary,{title:y,onClick:s}),jsxRuntime.jsx(h.Primary,{title:m,onClick:a}),o.dismissible&&jsxRuntime.jsx(h.Dismiss,{onClick:n})]}))}})}var Qe={};q(Qe,{Collapsible:()=>Qo,CollapsibleStep:()=>Pe});var Pe={};q(Pe,{Content:()=>Je,Root:()=>qe,Trigger:()=>Ye});var Zr=react.keyframes`
48
+ var ao=Object.defineProperty,wt=Object.defineProperties;var vt=Object.getOwnPropertyDescriptors;var Te=Object.getOwnPropertySymbols;var so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable;var io=(e,o,t)=>o in e?ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))so.call(o,t)&&io(e,t,o[t]);if(Te)for(var t of Te(o))lo.call(o,t)&&io(e,t,o[t]);return e},p=(e,o)=>wt(e,vt(o));var Bt=(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 u=(e,o)=>{var t={};for(var r in e)so.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Te)for(var r of Te(e))o.indexOf(r)<0&&lo.call(e,r)&&(t[r]=e[r]);return t};var q=(e,o)=>{for(var t in o)ao(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{d(t.next(c));}catch(m){n(m);}},s=c=>{try{d(t.throw(c));}catch(m){n(m);}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var po={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var we=[5,10,20,35,50,65,80,95,98],co=[...we],Ae=[...we];co[4]=40;Ae[4]=60;var Rt={blue:{h:213,s:100,l:we},gray:{h:220,s:10,l:we},green:{h:141,s:90,l:co},red:{h:9,s:90,l:Ae},yellow:{h:50,s:90,l:Ae}};var D={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Rt))D[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t} ${n})`]));var uo=p(i({black:"hsl(0 0 0)",white:"hsl(0 0 100%)"},D),{gray100:D.gray[100],gray200:D.gray[200],gray300:D.gray[300],gray400:D.gray[400],gray500:D.gray[500],gray600:D.gray[600],gray700:D.gray[700],gray800:D.gray[800],gray900:D.gray[900],blue400:D.blue[400],blue500:D.blue[500],blue800:D.blue[800],blue900:D.blue[900],green400:D.blue[400],green500:D.green[500],green800:D.green[800],red500:D.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var mo={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,fo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var go={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var kt="px",Dt=e=>typeof e=="number"?`${4*e}${kt}`:e,Et=[-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"],yo=Object.fromEntries(Et.map(e=>[e,Dt(e)]));var xo={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var ve=p(i(p(i({},po),{colors:i(i({},uo),fo)}),xo),{radii:mo,shadows:go,space:yo});function xe(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,xe(d,s,t)):r[s]=d,r},{})}function Le(e){return xe(e,"--fr","-")}function bo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=bo(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var $e=Le(ve),S=bo(ve);var It=new Set(["alt","size","src"]),Ht=Ot__default.default.all.filter(e=>e.indexOf("-")!=0&&!It.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Mt=Object.fromEntries(Ht),Ve=xe(S.colors),Wt={color:Ve,backgroundColor:Ve,borderColor:Ve,border:S.borders,borderRadius:S.radii,borderWidth:S.borderWidths,boxShadow:S.shadows,fontFamily:S.fontFamilies,fontSize:S.fontSizes,fontWeight:S.fontWeights,gap:S.space,lineHeight:S.lineHeights,margin:S.space,marginBottom:S.space,marginLeft:S.space,marginRight:S.space,marginTop:S.space,padding:S.space,paddingBottom:S.space,paddingLeft:S.space,paddingRight:S.space,paddingTop:S.space},ho=i(i({},Mt),Wt),Po={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"]},Co=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function At(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 So=new Map(Object.entries(ho).map(([e,o])=>[e,At(o)])),Lt=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),$t=new Set(["height","width"]),Vt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Fo(e){let[o,t]=e.split(":");return [o,Co.has(t)?t:null]}function To(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[d]==null&&(r[d]={}),r[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=Lt.get(d);m!=null&&(m.forEach(x=>{let y=`${x}${c?":"+c:""}`;t[y]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=So.get(d);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let x=s.split(" ");n(c)[d]=x.map(y=>{var b;return (b=m.get(y.toString()))!=null?b:y}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!Vt.has(o)||!$t.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&So.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Kt(){if(typeof window=="undefined"){let{JSDOM:e}=Bt("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:Nt__default.default(Kt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function _t(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):_t(e))}function jt(d,s){var c=d,{as:e,children:o,className:t,css:r={},part:n}=c,a=u(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:x,unmatchedProps:y}=To(a,m),b=Ro(n),f=t||b?clsx.clsx(t,b):void 0,F=[{boxSizing:"border-box"},x,r];return typeof o=="string"?jsxRuntime.jsx(m,p(i({className:f,css:F},y),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsxRuntime.jsx(m,p(i({className:f,css:F},y),{ref:s,children:o}))}var g=ze__namespace.forwardRef(jt);var v={};q(v,{Link:()=>br,Plain:()=>hr,Primary:()=>yr,Secondary:()=>xr});var C={};q(C,{Body1:()=>lr,Body2:()=>pr,Caption:()=>dr,Display1:()=>tr,Display2:()=>rr,H1:()=>nr,H2:()=>ir,H3:()=>ar,H4:()=>sr});var Ne={};q(Ne,{Body1:()=>Qt,Body2:()=>Zt,Caption:()=>er,Display1:()=>Ut,Display2:()=>Gt,H1:()=>Xt,H2:()=>Jt,H3:()=>qt,H4:()=>Yt});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ut=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Gt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Jt=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),qt=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Yt=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Qt=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Zt=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),er=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var or=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(or.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ze__namespace.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsxRuntime.jsx(g,p(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),tr=Q.Display1,rr=Q.Display2,nr=Q.H1,ir=Q.H2,ar=Q.H3,sr=Q.H4,lr=Q.Body1,pr=Q.Body2,dr=Q.Caption;var Ke={};q(Ke,{Link:()=>fr,Plain:()=>gr,Primary:()=>ur,Secondary:()=>mr});var Be={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},ur=p(i({},Be),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),mr=p(i({},Be),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),fr=p(i({},Be),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),gr=p(i({},Be),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function Re(s){var d=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=d,a=u(d,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(g,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsxRuntime.jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function yr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Primary",children:e}))}function xr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Secondary",children:e}))}function br(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Link",children:e}))}function hr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Plain",children:e}))}var P={};q(P,{Column:()=>Sr,Row:()=>Cr});var Cr=ze__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Sr=ze__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var A=ze.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Oo(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?Le(t):{},[d,c]=ze.useState(new Set),m=ze.useMemo(()=>new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowConfigOverrides:r.__flowConfigOverrides}),[r.userId,r.groupId,r.apiKey]),x=o!=null?o:(b,f="_self")=>{window.open(b,f);};ze.useEffect(()=>()=>{m.destroy();},[]);let y=d.size>0?d.values().next().value:null;return jsxRuntime.jsxs(A.Provider,{value:p(i({modals:d,setModals:c,currentModal:y,navigate:x},r),{frigade:m}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},$e),s)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:S,children:e})]})}function re(e,o){let[t,r]=ze.useState(),[,n]=ze.useState(""),{frigade:a}=ze.useContext(A),s=ze.useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),r(d),n(Math.random().toString()));},[o==null?void 0:o.variables]);return ze.useEffect(()=>(M(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),r(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),ze.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function ne(e,{onComplete:o,onDismiss:t}={}){let r=ze.useRef(null);return ze.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&M(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:ze.useCallback(n=>M(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=ze.useContext(A),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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:ze.useCallback((a,s)=>M(this,null,function*(){if((yield o==null?void 0:o(e,a))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let c=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:ze.useCallback((a,s)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a))===!1)return a.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 he(e,o=!0){let{currentModal:t,modals:r,setModals:n}=ze.useContext(A),[a,s]=ze.useState(!1);ze.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]),ze.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function d(){o&&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:a||!o,removeModal:d}}function X(y){var b=y,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=b,x=u(b,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let{flow:f}=re(r,{variables:c}),[F,T]=ze.useState(!1),w=f==null?void 0:f.getCurrentStep(),{handleDismiss:B}=ne(f,{onComplete:n,onDismiss:a}),{handlePrimary:O,handleSecondary:R}=ie(w,{onPrimary:s,onSecondary:d}),H=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:z,removeModal:V}=he(f,H);ze.useEffect(()=>{!(f!=null&&f.isVisible)&&z&&V();},[f==null?void 0:f.isVisible,z]),ze.useEffect(()=>{f==null||f.register(()=>{T(!0);});},[f]),ze.useEffect(()=>()=>{f==null||f.unregister();},[f]);let me=m&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||!me&&!z||!f.isVisible&&!me||!F)return null;(me||!f.isCompleted&&!f.isSkipped)&&w.start();let We=e===null?ze.Fragment:e!=null?e:g;return jsxRuntime.jsx(We,p(i({},e===null?{}:x),{children:o({flow:f,handleDismiss:B,handlePrimary:O,handleSecondary:R,parentProps:i({dismissible:t,flowId:r,variables:c},x),step:w})}))}function Lo(e){return jsxRuntime.jsx(X,p(i({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a})=>{var c,m,x,y;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(y=(x=a.secondaryButton)==null?void 0:x.title)!=null?y:a.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(h.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(h.Secondary,{title:d,onClick:r}),jsxRuntime.jsx(h.Primary,{title:s,onClick:t})]})]})}}))}function je(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsxRuntime.jsx(g,i({as:"img",part:["image",e],src:o},t))}function _r(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ue(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);let a=_r(o);return a?jsxRuntime.jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Ue:je,i({src:e},t))}var h=ze__namespace.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsxRuntime.jsx(Lo,i({flowId:o},t));let s=(d=t.as)!=null?d:P.Column;return jsxRuntime.jsx(s,p(i({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(v.Plain,p(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}));h.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=u(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,p(i({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:"gray500",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ae,i({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(v.Primary,i({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(v.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,p(i({display:"block",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({display:"block",part:"title"},o),{children:e}))};var ke={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function No(e){let o=Object.fromEntries(ke.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(ke.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!ke.content.some(a=>a===n)&&!ke.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}function k(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:x}=No(r),y=x,{zIndex:c}=y,m=u(y,["zIndex"]);return jsxRuntime.jsx(L__namespace.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(L__namespace.Portal,{children:jsxRuntime.jsxs(g,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(L__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(L__namespace.Content,p(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},d),{children:jsxRuntime.jsx(h,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}k.Dismiss=e=>jsxRuntime.jsx(L__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(v.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});k.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(L__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))})};k.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(ae,i({borderRadius:"md",src:e},o))};k.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(v.Primary,i({title:o,onClick:e},t))};k.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?S.colors.blue500:S.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};k.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(v.Secondary,i({title:o,onClick:e},t))};k.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(L__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(C.H3,p(i({part:"title"},o),{children:e}))})};k.displayName="Dialog";var Ko=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function qr(t){var r=t,{flowId:e}=r,o=u(r,["flowId"]);let n=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.some(d=>s===d))),a=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.indexOf(s)===-1));return jsxRuntime.jsx(X,p(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:d,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:x},step:y})=>{var T,w,B,O,R,H;let b=(T=y.props)!=null?T:{},f=(B=(w=y.primaryButton)==null?void 0:w.title)!=null?B:y.primaryButtonTitle,F=(R=(O=y.secondaryButton)==null?void 0:O.title)!=null?R:y.secondaryButtonTitle;return jsxRuntime.jsx(k,p(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:z=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(z),z.defaultPrevented||d(z);},children:jsxRuntime.jsxs(P.Column,p(i({gap:5,part:"announcement-step"},b),{children:[x&&jsxRuntime.jsx(k.Dismiss,{onClick:d}),jsxRuntime.jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(k.Title,{children:y.title}),jsxRuntime.jsx(k.Subtitle,{children:y.subtitle})]}),jsxRuntime.jsx(k.Media,{src:(H=y.videoUri)!=null?H:y.imageUri,type:y.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(k.ProgressDots,{current:s.getNumberOfCompletedSteps(),total:s.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[F&&jsxRuntime.jsx(k.Secondary,{onClick:m,title:F}),f&&jsxRuntime.jsx(k.Primary,{onClick:c,title:f})]})]}))}))}}))}function Yr(r){var n=r,{dismissible:e,flowId:o}=n,t=u(n,["dismissible","flowId"]);return jsxRuntime.jsx(X,{as:null,flowId:o,children:({handleDismiss:a,handlePrimary:s,handleSecondary:d,step:c})=>{var b,f,F,T,w;let m=(b=c.props)!=null?b:{},x=(F=(f=c.primaryButton)==null?void 0:f.title)!=null?F:c.primaryButtonTitle,y=(w=(T=c.secondaryButton)==null?void 0:T.title)!=null?w:c.secondaryButtonTitle;return jsxRuntime.jsxs(h,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},t),m),{children:[c.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:c.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(h.Title,{part:"title",children:c.title}),jsxRuntime.jsx(h.Subtitle,{part:"subtitle",children:c.subtitle})]}),jsxRuntime.jsx(h.Secondary,{title:y,onClick:d}),jsxRuntime.jsx(h.Primary,{title:x,onClick:s}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:a})]}))}})}var Qe={};q(Qe,{Collapsible:()=>Qo,CollapsibleStep:()=>Ce});var Ce={};q(Ce,{Content:()=>Je,Root:()=>qe,Trigger:()=>Ye});var Zr=react.keyframes`
49
49
  from {
50
50
  height: 0;
51
51
  opacity: 0;
@@ -63,7 +63,7 @@ var ao=Object.defineProperty,wt=Object.defineProperties;var vt=Object.getOwnProp
63
63
  height: 0;
64
64
  opacity: 0;
65
65
  }
66
- `,on=()=>jsxRuntime.jsx(g,{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 tn({checked:e=!1}){return jsxRuntime.jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(on,{})})})}function Je({children:e}){return jsxRuntime.jsx(ce__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${Zr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${en} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(g,{}),e]})})}function qe(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=u(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(ce__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(h,d(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Ye({isCompleted:e,title:o}){return jsxRuntime.jsx(ce__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(tn,{checked:e}),jsxRuntime.jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var De={};q(De,{Bar:()=>ke,Dots:()=>Go,Segments:()=>Jo});function ke(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(g,d(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Go(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,p)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?S.colors.blue500:S.colors.blue800},p));return jsxRuntime.jsx(g,d(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Jo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=[...Array(o)].map((s,p)=>jsxRuntime.jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(P.Row,d(i({gap:1,height:"10px"},t),{children:a}))}var qo=ze.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Yo({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var b,f,F,T,w,R;let{$state:{blocked:a,completed:s},subtitle:p,title:c}=n,m=(f=(b=n.primaryButton)==null?void 0:b.title)!=null?f:n.primaryButtonTitle,y=(T=(F=n.secondaryButton)==null?void 0:F.title)!=null?T:n.secondaryButtonTitle,x=(w=n.props)!=null?w:{};return jsxRuntime.jsxs(qe,d(i({open:t,onOpenChange:r},x),{children:[jsxRuntime.jsx(Ye,{isCompleted:s,title:c}),jsxRuntime.jsxs(Je,{children:[jsxRuntime.jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=n.videoUri)!=null?R:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(h.Subtitle,{color:"gray500",children:p}),jsxRuntime.jsxs(P.Row,{gap:3,children:[jsxRuntime.jsx(h.Secondary,{disabled:!!(s||a),title:y,onClick:o}),jsxRuntime.jsx(h.Primary,{disabled:!!(s||a),title:m,onClick:e})]})]})]}))}var sn={default:Yo};function ln(r){var n=r,{flow:e,step:o}=n,t=u(n,["flow","step"]);var T;let{onPrimary:a,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:m}=ze.useContext(qo),{handlePrimary:y,handleSecondary:x}=ie(o,{onPrimary:a,onSecondary:s}),b=(p!=null?p:e.getCurrentStep().id)===o.id,f=(T=m[o.type])!=null?T:Yo;function F(w){return W(this,null,function*(){c(w?o.id:""),w&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(f,d(i({flow:e,onOpenChange:F,open:b,step:o},t),{handlePrimary:y,handleSecondary:x}),o.id)}function Qo(s){var p=s,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=p,a=u(p,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=ze.useState(null),y=i(i({},sn),n);return jsxRuntime.jsx(qo.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:y},children:jsxRuntime.jsx(X,d(i({as:h,borderWidth:"md",flowId:o,part:"checklist"},a),{children:F=>{var T=F,{flow:x,handleDismiss:b}=T,f=u(T,["flow","handleDismiss"]);let R=Array.from(x.steps.entries()).filter(([,v])=>v.$state.visible===!0).map(([,v])=>jsxRuntime.jsx(ln,d(i({flow:x,handleDismiss:b},f),{step:v}),v.id)),O=x.getNumberOfCompletedSteps(),H=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(h.Header,{dismissible:e,handleDismiss:b,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(C.Body2,{fontWeight:"demibold",children:[O,"/",H]}),jsxRuntime.jsx(ke,{current:O,total:H,flexGrow:1})]})]}),R]})}}))})}var un=new Set(["required","min","max","minLength","maxLength","pattern"]);function mn({fieldComponent:e,control:o,fieldData:t,submit:r}){t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let n=Object.fromEntries(Object.entries(t).filter(([s])=>un.has(s))),a=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,d(i({},a),{fieldData:t,submit:r}))}function et({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var F,T,w,R,O,H;let{control:s,handleSubmit:p}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),c=[],m=(F=a.props)!=null?F:{};function y(v,M){t(M,v);}function x(v,M){r(M,v);}(T=a.fields)==null||T.forEach(v=>{e[v.type]!=null&&c.push(jsxRuntime.jsx(mn,{control:s,fieldComponent:e[v.type],fieldData:v,submit:p(y)},v.id));});let b=(R=(w=a.primaryButton)==null?void 0:w.title)!=null?R:a.primaryButtonTitle,f=(H=(O=a.secondaryButton)==null?void 0:O.title)!=null?H:a.secondaryButtonTitle;return jsxRuntime.jsxs(P.Column,d(i({gap:5,part:"form-step"},m),{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),c,jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[f&&jsxRuntime.jsx(B.Secondary,{title:f,onClick:p(x)}),jsxRuntime.jsx(B.Primary,{title:b!=null?b:"Submit",onClick:p(y)})]},"form-footer")]}))}function ot({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function tt({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var Se={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ee({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:p}=r,c=d(i(i(i({id:n},o),s?{placeholder:s}:{}),Se),{"aria-invalid":!!p,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(tt,{id:n,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(ot,{error:p})]})}var xn=()=>jsxRuntime.jsx(g,{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"})}),bn=ze__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(C.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(ue__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{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(g,{as:ue__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(xn,{})})})})]}));function at(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsxRuntime.jsx(bn,{value:s,label:a},s));return jsxRuntime.jsx(ee,d(i({},e),{children:()=>jsxRuntime.jsx(ue__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Cn=ze__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(A__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(A__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function pt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:p})=>jsxRuntime.jsx(Cn,{value:p,label:s},p));return jsxRuntime.jsx(ee,d(i({},e),{children:()=>jsxRuntime.jsxs(A__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(A__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Body2,d(i({},Se),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(A__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(A__namespace.Icon,{children:jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(A__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,d(i({},Se),{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(A__namespace.Viewport,{children:a})}))})]})}))}function ct(e){return jsxRuntime.jsx(ee,d(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function mt(e){return jsxRuntime.jsx(ee,d(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var Sn={radio:at,select:pt,text:ct,textarea:mt};function Ze(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=u(n,["fieldTypes","flowId"]);let a=Object.assign({},Sn,e);return jsxRuntime.jsx(X,d(i({flowId:o,part:"form"},t),{children:s=>jsxRuntime.jsx(et,i({fieldTypes:a},s))}))}var eo={};q(eo,{NPS:()=>xt});function yt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let a=e.value===n?B.Primary:B.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,justifyContent:"space-between",part:"field-nps",children:t}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(C.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsxRuntime.jsx(C.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function xt(n){var a=n,{as:e=k,flowId:o,fieldTypes:t}=a,r=u(a,["as","flowId","fieldTypes"]);let{flow:s}=re(o);return jsxRuntime.jsx(Ze,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:yt},t),minWidth:"620px",modal:!1,onEscapeKeyDown:p=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(p),p.defaultPrevented||s.skip();},width:"620px",css:d(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px"},".fr-form-step":{gap:"1"}})},r))}function Oe(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=ze.useState(e),[r,n]=ze.useState(null),a=ze.useCallback(s=>{n(s);},[]);return ze.useLayoutEffect(()=>{if(!r)return;let s=()=>{let p=r.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var Bn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Pt(r){var n=r,{style:e={},part:o=""}=n,t=u(n,["style","part"]);return jsxRuntime.jsxs(g,d(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Bn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ct({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{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",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=s;let c=a();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 Ie={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function St(e,o){var a,s,p,c,m;let t=Object.fromEntries(Ie.content.map(y=>[y,e[y]]).filter(y=>y[1]!==void 0)),r=Object.fromEntries(Ie.root.map(y=>[y,e[y]]).filter(y=>y[1]!==void 0)),n={};for(let y of Object.keys(e))!Ie.content.includes(y)&&!Ie.root.includes(y)&&(n[y]=e[y]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let y={after:"end",before:"start"},x=(R,O)=>["top","bottom"].includes(O)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",b=(p=t.alignOffset)!=null?p:0,f=(c=t.style)!=null?c:{},F=(m=t.side)!=null?m:"bottom",T=t.align;t.style=d(i({},f),{[x(T,F)]:b});let w=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(w+b)*-1,t.align=y[T];}return {contentProps:t,otherProps:n,rootProps:r}}function I(s){var p=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=p,a=u(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:y}=Oe(),{node:x,rect:b,ref:f}=Oe(),{contentProps:F,otherProps:T,rootProps:w}=St(a,m),[R,O]=ze.useState(F.align),[H,v]=ze.useState(F.side),[M,N]=ze.useState(0),[Me,We]=ze.useState(0);if(c!==null){let j=c.getAttribute("data-align"),oe=c.getAttribute("data-side");R!==j&&O(j),H!==oe&&v(oe);}let me=ze.useRef(null);if(ze.useEffect(()=>{let j=document.querySelector(e);j!=null?(f(j),me.current=j):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),ze.useEffect(()=>{function j(fe){if(fe.matches(e))return fe;let de=fe.querySelectorAll(e);return de.length>0?de[0]:null}let oe=new MutationObserver(fe=>{for(let de of fe)if(de.type==="childList"){for(let ge of de.addedNodes){if(ge.nodeType!==Node.ELEMENT_NODE)continue;let te=j(ge);if(te!=null){f(te),me.current=te,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",te);break}}for(let ge of de.removedNodes){if(ge.nodeType!==Node.ELEMENT_NODE)continue;let te=j(ge);if(te!=null){f(null),me.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",te);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),ze.useEffect(()=>{let{scrollX:j,scrollY:oe}=window;N(b.left+j),We(b.top+oe);},[b.left,b.top]),x==null)return null;let no="0";typeof window!="undefined"&&(no=window.getComputedStyle(x).borderRadius);let Tt=Ct({props:a,alignAttr:R,sideAttr:H});return jsxRuntime.jsxs(J__namespace.Root,d(i({defaultOpen:!0},w),{children:[jsxRuntime.jsx(J__namespace.Anchor,{virtualRef:me}),jsxRuntime.jsx(J__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(g,i({boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:no,height:b.height,left:M,top:Me,width:b.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(J__namespace.Content,d(i({asChild:!0},F),{ref:y,children:jsxRuntime.jsxs(h,d(i({boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},T),{children:[jsxRuntime.jsx(Pt,{style:Tt}),o]}))}))]})})]}))}I.Close=e=>jsxRuntime.jsx(J__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(B.Plain,d(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});I.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(ae,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};I.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(B.Primary,i({title:o,onClick:e},t))};I.Progress=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,d(i({part:"progress"},o),{children:e}))};I.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(B.Secondary,i({title:o,onClick:e},t))};I.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(i({part:"subtitle"},o),{children:e}))};I.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,d(i({part:"title"},o),{children:e}))};function Ft(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:a,step:s}=m,p=u(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var w,R,O,H,v,M;let{handleDismiss:y}=ne(o,{onDismiss:t}),{handlePrimary:x,handleSecondary:b}=ie(s,{onPrimary:n,onSecondary:a}),f=(w=s.props)!=null?w:{},F=(O=(R=s.primaryButton)==null?void 0:R.title)!=null?O:s.primaryButtonTitle,T=(v=(H=s.secondaryButton)==null?void 0:H.title)!=null?v:s.secondaryButtonTitle;return jsxRuntime.jsxs(I,d(i(i({anchor:s.selector,onOpenAutoFocus:N=>N.preventDefault(),onPointerDownOutside:N=>N.preventDefault(),onInteractOutside:N=>N.preventDefault()},p),f),{onEscapeKeyDown:N=>{typeof r=="function"&&r(N),N.defaultPrevented||y(N);},children:[e&&jsxRuntime.jsx(I.Close,{onClick:y}),jsxRuntime.jsx(I.Media,{src:(M=s.videoUri)!=null?M:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(I.Title,{children:s.title}),jsxRuntime.jsx(I.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(I.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(I.Secondary,{title:T,onClick:b}),jsxRuntime.jsx(I.Primary,{title:F,onClick:x})]})]}),s.id)}function In(n){var a=n,{flowId:e,onComplete:o,variables:t}=a,r=u(a,["flowId","onComplete","variables"]);let{flow:s}=re(e,{variables:t});ne(s,{onComplete:o});let{isCurrentModal:p,removeModal:c}=be(s);if(ze.useEffect(()=>{!(s!=null&&s.isVisible)&&p&&c();},[s==null?void 0:s.isVisible,p]),s==null||s.isVisible===!1||!p)return null;let m=s.getCurrentStep();return m==null||m.start(),jsxRuntime.jsx(Ft,i({step:m,flow:s},r))}function Wn(){let{frigade:e}=ze.useContext(L);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Ln(){let{userId:e,frigade:o}=ze.useContext(L);function t(n){return W(this,null,function*(){yield o.identify(e,n);})}function r(n,a){return W(this,null,function*(){yield o.track(n,a);})}return {userId:e,addProperties:t,track:r}}function Vn(){let{groupId:e,frigade:o}=ze.useContext(L);function t(n){return W(this,null,function*(){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(e,n);})}function r(n,a){return W(this,null,function*(){yield o.track(n,a);})}return {groupId:e,addProperties:t,track:r}}
66
+ `,on=()=>jsxRuntime.jsx(g,{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 tn({checked:e=!1}){return jsxRuntime.jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(on,{})})})}function Je({children:e}){return jsxRuntime.jsx(ce__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${Zr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${en} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(g,{}),e]})})}function qe(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=u(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(ce__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(h,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Ye({isCompleted:e,title:o}){return jsxRuntime.jsx(ce__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(tn,{checked:e}),jsxRuntime.jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ee={};q(Ee,{Bar:()=>De,Dots:()=>Go,Segments:()=>Jo});function De(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(g,p(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Go(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?S.colors.blue500:S.colors.blue800},d));return jsxRuntime.jsx(g,p(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Jo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(g,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(P.Row,p(i({gap:1,height:"10px"},t),{children:a}))}var qo=ze.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Yo({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var b,f,F,T,w,B;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=n,m=(f=(b=n.primaryButton)==null?void 0:b.title)!=null?f:n.primaryButtonTitle,x=(T=(F=n.secondaryButton)==null?void 0:F.title)!=null?T:n.secondaryButtonTitle,y=(w=n.props)!=null?w:{};return jsxRuntime.jsxs(qe,p(i({open:t,onOpenChange:r},y),{children:[jsxRuntime.jsx(Ye,{isCompleted:s,title:c}),jsxRuntime.jsxs(Je,{children:[jsxRuntime.jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(B=n.videoUri)!=null?B:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(h.Subtitle,{color:"gray500",children:d}),jsxRuntime.jsxs(P.Row,{gap:3,children:[jsxRuntime.jsx(h.Secondary,{disabled:!!(s||a),title:x,onClick:o}),jsxRuntime.jsx(h.Primary,{disabled:!!(s||a),title:m,onClick:e})]})]})]}))}var sn={default:Yo};function ln(r){var n=r,{flow:e,step:o}=n,t=u(n,["flow","step"]);var T;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:m}=ze.useContext(qo),{handlePrimary:x,handleSecondary:y}=ie(o,{onPrimary:a,onSecondary:s}),b=(d!=null?d:e.getCurrentStep().id)===o.id,f=(T=m[o.type])!=null?T:Yo;function F(w){return M(this,null,function*(){c(w?o.id:""),w&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(f,p(i({flow:e,onOpenChange:F,open:b,step:o},t),{handlePrimary:x,handleSecondary:y}),o.id)}function Qo(s){var d=s,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=d,a=u(d,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=ze.useState(null),x=i(i({},sn),n);return jsxRuntime.jsx(qo.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:x},children:jsxRuntime.jsx(X,p(i({as:h,borderWidth:"md",flowId:o,part:"checklist"},a),{children:F=>{var T=F,{flow:y,handleDismiss:b}=T,f=u(T,["flow","handleDismiss"]);let B=Array.from(y.steps.entries()).filter(([,H])=>H.$state.visible===!0).map(([,H])=>jsxRuntime.jsx(ln,p(i({flow:y,handleDismiss:b},f),{step:H}),H.id)),O=y.getNumberOfCompletedSteps(),R=y.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(h.Header,{dismissible:e,handleDismiss:b,part:"checklist-header",subtitle:y.subtitle,title:y.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(C.Body2,{fontWeight:"demibold",children:[O,"/",R]}),jsxRuntime.jsx(De,{current:O,total:R,flexGrow:1})]})]}),B]})}}))})}var un=new Set(["required","min","max","minLength","maxLength","pattern"]);function mn({fieldComponent:e,control:o,fieldData:t,submit:r}){t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let n=Object.fromEntries(Object.entries(t).filter(([s])=>un.has(s))),a=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,p(i({},a),{fieldData:t,submit:r}))}function et({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var f,F,T,w,B,O;let{control:s,handleSubmit:d}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),c=[],m=(f=a.props)!=null?f:{};function x(R,H){t(H,R);}(F=a.fields)==null||F.forEach(R=>{e[R.type]!=null&&c.push(jsxRuntime.jsx(mn,{control:s,fieldComponent:e[R.type],fieldData:R,submit:d(x)},R.id));});let y=(w=(T=a.primaryButton)==null?void 0:T.title)!=null?w:a.primaryButtonTitle,b=(O=(B=a.secondaryButton)==null?void 0:B.title)!=null?O:a.secondaryButtonTitle;return jsxRuntime.jsxs(P.Column,p(i({gap:5,part:"form-step"},m),{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),c,jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[b&&jsxRuntime.jsx(v.Secondary,{title:b,onClick:r}),jsxRuntime.jsx(v.Primary,{title:y!=null?y:"Submit",onClick:d(x)})]},"form-footer")]}))}function ot({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function tt({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var Fe={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ee({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:d}=r,c=p(i(i(i({id:n},o),s?{placeholder:s}:{}),Fe),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(tt,{id:n,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(ot,{error:d})]})}var xn=()=>jsxRuntime.jsx(g,{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"})}),bn=ze__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(C.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(ue__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{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(g,{as:ue__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(xn,{})})})})]}));function at(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsxRuntime.jsx(bn,{value:s,label:a},s));return jsxRuntime.jsx(ee,p(i({},e),{children:()=>jsxRuntime.jsx(ue__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Cn=ze__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(W__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(W__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function pt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:d})=>jsxRuntime.jsx(Cn,{value:d,label:s},d));return jsxRuntime.jsx(ee,p(i({},e),{children:()=>jsxRuntime.jsxs(W__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(W__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Body2,p(i({},Fe),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(W__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(W__namespace.Icon,{children:jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(W__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,p(i({},Fe),{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(W__namespace.Viewport,{children:a})}))})]})}))}function ct(e){return jsxRuntime.jsx(ee,p(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function mt(e){return jsxRuntime.jsx(ee,p(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var Sn={radio:at,select:pt,text:ct,textarea:mt};function Ze(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=u(n,["fieldTypes","flowId"]);let a=Object.assign({},Sn,e);return jsxRuntime.jsx(X,p(i({flowId:o,part:"form"},t),{children:s=>jsxRuntime.jsx(et,i({fieldTypes:a},s))}))}var eo={};q(eo,{NPS:()=>xt});function yt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let a=e.value===n?v.Primary:v.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,justifyContent:"space-between",part:"field-nps",children:t}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(C.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsxRuntime.jsx(C.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function xt(n){var a=n,{as:e=k,flowId:o,fieldTypes:t}=a,r=u(a,["as","flowId","fieldTypes"]);let{flow:s}=re(o);return jsxRuntime.jsx(Ze,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:yt},t),minWidth:"620px",modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||s.skip();},width:"620px",css:p(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px"},".fr-form-step":{gap:"1"}})},r))}function Ie(){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]=ze.useState(e),[r,n]=ze.useState(null),a=ze.useCallback(s=>{n(s);},[]);return ze.useLayoutEffect(()=>{if(!r)return;let s=()=>{let d=r.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var Bn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Pt(r){var n=r,{style:e={},part:o=""}=n,t=u(n,["style","part"]);return jsxRuntime.jsxs(g,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Bn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ct({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{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",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=s;let c=a();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 He={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function St(e,o){var a,s,d,c,m;let t=Object.fromEntries(He.content.map(x=>[x,e[x]]).filter(x=>x[1]!==void 0)),r=Object.fromEntries(He.root.map(x=>[x,e[x]]).filter(x=>x[1]!==void 0)),n={};for(let x of Object.keys(e))!He.content.includes(x)&&!He.root.includes(x)&&(n[x]=e[x]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let x={after:"end",before:"start"},y=(B,O)=>["top","bottom"].includes(O)?B=="after"?"marginLeft":"marginRight":B=="after"?"marginTop":"marginBottom",b=(d=t.alignOffset)!=null?d:0,f=(c=t.style)!=null?c:{},F=(m=t.side)!=null?m:"bottom",T=t.align;t.style=p(i({},f),{[y(T,F)]:b});let w=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(w+b)*-1,t.align=x[T];}return {contentProps:t,otherProps:n,rootProps:r}}function I(s){var d=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=d,a=u(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:x}=Ie(),{node:y,rect:b,ref:f}=Ie(),{contentProps:F,otherProps:T,rootProps:w}=St(a,m),[B,O]=ze.useState(F.align),[R,H]=ze.useState(F.side),[z,V]=ze.useState(0),[me,We]=ze.useState(0);if(c!==null){let j=c.getAttribute("data-align"),oe=c.getAttribute("data-side");B!==j&&O(j),R!==oe&&H(oe);}let fe=ze.useRef(null);if(ze.useEffect(()=>{let j=document.querySelector(e);j!=null?(f(j),fe.current=j):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),ze.useEffect(()=>{function j(ge){if(ge.matches(e))return ge;let de=ge.querySelectorAll(e);return de.length>0?de[0]:null}let oe=new MutationObserver(ge=>{for(let de of ge)if(de.type==="childList"){for(let ye of de.addedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let te=j(ye);if(te!=null){f(te),fe.current=te,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",te);break}}for(let ye of de.removedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let te=j(ye);if(te!=null){f(null),fe.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",te);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),ze.useEffect(()=>{let{scrollX:j,scrollY:oe}=window;V(b.left+j),We(b.top+oe);},[b.left,b.top]),y==null)return null;let no="0";typeof window!="undefined"&&(no=window.getComputedStyle(y).borderRadius);let Tt=Ct({props:a,alignAttr:B,sideAttr:R});return jsxRuntime.jsxs(J__namespace.Root,p(i({defaultOpen:!0},w),{children:[jsxRuntime.jsx(J__namespace.Anchor,{virtualRef:fe}),jsxRuntime.jsx(J__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(g,i({boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:no,height:b.height,left:z,top:me,width:b.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(J__namespace.Content,p(i({asChild:!0},F),{ref:x,children:jsxRuntime.jsxs(h,p(i({boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},T),{children:[jsxRuntime.jsx(Pt,{style:Tt}),o]}))}))]})})]}))}I.Close=e=>jsxRuntime.jsx(J__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(v.Plain,p(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});I.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(ae,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};I.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(v.Primary,i({title:o,onClick:e},t))};I.Progress=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({part:"progress"},o),{children:e}))};I.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(v.Secondary,i({title:o,onClick:e},t))};I.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))};I.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({part:"title"},o),{children:e}))};function Ft(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:a,step:s}=m,d=u(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var w,B,O,R,H,z;let{handleDismiss:x}=ne(o,{onDismiss:t}),{handlePrimary:y,handleSecondary:b}=ie(s,{onPrimary:n,onSecondary:a}),f=(w=s.props)!=null?w:{},F=(O=(B=s.primaryButton)==null?void 0:B.title)!=null?O:s.primaryButtonTitle,T=(H=(R=s.secondaryButton)==null?void 0:R.title)!=null?H:s.secondaryButtonTitle;return jsxRuntime.jsxs(I,p(i(i({anchor:s.selector,onOpenAutoFocus:V=>V.preventDefault(),onPointerDownOutside:V=>V.preventDefault(),onInteractOutside:V=>V.preventDefault()},d),f),{onEscapeKeyDown:V=>{typeof r=="function"&&r(V),V.defaultPrevented||x(V);},children:[e&&jsxRuntime.jsx(I.Close,{onClick:x}),jsxRuntime.jsx(I.Media,{src:(z=s.videoUri)!=null?z:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(I.Title,{children:s.title}),jsxRuntime.jsx(I.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(I.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(I.Secondary,{title:T,onClick:b}),jsxRuntime.jsx(I.Primary,{title:F,onClick:y})]})]}),s.id)}function In(n){var a=n,{flowId:e,onComplete:o,variables:t}=a,r=u(a,["flowId","onComplete","variables"]);let{flow:s}=re(e,{variables:t});ne(s,{onComplete:o});let{isCurrentModal:d,removeModal:c}=he(s);if(ze.useEffect(()=>{!(s!=null&&s.isVisible)&&d&&c();},[s==null?void 0:s.isVisible,d]),s==null||s.isVisible===!1||!d)return null;let m=s.getCurrentStep();return m==null||m.start(),jsxRuntime.jsx(Ft,i({step:m,flow:s},r))}function Wn(){let{frigade:e}=ze.useContext(A);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Ln(){let{userId:e,frigade:o}=ze.useContext(A);function t(n){return M(this,null,function*(){yield o.identify(e,n);})}function r(n,a){return M(this,null,function*(){yield o.track(n,a);})}return {userId:e,addProperties:t,track:r}}function Vn(){let{groupId:e,frigade:o}=ze.useContext(A);function t(n){return M(this,null,function*(){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(e,n);})}function r(n,a){return M(this,null,function*(){yield o.track(n,a);})}return {groupId:e,addProperties:t,track:r}}
67
67
 
68
68
  Object.defineProperty(exports, 'Flow', {
69
69
  enumerable: true,
@@ -80,26 +80,26 @@ Object.defineProperty(exports, 'Frigade', {
80
80
  exports.Announcement = qr;
81
81
  exports.Banner = Yr;
82
82
  exports.Box = g;
83
- exports.Button = B;
83
+ exports.Button = v;
84
84
  exports.Card = h;
85
85
  exports.Checklist = Qe;
86
86
  exports.Dialog = k;
87
87
  exports.Flex = P;
88
88
  exports.Form = Ze;
89
- exports.Progress = De;
89
+ exports.Progress = Ee;
90
90
  exports.Provider = Oo;
91
91
  exports.Survey = eo;
92
92
  exports.Text = C;
93
93
  exports.Tooltip = I;
94
94
  exports.Tour = In;
95
95
  exports.themeVariables = $e;
96
- exports.tokens = we;
97
- exports.useBoundingClientRect = Oe;
96
+ exports.tokens = ve;
97
+ exports.useBoundingClientRect = Ie;
98
98
  exports.useFlow = re;
99
99
  exports.useFlowHandlers = ne;
100
100
  exports.useFrigade = Wn;
101
101
  exports.useGroup = Vn;
102
- exports.useModal = be;
102
+ exports.useModal = he;
103
103
  exports.useStepHandlers = ie;
104
104
  exports.useUser = Ln;
105
105
  //# sourceMappingURL=out.js.map