@frigade/react 2.6.1 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +51 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
import { keyframes, Global, ThemeProvider } from '@emotion/react';
|
|
3
3
|
import * as X from '@radix-ui/react-dialog';
|
|
4
4
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
5
|
-
import * as
|
|
5
|
+
import * as Oo from 'react';
|
|
6
6
|
import { createContext, useContext, useCallback, useState, useEffect, useLayoutEffect, useRef, useMemo, useSyncExternalStore, Fragment as Fragment$1 } from 'react';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import gn from 'known-css-properties';
|
|
9
|
+
import Fn from 'dompurify';
|
|
10
10
|
import { FlowType, Frigade } from '@frigade/js';
|
|
11
11
|
import * as js from '@frigade/js';
|
|
12
12
|
export { js as FrigadeJS };
|
|
13
|
-
import
|
|
14
|
-
import * as
|
|
13
|
+
import gi from 'embla-carousel-react';
|
|
14
|
+
import * as Ie from '@radix-ui/react-collapsible';
|
|
15
15
|
import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
|
|
16
|
-
import * as
|
|
16
|
+
import * as Ae from '@radix-ui/react-radio-group';
|
|
17
17
|
import * as L from '@radix-ui/react-select';
|
|
18
|
-
import * as
|
|
18
|
+
import * as lo from '@radix-ui/react-checkbox';
|
|
19
19
|
import { createPortal } from 'react-dom';
|
|
20
20
|
import { RemoveScroll } from 'react-remove-scroll';
|
|
21
21
|
import { useFloating, autoUpdate, offset, flip, shift, useClick, useDismiss, useRole, useTransitionStatus, useInteractions } from '@floating-ui/react';
|
|
22
22
|
import * as de from '@radix-ui/react-popover';
|
|
23
23
|
|
|
24
|
-
var st=Object.defineProperty,sn=Object.defineProperties;var ln=Object.getOwnPropertyDescriptors;var Je=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable;var at=(e,o,t)=>o in e?st(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))lt.call(o,t)&&at(e,t,o[t]);if(Je)for(var t of Je(o))pt.call(o,t)&&at(e,t,o[t]);return e},p=(e,o)=>sn(e,ln(o));var pn=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,o)=>{var t={};for(var n in e)lt.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Je)for(var n of Je(e))o.indexOf(n)<0&&pt.call(e,n)&&(t[n]=e[n]);return t};var ue=(e,o)=>{for(var t in o)st(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((n,r)=>{var i=d=>{try{l(t.next(d));}catch(u){r(u);}},s=d=>{try{l(t.throw(d));}catch(u){r(u);}},l=d=>d.done?n(d.value):Promise.resolve(d.value).then(i,s);l((t=t.apply(e,o)).next());});function ke(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var ct={borderWidths:{md:"1px"}};var qe=[5,10,20,35,50,65,80,95,98],ut=[...qe],Fo=[...qe];ut[4]=40;Fo[4]=60;var dn={blue:{h:213,s:100,l:qe},gray:{h:220,s:10,l:qe},green:{h:141,s:90,l:ut},red:{h:9,s:90,l:Fo},yellow:{h:50,s:90,l:Fo}};var $={};for(let[e,{h:o,s:t,l:n}]of Object.entries(dn))$[e]=Object.fromEntries(n.map((r,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var mt=p(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},$),{gray100:$.gray[100],gray200:$.gray[200],gray300:$.gray[300],gray400:$.gray[400],gray500:$.gray[500],gray600:$.gray[600],gray700:$.gray[700],gray800:$.gray[800],gray900:$.gray[900],blue400:$.blue[400],blue500:$.blue[500],blue800:$.blue[800],blue900:$.blue[900],green400:$.green[400],green500:$.green[500],green800:$.green[800],red500:$.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var ft={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,gt={negative:{100:c("red-100"),200:c("red-200"),300:c("red-300"),400:c("red-400"),500:c("red-500"),600:c("red-600"),700:c("red-700"),800:c("red-800"),900:c("red-900"),background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500"),active:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")},focus:{background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500")},hover:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")}},neutral:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700"),active:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},focus:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},hover:{background:c("neutral-900"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700")}},positive:{100:c("green-100"),200:c("green-200"),300:c("green-300"),400:c("green-400"),500:c("green-500"),600:c("green-600"),700:c("green-700"),800:c("green-800"),900:c("green-900"),background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500"),active:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")},focus:{background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500")},hover:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")}},primary:{100:c("blue-100"),200:c("blue-200"),300:c("blue-300"),400:c("blue-400"),500:c("blue-500"),600:c("blue-600"),700:c("blue-700"),800:c("blue-800"),900:c("blue-900"),background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500"),active:{background:c("primary-300"),border:c("primary-300"),foreground:c("white"),surface:c("primary-300")},focus:{background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500")},hover:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")}},secondary:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900"),active:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")},focus:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900")},hover:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")}}};var yt={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var cn="px",un=e=>typeof e=="number"?`${4*e}${cn}`:e,mn=[-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"],xt=Object.fromEntries(mn.map(e=>[e,un(e)]));var ht={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 Ze=p(a(p(a({},ct),{colors:a(a({},mt),gt)}),ht),{radii:ft,shadows:yt,space:xt});function We(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,l=e[r];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(n,We(l,s,t)):n[s]=l,n},{})}function vo(e){let o=We(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function bt(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],i=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=bt(r,`${o}-${n}`):t[n]=`var(${o}-${i})`;}),t}var Ro=vo(Ze),E=bt(Ze);var gn=new Set(["alt","size","src"]),yn=fn.all.filter(e=>e.indexOf("-")!=0&&!gn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),xn=Object.fromEntries(yn),Ye=We(E.colors),hn={color:Ye,backgroundColor:Ye,borderColor:Ye,border:a(a({},E.borderWidths),Ye),borderRadius:E.radii,borderWidth:E.borderWidths,boxShadow:E.shadows,fontFamily:E.fontFamilies,fontSize:E.fontSizes,fontWeight:E.fontWeights,gap:E.space,lineHeight:E.lineHeights,margin:E.space,marginBottom:E.space,marginLeft:E.space,marginRight:E.space,marginTop:E.space,padding:E.space,paddingBottom:E.space,paddingLeft:E.space,paddingRight:E.space,paddingTop:E.space},Pt=a(a({},xn),hn),Ct={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"]},St=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function bn(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 wt=new Map(Object.entries(Pt).map(([e,o])=>[e,bn(o)])),Pn=new Map(Object.entries(Ct).map(([e,o])=>[e,new Set(o)])),Cn=new Set(["height","width"]),Sn=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ft(e){let[o,t]=e.split(":");return [o,St.has(t)?t:null]}function vt(e,o="div"){let t=Object.assign({},e),n={};function r(i){if(i==null)return n;let l=`&:${i.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[l]==null&&(n[l]={}),n[l]}return Object.entries(t).forEach(([i,s])=>{let[l,d]=Ft(i),u=Pn.get(l);u!=null&&(u.forEach(m=>{let f=`${m}${d?":"+d:""}`;t[f]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,d]=Ft(i),u=wt.get(l);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let m=s.split(" ");r(d)[l]=m.map(f=>{var x;return (x=u.get(f.toString()))!=null?x:f}).join(" ");}else u.has(s.toString())?r(d)[l]=u.get(s.toString()):r(d)[l]=s;(typeof o!="string"||!Sn.has(o)||!Cn.has(l))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&wt.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:n,unmatchedProps:t}}function Fn(){if(typeof window=="undefined"){let{JSDOM:e}=pn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Rt(e){return e?{__html:wn(Fn()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Rn(e){return e&&`fr-${e}`}function Bt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Bt(o)).join(" "):Rn(e))}function Tn(l,s){var d=l,{as:e,children:o,className:t,css:n={},part:r}=d,i=g(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:m,unmatchedProps:f}=vt(i,u),x=Bt(r),v=t||x?clsx(t,x):void 0,C=[{boxSizing:"border-box"},m,n];return typeof o=="string"?jsx(u,p(a({className:v,css:C},f),{ref:s,dangerouslySetInnerHTML:Rt(o)})):jsx(u,p(a({className:v,css:C},f),{ref:s,children:o}))}var y=Eo.forwardRef(Tn);var I={};ue(I,{Link:()=>ti,Plain:()=>ri,Primary:()=>ei,Secondary:()=>oi});var R={};ue(R,{Body1:()=>Un,Body2:()=>Gn,Caption:()=>Kn,Display1:()=>$n,Display2:()=>Wn,H1:()=>Ln,H2:()=>Nn,H3:()=>_n,H4:()=>zn});var To={};ue(To,{Body1:()=>Hn,Body2:()=>Vn,Caption:()=>An,Display1:()=>kn,Display2:()=>Bn,H1:()=>En,H2:()=>On,H3:()=>Dn,H4:()=>In});var me={color:"neutral.foreground",fontFamily:"default",margin:"0"},kn=p(a({},me),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Bn=p(a({},me),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),En=p(a({},me),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),On=p(a({},me),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Dn=p(a({},me),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),In=p(a({},me),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Hn=p(a({},me),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Vn=p(a({},me),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),An=p(a({},me),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Mn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],fe=Object.fromEntries(Mn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Eo.forwardRef((l,s)=>{var d=l,{as:n=o,children:r}=d,i=g(d,["as","children"]);return jsx(y,p(a(a({as:n},To[e]),i),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),$n=fe.Display1,Wn=fe.Display2,Ln=fe.H1,Nn=fe.H2,_n=fe.H3,zn=fe.H4,Un=fe.Body1,Gn=fe.Body2,Kn=fe.Caption;var Bo={};ue(Bo,{Link:()=>Zn,Plain:()=>Yn,Primary:()=>Jn,Secondary:()=>qn,loadingCSSStyle:()=>ko});var Qe={alignItems:"center",borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit","opacity:disabled":"0.6","pointerEvents:disabled":"none"},Jn=p(a({},Qe),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:active":"primary.active.surface","backgroundColor:disabled":"primary.surface"}),qn=p(a({},Qe),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:active":"secondary.active.surface","backgroundColor:disabled":"secondary.background"}),Zn=p(a({},Qe),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),Yn=p(a({},Qe),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Qn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),ko={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:Qn+" 1s ease infinite"}};function eo(s){var l=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=l,i=g(l,["as","children","part","title","variant"]);var u;let d=r.toLocaleLowerCase();return jsxs(y,p(a(p(a({as:e!=null?e:"button",part:[`button-${d}`,t]},Bo[r]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?ko:{})}),i),{loading:void 0,children:[o,n&&jsx(R.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function ei(t){var n=t,{children:e}=n,o=g(n,["children"]);return jsx(eo,p(a({},o),{variant:"Primary",children:e}))}function oi(t){var n=t,{children:e}=n,o=g(n,["children"]);return jsx(eo,p(a({},o),{variant:"Secondary",children:e}))}function ti(t){var n=t,{children:e}=n,o=g(n,["children"]);return jsx(eo,p(a({},o),{variant:"Link",children:e}))}function ri(t){var n=t,{children:e}=n,o=g(n,["children"]);return jsx(eo,p(a({},o),{variant:"Plain",children:e}))}var F={};ue(F,{Column:()=>ai,Row:()=>ii});var ii=Eo.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"row"},e),{ref:o}))),ai=Eo.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Oo(n){var r=n,{flowId:e,part:o}=r,t=g(r,["flowId","part"]);return jsx(z,p(a({alignItems:"center","aria-label":"Banner",as:h,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"flex-start",part:["banner",o],role:"complementary"},t),{children:({handleDismiss:i,handlePrimary:s,handleSecondary:l,parentProps:{dismissible:d},step:u})=>{var v,C,P,T;let m=(C=(v=u.primaryButton)==null?void 0:v.title)!=null?C:u.primaryButtonTitle,f=(T=(P=u.secondaryButton)==null?void 0:P.title)!=null?T:u.secondaryButtonTitle,x=u.$state.blocked;return jsxs(Fragment,{children:[u.imageUri&&jsx(y,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(F.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:u.title}),jsx(h.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(h.Secondary,{disabled:x,title:f,onClick:l}),jsx(h.Primary,{disabled:x,title:m,onClick:s}),d&&jsx(h.Dismiss,{onClick:i})]})}}))}var no={};ue(no,{Carousel:()=>Jt,Collapsible:()=>ro,CollapsibleStep:()=>_e});var we={};ue(we,{Bar:()=>Be,Dots:()=>Vt,Fraction:()=>Ee,Segments:()=>oo});function Be(n){var r=n,{current:e,total:o}=r,t=g(r,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsx(y,p(a({"aria-description":"Progress represented as a bar","aria-label":"Progress Bar","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,backgroundColor:"neutral.800",borderRadius:"md",height:"10px",part:"progress-bar",role:"meter"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Vt(n){var r=n,{current:e,total:o}=r,t=g(r,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsx(y,{as:"circle",cx:4+16*l,cy:"4px",fill:e-1===l?E.colors.blue500:E.colors.blue800,part:["progress-dot",e-1===l?"progress-dot-filled":null],r:4},l));return jsx(y,p(a({"aria-description":"Progress represented as dots","aria-label":"Progress Dots","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,as:"svg",height:"8px",part:"progress-dots",role:"meter",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function Ee(n){var r=n,{current:e,total:o}=r,t=g(r,["current","total"]);return jsx(R.Body2,p(a({"aria-description":"Progress represented as a fraction of a total","aria-label":"Progress Fraction","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,part:"progress-fraction",role:"meter"},t),{children:`${e}/${o}`}))}function oo(n){var r=n,{current:e,total:o}=r,t=g(r,["current","total"]);let i=[...Array(o)].map((s,l)=>jsx(y,{backgroundColor:e-1>=l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%",minWidth:"10px",part:["progress-segment",e-1===l?"progress-segment-filled":null]},l));return jsx(F.Row,p(a({"aria-description":"Progress represented as a segmented bar","aria-label":"Progress Segments","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,gap:1,height:"10px",part:"progress-segments",role:"meter"},t),{children:i}))}function $t(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function pi(){return jsx(y,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wt(t){var n=t,{checked:e=!1}=n,o=g(n,["checked"]);return jsx(y,p(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(pi,{})})}))}function ge(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(A),r={"flow.back":(...i)=>e.flow.back(...i),"flow.complete":(...i)=>e.flow.complete(...i),"flow.forward":(...i)=>e.flow.forward(...i),"flow.restart":()=>e.flow.restart(),"flow.skip":(...i)=>e.flow.skip(...i),"flow.start":(...i)=>e.flow.start(...i),"step.complete":(...i)=>e.complete(...i),"step.skip":(...i)=>e.skip(...i),"step.reset":()=>e.reset(),"step.start":(...i)=>e.start(...i)};return {handlePrimary:useCallback((i,s,l=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?yield u(s,l):u!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((i,s)=>M(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Nt({onPrimary:e,onSecondary:o,step:t}){var u,m;let{handlePrimary:n,handleSecondary:r}=ge(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s,skipped:l}=t.$state,d=s||l||!i?jsx(Wt,{checked:s||l,marginLeft:"auto"}):jsx(y,{as:$t,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(h,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:i,opacity:i?.5:1,children:[jsxs(F.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(h.Title,{children:t.title}),jsx(h.Subtitle,{children:t.subtitle}),jsxs(F.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(h.Secondary,{disabled:i,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(h.Primary,{disabled:i,onClick:n,title:(m=t.primaryButton)==null?void 0:m.title})]})]})}function zt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Gt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var Kt=keyframes`
|
|
24
|
+
var lt=Object.defineProperty,ln=Object.defineProperties;var pn=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var pt=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var st=(e,o,t)=>o in e?lt(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))pt.call(o,t)&&st(e,t,o[t]);if(qe)for(var t of qe(o))dt.call(o,t)&&st(e,t,o[t]);return e},p=(e,o)=>ln(e,pn(o));var dn=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,o)=>{var t={};for(var r in e)pt.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&qe)for(var r of qe(e))o.indexOf(r)<0&&dt.call(e,r)&&(t[r]=e[r]);return t};var ue=(e,o)=>{for(var t in o)lt(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((r,n)=>{var i=d=>{try{s(t.next(d));}catch(u){n(u);}},l=d=>{try{s(t.throw(d));}catch(u){n(u);}},s=d=>d.done?r(d.value):Promise.resolve(d.value).then(i,l);s((t=t.apply(e,o)).next());});function Be(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var ut={borderWidths:{md:"1px"}};var Ze=[5,10,20,35,50,65,80,95,98],mt=[...Ze],vo=[...Ze];mt[4]=40;vo[4]=60;var cn={blue:{h:213,s:100,l:Ze},gray:{h:220,s:10,l:Ze},green:{h:141,s:90,l:mt},red:{h:9,s:90,l:vo},yellow:{h:50,s:90,l:vo}};var $={};for(let[e,{h:o,s:t,l:r}]of Object.entries(cn))$[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var ft=p(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},$),{gray100:$.gray[100],gray200:$.gray[200],gray300:$.gray[300],gray400:$.gray[400],gray500:$.gray[500],gray600:$.gray[600],gray700:$.gray[700],gray800:$.gray[800],gray900:$.gray[900],blue400:$.blue[400],blue500:$.blue[500],blue800:$.blue[800],blue900:$.blue[900],green400:$.green[400],green500:$.green[500],green800:$.green[800],red500:$.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var gt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,yt={negative:{100:c("red-100"),200:c("red-200"),300:c("red-300"),400:c("red-400"),500:c("red-500"),600:c("red-600"),700:c("red-700"),800:c("red-800"),900:c("red-900"),background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500"),active:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")},focus:{background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500")},hover:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")}},neutral:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700"),active:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},focus:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},hover:{background:c("neutral-900"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700")}},positive:{100:c("green-100"),200:c("green-200"),300:c("green-300"),400:c("green-400"),500:c("green-500"),600:c("green-600"),700:c("green-700"),800:c("green-800"),900:c("green-900"),background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500"),active:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")},focus:{background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500")},hover:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")}},primary:{100:c("blue-100"),200:c("blue-200"),300:c("blue-300"),400:c("blue-400"),500:c("blue-500"),600:c("blue-600"),700:c("blue-700"),800:c("blue-800"),900:c("blue-900"),background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500"),active:{background:c("primary-300"),border:c("primary-300"),foreground:c("white"),surface:c("primary-300")},focus:{background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500")},hover:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")}},secondary:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900"),active:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")},focus:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900")},hover:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")}}};var xt={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var un="px",mn=e=>typeof e=="number"?`${4*e}${un}`:e,fn=[-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"],ht=Object.fromEntries(fn.map(e=>[e,mn(e)]));var bt={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 Ye=p(a(p(a({},ut),{colors:a(a({},ft),yt)}),bt),{radii:gt,shadows:xt,space:ht});function Le(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let l=`${o.length?`${o}${t}`:""}${n}`,s=e[n];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(r,Le(s,l,t)):r[l]=s,r},{})}function Ro(e){let o=Le(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Pt(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Pt(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var To=Ro(Ye),E=Pt(Ye);var yn=new Set(["alt","size","src"]),xn=gn.all.filter(e=>e.indexOf("-")!=0&&!yn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),hn=Object.fromEntries(xn),Qe=Le(E.colors),bn={color:Qe,backgroundColor:Qe,borderColor:Qe,border:a(a({},E.borderWidths),Qe),borderRadius:E.radii,borderWidth:E.borderWidths,boxShadow:E.shadows,fontFamily:E.fontFamilies,fontSize:E.fontSizes,fontWeight:E.fontWeights,gap:E.space,lineHeight:E.lineHeights,margin:E.space,marginBottom:E.space,marginLeft:E.space,marginRight:E.space,marginTop:E.space,padding:E.space,paddingBottom:E.space,paddingLeft:E.space,paddingRight:E.space,paddingTop:E.space},Ct=a(a({},hn),bn),St={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"]},wt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Pn(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 Ft=new Map(Object.entries(Ct).map(([e,o])=>[e,Pn(o)])),Cn=new Map(Object.entries(St).map(([e,o])=>[e,new Set(o)])),Sn=new Set(["height","width"]),wn=new Set(["canvas","embed","iframe","img","input","object","video"]);function vt(e){let[o,t]=e.split(":");return [o,wt.has(t)?t:null]}function Rt(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let s=`&:${i.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return r[s]==null&&(r[s]={}),r[s]}return Object.entries(t).forEach(([i,l])=>{let[s,d]=vt(i),u=Cn.get(s);u!=null&&(u.forEach(f=>{let m=`${f}${d?":"+d:""}`;t[m]=l;}),delete t[i]);}),Object.entries(t).forEach(([i,l])=>{let[s,d]=vt(i),u=Ft.get(s);if(u!=null){if(l==null)delete t[i];else if(typeof l=="string"&&l.indexOf(" ")>-1){let f=l.split(" ");n(d)[s]=f.map(m=>{var x;return (x=u.get(m.toString()))!=null?x:m}).join(" ");}else u.has(l.toString())?n(d)[s]=u.get(l.toString()):n(d)[s]=l;(typeof o!="string"||!wn.has(o)||!Sn.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let l=i.substring(1);i.indexOf("_")===0&&Ft.has(l)&&(t[l]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function vn(){if(typeof window=="undefined"){let{JSDOM:e}=dn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Tt(e){return e?{__html:Fn(vn()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Tn(e){return e&&`fr-${e}`}function Et(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Et(o)).join(" "):Tn(e))}function kn(s,l){var d=s,{as:e,children:o,className:t,css:r={},part:n}=d,i=g(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:m}=Rt(i,u),x=Et(n),v=t||x?clsx(t,x):void 0,C=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsx(u,p(a({className:v,css:C},m),{ref:l,dangerouslySetInnerHTML:Tt(o)})):jsx(u,p(a({className:v,css:C},m),{ref:l,children:o}))}var y=Oo.forwardRef(kn);var I={};ue(I,{Link:()=>ri,Plain:()=>ni,Primary:()=>oi,Secondary:()=>ti});var R={};ue(R,{Body1:()=>Gn,Body2:()=>Kn,Caption:()=>jn,Display1:()=>Wn,Display2:()=>Ln,H1:()=>Nn,H2:()=>_n,H3:()=>zn,H4:()=>Un});var ko={};ue(ko,{Body1:()=>Vn,Body2:()=>An,Caption:()=>Mn,Display1:()=>Bn,Display2:()=>En,H1:()=>On,H2:()=>Dn,H3:()=>In,H4:()=>Hn});var me={color:"neutral.foreground",fontFamily:"default",margin:"0"},Bn=p(a({},me),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),En=p(a({},me),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),On=p(a({},me),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Dn=p(a({},me),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),In=p(a({},me),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Hn=p(a({},me),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Vn=p(a({},me),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),An=p(a({},me),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Mn=p(a({},me),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var $n=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],fe=Object.fromEntries($n.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Oo.forwardRef((s,l)=>{var d=s,{as:r=o,children:n}=d,i=g(d,["as","children"]);return jsx(y,p(a(a({as:r},ko[e]),i),{ref:l,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Wn=fe.Display1,Ln=fe.Display2,Nn=fe.H1,_n=fe.H2,zn=fe.H3,Un=fe.H4,Gn=fe.Body1,Kn=fe.Body2,jn=fe.Caption;var Eo={};ue(Eo,{Link:()=>Yn,Plain:()=>Qn,Primary:()=>qn,Secondary:()=>Zn,loadingCSSStyle:()=>Bo});var eo={alignItems:"center",borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit","opacity:disabled":"0.6","pointerEvents:disabled":"none"},qn=p(a({},eo),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:active":"primary.active.surface","backgroundColor:disabled":"primary.surface"}),Zn=p(a({},eo),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:active":"secondary.active.surface","backgroundColor:disabled":"secondary.background"}),Yn=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),Qn=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),ei=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Bo={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:ei+" 1s ease infinite"}};function oo(l){var s=l,{as:e,children:o,part:t,title:r,variant:n="Primary"}=s,i=g(s,["as","children","part","title","variant"]);var u;let d=n.toLocaleLowerCase();return jsxs(y,p(a(p(a({as:e!=null?e:"button",part:[`button-${d}`,t]},Eo[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?Bo:{})}),i),{loading:void 0,children:[o,r&&jsx(R.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function oi(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Primary",children:e}))}function ti(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Secondary",children:e}))}function ri(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Link",children:e}))}function ni(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Plain",children:e}))}var F={};ue(F,{Column:()=>si,Row:()=>ai});var ai=Oo.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"row"},e),{ref:o}))),si=Oo.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Do(r){var n=r,{flowId:e,part:o}=n,t=g(n,["flowId","part"]);return jsx(z,p(a({alignItems:"center","aria-label":"Banner",as:h,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"flex-start",part:["banner",o],role:"complementary"},t),{children:({handleDismiss:i,handlePrimary:l,handleSecondary:s,parentProps:{dismissible:d},step:u})=>{var v,C,P,T;let f=(C=(v=u.primaryButton)==null?void 0:v.title)!=null?C:u.primaryButtonTitle,m=(T=(P=u.secondaryButton)==null?void 0:P.title)!=null?T:u.secondaryButtonTitle,x=u.$state.blocked;return jsxs(Fragment,{children:[u.imageUri&&jsx(y,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(F.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:u.title}),jsx(h.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(h.Secondary,{disabled:x,title:m,onClick:s}),jsx(h.Primary,{disabled:x,title:f,onClick:l}),d&&jsx(h.Dismiss,{onClick:i})]})}}))}var io={};ue(io,{Carousel:()=>qt,Collapsible:()=>no,CollapsibleStep:()=>ze});var Fe={};ue(Fe,{Bar:()=>Ee,Dots:()=>At,Fraction:()=>Oe,Segments:()=>to});function Ee(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,l=i===0?"10px":`${100*i}%`;return jsx(y,p(a({"aria-description":"Progress represented as a bar","aria-label":"Progress Bar","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,backgroundColor:"neutral.800",borderRadius:"md",height:"10px",part:"progress-bar",role:"meter"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function At(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((l,s)=>jsx(y,{as:"circle",cx:4+16*s,cy:"4px",fill:e-1===s?E.colors.blue500:E.colors.blue800,part:["progress-dot",e-1===s?"progress-dot-filled":null],r:4},s));return jsx(y,p(a({"aria-description":"Progress represented as dots","aria-label":"Progress Dots","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,as:"svg",height:"8px",part:"progress-dots",role:"meter",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function Oe(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);return jsx(R.Body2,p(a({"aria-description":"Progress represented as a fraction of a total","aria-label":"Progress Fraction","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,part:"progress-fraction",role:"meter"},t),{children:`${e}/${o}`}))}function to(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);let i=[...Array(o)].map((l,s)=>jsx(y,{backgroundColor:e-1>=s?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%",minWidth:"10px",part:["progress-segment",e-1===s?"progress-segment-filled":null]},s));return jsx(F.Row,p(a({"aria-description":"Progress represented as a segmented bar","aria-label":"Progress Segments","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,gap:1,height:"10px",part:"progress-segments",role:"meter"},t),{children:i}))}function Wt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function di(){return jsx(y,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Lt(t){var r=t,{checked:e=!1}=r,o=g(r,["checked"]);return jsx(y,p(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(di,{})})}))}function ge(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(A),n={"flow.back":(...i)=>e.flow.back(...i),"flow.complete":(...i)=>e.flow.complete(...i),"flow.forward":(...i)=>e.flow.forward(...i),"flow.restart":()=>e.flow.restart(),"flow.skip":(...i)=>e.flow.skip(...i),"flow.start":(...i)=>e.flow.start(...i),"step.complete":(...i)=>e.complete(...i),"step.skip":(...i)=>e.skip(...i),"step.reset":()=>e.reset(),"step.start":(...i)=>e.start(...i)};return {handlePrimary:useCallback((i,l,s=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,i,l))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?yield u(l,s):u!==!1&&(yield e.complete(l,s)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((i,l)=>M(this,null,function*(){if((yield t==null?void 0:t(e,i,l))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(l),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function _t({onPrimary:e,onSecondary:o,step:t}){var u,f;let{handlePrimary:r,handleSecondary:n}=ge(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:l,skipped:s}=t.$state,d=l||s||!i?jsx(Lt,{checked:l||s,marginLeft:"auto"}):jsx(y,{as:Wt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(h,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:i,opacity:i?.5:1,children:[jsxs(F.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(h.Title,{children:t.title}),jsx(h.Subtitle,{children:t.subtitle}),jsxs(F.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(h.Secondary,{disabled:i,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(h.Primary,{disabled:i,onClick:r,title:(f=t.primaryButton)==null?void 0:f.title})]})]})}function Ut(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Kt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var jt=keyframes`
|
|
25
25
|
from {
|
|
26
26
|
opacity: 0;
|
|
27
27
|
}
|
|
28
28
|
to {
|
|
29
29
|
opacity: 1;
|
|
30
30
|
}
|
|
31
|
-
`;function
|
|
31
|
+
`;function Xt({flow:e,sort:o,onPrimary:t,onSecondary:r}){var P,T;let[n,i]=useState(),[l]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(P=Array.from(e.steps.values()).find(S=>!S.$state.completed&&!S.$state.skipped))==null?void 0:P.order)!=null?T:0}),[s,d]=gi(l),[u,f]=useState(),[m,x]=useState();useLayoutEffect(()=>{d&&(u==null&&f(d.canScrollNext()),m==null&&x(d.canScrollPrev()),d.on("select",()=>{f(d.canScrollNext()),x(d.canScrollPrev());}));},[d]),useEffect(()=>{if(!n){let S=Array.from(e.steps.values()),B=S.filter(b=>b.$state.completed||b.$state.skipped).sort((b,k)=>b.order-k.order),O=S.filter(b=>!b.$state.completed&&!b.$state.skipped).sort((b,k)=>b.order-k.order);i(o==="completed-last"?[...O,...B].map(b=>b.id):S.map(b=>b.id));}},[]);let v=e.getNumberOfCompletedSteps(),C=e.getNumberOfAvailableSteps();return n?jsxs(Fragment,{children:[jsxs(F.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:E.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(F.Column,{part:"carousel-header-content",children:[jsx(R.H3,{children:e.title}),jsx(R.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(F.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(R.Body2,{fontWeight:"demibold",part:"progress-text",children:[v,"/",C]}),jsx(Ee,{current:v,total:C,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${E.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsx(F.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(S=>S.$state.visible).sort((S,B)=>n.indexOf(S.id)-n.indexOf(B.id)).map(S=>jsx(_t,{onPrimary:t,onSecondary:r,step:S},S.id))}),m&&jsx(F.Column,{animation:`${jt} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsx(I.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(Kt,{height:"24px",width:"24px"})})}),u&&jsx(F.Column,{animation:`${jt} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsx(I.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(Ut,{height:"24px",width:"24px"})})})]})]}):null}function qt(o){var e=g(o,[]);return jsx(z,p(a({as:h,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(Xt,a(a({},e),t))}))}var ze={};ue(ze,{Content:()=>Vo,Root:()=>Ao,Trigger:()=>Mo});function Yt(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var xi=keyframes`
|
|
32
32
|
from {
|
|
33
33
|
height: 0;
|
|
34
34
|
opacity: 0;
|
|
@@ -37,7 +37,7 @@ var st=Object.defineProperty,sn=Object.defineProperties;var ln=Object.getOwnProp
|
|
|
37
37
|
height: var(--radix-collapsible-content-height);
|
|
38
38
|
opacity: 1;
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`,hi=keyframes`
|
|
41
41
|
from {
|
|
42
42
|
height: var(--radix-collapsible-content-height);
|
|
43
43
|
opacity: 1;
|
|
@@ -46,14 +46,14 @@ var st=Object.defineProperty,sn=Object.defineProperties;var ln=Object.getOwnProp
|
|
|
46
46
|
height: 0;
|
|
47
47
|
opacity: 0;
|
|
48
48
|
}
|
|
49
|
-
`,hi=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function bi({checked:e=!1}){return jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(hi,{})})})}function Ho({children:e}){return jsx(De.Content,{asChild:!0,children:jsxs(F.Column,{css:{'&[data-state="open"]':{animation:`${yi} 300ms ease-out`},'&[data-state="closed"]':{animation:`${xi} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function Vo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=g(s,["children","disabled","onOpenChange","open"]);return jsx(De.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(h,p(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Ao({isCompleted:e,isBlocked:o,title:t}){return jsx(De.Trigger,{asChild:!0,children:jsxs(F.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(F.Row,{alignItems:"center",gap:2,children:[jsx(bi,{checked:e}),jsx(R.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:Zt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Pi=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function pe(e){let o={},t={};for(let[n,r]of Object.entries(e))Pi.some(i=>i===n)?o[n]=r:t[n]=r;return {otherProps:t,videoProps:o}}var Qt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function er({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var P,T,S,B,O,b;let{$state:{blocked:i,completed:s,skipped:l},subtitle:d,title:u}=r,m=(T=(P=r.primaryButton)==null?void 0:P.title)!=null?T:r.primaryButtonTitle,f=(B=(S=r.secondaryButton)==null?void 0:S.title)!=null?B:r.secondaryButtonTitle,x=(O=r.props)!=null?O:{},v=!!i,{videoProps:C}=pe(x);return jsxs(Vo,p(a({open:t,onOpenChange:n},x),{children:[jsx(Ao,{isBlocked:r.$state.blocked,isCompleted:s||l,title:u}),jsxs(Ho,{children:[jsx(h.Media,a({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(b=r.videoUri)!=null?b:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"},C)),jsx(h.Subtitle,{color:"neutral.400",children:d}),jsxs(F.Row,{gap:3,part:"collapsible-footer",children:[jsx(h.Secondary,{title:f,onClick:o}),jsx(h.Primary,{disabled:v,title:m,onClick:e})]})]})]}))}var Fi={default:er};function vi(n){var r=n,{flow:e,step:o}=r,t=g(r,["flow","step"]);var P;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:d,stepTypes:u}=useContext(Qt),{handlePrimary:m,handleSecondary:f}=ge(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,v=(P=u[o.type])!=null?P:er;function C(T){return M(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(v,p(a({flow:e,onOpenChange:C,open:x,step:o},t),{handlePrimary:m,handleSecondary:f}),o.id)}function ro(s){var l=s,{flowId:e,onPrimary:o,onSecondary:t,part:n,stepTypes:r={}}=l,i=g(l,["flowId","onPrimary","onSecondary","part","stepTypes"]);let[d,u]=useState(null),m=a(a({},Fi),r);return jsx(Qt.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:m},children:jsx(z,p(a({as:h,borderWidth:"md",flowId:e,part:["checklist",n]},i),{children:C=>{var P=C,{flow:f,handleDismiss:x}=P,v=g(P,["flow","handleDismiss"]);var k;let S=Array.from(f.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(vi,p(a({flow:f,handleDismiss:x},v),{step:w}),w.id)),B=f.getNumberOfCompletedSteps(),O=f.getNumberOfAvailableSteps(),b=i.dismissible||!!((k=f==null?void 0:f.props)!=null&&k.dismissible);return jsxs(Fragment,{children:[jsxs(F.Column,{gap:2,children:[jsx(h.Header,{dismissible:b,handleDismiss:x,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxs(F.Row,{alignItems:"center",gap:2,children:[jsxs(R.Body2,{fontWeight:"demibold",children:[B,"/",O]}),jsx(Be,{current:B,total:O,flexGrow:1})]})]}),S]})}}))})}var Hi=new Set(["required","min","max","minLength","maxLength","pattern"]);function Vi({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([l])=>Hi.has(l))),s=useController({name:t.id,control:o,rules:i});return jsx(e,p(a({},s),{fieldData:t,formContext:r,submit:n}))}function tr({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:i}){var B,O,b,k;let{__readOnly:s}=useContext(A),l=useMemo(()=>{var w,D;return (D=(w=i.fields)==null?void 0:w.filter(H=>e[H.type]!=null&&H.id))!=null?D:[]},[i.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:l.reduce((w,D)=>{var H;return w[D.id]=(H=D.value)!=null?H:"",w},{})});useEffect(()=>{d.formState.isDirty||d.reset(l.reduce((w,D)=>{var H;return w[D.id]=(H=D.value)!=null?H:"",w},{}));},[l]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(w=>l.some(D=>D.id===w))&&d.trigger();},[i.id]);let[u,m]=useState(!1),f=[],{control:x,handleSubmit:v}=d;function C(w,D){m(!0),t(D,w,s===!0).then(()=>m(!1));}l.forEach(w=>{e[w.type]!=null&&f.push(jsx(Vi,{control:x,fieldComponent:e[w.type],fieldData:w,submit:v(C)},`${i.flow.id}-${w.id}`));});let P=(O=(B=i.primaryButton)==null?void 0:B.title)!=null?O:i.primaryButtonTitle,T=(k=(b=i.secondaryButton)==null?void 0:b.title)!=null?k:i.secondaryButtonTitle,S=!!(i.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[i]),jsxs(Fragment,{children:[jsx(h.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,p(a({},d),{children:f})),jsxs(F.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[T&&jsx(I.Secondary,{onClick:n,title:T}),jsx(I.Primary,{disabled:S||u,onClick:v(C),title:P!=null?P:"Submit",loading:u})]},`form-footer-${i.id}`)]})}function rr({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(R.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function $o({children:e,id:o,required:t=!1}){return jsxs(R.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Wo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},ze=p(a({},Wo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),io={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function ae({children:e,field:o,fieldData:t,fieldState:n}){var m;let{id:r,label:i,placeholder:s,props:l}=t,{error:d}=n,u=a(p(a(a(a({id:r},o),s?{placeholder:s}:{}),ze),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""}),l);return jsxs(y,{part:"field",children:[jsx($o,{id:r,required:!!t.required,children:i}),e(u),jsx(rr,{error:d})]})}function He(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var Ni=Eo.forwardRef(({label:e,value:o},t)=>jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(R.Body2,{part:"field-radio-label",children:e}),jsx(Ve.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(y,p(a({as:Ve.Indicator},io),{children:jsx(He,{height:"14",width:"14"})}))})})]}));function Lo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:s})=>jsx(Ni,{value:s,label:i},s));return jsx(ae,p(a({},e),{children:()=>jsx(Ve.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(F.Column,{gap:2,part:"field-radio-group",children:r})})}))}function ao(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function pr(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,i]=Eo.useState([]);function s(l){let d=[];r.includes(l)?d=[...r.filter(u=>u!==l)]:d=[...r,l],i(d),o(d);}return jsx(ae,p(a({},e),{children:()=>jsx(F.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:l,value:d})=>jsx(so.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>s(d),asChild:!0,children:jsxs(y,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(R.Body2,{part:"field-check-label",children:l}),jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:d,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(so.Indicator,{asChild:!0,children:jsx(y,p(a({},io),{children:jsx(He,{height:"14",width:"14"})}))})})]})},d))})}))}var Ui=Eo.forwardRef(({label:e,value:o},t)=>jsx(L.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(L.ItemText,{asChild:!0,children:jsx(R.Body2,{part:"field-select-option-label",children:e})})})}));function No(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:s,value:l})=>jsx(Ui,{value:l,label:s},l));return e.fieldData.multiple?jsx(pr,a({},e)):jsx(ae,p(a({},e),{children:()=>jsxs(L.Root,{value:t,onValueChange:o,children:[jsx(L.Trigger,{asChild:!0,children:jsxs(R.Body2,p(a({},ze),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(L.Value,{placeholder:r!=null?r:"Select one"}),jsx(L.Icon,{children:jsx(y,{as:ao,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(L.Portal,{children:jsx(L.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,p(a({},ze),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(L.Viewport,{children:i})}))})})]})}))}function _o(e){return jsx(ae,p(a({},e),{children:o=>jsx(R.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function zo(e){return jsx(ae,p(a({},e),{children:o=>jsx(R.Body2,a({as:"textarea",part:"field-textarea"},o))}))}function fr(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:i=[]}}=e;return jsxs(y,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(so.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(y,p(a({},Wo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:i,children:jsx(so.Indicator,{asChild:!0,children:jsx(y,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(He,{height:"14",fill:"currentColor"})})})}))}),jsx(R.Body2,{part:"field-checkbox-label",as:"label",htmlFor:i,children:r})]})}var Ki={checkbox:fr,radio:Lo,select:No,text:_o,textarea:zo};function Me(r){var i=r,{fieldTypes:e={},flowId:o,part:t}=i,n=g(i,["fieldTypes","flowId","part"]);let s=Object.assign({},Ki,e);return jsx(z,p(a({as:h,flowId:o,part:["form",t]},n),{children:l=>jsx(tr,a({fieldTypes:s},l))}))}var co={};ue(co,{NPS:()=>Ge});function xr({field:e,fieldData:o,submit:t}){var r,i;let n=[...Array(11)].map((s,l)=>{let d=e.value===l?I.Primary:I.Secondary;return jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxs(F.Column,{gap:2,children:[jsx(F.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(F.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(R.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(R.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ge(i){var s=i,{as:e=V,flowId:o,fieldTypes:t,part:n}=s,r=g(s,["as","flowId","fieldTypes","part"]);var d;let{flow:l}=Re(o);return jsx(Me,p(a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:xr},t),modal:!1,onEscapeKeyDown:u=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(u),u.defaultPrevented||l.skip();},part:["nps",n]},r),{css:a({},a(p(a({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}}),(d=r.css)!=null?d:{}))}))}function hr(e,o,t){let[n,r]=useState(!1),i=useRef();return useEffect(()=>{i.current=typeof o=="string"?document.querySelector(o):o,r(!0);},[]),n?createPortal(e,i.current,t):null}function br({children:e,container:o="body"}){return e!=null?hr(e,o):null}function ea(i,r){var s=i,{children:e,part:o,opacity:t=.5}=s,n=g(s,["children","part","opacity"]);let l=keyframes`
|
|
49
|
+
`,bi=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Pi({checked:e=!1}){return jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(bi,{})})})}function Vo({children:e}){return jsx(Ie.Content,{asChild:!0,children:jsxs(F.Column,{css:{'&[data-state="open"]':{animation:`${xi} 300ms ease-out`},'&[data-state="closed"]':{animation:`${hi} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function Ao(i){var l=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=l,n=g(l,["children","disabled","onOpenChange","open"]);return jsx(Ie.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(h,p(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function Mo({isCompleted:e,isBlocked:o,title:t}){return jsx(Ie.Trigger,{asChild:!0,children:jsxs(F.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(F.Row,{alignItems:"center",gap:2,children:[jsx(Pi,{checked:e}),jsx(R.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:Yt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ci=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function pe(e){let o={},t={};for(let[r,n]of Object.entries(e))Ci.some(i=>i===r)?o[r]=n:t[r]=n;return {otherProps:t,videoProps:o}}var er=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function or({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var P,T,S,B,O,b;let{$state:{blocked:i,completed:l,skipped:s},subtitle:d,title:u}=n,f=(T=(P=n.primaryButton)==null?void 0:P.title)!=null?T:n.primaryButtonTitle,m=(B=(S=n.secondaryButton)==null?void 0:S.title)!=null?B:n.secondaryButtonTitle,x=(O=n.props)!=null?O:{},v=!!i,{videoProps:C}=pe(x);return jsxs(Ao,p(a({open:t,onOpenChange:r},x),{children:[jsx(Mo,{isBlocked:n.$state.blocked,isCompleted:l||s,title:u}),jsxs(Vo,{children:[jsx(h.Media,a({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(b=n.videoUri)!=null?b:n.imageUri,transform:"translate3d(0, 0, 1px)",type:n.videoUri?"video":"image"},C)),jsx(h.Subtitle,{color:"neutral.400",children:d}),jsxs(F.Row,{gap:3,part:"collapsible-footer",children:[jsx(h.Secondary,{title:m,onClick:o}),jsx(h.Primary,{disabled:v,title:f,onClick:e})]})]})]}))}var vi={default:or};function Ri(r){var n=r,{flow:e,step:o}=n,t=g(n,["flow","step"]);var P;let{onPrimary:i,onSecondary:l,openStepId:s,setOpenStepId:d,stepTypes:u}=useContext(er),{handlePrimary:f,handleSecondary:m}=ge(o,{onPrimary:i,onSecondary:l}),x=(s!=null?s:e.getCurrentStep().id)===o.id,v=(P=u[o.type])!=null?P:or;function C(T){return M(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(v,p(a({flow:e,onOpenChange:C,open:x,step:o},t),{handlePrimary:f,handleSecondary:m}),o.id)}function no(l){var s=l,{flowId:e,onPrimary:o,onSecondary:t,part:r,stepTypes:n={}}=s,i=g(s,["flowId","onPrimary","onSecondary","part","stepTypes"]);let[d,u]=useState(null),f=a(a({},vi),n);return jsx(er.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:f},children:jsx(z,p(a({as:h,borderWidth:"md",flowId:e,part:["checklist",r]},i),{children:C=>{var P=C,{flow:m,handleDismiss:x}=P,v=g(P,["flow","handleDismiss"]);var k;let S=Array.from(m.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(Ri,p(a({flow:m,handleDismiss:x},v),{step:w}),w.id)),B=m.getNumberOfCompletedSteps(),O=m.getNumberOfAvailableSteps(),b=i.dismissible||!!((k=m==null?void 0:m.props)!=null&&k.dismissible);return jsxs(Fragment,{children:[jsxs(F.Column,{gap:2,children:[jsx(h.Header,{dismissible:b,handleDismiss:x,part:"checklist-header",subtitle:m.subtitle,title:m.title}),jsxs(F.Row,{alignItems:"center",gap:2,children:[jsxs(R.Body2,{fontWeight:"demibold",children:[B,"/",O]}),jsx(Ee,{current:B,total:O,flexGrow:1})]})]}),S]})}}))})}var Vi=new Set(["required","min","max","minLength","maxLength","pattern"]);function Ai({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([s])=>Vi.has(s))),l=useController({name:t.id,control:o,rules:i});return jsx(e,p(a({},l),{fieldData:t,formContext:n,submit:r}))}function rr({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var B,O,b,k;let{__readOnly:l}=useContext(A),s=useMemo(()=>{var w,D;return (D=(w=i.fields)==null?void 0:w.filter(H=>e[H.type]!=null&&H.id))!=null?D:[]},[i.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:s.reduce((w,D)=>{var H;return w[D.id]=(H=D.value)!=null?H:"",w},{})});useEffect(()=>{d.formState.isDirty||d.reset(s.reduce((w,D)=>{var H;return w[D.id]=(H=D.value)!=null?H:"",w},{}));},[s]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(w=>s.some(D=>D.id===w))&&d.trigger();},[i.id]);let[u,f]=useState(!1),m=[],{control:x,handleSubmit:v}=d;function C(w,D){f(!0),t(D,w,l===!0).then(()=>f(!1));}s.forEach(w=>{e[w.type]!=null&&m.push(jsx(Ai,{control:x,fieldComponent:e[w.type],fieldData:w,submit:v(C)},`${i.flow.id}-${w.id}`));});let P=(O=(B=i.primaryButton)==null?void 0:B.title)!=null?O:i.primaryButtonTitle,T=(k=(b=i.secondaryButton)==null?void 0:b.title)!=null?k:i.secondaryButtonTitle,S=!!(i.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[i]),jsxs(Fragment,{children:[jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,p(a({},d),{children:m})),jsxs(F.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[T&&jsx(I.Secondary,{onClick:r,title:T}),jsx(I.Primary,{disabled:S||u,onClick:v(C),title:P!=null?P:"Submit",loading:u})]},`form-footer-${i.id}`)]})}function nr({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(R.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function Wo({children:e,id:o,required:t=!1}){return jsxs(R.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Lo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Ue=p(a({},Lo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),ao={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function ae({children:e,field:o,fieldData:t,fieldState:r}){var f;let{id:n,label:i,placeholder:l,props:s}=t,{error:d}=r,u=a(p(a(a(a({id:n},o),l?{placeholder:l}:{}),Ue),{"aria-invalid":!!d,value:(f=o.value)!=null?f:""}),s);return jsxs(y,{part:"field",children:[jsx(Wo,{id:n,required:!!t.required,children:i}),e(u),jsx(nr,{error:d})]})}function Ve(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var _i=Oo.forwardRef(({label:e,value:o},t)=>jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(R.Body2,{part:"field-radio-label",children:e}),jsx(Ae.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(y,p(a({as:Ae.Indicator},ao),{children:jsx(Ve,{height:"14",width:"14"})}))})})]}));function No(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:l})=>jsx(_i,{value:l,label:i},l));return jsx(ae,p(a({},e),{children:()=>jsx(Ae.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(F.Column,{gap:2,part:"field-radio-group",children:n})})}))}function so(e){return jsx("svg",p(a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function dr(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,[n,i]=Oo.useState([]);function l(s){let d=[];n.includes(s)?d=[...n.filter(u=>u!==s)]:d=[...n,s],i(d),o(d);}return jsx(ae,p(a({},e),{children:()=>jsx(F.Column,{gap:2,part:"field-select-multiple",children:r.map(({label:s,value:d})=>jsx(lo.Root,{value:n.includes(d)?d:void 0,onCheckedChange:()=>l(d),asChild:!0,children:jsxs(y,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(R.Body2,{part:"field-check-label",children:s}),jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:d,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(lo.Indicator,{asChild:!0,children:jsx(y,p(a({},ao),{children:jsx(Ve,{height:"14",width:"14"})}))})})]})},d))})}))}var Gi=Oo.forwardRef(({label:e,value:o},t)=>jsx(L.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(L.ItemText,{asChild:!0,children:jsx(R.Body2,{part:"field-select-option-label",children:e})})})}));function _o(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:l,value:s})=>jsx(Gi,{value:s,label:l},s));return e.fieldData.multiple?jsx(dr,a({},e)):jsx(ae,p(a({},e),{children:()=>jsxs(L.Root,{value:t,onValueChange:o,children:[jsx(L.Trigger,{asChild:!0,children:jsxs(R.Body2,p(a({},Ue),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(L.Value,{placeholder:n!=null?n:"Select one"}),jsx(L.Icon,{children:jsx(y,{as:so,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(L.Portal,{children:jsx(L.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,p(a({},Ue),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(L.Viewport,{children:i})}))})})]})}))}function zo(e){return jsx(ae,p(a({},e),{children:o=>jsx(R.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Uo(e){return jsx(ae,p(a({},e),{children:o=>jsx(R.Body2,a({as:"textarea",part:"field-textarea"},o))}))}function gr(e){let{field:{onChange:o,value:t},fieldData:{options:r,label:n,id:i=[]}}=e;return jsxs(y,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(lo.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(y,p(a({},Lo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:i,children:jsx(lo.Indicator,{asChild:!0,children:jsx(y,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ve,{height:"14",fill:"currentColor"})})})}))}),jsx(R.Body2,{part:"field-checkbox-label",as:"label",htmlFor:i,children:n})]})}var ji={checkbox:gr,radio:No,select:_o,text:zo,textarea:Uo};function $e(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=g(i,["fieldTypes","flowId","part"]);let l=Object.assign({},ji,e);return jsx(z,p(a({as:h,flowId:o,part:["form",t]},r),{children:s=>jsx(rr,a({fieldTypes:l},s))}))}var uo={};ue(uo,{NPS:()=>Ke});function hr({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((l,s)=>{let d=e.value===s?I.Primary:I.Secondary;return jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(s),t();},title:`${s}`,css:{".fr-button-title":{fontSize:"15px"}}},s)});return jsxs(F.Column,{gap:2,children:[jsx(F.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxs(F.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(R.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsx(R.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ke(i){var l=i,{as:e=V,flowId:o,fieldTypes:t,part:r}=l,n=g(l,["as","flowId","fieldTypes","part"]);var d;let{flow:s}=Te(o);return jsx($e,p(a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:hr},t),modal:!1,onEscapeKeyDown:u=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(u),u.defaultPrevented||s.skip();},part:["nps",r]},n),{css:a({},a(p(a({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}}),(d=n.css)!=null?d:{}))}))}function br(e,o,t){let[r,n]=useState(!1),i=useRef();return useEffect(()=>{i.current=typeof o=="string"?document.querySelector(o):o,n(!0);},[]),r?createPortal(e,i.current,t):null}function Pr({children:e,container:o="body"}){return e!=null?br(e,o):null}function oa(i,n){var l=i,{children:e,part:o,opacity:t=.5}=l,r=g(l,["children","part","opacity"]);let s=keyframes`
|
|
50
50
|
from {
|
|
51
51
|
opacity: 0;
|
|
52
52
|
}
|
|
53
53
|
to {
|
|
54
54
|
opacity: ${t}
|
|
55
55
|
}
|
|
56
|
-
`;return jsx(RemoveScroll,{forwardProps:!0,ref:
|
|
56
|
+
`;return jsx(RemoveScroll,{forwardProps:!0,ref:n,children:jsx(y,p(a({animation:`${s} 300ms ease-out`,backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",o],position:"fixed"},r),{children:e}))})}var mo=Oo.forwardRef(oa);var ia=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Fr(n){var i=n,{clickable:e=!1,part:o="",style:t={}}=i,r=g(i,["clickable","part","style"]);let[l,s]=useState(!1);return useEffect(()=>{s(!0);},[]),jsxs(y,p(a({borderRadius:"24px",height:"24px",part:`ping-wrapper ${o}`,position:"relative",width:"24px",cursor:e?"pointer":void 0,style:a({opacity:l?1:0},t),transition:"opacity 0.2s ease-out"},r),{children:[jsx(y,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${ia}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(y,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px","backgroundColor:hover":e?"primary.hover.surface":void 0})]}))}function ca({maxX:e,maxY:o,radius:t,x1:r,x2:n,y1:i,y2:l}){return t>0?`path("${[`M${r+t},${i}`,`H${n-t}`,`A${t} ${t} 0,0,1 ${n} ${i+t}`,`V${l-t}`,`A${t} ${t} 0,0,1 ${n-t} ${l}`,`H${r+t}`,`A${t} ${t} 0,0,1 ${r} ${l-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${r}`,`V${i+t}`,`A${t} ${t} 0,0,1 ${r+t} ${i}`,"Z"].join(" ")}")`:`path("M${r},${i} H${n} V${l} H${r} V${o} H${e} V0 H0 V${o} H${r} Z")`}function ua(e){if(!window||!("nodeType"in e))return 0;let o=Number(window.getComputedStyle(e).borderRadius.replace(/\D/g,""));return Number.isNaN(o)?0:o}function Go(n){var i=n,{anchor:e,part:o,style:t={}}=i,r=g(i,["anchor","part","style"]);let[l,s]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=useFloating({middleware:[{name:"clipPath",fn({elements:u,rects:f}){return s({maxX:u.floating.clientWidth,maxY:u.floating.clientHeight,radius:ua(u.reference),x1:f.reference.x,x2:f.reference.x+f.reference.width,y1:f.reference.y,y2:f.reference.y+f.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{try{let u=document.querySelector(e);u!=null?d.setReference(u):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);}catch(u){}},[e]),jsx(mo,a({part:["spotlight",o],ref:d.setFloating,style:a({clipPath:ca(l)},t)},r))}function vr({align:e,side:o}){let t={},r="-12px",n={top:"bottom",right:"left",bottom:"top",left:"right"};return t[n[o]]=r,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=r:t.bottom=r:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=r:t.top=r:["top","bottom"].includes(o)?t.left=`calc(50% + ${r})`:t.top=`calc(50% + ${r})`,t}function Tr(e,o){try{if(e.matches(o)&&kr(e))return e;let t=e.querySelectorAll(o);if(t.length>0&&kr(t[0]))return t[0]}catch(t){return null}}function kr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Br(e){let[o,t]=useState(null);return useEffect(()=>{try{let r=document.querySelector(e);r!=null&&t(r);}catch(r){}},[e]),useEffect(()=>{let r=new MutationObserver(n=>{for(let i of n)if(i.type==="childList"){for(let l of i.addedNodes){if(l.nodeType!==Node.ELEMENT_NODE)continue;let s=Tr(l,e);if(s!=null){t(s);break}}for(let l of i.removedNodes){if(l.nodeType!==Node.ELEMENT_NODE)continue;if(Tr(l,e)!=null){t(null);break}}}});return r.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),{anchorElement:o}}function Ra(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function Er({align:e,alignOffset:o,anchor:t,onOpenChange:r=()=>{},open:n,side:i,sideOffset:l}){let s=`${i}-${Ra(e)}`;function d({rects:k}){let w={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(i)?w.alignmentAxis=o-k.floating.width:w.alignmentAxis=o-k.floating.height),w}let{context:u,floatingStyles:f,placement:m,refs:x}=useFloating({middleware:[offset(d,[e,o,i,l]),flip(),shift()],onOpenChange:r,open:n,placement:s,whileElementsMounted:autoUpdate}),v=useClick(u),C=useDismiss(u,{outsidePress:!1}),P=useRole(u),T=useTransitionStatus(u),{getFloatingProps:S,getReferenceProps:B}=useInteractions([v,C,P]),{anchorElement:O}=Br(t);useEffect(()=>{O!=null?x.setReference(O):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[O]);let b=m.split("-");return e==="before"?b[1]=b[1]==="end"?"after":"before":e==="after"&&(b[1]=b[1]==="start"?"before":"after"),{context:u,getFloatingProps:S,getReferenceProps:B,floatingStyles:f,placement:b.join("-"),refs:x,status:T}}var Ko={height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}};function fo(){let e="DOMRect"in globalThis?new DOMRect:Ko,[o,t]=useState(e),[r,n]=useState(null),i=useCallback(l=>{n(l);},[]);return useLayoutEffect(()=>{if(!r)return;let l=()=>{let s=r.getBoundingClientRect();t(s);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[r]),{node:r,rect:o,ref:i}}function Ir(e){let[o,t]=useState(!1),[r,n]=useState(Ko),i=r.height>0&&r.width>0;return useEffect(()=>{if(e==null)return;let l=new IntersectionObserver(s=>{let d=s[0];n(d.boundingClientRect),t(d.isIntersecting);},{root:null});return l.observe(e),()=>{l.disconnect();}},[e]),{isVisible:o&&i}}function Xo(T){var S=T,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,css:i={},defaultOpen:l=!0,modal:s=!1,onOpenChange:d=()=>{},open:u,part:f,side:m="bottom",sideOffset:x=0,spotlight:v=!1,style:C={}}=S,P=g(S,["align","alignOffset","anchor","autoScroll","children","css","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[B,O]=useState(l),[b,k]=useState(!1),w=u!=null?u:B,{getFloatingProps:D,getReferenceProps:H,floatingStyles:re,placement:J,refs:U,status:Q}=Er({align:e,alignOffset:o,anchor:t,onOpenChange:oe=>{d(oe),u==null&&O(oe);},open:w,side:m,sideOffset:x}),[ee,_]=J.split("-"),q=H(),{isVisible:j}=Ir(U.reference.current);return useEffect(()=>{if(!b&&r&&U.reference.current instanceof Element){let oe=typeof r!="boolean"?r:{behavior:"smooth",block:"center"},W;window.addEventListener("scroll",function te(){clearTimeout(W),W=setTimeout(()=>{window.removeEventListener("scroll",te),k(!0);},100);},!0),U.reference.current.scrollIntoView(oe);}else r||k(!0);},[r,U.reference.current]),U.reference.current==null||!b||!j?null:jsxs(Fragment,{children:[v&&w&&jsx(Go,{anchor:t}),s&&!v&&w&&jsx(mo,{lockScroll:!0}),jsxs(y,p(a(a({css:a({'&[data-status="open"]':{transition:"transform 0.2s ease-out"}},i),"data-placement":J,"data-status":Q.status,part:["hint",f],ref:U.setFloating,style:a(a({},re),C)},D()),P),{children:[w&&n,jsx(Fr,p(a({},q),{position:"absolute",style:vr({align:_,side:ee}),clickable:l===!1}))]}))]})}var Ia=keyframes`
|
|
57
57
|
from {
|
|
58
58
|
opacity: 0;
|
|
59
59
|
}
|
|
@@ -63,7 +63,7 @@ var st=Object.defineProperty,sn=Object.defineProperties;var ln=Object.getOwnProp
|
|
|
63
63
|
to {
|
|
64
64
|
opacity: 1;
|
|
65
65
|
}
|
|
66
|
-
`;function fo(T){var S=T,{align:e,alignOffset:o,autoScroll:t,defaultOpen:n,dismissible:r,flow:i,handleDismiss:s,modal:l,onPrimary:d,onSecondary:u,part:m,side:f,sideOffset:x,spotlight:v,step:C}=S,P=g(S,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var re,J,U,Q,ee;let{handlePrimary:B,handleSecondary:O}=ge(C,{onPrimary:d,onSecondary:u}),{videoProps:b,otherProps:k}=pe(P),w=(J=(re=C.primaryButton)==null?void 0:re.title)!=null?J:C.primaryButtonTitle,D=(Q=(U=C.secondaryButton)==null?void 0:U.title)!=null?Q:C.secondaryButtonTitle,H=!!C.$state.blocked;return jsx(jo,p(a({align:e,alignOffset:o,anchor:C.selector,autoScroll:t,"data-step-id":C.id,defaultOpen:n,modal:l,part:m,side:f,sideOffset:x,spotlight:v},k),{children:jsxs(h,{animation:`${Da} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(h.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(ee=C.videoUri)!=null?ee:C.imageUri,transform:"translate3d(0, 0, 1px)",type:C.videoUri?"video":"image"},b)),jsx(h.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:r,handleDismiss:s,subtitle:C.subtitle,title:C.title}),jsxs(h.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsx(Ee,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsx(h.Secondary,{disabled:H,onClick:O,title:D}),jsx(h.Primary,{disabled:H,onClick:B,title:w})]})]})}))}function Ar(r){var i=r,{children:e,container:o,flowId:t}=i,n=g(i,["children","container","flowId"]);return jsx(br,{container:o,children:jsx(y,p(a({"data-flow-id":t,part:"tour"},n),{children:e}))})}function go(n){var r=n,{as:e,flowId:o}=r,t=g(r,["as","flowId"]);let{onDismiss:i,onPrimary:s,onSecondary:l}=t;return jsx(z,p(a({as:null,flowId:o},t),{children:({flow:d,handleDismiss:u,parentProps:m,step:f})=>{var ee;let Q=m.containerProps,{align:x="after",alignOffset:v=0,autoScroll:C=!1,container:P="body",defaultOpen:T,modal:S,part:B,sequential:O=!0,side:b="bottom",sideOffset:k=0,spotlight:w,zIndex:D=9999}=Q,H=g(Q,["align","alignOffset","autoScroll","container","defaultOpen","modal","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:re}=m,J=a({align:x,alignOffset:v,autoScroll:C,dismissible:re,flow:d,handleDismiss:u,modal:S,onPrimary:s,onSecondary:l,part:B,side:b,sideOffset:k,spotlight:w,step:f,zIndex:D},(ee=f.props)!=null?ee:{});if(O)return jsx(Ar,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:jsx(fo,a({defaultOpen:T!=null?T:!0},J),f.id)}));let U=Array.from(d.steps.values()).filter(_=>{let{blocked:q,completed:j,skipped:oe,visible:W}=_.$state;return !q&&!j&&!oe&&W}).map(_=>{var te,ce,se,xe;function q(le){return M(this,null,function*(){return (yield i==null?void 0:i(d,le))===!1?(le.preventDefault(),!1):(_.skip(),!0)})}let j=w&&_.id===f.id,oe=(ce=(te=_.props)==null?void 0:te.zIndex)!=null?ce:D,W=a({align:x,alignOffset:v,dismissible:re,flow:d,handleDismiss:q,onPrimary:s,onSecondary:l,part:B,side:b,sideOffset:k,spotlight:w,zIndex:oe},(se=_.props)!=null?se:{});return jsx(fo,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(oe)+2},".fr-overlay":{zIndex:Number(oe)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(xe=T||j)!=null?xe:!1,step:_},W),`${_.id}-${j}`)});return jsx(Ar,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:U}))}}))}function yo(){let{frigade:e}=useContext(A),[,o]=useState(!1),t,n=useCallback(s=>{e==null||e.getCollections().then(()=>{s();});let l=()=>{clearTimeout(t),t=setTimeout(()=>{o(d=>!d),s();},0);};return e==null||e.onStateChange(l),()=>{e==null||e.removeStateChangeHandler(l);}},[]),r=()=>{let s;try{s=e==null?void 0:e.getCollectionsSync();}catch(l){}return s};return {collections:useSyncExternalStore(n,r,r)}}function xo(e){var l,d,u,m;let{frigade:o}=useContext(A),{collections:t}=yo(),n=t==null?void 0:t.get(e),i=(m=((u=(d=(l=t==null?void 0:t.get(e))==null?void 0:l.flows)==null?void 0:d.filter(f=>f.visible).map(f=>p(a({},f),{flow:o==null?void 0:o.getFlowSync(f.flowId)})))!=null?u:[]).find(({flow:f})=>f.isVisible))==null?void 0:m.flowId,{flow:s}=Re(i);return useEffect(()=>{o==null||o.registerCollection(e);},[e]),{collection:n,currentFlow:s}}function Xo(r){var i=r,{collectionId:e,part:o,variables:t={}}=i,n=g(i,["collectionId","part","variables"]);var u,m,f;let s={ANNOUNCEMENT:Jo,BANNER:Oo,CARD:h,CHECKLIST:ro,EMBEDDED_TIP:h,FORM:Me,NPS_SURVEY:Ge,SURVEY:Ge,TOUR:go},{currentFlow:l}=xo(e),d=(m=s[(u=l==null?void 0:l.rawData)==null?void 0:u.flowType])!=null?m:null;return l==null||d==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(y,p(a({part:["collection",o],"data-collection-id":e},n),{children:jsx(Me,{flowId:l.id,as:V,variables:t},l.id)})):jsx(y,p(a({part:["collection",o],"data-collection-id":e},n),{children:jsx(d,{flowId:l.id,variables:t},l.id)}))}function Mr(){var t,n;let{collections:e}=yo(),o=(n=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(r=>r[1].collectionType==="DEFAULT"))==null?void 0:n[0];return xo(o),o==null?null:jsx(Xo,{as:null,collectionId:o})}var A=createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});function qo(){let{frigade:e}=useContext(A);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function $r(){let{frigade:e}=qo();return useEffect(()=>{M(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Wr="2.6.1";function Ur(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=l,i=g(l,["children","css","defaultCollection","navigate","theme"]);let d=r?vo(r):{},u=useRef(new Map),m=useRef(),[f,x]=useState(!1),[v,C]=useState(null),P=useMemo(()=>(x(!1),m.current=void 0,new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides,__platformVersion:Wr,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);useEffect(()=>{if(i.__flowStateOverrides){let b=P.getConfig();b.__flowStateOverrides=i.__flowStateOverrides,P.reload(b);}},[i.__flowStateOverrides]);function T(){let b=[...u.current.entries()].map(([k,w])=>[k,w.callback]);P.batchRegister(b),x(!0);}function S(b,k){if(m.current&&clearTimeout(m.current),f){u.current.has(b)?P.getFlow(b).then(w=>k(w.isVisible)):(P.getFlow(b).then(w=>w.register(k)),u.current.set(b,{callback:k}));return}u.current.has(b)||u.current.set(b,{callback:k}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>T(),0);}function B(b){u.current.has(b)&&P.getFlow(b).then(k=>{u.current.delete(b),k==null||k.unregister();});}let O=n!=null?n:(b,k="_self")=>{window.open(b,k);};return useEffect(()=>()=>{P.destroy();},[]),jsxs(A.Provider,{value:p(a({currentModal:v,setCurrentModal:C,navigate:O},i),{frigade:P,registerComponent:S,unregisterComponent:B,hasInitialized:f,variables:i.variables||{}}),children:[jsx(Global,{styles:{":root":a(a(a({},Ro),d),o)}}),jsxs(ThemeProvider,{theme:E,children:[t&&jsx(Mr,{}),e]}),i.preloadImages!==!1&&jsx($r,{})]})}function Re(e,o){let{frigade:t,variables:n}=useContext(A),[,r]=useState(!1),i=useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=u=>{u.id===e&&setTimeout(()=>{r(m=>!m),l();},0);};return t==null||t.onStateChange(d),()=>{t==null||t.removeStateChangeHandler(d);}},[e,t]),s=useSyncExternalStore(i,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return useEffect(()=>{s==null||s.applyVariables(a(a({},n),o==null?void 0:o.variables));},[o==null?void 0:o.variables,e,n]),{flow:s,isLoading:t!=null&&t.hasFailedToLoad()?!1:!s}}function Yo(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{if(e==null)return;function r(){return M(this,null,function*(){e.isCompleted&&n.current===!1&&(n.current=!0,yield o==null?void 0:o(e));})}return r(),n.current=e==null?void 0:e.isCompleted,()=>{r();}},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>M(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function jr(e,o=!0){let{currentModal:t,setCurrentModal:n}=useContext(A),r=useCallback(s=>{o&&e.isVisible&&n(s);},[o,e==null?void 0:e.isVisible]),i=useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&n(null);},[t,e==null?void 0:e.id]);return useEffect(()=>(e!=null&&t===null&&e.isVisible&&r(e.id),i),[t,e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{e!=null&&(!o||!e.isVisible)&&i();},[e==null?void 0:e.isVisible,o]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:{hasModalCollision:!0}}function et(e){return typeof e=="function"&&e.displayName==="Dialog"}function z(u){var m=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:i,onSecondary:s,variables:l}=m,d=g(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var U,Q,ee,q;let{flow:f}=Re(t,{variables:l}),x=f==null?void 0:f.getCurrentStep(),v=(U=x==null?void 0:x.props)!=null?U:{},{otherProps:C}=pe(v),_=a(a(a({},d),(Q=f==null?void 0:f.props)!=null?Q:{}),((ee=f==null?void 0:f.rawData)==null?void 0:ee.flowType)===FlowType.CHECKLIST?{}:C),{dismissible:P=!!et(e),forceMount:T=!1}=_,S=g(_,["dismissible","forceMount"]),{handleDismiss:B}=Yo(f,{onComplete:n,onDismiss:r}),{handlePrimary:O,handleSecondary:b}=ge(x,{onPrimary:i,onSecondary:s}),k=(S==null?void 0:S.modal)||et(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((q=f==null?void 0:f.rawData)==null?void 0:q.flowType),{hasModalCollision:w}=jr(f,k);function D(j){if(P===!1){j.preventDefault();return}typeof d.onEscapeKeyDown=="function"&&d.onEscapeKeyDown(j),j.defaultPrevented||B(j);}let H=T&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||(!f.isVisible||w)&&!H)return null;(H||!f.isCompleted&&!f.isSkipped)&&(x==null||x.start());let re=e===null?Fragment$1:e!=null?e:y,J=p(a({},S),{"data-flow-id":f.id});return et(e)&&(J.onEscapeKeyDown=D),jsx(re,p(a({},e===null?{}:J),{children:o({flow:f,handleDismiss:B,handlePrimary:O,handleSecondary:b,parentProps:{dismissible:P,flowId:t,variables:l,containerProps:J},step:x})}))}function Jr(t){var n=t,{part:e}=n,o=g(n,["part"]);return jsx(z,p(a({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:d})=>{var x,v,C,P,T,S;let u=(v=(x=d.primaryButton)==null?void 0:x.title)!=null?v:d.primaryButtonTitle,m=(P=(C=d.secondaryButton)==null?void 0:C.title)!=null?P:d.secondaryButtonTitle,{videoProps:f}=pe((T=d.props)!=null?T:{});return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:l,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsx(h.Media,a({src:(S=d.videoUri)!=null?S:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxs(F.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:m,onClick:s}),jsx(h.Primary,{title:u,onClick:i})]})]})}}))}function bo(n){var r=n,{part:e,src:o}=r,t=g(r,["part","src"]);return jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ss(e){var o,t,n,r,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Po(C){var P=C,{autoPlay:e,controls:o,controlsList:t,crossOrigin:n,disablePictureInPicture:r,disableRemotePlayback:i,loop:s,muted:l,playsInline:d,poster:u,preload:m,part:f,src:x}=P,v=g(P,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let T=ss(x);return T?jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",f],src:T},v)):x!=null&&x.endsWith(".mp4")?jsx(y,a({as:"video",part:["video",f],src:x,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:n,disablePictureInPicture:r,disableRemotePlayback:i,loop:s,muted:l!=null?l:e,playsInline:d,poster:u,preload:m},v)):(console.error(`Could not map videoUri ${x} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function be(n){var r=n,{src:e,type:o}=r,t=g(r,["src","type"]);return jsx(o==="video"?Po:bo,a({src:e},t))}var h=Eo.forwardRef((i,r)=>{var s=i,{children:e,flowId:o,part:t}=s,n=g(s,["children","flowId","part"]);var d;if(o!=null)return jsx(Jr,a({flowId:o},n));let l=(d=n.as)!=null?d:F.Column;return jsx(l,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});h.Dismiss=e=>jsx(I.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(ke,{height:"20",fill:"currentColor"})}));h.Footer=n=>{var r=n,{children:e,part:o}=r,t=g(r,["children","part"]);return jsx(F.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};h.Header=s=>{var l=s,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=l,i=g(l,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(r==null||(r==null?void 0:r.length)===0)&&(n==null||(n==null?void 0:n.length)===0)?null:jsxs(F.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};h.Media=t=>{var n=t,{src:e}=n,o=g(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(be,a({borderRadius:"md",src:e},o))};h.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=g(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Primary,a({title:o,onClick:e},t))};h.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=g(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Secondary,a({title:o,onClick:e},t))};h.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=g(r,["children","part"]);return e==null?null:jsx(R.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};h.Title=n=>{var r=n,{children:e,part:o}=r,t=g(r,["children","part"]);return e==null?null:jsx(R.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var Co={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Yr(e){let o=Object.fromEntries(Co.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(Co.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!Co.content.some(i=>i===r)&&!Co.root.some(i=>i===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var cs=keyframes`
|
|
66
|
+
`;function go(T){var S=T,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:i,handleDismiss:l,modal:s,onPrimary:d,onSecondary:u,part:f,side:m,sideOffset:x,spotlight:v,step:C}=S,P=g(S,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var re,J,U,Q,ee;let{handlePrimary:B,handleSecondary:O}=ge(C,{onPrimary:d,onSecondary:u}),{videoProps:b,otherProps:k}=pe(P),w=(J=(re=C.primaryButton)==null?void 0:re.title)!=null?J:C.primaryButtonTitle,D=(Q=(U=C.secondaryButton)==null?void 0:U.title)!=null?Q:C.secondaryButtonTitle,H=!!C.$state.blocked;return jsx(Xo,p(a({align:e,alignOffset:o,anchor:C.selector,autoScroll:t,"data-step-id":C.id,defaultOpen:r,modal:s,part:f,side:m,sideOffset:x,spotlight:v},k),{children:jsxs(h,{animation:`${Ia} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(h.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(ee=C.videoUri)!=null?ee:C.imageUri,transform:"translate3d(0, 0, 1px)",type:C.videoUri?"video":"image"},b)),jsx(h.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:l,subtitle:C.subtitle,title:C.title}),jsxs(h.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsx(Oe,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsx(h.Secondary,{disabled:H,onClick:O,title:D}),jsx(h.Primary,{disabled:H,onClick:B,title:w})]})]})}))}function Mr(n){var i=n,{children:e,container:o,flowId:t}=i,r=g(i,["children","container","flowId"]);return jsx(Pr,{container:o,children:jsx(y,p(a({"data-flow-id":t,part:"tour"},r),{children:e}))})}function yo(r){var n=r,{as:e,flowId:o}=n,t=g(n,["as","flowId"]);let{onDismiss:i,onPrimary:l,onSecondary:s}=t;return jsx(z,p(a({as:null,flowId:o},t),{children:({flow:d,handleDismiss:u,parentProps:f,step:m})=>{var ee;let Q=f.containerProps,{align:x="after",alignOffset:v=0,autoScroll:C=!1,container:P="body",defaultOpen:T,modal:S,part:B,sequential:O=!0,side:b="bottom",sideOffset:k=0,spotlight:w,zIndex:D=9999}=Q,H=g(Q,["align","alignOffset","autoScroll","container","defaultOpen","modal","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:re}=f,J=a({align:x,alignOffset:v,autoScroll:C,dismissible:re,flow:d,handleDismiss:u,modal:S,onPrimary:l,onSecondary:s,part:B,side:b,sideOffset:k,spotlight:w,step:m,zIndex:D},(ee=m.props)!=null?ee:{});if(O)return jsx(Mr,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:jsx(go,a({defaultOpen:T!=null?T:!0},J),m.id)}));let U=Array.from(d.steps.values()).filter(_=>{let{blocked:q,completed:j,skipped:oe,visible:W}=_.$state;return !q&&!j&&!oe&&W}).map(_=>{var te,ce,se,xe;function q(le){return M(this,null,function*(){return (yield i==null?void 0:i(d,le))===!1?(le.preventDefault(),!1):(_.skip(),!0)})}let j=w&&_.id===m.id,oe=(ce=(te=_.props)==null?void 0:te.zIndex)!=null?ce:D,W=a({align:x,alignOffset:v,dismissible:re,flow:d,handleDismiss:q,onPrimary:l,onSecondary:s,part:B,side:b,sideOffset:k,spotlight:w,zIndex:oe},(se=_.props)!=null?se:{});return jsx(go,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(oe)+2},".fr-overlay":{zIndex:Number(oe)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(xe=T||j)!=null?xe:!1,step:_},W),`${_.id}-${j}`)});return jsx(Mr,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:U}))}}))}function xo(){let{frigade:e}=useContext(A),[,o]=useState(!1),t,r=useCallback(l=>{e==null||e.getCollections().then(()=>{l();});let s=()=>{clearTimeout(t),t=setTimeout(()=>{o(d=>!d),l();},0);};return e==null||e.onStateChange(s),()=>{e==null||e.removeStateChangeHandler(s);}},[]),n=()=>{let l;try{l=e==null?void 0:e.getCollectionsSync();}catch(s){}return l};return {collections:useSyncExternalStore(r,n,n)}}function ho(e){var s,d,u,f;let{frigade:o}=useContext(A),{collections:t}=xo(),r=t==null?void 0:t.get(e),i=(f=((u=(d=(s=t==null?void 0:t.get(e))==null?void 0:s.flows)==null?void 0:d.filter(m=>m.visible).map(m=>p(a({},m),{flow:o==null?void 0:o.getFlowSync(m.flowId)})))!=null?u:[]).find(({flow:m})=>m.isVisible))==null?void 0:f.flowId,{flow:l}=Te(i);return useEffect(()=>{o==null||o.registerCollection(e);},[e]),{collection:r,currentFlow:l}}function Jo(n){var i=n,{collectionId:e,part:o,variables:t={}}=i,r=g(i,["collectionId","part","variables"]);var u,f,m;let l={ANNOUNCEMENT:qo,BANNER:Do,CARD:h,CHECKLIST:no,EMBEDDED_TIP:h,FORM:$e,NPS_SURVEY:Ke,SURVEY:Ke,TOUR:yo},{currentFlow:s}=ho(e),d=(f=l[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?f:null;return s==null||d==null?null:((m=s==null?void 0:s.rawData)==null?void 0:m.flowType)===FlowType.FORM?jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx($e,{flowId:s.id,as:V,variables:t},s.id)})):jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx(d,{flowId:s.id,variables:t},s.id)}))}function $r(){var t,r;let{collections:e}=xo(),o=(r=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(n=>n[1].collectionType==="DEFAULT"))==null?void 0:r[0];return ho(o),o==null?null:jsx(Jo,{as:null,collectionId:o})}var A=createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});var be=(e,o="log")=>{let t=`__frigade_logged_${e}`;globalThis[t]||(globalThis[t]=!0,console[o](e));};function Zo(){let e=useContext(A);(!e||!e.frigade)&&be("useFrigade() must be used in a child of the Frigade Provider","error");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function Wr(){let{frigade:e}=Zo();return useEffect(()=>{M(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}var Lr="2.6.3";function Gr(l){var s=l,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=s,i=g(s,["children","css","defaultCollection","navigate","theme"]);let d=n?Ro(n):{},u=useRef(new Map),f=useRef(),[m,x]=useState(!1),[v,C]=useState(null),P=useMemo(()=>(x(!1),f.current=void 0,new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides,__platformVersion:Lr,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);useEffect(()=>{if(i.__flowStateOverrides){let b=P.getConfig();b.__flowStateOverrides=i.__flowStateOverrides,P.reload(b);}},[i.__flowStateOverrides]);function T(){let b=[...u.current.entries()].map(([k,w])=>[k,w.callback]);P.batchRegister(b),x(!0);}function S(b,k){if(f.current&&clearTimeout(f.current),m){u.current.has(b)?P.getFlow(b).then(w=>k(w.isVisible)):(P.getFlow(b).then(w=>w.register(k)),u.current.set(b,{callback:k}));return}u.current.has(b)||u.current.set(b,{callback:k}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>T(),0);}function B(b){u.current.has(b)&&P.getFlow(b).then(k=>{u.current.delete(b),k==null||k.unregister();});}let O=r!=null?r:(b,k="_self")=>{window.open(b,k);};return useEffect(()=>()=>{P.destroy();},[]),jsxs(A.Provider,{value:p(a({currentModal:v,setCurrentModal:C,navigate:O},i),{frigade:P,registerComponent:S,unregisterComponent:B,hasInitialized:m,variables:i.variables||{}}),children:[jsx(Global,{styles:{":root":a(a(a({},To),d),o)}}),jsxs(ThemeProvider,{theme:E,children:[t&&jsx($r,{}),e]}),i.preloadImages!==!1&&jsx(Wr,{})]})}function Te(e,o){let t=useContext(A);(!t||!t.frigade)&&be(`useFlow('${e}') must be used in a child of the Frigade Provider`,"error");let{frigade:r,variables:n}=t!=null?t:{},[,i]=useState(!1),l=useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=f=>{f.id===e&&setTimeout(()=>{i(m=>!m),d();},0);};return r==null||r.onStateChange(u),()=>{r==null||r.removeStateChangeHandler(u);}},[e,r]),s=useSyncExternalStore(l,()=>r==null?void 0:r.getFlowSync(e),()=>r==null?void 0:r.getFlowSync(e));return useEffect(()=>{s==null||s.applyVariables(a(a({},n),o==null?void 0:o.variables));},[o==null?void 0:o.variables,e,n]),{flow:s,isLoading:r!=null&&r.hasFailedToLoad()?!1:!s}}function Qo(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{if(e==null)return;function n(){return M(this,null,function*(){e.isCompleted&&r.current===!1&&(r.current=!0,yield o==null?void 0:o(e));})}return n(),r.current=e==null?void 0:e.isCompleted,()=>{n();}},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>M(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Xr(e,o=!0){let{currentModal:t,setCurrentModal:r}=useContext(A),n=useCallback(l=>{o&&(e!=null&&e.isVisible)&&r(l);},[o,e==null?void 0:e.isVisible]),i=useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e==null?void 0:e.id]);return useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),i),[t,e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{e!=null&&(!o||!e.isVisible)&&i();},[e==null?void 0:e.isVisible,o]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function ot(e){return typeof e=="function"&&e.displayName==="Dialog"}function z(u){var f=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:l,variables:s}=f,d=g(f,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var U,Q,ee,q;let{flow:m}=Te(t,{variables:s}),x=m==null?void 0:m.getCurrentStep(),v=(U=x==null?void 0:x.props)!=null?U:{},{otherProps:C}=pe(v),_=a(a(a({},d),(Q=m==null?void 0:m.props)!=null?Q:{}),((ee=m==null?void 0:m.rawData)==null?void 0:ee.flowType)===FlowType.CHECKLIST?{}:C),{dismissible:P=!!ot(e),forceMount:T=!1}=_,S=g(_,["dismissible","forceMount"]),{handleDismiss:B}=Qo(m,{onComplete:r,onDismiss:n}),{handlePrimary:O,handleSecondary:b}=ge(x,{onPrimary:i,onSecondary:l}),k=(S==null?void 0:S.modal)||ot(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((q=m==null?void 0:m.rawData)==null?void 0:q.flowType),{hasModalCollision:w}=Xr(m,k);function D(j){if(P===!1){j.preventDefault();return}typeof d.onEscapeKeyDown=="function"&&d.onEscapeKeyDown(j),j.defaultPrevented||B(j);}let H=T&&((m==null?void 0:m.isCompleted)||(m==null?void 0:m.isSkipped));if(!m||(!m.isVisible||w)&&!H)return null;(H||!m.isCompleted&&!m.isSkipped)&&(x==null||x.start());let re=e===null?Fragment$1:e!=null?e:y,J=p(a({},S),{"data-flow-id":m.id});return ot(e)&&(J.onEscapeKeyDown=D),jsx(re,p(a({},e===null?{}:J),{children:o({flow:m,handleDismiss:B,handlePrimary:O,handleSecondary:b,parentProps:{dismissible:P,flowId:t,variables:s,containerProps:J},step:x})}))}function qr(t){var r=t,{part:e}=r,o=g(r,["part"]);return jsx(z,p(a({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:l,parentProps:{dismissible:s},step:d})=>{var x,v,C,P,T,S;let u=(v=(x=d.primaryButton)==null?void 0:x.title)!=null?v:d.primaryButtonTitle,f=(P=(C=d.secondaryButton)==null?void 0:C.title)!=null?P:d.secondaryButtonTitle,{videoProps:m}=pe((T=d.props)!=null?T:{});return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:s,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsx(h.Media,a({src:(S=d.videoUri)!=null?S:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},m)),jsxs(F.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:f,onClick:l}),jsx(h.Primary,{title:u,onClick:i})]})]})}}))}function Po(r){var n=r,{part:e,src:o}=n,t=g(n,["part","src"]);return jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ls(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Co(C){var P=C,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s,playsInline:d,poster:u,preload:f,part:m,src:x}=P,v=g(P,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let T=ls(x);return T?jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",m],src:T},v)):x!=null&&x.endsWith(".mp4")?jsx(y,a({as:"video",part:["video",m],src:x,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s!=null?s:e,playsInline:d,poster:u,preload:f},v)):(console.error(`Could not map videoUri ${x} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function Pe(r){var n=r,{src:e,type:o}=n,t=g(n,["src","type"]);return jsx(o==="video"?Co:Po,a({src:e},t))}var h=Oo.forwardRef((i,n)=>{var l=i,{children:e,flowId:o,part:t}=l,r=g(l,["children","flowId","part"]);var d;if(o!=null)return jsx(qr,a({flowId:o},r));let s=(d=r.as)!=null?d:F.Column;return jsx(s,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},r),{ref:n,children:e}))});h.Dismiss=e=>jsx(I.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}));h.Footer=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return jsx(F.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};h.Header=l=>{var s=l,{dismissible:e,handleDismiss:o,part:t,subtitle:r,title:n}=s,i=g(s,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(n==null||(n==null?void 0:n.length)===0)&&(r==null||(r==null?void 0:r.length)===0)?null:jsxs(F.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};h.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(Pe,a({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Primary,a({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Secondary,a({title:o,onClick:e},t))};h.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(R.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};h.Title=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(R.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var So={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Qr(e){let o=Object.fromEntries(So.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(So.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!So.content.some(i=>i===n)&&!So.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var us=keyframes`
|
|
67
67
|
from {
|
|
68
68
|
opacity: 0;
|
|
69
69
|
}
|
|
@@ -73,7 +73,7 @@ var st=Object.defineProperty,sn=Object.defineProperties;var ln=Object.getOwnProp
|
|
|
73
73
|
to {
|
|
74
74
|
opacity: 1;
|
|
75
75
|
}
|
|
76
|
-
`;function V(
|
|
76
|
+
`;function V(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=g(i,["children","className","modal"]);let{rootProps:l,contentProps:s,otherProps:f}=Qr(r),m=f,{zIndex:d}=m,u=g(m,["zIndex"]);return jsx(X.Root,p(a({defaultOpen:!0,modal:t},l),{children:jsx(X.Portal,{children:jsxs(y,{animation:`${us} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsx(X.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(X.Content,p(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},s),{children:jsx(h,p(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}V.Dismiss=e=>jsx(X.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,p(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}))});V.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(X.Description,{asChild:!0,children:jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))})};V.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsx(Pe,a({borderRadius:"md",src:e},o))};V.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(I.Primary,a({title:o,onClick:e},t))};V.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?E.colors.primary.surface:E.colors.neutral[700],part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};V.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(I.Secondary,a({title:o,onClick:e},t))};V.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(X.Title,{asChild:!0,children:jsx(R.H4,p(a({part:"title"},o),{children:e}))})};V.displayName="Dialog";function qo(r){var n=r,{flowId:e,part:o}=n,t=g(n,["flowId","part"]);return jsx(z,p(a({as:V,display:"flex",flexDirection:"column",flowId:e,gap:5,part:["announcement",o],textAlign:"center"},t),{children:({flow:i,handleDismiss:l,handlePrimary:s,handleSecondary:d,parentProps:{dismissible:u},step:f})=>{var P,T,S,B,O,b;let m=(T=(P=f.primaryButton)==null?void 0:P.title)!=null?T:f.primaryButtonTitle,x=(B=(S=f.secondaryButton)==null?void 0:S.title)!=null?B:f.secondaryButtonTitle,v=f.$state.blocked,{videoProps:C}=pe((O=f.props)!=null?O:{});return jsxs(Fragment,{children:[u&&jsx(V.Dismiss,{onClick:l}),jsxs(F.Column,{gap:1,part:"announcement-header",children:[jsx(V.Title,{children:f.title}),jsx(V.Subtitle,{children:f.subtitle})]}),jsx(V.Media,a({aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(b=f.videoUri)!=null?b:f.imageUri,transform:"translate3d(0, 0, 1px)",type:f.videoUri?"video":"image",width:"100%"},C)),jsx(V.ProgressDots,{current:i.getCurrentStepIndex(),total:i.getNumberOfAvailableSteps()}),jsxs(F.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[x&&jsx(V.Secondary,{disabled:v,onClick:d,title:x}),m&&jsx(V.Primary,{disabled:v,onClick:s,title:m})]})]})}}))}function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wo(...e){let o=e.shift(),t=e.length===1?e[0]:wo(...e);if(!rt(o)||!rt(t))throw new Error("deepmerge can only merge Objects");let r=structuredClone(o);return Object.entries(t).forEach(([n,i])=>{rt(i)?r[n]!==void 0?Object.assign(r,{[n]:wo(r[n],structuredClone(i))}):Object.assign(r,{[n]:structuredClone(i)}):Array.isArray(i)?r[n]!==void 0?Object.assign(r,{[n]:[...r[n],...structuredClone(i)]}):Object.assign(r,{[n]:structuredClone(i)}):Object.assign(r,{[n]:i});}),r}function gs(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function ys(t){var r=t,{title:e}=r,o=g(r,["title"]);return jsx(z,p(a({as:null},o),{children:({flow:n,parentProps:{containerProps:i},step:l})=>{var m,x,v;let s=gs(e,n.title,l.title),d=(m=n==null?void 0:n.getNumberOfCompletedSteps())!=null?m:0,u=(x=n==null?void 0:n.getNumberOfAvailableSteps())!=null?x:1,f=i.onClick!=null;return f&&(i.css=wo({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(v=i.css)!=null?v:{})),jsxs(h,p(a({"aria-label":"Progress Badge",borderWidth:"md",cursor:f?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},i),{children:[jsxs(F.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsx(h.Title,{fontSize:"sm",lineHeight:"sm",children:s}),jsx(y,{as:so,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxs(F.Row,{alignItems:"center",gap:"2",part:"progress-badge-footer",children:[jsx(Oe,{current:d,fontSize:"xs",fontWeight:"medium",lineHeight:"xs",total:u}),jsx(to,{current:d,flexGrow:"1",total:u})]})]}))}}))}var hs=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function on(r){var n=r,{style:e={},part:o=""}=n,t=g(n,["style","part"]);return jsxs(y,p(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${hs}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function tn({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},l="-24px",s={top:"bottom",right:"left",bottom:"top",left:"right"};n[s[r]]=l;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=l:n.bottom=l:["after","start"].includes(d)?["top","bottom"].includes(r)?n.left=l:n.top=l:["top","bottom"].includes(r)?n.left=`calc(50% + ${l})`:n.top=`calc(50% + ${l})`,n}var Fo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function rn(e,o){var i,l,s,d,u;let t=Object.fromEntries(Fo.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(Fo.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!Fo.content.includes(f)&&!Fo.root.includes(f)&&(n[f]=e[f]);if(t.align=(i=t.align)!=null?i:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},m=(S,B)=>["top","bottom"].includes(B)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",x=(s=t.alignOffset)!=null?s:0,v=(d=t.style)!=null?d:{},C=(u=t.side)!=null?u:"bottom",P=t.align;t.style=p(a({},v),{[m(P,C)]:x});let T=["top","bottom"].includes(C)?o.width:o.height;t.alignOffset=(T+x)*-1,t.align=f[P];}return {contentProps:t,otherProps:n,rootProps:r}}var nn=keyframes`
|
|
77
77
|
from {
|
|
78
78
|
opacity: 0;
|
|
79
79
|
}
|
|
@@ -83,8 +83,8 @@ var st=Object.defineProperty,sn=Object.defineProperties;var ln=Object.getOwnProp
|
|
|
83
83
|
to {
|
|
84
84
|
opacity: 1;
|
|
85
85
|
}
|
|
86
|
-
`;function
|
|
86
|
+
`;function an(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Se(u){var f=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:i,spotlight:l=!1,style:s={}}=f,d=g(f,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:m,rect:x,ref:v}=fo(),{node:C,rect:P,ref:T}=fo(),{contentProps:S,otherProps:B,rootProps:O}=rn(d,x),[b,k]=useState(r),[w,D]=useState(S.align),[H,re]=useState(S.side),[J,U]=useState(0),[Q,ee]=useState(0);function _(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",b),b)}if(m!==null){let W=m.getAttribute("data-align"),te=m.getAttribute("data-side");w!==W&&D(W),H!==te&&re(te);}let q=useRef(null);if(useEffect(()=>{let W=document.querySelector(e);W!=null?(T(W),q.current=W):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function W(ce){if(ce.matches(e))return an(ce)?ce:null;let se=ce.querySelectorAll(e);return se.length>0&&an(se[0])?se[0]:null}let te=new MutationObserver(ce=>{for(let se of ce)if(se.type==="childList"){for(let xe of se.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let le=W(xe);if(le!=null){T(le),q.current=le,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",le);break}}for(let xe of se.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let le=W(xe);if(le!=null){T(null),q.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",le);break}}}});return te.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>te.disconnect()},[]),useEffect(()=>{let{scrollX:W,scrollY:te}=window;U(P.left+W),ee(P.top+te);},[P.left,P.top]),C==null)return null;let j="0";typeof window!="undefined"&&(j=window.getComputedStyle(C).borderRadius);let oe=tn({props:d,alignAttr:w,sideAttr:H});return jsxs(de.Root,p(a({defaultOpen:!0},O),{children:[jsx(de.Anchor,{virtualRef:q}),jsx(de.Portal,{children:jsxs(Fragment,{children:[l&&jsx(y,a({animation:`${nn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:j,height:P.height,left:J,top:Q,width:P.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(de.Content,p(a({},S),{ref:v,children:jsxs(Fragment,{children:[_()&&jsx(h,p(a({animation:`${nn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:s},B),{children:o})),jsx(on,{onClick:()=>{k(()=>(typeof O.onOpenChange=="function"&&O.onOpenChange(!_()),!_()));},style:oe})]})}),b)]})})]}))}Se.Close=e=>jsx(de.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,p(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}))});Se.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsx(Pe,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};Se.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(I.Primary,a({title:o,onClick:e},t))};Se.Progress=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(R.Body2,p(a({part:"progress"},o),{children:e}))};Se.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(I.Secondary,a({title:o,onClick:e},t))};Se.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))};Se.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(R.H4,p(a({part:"title"},o),{children:e}))};function ws(){let e=useContext(A);(!e||!e.frigade)&&be("useUser() must be used in a child of the Frigade Provider","error");let{userId:o,frigade:t}=e!=null?e:{};function r(i){return M(this,null,function*(){yield t.identify(o,i);})}function n(i,l){return M(this,null,function*(){yield t.track(i,l);})}return {userId:o,addProperties:r,track:n}}function vs(){var i;let e=useContext(A);(!e||!e.frigade)&&be("useGroup() must be used in a child of the Frigade Provider","error");let{frigade:o}=e!=null?e:{};function t(l){return M(this,null,function*(){if(!o.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(o.config.groupId,l);})}function r(l,s){return M(this,null,function*(){yield o.track(l,s);})}function n(l,s){return M(this,null,function*(){yield o.group(l,s);})}return {groupId:(i=o==null?void 0:o.config)==null?void 0:i.groupId,setGroupId:n,addProperties:t,track:r}}
|
|
87
87
|
|
|
88
|
-
export {
|
|
88
|
+
export { qo as Announcement, Do as Banner, ae as BaseField, y as Box, I as Button, h as Card, io as Checklist, Jo as Collection, V as Dialog, F as Flex, z as Flow, $e as Form, Xo as Hint, Po as Image, Wo as Label, Pe as Media, Fe as Progress, ys as ProgressBadge, Gr as Provider, No as RadioField, _o as SelectField, Go as Spotlight, uo as Survey, R as Text, zo as TextField, Uo as TextareaField, Se as Tooltip, yo as Tour, Co as Video, To as themeVariables, Ye as tokens, fo as useBoundingClientRect, Te as useFlow, Qo as useFlowHandlers, Zo as useFrigade, vs as useGroup, ge as useStepHandlers, ws as useUser };
|
|
89
89
|
//# sourceMappingURL=out.js.map
|
|
90
90
|
//# sourceMappingURL=index.js.map
|