@frigade/react 2.0.12 → 2.0.13

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
@@ -3,7 +3,7 @@ import * as React$1 from 'react';
3
3
  import React__default, { CSSProperties, SyntheticEvent, ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
4
4
  import * as _frigade_js from '@frigade/js';
5
5
  import { Flow, FlowStep } from '@frigade/js';
6
- export { Flow, FlowStep, FlowType, Frigade } from '@frigade/js';
6
+ export * from '@frigade/js';
7
7
  import { EmotionJSX } from '@emotion/react/types/jsx-namespace';
8
8
  import * as Collapsible$1 from '@radix-ui/react-collapsible';
9
9
  import { ControllerFieldState, Message, ValidationRule } from 'react-hook-form';
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import lt from 'dompurify';
9
9
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
10
10
  import { keyframes, Global, ThemeProvider } from '@emotion/react';
11
11
  import { Frigade } from '@frigade/js';
12
- export { Flow, FlowStep, FlowType, Frigade } from '@frigade/js';
12
+ export * from '@frigade/js';
13
13
  import { ChevronDownIcon } from '@heroicons/react/24/outline';
14
14
  import * as Y from '@radix-ui/react-collapsible';
15
15
  import { useForm, useController } from 'react-hook-form';
@@ -17,7 +17,7 @@ import * as Q from '@radix-ui/react-radio-group';
17
17
  import * as C from '@radix-ui/react-select';
18
18
  import * as I from '@radix-ui/react-popover';
19
19
 
20
- var Jo=Object.defineProperty;var Xo=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var z=(e,o)=>{for(var t in o)Jo(e,t,{get:o[t],enumerable:!0});};var We={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Ae={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 Le={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Ve={neutral:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray700"),active:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},focus:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},hover:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")}},primary:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500"),active:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")},focus:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500")},hover:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")}},secondary:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray900"),active:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")},focus:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray900")},hover:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")}}};var $e={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var qo="px",Yo=e=>typeof e=="number"?`${4*e}${qo}`:e,Qo=[-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"],_e=Object.fromEntries(Qo.map(e=>[e,Yo(e)]));var ze={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var xe={...We,colors:{...Ae,...Ve},...ze,radii:Le,shadows:$e,space:_e};function ee(e,o="",t="."){return Object.keys(e).reduce((i,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,a=e[n];return typeof a=="object"&&a!==null&&!Array.isArray(a)?Object.assign(i,ee(a,s,t)):i[s]=a,i},{})}function ye(e){return ee(e,"--fr","-")}function je(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let n=e[i];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[i]=je(n,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var he=ye(xe),y=je(xe);var et=new Set(["alt","size","src"]),ot=Zo.all.filter(e=>e.indexOf("-")!=0&&!et.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),tt=Object.fromEntries(ot),be=ee(y.colors),rt={color:be,backgroundColor:be,borderColor:be,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},Ne={...tt,...rt},Ke={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"]},Ue=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function nt(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 Ge=new Map(Object.entries(Ne).map(([e,o])=>[e,nt(o)])),it=new Map(Object.entries(Ke).map(([e,o])=>[e,new Set(o)])),st=new Set(["height","width"]),at=new Set(["canvas","embed","iframe","img","input","object","video"]);function Je(e){let[o,t]=e.split(":");return [o,Ue.has(t)?t:null]}function Xe(e,o="div"){let t=Object.assign({},e),i={};function n(r){if(r==null)return i;let a=`&:${r.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[a]==null&&(i[a]={}),i[a]}return Object.entries(t).forEach(([r,s])=>{let[a,d]=Je(r),m=it.get(a);m!=null&&(m.forEach(f=>{let h=`${f}${d?":"+d:""}`;t[h]=s;}),delete t[r]);}),Object.entries(t).forEach(([r,s])=>{let[a,d]=Je(r),m=Ge.get(a);if(m!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(d)[a]=f.map(h=>m.get(h.toString())??h).join(" ");}else m.has(s.toString())?n(d)[a]=m.get(s.toString()):n(d)[a]=s;(typeof o!="string"||!at.has(o)||!st.has(a))&&delete t[r];}}),Object.keys(t).forEach(r=>{let s=r.substring(1);r.indexOf("_")===0&&Ge.has(s)&&(t[s]=t[r],delete t[r]);}),{cssFromProps:i,unmatchedProps:t}}function pt(){if(typeof window>"u"){let{JSDOM:e}=Xo("jsdom");return new e("<!DOCTYPE html>").window}return window}function qe(e){return e?{__html:lt(pt()).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 ct(e){return e&&`fr-${e}`}function Ze(e){return e&&(Array.isArray(e)?e.map(o=>Ze(o)).join(" "):ct(e))}function mt({as:e,children:o,className:t,css:i={},part:n,...r},s){let a=e??"div",{cssFromProps:d,unmatchedProps:m}=Xe(r,a),f=Ze(n),h=t||f?clsx(t,f):void 0,c=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsx(a,{className:h,css:c,...m,ref:s,dangerouslySetInnerHTML:qe(o)}):jsx(a,{className:h,css:c,...m,ref:s,children:o})}var l=Se.forwardRef(mt);var g={};z(g,{Body1:()=>kt,Body2:()=>Dt,Caption:()=>Et,Display1:()=>Ft,Display2:()=>Tt,H1:()=>wt,H2:()=>Rt,H3:()=>Bt,H4:()=>vt});var Pe={};z(Pe,{Body1:()=>bt,Body2:()=>Pt,Caption:()=>Ct,Display1:()=>ut,Display2:()=>ft,H1:()=>gt,H2:()=>xt,H3:()=>yt,H4:()=>ht});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},ut={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ft={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},gt={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},xt={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},yt={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},ht={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},bt={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},Pt={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Ct={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var St=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(St.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Se.forwardRef(({as:i=o,children:n,...r},s)=>jsx(l,{as:i,...Pe[e],...r,ref:s,children:n}));return t.displayName=`Text.${e}`,[e,t]})),Ft=H.Display1,Tt=H.Display2,wt=H.H1,Rt=H.H2,Bt=H.H3,vt=H.H4,kt=H.Body1,Dt=H.Body2,Et=H.Caption;var Ce={};z(Ce,{Link:()=>Ht,Plain:()=>Wt,Primary:()=>It,Secondary:()=>Mt});var se={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},It={...se,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},Mt={...se,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},Ht={...se,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Wt={...se,backgroundColor:"transparent",color:"neutral.foreground"};function oo({as:e,children:o,part:t,title:i,variant:n="Primary",...r}){let s=n.toLocaleLowerCase();return jsxs(l,{as:e??"button",part:[`button-${s}`,t],...Ce[n],...r,children:[o,i&&jsx(g.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var At=["Primary","Secondary","Link","Plain"],Lt=Object.fromEntries(At.map(e=>{let o=t=>jsx(oo,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(oo,Lt);var x={};z(x,{Column:()=>_t,Row:()=>$t});var $t=Se.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),_t=Se.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var v=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Xt({children:e,navigate:o,theme:t,...i}){let n=t?ye(t):{},[r,s]=useState(new Set),a=useMemo(()=>new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,__readOnly:i.__readOnly,__flowConfigOverrides:i.__flowConfigOverrides}),[i.userId,i.groupId,i.apiKey]),d=o??((f,h="_self")=>{window.open(f,h);});useEffect(()=>()=>{a.destroy();},[]);let m=r.size>0?r.values().next().value:null;return jsxs(v.Provider,{value:{modals:r,setModals:s,currentModal:m,navigate:d,...i,frigade:a},children:[jsx(Global,{styles:{":root":{...he,...n}}}),jsx(ThemeProvider,{theme:y,children:e})]})}function oe(e,o){let[t,i]=useState(),[,n]=useState(""),{frigade:r}=useContext(v),s=a=>{a.id===e&&(o!=null&&o.variables&&a.applyVariables(o.variables),i(a),n(Math.random().toString()));};return useEffect(()=>((async()=>{let a=await r.getFlow(e);if(!a||r.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&a.applyVariables(o.variables),i(a);})(),r.onStateChange(s),()=>{r.removeStateChangeHandler(s);}),[]),{flow:t}}function j(e,{onComplete:o,onDismiss:t}={}){let i=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&i.current===!1&&(async()=>await(o==null?void 0:o(e)))(),i.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function N(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=useContext(v);return {handlePrimary:useCallback(async(n,r)=>await(o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:useCallback(async(n,r)=>await(t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e,o=!0){let{currentModal:t,modals:i,setModals:n}=useContext(v),[r,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&n(d=>new Set(d).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let d=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&d!==r&&s(d);},[e==null?void 0:e.id,t]);function a(){o&&i.has(e==null?void 0:e.id)&&n(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:r||!o,removeModal:a}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:n,onComplete:r,onDismiss:s,onPrimary:a,onSecondary:d,variables:m,forceMount:f,...h}){let{flow:c}=oe(n,{variables:m}),S=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=j(c,{onComplete:r,onDismiss:s}),{handlePrimary:_,handleSecondary:ue}=N(S,{onPrimary:a,onSecondary:d}),ne=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:Z,removeModal:fe}=te(c,ne);if(useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&fe();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let ge=f&&c.isCompleted;return !c.isVisible&&!ge?null:(!c.isCompleted&&!c.isSkipped&&S.start(),jsx(e??l,{position:"relative",...h,children:o({flow:c,handleDismiss:q,handlePrimary:_,handleSecondary:ue,parentProps:{container:t,dismissible:i,flowId:n,variables:m,...h},step:S})}))}function lo(e){return jsx(O,{as:u,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r})=>jsxs(Fragment,{children:[jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(u.Title,{children:r.title}),n&&jsx(u.Dismiss,{onClick:o}),jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsx(u.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(x.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(u.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsx(u.Primary,{title:r.primaryButtonTitle??"Continue",onClick:t})]})]})})}function po({part:e,src:o,...t}){return jsx(l,{as:"img",part:["image",e],src:o,...t})}function pr(e){var o,t,i,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/${(i=e.split("wistia.com/medias/")[1])==null?void 0:i.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 mo({part:e,src:o,...t}){let i=pr(o);return i?jsx(l,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i,...t}):o!=null&&o.endsWith(".mp4")?jsx(l,{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 U({src:e,type:o,...t}){return jsx(o==="video"?mo:po,{src:e,...t})}var u=Se.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsx(lo,{flowId:o,...t});let n=t.as??x.Column;return jsx(n,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});u.Dismiss=e=>jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})});u.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});u.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Primary,{title:o,onClick:e,...t});u.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Secondary,{title:o,onClick:e,...t});u.Subtitle=({children:e,...o})=>e==null?null:jsx(g.Body2,{display:"block",part:"subtitle",...o,children:e});u.Title=({children:e,...o})=>e==null?null:jsx(g.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});function F({children:e,...o}){return jsx(w.Root,{defaultOpen:!0,modal:!0,children:jsx(w.Portal,{children:jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsx(w.Overlay,{asChild:!0,children:jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsx(w.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsx(u,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}F.Dismiss=e=>jsx(w.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});F.Subtitle=({children:e,...o})=>jsx(w.Description,{asChild:!0,children:jsx(g.Body2,{part:"subtitle",...o,children:e})});F.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});F.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Primary,{title:o,onClick:e,...t});F.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,n)=>jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?y.colors.blue500:y.colors.blue800},n));return jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};F.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Secondary,{title:o,onClick:e,...t});F.Title=({children:e,...o})=>jsx(w.Title,{asChild:!0,children:jsx(g.H3,{part:"title",...o,children:e})});F.displayName="Dialog";function fr({flowId:e,...o}){return jsx(O,{as:F,dismissible:!0,flowId:e,...o,children:({flow:t,handleDismiss:i,handlePrimary:n,handleSecondary:r,parentProps:{dismissible:s},step:a})=>jsxs(Fragment,{children:[s&&jsx(F.Dismiss,{onClick:i}),jsxs(x.Column,{gap:1,part:"announcement-header",children:[jsx(F.Title,{children:a.title}),jsx(F.Subtitle,{children:a.subtitle})]}),jsx(F.Media,{src:a.videoUri??a.imageUri,type:a.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(F.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxs(x.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[a.secondaryButtonTitle&&jsx(F.Secondary,{onClick:r,title:a.secondaryButtonTitle}),a.primaryButtonTitle&&jsx(F.Primary,{onClick:n,title:a.primaryButtonTitle??"Continue"})]})]})})}function xr({flowId:e,...o}){return jsx(O,{as:u,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:n,step:r})=>jsxs(Fragment,{children:[jsxs(x.Row,{gap:3,children:[r.imageUri&&jsx("img",{src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(x.Column,{children:[jsx(g.H4,{mb:1,children:r.title}),jsx(g.Body2,{color:"gray500",children:r.subtitle})]})]}),jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsx(b.Primary,{title:r.primaryButtonTitle,onClick:i}),o.dismissible&&jsx(u.Dismiss,{onClick:t})]})]})})}var Fo={};z(Fo,{Collapsible:()=>So,CollapsibleStep:()=>le});var le={};z(le,{Content:()=>Re,Root:()=>Be,Trigger:()=>ve});var br=keyframes`
20
+ var Jo=Object.defineProperty;var Xo=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var z=(e,o)=>{for(var t in o)Jo(e,t,{get:o[t],enumerable:!0});};var We={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Ae={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 Le={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Ve={neutral:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray700"),active:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},focus:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},hover:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")}},primary:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500"),active:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")},focus:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500")},hover:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")}},secondary:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray900"),active:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")},focus:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray900")},hover:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")}}};var $e={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var qo="px",Yo=e=>typeof e=="number"?`${4*e}${qo}`:e,Qo=[-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"],_e=Object.fromEntries(Qo.map(e=>[e,Yo(e)]));var ze={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var xe={...We,colors:{...Ae,...Ve},...ze,radii:Le,shadows:$e,space:_e};function ee(e,o="",t="."){return Object.keys(e).reduce((i,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,a=e[n];return typeof a=="object"&&a!==null&&!Array.isArray(a)?Object.assign(i,ee(a,s,t)):i[s]=a,i},{})}function ye(e){return ee(e,"--fr","-")}function je(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let n=e[i];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[i]=je(n,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var he=ye(xe),y=je(xe);var et=new Set(["alt","size","src"]),ot=Zo.all.filter(e=>e.indexOf("-")!=0&&!et.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),tt=Object.fromEntries(ot),be=ee(y.colors),rt={color:be,backgroundColor:be,borderColor:be,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},Ne={...tt,...rt},Ke={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"]},Ue=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function nt(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 Ge=new Map(Object.entries(Ne).map(([e,o])=>[e,nt(o)])),it=new Map(Object.entries(Ke).map(([e,o])=>[e,new Set(o)])),st=new Set(["height","width"]),at=new Set(["canvas","embed","iframe","img","input","object","video"]);function Je(e){let[o,t]=e.split(":");return [o,Ue.has(t)?t:null]}function Xe(e,o="div"){let t=Object.assign({},e),i={};function n(r){if(r==null)return i;let a=`&:${r.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[a]==null&&(i[a]={}),i[a]}return Object.entries(t).forEach(([r,s])=>{let[a,d]=Je(r),m=it.get(a);m!=null&&(m.forEach(f=>{let h=`${f}${d?":"+d:""}`;t[h]=s;}),delete t[r]);}),Object.entries(t).forEach(([r,s])=>{let[a,d]=Je(r),m=Ge.get(a);if(m!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(d)[a]=f.map(h=>m.get(h.toString())??h).join(" ");}else m.has(s.toString())?n(d)[a]=m.get(s.toString()):n(d)[a]=s;(typeof o!="string"||!at.has(o)||!st.has(a))&&delete t[r];}}),Object.keys(t).forEach(r=>{let s=r.substring(1);r.indexOf("_")===0&&Ge.has(s)&&(t[s]=t[r],delete t[r]);}),{cssFromProps:i,unmatchedProps:t}}function pt(){if(typeof window>"u"){let{JSDOM:e}=Xo("jsdom");return new e("<!DOCTYPE html>").window}return window}function qe(e){return e?{__html:lt(pt()).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 ct(e){return e&&`fr-${e}`}function Ze(e){return e&&(Array.isArray(e)?e.map(o=>Ze(o)).join(" "):ct(e))}function mt({as:e,children:o,className:t,css:i={},part:n,...r},s){let a=e??"div",{cssFromProps:d,unmatchedProps:m}=Xe(r,a),f=Ze(n),h=t||f?clsx(t,f):void 0,c=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsx(a,{className:h,css:c,...m,ref:s,dangerouslySetInnerHTML:qe(o)}):jsx(a,{className:h,css:c,...m,ref:s,children:o})}var l=Se.forwardRef(mt);var g={};z(g,{Body1:()=>kt,Body2:()=>Dt,Caption:()=>Et,Display1:()=>Ft,Display2:()=>Tt,H1:()=>wt,H2:()=>Rt,H3:()=>Bt,H4:()=>vt});var Pe={};z(Pe,{Body1:()=>bt,Body2:()=>Pt,Caption:()=>Ct,Display1:()=>ut,Display2:()=>ft,H1:()=>gt,H2:()=>xt,H3:()=>yt,H4:()=>ht});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},ut={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ft={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},gt={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},xt={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},yt={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},ht={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},bt={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},Pt={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Ct={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var St=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(St.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Se.forwardRef(({as:i=o,children:n,...r},s)=>jsx(l,{as:i,...Pe[e],...r,ref:s,children:n}));return t.displayName=`Text.${e}`,[e,t]})),Ft=H.Display1,Tt=H.Display2,wt=H.H1,Rt=H.H2,Bt=H.H3,vt=H.H4,kt=H.Body1,Dt=H.Body2,Et=H.Caption;var Ce={};z(Ce,{Link:()=>Ht,Plain:()=>Wt,Primary:()=>It,Secondary:()=>Mt});var se={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},It={...se,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},Mt={...se,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},Ht={...se,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Wt={...se,backgroundColor:"transparent",color:"neutral.foreground"};function oo({as:e,children:o,part:t,title:i,variant:n="Primary",...r}){let s=n.toLocaleLowerCase();return jsxs(l,{as:e??"button",part:[`button-${s}`,t],...Ce[n],...r,children:[o,i&&jsx(g.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var At=["Primary","Secondary","Link","Plain"],Lt=Object.fromEntries(At.map(e=>{let o=t=>jsx(oo,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(oo,Lt);var x={};z(x,{Column:()=>_t,Row:()=>$t});var $t=Se.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),_t=Se.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var v=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Xt({children:e,navigate:o,theme:t,...i}){let n=t?ye(t):{},[r,s]=useState(new Set),a=useMemo(()=>new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,__readOnly:i.__readOnly,__flowConfigOverrides:i.__flowConfigOverrides}),[i.userId,i.groupId,i.apiKey]),d=o??((f,h="_self")=>{window.open(f,h);});useEffect(()=>()=>{a.destroy();},[]);let m=r.size>0?r.values().next().value:null;return jsxs(v.Provider,{value:{modals:r,setModals:s,currentModal:m,navigate:d,...i,frigade:a},children:[jsx(Global,{styles:{":root":{...he,...n}}}),jsx(ThemeProvider,{theme:y,children:e})]})}function oe(e,o){let[t,i]=useState(),[,n]=useState(""),{frigade:r}=useContext(v),s=a=>{a.id===e&&(o!=null&&o.variables&&a.applyVariables(o.variables),i(a),n(Math.random().toString()));};return useEffect(()=>((async()=>{let a=await r.getFlow(e);if(!a||r.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&a.applyVariables(o.variables),i(a);})(),r.onStateChange(s),()=>{r.removeStateChangeHandler(s);}),[]),{flow:t}}function j(e,{onComplete:o,onDismiss:t}={}){let i=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&i.current===!1&&(async()=>await(o==null?void 0:o(e)))(),i.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function N(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=useContext(v);return {handlePrimary:useCallback(async(n,r)=>await(o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:useCallback(async(n,r)=>await(t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e,o=!0){let{currentModal:t,modals:i,setModals:n}=useContext(v),[r,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&n(d=>new Set(d).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let d=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&d!==r&&s(d);},[e==null?void 0:e.id,t]);function a(){o&&i.has(e==null?void 0:e.id)&&n(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:r||!o,removeModal:a}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:n,onComplete:r,onDismiss:s,onPrimary:a,onSecondary:d,variables:m,forceMount:f,...h}){let{flow:c}=oe(n,{variables:m}),S=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=j(c,{onComplete:r,onDismiss:s}),{handlePrimary:_,handleSecondary:ue}=N(S,{onPrimary:a,onSecondary:d}),ne=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:Z,removeModal:fe}=te(c,ne);if(useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&fe();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let ge=f&&c.isCompleted;return !c.isVisible&&!ge?null:(!c.isCompleted&&!c.isSkipped&&S.start(),jsx(e??l,{position:"relative",...h,children:o({flow:c,handleDismiss:q,handlePrimary:_,handleSecondary:ue,parentProps:{container:t,dismissible:i,flowId:n,variables:m,...h},step:S})}))}function lo(e){return jsx(O,{as:u,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r})=>jsxs(Fragment,{children:[jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(u.Title,{children:r.title}),n&&jsx(u.Dismiss,{onClick:o}),jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsx(u.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(x.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(u.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsx(u.Primary,{title:r.primaryButtonTitle??"Continue",onClick:t})]})]})})}function po({part:e,src:o,...t}){return jsx(l,{as:"img",part:["image",e],src:o,...t})}function pr(e){var o,t,i,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/${(i=e.split("wistia.com/medias/")[1])==null?void 0:i.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 mo({part:e,src:o,...t}){let i=pr(o);return i?jsx(l,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i,...t}):o!=null&&o.endsWith(".mp4")?jsx(l,{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 U({src:e,type:o,...t}){return jsx(o==="video"?mo:po,{src:e,...t})}var u=Se.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsx(lo,{flowId:o,...t});let n=t.as??x.Column;return jsx(n,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});u.Dismiss=e=>jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})});u.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});u.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Primary,{title:o,onClick:e,...t});u.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Secondary,{title:o,onClick:e,...t});u.Subtitle=({children:e,...o})=>e==null?null:jsx(g.Body2,{display:"block",part:"subtitle",...o,children:e});u.Title=({children:e,...o})=>e==null?null:jsx(g.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});function F({children:e,...o}){return jsx(w.Root,{defaultOpen:!0,modal:!0,children:jsx(w.Portal,{children:jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsx(w.Overlay,{asChild:!0,children:jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsx(w.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsx(u,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}F.Dismiss=e=>jsx(w.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});F.Subtitle=({children:e,...o})=>jsx(w.Description,{asChild:!0,children:jsx(g.Body2,{part:"subtitle",...o,children:e})});F.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});F.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Primary,{title:o,onClick:e,...t});F.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,n)=>jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?y.colors.blue500:y.colors.blue800},n));return jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};F.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Secondary,{title:o,onClick:e,...t});F.Title=({children:e,...o})=>jsx(w.Title,{asChild:!0,children:jsx(g.H3,{part:"title",...o,children:e})});F.displayName="Dialog";function fr({flowId:e,...o}){return jsx(O,{as:F,dismissible:!0,flowId:e,...o,children:({flow:t,handleDismiss:i,handlePrimary:n,handleSecondary:r,parentProps:{dismissible:s},step:a})=>jsxs(Fragment,{children:[s&&jsx(F.Dismiss,{onClick:i}),jsxs(x.Column,{gap:1,part:"announcement-header",children:[jsx(F.Title,{children:a.title}),jsx(F.Subtitle,{children:a.subtitle})]}),jsx(F.Media,{src:a.videoUri??a.imageUri,type:a.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(F.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxs(x.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[a.secondaryButtonTitle&&jsx(F.Secondary,{onClick:r,title:a.secondaryButtonTitle}),a.primaryButtonTitle&&jsx(F.Primary,{onClick:n,title:a.primaryButtonTitle??"Continue"})]})]})})}function xr({flowId:e,...o}){return jsx(O,{as:u,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:n,step:r})=>jsxs(Fragment,{children:[jsxs(x.Row,{gap:3,children:[r.imageUri&&jsx(l,{as:"img",part:"image",src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(x.Column,{children:[jsx(g.H4,{part:"title",children:r.title}),jsx(g.Body2,{part:"subtitle",children:r.subtitle})]})]}),jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsx(b.Primary,{title:r.primaryButtonTitle,onClick:i}),o.dismissible&&jsx(u.Dismiss,{onClick:t})]})]})})}var Fo={};z(Fo,{Collapsible:()=>So,CollapsibleStep:()=>le});var le={};z(le,{Content:()=>Re,Root:()=>Be,Trigger:()=>ve});var br=keyframes`
21
21
  from {
22
22
  height: 0;
23
23
  opacity: 0;