@frigade/react 2.0.34 → 2.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
2
  import * as RadixDialog from '@radix-ui/react-dialog';
3
3
  import * as React$1 from 'react';
4
- import React__default, { CSSProperties, MouseEvent, SyntheticEvent, ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ import React__default, { CSSProperties, SyntheticEvent, ForwardRefExoticComponent, RefAttributes } from 'react';
5
5
  import * as _frigade_js from '@frigade/js';
6
6
  import { Flow, FlowStep } from '@frigade/js';
7
7
  export { Flow, FlowType, Frigade } from '@frigade/js';
@@ -1105,33 +1105,24 @@ declare namespace Text {
1105
1105
  };
1106
1106
  }
1107
1107
 
1108
- interface DialogContentProps extends Pick<RadixDialog.DialogContentProps, 'onOpenAutoFocus' | 'onCloseAutoFocus' | 'onEscapeKeyDown' | 'onPointerDownOutside' | 'onInteractOutside'> {
1109
- }
1110
- interface DialogRootProps extends RadixDialog.DialogProps {
1111
- }
1112
- interface DialogProps extends BoxProps, DialogRootProps, DialogContentProps {
1113
- }
1114
- declare function Dialog({ children, className, modal, ...props }: DialogProps): _emotion_react_jsx_runtime.JSX.Element;
1115
- declare namespace Dialog {
1116
- var Dismiss: (props: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1117
- var Subtitle: ({ children, ...props }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
1118
- var Media: ({ src, ...props }: MediaProps) => _emotion_react_jsx_runtime.JSX.Element;
1119
- var Primary: ({ onClick, title, ...props }: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1120
- var ProgressDots: ({ current, total }: {
1121
- current: number;
1122
- total: number;
1123
- }) => _emotion_react_jsx_runtime.JSX.Element;
1124
- var Secondary: ({ onClick, title, ...props }: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1125
- var Title: ({ children, ...props }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
1126
- var displayName: string;
1127
- }
1128
-
1129
- type FlowHandlerProp = (flow: Flow, event?: MouseEvent<unknown>) => Promise<boolean | void> | (boolean | void);
1108
+ /**
1109
+ * A function that handles a Flow event.
1110
+ * If the function returns a promise that evaluates to `false`, the Flow's state will not be updated for the current user (e.g. a Flow will not be marked as completed or dismissed).
1111
+ */
1112
+ type FlowHandlerProp = (
1113
+ /**
1114
+ * The Flow that the handler is being called on
1115
+ */
1116
+ flow: Flow,
1117
+ /**
1118
+ * The event that triggered the handler
1119
+ */
1120
+ event?: MouseEvent | KeyboardEvent) => Promise<boolean | void> | (boolean | void);
1130
1121
  interface FlowHandlerProps {
1131
1122
  onComplete?: FlowHandlerProp;
1132
1123
  onDismiss?: FlowHandlerProp;
1133
1124
  }
1134
- type DismissHandler = (e: MouseEvent<unknown>) => Promise<boolean | void>;
1125
+ type DismissHandler = (e: MouseEvent | KeyboardEvent) => Promise<boolean | void>;
1135
1126
  declare function useFlowHandlers(flow: Flow, { onComplete, onDismiss }?: FlowHandlerProps): {
1136
1127
  handleDismiss: DismissHandler;
1137
1128
  };
@@ -1147,27 +1138,31 @@ declare function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }?: St
1147
1138
  handleSecondary: StepHandler;
1148
1139
  };
1149
1140
 
1150
- interface FlowProps extends BoxProps {
1151
- /**
1152
- * Flow accepts a render function as its only child, whose props are described in FlowChildrenProps
1153
- */
1154
- children?: (props: FlowChildrenProps) => ReactNode;
1141
+ interface BoxPropsWithoutChildren extends Omit<BoxProps, 'children'> {
1142
+ }
1143
+ interface FlowPropsWithoutChildren extends BoxPropsWithoutChildren {
1155
1144
  /**
1156
1145
  * Whether the Flow is dismissible or not
1157
1146
  *
1158
- * @defaultValue `true`
1159
1147
  */
1160
1148
  dismissible?: boolean;
1161
1149
  /**
1162
1150
  * The Flow ID to render. You can find the Flow ID in the Frigade dashboard.
1163
1151
  */
1164
1152
  flowId: string;
1153
+ /**
1154
+ * If true, the Flow will be mounted even if it has already been completed or dismissed.
1155
+ * However, if the user does not match the Flow's targeting, the Flow will not be mounted.
1156
+ */
1157
+ forceMount?: boolean;
1165
1158
  /**
1166
1159
  * Handler for when the Flow is completed.
1160
+ * If this function a promise that evaluates to `false`, the Flow will not be marked as completed.
1167
1161
  */
1168
1162
  onComplete?: FlowHandlerProp;
1169
1163
  /**
1170
1164
  * Handler for when the Flow is dismissed.
1165
+ * If this function a promise that evaluates to `false`, the Flow will not be marked as dismissed.
1171
1166
  */
1172
1167
  onDismiss?: FlowHandlerProp;
1173
1168
  /**
@@ -1185,13 +1180,6 @@ interface FlowProps extends BoxProps {
1185
1180
  * For instance, you can use `title: Hello, ${name}!` in the Flow configuration and pass `variables={{name: 'John'}}` to customize the copy.
1186
1181
  */
1187
1182
  variables?: Record<string, unknown>;
1188
- /**
1189
- * If true, the Flow will be mounted even if it has already been completed or dismissed.
1190
- * However, if the user does not match the Flow's targeting, the Flow will not be mounted.
1191
- */
1192
- forceMount?: boolean;
1193
- }
1194
- interface FlowPropsWithoutChildren extends Omit<FlowProps, 'children'> {
1195
1183
  }
1196
1184
  interface FlowChildrenProps {
1197
1185
  flow: Flow;
@@ -1202,7 +1190,44 @@ interface FlowChildrenProps {
1202
1190
  step: FlowStep;
1203
1191
  }
1204
1192
 
1193
+ interface DialogContentProps extends Pick<RadixDialog.DialogContentProps, 'onOpenAutoFocus' | 'onCloseAutoFocus' | 'onEscapeKeyDown' | 'onPointerDownOutside' | 'onInteractOutside'> {
1194
+ }
1195
+ interface DialogRootProps extends RadixDialog.DialogProps {
1196
+ }
1197
+ interface DialogProps extends BoxPropsWithoutChildren, DialogRootProps, DialogContentProps {
1198
+ /**
1199
+ * The modality of the dialog. When set to `true`, interaction with outside elements will be disabled and only dialog content will be visible to screen readers.
1200
+ */
1201
+ modal?: boolean;
1202
+ }
1203
+ declare function Dialog({ children, className, modal, ...props }: DialogProps): _emotion_react_jsx_runtime.JSX.Element;
1204
+ declare namespace Dialog {
1205
+ var Dismiss: (props: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1206
+ var Subtitle: ({ children, ...props }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
1207
+ var Media: ({ src, ...props }: MediaProps) => _emotion_react_jsx_runtime.JSX.Element;
1208
+ var Primary: ({ onClick, title, ...props }: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1209
+ var ProgressDots: ({ current, total }: {
1210
+ current: number;
1211
+ total: number;
1212
+ }) => _emotion_react_jsx_runtime.JSX.Element;
1213
+ var Secondary: ({ onClick, title, ...props }: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1214
+ var Title: ({ children, ...props }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
1215
+ var displayName: string;
1216
+ }
1217
+
1205
1218
  interface AnnouncementProps extends FlowPropsWithoutChildren, DialogProps {
1219
+ /**
1220
+ * @ignore
1221
+ */
1222
+ children: React.ReactNode;
1223
+ /**
1224
+ * @ignore
1225
+ */
1226
+ open?: boolean;
1227
+ /**
1228
+ * @ignore
1229
+ */
1230
+ defaultOpen?: boolean;
1206
1231
  }
1207
1232
  declare function Announcement({ flowId, ...props }: AnnouncementProps): _emotion_react_jsx_runtime.JSX.Element;
1208
1233
 
@@ -1403,9 +1428,9 @@ declare namespace index {
1403
1428
  };
1404
1429
  }
1405
1430
 
1406
- interface MergedRadixPopoverProps extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>, Omit<Popover.PopoverContentProps, 'align' | 'asChild' | 'color' | 'content' | 'translate'> {
1431
+ interface MergedRadixPopoverProps extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>, Omit<Popover.PopoverContentProps, 'align' | 'asChild' | 'color' | 'content' | 'translate' | 'forceMount'> {
1407
1432
  }
1408
- interface TooltipProps extends BoxProps, MergedRadixPopoverProps {
1433
+ interface TooltipProps extends BoxPropsWithoutChildren, Omit<MergedRadixPopoverProps, 'children'> {
1409
1434
  /**
1410
1435
  * How to align the Tooltip relative to the anchor.
1411
1436
  * Uses the same notation as the `align` property in [Radix Popover](https://www.radix-ui.com/primitives/docs/components/popover).
@@ -1437,6 +1462,18 @@ declare namespace Tooltip {
1437
1462
  }
1438
1463
 
1439
1464
  interface TourProps extends TooltipProps, FlowPropsWithoutChildren {
1465
+ /**
1466
+ * @ignore
1467
+ */
1468
+ defaultOpen?: boolean;
1469
+ /**
1470
+ * @ignore
1471
+ */
1472
+ open?: boolean;
1473
+ /**
1474
+ * The modality of the tooltip. When set to `true`, interaction with outside elements will be disabled and only popover content will be visible to screen readers.
1475
+ */
1476
+ modal?: boolean;
1440
1477
  }
1441
1478
  declare function Tour({ flowId, onComplete, variables, ...props }: TourProps): _emotion_react_jsx_runtime.JSX.Element;
1442
1479
 
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import * as I from '@radix-ui/react-dialog';
3
3
  import { XMarkIcon } from '@heroicons/react/24/solid';
4
- import * as Ve from 'react';
4
+ import * as Le from 'react';
5
5
  import { createContext, useState, useMemo, useEffect, useContext, useCallback, useRef, useLayoutEffect, Fragment as Fragment$1 } from 'react';
6
6
  import { clsx } from 'clsx';
7
- import wt from 'known-css-properties';
8
- import Mt from 'dompurify';
7
+ import Rt from 'known-css-properties';
8
+ import Ht from 'dompurify';
9
9
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
10
10
  import { Frigade } from '@frigade/js';
11
11
  export { Flow, FlowType, Frigade } from '@frigade/js';
@@ -14,10 +14,10 @@ import { ChevronDownIcon } from '@heroicons/react/24/outline';
14
14
  import * as pe from '@radix-ui/react-collapsible';
15
15
  import { useForm, useController } from 'react-hook-form';
16
16
  import * as de from '@radix-ui/react-radio-group';
17
- import * as v from '@radix-ui/react-select';
18
- import * as _ from '@radix-ui/react-popover';
17
+ import * as E from '@radix-ui/react-select';
18
+ import * as z from '@radix-ui/react-popover';
19
19
 
20
- var no=Object.defineProperty,ht=Object.defineProperties;var Pt=Object.getOwnPropertyDescriptors;var Pe=Object.getOwnPropertySymbols;var io=Object.prototype.hasOwnProperty,so=Object.prototype.propertyIsEnumerable;var ro=(e,o,t)=>o in e?no(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))io.call(o,t)&&ro(e,t,o[t]);if(Pe)for(var t of Pe(o))so.call(o,t)&&ro(e,t,o[t]);return e},l=(e,o)=>ht(e,Pt(o));var Ct=(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 d=(e,o)=>{var t={};for(var r in e)io.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Pe)for(var r of Pe(e))o.indexOf(r)<0&&so.call(e,r)&&(t[r]=e[r]);return t};var z=(e,o)=>{for(var t in o)no(e,t,{get:o[t],enumerable:!0});};var D=(e,o,t)=>new Promise((r,n)=>{var s=c=>{try{p(t.next(c));}catch(u){n(u);}},a=c=>{try{p(t.throw(c));}catch(u){n(u);}},p=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);p((t=t.apply(e,o)).next());});var ao={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var lo={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var po={md:"10px",lg:"20px",round:"50%"};var f=e=>`var(--fr-colors-${e})`,co={neutral:{background:f("white"),border:f("gray800"),foreground:f("black"),surface:f("gray700"),active:{background:f("white"),border:f("gray900"),foreground:f("black"),surface:f("gray700")},focus:{background:f("white"),border:f("gray900"),foreground:f("black"),surface:f("gray700")},hover:{background:f("white"),border:f("gray900"),foreground:f("black"),surface:f("gray700")}},primary:{background:f("blue500"),border:f("blue500"),foreground:f("white"),surface:f("blue500"),active:{background:f("blue400"),border:f("blue400"),foreground:f("white"),surface:f("blue400")},focus:{background:f("blue500"),border:f("blue500"),foreground:f("white"),surface:f("blue500")},hover:{background:f("blue400"),border:f("blue400"),foreground:f("white"),surface:f("blue400")}},secondary:{background:f("white"),border:f("gray800"),foreground:f("black"),surface:f("gray900"),active:{background:f("gray900"),border:f("gray800"),foreground:f("black"),surface:f("gray800")},focus:{background:f("gray900"),border:f("gray800"),foreground:f("black"),surface:f("gray900")},hover:{background:f("gray900"),border:f("gray800"),foreground:f("black"),surface:f("gray800")}}};var uo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var St="px",Ft=e=>typeof e=="number"?`${4*e}${St}`:e,Tt=[-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"],mo=Object.fromEntries(Tt.map(e=>[e,Ft(e)]));var fo={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 Ie=l(i(l(i({},ao),{colors:i(i({},lo),co)}),fo),{radii:po,shadows:uo,space:mo});function fe(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let a=`${o.length?`${o}${t}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,fe(p,a,t)):r[a]=p,r},{})}function Me(e){return fe(e,"--fr","-")}function go(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]=go(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var He=Me(Ie),T=go(Ie);var Rt=new Set(["alt","size","src"]),Bt=wt.all.filter(e=>e.indexOf("-")!=0&&!Rt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),vt=Object.fromEntries(Bt),We=fe(T.colors),kt={color:We,backgroundColor:We,borderColor:We,border:T.borders,borderRadius:T.radii,borderWidth:T.borderWidths,boxShadow:T.shadows,fontFamily:T.fontFamilies,fontSize:T.fontSizes,fontWeight:T.fontWeights,gap:T.space,lineHeight:T.lineHeights,margin:T.space,marginBottom:T.space,marginLeft:T.space,marginRight:T.space,marginTop:T.space,padding:T.space,paddingBottom:T.space,paddingLeft:T.space,paddingRight:T.space,paddingTop:T.space},xo=i(i({},vt),kt),yo={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"]},bo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Dt(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 ho=new Map(Object.entries(xo).map(([e,o])=>[e,Dt(o)])),Et=new Map(Object.entries(yo).map(([e,o])=>[e,new Set(o)])),Ot=new Set(["height","width"]),It=new Set(["canvas","embed","iframe","img","input","object","video"]);function Po(e){let[o,t]=e.split(":");return [o,bo.has(t)?t:null]}function Co(e,o="div"){let t=Object.assign({},e),r={};function n(s){if(s==null)return r;let p=`&:${s.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(t).forEach(([s,a])=>{let[p,c]=Po(s),u=Et.get(p);u!=null&&(u.forEach(g=>{let h=`${g}${c?":"+c:""}`;t[h]=a;}),delete t[s]);}),Object.entries(t).forEach(([s,a])=>{let[p,c]=Po(s),u=ho.get(p);if(u!=null&&a!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let g=a.split(" ");n(c)[p]=g.map(h=>{var y;return (y=u.get(h.toString()))!=null?y:h}).join(" ");}else u.has(a.toString())?n(c)[p]=u.get(a.toString()):n(c)[p]=a;(typeof o!="string"||!It.has(o)||!Ot.has(p))&&delete t[s];}}),Object.keys(t).forEach(s=>{let a=s.substring(1);s.indexOf("_")===0&&ho.has(a)&&(t[a]=t[s],delete t[s]);}),{cssFromProps:r,unmatchedProps:t}}function Ht(){if(typeof window=="undefined"){let{JSDOM:e}=Ct("jsdom");return new e("<!DOCTYPE html>").window}return window}function So(e){return e?{__html:Mt(Ht()).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"]})}:{__html:""}}function At(e){return e&&`fr-${e}`}function wo(e){return e&&(Array.isArray(e)?e.map(o=>wo(o)).join(" "):At(e))}function Lt(p,a){var c=p,{as:e,children:o,className:t,css:r={},part:n}=c,s=d(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:h}=Co(s,u),y=wo(n),S=t||y?clsx(t,y):void 0,P=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsx(u,l(i({className:S,css:P},h),{ref:a,dangerouslySetInnerHTML:So(o)})):jsx(u,l(i({className:S,css:P},h),{ref:a,children:o}))}var m=Ve.forwardRef(Lt);var w={};z(w,{Link:()=>cr,Plain:()=>ur,Primary:()=>pr,Secondary:()=>dr});var C={};z(C,{Body1:()=>or,Body2:()=>tr,Caption:()=>rr,Display1:()=>Jt,Display2:()=>qt,H1:()=>Yt,H2:()=>Qt,H3:()=>Zt,H4:()=>er});var Ae={};z(Ae,{Body1:()=>Kt,Body2:()=>Ut,Caption:()=>Gt,Display1:()=>Vt,Display2:()=>$t,H1:()=>Nt,H2:()=>_t,H3:()=>zt,H4:()=>jt});var j={color:"neutral.foreground",fontFamily:"default",margin:"0"},Vt=l(i({},j),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),$t=l(i({},j),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Nt=l(i({},j),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),_t=l(i({},j),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),zt=l(i({},j),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),jt=l(i({},j),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Kt=l(i({},j),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Ut=l(i({},j),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Gt=l(i({},j),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Xt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],K=Object.fromEntries(Xt.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Ve.forwardRef((p,a)=>{var c=p,{as:r=o,children:n}=c,s=d(c,["as","children"]);return jsx(m,l(i(i({as:r},Ae[e]),s),{ref:a,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Jt=K.Display1,qt=K.Display2,Yt=K.H1,Qt=K.H2,Zt=K.H3,er=K.H4,or=K.Body1,tr=K.Body2,rr=K.Caption;var Le={};z(Le,{Link:()=>ar,Plain:()=>lr,Primary:()=>ir,Secondary:()=>sr});var Ce={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},ir=l(i({},Ce),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),sr=l(i({},Ce),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),ar=l(i({},Ce),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),lr=l(i({},Ce),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function Se(a){var p=a,{as:e,children:o,part:t,title:r,variant:n="Primary"}=p,s=d(p,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxs(m,l(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Le[n]),s),{children:[o,r&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function pr(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Se,l(i({},o),{variant:"Primary",children:e}))}function dr(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Se,l(i({},o),{variant:"Secondary",children:e}))}function cr(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Se,l(i({},o),{variant:"Link",children:e}))}function ur(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Se,l(i({},o),{variant:"Plain",children:e}))}var b={};z(b,{Column:()=>gr,Row:()=>fr});var fr=Ve.forwardRef((e,o)=>jsx(m,l(i({display:"flex",flexDirection:"row"},e),{ref:o}))),gr=Ve.forwardRef((e,o)=>jsx(m,l(i({display:"flex",flexDirection:"column"},e),{ref:o})));var E=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function ko(n){var s=n,{children:e,navigate:o,theme:t}=s,r=d(s,["children","navigate","theme"]);let a=t?Me(t):{},[p,c]=useState(new Set),u=useMemo(()=>new 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]),g=o!=null?o:(y,S="_self")=>{window.open(y,S);};useEffect(()=>()=>{u.destroy();},[]);let h=p.size>0?p.values().next().value:null;return jsxs(E.Provider,{value:l(i({modals:p,setModals:c,currentModal:h,navigate:g},r),{frigade:u}),children:[jsx(Global,{styles:{":root":i(i({},He),a)}}),jsx(ThemeProvider,{theme:T,children:e})]})}function ee(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:s}=useContext(E),a=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 useEffect(()=>(D(this,null,function*(){let p=yield s.getFlow(e);if(!p||s.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),r(p);}),s.onStateChange(a),()=>{s.removeStateChangeHandler(a);}),[a]),useEffect(()=>{!(o!=null&&o.variables)||!t||a(t);},[o==null?void 0:o.variables]),{flow:t}}function oe(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&D(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:useCallback(n=>D(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function te(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(E);return {handlePrimary:useCallback((n,s)=>D(this,null,function*(){return (yield o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(e.complete(s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget),!0)}),[e]),handleSecondary:useCallback((n,s)=>D(this,null,function*(){return (yield t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0)}),[e])}}function xe(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(E),[s,a]=useState(!1);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]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==s&&a(c);},[e==null?void 0:e.id,t]);function p(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:s||!o,removeModal:p}}function N(y){var S=y,{as:e,children:o,container:t,dismissible:r=!1,flowId:n,onComplete:s,onDismiss:a,onPrimary:p,onSecondary:c,variables:u,forceMount:g}=S,h=d(S,["as","children","container","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let{flow:P}=ee(n,{variables:u}),F=P==null?void 0:P.getCurrentStep(),{handleDismiss:O}=oe(P,{onComplete:s,onDismiss:a}),{handlePrimary:$,handleSecondary:G}=te(F,{onPrimary:p,onSecondary:c}),Y=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:ce,removeModal:De}=xe(P,Y);if(useEffect(()=>{!(P!=null&&P.isVisible)&&ce&&De();},[P==null?void 0:P.isVisible,ce]),P==null||!ce)return null;let Ee=g&&P.isCompleted;if(!P.isVisible&&!Ee)return null;!P.isCompleted&&!P.isSkipped&&F.start();let Oe=e===null?Fragment$1:e!=null?e:m;return jsx(Oe,l(i({},e===null?{}:h),{children:o({flow:P,handleDismiss:O,handlePrimary:$,handleSecondary:G,parentProps:i({container:t,dismissible:r,flowId:n,variables:u},h),step:F})}))}function Mo(e){return jsx(N,l(i({as:x,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:s})=>jsxs(Fragment,{children:[jsxs(b.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(x.Title,{children:s.title}),n&&jsx(x.Dismiss,{onClick:o}),jsx(x.Subtitle,{flexBasis:"100%",children:s.subtitle})]}),jsx(x.Media,{src:s.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(b.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(x.Secondary,{title:s.secondaryButtonTitle,onClick:r}),jsx(x.Primary,{title:s.primaryButtonTitle,onClick:t})]})]})}))}function Ne(r){var n=r,{part:e,src:o}=n,t=d(n,["part","src"]);return jsx(m,i({as:"img",part:["image",e],src:o},t))}function Ar(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 _e(r){var n=r,{part:e,src:o}=n,t=d(n,["part","src"]);let s=Ar(o);return s?jsx(m,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:s},t)):o!=null&&o.endsWith(".mp4")?jsx(m,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 ne(r){var n=r,{src:e,type:o}=n,t=d(n,["src","type"]);return jsx(o==="video"?_e:Ne,i({src:e},t))}var x=Ve.forwardRef((n,r)=>{var s=n,{children:e,flowId:o}=s,t=d(s,["children","flowId"]);var p;if(o!=null)return jsx(Mo,i({flowId:o},t));let a=(p=t.as)!=null?p:b.Column;return jsx(a,l(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});x.Dismiss=e=>jsx(w.Plain,l(i({part:"dismiss",padding:0},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}));x.Media=t=>{var r=t,{src:e}=r,o=d(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ne,i({borderRadius:"md",src:e},o))};x.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(w.Primary,i({title:o,onClick:e},t))};x.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(w.Secondary,i({title:o,onClick:e},t))};x.Subtitle=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.Body2,l(i({display:"block",part:"subtitle"},o),{children:e}))};x.Title=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.H4,l(i({display:"block",part:"title"},o),{children:e}))};var Fe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Ao(e){let o=Object.fromEntries(Fe.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Fe.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Fe.content.some(s=>s===n)&&!Fe.root.some(s=>s===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}function R(n){var s=n,{children:e,className:o,modal:t=!0}=s,r=d(s,["children","className","modal"]);let{rootProps:a,contentProps:p,otherProps:g}=Ao(r),h=g,{zIndex:c}=h,u=d(h,["zIndex"]);return jsx(I.Root,l(i({defaultOpen:!0,modal:t},a),{children:jsx(I.Portal,{children:jsxs(m,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(I.Overlay,{asChild:!0,children:jsx(m,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(I.Content,l(i({asChild:!0,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault()},p),{children:jsx(x,l(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}R.Dismiss=e=>jsx(I.Close,{"aria-label":"Close",asChild:!0,children:jsx(w.Plain,l(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});R.Subtitle=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return jsx(I.Description,{asChild:!0,children:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))})};R.Media=t=>{var r=t,{src:e}=r,o=d(r,["src"]);return e==null?null:jsx(ne,i({borderRadius:"md",src:e},o))};R.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Primary,i({title:o,onClick:e},t))};R.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(m,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?T.colors.blue500:T.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(m,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};R.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Secondary,i({title:o,onClick:e},t))};R.Title=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return jsx(I.Title,{asChild:!0,children:jsx(C.H3,l(i({part:"title"},o),{children:e}))})};R.displayName="Dialog";function _r(t){var r=t,{flowId:e}=r,o=d(r,["flowId"]);return jsx(N,l(i({as:R,dismissible:!0,flowId:e,part:"announcement",textAlign:"center"},o),{children:({flow:n,handleDismiss:s,handlePrimary:a,handleSecondary:p,parentProps:{dismissible:c},step:u})=>{var h,y,S;let g=(h=u.props)!=null?h:{};return jsxs(b.Column,l(i({gap:5,part:"announcement-step"},g),{children:[c&&jsx(R.Dismiss,{onClick:s}),jsxs(b.Column,{gap:1,part:"announcement-header",children:[jsx(R.Title,{children:u.title}),jsx(R.Subtitle,{children:u.subtitle})]}),jsx(R.Media,{src:(y=u.videoUri)!=null?y:u.imageUri,type:u.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(R.ProgressDots,{current:n.getNumberOfCompletedSteps(),total:n.getNumberOfAvailableSteps()}),jsxs(b.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[u.secondaryButtonTitle&&jsx(R.Secondary,{onClick:p,title:u.secondaryButtonTitle}),u.primaryButtonTitle&&jsx(R.Primary,{onClick:a,title:(S=u.primaryButtonTitle)!=null?S:"Continue"})]})]}))}}))}function zr(t){var r=t,{flowId:e}=r,o=d(r,["flowId"]);return jsx(N,{as:null,flowId:e,children:({handleDismiss:n,handlePrimary:s,handleSecondary:a,step:p})=>{var u;let c=(u=p.props)!=null?u:{};return jsxs(x,l(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},o),c),{children:[p.imageUri&&jsx(m,{as:"img",part:"image",src:p.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(b.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(x.Title,{part:"title",children:p.title}),jsx(x.Subtitle,{part:"subtitle",children:p.subtitle})]}),jsx(x.Secondary,{title:p.secondaryButtonTitle,onClick:a}),jsx(x.Primary,{title:p.primaryButtonTitle,onClick:s}),o.dismissible&&jsx(x.Dismiss,{onClick:n})]}))}})}var Xe={};z(Xe,{Collapsible:()=>Go,CollapsibleStep:()=>ye});var ye={};z(ye,{Content:()=>Ke,Root:()=>Ue,Trigger:()=>Ge});var Kr=keyframes`
20
+ var ro=Object.defineProperty,Pt=Object.defineProperties;var Ct=Object.getOwnPropertyDescriptors;var he=Object.getOwnPropertySymbols;var no=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable;var to=(e,o,t)=>o in e?ro(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))no.call(o,t)&&to(e,t,o[t]);if(he)for(var t of he(o))io.call(o,t)&&to(e,t,o[t]);return e},l=(e,o)=>Pt(e,Ct(o));var St=(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 d=(e,o)=>{var t={};for(var r in e)no.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&he)for(var r of he(e))o.indexOf(r)<0&&io.call(e,r)&&(t[r]=e[r]);return t};var j=(e,o)=>{for(var t in o)ro(e,t,{get:o[t],enumerable:!0});};var D=(e,o,t)=>new Promise((r,n)=>{var s=c=>{try{p(t.next(c));}catch(m){n(m);}},a=c=>{try{p(t.throw(c));}catch(m){n(m);}},p=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);p((t=t.apply(e,o)).next());});var so={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var ao={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var lo={md:"10px",lg:"20px",round:"50%"};var f=e=>`var(--fr-colors-${e})`,po={neutral:{background:f("white"),border:f("gray800"),foreground:f("black"),surface:f("gray700"),active:{background:f("white"),border:f("gray900"),foreground:f("black"),surface:f("gray700")},focus:{background:f("white"),border:f("gray900"),foreground:f("black"),surface:f("gray700")},hover:{background:f("white"),border:f("gray900"),foreground:f("black"),surface:f("gray700")}},primary:{background:f("blue500"),border:f("blue500"),foreground:f("white"),surface:f("blue500"),active:{background:f("blue400"),border:f("blue400"),foreground:f("white"),surface:f("blue400")},focus:{background:f("blue500"),border:f("blue500"),foreground:f("white"),surface:f("blue500")},hover:{background:f("blue400"),border:f("blue400"),foreground:f("white"),surface:f("blue400")}},secondary:{background:f("white"),border:f("gray800"),foreground:f("black"),surface:f("gray900"),active:{background:f("gray900"),border:f("gray800"),foreground:f("black"),surface:f("gray800")},focus:{background:f("gray900"),border:f("gray800"),foreground:f("black"),surface:f("gray900")},hover:{background:f("gray900"),border:f("gray800"),foreground:f("black"),surface:f("gray800")}}};var co={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ft="px",Tt=e=>typeof e=="number"?`${4*e}${Ft}`:e,wt=[-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"],mo=Object.fromEntries(wt.map(e=>[e,Tt(e)]));var uo={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 Oe=l(i(l(i({},so),{colors:i(i({},ao),po)}),uo),{radii:lo,shadows:co,space:mo});function ue(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let a=`${o.length?`${o}${t}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,ue(p,a,t)):r[a]=p,r},{})}function Ie(e){return ue(e,"--fr","-")}function fo(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]=fo(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var Me=Ie(Oe),F=fo(Oe);var Bt=new Set(["alt","size","src"]),vt=Rt.all.filter(e=>e.indexOf("-")!=0&&!Bt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),kt=Object.fromEntries(vt),He=ue(F.colors),Dt={color:He,backgroundColor:He,borderColor:He,border:F.borders,borderRadius:F.radii,borderWidth:F.borderWidths,boxShadow:F.shadows,fontFamily:F.fontFamilies,fontSize:F.fontSizes,fontWeight:F.fontWeights,gap:F.space,lineHeight:F.lineHeights,margin:F.space,marginBottom:F.space,marginLeft:F.space,marginRight:F.space,marginTop:F.space,padding:F.space,paddingBottom:F.space,paddingLeft:F.space,paddingRight:F.space,paddingTop:F.space},go=i(i({},kt),Dt),xo={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"]},yo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Et(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 bo=new Map(Object.entries(go).map(([e,o])=>[e,Et(o)])),Ot=new Map(Object.entries(xo).map(([e,o])=>[e,new Set(o)])),It=new Set(["height","width"]),Mt=new Set(["canvas","embed","iframe","img","input","object","video"]);function ho(e){let[o,t]=e.split(":");return [o,yo.has(t)?t:null]}function Po(e,o="div"){let t=Object.assign({},e),r={};function n(s){if(s==null)return r;let p=`&:${s.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(t).forEach(([s,a])=>{let[p,c]=ho(s),m=Ot.get(p);m!=null&&(m.forEach(g=>{let x=`${g}${c?":"+c:""}`;t[x]=a;}),delete t[s]);}),Object.entries(t).forEach(([s,a])=>{let[p,c]=ho(s),m=bo.get(p);if(m!=null){if(a==null)delete t[s];else if(typeof a=="string"&&a.indexOf(" ")>-1){let g=a.split(" ");n(c)[p]=g.map(x=>{var b;return (b=m.get(x.toString()))!=null?b:x}).join(" ");}else m.has(a.toString())?n(c)[p]=m.get(a.toString()):n(c)[p]=a;(typeof o!="string"||!Mt.has(o)||!It.has(p))&&delete t[s];}}),Object.keys(t).forEach(s=>{let a=s.substring(1);s.indexOf("_")===0&&bo.has(a)&&(t[a]=t[s],delete t[s]);}),{cssFromProps:r,unmatchedProps:t}}function Wt(){if(typeof window=="undefined"){let{JSDOM:e}=St("jsdom");return new e("<!DOCTYPE html>").window}return window}function Co(e){return e?{__html:Ht(Wt()).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"]})}:{__html:""}}function Lt(e){return e&&`fr-${e}`}function To(e){return e&&(Array.isArray(e)?e.map(o=>To(o)).join(" "):Lt(e))}function Vt(p,a){var c=p,{as:e,children:o,className:t,css:r={},part:n}=c,s=d(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:g,unmatchedProps:x}=Po(s,m),b=To(n),y=t||b?clsx(t,b):void 0,T=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsx(m,l(i({className:y,css:T},x),{ref:a,dangerouslySetInnerHTML:Co(o)})):jsx(m,l(i({className:y,css:T},x),{ref:a,children:o}))}var u=Le.forwardRef(Vt);var w={};j(w,{Link:()=>mr,Plain:()=>ur,Primary:()=>dr,Secondary:()=>cr});var C={};j(C,{Body1:()=>tr,Body2:()=>rr,Caption:()=>nr,Display1:()=>qt,Display2:()=>Yt,H1:()=>Qt,H2:()=>Zt,H3:()=>er,H4:()=>or});var We={};j(We,{Body1:()=>Ut,Body2:()=>Gt,Caption:()=>Xt,Display1:()=>$t,Display2:()=>Nt,H1:()=>zt,H2:()=>_t,H3:()=>jt,H4:()=>Kt});var K={color:"neutral.foreground",fontFamily:"default",margin:"0"},$t=l(i({},K),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Nt=l(i({},K),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),zt=l(i({},K),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),_t=l(i({},K),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),jt=l(i({},K),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Kt=l(i({},K),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Ut=l(i({},K),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Gt=l(i({},K),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Xt=l(i({},K),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Jt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],U=Object.fromEntries(Jt.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Le.forwardRef((p,a)=>{var c=p,{as:r=o,children:n}=c,s=d(c,["as","children"]);return jsx(u,l(i(i({as:r},We[e]),s),{ref:a,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),qt=U.Display1,Yt=U.Display2,Qt=U.H1,Zt=U.H2,er=U.H3,or=U.H4,tr=U.Body1,rr=U.Body2,nr=U.Caption;var Ae={};j(Ae,{Link:()=>lr,Plain:()=>pr,Primary:()=>sr,Secondary:()=>ar});var Pe={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},sr=l(i({},Pe),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),ar=l(i({},Pe),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),lr=l(i({},Pe),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),pr=l(i({},Pe),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function Ce(a){var p=a,{as:e,children:o,part:t,title:r,variant:n="Primary"}=p,s=d(p,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxs(u,l(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ae[n]),s),{children:[o,r&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function dr(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Ce,l(i({},o),{variant:"Primary",children:e}))}function cr(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Ce,l(i({},o),{variant:"Secondary",children:e}))}function mr(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Ce,l(i({},o),{variant:"Link",children:e}))}function ur(t){var r=t,{children:e}=r,o=d(r,["children"]);return jsx(Ce,l(i({},o),{variant:"Plain",children:e}))}var P={};j(P,{Column:()=>xr,Row:()=>gr});var gr=Le.forwardRef((e,o)=>jsx(u,l(i({display:"flex",flexDirection:"row"},e),{ref:o}))),xr=Le.forwardRef((e,o)=>jsx(u,l(i({display:"flex",flexDirection:"column"},e),{ref:o})));var O=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function vo(n){var s=n,{children:e,navigate:o,theme:t}=s,r=d(s,["children","navigate","theme"]);let a=t?Ie(t):{},[p,c]=useState(new Set),m=useMemo(()=>new 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]),g=o!=null?o:(b,y="_self")=>{window.open(b,y);};useEffect(()=>()=>{m.destroy();},[]);let x=p.size>0?p.values().next().value:null;return jsxs(O.Provider,{value:l(i({modals:p,setModals:c,currentModal:x,navigate:g},r),{frigade:m}),children:[jsx(Global,{styles:{":root":i(i({},Me),a)}}),jsx(ThemeProvider,{theme:F,children:e})]})}function ee(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:s}=useContext(O),a=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 useEffect(()=>(D(this,null,function*(){let p=yield s.getFlow(e);if(!p||s.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),r(p);}),s.onStateChange(a),()=>{s.removeStateChangeHandler(a);}),[a]),useEffect(()=>{!(o!=null&&o.variables)||!t||a(t);},[o==null?void 0:o.variables]),{flow:t}}function oe(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&D(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:useCallback(n=>D(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function te(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(O);return {handlePrimary:useCallback((n,s)=>D(this,null,function*(){return (yield o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(e.complete(s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget),!0)}),[e]),handleSecondary:useCallback((n,s)=>D(this,null,function*(){return (yield t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0)}),[e])}}function ge(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(O),[s,a]=useState(!1);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]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==s&&a(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:s||!o,removeModal:p}}function N(x){var b=x,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:s,onPrimary:a,onSecondary:p,variables:c,forceMount:m}=b,g=d(b,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let{flow:y}=ee(r,{variables:c}),T=y==null?void 0:y.getCurrentStep(),{handleDismiss:S}=oe(y,{onComplete:n,onDismiss:s}),{handlePrimary:B,handleSecondary:$}=te(T,{onPrimary:a,onSecondary:p}),J=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:_,removeModal:ke}=ge(y,J);if(useEffect(()=>{!(y!=null&&y.isVisible)&&_&&ke();},[y==null?void 0:y.isVisible,_]),y==null||!_)return null;let De=m&&y.isCompleted;if(!y.isVisible&&!De)return null;!y.isCompleted&&!y.isSkipped&&T.start();let Ee=e===null?Fragment$1:e!=null?e:u;return jsx(Ee,l(i({},e===null?{}:g),{children:o({flow:y,handleDismiss:S,handlePrimary:B,handleSecondary:$,parentProps:i({dismissible:t,flowId:r,variables:c},g),step:T})}))}function Io(e){return jsx(N,l(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:s})=>jsxs(Fragment,{children:[jsxs(P.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(h.Title,{children:s.title}),n&&jsx(h.Dismiss,{onClick:o}),jsx(h.Subtitle,{flexBasis:"100%",children:s.subtitle})]}),jsx(h.Media,{src:s.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:s.secondaryButtonTitle,onClick:r}),jsx(h.Primary,{title:s.primaryButtonTitle,onClick:t})]})]})}))}function $e(r){var n=r,{part:e,src:o}=n,t=d(n,["part","src"]);return jsx(u,i({as:"img",part:["image",e],src:o},t))}function Lr(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 Ne(r){var n=r,{part:e,src:o}=n,t=d(n,["part","src"]);let s=Lr(o);return s?jsx(u,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:s},t)):o!=null&&o.endsWith(".mp4")?jsx(u,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 ne(r){var n=r,{src:e,type:o}=n,t=d(n,["src","type"]);return jsx(o==="video"?Ne:$e,i({src:e},t))}var h=Le.forwardRef((n,r)=>{var s=n,{children:e,flowId:o}=s,t=d(s,["children","flowId"]);var p;if(o!=null)return jsx(Io,i({flowId:o},t));let a=(p=t.as)!=null?p:P.Column;return jsx(a,l(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=>jsx(w.Plain,l(i({part:"dismiss",padding:0},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}));h.Media=t=>{var r=t,{src:e}=r,o=d(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ne,i({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(w.Primary,i({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(w.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.Body2,l(i({display:"block",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.H4,l(i({display:"block",part:"title"},o),{children:e}))};var Se={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Wo(e){let o=Object.fromEntries(Se.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Se.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Se.content.some(s=>s===n)&&!Se.root.some(s=>s===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}function R(n){var s=n,{children:e,className:o,modal:t=!0}=s,r=d(s,["children","className","modal"]);let{rootProps:a,contentProps:p,otherProps:g}=Wo(r),x=g,{zIndex:c}=x,m=d(x,["zIndex"]);return jsx(I.Root,l(i({defaultOpen:!0,modal:t},a),{children:jsx(I.Portal,{children:jsxs(u,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(I.Overlay,{asChild:!0,children:jsx(u,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(I.Content,l(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},p),{children:jsx(h,l(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}R.Dismiss=e=>jsx(I.Close,{"aria-label":"Close",asChild:!0,children:jsx(w.Plain,l(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});R.Subtitle=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return jsx(I.Description,{asChild:!0,children:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))})};R.Media=t=>{var r=t,{src:e}=r,o=d(r,["src"]);return e==null?null:jsx(ne,i({borderRadius:"md",src:e},o))};R.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Primary,i({title:o,onClick:e},t))};R.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(u,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?F.colors.blue500:F.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(u,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};R.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Secondary,i({title:o,onClick:e},t))};R.Title=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return jsx(I.Title,{asChild:!0,children:jsx(C.H3,l(i({part:"title"},o),{children:e}))})};R.displayName="Dialog";var Ao=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function _r(t){var r=t,{flowId:e}=r,o=d(r,["flowId"]);let n=Object.fromEntries(Object.entries(o).filter(([a])=>Ao.some(p=>a===p))),s=Object.fromEntries(Object.entries(o).filter(([a])=>Ao.indexOf(a)===-1));return jsx(N,l(i({as:null,flowId:e},n),{children:({flow:a,handleDismiss:p,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:g},step:x})=>{var y,T,S;let b=(y=x.props)!=null?y:{};return jsx(R,l(i({part:"announcement",textAlign:"center"},s),{onEscapeKeyDown:B=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(B),B.defaultPrevented||p(B);},children:jsxs(P.Column,l(i({gap:5,part:"announcement-step"},b),{children:[g&&jsx(R.Dismiss,{onClick:p}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(R.Title,{children:x.title}),jsx(R.Subtitle,{children:x.subtitle})]}),jsx(R.Media,{src:(T=x.videoUri)!=null?T:x.imageUri,type:x.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(R.ProgressDots,{current:a.getNumberOfCompletedSteps(),total:a.getNumberOfAvailableSteps()}),jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[x.secondaryButtonTitle&&jsx(R.Secondary,{onClick:m,title:x.secondaryButtonTitle}),x.primaryButtonTitle&&jsx(R.Primary,{onClick:c,title:(S=x.primaryButtonTitle)!=null?S:"Continue"})]})]}))}))}}))}function jr(t){var r=t,{flowId:e}=r,o=d(r,["flowId"]);return jsx(N,{as:null,flowId:e,children:({handleDismiss:n,handlePrimary:s,handleSecondary:a,step:p})=>{var m;let c=(m=p.props)!=null?m:{};return jsxs(h,l(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},o),c),{children:[p.imageUri&&jsx(u,{as:"img",part:"image",src:p.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:p.title}),jsx(h.Subtitle,{part:"subtitle",children:p.subtitle})]}),jsx(h.Secondary,{title:p.secondaryButtonTitle,onClick:a}),jsx(h.Primary,{title:p.primaryButtonTitle,onClick:s}),o.dismissible&&jsx(h.Dismiss,{onClick:n})]}))}})}var Ge={};j(Ge,{Collapsible:()=>Go,CollapsibleStep:()=>xe});var xe={};j(xe,{Content:()=>je,Root:()=>Ke,Trigger:()=>Ue});var Ur=keyframes`
21
21
  from {
22
22
  height: 0;
23
23
  opacity: 0;
@@ -26,7 +26,7 @@ var no=Object.defineProperty,ht=Object.defineProperties;var Pt=Object.getOwnProp
26
26
  height: var(--radix-collapsible-content-height);
27
27
  opacity: 1;
28
28
  }
29
- `,Ur=keyframes`
29
+ `,Gr=keyframes`
30
30
  from {
31
31
  height: var(--radix-collapsible-content-height);
32
32
  opacity: 1;
@@ -35,8 +35,8 @@ var no=Object.defineProperty,ht=Object.defineProperties;var Pt=Object.getOwnProp
35
35
  height: 0;
36
36
  opacity: 0;
37
37
  }
38
- `,Gr=()=>jsx(m,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Xr({checked:e=!1}){return jsx(m,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(m,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Gr,{})})})}function Ke({children:e}){return jsx(pe.Content,{asChild:!0,children:jsxs(b.Column,{css:{'&[data-state="open"]':{animation:`${Kr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Ur} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(m,{}),e]})})}function Ue(s){var a=s,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=a,n=d(a,["children","disabled","onOpenChange","open"]);return jsx(pe.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(x,l(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Ge({isCompleted:e,title:o}){return jsx(pe.Trigger,{asChild:!0,children:jsxs(b.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxs(b.Row,{alignItems:"center",gap:2,children:[jsx(Xr,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsx(m,{as:ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var we={};z(we,{Bar:()=>Te,Dots:()=>_o,Segments:()=>jo});function Te(r){var n=r,{current:e,total:o}=n,t=d(n,["current","total"]);let s=o>0?Math.min(e/o,1):0,a=s===0?"10px":`${100*s}%`;return jsx(m,l(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(m,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:a},transition:"width 300ms ease-out"})}))}function _o(r){var n=r,{current:e,total:o}=n,t=d(n,["current","total"]);if(o==1)return null;let s=[...Array(o)].map((a,p)=>jsx(m,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?T.colors.blue500:T.colors.blue800},p));return jsx(m,l(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:s}))}function jo(r){var n=r,{current:e,total:o}=n,t=d(n,["current","total"]);let s=[...Array(o)].map((a,p)=>jsx(m,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(b.Row,l(i({gap:1,height:"10px"},t),{children:s}))}var Ko=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Uo({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var y,S;let{isBlocked:s,isCompleted:a,primaryButtonTitle:p,secondaryButtonTitle:c,subtitle:u,title:g}=n,h=(y=n.props)!=null?y:{};return jsxs(Ue,l(i({open:t,onOpenChange:r},h),{children:[jsx(Ge,{isCompleted:a,title:g}),jsxs(Ke,{children:[jsx(x.Media,{aspectRatio:2.5,objectFit:"cover",src:(S=n.videoUri)!=null?S:n.imageUri,type:n.videoUri?"video":"image"}),jsx(x.Subtitle,{color:"gray500",children:u}),jsxs(b.Row,{gap:3,children:[jsx(x.Secondary,{disabled:!!(a||s),title:c,onClick:o}),jsx(x.Primary,{disabled:!!(a||s),title:p,onClick:e})]})]})]}))}var Qr={default:Uo};function Zr(r){var n=r,{flow:e,step:o}=n,t=d(n,["flow","step"]);var F;let{onPrimary:s,onSecondary:a,openStepId:p,setOpenStepId:c,stepTypes:u}=useContext(Ko),{handlePrimary:g,handleSecondary:h}=te(o,{onPrimary:s,onSecondary:a}),y=(p!=null?p:e.getCurrentStep().id)===o.id,S=(F=u[o.type])!=null?F:Uo;function P(O){return D(this,null,function*(){c(O?o.id:""),O&&!o.isCompleted&&(yield o.start());})}return jsx(S,l(i({flow:e,onOpenChange:P,open:y,step:o},t),{handlePrimary:g,handleSecondary:h}),o.id)}function Go(a){var p=a,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=p,s=d(p,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,u]=useState(null),g=i(i({},Qr),n);return jsx(Ko.Provider,{value:{openStepId:c,setOpenStepId:u,onPrimary:t,onSecondary:r,stepTypes:g},children:jsx(N,l(i({as:x,borderWidth:"md",flowId:o,part:"checklist"},s),{children:P=>{var F=P,{flow:h,handleDismiss:y}=F,S=d(F,["flow","handleDismiss"]);let O=Array.from(h.steps.entries()).map(([,Y])=>jsx(Zr,l(i({flow:h,handleDismiss:y},S),{step:Y}),Y.id)),$=h.getNumberOfCompletedSteps(),G=h.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(b.Column,{gap:2,children:[jsxs(b.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsx(x.Title,{children:h.title}),e&&jsx(x.Dismiss,{onClick:y}),jsx(x.Subtitle,{color:"gray500",flexBasis:"100%",children:h.subtitle})]}),jsxs(b.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[$,"/",G]}),jsx(Te,{current:$,total:G,flexGrow:1})]})]}),O]})}}))})}var rn=new Set(["required","min","max","minLength","maxLength","pattern"]);function nn({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(([a])=>rn.has(a))),s=useController({name:t.id,control:o,rules:n});return jsx(e,l(i({},s),{fieldData:t,submit:r}))}function Xo({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:s}){var y,S,P;let{control:a,handleSubmit:p}=useForm({delayError:2e3,mode:"onChange"}),c=[],u=(y=s.props)!=null?y:{};function g(F,O){t(O,F);}function h(F,O){r(O,F);}return (S=s.fields)==null||S.forEach(F=>{e[F.type]!=null&&c.push(jsx(nn,{control:a,fieldComponent:e[F.type],fieldData:F,submit:p(g)},F.id));}),jsxs(b.Column,l(i({gap:5,part:"form-step"},u),{children:[jsxs(b.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsx(x.Title,{children:s.title}),n&&jsx(x.Dismiss,{onClick:o}),jsx(x.Subtitle,{flexBasis:"100%",children:s.subtitle})]}),c,jsxs(b.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[s.secondaryButtonTitle&&jsx(w.Secondary,{title:s.secondaryButtonTitle,onClick:p(h)}),jsx(w.Primary,{title:(P=s.primaryButtonTitle)!=null?P:"Submit",onClick:p(g)})]},"form-footer")]}))}function Jo({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(C.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function qo({children:e,id:o,required:t=!1}){return jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var be={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function q({children:e,field:o,fieldData:t,fieldState:r}){var u;let{id:n,label:s,placeholder:a}=t,{error:p}=r,c=l(i(i(i({id:n},o),a?{placeholder:a}:{}),be),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxs(m,{part:"field",children:[jsx(qo,{id:n,required:!!t.required,children:s}),e(c),jsx(Jo,{error:p})]})}var pn=()=>jsx(m,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),dn=Ve.forwardRef(({label:e,value:o},t)=>jsxs(m,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(C.Body2,{part:"field-radio-label",children:e}),jsx(de.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(m,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(m,{as:de.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:jsx(pn,{})})})})]}));function et(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:s,value:a})=>jsx(dn,{value:a,label:s},a));return jsx(q,l(i({},e),{children:()=>jsx(de.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(b.Column,{gap:2,part:"field-radio-group",children:n})})}))}var mn=Ve.forwardRef(({label:e,value:o},t)=>jsx(v.Item,{value:o,ref:t,asChild:!0,children:jsx(m,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(v.ItemText,{asChild:!0,children:jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function rt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,s=r.map(({label:a,value:p})=>jsx(mn,{value:p,label:a},p));return jsx(q,l(i({},e),{children:()=>jsxs(v.Root,{value:t,onValueChange:o,children:[jsx(v.Trigger,{asChild:!0,children:jsxs(C.Body2,l(i({},be),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(v.Value,{placeholder:n!=null?n:"Select one"}),jsx(v.Icon,{children:jsx(m,{as:ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(v.Portal,{children:jsx(v.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(m,l(i({},be),{p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsx(v.Viewport,{children:s})}))})})]})}))}function it(e){return jsx(q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function at(e){return jsx(q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var fn={radio:et,select:rt,text:it,textarea:at};function qe(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=d(n,["fieldTypes","flowId"]);let s=Object.assign({},fn,e);return jsx(N,l(i({flowId:o,part:"form"},t),{children:a=>jsx(Xo,i({fieldTypes:s},a))}))}var Ye={};z(Ye,{NPS:()=>ct});function dt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let s=e.value===n?w.Primary:w.Secondary;return jsx(s,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxs(b.Column,{gap:2,children:[jsx(b.Row,{gap:2,justifyContent:"space-between",part:"field-nps",children:t}),jsxs(b.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(C.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsx(C.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function ct(n){var s=n,{as:e=R,flowId:o,fieldTypes:t}=s,r=d(s,["as","flowId","fieldTypes"]);let{flow:a}=ee(o);return jsx(qe,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:dt},t),minWidth:"620px",modal:!1,width:"620px",css:l(i({},!a||a.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px"},".fr-form-step":{gap:"1"}})},r))}function Be(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[r,n]=useState(null),s=useCallback(a=>{n(a);},[]);return useLayoutEffect(()=>{if(!r)return;let a=()=>{let p=r.getBoundingClientRect();t(p);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[r]),{node:r,rect:o,ref:s}}var hn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ft(r){var n=r,{style:e={},part:o=""}=n,t=d(n,["style","part"]);return jsxs(m,l(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(m,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${hn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(m,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function gt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},s=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},a="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=a;let c=s();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=a:n.bottom=a:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=a:n.top=a:["top","bottom"].includes(r)?n.left=`calc(50% + ${a})`:n.top=`calc(50% + ${a})`,n}var ve={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function xt(e,o){var s,a,p,c,u;let t=Object.fromEntries(ve.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(ve.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!ve.content.includes(g)&&!ve.root.includes(g)&&(n[g]=e[g]);if(t.align=(s=t.align)!=null?s:"after",t.side=(a=t.side)!=null?a:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},h=($,G)=>["top","bottom"].includes(G)?$=="after"?"marginLeft":"marginRight":$=="after"?"marginTop":"marginBottom",y=(p=t.alignOffset)!=null?p:0,S=(c=t.style)!=null?c:{},P=(u=t.side)!=null?u:"bottom",F=t.align;t.style=l(i({},S),{[h(F,P)]:y});let O=["top","bottom"].includes(P)?o.width:o.height;t.alignOffset=(O+y)*-1,t.align=g[F];}return {contentProps:t,otherProps:n,rootProps:r}}function k(a){var p=a,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=p,s=d(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=Be(),{node:h,rect:y,ref:S}=Be(),{contentProps:P,otherProps:F,rootProps:O}=xt(s,u),[$,G]=useState(P.align),[Y,ce]=useState(P.side),[De,Ee]=useState(0),[Oe,oo]=useState(0);if(c!==null){let L=c.getAttribute("data-align"),Q=c.getAttribute("data-side");$!==L&&G(L),Y!==Q&&ce(Q);}let he=useRef(null);if(useEffect(()=>{let L=document.querySelector(e);L!=null?(S(L),he.current=L):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function L(ue){if(ue.matches(e))return ue;let le=ue.querySelectorAll(e);return le.length>0?le[0]:null}let Q=new MutationObserver(ue=>{for(let le of ue)if(le.type==="childList"){for(let me of le.addedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let Z=L(me);if(Z!=null){S(Z),he.current=Z,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",Z);break}}for(let me of le.removedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let Z=L(me);if(Z!=null){S(null),he.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",Z);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),useEffect(()=>{let{scrollX:L,scrollY:Q}=window;Ee(y.left+L),oo(y.top+Q);},[y.left,y.top]),h==null)return null;let to="0";typeof window!="undefined"&&(to=window.getComputedStyle(h).borderRadius);let bt=gt({props:s,alignAttr:$,sideAttr:Y});return jsxs(_.Root,l(i({defaultOpen:!0},O),{children:[jsx(_.Anchor,{virtualRef:he}),jsx(_.Portal,{children:jsxs(Fragment,{children:[r&&jsx(m,i({boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:to,height:y.height,left:De,top:Oe,width:y.width}},s.zIndex!=null?{zIndex:s.zIndex}:{})),jsx(_.Content,l(i({asChild:!0},P),{ref:g,children:jsxs(x,l(i({boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},F),{children:[jsx(ft,{style:bt}),o]}))}))]})})]}))}k.Close=e=>jsx(_.Close,{"aria-label":"Close",asChild:!0,children:jsx(w.Plain,l(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});k.Media=t=>{var r=t,{src:e}=r,o=d(r,["src"]);return e==null?null:jsx(ne,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};k.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Primary,i({title:o,onClick:e},t))};k.Progress=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.H4,l(i({part:"progress"},o),{children:e}))};k.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Secondary,i({title:o,onClick:e},t))};k.Subtitle=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))};k.Title=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.H4,l(i({part:"title"},o),{children:e}))};function yt(p){var c=p,{dismissible:e=!0,flow:o,onDismiss:t,onPrimary:r,onSecondary:n,step:s}=c,a=d(c,["dismissible","flow","onDismiss","onPrimary","onSecondary","step"]);var S,P;let{handleDismiss:u}=oe(o,{onDismiss:t}),{handlePrimary:g,handleSecondary:h}=te(s,{onPrimary:r,onSecondary:n}),y=(S=s.props)!=null?S:{};return jsxs(k,l(i(i({anchor:s.selector,onOpenAutoFocus:F=>F.preventDefault(),onPointerDownOutside:F=>F.preventDefault(),onInteractOutside:F=>F.preventDefault()},a),y),{children:[e&&jsx(k.Close,{onClick:u}),jsx(k.Media,{src:(P=s.videoUri)!=null?P:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(b.Column,{gap:1,part:"tooltip-header",children:[jsx(k.Title,{children:s.title}),jsx(k.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxs(b.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsx(k.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(k.Secondary,{title:s.secondaryButtonTitle,onClick:h}),jsx(k.Primary,{title:s.primaryButtonTitle,onClick:g})]})]}),s.id)}function wn(n){var s=n,{flowId:e,onComplete:o,variables:t}=s,r=d(s,["flowId","onComplete","variables"]);let{flow:a}=ee(e,{variables:t});oe(a,{onComplete:o});let{isCurrentModal:p,removeModal:c}=xe(a);if(useEffect(()=>{!(a!=null&&a.isVisible)&&p&&c();},[a==null?void 0:a.isVisible,p]),a==null||a.isVisible===!1||!p)return null;let u=a.getCurrentStep();return u==null||u.start(),jsx(yt,i({step:u,flow:a},r))}function vn(){let{frigade:e}=useContext(E);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Dn(){let{userId:e,frigade:o}=useContext(E);function t(n){return D(this,null,function*(){yield o.identify(e,n);})}function r(n,s){return D(this,null,function*(){yield o.track(n,s);})}return {userId:e,addProperties:t,track:r}}function On(){let{groupId:e,frigade:o}=useContext(E);function t(n){return D(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,s){return D(this,null,function*(){yield o.track(n,s);})}return {groupId:e,addProperties:t,track:r}}
38
+ `,Xr=()=>jsx(u,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Jr({checked:e=!1}){return jsx(u,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(u,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Xr,{})})})}function je({children:e}){return jsx(pe.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${Ur} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Gr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(u,{}),e]})})}function Ke(s){var a=s,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=a,n=d(a,["children","disabled","onOpenChange","open"]);return jsx(pe.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(h,l(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Ue({isCompleted:e,title:o}){return jsx(pe.Trigger,{asChild:!0,children:jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxs(P.Row,{alignItems:"center",gap:2,children:[jsx(Jr,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsx(u,{as:ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Te={};j(Te,{Bar:()=>Fe,Dots:()=>zo,Segments:()=>jo});function Fe(r){var n=r,{current:e,total:o}=n,t=d(n,["current","total"]);let s=o>0?Math.min(e/o,1):0,a=s===0?"10px":`${100*s}%`;return jsx(u,l(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(u,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:a},transition:"width 300ms ease-out"})}))}function zo(r){var n=r,{current:e,total:o}=n,t=d(n,["current","total"]);if(o==1)return null;let s=[...Array(o)].map((a,p)=>jsx(u,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?F.colors.blue500:F.colors.blue800},p));return jsx(u,l(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:s}))}function jo(r){var n=r,{current:e,total:o}=n,t=d(n,["current","total"]);let s=[...Array(o)].map((a,p)=>jsx(u,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(P.Row,l(i({gap:1,height:"10px"},t),{children:s}))}var Ko=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Uo({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var b,y;let{isBlocked:s,isCompleted:a,primaryButtonTitle:p,secondaryButtonTitle:c,subtitle:m,title:g}=n,x=(b=n.props)!=null?b:{};return jsxs(Ke,l(i({open:t,onOpenChange:r},x),{children:[jsx(Ue,{isCompleted:a,title:g}),jsxs(je,{children:[jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(y=n.videoUri)!=null?y:n.imageUri,type:n.videoUri?"video":"image"}),jsx(h.Subtitle,{color:"gray500",children:m}),jsxs(P.Row,{gap:3,children:[jsx(h.Secondary,{disabled:!!(a||s),title:c,onClick:o}),jsx(h.Primary,{disabled:!!(a||s),title:p,onClick:e})]})]})]}))}var Zr={default:Uo};function en(r){var n=r,{flow:e,step:o}=n,t=d(n,["flow","step"]);var S;let{onPrimary:s,onSecondary:a,openStepId:p,setOpenStepId:c,stepTypes:m}=useContext(Ko),{handlePrimary:g,handleSecondary:x}=te(o,{onPrimary:s,onSecondary:a}),b=(p!=null?p:e.getCurrentStep().id)===o.id,y=(S=m[o.type])!=null?S:Uo;function T(B){return D(this,null,function*(){c(B?o.id:""),B&&!o.isCompleted&&(yield o.start());})}return jsx(y,l(i({flow:e,onOpenChange:T,open:b,step:o},t),{handlePrimary:g,handleSecondary:x}),o.id)}function Go(a){var p=a,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=p,s=d(p,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=useState(null),g=i(i({},Zr),n);return jsx(Ko.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:g},children:jsx(N,l(i({as:h,borderWidth:"md",flowId:o,part:"checklist"},s),{children:T=>{var S=T,{flow:x,handleDismiss:b}=S,y=d(S,["flow","handleDismiss"]);let B=Array.from(x.steps.entries()).map(([,_])=>jsx(en,l(i({flow:x,handleDismiss:b},y),{step:_}),_.id)),$=x.getNumberOfCompletedSteps(),J=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsxs(P.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsx(h.Title,{children:x.title}),e&&jsx(h.Dismiss,{onClick:b}),jsx(h.Subtitle,{color:"gray500",flexBasis:"100%",children:x.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[$,"/",J]}),jsx(Fe,{current:$,total:J,flexGrow:1})]})]}),B]})}}))})}var nn=new Set(["required","min","max","minLength","maxLength","pattern"]);function sn({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(([a])=>nn.has(a))),s=useController({name:t.id,control:o,rules:n});return jsx(e,l(i({},s),{fieldData:t,submit:r}))}function Xo({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:s}){var b,y,T;let{control:a,handleSubmit:p}=useForm({delayError:2e3,mode:"onChange"}),c=[],m=(b=s.props)!=null?b:{};function g(S,B){t(B,S);}function x(S,B){r(B,S);}return (y=s.fields)==null||y.forEach(S=>{e[S.type]!=null&&c.push(jsx(sn,{control:a,fieldComponent:e[S.type],fieldData:S,submit:p(g)},S.id));}),jsxs(P.Column,l(i({gap:5,part:"form-step"},m),{children:[jsxs(P.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsx(h.Title,{children:s.title}),n&&jsx(h.Dismiss,{onClick:o}),jsx(h.Subtitle,{flexBasis:"100%",children:s.subtitle})]}),c,jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[s.secondaryButtonTitle&&jsx(w.Secondary,{title:s.secondaryButtonTitle,onClick:p(x)}),jsx(w.Primary,{title:(T=s.primaryButtonTitle)!=null?T:"Submit",onClick:p(g)})]},"form-footer")]}))}function Jo({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function qo({children:e,id:o,required:t=!1}){return jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var ye={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function Y({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:s,placeholder:a}=t,{error:p}=r,c=l(i(i(i({id:n},o),a?{placeholder:a}:{}),ye),{"aria-invalid":!!p,value:(m=o.value)!=null?m:""});return jsxs(u,{part:"field",children:[jsx(qo,{id:n,required:!!t.required,children:s}),e(c),jsx(Jo,{error:p})]})}var dn=()=>jsx(u,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),cn=Le.forwardRef(({label:e,value:o},t)=>jsxs(u,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(C.Body2,{part:"field-radio-label",children:e}),jsx(de.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(u,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(u,{as:de.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:jsx(dn,{})})})})]}));function et(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:s,value:a})=>jsx(cn,{value:a,label:s},a));return jsx(Y,l(i({},e),{children:()=>jsx(de.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var fn=Le.forwardRef(({label:e,value:o},t)=>jsx(E.Item,{value:o,ref:t,asChild:!0,children:jsx(u,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(E.ItemText,{asChild:!0,children:jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function rt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,s=r.map(({label:a,value:p})=>jsx(fn,{value:p,label:a},p));return jsx(Y,l(i({},e),{children:()=>jsxs(E.Root,{value:t,onValueChange:o,children:[jsx(E.Trigger,{asChild:!0,children:jsxs(C.Body2,l(i({},ye),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(E.Value,{placeholder:n!=null?n:"Select one"}),jsx(E.Icon,{children:jsx(u,{as:ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(E.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(u,l(i({},ye),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(E.Viewport,{children:s})}))})]})}))}function it(e){return jsx(Y,l(i({},e),{children:o=>jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function at(e){return jsx(Y,l(i({},e),{children:o=>jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var gn={radio:et,select:rt,text:it,textarea:at};function Je(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=d(n,["fieldTypes","flowId"]);let s=Object.assign({},gn,e);return jsx(N,l(i({flowId:o,part:"form"},t),{children:a=>jsx(Xo,i({fieldTypes:s},a))}))}var qe={};j(qe,{NPS:()=>ct});function dt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let s=e.value===n?w.Primary:w.Secondary;return jsx(s,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxs(P.Column,{gap:2,children:[jsx(P.Row,{gap:2,justifyContent:"space-between",part:"field-nps",children:t}),jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(C.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsx(C.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function ct(n){var s=n,{as:e=R,flowId:o,fieldTypes:t}=s,r=d(s,["as","flowId","fieldTypes"]);let{flow:a}=ee(o);return jsx(Je,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:dt},t),minWidth:"620px",modal:!1,width:"620px",css:l(i({},!a||a.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px"},".fr-form-step":{gap:"1"}})},r))}function Re(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[r,n]=useState(null),s=useCallback(a=>{n(a);},[]);return useLayoutEffect(()=>{if(!r)return;let a=()=>{let p=r.getBoundingClientRect();t(p);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[r]),{node:r,rect:o,ref:s}}var Pn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ft(r){var n=r,{style:e={},part:o=""}=n,t=d(n,["style","part"]);return jsxs(u,l(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(u,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Pn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(u,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function gt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},s=()=>{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"},a="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=a;let c=s();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=a:n.bottom=a:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=a:n.top=a:["top","bottom"].includes(r)?n.left=`calc(50% + ${a})`:n.top=`calc(50% + ${a})`,n}var Be={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function xt(e,o){var s,a,p,c,m;let t=Object.fromEntries(Be.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(Be.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!Be.content.includes(g)&&!Be.root.includes(g)&&(n[g]=e[g]);if(t.align=(s=t.align)!=null?s:"after",t.side=(a=t.side)!=null?a:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},x=($,J)=>["top","bottom"].includes(J)?$=="after"?"marginLeft":"marginRight":$=="after"?"marginTop":"marginBottom",b=(p=t.alignOffset)!=null?p:0,y=(c=t.style)!=null?c:{},T=(m=t.side)!=null?m:"bottom",S=t.align;t.style=l(i({},y),{[x(S,T)]:b});let B=["top","bottom"].includes(T)?o.width:o.height;t.alignOffset=(B+b)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}function k(a){var p=a,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=p,s=d(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:g}=Re(),{node:x,rect:b,ref:y}=Re(),{contentProps:T,otherProps:S,rootProps:B}=xt(s,m),[$,J]=useState(T.align),[_,ke]=useState(T.side),[De,Ee]=useState(0),[eo,bt]=useState(0);if(c!==null){let L=c.getAttribute("data-align"),Q=c.getAttribute("data-side");$!==L&&J(L),_!==Q&&ke(Q);}let be=useRef(null);if(useEffect(()=>{let L=document.querySelector(e);L!=null?(y(L),be.current=L):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function L(ce){if(ce.matches(e))return ce;let le=ce.querySelectorAll(e);return le.length>0?le[0]:null}let Q=new MutationObserver(ce=>{for(let le of ce)if(le.type==="childList"){for(let me of le.addedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let Z=L(me);if(Z!=null){y(Z),be.current=Z,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",Z);break}}for(let me of le.removedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let Z=L(me);if(Z!=null){y(null),be.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",Z);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),useEffect(()=>{let{scrollX:L,scrollY:Q}=window;Ee(b.left+L),bt(b.top+Q);},[b.left,b.top]),x==null)return null;let oo="0";typeof window!="undefined"&&(oo=window.getComputedStyle(x).borderRadius);let ht=gt({props:s,alignAttr:$,sideAttr:_});return jsxs(z.Root,l(i({defaultOpen:!0},B),{children:[jsx(z.Anchor,{virtualRef:be}),jsx(z.Portal,{children:jsxs(Fragment,{children:[r&&jsx(u,i({boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:oo,height:b.height,left:De,top:eo,width:b.width}},s.zIndex!=null?{zIndex:s.zIndex}:{})),jsx(z.Content,l(i({asChild:!0},T),{ref:g,children:jsxs(h,l(i({boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},S),{children:[jsx(ft,{style:ht}),o]}))}))]})})]}))}k.Close=e=>jsx(z.Close,{"aria-label":"Close",asChild:!0,children:jsx(w.Plain,l(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});k.Media=t=>{var r=t,{src:e}=r,o=d(r,["src"]);return e==null?null:jsx(ne,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};k.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Primary,i({title:o,onClick:e},t))};k.Progress=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.H4,l(i({part:"progress"},o),{children:e}))};k.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=d(n,["onClick","title"]);return o==null?null:jsx(w.Secondary,i({title:o,onClick:e},t))};k.Subtitle=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))};k.Title=t=>{var r=t,{children:e}=r,o=d(r,["children"]);return e==null?null:jsx(C.H4,l(i({part:"title"},o),{children:e}))};function yt(p){var c=p,{dismissible:e=!0,flow:o,onDismiss:t,onPrimary:r,onSecondary:n,step:s}=c,a=d(c,["dismissible","flow","onDismiss","onPrimary","onSecondary","step"]);var y,T;let{handleDismiss:m}=oe(o,{onDismiss:t}),{handlePrimary:g,handleSecondary:x}=te(s,{onPrimary:r,onSecondary:n}),b=(y=s.props)!=null?y:{};return jsxs(k,l(i(i({anchor:s.selector,onOpenAutoFocus:S=>S.preventDefault(),onPointerDownOutside:S=>S.preventDefault(),onInteractOutside:S=>S.preventDefault()},a),b),{children:[e&&jsx(k.Close,{onClick:m}),jsx(k.Media,{src:(T=s.videoUri)!=null?T:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsx(k.Title,{children:s.title}),jsx(k.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsx(k.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(k.Secondary,{title:s.secondaryButtonTitle,onClick:x}),jsx(k.Primary,{title:s.primaryButtonTitle,onClick:g})]})]}),s.id)}function Rn(n){var s=n,{flowId:e,onComplete:o,variables:t}=s,r=d(s,["flowId","onComplete","variables"]);let{flow:a}=ee(e,{variables:t});oe(a,{onComplete:o});let{isCurrentModal:p,removeModal:c}=ge(a);if(useEffect(()=>{!(a!=null&&a.isVisible)&&p&&c();},[a==null?void 0:a.isVisible,p]),a==null||a.isVisible===!1||!p)return null;let m=a.getCurrentStep();return m==null||m.start(),jsx(yt,i({step:m,flow:a},r))}function kn(){let{frigade:e}=useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function En(){let{userId:e,frigade:o}=useContext(O);function t(n){return D(this,null,function*(){yield o.identify(e,n);})}function r(n,s){return D(this,null,function*(){yield o.track(n,s);})}return {userId:e,addProperties:t,track:r}}function In(){let{groupId:e,frigade:o}=useContext(O);function t(n){return D(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,s){return D(this,null,function*(){yield o.track(n,s);})}return {groupId:e,addProperties:t,track:r}}
39
39
 
40
- export { _r as Announcement, zr as Banner, m as Box, w as Button, x as Card, Xe as Checklist, R as Dialog, b as Flex, qe as Form, we as Progress, ko as Provider, Ye as Survey, C as Text, k as Tooltip, wn as Tour, He as themeVariables, Be as useBoundingClientRect, ee as useFlow, oe as useFlowHandlers, vn as useFrigade, On as useGroup, xe as useModal, te as useStepHandlers, Dn as useUser };
40
+ export { _r as Announcement, jr as Banner, u as Box, w as Button, h as Card, Ge as Checklist, R as Dialog, P as Flex, Je as Form, Te as Progress, vo as Provider, qe as Survey, C as Text, k as Tooltip, Rn as Tour, Me as themeVariables, Re as useBoundingClientRect, ee as useFlow, oe as useFlowHandlers, kn as useFrigade, In as useGroup, ge as useModal, te as useStepHandlers, En as useUser };
41
41
  //# sourceMappingURL=out.js.map
42
42
  //# sourceMappingURL=index.js.map