@frigade/react 2.5.0-canary.1 → 2.5.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 +60 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('@emotion/react');
|
|
4
|
-
var
|
|
4
|
+
var j = require('@radix-ui/react-dialog');
|
|
5
5
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
6
|
-
var
|
|
6
|
+
var Fo = require('react');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var qr = require('known-css-properties');
|
|
9
|
+
var an = require('dompurify');
|
|
10
10
|
var js = require('@frigade/js');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var qn = require('embla-carousel-react');
|
|
12
|
+
var Te = require('@radix-ui/react-collapsible');
|
|
13
13
|
var reactHookForm = require('react-hook-form');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
14
|
+
var De = require('@radix-ui/react-radio-group');
|
|
15
|
+
var V = require('@radix-ui/react-select');
|
|
16
|
+
var no = require('@radix-ui/react-checkbox');
|
|
17
17
|
var reactRemoveScroll = require('react-remove-scroll');
|
|
18
18
|
var react$1 = require('@floating-ui/react');
|
|
19
19
|
var reactDom = require('react-dom');
|
|
20
|
-
var
|
|
20
|
+
var re = require('@radix-ui/react-popover');
|
|
21
21
|
|
|
22
22
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
23
|
|
|
@@ -39,26 +39,26 @@ function _interopNamespace(e) {
|
|
|
39
39
|
return Object.freeze(n);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
42
|
+
var j__namespace = /*#__PURE__*/_interopNamespace(j);
|
|
43
|
+
var Fo__namespace = /*#__PURE__*/_interopNamespace(Fo);
|
|
44
|
+
var qr__default = /*#__PURE__*/_interopDefault(qr);
|
|
45
|
+
var an__default = /*#__PURE__*/_interopDefault(an);
|
|
46
46
|
var js__namespace = /*#__PURE__*/_interopNamespace(js);
|
|
47
|
-
var
|
|
48
|
-
var ve__namespace = /*#__PURE__*/_interopNamespace(ve);
|
|
47
|
+
var qn__default = /*#__PURE__*/_interopDefault(qn);
|
|
49
48
|
var Te__namespace = /*#__PURE__*/_interopNamespace(Te);
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
49
|
+
var De__namespace = /*#__PURE__*/_interopNamespace(De);
|
|
50
|
+
var V__namespace = /*#__PURE__*/_interopNamespace(V);
|
|
51
|
+
var no__namespace = /*#__PURE__*/_interopNamespace(no);
|
|
52
|
+
var re__namespace = /*#__PURE__*/_interopNamespace(re);
|
|
53
53
|
|
|
54
|
-
var Jo=Object.defineProperty,_r=Object.defineProperties;var zr=Object.getOwnPropertyDescriptors;var Ge=Object.getOwnPropertySymbols;var qo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable;var Xo=(e,o,t)=>o in e?Jo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))qo.call(o,t)&&Xo(e,t,o[t]);if(Ge)for(var t of Ge(o))Zo.call(o,t)&&Xo(e,t,o[t]);return e},s=(e,o)=>_r(e,zr(o));var Ur=(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 f=(e,o)=>{var t={};for(var n in e)qo.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Ge)for(var n of Ge(e))o.indexOf(n)<0&&Zo.call(e,n)&&(t[n]=e[n]);return t};var oe=(e,o)=>{for(var t in o)Jo(e,t,{get:o[t],enumerable:!0});};var $=(e,o,t)=>new Promise((n,r)=>{var a=d=>{try{p(t.next(d));}catch(m){r(m);}},l=d=>{try{p(t.throw(d));}catch(m){r(m);}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,l);p((t=t.apply(e,o)).next());});function Ce(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 Qo={borderWidths:{md:"1px"}};var Ke=[5,10,20,35,50,65,80,95,98],et=[...Ke],yo=[...Ke];et[4]=40;yo[4]=60;var Gr={blue:{h:213,s:100,l:Ke},gray:{h:220,s:10,l:Ke},green:{h:141,s:90,l:et},red:{h:9,s:90,l:yo},yellow:{h:50,s:90,l:yo}};var M={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Gr))M[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var ot=s(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},M),{gray100:M.gray[100],gray200:M.gray[200],gray300:M.gray[300],gray400:M.gray[400],gray500:M.gray[500],gray600:M.gray[600],gray700:M.gray[700],gray800:M.gray[800],gray900:M.gray[900],blue400:M.blue[400],blue500:M.blue[500],blue800:M.blue[800],blue900:M.blue[900],green400:M.blue[400],green500:M.green[500],green800:M.green[800],red500:M.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var tt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,rt={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("white"),border:c("neutral-900"),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-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")},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 nt={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Kr="px",jr=e=>typeof e=="number"?`${4*e}${Kr}`:e,Xr=[-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"],it=Object.fromEntries(Xr.map(e=>[e,jr(e)]));var at={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 je=s(i(s(i({},Qo),{colors:i(i({},ot),rt)}),at),{radii:tt,shadows:nt,space:it});function He(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let l=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,He(p,l,t)):n[l]=p,n},{})}function xo(e){let o=He(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function st(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=st(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var ho=xo(je),k=st(je);var qr=new Set(["alt","size","src"]),Zr=Jr__default.default.all.filter(e=>e.indexOf("-")!=0&&!qr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Yr=Object.fromEntries(Zr),Xe=He(k.colors),Qr={color:Xe,backgroundColor:Xe,borderColor:Xe,border:i(i({},k.borderWidths),Xe),borderRadius:k.radii,borderWidth:k.borderWidths,boxShadow:k.shadows,fontFamily:k.fontFamilies,fontSize:k.fontSizes,fontWeight:k.fontWeights,gap:k.space,lineHeight:k.lineHeights,margin:k.space,marginBottom:k.space,marginLeft:k.space,marginRight:k.space,marginTop:k.space,padding:k.space,paddingBottom:k.space,paddingLeft:k.space,paddingRight:k.space,paddingTop:k.space},lt=i(i({},Yr),Qr),pt={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"]},dt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function en(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 ct=new Map(Object.entries(lt).map(([e,o])=>[e,en(o)])),on=new Map(Object.entries(pt).map(([e,o])=>[e,new Set(o)])),tn=new Set(["height","width"]),rn=new Set(["canvas","embed","iframe","img","input","object","video"]);function mt(e){let[o,t]=e.split(":");return [o,dt.has(t)?t:null]}function ut(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let p=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([a,l])=>{let[p,d]=mt(a),m=on.get(p);m!=null&&(m.forEach(u=>{let y=`${u}${d?":"+d:""}`;t[y]=l;}),delete t[a]);}),Object.entries(t).forEach(([a,l])=>{let[p,d]=mt(a),m=ct.get(p);if(m!=null){if(l==null)delete t[a];else if(typeof l=="string"&&l.indexOf(" ")>-1){let u=l.split(" ");r(d)[p]=u.map(y=>{var h;return (h=m.get(y.toString()))!=null?h:y}).join(" ");}else m.has(l.toString())?r(d)[p]=m.get(l.toString()):r(d)[p]=l;(typeof o!="string"||!rn.has(o)||!tn.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let l=a.substring(1);a.indexOf("_")===0&&ct.has(l)&&(t[l]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function an(){if(typeof window=="undefined"){let{JSDOM:e}=Ur("jsdom");return new e("<!DOCTYPE html>").window}return window}function ft(e){return e?{__html:nn__default.default(an()).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 ln(e){return e&&`fr-${e}`}function xt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>xt(o)).join(" "):ln(e))}function pn(p,l){var d=p,{as:e,children:o,className:t,css:n={},part:r}=d,a=f(d,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:u,unmatchedProps:y}=ut(a,m),h=xt(r),x=t||h?clsx.clsx(t,h):void 0,F=[{boxSizing:"border-box"},u,n];return typeof o=="string"?jsxRuntime.jsx(m,s(i({className:x,css:F},y),{ref:l,dangerouslySetInnerHTML:ft(o)})):jsxRuntime.jsx(m,s(i({className:x,css:F},y),{ref:l,children:o}))}var g=So__namespace.forwardRef(pn);var D={};oe(D,{Link:()=>Wn,Plain:()=>Vn,Primary:()=>Mn,Secondary:()=>An});var w={};oe(w,{Body1:()=>Rn,Body2:()=>Bn,Caption:()=>Tn,Display1:()=>Pn,Display2:()=>Cn,H1:()=>Sn,H2:()=>wn,H3:()=>Fn,H4:()=>vn});var bo={};oe(bo,{Body1:()=>yn,Body2:()=>xn,Caption:()=>hn,Display1:()=>dn,Display2:()=>cn,H1:()=>mn,H2:()=>un,H3:()=>fn,H4:()=>gn});var te={color:"neutral.foreground",fontFamily:"default",margin:"0"},dn=s(i({},te),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),cn=s(i({},te),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),mn=s(i({},te),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),un=s(i({},te),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),fn=s(i({},te),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),gn=s(i({},te),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),yn=s(i({},te),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),xn=s(i({},te),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),hn=s(i({},te),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var bn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],re=Object.fromEntries(bn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=So__namespace.forwardRef((p,l)=>{var d=p,{as:n=o,children:r}=d,a=f(d,["as","children"]);return jsxRuntime.jsx(g,s(i(i({as:n},bo[e]),a),{ref:l,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Pn=re.Display1,Cn=re.Display2,Sn=re.H1,wn=re.H2,Fn=re.H3,vn=re.H4,Rn=re.Body1,Bn=re.Body2,Tn=re.Caption;var Co={};oe(Co,{Link:()=>In,Plain:()=>Hn,Primary:()=>Dn,Secondary:()=>On,loadingCSSStyle:()=>Po});var Je={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Dn=s(i({},Je),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),On=s(i({},Je),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),In=s(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Hn=s(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),$n=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Po={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:$n+" 1s ease infinite"}};function qe(l){var p=l,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,a=f(p,["as","children","part","title","variant"]);var m;let d=r.toLocaleLowerCase();return jsxRuntime.jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${d}`,t]},Co[r]),{css:i(i({},(m=a.css)!=null?m:{}),a.loading?Po:{})}),a),{loading:void 0,children:[o,n&&jsxRuntime.jsx(w.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function Mn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(qe,s(i({},o),{variant:"Primary",children:e}))}function An(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(qe,s(i({},o),{variant:"Secondary",children:e}))}function Wn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(qe,s(i({},o),{variant:"Link",children:e}))}function Vn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(qe,s(i({},o),{variant:"Plain",children:e}))}var S={};oe(S,{Column:()=>_n,Row:()=>Nn});var Nn=So__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),_n=So__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function wo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=f(a,["dismissible","flowId","part"]);return jsxRuntime.jsx(z,s(i({as:null,flowId:o},n),{children:({handleDismiss:l,handlePrimary:p,handleSecondary:d,parentProps:{containerProps:m},step:u})=>{var v,T,B,P,C;let y=(v=u.props)!=null?v:{},h=(B=(T=u.primaryButton)==null?void 0:T.title)!=null?B:u.primaryButtonTitle,x=(C=(P=u.secondaryButton)==null?void 0:P.title)!=null?C:u.secondaryButtonTitle,F=u.$state.blocked;return jsxRuntime.jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},m),y),{children:[u.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:u.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:F,title:x,onClick:d}),jsxRuntime.jsx(b.Primary,{disabled:F,title:h,onClick:p}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:l})]}))}}))}var eo={};oe(eo,{Carousel:()=>Wt,Collapsible:()=>Qe,CollapsibleStep:()=>Ae});var we={};oe(we,{Bar:()=>Se,Dots:()=>wt,Fraction:()=>Ze,Segments:()=>vt});function Se(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,l=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function wt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((l,p)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?k.colors.blue500:k.colors.blue800},p));return jsxRuntime.jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Ze(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);return jsxRuntime.jsx(w.Body2,s(i({part:"progress-fraction"},t),{children:`${e}/${o}`}))}function vt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=[...Array(o)].map((l,p)=>jsxRuntime.jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(S.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Bt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsxRuntime.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 Un(){return jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Tt(t){var n=t,{checked:e=!1}=n,o=f(n,["checked"]);return jsxRuntime.jsx(g,s(i({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&&jsxRuntime.jsx(g,{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:jsxRuntime.jsx(Un,{})})}))}function ne(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=So.useContext(N),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:So.useCallback((a,l,p=!0)=>$(this,null,function*(){if((yield o==null?void 0:o(e,a,l))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(l,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:So.useCallback((a,l)=>$(this,null,function*(){if((yield t==null?void 0:t(e,a,l))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(l),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Et({onPrimary:e,onSecondary:o,step:t}){var m,u;let{handlePrimary:n,handleSecondary:r}=ne(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:l,skipped:p}=t.$state,d=l||p||!a?jsxRuntime.jsx(Tt,{checked:l||p,marginLeft:"auto"}):jsxRuntime.jsx(g,{as:Bt,height:"22px",marginLeft:"auto",width:"22px"});return jsxRuntime.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:a,opacity:a?.5:1,children:[jsxRuntime.jsxs(S.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(S.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:[jsxRuntime.jsx(b.Secondary,{disabled:a,onClick:r,title:(m=t.secondaryButton)==null?void 0:m.title}),jsxRuntime.jsx(b.Primary,{disabled:a,onClick:n,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}function Ot(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 Ht(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 $t=react.keyframes`
|
|
54
|
+
var qo=Object.defineProperty,_r=Object.defineProperties;var Ur=Object.getOwnPropertyDescriptors;var je=Object.getOwnPropertySymbols;var Zo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable;var Jo=(e,o,t)=>o in e?qo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Zo.call(o,t)&&Jo(e,t,o[t]);if(je)for(var t of je(o))Yo.call(o,t)&&Jo(e,t,o[t]);return e},s=(e,o)=>_r(e,Ur(o));var Gr=(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 m=(e,o)=>{var t={};for(var n in e)Zo.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&je)for(var n of je(e))o.indexOf(n)<0&&Yo.call(e,n)&&(t[n]=e[n]);return t};var ie=(e,o)=>{for(var t in o)qo(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((n,r)=>{var a=d=>{try{p(t.next(d));}catch(u){r(u);}},l=d=>{try{p(t.throw(d));}catch(u){r(u);}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,l);p((t=t.apply(e,o)).next());});function Fe(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 et={borderWidths:{md:"1px"}};var Xe=[5,10,20,35,50,65,80,95,98],ot=[...Xe],ho=[...Xe];ot[4]=40;ho[4]=60;var Kr={blue:{h:213,s:100,l:Xe},gray:{h:220,s:10,l:Xe},green:{h:141,s:90,l:ot},red:{h:9,s:90,l:ho},yellow:{h:50,s:90,l:ho}};var A={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Kr))A[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var tt=s(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var rt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,nt={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("white"),border:c("neutral-900"),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-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")},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 it={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var jr="px",Xr=e=>typeof e=="number"?`${4*e}${jr}`:e,Jr=[-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"],at=Object.fromEntries(Jr.map(e=>[e,Xr(e)]));var st={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 Je=s(i(s(i({},et),{colors:i(i({},tt),nt)}),st),{radii:rt,shadows:it,space:at});function Me(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let l=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,Me(p,l,t)):n[l]=p,n},{})}function bo(e){let o=Me(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function lt(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=lt(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var Po=bo(Je),D=lt(Je);var Zr=new Set(["alt","size","src"]),Yr=qr__default.default.all.filter(e=>e.indexOf("-")!=0&&!Zr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Qr=Object.fromEntries(Yr),qe=Me(D.colors),en={color:qe,backgroundColor:qe,borderColor:qe,border:i(i({},D.borderWidths),qe),borderRadius:D.radii,borderWidth:D.borderWidths,boxShadow:D.shadows,fontFamily:D.fontFamilies,fontSize:D.fontSizes,fontWeight:D.fontWeights,gap:D.space,lineHeight:D.lineHeights,margin:D.space,marginBottom:D.space,marginLeft:D.space,marginRight:D.space,marginTop:D.space,padding:D.space,paddingBottom:D.space,paddingLeft:D.space,paddingRight:D.space,paddingTop:D.space},pt=i(i({},Qr),en),dt={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"]},ct=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function on(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 ut=new Map(Object.entries(pt).map(([e,o])=>[e,on(o)])),tn=new Map(Object.entries(dt).map(([e,o])=>[e,new Set(o)])),rn=new Set(["height","width"]),nn=new Set(["canvas","embed","iframe","img","input","object","video"]);function mt(e){let[o,t]=e.split(":");return [o,ct.has(t)?t:null]}function ft(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let p=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([a,l])=>{let[p,d]=mt(a),u=tn.get(p);u!=null&&(u.forEach(f=>{let y=`${f}${d?":"+d:""}`;t[y]=l;}),delete t[a]);}),Object.entries(t).forEach(([a,l])=>{let[p,d]=mt(a),u=ut.get(p);if(u!=null){if(l==null)delete t[a];else if(typeof l=="string"&&l.indexOf(" ")>-1){let f=l.split(" ");r(d)[p]=f.map(y=>{var h;return (h=u.get(y.toString()))!=null?h:y}).join(" ");}else u.has(l.toString())?r(d)[p]=u.get(l.toString()):r(d)[p]=l;(typeof o!="string"||!nn.has(o)||!rn.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let l=a.substring(1);a.indexOf("_")===0&&ut.has(l)&&(t[l]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function sn(){if(typeof window=="undefined"){let{JSDOM:e}=Gr("jsdom");return new e("<!DOCTYPE html>").window}return window}function gt(e){return e?{__html:an__default.default(sn()).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 pn(e){return e&&`fr-${e}`}function ht(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>ht(o)).join(" "):pn(e))}function dn(p,l){var d=p,{as:e,children:o,className:t,css:n={},part:r}=d,a=m(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:y}=ft(a,u),h=ht(r),x=t||h?clsx.clsx(t,h):void 0,R=[{boxSizing:"border-box"},f,n];return typeof o=="string"?jsxRuntime.jsx(u,s(i({className:x,css:R},y),{ref:l,dangerouslySetInnerHTML:gt(o)})):jsxRuntime.jsx(u,s(i({className:x,css:R},y),{ref:l,children:o}))}var g=Fo__namespace.forwardRef(dn);var O={};ie(O,{Link:()=>Vn,Plain:()=>Ln,Primary:()=>An,Secondary:()=>Wn});var F={};ie(F,{Body1:()=>Bn,Body2:()=>Tn,Caption:()=>kn,Display1:()=>Cn,Display2:()=>Sn,H1:()=>wn,H2:()=>Fn,H3:()=>vn,H4:()=>Rn});var Co={};ie(Co,{Body1:()=>xn,Body2:()=>hn,Caption:()=>bn,Display1:()=>cn,Display2:()=>un,H1:()=>mn,H2:()=>fn,H3:()=>gn,H4:()=>yn});var ae={color:"neutral.foreground",fontFamily:"default",margin:"0"},cn=s(i({},ae),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),un=s(i({},ae),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),mn=s(i({},ae),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),fn=s(i({},ae),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),gn=s(i({},ae),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),yn=s(i({},ae),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),xn=s(i({},ae),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),hn=s(i({},ae),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),bn=s(i({},ae),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Pn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],se=Object.fromEntries(Pn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Fo__namespace.forwardRef((p,l)=>{var d=p,{as:n=o,children:r}=d,a=m(d,["as","children"]);return jsxRuntime.jsx(g,s(i(i({as:n},Co[e]),a),{ref:l,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Cn=se.Display1,Sn=se.Display2,wn=se.H1,Fn=se.H2,vn=se.H3,Rn=se.H4,Bn=se.Body1,Tn=se.Body2,kn=se.Caption;var wo={};ie(wo,{Link:()=>Hn,Plain:()=>$n,Primary:()=>On,Secondary:()=>In,loadingCSSStyle:()=>So});var Ze={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},On=s(i({},Ze),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),In=s(i({},Ze),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Hn=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),$n=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Mn=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),So={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:Mn+" 1s ease infinite"}};function Ye(l){var p=l,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,a=m(p,["as","children","part","title","variant"]);var u;let d=r.toLocaleLowerCase();return jsxRuntime.jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${d}`,t]},wo[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?So:{})}),a),{loading:void 0,children:[o,n&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function An(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ye,s(i({},o),{variant:"Primary",children:e}))}function Wn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ye,s(i({},o),{variant:"Secondary",children:e}))}function Vn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ye,s(i({},o),{variant:"Link",children:e}))}function Ln(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ye,s(i({},o),{variant:"Plain",children:e}))}var S={};ie(S,{Column:()=>_n,Row:()=>zn});var zn=Fo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),_n=Fo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function vo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsxRuntime.jsx(_,s(i({as:null,flowId:o},n),{children:({handleDismiss:l,handlePrimary:p,handleSecondary:d,parentProps:{containerProps:u},step:f})=>{var B,T,w,P,C;let y=(B=f.props)!=null?B:{},h=(w=(T=f.primaryButton)==null?void 0:T.title)!=null?w:f.primaryButtonTitle,x=(C=(P=f.secondaryButton)==null?void 0:P.title)!=null?C:f.secondaryButtonTitle,R=f.$state.blocked;return jsxRuntime.jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),y),{children:[f.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:f.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:R,title:x,onClick:d}),jsxRuntime.jsx(b.Primary,{disabled:R,title:h,onClick:p}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:l})]}))}}))}var to={};ie(to,{Carousel:()=>Vt,Collapsible:()=>oo,CollapsibleStep:()=>Ve});var Re={};ie(Re,{Bar:()=>ve,Dots:()=>Ft,Fraction:()=>Qe,Segments:()=>Rt});function ve(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,l=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function Ft(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((l,p)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?D.colors.blue500:D.colors.blue800},p));return jsxRuntime.jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Qe(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);return jsxRuntime.jsx(F.Body2,s(i({part:"progress-fraction"},t),{children:`${e}/${o}`}))}function Rt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((l,p)=>jsxRuntime.jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(S.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Tt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsxRuntime.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 Gn(){return jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function kt(t){var n=t,{checked:e=!1}=n,o=m(n,["checked"]);return jsxRuntime.jsx(g,s(i({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&&jsxRuntime.jsx(g,{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:jsxRuntime.jsx(Gn,{})})}))}function le(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=Fo.useContext(z),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:Fo.useCallback((a,l,p=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,a,l))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(l,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:Fo.useCallback((a,l)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a,l))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(l),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Dt({onPrimary:e,onSecondary:o,step:t}){var u,f;let{handlePrimary:n,handleSecondary:r}=le(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:l,skipped:p}=t.$state,d=l||p||!a?jsxRuntime.jsx(kt,{checked:l||p,marginLeft:"auto"}):jsxRuntime.jsx(g,{as:Tt,height:"22px",marginLeft:"auto",width:"22px"});return jsxRuntime.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:a,opacity:a?.5:1,children:[jsxRuntime.jsxs(S.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(S.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:[jsxRuntime.jsx(b.Secondary,{disabled:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsxRuntime.jsx(b.Primary,{disabled:a,onClick:n,title:(f=t.primaryButton)==null?void 0:f.title})]})]})}function It(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 $t(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 Mt=react.keyframes`
|
|
55
55
|
from {
|
|
56
56
|
opacity: 0;
|
|
57
57
|
}
|
|
58
58
|
to {
|
|
59
59
|
opacity: 1;
|
|
60
60
|
}
|
|
61
|
-
`;function
|
|
61
|
+
`;function At({flow:e,sort:o,onPrimary:t,onSecondary:n}){var B,T;let[r,a]=Fo.useState(),[l]=Fo.useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(B=Array.from(e.steps.values()).find(w=>!w.$state.completed&&!w.$state.skipped))==null?void 0:B.order)!=null?T:0}),[p,d]=qn__default.default(l),[u,f]=Fo.useState(),[y,h]=Fo.useState();Fo.useLayoutEffect(()=>{d&&(u==null&&f(d.canScrollNext()),y==null&&h(d.canScrollPrev()),d.on("select",()=>{f(d.canScrollNext()),h(d.canScrollPrev());}));},[d]),Fo.useEffect(()=>{if(!r){let w=Array.from(e.steps.values()),P=w.filter(v=>v.$state.completed||v.$state.skipped).sort((v,E)=>v.order-E.order),C=w.filter(v=>!v.$state.completed&&!v.$state.skipped).sort((v,E)=>v.order-E.order);a(o==="completed-last"?[...C,...P].map(v=>v.id):w.map(v=>v.id));}},[]);let x=e.getNumberOfCompletedSteps(),R=e.getNumberOfAvailableSteps();return r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(S.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:D.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxRuntime.jsxs(S.Column,{part:"carousel-header-content",children:[jsxRuntime.jsx(F.H3,{children:e.title}),jsxRuntime.jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",R]}),jsxRuntime.jsx(ve,{current:x,total:R,minWidth:"200px"})]})]}),jsxRuntime.jsxs(g,{margin:`0 ${D.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:p,children:[jsxRuntime.jsx(S.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(w=>w.$state.visible).sort((w,P)=>r.indexOf(w.id)-r.indexOf(P.id)).map(w=>jsxRuntime.jsx(Dt,{onPrimary:t,onSecondary:n,step:w},w.id))}),y&&jsxRuntime.jsx(S.Column,{animation:`${Mt} 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:jsxRuntime.jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsxRuntime.jsx($t,{height:"24px",width:"24px"})})}),u&&jsxRuntime.jsx(S.Column,{animation:`${Mt} 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:jsxRuntime.jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsxRuntime.jsx(It,{height:"24px",width:"24px"})})})]})]}):null}function Vt(o){var e=m(o,[]);return jsxRuntime.jsx(_,s(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsxRuntime.jsx(At,i(i({},e),t))}))}var Ve={};ie(Ve,{Content:()=>To,Root:()=>ko,Trigger:()=>Eo});function Nt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var Yn=react.keyframes`
|
|
62
62
|
from {
|
|
63
63
|
height: 0;
|
|
64
64
|
opacity: 0;
|
|
@@ -67,7 +67,7 @@ var Jo=Object.defineProperty,_r=Object.defineProperties;var zr=Object.getOwnProp
|
|
|
67
67
|
height: var(--radix-collapsible-content-height);
|
|
68
68
|
opacity: 1;
|
|
69
69
|
}
|
|
70
|
-
`,
|
|
70
|
+
`,Qn=react.keyframes`
|
|
71
71
|
from {
|
|
72
72
|
height: var(--radix-collapsible-content-height);
|
|
73
73
|
opacity: 1;
|
|
@@ -76,7 +76,7 @@ var Jo=Object.defineProperty,_r=Object.defineProperties;var zr=Object.getOwnProp
|
|
|
76
76
|
height: 0;
|
|
77
77
|
opacity: 0;
|
|
78
78
|
}
|
|
79
|
-
`,Qn=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function ei({checked:e=!1}){return jsxRuntime.jsx(g,{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&&jsxRuntime.jsx(g,{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:jsxRuntime.jsx(Qn,{})})})}function Ro({children:e}){return jsxRuntime.jsx(ve__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${Zn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Yn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsxRuntime.jsx(g,{}),e]})})}function Bo(a){var l=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=l,r=f(l,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(ve__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function To({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(ve__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.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:[jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(ei,{checked:e}),jsxRuntime.jsx(w.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsxRuntime.jsx(g,{as:Lt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var _t=So.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function zt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var F,v,T,B,P,C;let{$state:{blocked:a,completed:l,skipped:p},subtitle:d,title:m}=r,u=(v=(F=r.primaryButton)==null?void 0:F.title)!=null?v:r.primaryButtonTitle,y=(B=(T=r.secondaryButton)==null?void 0:T.title)!=null?B:r.secondaryButtonTitle,h=(P=r.props)!=null?P:{},x=!!a;return jsxRuntime.jsxs(Bo,s(i({open:t,onOpenChange:n},h),{children:[jsxRuntime.jsx(To,{isBlocked:r.$state.blocked,isCompleted:l||p,title:m}),jsxRuntime.jsxs(Ro,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=r.videoUri)!=null?C:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxRuntime.jsxs(S.Row,{gap:3,part:"collapsible-footer",children:[jsxRuntime.jsx(b.Secondary,{title:y,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var ni={default:zt};function ii(n){var r=n,{flow:e,step:o}=r,t=f(r,["flow","step"]);var v;let{onPrimary:a,onSecondary:l,openStepId:p,setOpenStepId:d,stepTypes:m}=So.useContext(_t),{handlePrimary:u,handleSecondary:y}=ne(o,{onPrimary:a,onSecondary:l}),h=(p!=null?p:e.getCurrentStep().id)===o.id,x=(v=m[o.type])!=null?v:zt;function F(T){return $(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsxRuntime.jsx(x,s(i({flow:e,onOpenChange:F,open:h,step:o},t),{handlePrimary:u,handleSecondary:y}),o.id)}function Qe(p){var d=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=d,l=f(d,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,u]=So.useState(null),y=i(i({},ni),a);return jsxRuntime.jsx(_t.Provider,{value:{openStepId:m,setOpenStepId:u,onPrimary:t,onSecondary:n,stepTypes:y},children:jsxRuntime.jsx(z,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},l),{children:v=>{var T=v,{flow:h,handleDismiss:x}=T,F=f(T,["flow","handleDismiss"]);let P=Array.from(h.steps.entries()).filter(([,E])=>E.$state.visible===!0).map(([,E])=>jsxRuntime.jsx(ii,s(i({flow:h,handleDismiss:x},F),{step:E}),E.id)),C=h.getNumberOfCompletedSteps(),R=h.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:x,part:"checklist-header",subtitle:h.subtitle,title:h.title}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(w.Body2,{fontWeight:"demibold",children:[C,"/",R]}),jsxRuntime.jsx(Se,{current:C,total:R,flexGrow:1})]})]}),P]})}}))})}var fi=new Set(["required","min","max","minLength","maxLength","pattern"]);function gi({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.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 a=Object.fromEntries(Object.entries(t).filter(([p])=>fi.has(p))),l=reactHookForm.useController({name:t.id,control:o,rules:a});return jsxRuntime.jsx(e,s(i({},l),{fieldData:t,formContext:r,submit:n}))}function Gt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var C,R,E,L,A,O;let{__readOnly:l}=So.useContext(N),p=((C=a.fields)!=null?C:[]).filter(I=>e[I.type]!=null&&I.id),d=reactHookForm.useForm({delayError:2e3,mode:"onChange",defaultValues:p.reduce((I,_)=>{var J;return I[_.id]=(J=_.value)!=null?J:"",I},{})}),[m,u]=So.useState(!1),y=[],{control:h,handleSubmit:x}=d,F=(R=a.props)!=null?R:{};function v(I,_){u(!0),t(_,I,l===!0).then(()=>u(!1));}p.forEach(I=>{e[I.type]!=null&&y.push(jsxRuntime.jsx(gi,{control:h,fieldComponent:e[I.type],fieldData:I,submit:x(v)},`${a.flow.id}-${I.id}`));});let T=(L=(E=a.primaryButton)==null?void 0:E.title)!=null?L:a.primaryButtonTitle,B=(O=(A=a.secondaryButton)==null?void 0:A.title)!=null?O:a.secondaryButtonTitle,P=!!(a.$state.blocked||!d.formState.isValid);return So.useEffect(()=>{d.clearErrors();},[a]),jsxRuntime.jsxs(S.Column,s(i({gap:5,part:"form-step"},F),{children:[jsxRuntime.jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(reactHookForm.FormProvider,s(i({},d),{children:y})),jsxRuntime.jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(D.Secondary,{onClick:n,title:B}),jsxRuntime.jsx(D.Primary,{disabled:P||m,onClick:x(v),title:T!=null?T:"Submit",loading:m})]},`form-footer-${a.id}`)]}))}function Kt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(w.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function ko({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(w.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Eo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},We=s(i({},Eo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),oo={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 Q({children:e,field:o,fieldData:t,fieldState:n}){var m;let{id:r,label:a,placeholder:l}=t,{error:p}=n,d=s(i(i(i({id:r},o),l?{placeholder:l}:{}),We),{"aria-invalid":!!p,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(ko,{id:r,required:!!t.required,children:a}),e(d),jsxRuntime.jsx(Kt,{error:p})]})}function Be(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 Pi=So__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(g,{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:[jsxRuntime.jsx(w.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Te__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(g,s(i({as:Te__namespace.Indicator},oo),{children:jsxRuntime.jsx(Be,{height:"14",width:"14"})}))})})]}));function Do(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:l})=>jsxRuntime.jsx(Pi,{value:l,label:a},l));return jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsx(Te__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Zt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 Qt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=So__namespace.useState([]);function l(p){let d=[];r.includes(p)?d=[...r.filter(m=>m!==p)]:d=[...r,p],a(d),o(d);}return jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsx(S.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:p,value:d})=>jsxRuntime.jsx(to__namespace.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>l(d),asChild:!0,children:jsxRuntime.jsxs(g,{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:[jsxRuntime.jsx(w.Body2,{part:"field-check-label",children:p}),jsxRuntime.jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(to__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,s(i({},oo),{children:jsxRuntime.jsx(Be,{height:"14",width:"14"})}))})})]})},d))})}))}var wi=So__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(W__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(W__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(w.Body2,{part:"field-select-option-label",children:e})})})}));function Oo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:l,value:p})=>jsxRuntime.jsx(wi,{value:p,label:l},p));return e.fieldData.multiple?jsxRuntime.jsx(Qt,i({},e)):jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsxs(W__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(W__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(w.Body2,s(i({},We),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(W__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(W__namespace.Icon,{children:jsxRuntime.jsx(g,{as:Zt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(W__namespace.Portal,{children:jsxRuntime.jsx(W__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,s(i({},We),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(W__namespace.Viewport,{children:a})}))})})]})}))}function Io(e){return jsxRuntime.jsx(Q,s(i({},e),{children:o=>jsxRuntime.jsx(w.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Ho(e){return jsxRuntime.jsx(Q,s(i({},e),{children:o=>jsxRuntime.jsx(w.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function nr(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxRuntime.jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsxRuntime.jsx(to__namespace.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsxRuntime.jsx(g,s(i({},Eo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsxRuntime.jsx(to__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsxRuntime.jsx(Be,{height:"14",fill:"currentColor"})})})}))}),jsxRuntime.jsx(w.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var vi={checkbox:nr,radio:Do,select:Oo,text:Io,textarea:Ho};function Ee(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=f(a,["fieldTypes","flowId","part"]);let l=Object.assign({},vi,e);return jsxRuntime.jsx(z,s(i({flowId:o,part:["form",t]},n),{children:p=>jsxRuntime.jsx(Gt,i({fieldTypes:l},p))}))}var io={};oe(io,{NPS:()=>Le});function sr({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((l,p)=>{let d=e.value===p?D.Primary:D.Secondary;return jsxRuntime.jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxRuntime.jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(w.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsxRuntime.jsx(w.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Le(a){var l=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=l,r=f(l,["as","flowId","fieldTypes","part"]);let{flow:p}=xe(o);return jsxRuntime.jsx(Ee,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:sr},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||p.skip();},part:["nps",n],css:s(i({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function Ti(r,n){var a=r,{children:e,part:o}=a,t=f(a,["children","part"]);return jsxRuntime.jsx(reactRemoveScroll.RemoveScroll,{forwardProps:!0,ref:n,children:jsxRuntime.jsx(g,s(i({backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",o],position:"absolute"},t),{children:e}))})}var ao=So__namespace.forwardRef(Ti);var Ei=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function cr(t){var n=t,{part:e=""}=n,o=f(n,["part"]);return jsxRuntime.jsxs(g,s(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${e}`,position:"relative",width:"24px"},o),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${Ei}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px"})]}))}function Mi({maxX:e,maxY:o,radius:t,x1:n,x2:r,y1:a,y2:l}){return t>0?`path("${[`M${n+t},${a}`,`H${r-t}`,`A${t} ${t} 0,0,1 ${r} ${a+t}`,`V${l-t}`,`A${t} ${t} 0,0,1 ${r-t} ${l}`,`H${n+t}`,`A${t} ${t} 0,0,1 ${n} ${l-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${n}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${n+t} ${a}`,"Z"].join(" ")}")`:`path("M${n},${a} H${r} V${l} H${n} V${o} H${e} V0 H0 V${o} H${n} Z")`}function Ai(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 $o(r){var a=r,{anchor:e,part:o,style:t={}}=a,n=f(a,["anchor","part","style"]);let[l,p]=So.useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=react$1.useFloating({middleware:[{name:"clipPath",fn({elements:m,rects:u}){return p({maxX:m.floating.clientWidth,maxY:m.floating.clientHeight,radius:Ai(m.reference),x1:u.reference.x,x2:u.reference.x+u.reference.width,y1:u.reference.y,y2:u.reference.y+u.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:react$1.autoUpdate});return So.useEffect(()=>{let m=document.querySelector(e);m!=null?d.setReference(m):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);},[e]),jsxRuntime.jsx(ao,i({part:["spotlight",o],ref:d.setFloating,style:i({clipPath:Mi(l)},t)},n))}function mr({align:e,side:o}){let t={},n="-12px",r={top:"bottom",right:"left",bottom:"top",left:"right"};return t[r[o]]=n,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=n:t.bottom=n:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=n:t.top=n:["top","bottom"].includes(o)?t.left=`calc(50% + ${n})`:t.top=`calc(50% + ${n})`,t}function Ji(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function ur({align:e,alignOffset:o,anchor:t,onOpenChange:n=()=>{},open:r,side:a,sideOffset:l}){let p=`${a}-${Ji(e)}`;function d({rects:C}){let R={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(a)?R.alignmentAxis=o-C.floating.width:R.alignmentAxis=o-C.floating.height),R}let{context:m,floatingStyles:u,placement:y,refs:h}=react$1.useFloating({middleware:[react$1.offset(d),react$1.flip(),react$1.shift()],onOpenChange:n,open:r,placement:p,whileElementsMounted:react$1.autoUpdate}),x=react$1.useClick(m),F=react$1.useDismiss(m,{outsidePress:!1}),v=react$1.useRole(m),{getFloatingProps:T,getReferenceProps:B}=react$1.useInteractions([x,F,v]);So.useEffect(()=>{let C=document.querySelector(t);C!=null?h.setReference(C):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[t]);let P=y.split("-");return e==="before"?P[1]=P[1]==="end"?"after":"before":e==="after"&&(P[1]=P[1]==="start"?"before":"after"),{context:m,getFloatingProps:T,getReferenceProps:B,floatingStyles:u,placement:P.join("-"),refs:h}}function Ao(F){var v=F,{align:e="center",alignOffset:o=0,anchor:t,children:n,defaultOpen:r=!0,modal:a=!1,onOpenChange:l=()=>{},open:p,part:d,side:m="bottom",sideOffset:u=0,spotlight:y=!1,style:h={}}=v,x=f(v,["align","alignOffset","anchor","children","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,B]=So.useState(r),P=p!=null?p:T,{getFloatingProps:C,getReferenceProps:R,floatingStyles:E,placement:L,refs:A}=ur({align:e,alignOffset:o,anchor:t,onOpenChange:J=>{l(J),p==null&&B(J);},open:P,side:m,sideOffset:u}),[O,I]=L.split("-"),_=R();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[y&&P&&jsxRuntime.jsx($o,{anchor:t}),a&&!y&&P&&jsxRuntime.jsx(ao,{lockScroll:!0}),jsxRuntime.jsxs(g,s(i(i({part:["hint",d],ref:A.setFloating,style:i(i({},E),h)},C()),x),{children:[P&&n,jsxRuntime.jsx(cr,s(i({},_),{position:"absolute",style:mr({align:I,side:O})}))]}))]})}var Qi=react.keyframes`
|
|
79
|
+
`,ei=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function oi({checked:e=!1}){return jsxRuntime.jsx(g,{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&&jsxRuntime.jsx(g,{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:jsxRuntime.jsx(ei,{})})})}function To({children:e}){return jsxRuntime.jsx(Te__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${Yn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Qn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsxRuntime.jsx(g,{}),e]})})}function ko(a){var l=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=l,r=m(l,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(Te__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Eo({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(Te__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.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:[jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(oi,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsxRuntime.jsx(g,{as:Nt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var _t=Fo.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Ut({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var R,B,T,w,P,C;let{$state:{blocked:a,completed:l,skipped:p},subtitle:d,title:u}=r,f=(B=(R=r.primaryButton)==null?void 0:R.title)!=null?B:r.primaryButtonTitle,y=(w=(T=r.secondaryButton)==null?void 0:T.title)!=null?w:r.secondaryButtonTitle,h=(P=r.props)!=null?P:{},x=!!a;return jsxRuntime.jsxs(ko,s(i({open:t,onOpenChange:n},h),{children:[jsxRuntime.jsx(Eo,{isBlocked:r.$state.blocked,isCompleted:l||p,title:u}),jsxRuntime.jsxs(To,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=r.videoUri)!=null?C:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxRuntime.jsxs(S.Row,{gap:3,part:"collapsible-footer",children:[jsxRuntime.jsx(b.Secondary,{title:y,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:x,title:f,onClick:e})]})]})]}))}var ii={default:Ut};function ai(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var B;let{onPrimary:a,onSecondary:l,openStepId:p,setOpenStepId:d,stepTypes:u}=Fo.useContext(_t),{handlePrimary:f,handleSecondary:y}=le(o,{onPrimary:a,onSecondary:l}),h=(p!=null?p:e.getCurrentStep().id)===o.id,x=(B=u[o.type])!=null?B:Ut;function R(T){return M(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsxRuntime.jsx(x,s(i({flow:e,onOpenChange:R,open:h,step:o},t),{handlePrimary:f,handleSecondary:y}),o.id)}function oo(p){var d=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=d,l=m(d,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=Fo.useState(null),y=i(i({},ii),a);return jsxRuntime.jsx(_t.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:n,stepTypes:y},children:jsxRuntime.jsx(_,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},l),{children:B=>{var T=B,{flow:h,handleDismiss:x}=T,R=m(T,["flow","handleDismiss"]);let P=Array.from(h.steps.entries()).filter(([,E])=>E.$state.visible===!0).map(([,E])=>jsxRuntime.jsx(ai,s(i({flow:h,handleDismiss:x},R),{step:E}),E.id)),C=h.getNumberOfCompletedSteps(),v=h.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:x,part:"checklist-header",subtitle:h.subtitle,title:h.title}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[C,"/",v]}),jsxRuntime.jsx(ve,{current:C,total:v,flexGrow:1})]})]}),P]})}}))})}var gi=new Set(["required","min","max","minLength","maxLength","pattern"]);function yi({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.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 a=Object.fromEntries(Object.entries(t).filter(([p])=>gi.has(p))),l=reactHookForm.useController({name:t.id,control:o,rules:a});return jsxRuntime.jsx(e,s(i({},l),{fieldData:t,formContext:r,submit:n}))}function jt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var C,v,E,$,N;let{__readOnly:l}=Fo.useContext(z),p=Fo.useMemo(()=>{var k;return (k=a.fields)==null?void 0:k.filter(I=>e[I.type]!=null&&I.id)},[a.fields,e]),d=reactHookForm.useForm({delayError:2e3,mode:"onChange",defaultValues:p.reduce((k,I)=>{var W;return k[I.id]=(W=I.value)!=null?W:"",k},{})});Fo.useEffect(()=>{d.formState.isDirty||d.reset(p.reduce((k,I)=>{var W;return k[I.id]=(W=I.value)!=null?W:"",k},{}));},[p]);let[u,f]=Fo.useState(!1),y=[],{control:h,handleSubmit:x}=d,R=(C=a.props)!=null?C:{};function B(k,I){f(!0),t(I,k,l===!0).then(()=>f(!1));}p.forEach(k=>{e[k.type]!=null&&y.push(jsxRuntime.jsx(yi,{control:h,fieldComponent:e[k.type],fieldData:k,submit:x(B)},`${a.flow.id}-${k.id}`));});let T=(E=(v=a.primaryButton)==null?void 0:v.title)!=null?E:a.primaryButtonTitle,w=(N=($=a.secondaryButton)==null?void 0:$.title)!=null?N:a.secondaryButtonTitle,P=!!(a.$state.blocked||!d.formState.isValid);return Fo.useEffect(()=>{d.clearErrors();},[a]),jsxRuntime.jsxs(S.Column,s(i({gap:5,part:"form-step"},R),{children:[jsxRuntime.jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(reactHookForm.FormProvider,s(i({},d),{children:y})),jsxRuntime.jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[w&&jsxRuntime.jsx(O.Secondary,{onClick:n,title:w}),jsxRuntime.jsx(O.Primary,{disabled:P||u,onClick:x(B),title:T!=null?T:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Xt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function Do({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Oo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Le=s(i({},Oo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),ro={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 Y({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:l}=t,{error:p}=n,d=s(i(i(i({id:r},o),l?{placeholder:l}:{}),Le),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(Do,{id:r,required:!!t.required,children:a}),e(d),jsxRuntime.jsx(Xt,{error:p})]})}function Ee(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 Ci=Fo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(g,{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:[jsxRuntime.jsx(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(De__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{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:jsxRuntime.jsx(g,s(i({as:De__namespace.Indicator},ro),{children:jsxRuntime.jsx(Ee,{height:"14",width:"14"})}))})})]}));function Io(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:l})=>jsxRuntime.jsx(Ci,{value:l,label:a},l));return jsxRuntime.jsx(Y,s(i({},e),{children:()=>jsxRuntime.jsx(De__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Qt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.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 or(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=Fo__namespace.useState([]);function l(p){let d=[];r.includes(p)?d=[...r.filter(u=>u!==p)]:d=[...r,p],a(d),o(d);}return jsxRuntime.jsx(Y,s(i({},e),{children:()=>jsxRuntime.jsx(S.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:p,value:d})=>jsxRuntime.jsx(no__namespace.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>l(d),asChild:!0,children:jsxRuntime.jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:d,justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsxRuntime.jsx(F.Body2,{part:"field-check-label",children:p}),jsxRuntime.jsx(g,{as:"button",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:jsxRuntime.jsx(no__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,s(i({},ro),{children:jsxRuntime.jsx(Ee,{height:"14",width:"14"})}))})})]})},d))})}))}var Fi=Fo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(V__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(V__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function Ho(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:l,value:p})=>jsxRuntime.jsx(Fi,{value:p,label:l},p));return e.fieldData.multiple?jsxRuntime.jsx(or,i({},e)):jsxRuntime.jsx(Y,s(i({},e),{children:()=>jsxRuntime.jsxs(V__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(V__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,s(i({},Le),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(V__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(V__namespace.Icon,{children:jsxRuntime.jsx(g,{as:Qt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(V__namespace.Portal,{children:jsxRuntime.jsx(V__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,s(i({},Le),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(V__namespace.Viewport,{children:a})}))})})]})}))}function $o(e){return jsxRuntime.jsx(Y,s(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Mo(e){return jsxRuntime.jsx(Y,s(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function ar(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxRuntime.jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsxRuntime.jsx(no__namespace.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsxRuntime.jsx(g,s(i({},Oo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsxRuntime.jsx(no__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsxRuntime.jsx(Ee,{height:"14",fill:"currentColor"})})})}))}),jsxRuntime.jsx(F.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var Ri={checkbox:ar,radio:Io,select:Ho,text:$o,textarea:Mo};function Ie(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let l=Object.assign({},Ri,e);return jsxRuntime.jsx(_,s(i({flowId:o,part:["form",t]},n),{children:p=>jsxRuntime.jsx(jt,i({fieldTypes:l},p))}))}var so={};ie(so,{NPS:()=>ze});function pr({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((l,p)=>{let d=e.value===p?O.Primary:O.Secondary;return jsxRuntime.jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxRuntime.jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function ze(a){var l=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=l,r=m(l,["as","flowId","fieldTypes","part"]);let{flow:p}=Se(o);return jsxRuntime.jsx(Ie,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:pr},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||p.skip();},part:["nps",n],css:s(i({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function ki(r,n){var a=r,{children:e,part:o}=a,t=m(a,["children","part"]);return jsxRuntime.jsx(reactRemoveScroll.RemoveScroll,{forwardProps:!0,ref:n,children:jsxRuntime.jsx(g,s(i({backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",o],position:"absolute"},t),{children:e}))})}var lo=Fo__namespace.forwardRef(ki);var Di=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function mr(t){var n=t,{part:e=""}=n,o=m(n,["part"]);return jsxRuntime.jsxs(g,s(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${e}`,position:"relative",width:"24px"},o),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${Di}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px"})]}))}function Ai({maxX:e,maxY:o,radius:t,x1:n,x2:r,y1:a,y2:l}){return t>0?`path("${[`M${n+t},${a}`,`H${r-t}`,`A${t} ${t} 0,0,1 ${r} ${a+t}`,`V${l-t}`,`A${t} ${t} 0,0,1 ${r-t} ${l}`,`H${n+t}`,`A${t} ${t} 0,0,1 ${n} ${l-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${n}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${n+t} ${a}`,"Z"].join(" ")}")`:`path("M${n},${a} H${r} V${l} H${n} V${o} H${e} V0 H0 V${o} H${n} Z")`}function Wi(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 Ao(r){var a=r,{anchor:e,part:o,style:t={}}=a,n=m(a,["anchor","part","style"]);let[l,p]=Fo.useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=react$1.useFloating({middleware:[{name:"clipPath",fn({elements:u,rects:f}){return p({maxX:u.floating.clientWidth,maxY:u.floating.clientHeight,radius:Wi(u.reference),x1:f.reference.x,x2:f.reference.x+f.reference.width,y1:f.reference.y,y2:f.reference.y+f.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:react$1.autoUpdate});return Fo.useEffect(()=>{let u=document.querySelector(e);u!=null?d.setReference(u):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);},[e]),jsxRuntime.jsx(lo,i({part:["spotlight",o],ref:d.setFloating,style:i({clipPath:Ai(l)},t)},n))}function fr({align:e,side:o}){let t={},n="-12px",r={top:"bottom",right:"left",bottom:"top",left:"right"};return t[r[o]]=n,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=n:t.bottom=n:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=n:t.top=n:["top","bottom"].includes(o)?t.left=`calc(50% + ${n})`:t.top=`calc(50% + ${n})`,t}function qi(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function gr({align:e,alignOffset:o,anchor:t,onOpenChange:n=()=>{},open:r,side:a,sideOffset:l}){let p=`${a}-${qi(e)}`;function d({rects:C}){let v={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(a)?v.alignmentAxis=o-C.floating.width:v.alignmentAxis=o-C.floating.height),v}let{context:u,floatingStyles:f,placement:y,refs:h}=react$1.useFloating({middleware:[react$1.offset(d),react$1.flip(),react$1.shift()],onOpenChange:n,open:r,placement:p,whileElementsMounted:react$1.autoUpdate}),x=react$1.useClick(u),R=react$1.useDismiss(u,{outsidePress:!1}),B=react$1.useRole(u),{getFloatingProps:T,getReferenceProps:w}=react$1.useInteractions([x,R,B]);Fo.useEffect(()=>{let C=document.querySelector(t);C!=null?h.setReference(C):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[t]);let P=y.split("-");return e==="before"?P[1]=P[1]==="end"?"after":"before":e==="after"&&(P[1]=P[1]==="start"?"before":"after"),{context:u,getFloatingProps:T,getReferenceProps:w,floatingStyles:f,placement:P.join("-"),refs:h}}function Vo(R){var B=R,{align:e="center",alignOffset:o=0,anchor:t,children:n,defaultOpen:r=!0,modal:a=!1,onOpenChange:l=()=>{},open:p,part:d,side:u="bottom",sideOffset:f=0,spotlight:y=!1,style:h={}}=B,x=m(B,["align","alignOffset","anchor","children","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,w]=Fo.useState(r),P=p!=null?p:T,{getFloatingProps:C,getReferenceProps:v,floatingStyles:E,placement:$,refs:N}=gr({align:e,alignOffset:o,anchor:t,onOpenChange:he=>{l(he),p==null&&w(he);},open:P,side:u,sideOffset:f}),[k,I]=$.split("-"),W=v();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[y&&P&&jsxRuntime.jsx(Ao,{anchor:t}),a&&!y&&P&&jsxRuntime.jsx(lo,{lockScroll:!0}),jsxRuntime.jsxs(g,s(i(i({part:["hint",d],ref:N.setFloating,style:i(i({},E),h)},C()),x),{children:[P&&n,jsxRuntime.jsx(mr,s(i({},W),{position:"absolute",style:fr({align:I,side:k})}))]}))]})}var ea=react.keyframes`
|
|
80
80
|
from {
|
|
81
81
|
opacity: 0;
|
|
82
82
|
}
|
|
@@ -86,7 +86,7 @@ var Jo=Object.defineProperty,_r=Object.defineProperties;var zr=Object.getOwnProp
|
|
|
86
86
|
to {
|
|
87
87
|
opacity: 1;
|
|
88
88
|
}
|
|
89
|
-
`;function so({align:e,alignOffset:o,defaultOpen:t,dismissible:n,flow:r,handleDismiss:a,modal:l,onPrimary:p,onSecondary:d,part:m,side:u,sideOffset:y,spotlight:h,step:x}){var C,R,E,L,A;let{handlePrimary:F,handleSecondary:v}=ne(x,{onPrimary:p,onSecondary:d}),T=(R=(C=x.primaryButton)==null?void 0:C.title)!=null?R:x.primaryButtonTitle,B=(L=(E=x.secondaryButton)==null?void 0:E.title)!=null?L:x.secondaryButtonTitle,P=!!x.$state.blocked;return jsxRuntime.jsx(Ao,{align:e,alignOffset:o,anchor:x.selector,"data-step-id":x.id,defaultOpen:t,modal:l,part:m,side:u,sideOffset:y,spotlight:h,children:jsxRuntime.jsxs(b,{animation:`${Qi} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsxRuntime.jsx(b.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(A=x.videoUri)!=null?A:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image"}),jsxRuntime.jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:a,subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(b.Footer,{children:[r.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(Ze,{current:r.getCurrentStepOrder()+1,marginRight:"auto",total:r.getNumberOfAvailableSteps()}),jsxRuntime.jsx(b.Secondary,{disabled:P,onClick:v,title:B}),jsxRuntime.jsx(b.Primary,{disabled:P,onClick:F,title:T})]})]})})}function yr(e,o,t){let[n,r]=So.useState(!1),a=So.useRef();return So.useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,r(!0);},[]),n?reactDom.createPortal(e,a.current,t):null}function lo(x){var F=x,{align:e="after",alignOffset:o=0,as:t,defaultOpen:n,dismissible:r=!1,flowId:a,modal:l,part:p,sequential:d=!0,side:m="bottom",sideOffset:u=0,spotlight:y}=F,h=f(F,["align","alignOffset","as","defaultOpen","dismissible","flowId","modal","part","sequential","side","sideOffset","spotlight"]);let{onDismiss:v,onPrimary:T,onSecondary:B}=h;return yr(jsxRuntime.jsx(z,s(i({as:t,css:i({".fr-hint":{zIndex:1},".fr-hint:has([aria-expanded=true])":{zIndex:3},".fr-overlay":{zIndex:2}},d?{}:{".fr-progress-fraction":{display:"none"}}),flowId:a,part:"tour"},h),{children:({flow:C,handleDismiss:R,step:E})=>{var A;let L=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:R,modal:l,onPrimary:T,onSecondary:B,part:p,side:m,sideOffset:u,spotlight:y,step:E},(A=E.props)!=null?A:{});return d?jsxRuntime.jsx(so,i({defaultOpen:n!=null?n:!0},L)):Array.from(C.steps.values()).filter(O=>{let{blocked:I,completed:_,skipped:J,visible:he}=O.$state;return !I&&!_&&!J&&he}).map(O=>{var he,Ue;function I(be){return $(this,null,function*(){return (yield v==null?void 0:v(C,be))===!1?(be.preventDefault(),!1):(O.skip(),!0)})}let _=y&&O.id===E.id,J=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:I,onPrimary:T,onSecondary:B,part:p,side:m,sideOffset:u,spotlight:y},(he=O.props)!=null?he:{});return jsxRuntime.jsx(so,i({defaultOpen:(Ue=n||_)!=null?Ue:!1,step:O},J),`${O.id}-${_}`)})}})),"body")}function xr(e){var m,u,y;let{frigade:o}=So.useContext(N),[,t]=So.useState(!1),n,r=So.useCallback(h=>{o==null||o.getCollection(e).then(()=>{h();});let x=()=>{clearTimeout(n),n=setTimeout(()=>{t(F=>!F),h();},100);};return o==null||o.onStateChange(x),()=>{o==null||o.removeStateChangeHandler(x);}},[e]),a=So.useSyncExternalStore(r,()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h},()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h}),p=(y=((u=(m=a==null?void 0:a.flows)==null?void 0:m.map(h=>s(i({},h),{flow:o==null?void 0:o.getFlowSync(h.flowId)})))!=null?u:[]).find(({flow:h})=>h.isVisible))==null?void 0:y.flowId,{flow:d}=xe(p);return {collection:a,currentFlow:d}}function Vo(n){var r=n,{collectionId:e,part:o}=r,t=f(r,["collectionId","part"]);var d,m,u;let a={ANNOUNCEMENT:Lo,BANNER:wo,CARD:b,CHECKLIST:Qe,EMBEDDED_TIP:b,FORM:Ee,NPS_SURVEY:Le,SURVEY:Le,TOUR:lo},{currentFlow:l}=xr(e),p=(m=a[(d=l==null?void 0:l.rawData)==null?void 0:d.flowType])!=null?m:null;return l==null||p==null?null:((u=l==null?void 0:l.rawData)==null?void 0:u.flowType)===js.FlowType.FORM?jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(Ee,{flowId:l.id,as:H},l.id)})):jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(p,{flowId:l.id},l.id)}))}function Ne(){let{frigade:e}=So.useContext(N);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function hr(){let[e,o]=So.useState(),{frigade:t}=Ne();return So.useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsxRuntime.jsx(Vo,{as:null,collectionId:e})}var N=So.createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function br(){let{frigade:e}=Ne();return So.useEffect(()=>{$(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Pr="2.4.29";function Fr(l){var p=l,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,a=f(p,["children","css","defaultCollection","navigate","theme"]);let d=r?xo(r):{},m=So.useRef(new Map),u=So.useRef(),[y,h]=So.useState(!1),x=So.useMemo(()=>(h(!1),u.current=void 0,new js.Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:Pr,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);So.useEffect(()=>{if(a.__flowStateOverrides){let P=x.getConfig();P.__flowStateOverrides=a.__flowStateOverrides,x.reload(P);}},[a.__flowStateOverrides]);function F(){let P=[...m.current.entries()].map(([C,R])=>[C,R.callback]);x.batchRegister(P),h(!0);}function v(P,C){if(u.current&&clearTimeout(u.current),y){m.current.has(P)?x.getFlow(P).then(R=>C(R.isVisible)):(x.getFlow(P).then(R=>R.register(C)),m.current.set(P,{callback:C}));return}m.current.has(P)||m.current.set(P,{callback:C}),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>F(),0);}function T(P){m.current.has(P)&&x.getFlow(P).then(C=>{m.current.delete(P),C==null||C.unregister();});}let B=n!=null?n:(P,C="_self")=>{window.open(P,C);};return So.useEffect(()=>()=>{x.destroy();},[]),jsxRuntime.jsxs(N.Provider,{value:s(i({navigate:B},a),{frigade:x,registerComponent:v,unregisterComponent:T,hasInitialized:y}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i(i({},ho),d),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:k,children:[t&&jsxRuntime.jsx(hr,{}),e]}),a.preloadImages!==!1&&jsxRuntime.jsx(br,{})]})}function xe(e,o){let{frigade:t}=So.useContext(N),[,n]=So.useState(!1),r=So.useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let p=d=>{d.id===e&&setTimeout(()=>{n(m=>!m),l();},0);};return t==null||t.onStateChange(p),()=>{t==null||t.removeStateChangeHandler(p);}},[e]),a=So.useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a,isLoading:t!=null&&t.hasFailedToLoad()?!1:!a}}function _o(e,{onComplete:o,onDismiss:t}={}){let n=So.useRef(null);return So.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&$(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:So.useCallback(r=>$(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var ae=new Set;function zo(e,o=!0){let t=So.useCallback(()=>{ae.has(e==null?void 0:e.id)&&ae.delete(e==null?void 0:e.id);},[ae,o]),n=So.useCallback(()=>{o&&(e!=null&&e.isVisible)&&!ae.has(e.id)&&ae.add(e.id);},[ae,o]);So.useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=ae.size>0?ae.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||ae.size==0:!0}}function z(m){var u=m,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:l,variables:p}=u,d=f(u,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var O,_;let{flow:y}=xe(t,{variables:p}),I=i(i({},d),(O=y==null?void 0:y.props)!=null?O:{}),{dismissible:h=!1,forceMount:x=!1}=I,F=f(I,["dismissible","forceMount"]),v=y==null?void 0:y.getCurrentStep(),{handleDismiss:T}=_o(y,{onComplete:n,onDismiss:r}),{handlePrimary:B,handleSecondary:P}=ne(v,{onPrimary:a,onSecondary:l}),C=(F==null?void 0:F.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((_=y==null?void 0:y.rawData)==null?void 0:_.flowType),{isCurrentModal:R}=zo(y,C),E=x&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!E||!E&&!R)return null;(E||!y.isCompleted&&!y.isSkipped)&&v.start();let L=e===null?So.Fragment:e!=null?e:g,A=s(i({},F),{"data-flow-id":y.id});return jsxRuntime.jsx(L,s(i({},e===null?{}:A),{children:o({flow:y,handleDismiss:T,handlePrimary:B,handleSecondary:P,parentProps:{dismissible:h,flowId:t,variables:p,containerProps:A},step:v})}))}function Tr(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsxRuntime.jsx(z,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:l,parentProps:{dismissible:p},step:d})=>{var y,h,x,F;let m=(h=(y=d.primaryButton)==null?void 0:y.title)!=null?h:d.primaryButtonTitle,u=(F=(x=d.secondaryButton)==null?void 0:x.title)!=null?F:d.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:p,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsxRuntime.jsx(b.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:u,onClick:l}),jsxRuntime.jsx(b.Primary,{title:m,onClick:a})]})]})}}))}function co(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsxRuntime.jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Oa(e){var o,t,n,r,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function mo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let a=Oa(o);return a?jsxRuntime.jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function pe(n){var r=n,{src:e,type:o}=r,t=f(r,["src","type"]);return jsxRuntime.jsx(o==="video"?mo:co,i({src:e},t))}var b=So__namespace.forwardRef((a,r)=>{var l=a,{children:e,flowId:o,part:t}=l,n=f(l,["children","flowId","part"]);var d;if(o!=null)return jsxRuntime.jsx(Tr,i({flowId:o},n));let p=(d=n.as)!=null?d:S.Column;return jsxRuntime.jsx(p,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(D.Plain,s(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Ce,{height:"20",fill:"currentColor"})}));b.Footer=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return jsxRuntime.jsx(S.Row,s(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=l=>{var p=l,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=p,a=f(p,["dismissible","handleDismiss","part","subtitle","title"]);return jsxRuntime.jsxs(S.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};b.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};b.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsxRuntime.jsx(w.Body2,s(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsxRuntime.jsx(w.H4,s(i({display:"block",part:["title",o]},t),{children:e}))};var uo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Dr(e){let o=Object.fromEntries(uo.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(uo.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!uo.content.some(a=>a===r)&&!uo.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Ma=react.keyframes`
|
|
89
|
+
`;function po(B){var T=B,{align:e,alignOffset:o,defaultOpen:t,dismissible:n,flow:r,handleDismiss:a,modal:l,onPrimary:p,onSecondary:d,part:u,side:f,sideOffset:y,spotlight:h,step:x}=T,R=m(T,["align","alignOffset","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var $,N,k,I,W;let{handlePrimary:w,handleSecondary:P}=le(x,{onPrimary:p,onSecondary:d}),C=(N=($=x.primaryButton)==null?void 0:$.title)!=null?N:x.primaryButtonTitle,v=(I=(k=x.secondaryButton)==null?void 0:k.title)!=null?I:x.secondaryButtonTitle,E=!!x.$state.blocked;return jsxRuntime.jsx(Vo,s(i({align:e,alignOffset:o,anchor:x.selector,"data-step-id":x.id,defaultOpen:t,modal:l,part:u,side:f,sideOffset:y,spotlight:h},R),{children:jsxRuntime.jsxs(b,{animation:`${ea} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsxRuntime.jsx(b.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(W=x.videoUri)!=null?W:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image"}),jsxRuntime.jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:a,subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(b.Footer,{children:[r.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(Qe,{current:r.getCurrentStepOrder()+1,marginRight:"auto",total:r.getNumberOfAvailableSteps()}),jsxRuntime.jsx(b.Secondary,{disabled:E,onClick:P,title:v}),jsxRuntime.jsx(b.Primary,{disabled:E,onClick:w,title:C})]})]})}))}function hr(e,o,t){let[n,r]=Fo.useState(!1),a=Fo.useRef();return Fo.useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,r(!0);},[]),n?reactDom.createPortal(e,a.current,t):null}function co(R){var B=R,{align:e="after",alignOffset:o=0,as:t,defaultOpen:n,dismissible:r=!1,flowId:a,modal:l,part:p,sequential:d=!0,side:u="bottom",sideOffset:f=0,spotlight:y,zIndex:h=9999}=B,x=m(B,["align","alignOffset","as","defaultOpen","dismissible","flowId","modal","part","sequential","side","sideOffset","spotlight","zIndex"]);let{onDismiss:T,onPrimary:w,onSecondary:P}=x;return hr(jsxRuntime.jsx(_,s(i({as:t,flowId:a,part:"tour"},x),{children:({flow:C,handleDismiss:v,parentProps:{containerProps:E},step:$})=>{var k,I,W,he;let N=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:v,modal:l,onPrimary:w,onSecondary:P,part:p,side:u,sideOffset:f,spotlight:y,step:$,zIndex:(W=(I=(k=$.props)==null?void 0:k.zIndex)!=null?I:E==null?void 0:E.zIndex)!=null?W:h},(he=$.props)!=null?he:{});return d?jsxRuntime.jsx(po,i({defaultOpen:n!=null?n:!0},N)):Array.from(C.steps.values()).filter(Q=>{let{blocked:$e,completed:ue,skipped:ee,visible:we}=Q.$state;return !$e&&!ue&&!ee&&we}).map(Q=>{var Ke,K,oe,ne,te;function $e(me){return M(this,null,function*(){return (yield T==null?void 0:T(C,me))===!1?(me.preventDefault(),!1):(Q.skip(),!0)})}let ue=y&&Q.id===$.id,ee=(oe=(K=(Ke=Q.props)==null?void 0:Ke.zIndex)!=null?K:E==null?void 0:E.zIndex)!=null?oe:h,we=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:$e,onPrimary:w,onSecondary:P,part:p,side:u,sideOffset:f,spotlight:y,zIndex:ee},(ne=Q.props)!=null?ne:{});return jsxRuntime.jsx(po,i({css:{"&:has([aria-expanded=true])":{zIndex:Number(ee)+2},".fr-overlay":{zIndex:Number(ee)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(te=n||ue)!=null?te:!1,step:Q},we),`${Q.id}-${ue}`)})}})),"body")}function br(e){var u,f,y;let{frigade:o}=Fo.useContext(z),[,t]=Fo.useState(!1),n,r=Fo.useCallback(h=>{o==null||o.getCollection(e).then(()=>{h();});let x=()=>{clearTimeout(n),n=setTimeout(()=>{t(R=>!R),h();},100);};return o==null||o.onStateChange(x),()=>{o==null||o.removeStateChangeHandler(x);}},[e]),a=Fo.useSyncExternalStore(r,()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h},()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h}),p=(y=((f=(u=a==null?void 0:a.flows)==null?void 0:u.map(h=>s(i({},h),{flow:o==null?void 0:o.getFlowSync(h.flowId)})))!=null?f:[]).find(({flow:h})=>h.isVisible))==null?void 0:y.flowId,{flow:d}=Se(p);return {collection:a,currentFlow:d}}function No(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var d,u,f;let a={ANNOUNCEMENT:zo,BANNER:vo,CARD:b,CHECKLIST:oo,EMBEDDED_TIP:b,FORM:Ie,NPS_SURVEY:ze,SURVEY:ze,TOUR:co},{currentFlow:l}=br(e),p=(u=a[(d=l==null?void 0:l.rawData)==null?void 0:d.flowType])!=null?u:null;return l==null||p==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===js.FlowType.FORM?jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(Ie,{flowId:l.id,as:H},l.id)})):jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(p,{flowId:l.id},l.id)}))}function _e(){let{frigade:e}=Fo.useContext(z);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Pr(){let[e,o]=Fo.useState(),{frigade:t}=_e();return Fo.useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsxRuntime.jsx(No,{as:null,collectionId:e})}var z=Fo.createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Cr(){let{frigade:e}=_e();return Fo.useEffect(()=>{M(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Sr="2.5.1";function Rr(l){var p=l,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,a=m(p,["children","css","defaultCollection","navigate","theme"]);let d=r?bo(r):{},u=Fo.useRef(new Map),f=Fo.useRef(),[y,h]=Fo.useState(!1),x=Fo.useMemo(()=>(h(!1),f.current=void 0,new js.Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:Sr,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);Fo.useEffect(()=>{if(a.__flowStateOverrides){let P=x.getConfig();P.__flowStateOverrides=a.__flowStateOverrides,x.reload(P);}},[a.__flowStateOverrides]);function R(){let P=[...u.current.entries()].map(([C,v])=>[C,v.callback]);x.batchRegister(P),h(!0);}function B(P,C){if(f.current&&clearTimeout(f.current),y){u.current.has(P)?x.getFlow(P).then(v=>C(v.isVisible)):(x.getFlow(P).then(v=>v.register(C)),u.current.set(P,{callback:C}));return}u.current.has(P)||u.current.set(P,{callback:C}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>R(),0);}function T(P){u.current.has(P)&&x.getFlow(P).then(C=>{u.current.delete(P),C==null||C.unregister();});}let w=n!=null?n:(P,C="_self")=>{window.open(P,C);};return Fo.useEffect(()=>()=>{x.destroy();},[]),jsxRuntime.jsxs(z.Provider,{value:s(i({navigate:w},a),{frigade:x,registerComponent:B,unregisterComponent:T,hasInitialized:y}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i(i({},Po),d),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:D,children:[t&&jsxRuntime.jsx(Pr,{}),e]}),a.preloadImages!==!1&&jsxRuntime.jsx(Cr,{})]})}function Se(e,o){let{frigade:t}=Fo.useContext(z),[,n]=Fo.useState(!1),r=Fo.useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let p=d=>{d.id===e&&setTimeout(()=>{n(u=>!u),l();},0);};return t==null||t.onStateChange(p),()=>{t==null||t.removeStateChangeHandler(p);}},[e]),a=Fo.useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a,isLoading:t!=null&&t.hasFailedToLoad()?!1:!a}}function Uo(e,{onComplete:o,onDismiss:t}={}){let n=Fo.useRef(null);return Fo.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&M(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Fo.useCallback(r=>M(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var de=new Set;function Go(e,o=!0){let t=Fo.useCallback(()=>{de.has(e==null?void 0:e.id)&&de.delete(e==null?void 0:e.id);},[de,o]),n=Fo.useCallback(()=>{o&&(e!=null&&e.isVisible)&&!de.has(e.id)&&de.add(e.id);},[de,o]);Fo.useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=de.size>0?de.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||de.size==0:!0}}function _(u){var f=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:l,variables:p}=f,d=m(f,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var k,W;let{flow:y}=Se(t,{variables:p}),I=i(i({},d),(k=y==null?void 0:y.props)!=null?k:{}),{dismissible:h=!1,forceMount:x=!1}=I,R=m(I,["dismissible","forceMount"]),B=y==null?void 0:y.getCurrentStep(),{handleDismiss:T}=Uo(y,{onComplete:n,onDismiss:r}),{handlePrimary:w,handleSecondary:P}=le(B,{onPrimary:a,onSecondary:l}),C=(R==null?void 0:R.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((W=y==null?void 0:y.rawData)==null?void 0:W.flowType),{isCurrentModal:v}=Go(y,C),E=x&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!E||!E&&!v)return null;(E||!y.isCompleted&&!y.isSkipped)&&B.start();let $=e===null?Fo.Fragment:e!=null?e:g,N=s(i({},R),{"data-flow-id":y.id});return jsxRuntime.jsx($,s(i({},e===null?{}:N),{children:o({flow:y,handleDismiss:T,handlePrimary:w,handleSecondary:P,parentProps:{dismissible:h,flowId:t,variables:p,containerProps:N},step:B})}))}function Er(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(_,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:l,parentProps:{dismissible:p},step:d})=>{var y,h,x,R;let u=(h=(y=d.primaryButton)==null?void 0:y.title)!=null?h:d.primaryButtonTitle,f=(R=(x=d.secondaryButton)==null?void 0:x.title)!=null?R:d.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:p,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsxRuntime.jsx(b.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:f,onClick:l}),jsxRuntime.jsx(b.Primary,{title:u,onClick:a})]})]})}}))}function mo(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Ia(e){var o,t,n,r,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function fo(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=Ia(o);return a?jsxRuntime.jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ye(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?fo:mo,i({src:e},t))}var b=Fo__namespace.forwardRef((a,r)=>{var l=a,{children:e,flowId:o,part:t}=l,n=m(l,["children","flowId","part"]);var d;if(o!=null)return jsxRuntime.jsx(Er,i({flowId:o},n));let p=(d=n.as)!=null?d:S.Column;return jsxRuntime.jsx(p,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(O.Plain,s(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Fe,{height:"20",fill:"currentColor"})}));b.Footer=n=>{var r=n,{children:e,part:o}=r,t=m(r,["children","part"]);return jsxRuntime.jsx(S.Row,s(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=l=>{var p=l,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=p,a=m(p,["dismissible","handleDismiss","part","subtitle","title"]);return jsxRuntime.jsxs(S.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};b.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ye,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Secondary,i({title:o,onClick:e},t))};b.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=m(r,["children","part"]);return e==null?null:jsxRuntime.jsx(F.Body2,s(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=n=>{var r=n,{children:e,part:o}=r,t=m(r,["children","part"]);return e==null?null:jsxRuntime.jsx(F.H4,s(i({display:"block",part:["title",o]},t),{children:e}))};var go={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Ir(e){let o=Object.fromEntries(go.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(go.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!go.content.some(a=>a===r)&&!go.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Aa=react.keyframes`
|
|
90
90
|
from {
|
|
91
91
|
opacity: 0;
|
|
92
92
|
}
|
|
@@ -96,7 +96,7 @@ var Jo=Object.defineProperty,_r=Object.defineProperties;var zr=Object.getOwnProp
|
|
|
96
96
|
to {
|
|
97
97
|
opacity: 1;
|
|
98
98
|
}
|
|
99
|
-
`;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=
|
|
99
|
+
`;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:l,contentProps:p,otherProps:f}=Ir(n),y=f,{zIndex:d}=y,u=m(y,["zIndex"]);return jsxRuntime.jsx(j__namespace.Root,s(i({defaultOpen:!0,modal:t},l),{children:jsxRuntime.jsx(j__namespace.Portal,{children:jsxRuntime.jsxs(g,{animation:`${Aa} 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&&jsxRuntime.jsx(j__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(j__namespace.Content,s(i({asChild:!0,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault()},p),{children:jsxRuntime.jsx(b,s(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}H.Dismiss=e=>jsxRuntime.jsx(j__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,s(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(Fe,{height:"20",fill:"currentColor"})}))});H.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(j__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))})};H.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(ye,i({borderRadius:"md",src:e},o))};H.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,i({title:o,onClick:e},t))};H.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?D.colors.primary.surface:D.colors.neutral[700],part:e===r?"progress-dot-selected":"progress-dot"},r));return jsxRuntime.jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};H.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,i({title:o,onClick:e},t))};H.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(j__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(F.H4,s(i({part:"title"},o),{children:e}))})};H.displayName="Dialog";var Hr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function zo(n){var r=n,{flowId:e,part:o}=r,t=m(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([p])=>Hr.some(d=>p===d))),l=Object.fromEntries(Object.entries(t).filter(([p])=>Hr.indexOf(p)===-1));return jsxRuntime.jsx(_,s(i({as:null,flowId:e},a),{children:({flow:p,handleDismiss:d,handlePrimary:u,handleSecondary:f,parentProps:{containerProps:y,dismissible:h},step:x})=>{var P,C,v,E,$,N;let R=(P=x.props)!=null?P:{},B=(v=(C=x.primaryButton)==null?void 0:C.title)!=null?v:x.primaryButtonTitle,T=($=(E=x.secondaryButton)==null?void 0:E.title)!=null?$:x.secondaryButtonTitle,w=x.$state.blocked;return jsxRuntime.jsx(H,s(i(i({part:["announcement",o],textAlign:"center"},y),l),{onEscapeKeyDown:k=>{if(t.dismissible===!1){k.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(k),k.defaultPrevented||d(k);},children:jsxRuntime.jsxs(S.Column,s(i({gap:5,part:"announcement-step"},R),{children:[h&&jsxRuntime.jsx(H.Dismiss,{onClick:d}),jsxRuntime.jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(H.Title,{children:x.title}),jsxRuntime.jsx(H.Subtitle,{children:x.subtitle})]}),jsxRuntime.jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(N=x.videoUri)!=null?N:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image",width:"100%"}),jsxRuntime.jsx(H.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[T&&jsxRuntime.jsx(H.Secondary,{disabled:w,onClick:f,title:T}),B&&jsxRuntime.jsx(H.Primary,{disabled:w,onClick:u,title:B})]})]}))}))}}))}function yo(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=Fo.useState(e),[n,r]=Fo.useState(null),a=Fo.useCallback(l=>{r(l);},[]);return Fo.useLayoutEffect(()=>{if(!n)return;let l=()=>{let p=n.getBoundingClientRect();t(p);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),{node:n,rect:o,ref:a}}var za=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ar(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${za}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Wr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{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",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=l;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=l:r.bottom=l:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=l:r.top=l:["top","bottom"].includes(n)?r.left=`calc(50% + ${l})`:r.top=`calc(50% + ${l})`,r}var xo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Vr(e,o){var a,l,p,d,u;let t=Object.fromEntries(xo.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n=Object.fromEntries(xo.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r={};for(let f of Object.keys(e))!xo.content.includes(f)&&!xo.root.includes(f)&&(r[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},y=(w,P)=>["top","bottom"].includes(P)?w=="after"?"marginLeft":"marginRight":w=="after"?"marginTop":"marginBottom",h=(p=t.alignOffset)!=null?p:0,x=(d=t.style)!=null?d:{},R=(u=t.side)!=null?u:"bottom",B=t.align;t.style=s(i({},x),{[y(B,R)]:h});let T=["top","bottom"].includes(R)?o.width:o.height;t.alignOffset=(T+h)*-1,t.align=f[B];}return {contentProps:t,otherProps:r,rootProps:n}}var Lr=react.keyframes`
|
|
100
100
|
from {
|
|
101
101
|
opacity: 0;
|
|
102
102
|
}
|
|
@@ -106,46 +106,46 @@ var Jo=Object.defineProperty,_r=Object.defineProperties;var zr=Object.getOwnProp
|
|
|
106
106
|
to {
|
|
107
107
|
opacity: 1;
|
|
108
108
|
}
|
|
109
|
-
`;function
|
|
109
|
+
`;function Nr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function xe(u){var f=u,{anchor:e,children:o,className:t,defaultOpen:n=!0,open:r,part:a,spotlight:l=!1,style:p={}}=f,d=m(f,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:y,rect:h,ref:x}=yo(),{node:R,rect:B,ref:T}=yo(),{contentProps:w,otherProps:P,rootProps:C}=Vr(d,h),[v,E]=Fo.useState(n),[$,N]=Fo.useState(w.align),[k,I]=Fo.useState(w.side),[W,he]=Fo.useState(0),[Q,$e]=Fo.useState(0);function ue(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",v),v)}if(y!==null){let K=y.getAttribute("data-align"),oe=y.getAttribute("data-side");$!==K&&N(K),k!==oe&&I(oe);}let ee=Fo.useRef(null);if(Fo.useEffect(()=>{let K=document.querySelector(e);K!=null?(T(K),ee.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Fo.useEffect(()=>{function K(ne){if(ne.matches(e))return Nr(ne)?ne:null;let te=ne.querySelectorAll(e);return te.length>0&&Nr(te[0])?te[0]:null}let oe=new MutationObserver(ne=>{for(let te of ne)if(te.type==="childList"){for(let me of te.addedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){T(fe),ee.current=fe,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",fe);break}}for(let me of te.removedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){T(null),ee.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",fe);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),Fo.useEffect(()=>{let{scrollX:K,scrollY:oe}=window;he(B.left+K),$e(B.top+oe);},[B.left,B.top]),R==null)return null;let we="0";typeof window!="undefined"&&(we=window.getComputedStyle(R).borderRadius);let Ke=Wr({props:d,alignAttr:$,sideAttr:k});return jsxRuntime.jsxs(re__namespace.Root,s(i({defaultOpen:!0},C),{children:[jsxRuntime.jsx(re__namespace.Anchor,{virtualRef:ee}),jsxRuntime.jsx(re__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&jsxRuntime.jsx(g,i({animation:`${Lr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:we,height:B.height,left:W,top:Q,width:B.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsxRuntime.jsx(re__namespace.Content,s(i({},w),{ref:x,children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[ue()&&jsxRuntime.jsx(b,s(i({animation:`${Lr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:p},P),{children:o})),jsxRuntime.jsx(Ar,{onClick:()=>{E(()=>(typeof C.onOpenChange=="function"&&C.onOpenChange(!ue()),!ue()));},style:Ke})]})}),v)]})})]}))}xe.Close=e=>jsxRuntime.jsx(re__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(Fe,{height:"20",fill:"currentColor"})}))});xe.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(ye,i({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))};xe.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,i({title:o,onClick:e},t))};xe.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,s(i({part:"progress"},o),{children:e}))};xe.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,i({title:o,onClick:e},t))};xe.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))};xe.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,s(i({part:"title"},o),{children:e}))};function ja(){let{userId:e,frigade:o}=Fo.useContext(z);function t(r){return M(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return M(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function Ja(){var r;let{frigade:e}=Fo.useContext(z);function o(a){return M(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,l){return M(this,null,function*(){yield e.track(a,l);})}function n(a,l){return M(this,null,function*(){yield e.group(a,l);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
|
|
110
110
|
|
|
111
111
|
exports.FrigadeJS = js__namespace;
|
|
112
|
-
exports.Announcement =
|
|
113
|
-
exports.Banner =
|
|
114
|
-
exports.BaseField =
|
|
112
|
+
exports.Announcement = zo;
|
|
113
|
+
exports.Banner = vo;
|
|
114
|
+
exports.BaseField = Y;
|
|
115
115
|
exports.Box = g;
|
|
116
|
-
exports.Button =
|
|
116
|
+
exports.Button = O;
|
|
117
117
|
exports.Card = b;
|
|
118
|
-
exports.Checklist =
|
|
119
|
-
exports.Collection =
|
|
118
|
+
exports.Checklist = to;
|
|
119
|
+
exports.Collection = No;
|
|
120
120
|
exports.Dialog = H;
|
|
121
121
|
exports.Flex = S;
|
|
122
|
-
exports.Flow =
|
|
123
|
-
exports.Form =
|
|
124
|
-
exports.Hint =
|
|
125
|
-
exports.Image =
|
|
126
|
-
exports.Label =
|
|
127
|
-
exports.Media =
|
|
128
|
-
exports.Progress =
|
|
129
|
-
exports.Provider =
|
|
130
|
-
exports.RadioField =
|
|
131
|
-
exports.SelectField =
|
|
132
|
-
exports.Spotlight =
|
|
133
|
-
exports.Survey =
|
|
134
|
-
exports.Text =
|
|
135
|
-
exports.TextField =
|
|
136
|
-
exports.TextareaField =
|
|
137
|
-
exports.Tooltip =
|
|
138
|
-
exports.Tour =
|
|
139
|
-
exports.Video =
|
|
140
|
-
exports.themeVariables =
|
|
141
|
-
exports.tokens =
|
|
142
|
-
exports.useBoundingClientRect =
|
|
143
|
-
exports.useFlow =
|
|
144
|
-
exports.useFlowHandlers =
|
|
145
|
-
exports.useFrigade =
|
|
146
|
-
exports.useGroup =
|
|
147
|
-
exports.useModal =
|
|
148
|
-
exports.useStepHandlers =
|
|
149
|
-
exports.useUser =
|
|
122
|
+
exports.Flow = _;
|
|
123
|
+
exports.Form = Ie;
|
|
124
|
+
exports.Hint = Vo;
|
|
125
|
+
exports.Image = mo;
|
|
126
|
+
exports.Label = Do;
|
|
127
|
+
exports.Media = ye;
|
|
128
|
+
exports.Progress = Re;
|
|
129
|
+
exports.Provider = Rr;
|
|
130
|
+
exports.RadioField = Io;
|
|
131
|
+
exports.SelectField = Ho;
|
|
132
|
+
exports.Spotlight = Ao;
|
|
133
|
+
exports.Survey = so;
|
|
134
|
+
exports.Text = F;
|
|
135
|
+
exports.TextField = $o;
|
|
136
|
+
exports.TextareaField = Mo;
|
|
137
|
+
exports.Tooltip = xe;
|
|
138
|
+
exports.Tour = co;
|
|
139
|
+
exports.Video = fo;
|
|
140
|
+
exports.themeVariables = Po;
|
|
141
|
+
exports.tokens = Je;
|
|
142
|
+
exports.useBoundingClientRect = yo;
|
|
143
|
+
exports.useFlow = Se;
|
|
144
|
+
exports.useFlowHandlers = Uo;
|
|
145
|
+
exports.useFrigade = _e;
|
|
146
|
+
exports.useGroup = Ja;
|
|
147
|
+
exports.useModal = Go;
|
|
148
|
+
exports.useStepHandlers = le;
|
|
149
|
+
exports.useUser = ja;
|
|
150
150
|
//# sourceMappingURL=out.js.map
|
|
151
151
|
//# sourceMappingURL=index.cjs.map
|