@frigade/react 2.0.25 → 2.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import * as Q from '@radix-ui/react-radio-group';
17
17
  import * as S from '@radix-ui/react-select';
18
18
  import * as I from '@radix-ui/react-popover';
19
19
 
20
- var rt=Object.defineProperty;var nt=(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 M=(e,o)=>{for(var t in o)rt(e,t,{get:o[t],enumerable:!0});};var Ne={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var je={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 ze={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Ke={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 Ue={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var it="px",st=e=>typeof e=="number"?`${4*e}${it}`:e,at=[-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"],Ge=Object.fromEntries(at.map(e=>[e,st(e)]));var Xe={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 be={...Ne,colors:{...je,...Ke},...Xe,radii:ze,shadows:Ue,space:Ge};function ee(e,o="",t="."){return Object.keys(e).reduce((i,r)=>{let a=`${o.length?`${o}${t}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,ee(s,a,t)):i[a]=s,i},{})}function Pe(e){return ee(e,"--fr","-")}function Je(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let r=e[i];typeof r=="object"&&r!==null&&!Array.isArray(r)?t[i]=Je(r,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var Ce=Pe(be),y=Je(be);var pt=new Set(["alt","size","src"]),dt=lt.all.filter(e=>e.indexOf("-")!=0&&!pt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),ct=Object.fromEntries(dt),Se=ee(y.colors),mt={color:Se,backgroundColor:Se,borderColor:Se,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},qe={...ct,...mt},Ye={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"]},Qe=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function ut(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 Ze=new Map(Object.entries(qe).map(([e,o])=>[e,ut(o)])),ft=new Map(Object.entries(Ye).map(([e,o])=>[e,new Set(o)])),gt=new Set(["height","width"]),xt=new Set(["canvas","embed","iframe","img","input","object","video"]);function eo(e){let[o,t]=e.split(":");return [o,Qe.has(t)?t:null]}function oo(e,o="div"){let t=Object.assign({},e),i={};function r(n){if(n==null)return i;let s=`&:${n.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[s]==null&&(i[s]={}),i[s]}return Object.entries(t).forEach(([n,a])=>{let[s,d]=eo(n),m=ft.get(s);m!=null&&(m.forEach(g=>{let b=`${g}${d?":"+d:""}`;t[b]=a;}),delete t[n]);}),Object.entries(t).forEach(([n,a])=>{let[s,d]=eo(n),m=Ze.get(s);if(m!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let g=a.split(" ");r(d)[s]=g.map(b=>m.get(b.toString())??b).join(" ");}else m.has(a.toString())?r(d)[s]=m.get(a.toString()):r(d)[s]=a;(typeof o!="string"||!xt.has(o)||!gt.has(s))&&delete t[n];}}),Object.keys(t).forEach(n=>{let a=n.substring(1);n.indexOf("_")===0&&Ze.has(a)&&(t[a]=t[n],delete t[n]);}),{cssFromProps:i,unmatchedProps:t}}function ht(){if(typeof window>"u"){let{JSDOM:e}=nt("jsdom");return new e("<!DOCTYPE html>").window}return window}function to(e){return e?{__html:yt(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 Pt(e){return e&&`fr-${e}`}function io(e){return e&&(Array.isArray(e)?e.map(o=>io(o)).join(" "):Pt(e))}function Ct({as:e,children:o,className:t,css:i={},part:r,...n},a){let s=e??"div",{cssFromProps:d,unmatchedProps:m}=oo(n,s),g=io(r),b=t||g?clsx(t,g):void 0,c=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsx(s,{className:b,css:c,...m,ref:a,dangerouslySetInnerHTML:to(o)}):jsx(s,{className:b,css:c,...m,ref:a,children:o})}var l=we.forwardRef(Ct);var h={};M(h,{Link:()=>Xt,Plain:()=>Jt,Primary:()=>Ut,Secondary:()=>Gt});var x={};M(x,{Body1:()=>Lt,Body2:()=>Vt,Caption:()=>$t,Display1:()=>Ot,Display2:()=>It,H1:()=>Mt,H2:()=>Ht,H3:()=>Wt,H4:()=>At});var Fe={};M(Fe,{Body1:()=>vt,Body2:()=>kt,Caption:()=>Dt,Display1:()=>St,Display2:()=>Ft,H1:()=>Tt,H2:()=>wt,H3:()=>Rt,H4:()=>Bt});var H={color:"neutral.foreground",fontFamily:"default",margin:"0"},St={...H,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},Ft={...H,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},Tt={...H,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},wt={...H,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},Rt={...H,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},Bt={...H,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},vt={...H,fontSize:"md",fontWeight:"regular",lineHeight:"md"},kt={...H,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Dt={...H,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var Et=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],W=Object.fromEntries(Et.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=we.forwardRef(({as:i=o,children:r,...n},a)=>jsx(l,{as:i,...Fe[e],...n,ref:a,children:r}));return t.displayName=`Text.${e}`,[e,t]})),Ot=W.Display1,It=W.Display2,Mt=W.H1,Ht=W.H2,Wt=W.H3,At=W.H4,Lt=W.Body1,Vt=W.Body2,$t=W.Caption;var Te={};M(Te,{Link:()=>zt,Plain:()=>Kt,Primary:()=>Nt,Secondary:()=>jt});var ae={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},Nt={...ae,backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},jt={...ae,backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},zt={...ae,backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Kt={...ae,backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"};function le({as:e,children:o,part:t,title:i,variant:r="Primary",...n}){let a=r.toLocaleLowerCase();return jsxs(l,{as:e??"button",part:[`button-${a}`,t],...Te[r],...n,children:[o,i&&jsx(x.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}function Ut({children:e,...o}){return jsx(le,{...o,variant:"Primary",children:e})}function Gt({children:e,...o}){return jsx(le,{...o,variant:"Secondary",children:e})}function Xt({children:e,...o}){return jsx(le,{...o,variant:"Link",children:e})}function Jt({children:e,...o}){return jsx(le,{...o,variant:"Plain",children:e})}var u={};M(u,{Column:()=>Qt,Row:()=>Yt});var Yt=we.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),Qt=we.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var w=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function po({children:e,navigate:o,theme:t,...i}){let r=t?Pe(t):{},[n,a]=useState(new Set),s=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??((g,b="_self")=>{window.open(g,b);});useEffect(()=>()=>{s.destroy();},[]);let m=n.size>0?n.values().next().value:null;return jsxs(w.Provider,{value:{modals:n,setModals:a,currentModal:m,navigate:d,...i,frigade:s},children:[jsx(Global,{styles:{":root":{...Ce,...r}}}),jsx(ThemeProvider,{theme:y,children:e})]})}function te(e,o){let[t,i]=useState(),[,r]=useState(""),{frigade:n}=useContext(w),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),i(s),r(Math.random().toString()));};return useEffect(()=>((async()=>{let s=await n.getFlow(e);if(!s||n.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),i(s);})(),n.onStateChange(a),()=>{n.removeStateChangeHandler(a);}),[]),useEffect(()=>{!(o!=null&&o.variables)||!t||a(t);},[o.variables]),{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 r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();},[e])}}function z(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=useContext(w);return {handlePrimary:useCallback(async(r,n)=>await(o==null?void 0:o(e,r))===!1?(r.preventDefault(),!1):(e.complete(n),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:useCallback(async(r,n)=>await(t==null?void 0:t(e,r))===!1?(r.preventDefault(),!1):(e.complete(n),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function re(e,o=!0){let{currentModal:t,modals:i,setModals:r}=useContext(w),[n,a]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&r(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!==n&&a(d);},[e==null?void 0:e.id,t]);function s(){o&&i.has(e==null?void 0:e.id)&&r(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:n||!o,removeModal:s}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:m,forceMount:g,...b}){let{flow:c}=te(r,{variables:m}),F=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=j(c,{onComplete:n,onDismiss:a}),{handlePrimary:N,handleSecondary:xe}=z(F,{onPrimary:s,onSecondary:d}),ie=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:Z,removeModal:ye}=re(c,ie);if(useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&ye();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let he=g&&c.isCompleted;return !c.isVisible&&!he?null:(!c.isCompleted&&!c.isSkipped&&F.start(),jsx(e??l,{position:"relative",...b,children:o({flow:c,handleDismiss:q,handlePrimary:N,handleSecondary:xe,parentProps:{container:t,dismissible:i,flowId:r,variables:m,...b},step:F})}))}function go(e){return jsx(O,{as:f,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:r},step:n})=>jsxs(Fragment,{children:[jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(f.Title,{children:n.title}),r&&jsx(f.Dismiss,{onClick:o}),jsx(f.Subtitle,{flexBasis:"100%",children:n.subtitle})]}),jsx(f.Media,{src:n.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(u.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(f.Secondary,{title:n.secondaryButtonTitle,onClick:i}),jsx(f.Primary,{title:n.primaryButtonTitle,onClick:t})]})]})})}function Be({part:e,src:o,...t}){return jsx(l,{as:"img",part:["image",e],src:o,...t})}function hr(e){var o,t,i,r;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/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function ve({part:e,src:o,...t}){let i=hr(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"?ve:Be,{src:e,...t})}var f=we.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsx(go,{flowId:o,...t});let r=t.as??u.Column;return jsx(r,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});f.Dismiss=e=>jsx(h.Plain,{part:"dismiss",padding:0,...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})});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(h.Primary,{title:o,onClick:e,...t});f.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(h.Secondary,{title:o,onClick:e,...t});f.Subtitle=({children:e,...o})=>e==null?null:jsx(x.Body2,{display:"block",part:"subtitle",...o,children:e});f.Title=({children:e,...o})=>e==null?null:jsx(x.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});var pe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function ho(e){let o=Object.fromEntries(pe.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(pe.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i={};for(let r of Object.keys(e))!pe.content.includes(r)&&!pe.root.includes(r)&&(i[r]=e[r]);return {contentProps:o,otherProps:i,rootProps:t}}function P({children:e,className:o,modal:t=!0,...i}){let{rootProps:r,contentProps:n,otherProps:a}=ho(i);return jsx(R.Root,{defaultOpen:!0,modal:t,...r,children:jsx(R.Portal,{children:jsxs(l,{className:o,display:"grid",inset:"0",padding:"6",pointerEvents:"none",position:"fixed",children:[jsx(R.Overlay,{asChild:!0,children:jsx(l,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(R.Content,{asChild:!0,onOpenAutoFocus:s=>s.preventDefault(),onPointerDownOutside:s=>s.preventDefault(),...n,children:jsx(f,{alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",...a,children:e})})]})})})}P.Dismiss=e=>jsx(R.Close,{"aria-label":"Close",asChild:!0,children:jsx(h.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});P.Subtitle=({children:e,...o})=>jsx(R.Description,{asChild:!0,children:jsx(x.Body2,{part:"subtitle",...o,children:e})});P.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});P.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(h.Primary,{title:o,onClick:e,...t});P.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,r)=>jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?y.colors.blue500:y.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};P.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(h.Secondary,{title:o,onClick:e,...t});P.Title=({children:e,...o})=>jsx(R.Title,{asChild:!0,children:jsx(x.H3,{part:"title",...o,children:e})});P.displayName="Dialog";function Fr({flowId:e,...o}){return jsx(O,{as:P,dismissible:!0,flowId:e,textAlign:"center",...o,children:({flow:t,handleDismiss:i,handlePrimary:r,handleSecondary:n,parentProps:{dismissible:a},step:s})=>jsxs(Fragment,{children:[a&&jsx(P.Dismiss,{onClick:i}),jsxs(u.Column,{gap:1,part:"announcement-header",children:[jsx(P.Title,{children:s.title}),jsx(P.Subtitle,{children:s.subtitle})]}),jsx(P.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(P.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxs(u.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsx(P.Secondary,{onClick:n,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsx(P.Primary,{onClick:r,title:s.primaryButtonTitle??"Continue"})]})]})})}function wr({flowId:e,...o}){return jsx(O,{as:f,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:r,step:n})=>jsxs(Fragment,{children:[jsxs(u.Row,{gap:3,children:[n.imageUri&&jsx(l,{as:"img",part:"image",src:n.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(u.Column,{children:[jsx(x.H4,{part:"title",children:n.title}),jsx(x.Body2,{part:"subtitle",children:n.subtitle})]})]}),jsxs(u.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[n.secondaryButtonTitle&&jsx(h.Secondary,{title:n.secondaryButtonTitle,onClick:r}),jsx(h.Primary,{title:n.primaryButtonTitle,onClick:i}),o.dismissible&&jsx(f.Dismiss,{onClick:t})]})]})})}var vo={};M(vo,{Collapsible:()=>Bo,CollapsibleStep:()=>ce});var ce={};M(ce,{Content:()=>Ee,Root:()=>Oe,Trigger:()=>Ie});var vr=keyframes`
20
+ var rt=Object.defineProperty;var nt=(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 M=(e,o)=>{for(var t in o)rt(e,t,{get:o[t],enumerable:!0});};var Ne={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var je={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 ze={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Ke={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 Ue={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var it="px",st=e=>typeof e=="number"?`${4*e}${it}`:e,at=[-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"],Ge=Object.fromEntries(at.map(e=>[e,st(e)]));var Xe={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 be={...Ne,colors:{...je,...Ke},...Xe,radii:ze,shadows:Ue,space:Ge};function ee(e,o="",t="."){return Object.keys(e).reduce((i,r)=>{let a=`${o.length?`${o}${t}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,ee(s,a,t)):i[a]=s,i},{})}function Pe(e){return ee(e,"--fr","-")}function Je(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let r=e[i];typeof r=="object"&&r!==null&&!Array.isArray(r)?t[i]=Je(r,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var Ce=Pe(be),y=Je(be);var pt=new Set(["alt","size","src"]),dt=lt.all.filter(e=>e.indexOf("-")!=0&&!pt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),ct=Object.fromEntries(dt),Se=ee(y.colors),mt={color:Se,backgroundColor:Se,borderColor:Se,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},qe={...ct,...mt},Ye={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"]},Qe=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function ut(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 Ze=new Map(Object.entries(qe).map(([e,o])=>[e,ut(o)])),ft=new Map(Object.entries(Ye).map(([e,o])=>[e,new Set(o)])),gt=new Set(["height","width"]),xt=new Set(["canvas","embed","iframe","img","input","object","video"]);function eo(e){let[o,t]=e.split(":");return [o,Qe.has(t)?t:null]}function oo(e,o="div"){let t=Object.assign({},e),i={};function r(n){if(n==null)return i;let s=`&:${n.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[s]==null&&(i[s]={}),i[s]}return Object.entries(t).forEach(([n,a])=>{let[s,d]=eo(n),m=ft.get(s);m!=null&&(m.forEach(g=>{let b=`${g}${d?":"+d:""}`;t[b]=a;}),delete t[n]);}),Object.entries(t).forEach(([n,a])=>{let[s,d]=eo(n),m=Ze.get(s);if(m!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let g=a.split(" ");r(d)[s]=g.map(b=>m.get(b.toString())??b).join(" ");}else m.has(a.toString())?r(d)[s]=m.get(a.toString()):r(d)[s]=a;(typeof o!="string"||!xt.has(o)||!gt.has(s))&&delete t[n];}}),Object.keys(t).forEach(n=>{let a=n.substring(1);n.indexOf("_")===0&&Ze.has(a)&&(t[a]=t[n],delete t[n]);}),{cssFromProps:i,unmatchedProps:t}}function ht(){if(typeof window>"u"){let{JSDOM:e}=nt("jsdom");return new e("<!DOCTYPE html>").window}return window}function to(e){return e?{__html:yt(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 Pt(e){return e&&`fr-${e}`}function io(e){return e&&(Array.isArray(e)?e.map(o=>io(o)).join(" "):Pt(e))}function Ct({as:e,children:o,className:t,css:i={},part:r,...n},a){let s=e??"div",{cssFromProps:d,unmatchedProps:m}=oo(n,s),g=io(r),b=t||g?clsx(t,g):void 0,c=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsx(s,{className:b,css:c,...m,ref:a,dangerouslySetInnerHTML:to(o)}):jsx(s,{className:b,css:c,...m,ref:a,children:o})}var l=we.forwardRef(Ct);var h={};M(h,{Link:()=>Xt,Plain:()=>Jt,Primary:()=>Ut,Secondary:()=>Gt});var x={};M(x,{Body1:()=>Lt,Body2:()=>Vt,Caption:()=>$t,Display1:()=>Ot,Display2:()=>It,H1:()=>Mt,H2:()=>Ht,H3:()=>Wt,H4:()=>At});var Fe={};M(Fe,{Body1:()=>vt,Body2:()=>kt,Caption:()=>Dt,Display1:()=>St,Display2:()=>Ft,H1:()=>Tt,H2:()=>wt,H3:()=>Rt,H4:()=>Bt});var H={color:"neutral.foreground",fontFamily:"default",margin:"0"},St={...H,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},Ft={...H,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},Tt={...H,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},wt={...H,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},Rt={...H,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},Bt={...H,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},vt={...H,fontSize:"md",fontWeight:"regular",lineHeight:"md"},kt={...H,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Dt={...H,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var Et=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],W=Object.fromEntries(Et.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=we.forwardRef(({as:i=o,children:r,...n},a)=>jsx(l,{as:i,...Fe[e],...n,ref:a,children:r}));return t.displayName=`Text.${e}`,[e,t]})),Ot=W.Display1,It=W.Display2,Mt=W.H1,Ht=W.H2,Wt=W.H3,At=W.H4,Lt=W.Body1,Vt=W.Body2,$t=W.Caption;var Te={};M(Te,{Link:()=>zt,Plain:()=>Kt,Primary:()=>Nt,Secondary:()=>jt});var ae={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},Nt={...ae,backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},jt={...ae,backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},zt={...ae,backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Kt={...ae,backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"};function le({as:e,children:o,part:t,title:i,variant:r="Primary",...n}){let a=r.toLocaleLowerCase();return jsxs(l,{as:e??"button",part:[`button-${a}`,t],...Te[r],...n,children:[o,i&&jsx(x.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}function Ut({children:e,...o}){return jsx(le,{...o,variant:"Primary",children:e})}function Gt({children:e,...o}){return jsx(le,{...o,variant:"Secondary",children:e})}function Xt({children:e,...o}){return jsx(le,{...o,variant:"Link",children:e})}function Jt({children:e,...o}){return jsx(le,{...o,variant:"Plain",children:e})}var u={};M(u,{Column:()=>Qt,Row:()=>Yt});var Yt=we.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),Qt=we.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var w=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function po({children:e,navigate:o,theme:t,...i}){let r=t?Pe(t):{},[n,a]=useState(new Set),s=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??((g,b="_self")=>{window.open(g,b);});useEffect(()=>()=>{s.destroy();},[]);let m=n.size>0?n.values().next().value:null;return jsxs(w.Provider,{value:{modals:n,setModals:a,currentModal:m,navigate:d,...i,frigade:s},children:[jsx(Global,{styles:{":root":{...Ce,...r}}}),jsx(ThemeProvider,{theme:y,children:e})]})}function te(e,o){let[t,i]=useState(),[,r]=useState(""),{frigade:n}=useContext(w),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),i(s),r(Math.random().toString()));};return useEffect(()=>((async()=>{let s=await n.getFlow(e);if(!s||n.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),i(s);})(),n.onStateChange(a),()=>{n.removeStateChangeHandler(a);}),[]),useEffect(()=>{!(o!=null&&o.variables)||!t||a(t);},[o==null?void 0:o.variables]),{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 r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();},[e])}}function z(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=useContext(w);return {handlePrimary:useCallback(async(r,n)=>await(o==null?void 0:o(e,r))===!1?(r.preventDefault(),!1):(e.complete(n),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:useCallback(async(r,n)=>await(t==null?void 0:t(e,r))===!1?(r.preventDefault(),!1):(e.complete(n),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function re(e,o=!0){let{currentModal:t,modals:i,setModals:r}=useContext(w),[n,a]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&r(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!==n&&a(d);},[e==null?void 0:e.id,t]);function s(){o&&i.has(e==null?void 0:e.id)&&r(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:n||!o,removeModal:s}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:m,forceMount:g,...b}){let{flow:c}=te(r,{variables:m}),F=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=j(c,{onComplete:n,onDismiss:a}),{handlePrimary:N,handleSecondary:xe}=z(F,{onPrimary:s,onSecondary:d}),ie=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:Z,removeModal:ye}=re(c,ie);if(useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&ye();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let he=g&&c.isCompleted;return !c.isVisible&&!he?null:(!c.isCompleted&&!c.isSkipped&&F.start(),jsx(e??l,{position:"relative",...b,children:o({flow:c,handleDismiss:q,handlePrimary:N,handleSecondary:xe,parentProps:{container:t,dismissible:i,flowId:r,variables:m,...b},step:F})}))}function go(e){return jsx(O,{as:f,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:r},step:n})=>jsxs(Fragment,{children:[jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(f.Title,{children:n.title}),r&&jsx(f.Dismiss,{onClick:o}),jsx(f.Subtitle,{flexBasis:"100%",children:n.subtitle})]}),jsx(f.Media,{src:n.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(u.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(f.Secondary,{title:n.secondaryButtonTitle,onClick:i}),jsx(f.Primary,{title:n.primaryButtonTitle,onClick:t})]})]})})}function Be({part:e,src:o,...t}){return jsx(l,{as:"img",part:["image",e],src:o,...t})}function hr(e){var o,t,i,r;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/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function ve({part:e,src:o,...t}){let i=hr(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"?ve:Be,{src:e,...t})}var f=we.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsx(go,{flowId:o,...t});let r=t.as??u.Column;return jsx(r,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});f.Dismiss=e=>jsx(h.Plain,{part:"dismiss",padding:0,...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})});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(h.Primary,{title:o,onClick:e,...t});f.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(h.Secondary,{title:o,onClick:e,...t});f.Subtitle=({children:e,...o})=>e==null?null:jsx(x.Body2,{display:"block",part:"subtitle",...o,children:e});f.Title=({children:e,...o})=>e==null?null:jsx(x.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});var pe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function ho(e){let o=Object.fromEntries(pe.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(pe.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i={};for(let r of Object.keys(e))!pe.content.includes(r)&&!pe.root.includes(r)&&(i[r]=e[r]);return {contentProps:o,otherProps:i,rootProps:t}}function P({children:e,className:o,modal:t=!0,...i}){let{rootProps:r,contentProps:n,otherProps:a}=ho(i);return jsx(R.Root,{defaultOpen:!0,modal:t,...r,children:jsx(R.Portal,{children:jsxs(l,{className:o,display:"grid",inset:"0",padding:"6",pointerEvents:"none",position:"fixed",children:[jsx(R.Overlay,{asChild:!0,children:jsx(l,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(R.Content,{asChild:!0,onOpenAutoFocus:s=>s.preventDefault(),onPointerDownOutside:s=>s.preventDefault(),...n,children:jsx(f,{alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",...a,children:e})})]})})})}P.Dismiss=e=>jsx(R.Close,{"aria-label":"Close",asChild:!0,children:jsx(h.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});P.Subtitle=({children:e,...o})=>jsx(R.Description,{asChild:!0,children:jsx(x.Body2,{part:"subtitle",...o,children:e})});P.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});P.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(h.Primary,{title:o,onClick:e,...t});P.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,r)=>jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?y.colors.blue500:y.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};P.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(h.Secondary,{title:o,onClick:e,...t});P.Title=({children:e,...o})=>jsx(R.Title,{asChild:!0,children:jsx(x.H3,{part:"title",...o,children:e})});P.displayName="Dialog";function Fr({flowId:e,...o}){return jsx(O,{as:P,dismissible:!0,flowId:e,textAlign:"center",...o,children:({flow:t,handleDismiss:i,handlePrimary:r,handleSecondary:n,parentProps:{dismissible:a},step:s})=>jsxs(Fragment,{children:[a&&jsx(P.Dismiss,{onClick:i}),jsxs(u.Column,{gap:1,part:"announcement-header",children:[jsx(P.Title,{children:s.title}),jsx(P.Subtitle,{children:s.subtitle})]}),jsx(P.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(P.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxs(u.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsx(P.Secondary,{onClick:n,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsx(P.Primary,{onClick:r,title:s.primaryButtonTitle??"Continue"})]})]})})}function wr({flowId:e,...o}){return jsx(O,{as:f,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:r,step:n})=>jsxs(Fragment,{children:[jsxs(u.Row,{gap:3,children:[n.imageUri&&jsx(l,{as:"img",part:"image",src:n.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(u.Column,{children:[jsx(x.H4,{part:"title",children:n.title}),jsx(x.Body2,{part:"subtitle",children:n.subtitle})]})]}),jsxs(u.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[n.secondaryButtonTitle&&jsx(h.Secondary,{title:n.secondaryButtonTitle,onClick:r}),jsx(h.Primary,{title:n.primaryButtonTitle,onClick:i}),o.dismissible&&jsx(f.Dismiss,{onClick:t})]})]})})}var vo={};M(vo,{Collapsible:()=>Bo,CollapsibleStep:()=>ce});var ce={};M(ce,{Content:()=>Ee,Root:()=>Oe,Trigger:()=>Ie});var vr=keyframes`
21
21
  from {
22
22
  height: 0;
23
23
  opacity: 0;