@frigade/react 2.6.8 → 2.7.1
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 +20 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +28 -26
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import { keyframes, Global, ThemeProvider } from '@emotion/react';
|
|
|
3
3
|
import * as J from '@radix-ui/react-dialog';
|
|
4
4
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
5
5
|
import * as Do from 'react';
|
|
6
|
-
import { createContext, useContext, useCallback, useState, useEffect, useLayoutEffect, useRef,
|
|
6
|
+
import { createContext, useContext, useMemo, useCallback, useState, useEffect, useLayoutEffect, useRef, Fragment as Fragment$1 } from 'react';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import Cn from 'known-css-properties';
|
|
9
9
|
import En 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
|
|
13
|
+
import Si from 'embla-carousel-react';
|
|
14
14
|
import * as Ie from '@radix-ui/react-collapsible';
|
|
15
15
|
import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
|
|
16
16
|
import * as $e from '@radix-ui/react-radio-group';
|
|
@@ -19,17 +19,17 @@ 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
|
-
import * as
|
|
22
|
+
import * as Ur from 'use-sync-external-store/shim/index.js';
|
|
23
23
|
import * as ce from '@radix-ui/react-popover';
|
|
24
24
|
|
|
25
|
-
var ut=Object.defineProperty,fn=Object.defineProperties;var gn=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable;var ct=(e,o,t)=>o in e?ut(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))mt.call(o,t)&&ct(e,t,o[t]);if(qe)for(var t of qe(o))ft.call(o,t)&&ct(e,t,o[t]);return e},p=(e,o)=>fn(e,gn(o));var yn=(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)mt.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&&ft.call(e,r)&&(t[r]=e[r]);return t};var ue=(e,o)=>{for(var t in o)ut(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 yt={borderWidths:{md:"1px"}};var Ze=[5,10,20,35,50,65,80,95,98],xt=[...Ze],Ro=[...Ze];xt[4]=40;Ro[4]=60;var xn={blue:{h:213,s:100,l:Ze},gray:{h:220,s:10,l:Ze},green:{h:141,s:90,l:xt},red:{h:9,s:90,l:Ro},yellow:{h:50,s:90,l:Ro}};var W={};for(let[e,{h:o,s:t,l:r}]of Object.entries(xn))W[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var ht=p(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.green[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var bt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,Pt={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 Ct={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var hn="px",bn=e=>typeof e=="number"?`${4*e}${hn}`:e,Pn=[-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"],St=Object.fromEntries(Pn.map(e=>[e,bn(e)]));var wt={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({},yt),{colors:a(a({},ht),Pt)}),wt),{radii:bt,shadows:Ct,space:St});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 To(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 vt(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]=vt(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var ko=To(Ye),O=vt(Ye);var Sn=new Set(["alt","size","src"]),wn=Cn.all.filter(e=>e.indexOf("-")!=0&&!Sn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),vn=Object.fromEntries(wn),Qe=Le(O.colors),Fn={color:Qe,backgroundColor:Qe,borderColor:Qe,border:a(a({},O.borderWidths),Qe),borderRadius:O.radii,borderWidth:O.borderWidths,boxShadow:O.shadows,fontFamily:O.fontFamilies,fontSize:O.fontSizes,fontWeight:O.fontWeights,gap:O.space,lineHeight:O.lineHeights,margin:O.space,marginBottom:O.space,marginLeft:O.space,marginRight:O.space,marginTop:O.space,padding:O.space,paddingBottom:O.space,paddingLeft:O.space,paddingRight:O.space,paddingTop:O.space},Ft=a(a({},vn),Fn),Rt={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"]},Tt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Rn(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 kt=new Map(Object.entries(Ft).map(([e,o])=>[e,Rn(o)])),Tn=new Map(Object.entries(Rt).map(([e,o])=>[e,new Set(o)])),kn=new Set(["height","width"]),Bn=new Set(["canvas","embed","iframe","img","input","object","video"]);function Bt(e){let[o,t]=e.split(":");return [o,Tt.has(t)?t:null]}function Et(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]=Bt(i),u=Tn.get(s);u!=null&&(u.forEach(m=>{let f=`${m}${d?":"+d:""}`;t[f]=l;}),delete t[i]);}),Object.entries(t).forEach(([i,l])=>{let[s,d]=Bt(i),u=kt.get(s);if(u!=null){if(l==null)delete t[i];else if(typeof l=="string"&&l.indexOf(" ")>-1){let m=l.split(" ");n(d)[s]=m.map(f=>{var x;return (x=u.get(f.toString()))!=null?x:f}).join(" ");}else u.has(l.toString())?n(d)[s]=u.get(l.toString()):n(d)[s]=l;(typeof o!="string"||!Bn.has(o)||!kn.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let l=i.substring(1);i.indexOf("_")===0&&kt.has(l)&&(t[l]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function On(){if(typeof window=="undefined"){let{JSDOM:e}=yn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ot(e){return e?{__html:En(On()).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 In(e){return e&&`fr-${e}`}function Ht(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Ht(o)).join(" "):In(e))}function Hn(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:m,unmatchedProps:f}=Et(i,u),x=Ht(n),w=t||x?clsx(t,x):void 0,S=[{boxSizing:"border-box"},m,r];return typeof o=="string"?jsx(u,p(a({className:w,css:S},f),{ref:l,dangerouslySetInnerHTML:Ot(o)})):jsx(u,p(a({className:w,css:S},f),{ref:l,children:o}))}var y=Do.forwardRef(Hn);var D={};ue(D,{Link:()=>pi,Plain:()=>di,Primary:()=>si,Secondary:()=>li});var T={};ue(T,{Body1:()=>Zn,Body2:()=>Yn,Caption:()=>Qn,Display1:()=>Gn,Display2:()=>Kn,H1:()=>jn,H2:()=>Xn,H3:()=>Jn,H4:()=>qn});var Bo={};ue(Bo,{Body1:()=>Nn,Body2:()=>_n,Caption:()=>zn,Display1:()=>Vn,Display2:()=>$n,H1:()=>An,H2:()=>Mn,H3:()=>Wn,H4:()=>Ln});var me={color:"neutral.foreground",fontFamily:"default",margin:"0"},Vn=p(a({},me),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),$n=p(a({},me),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),An=p(a({},me),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Mn=p(a({},me),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Wn=p(a({},me),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Ln=p(a({},me),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Nn=p(a({},me),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),_n=p(a({},me),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),zn=p(a({},me),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Un=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],fe=Object.fromEntries(Un.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Do.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},Bo[e]),i),{ref:l,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Gn=fe.Display1,Kn=fe.Display2,jn=fe.H1,Xn=fe.H2,Jn=fe.H3,qn=fe.H4,Zn=fe.Body1,Yn=fe.Body2,Qn=fe.Caption;var Oo={};ue(Oo,{Link:()=>ni,Plain:()=>ii,Primary:()=>ti,Secondary:()=>ri,loadingCSSStyle:()=>Eo});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"},ti=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"}),ri=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"}),ni=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),ii=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),ai=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Eo={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:ai+" 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]},Oo[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?Eo:{})}),i),{loading:void 0,children:[o,r&&jsx(T.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function si(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Primary",children:e}))}function li(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Secondary",children:e}))}function pi(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Link",children:e}))}function di(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Plain",children:e}))}var R={};ue(R,{Column:()=>mi,Row:()=>ui});var ui=Do.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"row"},e),{ref:o}))),mi=Do.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Io(r){var n=r,{flowId:e,part:o}=n,t=g(n,["flowId","part"]);return jsx(U,p(a({alignItems:"center","aria-label":"Banner",as:b,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 w,S,P,F;let m=(S=(w=u.primaryButton)==null?void 0:w.title)!=null?S:u.primaryButtonTitle,f=(F=(P=u.secondaryButton)==null?void 0:P.title)!=null?F: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(R.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:u.title}),jsx(b.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(b.Secondary,{disabled:x,title:f,onClick:s}),jsx(b.Primary,{disabled:x,title:m,onClick:l}),d&&jsx(b.Dismiss,{onClick:i})]})}}))}var io={};ue(io,{Carousel:()=>er,Collapsible:()=>no,CollapsibleStep:()=>ze});var ve={};ue(ve,{Bar:()=>Ee,Dots:()=>Lt,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 Lt(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?O.colors.blue500:O.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(T.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(R.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 zt(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 yi(){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 Ut(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(yi,{})})}))}function ge(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext($),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 Kt({onPrimary:e,onSecondary:o,step:t}){var u,m;let{handlePrimary:r,handleSecondary:n}=ge(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:l,skipped:s}=t.$state,d=l||s||!i?jsx(Ut,{checked:l||s,marginLeft:"auto"}):jsx(y,{as:zt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{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(R.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(R.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(b.Secondary,{disabled:i,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(b.Primary,{disabled:i,onClick:r,title:(m=t.primaryButton)==null?void 0:m.title})]})]})}function Xt(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 qt(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 Zt=keyframes`
|
|
25
|
+
var ut=Object.defineProperty,fn=Object.defineProperties;var gn=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable;var ct=(e,o,t)=>o in e?ut(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))mt.call(o,t)&&ct(e,t,o[t]);if(qe)for(var t of qe(o))ft.call(o,t)&&ct(e,t,o[t]);return e},p=(e,o)=>fn(e,gn(o));var yn=(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)mt.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&&ft.call(e,r)&&(t[r]=e[r]);return t};var ue=(e,o)=>{for(var t in o)ut(e,t,{get:o[t],enumerable:!0});};var V=(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 yt={borderWidths:{md:"1px"}};var Ze=[5,10,20,35,50,65,80,95,98],xt=[...Ze],Ro=[...Ze];xt[4]=40;Ro[4]=60;var xn={blue:{h:213,s:100,l:Ze},gray:{h:220,s:10,l:Ze},green:{h:141,s:90,l:xt},red:{h:9,s:90,l:Ro},yellow:{h:50,s:90,l:Ro}};var W={};for(let[e,{h:o,s:t,l:r}]of Object.entries(xn))W[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var ht=p(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.green[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var bt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,Pt={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 Ct={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var hn="px",bn=e=>typeof e=="number"?`${4*e}${hn}`:e,Pn=[-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"],St=Object.fromEntries(Pn.map(e=>[e,bn(e)]));var wt={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({},yt),{colors:a(a({},ht),Pt)}),wt),{radii:bt,shadows:Ct,space:St});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 To(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 vt(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]=vt(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var ko=To(Ye),O=vt(Ye);var Sn=new Set(["alt","size","src"]),wn=Cn.all.filter(e=>e.indexOf("-")!=0&&!Sn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),vn=Object.fromEntries(wn),Qe=Le(O.colors),Fn={color:Qe,backgroundColor:Qe,borderColor:Qe,border:a(a({},O.borderWidths),Qe),borderRadius:O.radii,borderWidth:O.borderWidths,boxShadow:O.shadows,fontFamily:O.fontFamilies,fontSize:O.fontSizes,fontWeight:O.fontWeights,gap:O.space,lineHeight:O.lineHeights,margin:O.space,marginBottom:O.space,marginLeft:O.space,marginRight:O.space,marginTop:O.space,padding:O.space,paddingBottom:O.space,paddingLeft:O.space,paddingRight:O.space,paddingTop:O.space},Ft=a(a({},vn),Fn),Rt={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"]},Tt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Rn(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 kt=new Map(Object.entries(Ft).map(([e,o])=>[e,Rn(o)])),Tn=new Map(Object.entries(Rt).map(([e,o])=>[e,new Set(o)])),kn=new Set(["height","width"]),Bn=new Set(["canvas","embed","iframe","img","input","object","video"]);function Bt(e){let[o,t]=e.split(":");return [o,Tt.has(t)?t:null]}function Et(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]=Bt(i),u=Tn.get(s);u!=null&&(u.forEach(m=>{let f=`${m}${d?":"+d:""}`;t[f]=l;}),delete t[i]);}),Object.entries(t).forEach(([i,l])=>{let[s,d]=Bt(i),u=kt.get(s);if(u!=null){if(l==null)delete t[i];else if(typeof l=="string"&&l.indexOf(" ")>-1){let m=l.split(" ");n(d)[s]=m.map(f=>{var x;return (x=u.get(f.toString()))!=null?x:f}).join(" ");}else u.has(l.toString())?n(d)[s]=u.get(l.toString()):n(d)[s]=l;(typeof o!="string"||!Bn.has(o)||!kn.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let l=i.substring(1);i.indexOf("_")===0&&kt.has(l)&&(t[l]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function On(){if(typeof window=="undefined"){let{JSDOM:e}=yn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ot(e){return e?{__html:En(On()).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 In(e){return e&&`fr-${e}`}function Ht(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Ht(o)).join(" "):In(e))}function Hn(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:m,unmatchedProps:f}=Et(i,u),x=Ht(n),v=t||x?clsx(t,x):void 0,S=[{boxSizing:"border-box"},m,r];return typeof o=="string"?jsx(u,p(a({className:v,css:S},f),{ref:l,dangerouslySetInnerHTML:Ot(o)})):jsx(u,p(a({className:v,css:S},f),{ref:l,children:o}))}var y=Do.forwardRef(Hn);var D={};ue(D,{Link:()=>pi,Plain:()=>di,Primary:()=>si,Secondary:()=>li});var T={};ue(T,{Body1:()=>Zn,Body2:()=>Yn,Caption:()=>Qn,Display1:()=>Gn,Display2:()=>Kn,H1:()=>jn,H2:()=>Xn,H3:()=>Jn,H4:()=>qn});var Bo={};ue(Bo,{Body1:()=>Nn,Body2:()=>_n,Caption:()=>Un,Display1:()=>Mn,Display2:()=>$n,H1:()=>An,H2:()=>Vn,H3:()=>Wn,H4:()=>Ln});var me={color:"neutral.foreground",fontFamily:"default",margin:"0"},Mn=p(a({},me),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),$n=p(a({},me),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),An=p(a({},me),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Vn=p(a({},me),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Wn=p(a({},me),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Ln=p(a({},me),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Nn=p(a({},me),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),_n=p(a({},me),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Un=p(a({},me),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var zn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],fe=Object.fromEntries(zn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Do.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},Bo[e]),i),{ref:l,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Gn=fe.Display1,Kn=fe.Display2,jn=fe.H1,Xn=fe.H2,Jn=fe.H3,qn=fe.H4,Zn=fe.Body1,Yn=fe.Body2,Qn=fe.Caption;var Oo={};ue(Oo,{Link:()=>ni,Plain:()=>ii,Primary:()=>ti,Secondary:()=>ri,loadingCSSStyle:()=>Eo});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"},ti=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"}),ri=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"}),ni=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),ii=p(a({},eo),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),ai=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Eo={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:ai+" 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]},Oo[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?Eo:{})}),i),{loading:void 0,children:[o,r&&jsx(T.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function si(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Primary",children:e}))}function li(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Secondary",children:e}))}function pi(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Link",children:e}))}function di(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(oo,p(a({},o),{variant:"Plain",children:e}))}var R={};ue(R,{Column:()=>mi,Row:()=>ui});var ui=Do.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"row"},e),{ref:o}))),mi=Do.forwardRef((e,o)=>jsx(y,p(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Io(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:b,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,S,P,w;let m=(S=(v=u.primaryButton)==null?void 0:v.title)!=null?S:u.primaryButtonTitle,f=(w=(P=u.secondaryButton)==null?void 0:P.title)!=null?w: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(R.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:u.title}),jsx(b.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(b.Secondary,{disabled:x,title:f,onClick:s}),jsx(b.Primary,{disabled:x,title:m,onClick:l}),d&&jsx(b.Dismiss,{onClick:i})]})}}))}var io={};ue(io,{Carousel:()=>er,Collapsible:()=>no,CollapsibleStep:()=>Ue});var ve={};ue(ve,{Bar:()=>Ee,Dots:()=>Lt,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 Lt(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?O.colors.blue500:O.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(T.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(R.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 Ut(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 yi(){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 zt(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(yi,{})})}))}function ge(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext($),n=useMemo(()=>e==null?{}:{"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,l)=>e.complete(i,l),"step.skip":(i,l)=>e.skip(i,l),"step.reset":()=>e.reset(),"step.start":i=>e.start(i)},[e]);return {handlePrimary:useCallback((i,l,s=!0)=>V(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}),[r,o,e,n]),handleSecondary:useCallback((i,l)=>V(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}),[r,t,e,n])}}function Kt({onPrimary:e,onSecondary:o,step:t}){var u,m;let{handlePrimary:r,handleSecondary:n}=ge(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:l,skipped:s}=t.$state,d=l||s||!i?jsx(zt,{checked:l||s,marginLeft:"auto"}):jsx(y,{as:Ut,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{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(R.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(R.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(b.Secondary,{disabled:i,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(b.Primary,{disabled:i,onClick:r,title:(m=t.primaryButton)==null?void 0:m.title})]})]})}function Xt(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 qt(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 Zt=keyframes`
|
|
26
26
|
from {
|
|
27
27
|
opacity: 0;
|
|
28
28
|
}
|
|
29
29
|
to {
|
|
30
30
|
opacity: 1;
|
|
31
31
|
}
|
|
32
|
-
`;function Yt({flow:e,sort:o,onPrimary:t,onSecondary:r}){var P,
|
|
32
|
+
`;function Yt({flow:e,sort:o,onPrimary:t,onSecondary:r}){var P,w;let[n,i]=useState(),[l]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(w=(P=Array.from(e.steps.values()).find(C=>!C.$state.completed&&!C.$state.skipped))==null?void 0:P.order)!=null?w:0}),[s,d]=Si(l),[u,m]=useState(),[f,x]=useState();useLayoutEffect(()=>{d&&(u==null&&m(d.canScrollNext()),f==null&&x(d.canScrollPrev()),d.on("select",()=>{m(d.canScrollNext()),x(d.canScrollPrev());}));},[d,u,f]),useEffect(()=>{if(!n){let C=Array.from(e.steps.values()),B=C.filter(h=>h.$state.completed||h.$state.skipped).sort((h,k)=>h.order-k.order),E=C.filter(h=>!h.$state.completed&&!h.$state.skipped).sort((h,k)=>h.order-k.order);i(o==="completed-last"?[...E,...B].map(h=>h.id):C.map(h=>h.id));}},[e.steps,o,n]);let v=e.getNumberOfCompletedSteps(),S=e.getNumberOfAvailableSteps();return n?jsxs(Fragment,{children:[jsxs(R.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:O.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(R.Column,{part:"carousel-header-content",children:[jsx(T.H3,{children:e.title}),jsx(T.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(R.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(T.Body2,{fontWeight:"demibold",part:"progress-text",children:[v,"/",S]}),jsx(Ee,{current:v,total:S,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${O.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsx(R.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(C=>C.$state.visible).sort((C,B)=>n.indexOf(C.id)-n.indexOf(B.id)).map(C=>jsx(Kt,{onPrimary:t,onSecondary:r,step:C},C.id))}),f&&jsx(R.Column,{animation:`${Zt} 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(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(qt,{height:"24px",width:"24px"})})}),u&&jsx(R.Column,{animation:`${Zt} 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(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(Xt,{height:"24px",width:"24px"})})})]})]}):null}function er(o){var e=g(o,[]);return jsx(z,p(a({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(Yt,a(a({},e),t))}))}var Ue={};ue(Ue,{Content:()=>$o,Root:()=>Ao,Trigger:()=>Vo});function tr(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 vi=keyframes`
|
|
33
33
|
from {
|
|
34
34
|
height: 0;
|
|
35
35
|
opacity: 0;
|
|
@@ -38,7 +38,7 @@ var ut=Object.defineProperty,fn=Object.defineProperties;var gn=Object.getOwnProp
|
|
|
38
38
|
height: var(--radix-collapsible-content-height);
|
|
39
39
|
opacity: 1;
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,Fi=keyframes`
|
|
42
42
|
from {
|
|
43
43
|
height: var(--radix-collapsible-content-height);
|
|
44
44
|
opacity: 1;
|
|
@@ -47,14 +47,14 @@ var ut=Object.defineProperty,fn=Object.defineProperties;var gn=Object.getOwnProp
|
|
|
47
47
|
height: 0;
|
|
48
48
|
opacity: 0;
|
|
49
49
|
}
|
|
50
|
-
`,Fi=()=>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 Ri({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(Fi,{})})})}function $o({children:e}){return jsx(Ie.Content,{asChild:!0,children:jsxs(R.Column,{css:{'&[data-state="open"]':{animation:`${wi} 300ms ease-out`},'&[data-state="closed"]':{animation:`${vi} 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(b,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(R.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(R.Row,{alignItems:"center",gap:2,children:[jsx(Ri,{checked:e}),jsx(T.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:tr,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ti=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function de(e){let o={},t={};for(let[r,n]of Object.entries(e))Ti.some(i=>i===r)?o[r]=n:t[r]=n;return {otherProps:t,videoProps:o}}var nr=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ir({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var P,F,C,B,E,h;let{$state:{blocked:i,completed:l,skipped:s},subtitle:d,title:u}=n,m=(F=(P=n.primaryButton)==null?void 0:P.title)!=null?F:n.primaryButtonTitle,f=(B=(C=n.secondaryButton)==null?void 0:C.title)!=null?B:n.secondaryButtonTitle,x=(E=n.props)!=null?E:{},w=!!i,{videoProps:S}=de(x);return jsxs(Ao,p(a({open:t,onOpenChange:r},x),{children:[jsx(Mo,{isBlocked:n.$state.blocked,isCompleted:l||s,title:u}),jsxs($o,{children:[jsx(b.Media,a({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(h=n.videoUri)!=null?h:n.imageUri,transform:"translate3d(0, 0, 1px)",type:n.videoUri?"video":"image"},S)),jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxs(R.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:f,onClick:o}),jsx(b.Primary,{disabled:w,title:m,onClick:e})]})]})]}))}var Oi={default:ir};function Di(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(nr),{handlePrimary:m,handleSecondary:f}=ge(o,{onPrimary:i,onSecondary:l}),x=(s!=null?s:e.getCurrentStep().id)===o.id,w=(P=u[o.type])!=null?P:ir;function S(F){return M(this,null,function*(){d(F?o.id:""),F&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(w,p(a({flow:e,onOpenChange:S,open:x,step:o},t),{handlePrimary:m,handleSecondary:f}),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),m=a(a({},Oi),n);return jsx(nr.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:m},children:jsx(U,p(a({as:b,borderWidth:"md",flowId:e,part:["checklist",r]},i),{children:S=>{var P=S,{flow:f,handleDismiss:x}=P,w=g(P,["flow","handleDismiss"]);var k;let C=Array.from(f.steps.entries()).filter(([,v])=>v.$state.visible===!0).map(([,v])=>jsx(Di,p(a({flow:f,handleDismiss:x},w),{step:v}),v.id)),B=f.getNumberOfCompletedSteps(),E=f.getNumberOfAvailableSteps(),h=i.dismissible||!!((k=f==null?void 0:f.props)!=null&&k.dismissible);return jsxs(Fragment,{children:[jsxs(R.Column,{gap:2,children:[jsx(b.Header,{dismissible:h,handleDismiss:x,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxs(R.Row,{alignItems:"center",gap:2,children:[jsxs(T.Body2,{fontWeight:"demibold",children:[B,"/",E]}),jsx(Ee,{current:B,total:E,flexGrow:1})]})]}),C]})}}))})}var Ni=new Set(["required","min","max","minLength","maxLength","pattern"]);function _i({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])=>Ni.has(s))),l=useController({name:t.id,control:o,rules:i});return jsx(e,p(a({},l),{fieldData:t,formContext:n,submit:r}))}function sr({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var B,E,h,k;let{__readOnly:l}=useContext($),s=useMemo(()=>{var v,I;return (I=(v=i.fields)==null?void 0:v.filter(H=>e[H.type]!=null&&H.id))!=null?I:[]},[i.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:s.reduce((v,I)=>{var H;return v[I.id]=(H=I.value)!=null?H:"",v},{})});useEffect(()=>{d.formState.isDirty||d.reset(s.reduce((v,I)=>{var H;return v[I.id]=(H=I.value)!=null?H:"",v},{}));},[s]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(v=>s.some(I=>I.id===v))&&d.trigger();},[i.id]);let[u,m]=useState(!1),f=[],{control:x,handleSubmit:w}=d;function S(v,I){m(!0),t(I,v,l===!0).then(()=>m(!1));}s.forEach(v=>{e[v.type]!=null&&f.push(jsx(_i,{control:x,fieldComponent:e[v.type],fieldData:v,submit:w(S)},`${i.flow.id}-${v.id}`));});let P=(E=(B=i.primaryButton)==null?void 0:B.title)!=null?E:i.primaryButtonTitle,F=(k=(h=i.secondaryButton)==null?void 0:h.title)!=null?k:i.secondaryButtonTitle,C=!!(i.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[i]),jsxs(Fragment,{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,p(a({},d),{children:f})),jsxs(R.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[F&&jsx(D.Secondary,{onClick:r,title:F}),jsx(D.Primary,{disabled:C||u,onClick:w(S),title:P!=null?P:"Submit",loading:u})]},`form-footer-${i.id}`)]})}function lr({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(T.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function Lo({children:e,id:o,required:t=!1}){return jsxs(T.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 No={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Ue=p(a({},No),{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 ie({children:e,field:o,fieldData:t,fieldState:r}){var m;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:(m=o.value)!=null?m:""}),s);return jsxs(y,{part:"field",children:[jsx(Lo,{id:n,required:!!t.required,children:i}),e(u),jsx(lr,{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 Xi=Do.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(T.Body2,{part:"field-radio-label",children:e}),jsx($e.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:$e.Indicator},ao),{children:jsx(Ve,{height:"14",width:"14"})}))})})]}));function _o(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:l})=>jsx(Xi,{value:l,label:i},l));return jsx(ie,p(a({},e),{children:()=>jsx($e.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(R.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 fr(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,[n,i]=Do.useState([]);function l(s){let d=[];n.includes(s)?d=[...n.filter(u=>u!==s)]:d=[...n,s],i(d),o(d);}return jsx(ie,p(a({},e),{children:()=>jsx(R.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(T.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 Zi=Do.forwardRef(({label:e,value:o},t)=>jsx(N.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(N.ItemText,{asChild:!0,children:jsx(T.Body2,{part:"field-select-option-label",children:e})})})}));function zo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:l,value:s})=>jsx(Zi,{value:s,label:l},s));return e.fieldData.multiple?jsx(fr,a({},e)):jsx(ie,p(a({},e),{children:()=>jsxs(N.Root,{value:t,onValueChange:o,children:[jsx(N.Trigger,{asChild:!0,children:jsxs(T.Body2,p(a({},Ue),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(N.Value,{placeholder:n!=null?n:"Select one"}),jsx(N.Icon,{children:jsx(y,{as:so,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(N.Portal,{children:jsx(N.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(N.Viewport,{children:i})}))})})]})}))}function Uo(e){return jsx(ie,p(a({},e),{children:o=>jsx(T.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Go(e){return jsx(ie,p(a({},e),{children:o=>jsx(T.Body2,a({as:"textarea",part:"field-textarea"},o))}))}function br(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({},No),{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(T.Body2,{part:"field-checkbox-label",as:"label",htmlFor:i,children:n})]})}var Qi={checkbox:br,radio:_o,select:zo,text:Uo,textarea:Go};function Me(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=g(i,["fieldTypes","flowId","part"]);let l=Object.assign({},Qi,e);return jsx(U,p(a({as:b,flowId:o,part:["form",t]},r),{children:s=>jsx(sr,a({fieldTypes:l},s))}))}var uo={};ue(uo,{NPS:()=>Ke});function Sr({field:e,fieldData:o,submit:t,options:r,positiveLabel:n,negativeLabel:i}){var s,d;let l=r.map(u=>{let m=e.value===u.value?D.Primary:D.Secondary;return jsx(m,{borderWidth:"1px",onClick:()=>{e.onChange(u.value),t();},title:u.label,css:{".fr-button-title":{fontSize:"15px"}}},u.value)});return jsxs(R.Column,{gap:2,children:[jsx(R.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:l}),jsxs(R.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(T.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(s=o.negativeLabel)!=null?s:i}),jsx(T.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(d=o.positiveLabel)!=null?d:n})]})]})}function Ke(d){var u=d,{as:e=V,flowId:o,fieldTypes:t,part:r,options:n,positiveLabel:i,negativeLabel:l}=u,s=g(u,["as","flowId","fieldTypes","part","options","positiveLabel","negativeLabel"]);var w,S,P;let{flow:m}=Te(o),f=(S=(w=m==null?void 0:m.props)==null?void 0:w.options)!=null?S:[...Array(11)].map((F,C)=>({label:`${C}`,value:`${C}`})),x=n||f;return jsx(Me,p(a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:F=>{var C,B,E,h,k,v;return jsx(Sr,p(a({},F),{options:x,positiveLabel:(E=(B=(C=m==null?void 0:m.props)==null?void 0:C.positiveLabel)!=null?B:i)!=null?E:"Extremely likely",negativeLabel:(v=(k=(h=m==null?void 0:m.props)==null?void 0:h.negativeLabel)!=null?k:l)!=null?v:"Not likely at all"}))}},t),modal:!1,onEscapeKeyDown:F=>{typeof s.onEscapeKeyDown=="function"&&s.onEscapeKeyDown(F),F.defaultPrevented||m.skip();},part:["nps",r]},s),{css:a({},a(p(a({},!m||m.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{".fr-card-header":{minWidth:x.length*51}}),{".fr-form":{padding:"20px","@media (max-width: 660px)":{minWidth:"100%"}},".fr-nps-field":{"@media (min-width: 660px)":{minWidth:"fit-content"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}},".fr-nps":{maxWidth:"min-content"}}),(P=s.css)!=null?P:{}))}))}function vr(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 Fr({children:e,container:o="body"}){return e!=null?vr(e,o):null}function aa(i,n){var l=i,{children:e,part:o,opacity:t=.5}=l,r=g(l,["children","part","opacity"]);let s=keyframes`
|
|
50
|
+
`,Ri=()=>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 Ti({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(Ri,{})})})}function $o({children:e}){return jsx(Ie.Content,{asChild:!0,children:jsxs(R.Column,{css:{'&[data-state="open"]':{animation:`${vi} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Fi} 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(b,p(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function Vo({isCompleted:e,isBlocked:o,title:t}){return jsx(Ie.Trigger,{asChild:!0,children:jsxs(R.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(R.Row,{alignItems:"center",gap:2,children:[jsx(Ti,{checked:e}),jsx(T.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:tr,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var ki=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function de(e){let o={},t={};for(let[r,n]of Object.entries(e))ki.some(i=>i===r)?o[r]=n:t[r]=n;return {otherProps:t,videoProps:o}}var nr=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ir({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var P,w,C,B,E,h;let{$state:{blocked:i,completed:l,skipped:s},subtitle:d,title:u}=n,m=(w=(P=n.primaryButton)==null?void 0:P.title)!=null?w:n.primaryButtonTitle,f=(B=(C=n.secondaryButton)==null?void 0:C.title)!=null?B:n.secondaryButtonTitle,x=(E=n.props)!=null?E:{},v=!!i,{videoProps:S}=de(x);return jsxs(Ao,p(a({open:t,onOpenChange:r},x),{children:[jsx(Vo,{isBlocked:n.$state.blocked,isCompleted:l||s,title:u}),jsxs($o,{children:[jsx(b.Media,a({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(h=n.videoUri)!=null?h:n.imageUri,transform:"translate3d(0, 0, 1px)",type:n.videoUri?"video":"image"},S)),jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxs(R.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:f,onClick:o}),jsx(b.Primary,{disabled:v,title:m,onClick:e})]})]})]}))}var Di={default:ir};function Ii(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(nr),{handlePrimary:m,handleSecondary:f}=ge(o,{onPrimary:i,onSecondary:l}),x=(s!=null?s:e.getCurrentStep().id)===o.id,v=(P=u[o.type])!=null?P:ir;function S(w){return V(this,null,function*(){d(w?o.id:""),w&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(v,p(a({flow:e,onOpenChange:S,open:x,step:o},t),{handlePrimary:m,handleSecondary:f}),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),m=a(a({},Di),n);return jsx(nr.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:m},children:jsx(z,p(a({as:b,borderWidth:"md",flowId:e,part:["checklist",r]},i),{children:S=>{var P=S,{flow:f,handleDismiss:x}=P,v=g(P,["flow","handleDismiss"]);var k;let C=Array.from(f.steps.entries()).filter(([,F])=>F.$state.visible===!0).map(([,F])=>jsx(Ii,p(a({flow:f,handleDismiss:x},v),{step:F}),F.id)),B=f.getNumberOfCompletedSteps(),E=f.getNumberOfAvailableSteps(),h=i.dismissible||!!((k=f==null?void 0:f.props)!=null&&k.dismissible);return jsxs(Fragment,{children:[jsxs(R.Column,{gap:2,children:[jsx(b.Header,{dismissible:h,handleDismiss:x,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxs(R.Row,{alignItems:"center",gap:2,children:[jsxs(T.Body2,{fontWeight:"demibold",children:[B,"/",E]}),jsx(Ee,{current:B,total:E,flexGrow:1})]})]}),C]})}}))})}var _i=new Set(["required","min","max","minLength","maxLength","pattern"]);function Ui({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])=>_i.has(s))),l=useController({name:t.id,control:o,rules:i});return jsx(e,p(a({},l),{fieldData:t,formContext:n,submit:r}))}function sr({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var B,E,h,k;let{__readOnly:l}=useContext($),s=useMemo(()=>{var F,I;return (I=(F=i.fields)==null?void 0:F.filter(H=>e[H.type]!=null&&H.id))!=null?I:[]},[i.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:s.reduce((F,I)=>{var H;return F[I.id]=(H=I.value)!=null?H:"",F},{})});useEffect(()=>{d.formState.isDirty||d.reset(s.reduce((F,I)=>{var H;return F[I.id]=(H=I.value)!=null?H:"",F},{}));},[s,d]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(F=>s.some(I=>I.id===F))&&d.trigger();},[s,d,i.id]);let[u,m]=useState(!1),f=[],{control:x,handleSubmit:v}=d;function S(F,I){m(!0),t(I,F,l===!0).then(()=>m(!1));}s.forEach(F=>{e[F.type]!=null&&f.push(jsx(Ui,{control:x,fieldComponent:e[F.type],fieldData:F,submit:v(S)},`${i.flow.id}-${F.id}`));});let P=(E=(B=i.primaryButton)==null?void 0:B.title)!=null?E:i.primaryButtonTitle,w=(k=(h=i.secondaryButton)==null?void 0:h.title)!=null?k:i.secondaryButtonTitle,C=!!(i.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[d,i]),jsxs(Fragment,{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,p(a({},d),{children:f})),jsxs(R.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[w&&jsx(D.Secondary,{onClick:r,title:w}),jsx(D.Primary,{disabled:C||u,onClick:v(S),title:P!=null?P:"Submit",loading:u})]},`form-footer-${i.id}`)]})}function lr({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(T.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function Lo({children:e,id:o,required:t=!1}){return jsxs(T.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 No={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},ze=p(a({},No),{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 ie({children:e,field:o,fieldData:t,fieldState:r}){var m;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}:{}),ze),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""}),s);return jsxs(y,{part:"field",children:[jsx(Lo,{id:n,required:!!t.required,children:i}),e(u),jsx(lr,{error:d})]})}function Me(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 Ji=Do.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(T.Body2,{part:"field-radio-label",children:e}),jsx($e.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:$e.Indicator},ao),{children:jsx(Me,{height:"14",width:"14"})}))})})]}));function _o(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:l})=>jsx(Ji,{value:l,label:i},l));return jsx(ie,p(a({},e),{children:()=>jsx($e.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(R.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 fr(e){let{field:{onChange:o},fieldData:{options:t=[]}}=e,[r,n]=Do.useState([]);function i(l){let s=[];r.includes(l)?s=[...r.filter(d=>d!==l)]:s=[...r,l],n(s),o(s);}return jsx(ie,p(a({},e),{children:()=>jsx(R.Column,{gap:2,part:"field-select-multiple",children:t.map(({label:l,value:s})=>jsx(lo.Root,{value:r.includes(s)?s:void 0,onCheckedChange:()=>i(s),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(T.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:s,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(Me,{height:"14",width:"14"})}))})})]})},s))})}))}var Yi=Do.forwardRef(({label:e,value:o},t)=>jsx(N.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(N.ItemText,{asChild:!0,children:jsx(T.Body2,{part:"field-select-option-label",children:e})})})}));function Uo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:l,value:s})=>jsx(Yi,{value:s,label:l},s));return e.fieldData.multiple?jsx(fr,a({},e)):jsx(ie,p(a({},e),{children:()=>jsxs(N.Root,{value:t,onValueChange:o,children:[jsx(N.Trigger,{asChild:!0,children:jsxs(T.Body2,p(a({},ze),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(N.Value,{placeholder:n!=null?n:"Select one"}),jsx(N.Icon,{children:jsx(y,{as:so,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(N.Portal,{children:jsx(N.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(N.Viewport,{children:i})}))})})]})}))}function zo(e){return jsx(ie,p(a({},e),{children:o=>jsx(T.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Go(e){return jsx(ie,p(a({},e),{children:o=>jsx(T.Body2,a({as:"textarea",part:"field-textarea"},o))}))}function br(e){let{field:{onChange:o,value:t},fieldData:{label:r,id:n=[]}}=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({},No),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:n,children:jsx(lo.Indicator,{asChild:!0,children:jsx(y,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Me,{height:"14",fill:"currentColor"})})})}))}),jsx(T.Body2,{part:"field-checkbox-label",as:"label",htmlFor:n,children:r})]})}var ea={checkbox:br,radio:_o,select:Uo,text:zo,textarea:Go};function Ve(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=g(i,["fieldTypes","flowId","part"]);let l=Object.assign({},ea,e);return jsx(z,p(a({as:b,flowId:o,part:["form",t]},r),{children:s=>jsx(sr,a({fieldTypes:l},s))}))}var uo={};ue(uo,{NPS:()=>Ke});function Sr({field:e,fieldData:o,submit:t,options:r,positiveLabel:n,negativeLabel:i}){var s,d;let l=r.map(u=>{let m=e.value===u.value?D.Primary:D.Secondary;return jsx(m,{borderWidth:"1px",onClick:()=>{e.onChange(u.value),t();},title:u.label,css:{".fr-button-title":{fontSize:"15px"}}},u.value)});return jsxs(R.Column,{gap:2,children:[jsx(R.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:l}),jsxs(R.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(T.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(s=o.negativeLabel)!=null?s:i}),jsx(T.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(d=o.positiveLabel)!=null?d:n})]})]})}function Ke(d){var u=d,{as:e=M,flowId:o,fieldTypes:t,part:r,options:n,positiveLabel:i,negativeLabel:l}=u,s=g(u,["as","flowId","fieldTypes","part","options","positiveLabel","negativeLabel"]);var v,S,P;let{flow:m}=Te(o),f=(S=(v=m==null?void 0:m.props)==null?void 0:v.options)!=null?S:[...Array(11)].map((w,C)=>({label:`${C}`,value:`${C}`})),x=n||f;return jsx(Ve,p(a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:w=>{var C,B,E,h,k,F;return jsx(Sr,p(a({},w),{options:x,positiveLabel:(E=(B=(C=m==null?void 0:m.props)==null?void 0:C.positiveLabel)!=null?B:i)!=null?E:"Extremely likely",negativeLabel:(F=(k=(h=m==null?void 0:m.props)==null?void 0:h.negativeLabel)!=null?k:l)!=null?F:"Not likely at all"}))}},t),modal:!1,onEscapeKeyDown:w=>{typeof s.onEscapeKeyDown=="function"&&s.onEscapeKeyDown(w),w.defaultPrevented||m.skip();},part:["nps",r]},s),{css:a({},a(p(a({},!m||m.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{".fr-card-header":{minWidth:x.length*51}}),{".fr-form":{padding:"20px","@media (max-width: 660px)":{minWidth:"100%"}},".fr-nps-field":{"@media (min-width: 660px)":{minWidth:"fit-content"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}},".fr-nps":{maxWidth:"min-content"}}),(P=s.css)!=null?P:{}))}))}function vr(e,o,t){let[r,n]=useState(!1),i=useRef();return useEffect(()=>{i.current=typeof o=="string"?document.querySelector(o):o,n(!0);},[o]),r?createPortal(e,i.current,t):null}function Fr({children:e,container:o="body"}){return vr(e,o)}function sa(i,n){var l=i,{children:e,part:o,opacity:t=.5}=l,r=g(l,["children","part","opacity"]);let s=keyframes`
|
|
51
51
|
from {
|
|
52
52
|
opacity: 0;
|
|
53
53
|
}
|
|
54
54
|
to {
|
|
55
55
|
opacity: ${t}
|
|
56
56
|
}
|
|
57
|
-
`;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=Do.forwardRef(
|
|
57
|
+
`;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=Do.forwardRef(sa);var ca=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Br(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 ${ca}`,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 xa({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 ha(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 Ko(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:m}){return s({maxX:u.floating.clientWidth,maxY:u.floating.clientHeight,radius:ha(u.reference),x1:m.reference.x,x2:m.reference.x+m.reference.width,y1:m.reference.y,y2:m.reference.y+m.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,d]),jsx(mo,a({part:["spotlight",o],ref:d.setFloating,style:a({clipPath:xa(l)},t)},r))}function Er({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 Dr(e,o){try{if(e.matches(o)&&Ir(e))return e;let t=e.querySelectorAll(o);if(t.length>0&&Ir(t[0]))return t[0]}catch(t){return null}}function Ir(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Hr(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=Dr(l,e);if(s!=null){t(s);break}}for(let l of i.removedNodes){if(l.nodeType!==Node.ELEMENT_NODE)continue;if(Dr(l,e)!=null){t(null);break}}}});return r.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),{anchorElement:o}}function Da(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function Mr({align:e,alignOffset:o,anchor:t,onOpenChange:r=()=>{},open:n,side:i,sideOffset:l}){let s=`${i}-${Da(e)}`;function d({rects:k}){let F={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(i)?F.alignmentAxis=o-k.floating.width:F.alignmentAxis=o-k.floating.height),F}let{context:u,floatingStyles:m,placement:f,refs:x}=useFloating({middleware:[offset(d,[e,o,i,l]),flip(),shift()],onOpenChange:r,open:n,placement:s,whileElementsMounted:autoUpdate}),v=useClick(u),S=useDismiss(u,{outsidePress:!1}),P=useRole(u),w=useTransitionStatus(u),{getFloatingProps:C,getReferenceProps:B}=useInteractions([v,S,P]),{anchorElement:E}=Hr(t);useEffect(()=>{E!=null?x.setReference(E):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[t,E,x]);let h=f.split("-");return e==="before"?h[1]=h[1]==="end"?"after":"before":e==="after"&&(h[1]=h[1]==="start"?"before":"after"),{context:u,getFloatingProps:C,getReferenceProps:B,floatingStyles:m,placement:h.join("-"),refs:x,status:w}}var jo={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:jo,[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 Vr(e){let[o,t]=useState(!1),[r,n]=useState(jo),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 Jo(w){var C=w,{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:m,side:f="bottom",sideOffset:x=0,spotlight:v=!1,style:S={}}=C,P=g(C,["align","alignOffset","anchor","autoScroll","children","css","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[B,E]=useState(l),[h,k]=useState(!1),F=u!=null?u:B,{getFloatingProps:I,getReferenceProps:H,floatingStyles:q,placement:X,refs:U,status:ee}=Mr({align:e,alignOffset:o,anchor:t,onOpenChange:ae=>{d(ae),u==null&&E(ae);},open:F,side:f,sideOffset:x}),[oe,te]=X.split("-"),Q=H(),{isVisible:L}=Vr(U.reference.current);return useEffect(()=>{if(!h&&r&&U.reference.current instanceof Element){let ae=typeof r!="boolean"?r:{behavior:"smooth",block:"center"},A;window.addEventListener("scroll",function G(){clearTimeout(A),A=setTimeout(()=>{window.removeEventListener("scroll",G),k(!0);},100);},!0),U.reference.current.scrollIntoView(ae);}else r||k(!0);},[r,U.reference,h]),U.reference.current==null||!h||!L?null:jsxs(Fragment,{children:[v&&F&&jsx(Ko,{anchor:t}),s&&!v&&F&&jsx(mo,{lockScroll:!0}),jsxs(y,p(a(a({css:a({'&[data-status="open"]':{transition:"transform 0.2s ease-out"}},i),"data-placement":X,"data-status":ee.status,part:["hint",m],ref:U.setFloating,style:a(a({},q),S)},I()),P),{children:[F&&n,jsx(Br,p(a({},Q),{position:"absolute",style:Er({align:te,side:oe}),clickable:l===!1}))]}))]})}var Wa=keyframes`
|
|
58
58
|
from {
|
|
59
59
|
opacity: 0;
|
|
60
60
|
}
|
|
@@ -64,7 +64,7 @@ var ut=Object.defineProperty,fn=Object.defineProperties;var gn=Object.getOwnProp
|
|
|
64
64
|
to {
|
|
65
65
|
opacity: 1;
|
|
66
66
|
}
|
|
67
|
-
`;function go(F){var C=F,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:i,handleDismiss:l,modal:s,onPrimary:d,onSecondary:u,part:m,side:f,sideOffset:x,spotlight:w,step:S}=C,P=g(C,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var q,X,z,ee,oe;let{handlePrimary:B,handleSecondary:E}=ge(S,{onPrimary:d,onSecondary:u}),{videoProps:h,otherProps:k}=de(P),v=(X=(q=S.primaryButton)==null?void 0:q.title)!=null?X:S.primaryButtonTitle,I=(ee=(z=S.secondaryButton)==null?void 0:z.title)!=null?ee:S.secondaryButtonTitle,H=!!S.$state.blocked;return jsx(Jo,p(a({align:e,alignOffset:o,anchor:S.selector,autoScroll:t,"data-step-id":S.id,defaultOpen:r,modal:s,part:m,side:f,sideOffset:x,spotlight:w},k),{children:jsxs(b,{animation:`${Ma} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(b.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(oe=S.videoUri)!=null?oe:S.imageUri,transform:"translate3d(0, 0, 1px)",type:S.videoUri?"video":"image"},h)),jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:l,subtitle:S.subtitle,title:S.title}),jsxs(b.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsx(Oe,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsx(b.Secondary,{disabled:H,onClick:E,title:I}),jsx(b.Primary,{disabled:H,onClick:B,title:v})]})]})}))}function _r(n){var i=n,{children:e,container:o,flowId:t}=i,r=g(i,["children","container","flowId"]);return jsx(Fr,{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(U,p(a({as:null,flowId:o},t),{children:({flow:d,handleDismiss:u,parentProps:m,step:f})=>{var Q;let te=m.containerProps,{align:x="after",alignOffset:w=0,autoScroll:S=!1,container:P="body",defaultOpen:F,modal:C,onOpenChange:B,open:E,part:h,sequential:k=!0,side:v="bottom",sideOffset:I=0,spotlight:H,zIndex:q=9999}=te,X=g(te,["align","alignOffset","autoScroll","container","defaultOpen","modal","onOpenChange","open","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:z}=m,ee=a({align:x,alignOffset:w,autoScroll:S,dismissible:z,flow:d,handleDismiss:u,modal:C,onPrimary:l,onSecondary:s,onOpenChange:B,open:E,part:h,side:v,sideOffset:I,spotlight:H,step:f,zIndex:q},(Q=f.props)!=null?Q:{});if(k)return jsx(_r,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:q},X),{children:jsx(go,a({defaultOpen:F!=null?F:!0},ee),f.id)}));let oe=Array.from(d.steps.values()).filter(L=>{let{blocked:ae,completed:A,skipped:G,visible:se}=L.$state;return !ae&&!A&&!G&&se}).map(L=>{var le,xe,pe,pt;function ae(dt){return M(this,null,function*(){return (yield i==null?void 0:i(d,dt))===!1?(dt.preventDefault(),!1):(L.skip(),!0)})}let A=H&&L.id===f.id,G=(xe=(le=L.props)==null?void 0:le.zIndex)!=null?xe:q,se=a({align:x,alignOffset:w,dismissible:z,flow:d,handleDismiss:ae,onPrimary:l,onSecondary:s,onOpenChange:B,open:E,part:h,side:v,sideOffset:I,spotlight:H,zIndex:G},(pe=L.props)!=null?pe:{});return jsx(go,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(G)+2},".fr-overlay":{zIndex:Number(G)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(pt=F||A)!=null?pt:!1,step:L},se),`${L.id}-${A}`)});return jsx(_r,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:q},X),{children:oe}))}}))}var xo="useSyncExternalStore"in Do?Do.useSyncExternalStore:zr.useSyncExternalStore;function ho(){let{frigade:e}=useContext($),[,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:xo(r,n,n)}}function bo(e){var s,d,u,m;let{frigade:o}=useContext($),{collections:t}=ho(),r=t==null?void 0:t.get(e),i=(m=((u=(d=(s=t==null?void 0:t.get(e))==null?void 0:s.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:l}=Te(i);return useEffect(()=>{o==null||o.registerCollection(e);},[e]),{collection:r,currentFlow:l}}function Zo(n){var i=n,{collectionId:e,part:o,variables:t={}}=i,r=g(i,["collectionId","part","variables"]);var u,m,f;let l={ANNOUNCEMENT:Yo,BANNER:Io,CARD:b,CHECKLIST:no,EMBEDDED_TIP:b,FORM:Me,NPS_SURVEY:Ke,SURVEY:Ke,TOUR:yo},{currentFlow:s}=bo(e),d=(m=l[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?m:null;return s==null||d==null?null:((f=s==null?void 0:s.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx(Me,{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 Ur(){var t,r;let{collections:e}=ho(),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 bo(o),o==null?null:jsx(Zo,{as:null,collectionId:o})}var $=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 Qo(){let e=useContext($);(!e||!e.frigade)&&be("useFrigade() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function Gr(){let{frigade:e}=Qo();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 Kr="2.6.8";function Zr(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?To(n):{},u=useRef(new Map),m=useRef(),[f,x]=useState(!1),[w,S]=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:Kr,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);useEffect(()=>{if(i.__flowStateOverrides){let h=P.getConfig();h.__flowStateOverrides=i.__flowStateOverrides,P.reload(h);}},[i.__flowStateOverrides]);function F(){let h=[...u.current.entries()].map(([k,v])=>[k,v.callback]);P.batchRegister(h),x(!0);}function C(h,k){if(m.current&&clearTimeout(m.current),f){u.current.has(h)?P.getFlow(h).then(v=>k(v.isVisible)):(P.getFlow(h).then(v=>v.register(k)),u.current.set(h,{callback:k}));return}u.current.has(h)||u.current.set(h,{callback:k}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>F(),0);}function B(h){u.current.has(h)&&P.getFlow(h).then(k=>{u.current.delete(h),k==null||k.unregister();});}let E=r!=null?r:(h,k="_self")=>{window.open(h,k);};return useEffect(()=>()=>{P.destroy();},[]),jsxs($.Provider,{value:p(a({currentModal:w,setCurrentModal:S,navigate:E},i),{frigade:P,registerComponent:C,unregisterComponent:B,hasInitialized:f,variables:i.variables||{}}),children:[jsx(Global,{styles:{":root":a(a(a({},ko),d),o)}}),jsxs(ThemeProvider,{theme:O,children:[t&&jsx(Ur,{}),e]}),i.preloadImages!==!1&&jsx(Gr,{})]})}function Te(e,o){let t=useContext($);(!t||!t.frigade)&&be(`useFlow('${e}') must be used in a child of the Frigade Provider`,"warn");let{frigade:r,variables:n}=t!=null?t:{},[,i]=useState(!1),l=useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=m=>{m.id===e&&setTimeout(()=>{i(f=>!f),d();},0);};return r==null||r.onStateChange(u),()=>{r==null||r.removeStateChangeHandler(u);}},[e,r]),s=xo(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 ot(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,t])}}function en(e,o=!0){let{currentModal:t,setCurrentModal:r}=useContext($),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 rt(e){return typeof e=="function"&&e.displayName==="Dialog"}function U(u){var m=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:l,variables:s}=m,d=g(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var z,ee,oe,Q;let{flow:f}=Te(t,{variables:s}),x=f==null?void 0:f.getCurrentStep(),w=(z=x==null?void 0:x.props)!=null?z:{},{otherProps:S}=de(w),te=a(a(a({},d),(ee=f==null?void 0:f.props)!=null?ee:{}),((oe=f==null?void 0:f.rawData)==null?void 0:oe.flowType)===FlowType.CHECKLIST?{}:S),{dismissible:P=!!rt(e),forceMount:F=!1}=te,C=g(te,["dismissible","forceMount"]),{handleDismiss:B}=ot(f,{onComplete:r,onDismiss:n}),{handlePrimary:E,handleSecondary:h}=ge(x,{onPrimary:i,onSecondary:l}),k=(C==null?void 0:C.modal)||rt(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Q=f==null?void 0:f.rawData)==null?void 0:Q.flowType),{hasModalCollision:v}=en(f,k);function I(L){if(P===!1){L.preventDefault();return}typeof d.onEscapeKeyDown=="function"&&d.onEscapeKeyDown(L),L.defaultPrevented||B(L);}let H=F&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||(!f.isVisible||v)&&!H)return null;(H||!f.isCompleted&&!f.isSkipped)&&(x==null||x.start());let q=e===null?Fragment$1:e!=null?e:y,X=p(a({},C),{"data-flow-id":f.id});return rt(e)&&(X.onEscapeKeyDown=I),jsx(q,p(a({},e===null?{}:X),{children:o({flow:f,handleDismiss:B,handlePrimary:E,handleSecondary:h,parentProps:{dismissible:P,flowId:t,variables:s,containerProps:X},step:x})}))}function tn(t){var r=t,{part:e}=r,o=g(r,["part"]);return jsx(U,p(a({as:b,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,w,S,P,F,C;let u=(w=(x=d.primaryButton)==null?void 0:x.title)!=null?w:d.primaryButtonTitle,m=(P=(S=d.secondaryButton)==null?void 0:S.title)!=null?P:d.secondaryButtonTitle,{videoProps:f}=de((F=d.props)!=null?F:{});return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:s,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsx(b.Media,a({src:(C=d.videoUri)!=null?C:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:m,onClick:l}),jsx(b.Primary,{title:u,onClick:i})]})]})}}))}function Co(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 cs(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 So(S){var P=S,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s,playsInline:d,poster:u,preload:m,part:f,src:x}=P,w=g(P,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let F=cs(x);return F?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:F},w)):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:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s!=null?s:e,playsInline:d,poster:u,preload:m},w)):(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"?So:Co,a({src:e},t))}var b=Do.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(tn,a({flowId:o},r));let s=(d=r.as)!=null?d:R.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}))});b.Dismiss=e=>jsx(D.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}));b.Footer=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return jsx(R.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.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(R.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};b.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))};b.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(D.Primary,a({title:o,onClick:e},t))};b.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(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(T.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(T.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var wo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function an(e){let o=Object.fromEntries(wo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(wo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!wo.content.some(i=>i===n)&&!wo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var gs=keyframes`
|
|
67
|
+
`;function go(w){var C=w,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:i,handleDismiss:l,modal:s,onPrimary:d,onSecondary:u,part:m,side:f,sideOffset:x,spotlight:v,step:S}=C,P=g(C,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var q,X,U,ee,oe;let{handlePrimary:B,handleSecondary:E}=ge(S,{onPrimary:d,onSecondary:u}),{videoProps:h,otherProps:k}=de(P),F=(X=(q=S.primaryButton)==null?void 0:q.title)!=null?X:S.primaryButtonTitle,I=(ee=(U=S.secondaryButton)==null?void 0:U.title)!=null?ee:S.secondaryButtonTitle,H=!!S.$state.blocked;return jsx(Jo,p(a({align:e,alignOffset:o,anchor:S.selector,autoScroll:t,"data-step-id":S.id,defaultOpen:r,modal:s,part:m,side:f,sideOffset:x,spotlight:v},k),{children:jsxs(b,{animation:`${Wa} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(b.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(oe=S.videoUri)!=null?oe:S.imageUri,transform:"translate3d(0, 0, 1px)",type:S.videoUri?"video":"image"},h)),jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:l,subtitle:S.subtitle,title:S.title}),jsxs(b.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsx(Oe,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsx(b.Secondary,{disabled:H,onClick:E,title:I}),jsx(b.Primary,{disabled:H,onClick:B,title:F})]})]})}))}function _r(n){var i=n,{children:e,container:o,flowId:t}=i,r=g(i,["children","container","flowId"]);return jsx(Fr,{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:m,step:f})=>{var Q;let te=m.containerProps,{align:x="after",alignOffset:v=0,autoScroll:S=!1,container:P="body",defaultOpen:w,modal:C,onOpenChange:B,open:E,part:h,sequential:k=!0,side:F="bottom",sideOffset:I=0,spotlight:H,zIndex:q=9999}=te,X=g(te,["align","alignOffset","autoScroll","container","defaultOpen","modal","onOpenChange","open","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:U}=m,ee=a({align:x,alignOffset:v,autoScroll:S,dismissible:U,flow:d,handleDismiss:u,modal:C,onPrimary:l,onSecondary:s,onOpenChange:B,open:E,part:h,side:F,sideOffset:I,spotlight:H,step:f,zIndex:q},(Q=f.props)!=null?Q:{});if(k)return jsx(_r,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:q},X),{children:jsx(go,a({defaultOpen:w!=null?w:!0},ee),f.id)}));let oe=Array.from(d.steps.values()).filter(L=>{let{blocked:ae,completed:A,skipped:G,visible:se}=L.$state;return !ae&&!A&&!G&&se}).map(L=>{var le,xe,pe,pt;function ae(dt){return V(this,null,function*(){return (yield i==null?void 0:i(d,dt))===!1?(dt.preventDefault(),!1):(L.skip(),!0)})}let A=H&&L.id===f.id,G=(xe=(le=L.props)==null?void 0:le.zIndex)!=null?xe:q,se=a({align:x,alignOffset:v,dismissible:U,flow:d,handleDismiss:ae,onPrimary:l,onSecondary:s,onOpenChange:B,open:E,part:h,side:F,sideOffset:I,spotlight:H,zIndex:G},(pe=L.props)!=null?pe:{});return jsx(go,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(G)+2},".fr-overlay":{zIndex:Number(G)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(pt=w||A)!=null?pt:!1,step:L},se),`${L.id}-${A}`)});return jsx(_r,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:q},X),{children:oe}))}}))}var xo="useSyncExternalStore"in Do?Do.useSyncExternalStore:Ur.useSyncExternalStore;function ho(){let{frigade:e}=useContext($),[,o]=useState(!1),t=useRef(),r=useCallback(l=>{e==null||e.getCollections().then(()=>{l();});let s=()=>{clearTimeout(t.current),t.current=setTimeout(()=>{o(d=>!d),l();},0);};return e==null||e.on("flow.any",s),()=>{e==null||e.off("flow.any",s);};},[e]),n=()=>{let l;try{l=e==null?void 0:e.getCollectionsSync();}catch(s){}return l};return {collections:xo(r,n,n)}}function bo(e){var s,d,u,m;let{frigade:o}=useContext($),{collections:t}=ho(),r=t==null?void 0:t.get(e),i=(m=((u=(d=(s=t==null?void 0:t.get(e))==null?void 0:s.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:l}=Te(i);return useEffect(()=>{o==null||o.registerCollection(e);},[e,o]),{collection:r,currentFlow:l}}function Zo(n){var i=n,{collectionId:e,part:o,variables:t={}}=i,r=g(i,["collectionId","part","variables"]);var u,m,f;let l={ANNOUNCEMENT:Yo,BANNER:Io,CARD:b,CHECKLIST:no,EMBEDDED_TIP:b,FORM:Ve,NPS_SURVEY:Ke,SURVEY:Ke,TOUR:yo},{currentFlow:s}=bo(e),d=(m=l[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?m:null;return s==null||d==null?null:((f=s==null?void 0:s.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsx(Ve,{flowId:s.id,as:M,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 zr(){var t,r;let{collections:e}=ho(),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 bo(o),o==null?null:jsx(Zo,{as:null,collectionId:o})}var $=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 Qo(){let e=useContext($);(!e||!e.frigade)&&be("useFrigade() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function Gr(){let{frigade:e}=Qo();return useEffect(()=>{V(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[e]),null}var Kr="2.7.1";function Zr(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?To(n):{},u=useRef(new Map),m=useRef(),[f,x]=useState(!1),[v,S]=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:Kr,__platformName:"React"})),[i.apiKey,i.apiUrl,i.userId,i.groupId,i.userProperties,i.groupProperties,i.generateGuestId,i.syncOnWindowUpdates,i.__readOnly,i.__flowStateOverrides]);useEffect(()=>{if(i.__flowStateOverrides){let h=P.getConfig();h.__flowStateOverrides=i.__flowStateOverrides,P.reload(h);}},[P,i.__flowStateOverrides]);function w(){let h=[...u.current.entries()].map(([k,F])=>[k,F.callback]);P.batchRegister(h),x(!0);}function C(h,k){if(m.current&&clearTimeout(m.current),f){u.current.has(h)?P.getFlow(h).then(F=>k(F.isVisible)):(P.getFlow(h).then(F=>F.register(k)),u.current.set(h,{callback:k}));return}u.current.has(h)||u.current.set(h,{callback:k}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>w(),0);}function B(h){u.current.has(h)&&P.getFlow(h).then(k=>{u.current.delete(h),k==null||k.unregister();});}let E=r!=null?r:(h,k="_self")=>{window.open(h,k);};return useEffect(()=>()=>{P.destroy();},[P]),jsxs($.Provider,{value:p(a({currentModal:v,setCurrentModal:S,navigate:E},i),{frigade:P,registerComponent:C,unregisterComponent:B,hasInitialized:f,variables:i.variables||{}}),children:[jsx(Global,{styles:{":root":a(a(a({},ko),d),o)}}),jsxs(ThemeProvider,{theme:O,children:[t&&jsx(zr,{}),e]}),i.preloadImages!==!1&&jsx(Gr,{})]})}function Te(e,o){let t=useContext($);(!t||!t.frigade)&&be(`useFlow('${e}') must be used in a child of the Frigade Provider`,"warn");let{frigade:r,variables:n}=t!=null?t:{},[,i]=useState(!1),l=useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=(m,f)=>{f.id===e&&setTimeout(()=>{i(x=>!x),d();},0);};return r==null||r.on("flow.any",u),()=>{r==null||r.off("flow.any",u);}},[e,r]),s=xo(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,s,e,n]),{flow:s,isLoading:r!=null&&r.hasFailedToLoad()?!1:!s}}function ot(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{if(e==null)return;function n(){return V(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,o]),{handleDismiss:useCallback(n=>V(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e,t])}}function en(e,o=!0){let{currentModal:t,setCurrentModal:r}=useContext($),n=useCallback(l=>{o&&(e!=null&&e.isVisible)&&r(l);},[o,e==null?void 0:e.isVisible,r]),i=useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e,r]);return useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),i),[n,t,e,i]),useEffect(()=>{e!=null&&(!o||!e.isVisible)&&i();},[e,o,i]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function rt(e){return typeof e=="function"&&e.displayName==="Dialog"}function z(u){var m=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:l,variables:s}=m,d=g(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var U,ee,oe,Q;let{flow:f}=Te(t,{variables:s}),x=f==null?void 0:f.getCurrentStep(),v=(U=x==null?void 0:x.props)!=null?U:{},{otherProps:S}=de(v),te=a(a(a({},d),(ee=f==null?void 0:f.props)!=null?ee:{}),((oe=f==null?void 0:f.rawData)==null?void 0:oe.flowType)===FlowType.CHECKLIST?{}:S),{dismissible:P=!!rt(e),forceMount:w=!1}=te,C=g(te,["dismissible","forceMount"]),{handleDismiss:B}=ot(f,{onComplete:r,onDismiss:n}),{handlePrimary:E,handleSecondary:h}=ge(x,{onPrimary:i,onSecondary:l}),k=(C==null?void 0:C.modal)||rt(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Q=f==null?void 0:f.rawData)==null?void 0:Q.flowType),{hasModalCollision:F}=en(f,k);function I(L){if(P===!1){L.preventDefault();return}typeof d.onEscapeKeyDown=="function"&&d.onEscapeKeyDown(L),L.defaultPrevented||B(L);}let H=w&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||(!f.isVisible||F)&&!H)return null;(H||!f.isCompleted&&!f.isSkipped)&&(x==null||x.start());let q=e===null?Fragment$1:e!=null?e:y,X=p(a({},C),{"data-flow-id":f.id});return rt(e)&&(X.onEscapeKeyDown=I),jsx(q,p(a({},e===null?{}:X),{children:o({flow:f,handleDismiss:B,handlePrimary:E,handleSecondary:h,parentProps:{dismissible:P,flowId:t,variables:s,containerProps:X},step:x})}))}function tn(t){var r=t,{part:e}=r,o=g(r,["part"]);return jsx(z,p(a({as:b,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,S,P,w,C;let u=(v=(x=d.primaryButton)==null?void 0:x.title)!=null?v:d.primaryButtonTitle,m=(P=(S=d.secondaryButton)==null?void 0:S.title)!=null?P:d.secondaryButtonTitle,{videoProps:f}=de((w=d.props)!=null?w:{});return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:s,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsx(b.Media,a({src:(C=d.videoUri)!=null?C:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:m,onClick:l}),jsx(b.Primary,{title:u,onClick:i})]})]})}}))}function Co(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 ms(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 So(S){var P=S,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s,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 w=ms(x);return w?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:w},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:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s!=null?s: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 Pe(r){var n=r,{src:e,type:o}=n,t=g(n,["src","type"]);return jsx(o==="video"?So:Co,a({src:e},t))}var b=Do.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(tn,a({flowId:o},r));let s=(d=r.as)!=null?d:R.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}))});b.Dismiss=e=>jsx(D.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}));b.Footer=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return jsx(R.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.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(R.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};b.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))};b.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(D.Primary,a({title:o,onClick:e},t))};b.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(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(T.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(T.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var wo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function an(e){let o=Object.fromEntries(wo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(wo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!wo.content.some(i=>i===n)&&!wo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var xs=keyframes`
|
|
68
68
|
from {
|
|
69
69
|
opacity: 0;
|
|
70
70
|
}
|
|
@@ -74,7 +74,7 @@ var ut=Object.defineProperty,fn=Object.defineProperties;var gn=Object.getOwnProp
|
|
|
74
74
|
to {
|
|
75
75
|
opacity: 1;
|
|
76
76
|
}
|
|
77
|
-
`;function
|
|
77
|
+
`;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=g(i,["children","className","modal"]);let{rootProps:l,contentProps:s,otherProps:m}=an(r),f=m,{zIndex:d}=f,u=g(f,["zIndex"]);return jsx(J.Root,p(a({defaultOpen:!0,modal:t},l),{children:jsx(J.Portal,{children:jsxs(y,{animation:`${xs} 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(J.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(J.Content,p(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},s),{children:jsx(b,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}))}))]})})}))}M.Dismiss=e=>jsx(J.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Be,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(J.Description,{asChild:!0,children:jsx(T.Body2,p(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsx(Pe,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};M.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?O.colors.primary.surface:O.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})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(J.Title,{asChild:!0,children:jsx(T.H4,p(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";function Yo(r){var n=r,{flowId:e,part:o}=n,t=g(n,["flowId","part"]);return jsx(z,p(a({as:M,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:m})=>{var P,w,C,B,E,h;let f=(w=(P=m.primaryButton)==null?void 0:P.title)!=null?w:m.primaryButtonTitle,x=(B=(C=m.secondaryButton)==null?void 0:C.title)!=null?B:m.secondaryButtonTitle,v=m.$state.blocked,{videoProps:S}=de((E=m.props)!=null?E:{});return jsxs(Fragment,{children:[u&&jsx(M.Dismiss,{onClick:l}),jsxs(R.Column,{gap:1,part:"announcement-header",children:[jsx(M.Title,{children:m.title}),jsx(M.Subtitle,{children:m.subtitle})]}),jsx(M.Media,a({aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(h=m.videoUri)!=null?h:m.imageUri,transform:"translate3d(0, 0, 1px)",type:m.videoUri?"video":"image",width:"100%"},S)),jsx(M.ProgressDots,{current:i.getCurrentStepIndex(),total:i.getNumberOfAvailableSteps()}),jsxs(R.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[x&&jsx(M.Secondary,{disabled:v,onClick:d,title:x}),f&&jsx(M.Primary,{disabled:v,onClick:s,title:f})]})]})}}))}function it(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vo(...e){let o=e.shift(),t=e.length===1?e[0]:vo(...e);if(!it(o)||!it(t))throw new Error("deepmerge can only merge Objects");let r=structuredClone(o);return Object.entries(t).forEach(([n,i])=>{it(i)?r[n]!==void 0?Object.assign(r,{[n]:vo(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 Ps(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function Cs(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 f,x,v;let s=Ps(e,n.title,l.title),d=(f=n==null?void 0:n.getNumberOfCompletedSteps())!=null?f:0,u=(x=n==null?void 0:n.getNumberOfAvailableSteps())!=null?x:1,m=i.onClick!=null;return m&&(i.css=vo({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(v=i.css)!=null?v:{})),jsxs(b,p(a({"aria-label":"Progress Badge",borderWidth:"md",cursor:m?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},i),{children:[jsxs(R.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsx(b.Title,{fontSize:"sm",lineHeight:"sm",children:s}),jsx(y,{as:so,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxs(R.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 ws=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ln(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 ${ws}`,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 pn({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 dn(e,o){var i,l,s,d,u;let t=Object.fromEntries(Fo.content.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),r=Object.fromEntries(Fo.root.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),n={};for(let m of Object.keys(e))!Fo.content.includes(m)&&!Fo.root.includes(m)&&(n[m]=e[m]);if(t.align=(i=t.align)!=null?i:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let m={after:"end",before:"start"},f=(C,B)=>["top","bottom"].includes(B)?C=="after"?"marginLeft":"marginRight":C=="after"?"marginTop":"marginBottom",x=(s=t.alignOffset)!=null?s:0,v=(d=t.style)!=null?d:{},S=(u=t.side)!=null?u:"bottom",P=t.align;t.style=p(a({},v),{[f(P,S)]:x});let w=["top","bottom"].includes(S)?o.width:o.height;t.alignOffset=(w+x)*-1,t.align=m[P];}return {contentProps:t,otherProps:n,rootProps:r}}var cn=keyframes`
|
|
78
78
|
from {
|
|
79
79
|
opacity: 0;
|
|
80
80
|
}
|
|
@@ -84,8 +84,8 @@ var ut=Object.defineProperty,fn=Object.defineProperties;var gn=Object.getOwnProp
|
|
|
84
84
|
to {
|
|
85
85
|
opacity: 1;
|
|
86
86
|
}
|
|
87
|
-
`;function un(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Se(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:i,spotlight:l=!1,style:s={}}=m,d=g(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:f,rect:x,ref:
|
|
87
|
+
`;function un(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Se(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:i,spotlight:l=!1,style:s={}}=m,d=g(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:f,rect:x,ref:v}=fo(),{node:S,rect:P,ref:w}=fo(),{contentProps:C,otherProps:B,rootProps:E}=dn(d,x),[h,k]=useState(r),[F,I]=useState(C.align),[H,q]=useState(C.side),[X,U]=useState(0),[ee,oe]=useState(0);function te(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",h),h)}if(f!==null){let A=f.getAttribute("data-align"),G=f.getAttribute("data-side");F!==A&&I(A),H!==G&&q(G);}let Q=useRef(null);if(useEffect(()=>{let A=document.querySelector(e);A!=null?(w(A),Q.current=A):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e,w]),useEffect(()=>{function A(se){if(se.matches(e))return un(se)?se:null;let le=se.querySelectorAll(e);return le.length>0&&un(le[0])?le[0]:null}let G=new MutationObserver(se=>{for(let le of se)if(le.type==="childList"){for(let xe of le.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let pe=A(xe);if(pe!=null){w(pe),Q.current=pe,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",pe);break}}for(let xe of le.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let pe=A(xe);if(pe!=null){w(null),Q.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",pe);break}}}});return G.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>G.disconnect()},[e,w]),useEffect(()=>{let{scrollX:A,scrollY:G}=window;U(P.left+A),oe(P.top+G);},[P.left,P.top]),S==null)return null;let L="0";typeof window!="undefined"&&(L=window.getComputedStyle(S).borderRadius);let ae=pn({props:d,alignAttr:F,sideAttr:H});return jsxs(ce.Root,p(a({defaultOpen:!0},E),{children:[jsx(ce.Anchor,{virtualRef:Q}),jsx(ce.Portal,{children:jsxs(Fragment,{children:[l&&jsx(y,a({animation:`${cn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:L,height:P.height,left:X,top:ee,width:P.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(ce.Content,p(a({},C),{ref:v,children:jsxs(Fragment,{children:[te()&&jsx(b,p(a({animation:`${cn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:s},B),{children:o})),jsx(ln,{onClick:()=>{k(()=>(typeof E.onOpenChange=="function"&&E.onOpenChange(!te()),!te()));},style:ae})]})}),h)]})})]}))}Se.Close=e=>jsx(ce.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.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(D.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(T.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(D.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(T.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(T.H4,p(a({part:"title"},o),{children:e}))};function ks(){let e=useContext($);(!e||!e.frigade)&&be("useUser() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=o==null?void 0:o.config.userId;function r(i){return V(this,null,function*(){yield o.identify(t,i);})}function n(i,l){return V(this,null,function*(){yield o.track(i,l);})}return {userId:t,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}function Es(){var l;let e=useContext($);(!e||!e.frigade)&&be("useGroup() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=(l=o==null?void 0:o.getConfig())==null?void 0:l.groupId;function r(s){return V(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,s);})}function n(s,d){return V(this,null,function*(){yield o.track(s,d);})}function i(s,d){return V(this,null,function*(){yield o.group(s,d);})}return {groupId:t,setGroupId:i,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}
|
|
88
88
|
|
|
89
|
-
export { Yo as Announcement, Io as Banner, ie as BaseField, y as Box, D as Button, b as Card, io as Checklist, Zo as Collection,
|
|
89
|
+
export { Yo as Announcement, Io as Banner, ie as BaseField, y as Box, D as Button, b as Card, io as Checklist, Zo as Collection, M as Dialog, R as Flex, z as Flow, Ve as Form, Jo as Hint, Co as Image, Lo as Label, Pe as Media, ve as Progress, Cs as ProgressBadge, Zr as Provider, _o as RadioField, Uo as SelectField, Ko as Spotlight, uo as Survey, T as Text, zo as TextField, Go as TextareaField, Se as Tooltip, yo as Tour, So as Video, ko as themeVariables, Ye as tokens, fo as useBoundingClientRect, Te as useFlow, ot as useFlowHandlers, Qo as useFrigade, Es as useGroup, ge as useStepHandlers, ks as useUser };
|
|
90
90
|
//# sourceMappingURL=out.js.map
|
|
91
91
|
//# sourceMappingURL=index.js.map
|