@frigade/react 2.0.0-alpha.20 → 2.0.0-alpha.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,13 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var _ = require('react');
3
+ var b = require('@radix-ui/react-dialog');
4
+ var solid = require('@heroicons/react/24/solid');
5
+ var N = require('react');
4
6
  var clsx = require('clsx');
5
- var et = require('dompurify');
7
+ var qe = require('dompurify');
6
8
  var jsxRuntime = require('@emotion/react/jsx-runtime');
7
9
  var react = require('@emotion/react');
8
10
  var js = require('@frigade/js');
9
- var solid = require('@heroicons/react/24/solid');
10
- var T = require('@radix-ui/react-popover');
11
+ var w = require('@radix-ui/react-popover');
11
12
 
12
13
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
14
 
@@ -29,25 +30,28 @@ function _interopNamespace(e) {
29
30
  return Object.freeze(n);
30
31
  }
31
32
 
32
- var ___namespace = /*#__PURE__*/_interopNamespace(_);
33
- var et__default = /*#__PURE__*/_interopDefault(et);
34
- var T__namespace = /*#__PURE__*/_interopNamespace(T);
33
+ var b__namespace = /*#__PURE__*/_interopNamespace(b);
34
+ var N__namespace = /*#__PURE__*/_interopNamespace(N);
35
+ var qe__default = /*#__PURE__*/_interopDefault(qe);
36
+ var w__namespace = /*#__PURE__*/_interopNamespace(w);
35
37
 
36
- var ne=Object.defineProperty,Ne=Object.defineProperties;var Ge=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var oe=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i=(e,t)=>{for(var r in t||(t={}))ie.call(t,r)&&oe(e,r,t[r]);if(L)for(var r of L(t))se.call(t,r)&&oe(e,r,t[r]);return e},p=(e,t)=>Ne(e,Ge(t));var f=(e,t)=>{var r={};for(var o in e)ie.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&L)for(var o of L(e))t.indexOf(o)<0&&se.call(e,o)&&(r[o]=e[o]);return r};var ae=(e,t)=>{for(var r in t)ne(e,r,{get:t[r],enumerable:!0});};var S=(e,t,r)=>new Promise((o,n)=>{var s=d=>{try{c(r.next(d));}catch(u){n(u);}},l=d=>{try{c(r.throw(d));}catch(u){n(u);}},c=d=>d.done?o(d.value):Promise.resolve(d.value).then(s,l);c((r=r.apply(e,t)).next());});var le={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var pe={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 ce={md:"10px",lg:"20px",round:"50%"};var a=e=>`var(--fr-colors-${e})`,de={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var fe={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Xe="px",qe=e=>typeof e=="number"?`${4*e}${Xe}`:e,Je=[-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"],ue=Object.fromEntries(Je.map(e=>[e,qe(e)]));var me={fontFamilies:{default:"TT Interphases Pro, sans-serif"},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 z=p(i(p(i({},le),{colors:i(i({},pe),de)}),me),{radii:ce,shadows:fe,space:ue});function k(e,t="",r="."){return Object.keys(e).reduce((o,n)=>{let l=`${t.length?`${t}${r}`:""}${n}`,c=e[n];return typeof c=="object"&&c!==null&&!Array.isArray(c)?Object.assign(o,k(c,l,r)):o[l]=c,o},{})}function j(e){return k(e,"--fr","-")}function ge(e,t="--fr"){let r={};return Object.keys(e).forEach(o=>{let n=e[o];typeof n=="object"&&n!==null&&!Array.isArray(n)?r[o]=ge(n,`${t}-${o}`):r[o]=`var(${t}-${o})`;}),r}var xe=j(z),m=ge(z);var K=k(m.colors),be={color:K,backgroundColor:K,borderColor:K,border:m.borders,borderRadius:m.radii,borderWidth:m.borderWidths,boxShadow:m.shadows,fontFamily:m.fontFamilies,fontSize:m.fontSizes,fontWeight:m.fontWeights,gap:m.space,lineHeight:m.lineHeights,margin:m.space,marginTop:m.space,marginRight:m.space,marginBottom:m.space,marginLeft:m.space,padding:m.space,paddingTop:m.space,paddingRight:m.space,paddingBottom:m.space,paddingLeft:m.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},ye={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"]};function Qe(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var Ye=new Map(Object.entries(be).map(([e,t])=>[e,Qe(t)])),Ze=new Map(Object.entries(ye).map(([e,t])=>[e,new Set(t)]));function he(e){let t=Object.assign({},e),r={};return Object.entries(t).forEach(([o,n])=>{let s=Ze.get(o);s!=null&&(s.forEach(l=>{t[l]=n;}),delete t[o]);}),Object.entries(t).forEach(([o,n])=>{let s=Ye.get(o);if(s!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let l=n.split(" ");r[o]=l.map(c=>{var d;return (d=s.get(c.toString()))!=null?d:c}).join(" "),delete t[o];}else s.has(n.toString())&&(r[o]=s.get(n.toString()),delete t[o]);}),{cssFromProps:r,unmatchedProps:t}}function Pe(e){return e?{__html:et__default.default.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 ve(e){return e&&`fr-${e}`}function rt(e){return e&&(Array.isArray(e)?e.map(t=>ve(t)).join(" "):ve(e))}function ot(l,s){var c=l,{as:e,children:t,className:r,part:o}=c,n=f(c,["as","children","className","part"]);let d=e!=null?e:"div",{cssFromProps:u,unmatchedProps:v}=he(n),y=rt(o),P=r||y?clsx.clsx(r,y):void 0,h=[{boxSizing:"border-box"},u];return typeof t=="string"?jsxRuntime.jsx(d,p(i({className:P,css:h},v),{ref:s,dangerouslySetInnerHTML:Pe(t)})):jsxRuntime.jsx(d,p(i({className:P,css:h},v),{ref:s,children:t}))}var g=___namespace.forwardRef(ot);var nt=___namespace.forwardRef((n,o)=>{var s=n,{children:e,css:t}=s,r=f(s,["children","css"]);return jsxRuntime.jsx(g,p(i({css:[{display:"flex",flexDirection:"row"},t]},r),{ref:o,children:e}))}),it=___namespace.forwardRef((n,o)=>{var s=n,{children:e,css:t}=s,r=f(s,["children","css"]);return jsxRuntime.jsx(g,p(i({css:[{display:"flex",flexDirection:"column"},t]},r),{ref:o,children:e}))}),H={Column:it,Row:nt};var U=___namespace.forwardRef((n,o)=>{var s=n,{as:e,children:t}=s,r=f(s,["as","children"]);let l=e!=null?e:H.Column;return jsxRuntime.jsx(l,p(i({backgroundColor:"neutral.background",borderRadius:"md",boxShadow:"md",p:5},r),{ref:o,children:t}))});var N={};ae(N,{Body1:()=>ut,Body2:()=>mt,Caption:()=>gt,Display1:()=>at,Display2:()=>lt,H1:()=>pt,H2:()=>ct,H3:()=>dt,H4:()=>ft});var w={color:"neutral.foreground",fontFamily:"default",margin:0},at=p(i({},w),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),lt=p(i({},w),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),pt=p(i({},w),{fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"}),ct=p(i({},w),{fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"}),dt=p(i({},w),{fontSize:"xl",fontWeight:"bold",lineHeight:"lg"}),ft=p(i({},w),{fontSize:"lg",fontWeight:"bold",lineHeight:"md"}),ut=p(i({},w),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),mt=p(i({},w),{fontSize:"sm",fontWeight:"regular",lineHeight:"md"}),gt=p(i({},w),{fontSize:"xs",fontWeight:"regular",lineHeight:"sm"});function Be(n){var s=n,{as:e="span",children:t,variant:r="Body1"}=s,o=f(s,["as","children","variant"]);return jsxRuntime.jsx(g,p(i(i({as:e},N[r]),o),{children:t}))}var xt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],bt=Object.fromEntries(xt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,r=o=>jsxRuntime.jsx(Be,p(i({as:t},o),{variant:e,children:o.children}));return r.displayName=`Text.${e}`,[e,r]})),B=Object.assign(Be,bt);var G={};ae(G,{Link:()=>Pt,Plain:()=>vt,Primary:()=>yt,Secondary:()=>ht,base:()=>O});var O=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),yt=({colors:e})=>[O,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],ht=({colors:e})=>[O,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],Pt=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],vt=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.neutral.foreground}];function Re(s){var l=s,{as:e,children:t,title:r,variant:o="Primary"}=l,n=f(l,["as","children","title","variant"]);return jsxRuntime.jsxs(g,p(i({as:e!=null?e:"button",css:G[o]},n),{children:[t,r&&jsxRuntime.jsx(B.Body2,{fontWeight:"demibold",color:"inherit",children:r})]}))}var Tt=["Primary","Secondary","Link","Plain"],wt=Object.fromEntries(Tt.map(e=>{let t=e.toLocaleLowerCase(),r=s=>{var l=s,{part:o}=l,n=f(l,["part"]);return jsxRuntime.jsx(Re,p(i({part:[`button-${t}`,o]},n),{variant:e,children:n.children}))};return r.displayName=`Text.${e}`,[e,r]})),E=Object.assign(Re,wt);var C=_.createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function Ot(n){var s=n,{children:e,navigate:t,theme:r}=s,o=f(s,["children","navigate","theme"]);let l=r?j(r):{},[c,d]=_.useState([]),u=_.useRef(new js.Frigade(o.apiKey,{apiKey:o.apiKey,apiUrl:o.apiUrl,userId:o.userId,groupId:o.groupId})),v=t!=null?t:(y,P="_self")=>{window.open(y,P);};return jsxRuntime.jsxs(C.Provider,{value:p(i({modals:c,setModals:d,navigate:v},o),{frigade:u.current}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},xe),l)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:m,children:e})]})}function X(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,r]=_.useState(e),[o,n]=_.useState(null),s=_.useCallback(l=>{n(l);},[]);return _.useLayoutEffect(()=>{o&&r(o.getBoundingClientRect());},[o]),{node:o,rect:t,ref:s}}var It=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Me(o){var n=o,{style:e={},part:t=""}=n,r=f(n,["style","part"]);return jsxRuntime.jsxs(g,p(i({part:`dot-wrapper ${t}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},r),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${It}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function De(o){var n=o,{part:e,src:t}=n,r=f(n,["part","src"]);return jsxRuntime.jsx(g,i({as:"img",part:["image",e],src:t},r))}function $t(e){var t,r,o;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(o=e.split("wistia.com/medias/")[1])==null?void 0:o.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Ae(o){var n=o,{part:e,src:t}=n,r=f(n,["part","src"]);let s=$t(t);return jsxRuntime.jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:s},r))}function q(o){var n=o,{src:e,type:t}=n,r=f(n,["src","type"]);return jsxRuntime.jsx(t==="video"?Ae:De,i({src:e},r))}function Ie({props:e,alignAttr:t,sideAttr:r}){let o=r!=null?r:"bottom",n={},s=()=>{var u;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (u=e.align)!=null?u:"after"},l="-24px",c={top:"bottom",right:"left",bottom:"top",left:"right"};n[c[o]]=l;let d=s();return ["before","end"].includes(d)?["top","bottom"].includes(o)?n.right=l:n.bottom=l:["after","start"].includes(d)?["top","bottom"].includes(o)?n.left=l:n.top=l:["top","bottom"].includes(o)?n.left=`calc(50% + ${l})`:n.top=`calc(50% + ${l})`,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 We(e,t){var n,s,l,c,d;let r=Object.fromEntries(Ve.content.map(u=>[u,e[u]]).filter(u=>u[1]!==void 0)),o=Object.fromEntries(Ve.root.map(u=>[u,e[u]]).filter(u=>u[1]!==void 0));if(r.align=(n=r.align)!=null?n:"after",r.side=(s=r.side)!=null?s:"bottom",["before","after"].includes(r.align)){let u={after:"end",before:"start"},v=(I,V)=>["top","bottom"].includes(V)?I=="after"?"marginLeft":"marginRight":I=="after"?"marginTop":"marginBottom",y=(l=r.alignOffset)!=null?l:0,P=(c=r.style)!=null?c:{},h=(d=r.side)!=null?d:"bottom",D=r.align;r.style=p(i({},P),{[v(D,h)]:y});let A=["top","bottom"].includes(h)?t.width:t.height;r.alignOffset=(A+y)*-1,r.align=u[D];}return {contentProps:r,rootProps:o}}function x(l){var c=l,{anchor:e,children:t,className:r,spotlight:o=!1,style:n}=c,s=f(c,["anchor","children","className","spotlight","style"]);let{node:d,rect:u,ref:v}=X(),{contentProps:y,rootProps:P}=We(s,u),[h,D]=_.useState(y.align),[A,I]=_.useState(y.side);if(d!==null){let R=d.getAttribute("data-align"),re=d.getAttribute("data-side");h!==R&&D(R),A!==re&&I(re);}let V=_.useRef(null),[W,_e]=_.useState(null);if(_.useEffect(()=>{let R=document.querySelector(e);R!=null&&(V.current=R,_e(V));},[e]),W==null)return null;let $=W.current.getBoundingClientRect(),te="0";typeof window!="undefined"&&(te=window.getComputedStyle(W.current).borderRadius);let Ue=Ie({props:s,alignAttr:h,sideAttr:A});return jsxRuntime.jsxs(T__namespace.Root,p(i({defaultOpen:!0},P),{children:[jsxRuntime.jsx(T__namespace.Anchor,{virtualRef:W}),jsxRuntime.jsx(T__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:r,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[o&&jsxRuntime.jsx(g,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:te,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:$.height,left:$.left,top:$.top,width:$.width}}),jsxRuntime.jsx(T__namespace.Content,p(i({asChild:!0},y),{ref:v,children:jsxRuntime.jsxs(U,{part:"tooltip-content",position:"relative",css:i({maxWidth:"360px"},n),children:[jsxRuntime.jsx(Me,{style:Ue}),t]})}))]})})]}))}x.Close=e=>jsxRuntime.jsx(T__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(E.Plain,p(i({css:{top:"12px",right:"4px"},part:"tooltip-close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});x.Media=r=>{var o=r,{src:e}=o,t=f(o,["src"]);return e==null?null:jsxRuntime.jsx(q,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=o=>{var n=o,{onClick:e,title:t}=n,r=f(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(E.Primary,i({title:t,onClick:e},r))};x.Progress=r=>{var o=r,{children:e}=o,t=f(o,["children"]);return e==null?null:jsxRuntime.jsx(B.Body2,p(i({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=o=>{var n=o,{onClick:e,title:t}=n,r=f(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(E.Secondary,i({title:t,onClick:e},r))};x.Subtitle=r=>{var o=r,{children:e}=o,t=f(o,["children"]);return e==null?null:jsxRuntime.jsx(B.Body2,p(i({part:"subtitle"},t),{children:e}))};x.Title=r=>{var o=r,{children:e}=o,t=f(o,["children"]);return e==null?null:jsxRuntime.jsx(B.Body1,p(i({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};function Y(e,t){let[r,o]=_.useState(),[n,s]=_.useState(""),{frigade:l}=_.useContext(C),c=d=>{d.id===e&&(t!=null&&t.variables&&d.applyVariables(t.variables),o(d),s(Math.random().toString()));};return _.useEffect(()=>(S(this,null,function*(){let d=yield l.getFlow(e);t!=null&&t.variables&&d.applyVariables(t.variables),o(d);}),l.onStateChange(c),()=>{l.removeStateChangeHandler(c);}),[]),{flow:r}}function Z(e){let{modals:t,setModals:r}=_.useContext(C),[o,n]=_.useState(!1);return _.useEffect(()=>(r([...t,e]),()=>r(t.filter(s=>s!==e))),[]),_.useEffect(()=>{let s=t[0]===e;s!==o&&n(s);},[t]),{isCurrentModal:o}}function M(e,{onComplete:t,onDismiss:r}={}){let o=_.useRef(null);return _.useEffect(()=>{e!=null&&(e.isCompleted&&o.current===!1&&t&&t(e),o.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:_.useCallback(n=>S(this,null,function*(){if((r==null?void 0:r(e,n))===!1)return n.preventDefault(),!1;yield e.skip();}),[e])}}function ee(e,{onPrimary:t,onSecondary:r}={}){let{navigate:o}=_.useContext(C);return {handlePrimary:_.useCallback(n=>S(this,null,function*(){if((t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;yield e.complete(),e.primaryButtonUri!=null&&o(e.primaryButtonUri,e.primaryButtonUriTarget);}),[e]),handleSecondary:_.useCallback(n=>S(this,null,function*(){if((r==null?void 0:r(e,n))===!1)return n.preventDefault(),!1;yield e.complete(),e.secondaryButtonUri!=null&&o(e.secondaryButtonUri,e.secondaryButtonUriTarget);}),[e])}}function Ke(l){var c=l,{step:e,flow:t,onDismiss:r,onPrimary:o,onSecondary:n}=c,s=f(c,["step","flow","onDismiss","onPrimary","onSecondary"]);var P;let{isCurrentModal:d}=Z(`${t.id}-${e.id}`),{handleDismiss:u}=M(t,{onDismiss:r}),{handlePrimary:v,handleSecondary:y}=ee(e,{onPrimary:o,onSecondary:n});return d?jsxRuntime.jsxs(x,p(i({anchor:e.selector,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault()},s),{children:[jsxRuntime.jsx(x.Close,{onClick:u}),jsxRuntime.jsx(x.Media,{src:(P=e.videoUri)!=null?P:e.imageUri,type:e.videoUri?"video":"image"}),jsxRuntime.jsx(x.Title,{children:e.title}),jsxRuntime.jsx(x.Subtitle,{children:e.subtitle}),jsxRuntime.jsxs(H.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(x.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(x.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:y}),jsxRuntime.jsx(x.Primary,{title:e.primaryButtonTitle,onClick:v})]})]}),e.id):null}function Zt(n){var s=n,{flowId:e,onComplete:t,variables:r}=s,o=f(s,["flowId","onComplete","variables"]);let{flow:l}=Y(e,{variables:r});if(M(l,{onComplete:t}),l==null||l.isVisible===!1)return null;l.start();let c=l.getCurrentStep();return c==null||c.start(),jsxRuntime.jsx(Ke,i({step:c,flow:l},o))}function rr(){let{frigade:e}=_.useContext(C);return {frigade:e}}
38
+ var je=Object.defineProperty;var te=(e,t)=>{for(var r in t)je(e,r,{get:t[r],enumerable:!0});};var re={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var oe={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 ne={md:"10px",lg:"20px",round:"50%"};var a=e=>`var(--fr-colors-${e})`,ie={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var ae={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ue="px",_e=e=>typeof e=="number"?`${4*e}${Ue}`:e,Ke=[-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"],se=Object.fromEntries(Ke.map(e=>[e,_e(e)]));var le={fontFamilies:{default:"TT Interphases Pro, sans-serif"},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 z={...re,colors:{...oe,...ie},...le,radii:ne,shadows:ae,space:se};function E(e,t="",r="."){return Object.keys(e).reduce((o,n)=>{let i=`${t.length?`${t}${r}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(o,E(l,i,r)):o[i]=l,o},{})}function j(e){return E(e,"--fr","-")}function pe(e,t="--fr"){let r={};return Object.keys(e).forEach(o=>{let n=e[o];typeof n=="object"&&n!==null&&!Array.isArray(n)?r[o]=pe(n,`${t}-${o}`):r[o]=`var(${t}-${o})`;}),r}var ce=j(z),p=pe(z);var U=E(p.colors),de={color:U,backgroundColor:U,borderColor:U,border:p.borders,borderRadius:p.radii,borderWidth:p.borderWidths,boxShadow:p.shadows,fontFamily:p.fontFamilies,fontSize:p.fontSizes,fontWeight:p.fontWeights,gap:p.space,lineHeight:p.lineHeights,margin:p.space,marginTop:p.space,marginRight:p.space,marginBottom:p.space,marginLeft:p.space,padding:p.space,paddingTop:p.space,paddingRight:p.space,paddingBottom:p.space,paddingLeft:p.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"],textAlign:["center","end","start","right","left","justify","inherit","initial","revert","revert-layer","unset"]},ue={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"]};function Ne(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var Xe=new Map(Object.entries(de).map(([e,t])=>[e,Ne(t)])),Ge=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)]));function fe(e){let t=Object.assign({},e),r={};return Object.entries(t).forEach(([o,n])=>{let s=Ge.get(o);s!=null&&(s.forEach(i=>{t[i]=n;}),delete t[o]);}),Object.entries(t).forEach(([o,n])=>{let s=Xe.get(o);if(s!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let i=n.split(" ");r[o]=i.map(l=>s.get(l.toString())??l).join(" "),delete t[o];}else s.has(n.toString())&&(r[o]=s.get(n.toString()),delete t[o]);}),{cssFromProps:r,unmatchedProps:t}}function me(e){return e?{__html:qe__default.default.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 ge(e){return e&&`fr-${e}`}function Qe(e){return e&&(Array.isArray(e)?e.map(t=>ge(t)).join(" "):ge(e))}function Ye({as:e,children:t,className:r,css:o,part:n,...s},i){let l=e??"div",{cssFromProps:c,unmatchedProps:u}=fe(s),m=Qe(n),S=r||m?clsx.clsx(r,m):void 0,M=[{boxSizing:"border-box"},c,o];return typeof t=="string"?jsxRuntime.jsx(l,{className:S,css:M,...u,ref:i,dangerouslySetInnerHTML:me(t)}):jsxRuntime.jsx(l,{className:S,css:M,...u,ref:i,children:t})}var d=N__namespace.forwardRef(Ye);var _={};te(_,{Body1:()=>it,Body2:()=>at,Caption:()=>st,Display1:()=>Ze,Display2:()=>et,H1:()=>tt,H2:()=>rt,H3:()=>ot,H4:()=>nt});var v={color:"neutral.foreground",fontFamily:"default",margin:0},Ze={...v,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},et={...v,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},tt={...v,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},rt={...v,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},ot={...v,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},nt={...v,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},it={...v,fontSize:"md",fontWeight:"regular",lineHeight:"md"},at={...v,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},st={...v,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function ye({as:e="span",children:t,variant:r="Body1",...o}){return jsxRuntime.jsx(d,{as:e,..._[r],...o,children:t})}var lt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],pt=Object.fromEntries(lt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,r=o=>jsxRuntime.jsx(ye,{as:t,...o,variant:e,children:o.children});return r.displayName=`Text.${e}`,[e,r]})),h=Object.assign(ye,pt);var K={};te(K,{Link:()=>ut,Plain:()=>ft,Primary:()=>ct,Secondary:()=>dt,base:()=>I});var I=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),ct=({colors:e})=>[I,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],dt=({colors:e})=>[I,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],ut=({colors:e})=>[I,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],ft=({colors:e})=>[I,{backgroundColor:e.transparent,color:e.neutral.foreground}];function Pe({as:e,children:t,title:r,variant:o="Primary",...n}){return jsxRuntime.jsxs(d,{as:e??"button",css:K[o],...n,children:[t,r&&jsxRuntime.jsx(h.Body2,{fontWeight:"demibold",color:"inherit",children:r})]})}var mt=["Primary","Secondary","Link","Plain"],gt=Object.fromEntries(mt.map(e=>{let t=e.toLocaleLowerCase(),r=({part:o,...n})=>jsxRuntime.jsx(Pe,{part:[`button-${t}`,o],...n,variant:e,children:n.children});return r.displayName=`Text.${e}`,[e,r]})),P=Object.assign(Pe,gt);var bt=N__namespace.forwardRef(({children:e,css:t,...r},o)=>jsxRuntime.jsx(d,{css:[{display:"flex",flexDirection:"row"},t],...r,ref:o,children:e})),yt=N__namespace.forwardRef(({children:e,css:t,...r},o)=>jsxRuntime.jsx(d,{css:[{display:"flex",flexDirection:"column"},t],...r,ref:o,children:e})),C={Column:yt,Row:bt};var R=N__namespace.forwardRef(({as:e,children:t,...r},o)=>{let n=e??C.Column;return jsxRuntime.jsx(n,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...r,ref:o,children:t})});function Te({part:e,src:t,...r}){return jsxRuntime.jsx(d,{as:"img",part:["image",e],src:t,...r})}function Ct(e){var t,r,o;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(o=e.split("wistia.com/medias/")[1])==null?void 0:o.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Be({part:e,src:t,...r}){let o=Ct(t);return jsxRuntime.jsx(d,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:o,...r})}function V({src:e,type:t,...r}){return jsxRuntime.jsx(t==="video"?Be:Te,{src:e,...r})}function x({children:e,...t}){return jsxRuntime.jsx(b__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsxs(b__namespace.Portal,{children:[jsxRuntime.jsx(b__namespace.Overlay,{style:{background:"rgb(0 0 0 / 0.5)",position:"fixed",inset:0}}),jsxRuntime.jsx(b__namespace.Content,{asChild:!0,onOpenAutoFocus:r=>r.preventDefault(),onPointerDownOutside:r=>r.preventDefault(),children:jsxRuntime.jsx(R,{boxShadow:"md",css:{left:"50%",maxWidth:430,top:"50%",transform:"translate(-50%, -50%)"},p:8,position:"fixed",textAlign:"center",...t,children:e})})]})})}x.Close=e=>jsxRuntime.jsx(b__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(P.Plain,{css:{top:"4px",right:"-4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});x.Subtitle=({children:e,...t})=>jsxRuntime.jsx(b__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(h.Body2,{part:"subtitle",mb:5,...t,children:e})});x.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(V,{borderRadius:"md",src:e,...t});x.Primary=({onClick:e,title:t,...r})=>t==null?null:jsxRuntime.jsx(P.Primary,{title:t,onClick:e,...r});x.ProgressDots=({current:e,total:t})=>{let r=[...Array(t)].map((o,n)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?p.colors.blue500:p.colors.blue800},n));return jsxRuntime.jsx(d,{as:"svg",width:16*t-8,height:"8px",viewBox:`0 0 ${16*t-8} 8`,margin:"5 auto",children:r})};x.Secondary=({onClick:e,title:t,...r})=>t==null?null:jsxRuntime.jsx(P.Secondary,{title:t,onClick:e,...r});x.Title=({children:e,...t})=>jsxRuntime.jsx(b__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(h.H3,{mb:1,part:"title",...t,children:e})});var T=N.createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function Ht({children:e,navigate:t,theme:r,...o}){let n=r?j(r):{},[s,i]=N.useState([]),l=N.useRef(new js.Frigade(o.apiKey,{apiKey:o.apiKey,apiUrl:o.apiUrl,userId:o.userId,groupId:o.groupId})),c=t??((u,m="_self")=>{window.open(u,m);});return jsxRuntime.jsxs(T.Provider,{value:{modals:s,setModals:i,navigate:c,...o,frigade:l.current},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...ce,...n}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:p,children:e})]})}function F(e,t){let[r,o]=N.useState(),[n,s]=N.useState(""),{frigade:i}=N.useContext(T),l=c=>{c.id===e&&(t!=null&&t.variables&&c.applyVariables(t.variables),o(c),s(Math.random().toString()));};return N.useEffect(()=>((async()=>{let c=await i.getFlow(e);t!=null&&t.variables&&c.applyVariables(t.variables),o(c);})(),i.onStateChange(l),()=>{i.removeStateChangeHandler(l);}),[]),{flow:r}}function B(e,{onComplete:t,onDismiss:r}={}){let o=N.useRef(null);return N.useEffect(()=>{e!=null&&(e.isCompleted&&o.current===!1&&(async()=>await(t==null?void 0:t(e)))(),o.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:N.useCallback(async n=>{if(await(r==null?void 0:r(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function k(e,{onPrimary:t,onSecondary:r}={}){let{navigate:o}=N.useContext(T);return {handlePrimary:N.useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&o(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:N.useCallback(async n=>{if(await(r==null?void 0:r(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&o(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Lt({flowId:e,onComplete:t,onDismiss:r,onPrimary:o,onSecondary:n,variables:s}){let{flow:i}=F(e,{variables:s}),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:c}=B(i,{onComplete:t,onDismiss:r}),{handlePrimary:u,handleSecondary:m}=k(l,{onPrimary:o,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxRuntime.jsxs(x,{children:[jsxRuntime.jsx(x.Close,{onClick:c}),jsxRuntime.jsx(x.Title,{children:l.title}),jsxRuntime.jsx(x.Subtitle,{children:l.subtitle}),jsxRuntime.jsx(x.Media,{src:l.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(x.ProgressDots,{current:i.getNumberOfCompletedSteps(),total:i.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(C.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsxRuntime.jsx(x.Secondary,{title:"Secondary",onClick:m}),jsxRuntime.jsx(x.Primary,{title:"Primary",onClick:u})]})]}))}function jt({flowId:e,onComplete:t,onDismiss:r,onPrimary:o,onSecondary:n,...s}){let{flow:i}=F(e),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:c}=B(i,{onComplete:t,onDismiss:r}),{handlePrimary:u,handleSecondary:m}=k(l,{onPrimary:o,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxRuntime.jsxs(R,{as:C.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxRuntime.jsxs(C.Row,{gap:3,children:[jsxRuntime.jsx("img",{src:l.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(C.Column,{children:[jsxRuntime.jsx(h.H4,{mb:1,children:l.title}),jsxRuntime.jsx(h.Body2,{children:l.subtitle})]})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,children:[jsxRuntime.jsx(P.Secondary,{title:l.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(P.Primary,{title:l.primaryButtonTitle,onClick:u}),jsxRuntime.jsx(P.Plain,{part:"banner-close",onClick:c,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function X(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,r]=N.useState(e),[o,n]=N.useState(null),s=N.useCallback(i=>{n(i);},[]);return N.useLayoutEffect(()=>{o&&r(o.getBoundingClientRect());},[o]),{node:o,rect:t,ref:s}}var Nt=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function He({style:e={},part:t="",...r}){return jsxRuntime.jsxs(d,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...r,children:[jsxRuntime.jsx(d,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Nt}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(d,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Me({props:e,alignAttr:t,sideAttr:r}){let o=r??"bottom",n={},s=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},i="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[o]]=i;let c=s();return ["before","end"].includes(c)?["top","bottom"].includes(o)?n.right=i:n.bottom=i:["after","start"].includes(c)?["top","bottom"].includes(o)?n.left=i:n.top=i:["top","bottom"].includes(o)?n.left=`calc(50% + ${i})`:n.top=`calc(50% + ${i})`,n}var Ae={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ee(e,t){let r=Object.fromEntries(Ae.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),o=Object.fromEntries(Ae.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0));if(r.align=r.align??"after",r.side=r.side??"bottom",["before","after"].includes(r.align)){let n={after:"end",before:"start"},s=(S,M)=>["top","bottom"].includes(M)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",i=r.alignOffset??0,l=r.style??{},c=r.side??"bottom",u=r.align;r.style={...l,[s(u,c)]:i};let m=["top","bottom"].includes(c)?t.width:t.height;r.alignOffset=(m+i)*-1,r.align=n[u];}return {contentProps:r,rootProps:o}}function f({anchor:e,children:t,className:r,spotlight:o=!1,style:n,...s}){let{node:i,rect:l,ref:c}=X(),{contentProps:u,rootProps:m}=Ee(s,l),[S,M]=N.useState(u.align),[Q,$e]=N.useState(u.side);if(i!==null){let A=i.getAttribute("data-align"),ee=i.getAttribute("data-side");S!==A&&M(A),Q!==ee&&$e(ee);}let Y=N.useRef(null),[W,Le]=N.useState(null);if(N.useEffect(()=>{let A=document.querySelector(e);A!=null&&(Y.current=A,Le(Y));},[e]),W==null)return null;let $=W.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(W.current).borderRadius);let ze=Me({props:s,alignAttr:S,sideAttr:Q});return jsxRuntime.jsxs(w__namespace.Root,{defaultOpen:!0,...m,children:[jsxRuntime.jsx(w__namespace.Anchor,{virtualRef:W}),jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:r,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[o&&jsxRuntime.jsx(d,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:$.height,left:$.left,top:$.top,width:$.width}}),jsxRuntime.jsx(w__namespace.Content,{asChild:!0,...u,ref:c,children:jsxRuntime.jsxs(R,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...n},children:[jsxRuntime.jsx(He,{style:ze}),t]})})]})})]})}f.Close=e=>jsxRuntime.jsx(w__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(P.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});f.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(V,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});f.Primary=({onClick:e,title:t,...r})=>t==null?null:jsxRuntime.jsx(P.Primary,{title:t,onClick:e,...r});f.Progress=({children:e,...t})=>e==null?null:jsxRuntime.jsx(h.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});f.Secondary=({onClick:e,title:t,...r})=>t==null?null:jsxRuntime.jsx(P.Secondary,{title:t,onClick:e,...r});f.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(h.Body2,{part:"subtitle",...t,children:e});f.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(h.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function J(e){let{modals:t,setModals:r}=N.useContext(T),[o,n]=N.useState(!1);return N.useEffect(()=>(r([...t,e]),()=>r(t.filter(s=>s!==e))),[]),N.useEffect(()=>{let s=t[0]===e;s!==o&&n(s);},[t]),{isCurrentModal:o}}function We({step:e,flow:t,onDismiss:r,onPrimary:o,onSecondary:n,...s}){let{isCurrentModal:i}=J(`${t.id}-${e.id}`),{handleDismiss:l}=B(t,{onDismiss:r}),{handlePrimary:c,handleSecondary:u}=k(e,{onPrimary:o,onSecondary:n});return i?jsxRuntime.jsxs(f,{anchor:e.selector,onOpenAutoFocus:m=>m.preventDefault(),onPointerDownOutside:m=>m.preventDefault(),...s,children:[jsxRuntime.jsx(f.Close,{onClick:l}),jsxRuntime.jsx(f.Media,{src:e.videoUri??e.imageUri,type:e.videoUri?"video":"image"}),jsxRuntime.jsx(f.Title,{children:e.title}),jsxRuntime.jsx(f.Subtitle,{children:e.subtitle}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(f.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(f.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsxRuntime.jsx(f.Primary,{title:e.primaryButtonTitle,onClick:c})]})]},e.id):null}function Zt({flowId:e,onComplete:t,variables:r,...o}){let{flow:n}=F(e,{variables:r});if(B(n,{onComplete:t}),n==null||n.isVisible===!1)return null;n.start();let s=n.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(We,{step:s,flow:n,...o})}function rr(){let{frigade:e}=N.useContext(T);return {frigade:e}}
37
39
 
38
- exports.Box = g;
39
- exports.Button = E;
40
- exports.Card = U;
41
- exports.Flex = H;
42
- exports.Provider = Ot;
43
- exports.Text = B;
44
- exports.Tooltip = x;
40
+ exports.Announcement = Lt;
41
+ exports.Banner = jt;
42
+ exports.Box = d;
43
+ exports.Button = P;
44
+ exports.Card = R;
45
+ exports.Flex = C;
46
+ exports.Provider = Ht;
47
+ exports.Text = h;
48
+ exports.Tooltip = f;
45
49
  exports.Tour = Zt;
46
50
  exports.useBoundingClientRect = X;
47
- exports.useFlow = Y;
48
- exports.useFlowHandlers = M;
51
+ exports.useFlow = F;
52
+ exports.useFlowHandlers = B;
49
53
  exports.useFrigade = rr;
50
- exports.useModal = Z;
51
- exports.useStepHandlers = ee;
54
+ exports.useModal = J;
55
+ exports.useStepHandlers = k;
52
56
  //# sourceMappingURL=out.js.map
53
57
  //# sourceMappingURL=index.cjs.map