@frigade/react 2.3.2 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +21 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('@emotion/react');
|
|
4
|
-
var
|
|
4
|
+
var K = require('@radix-ui/react-dialog');
|
|
5
5
|
var solid = require('@heroicons/react/20/solid');
|
|
6
|
-
var
|
|
6
|
+
var so = require('react');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var cr = require('known-css-properties');
|
|
9
9
|
var Pr = require('dompurify');
|
|
@@ -37,8 +37,8 @@ function _interopNamespace(e) {
|
|
|
37
37
|
return Object.freeze(n);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var K__namespace = /*#__PURE__*/_interopNamespace(K);
|
|
41
|
+
var so__namespace = /*#__PURE__*/_interopNamespace(so);
|
|
42
42
|
var cr__default = /*#__PURE__*/_interopDefault(cr);
|
|
43
43
|
var Pr__default = /*#__PURE__*/_interopDefault(Pr);
|
|
44
44
|
var js__namespace = /*#__PURE__*/_interopNamespace(js);
|
|
@@ -48,14 +48,14 @@ var Ce__namespace = /*#__PURE__*/_interopNamespace(Ce);
|
|
|
48
48
|
var N__namespace = /*#__PURE__*/_interopNamespace(N);
|
|
49
49
|
var Z__namespace = /*#__PURE__*/_interopNamespace(Z);
|
|
50
50
|
|
|
51
|
-
var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnPropertyDescriptors;var Ae=Object.getOwnPropertySymbols;var Eo=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var ko=(e,o,t)=>o in e?Do(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Eo.call(o,t)&&ko(e,t,o[t]);if(Ae)for(var t of Ae(o))Oo.call(o,t)&&ko(e,t,o[t]);return e},d=(e,o)=>nr(e,ir(o));var ar=(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 r in e)Eo.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Ae)for(var r of Ae(e))o.indexOf(r)<0&&Oo.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Do(e,t,{get:o[t],enumerable:!0});};var I=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{l(t.next(c));}catch(u){n(u);}},s=c=>{try{l(t.throw(c));}catch(u){n(u);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((t=t.apply(e,o)).next());});var Io={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Ho=[...$e],Ze=[...$e];Ho[4]=40;Ze[4]=60;var sr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Ho},red:{h:9,s:90,l:Ze},yellow:{h:50,s:90,l:Ze}};var L={};for(let[e,{h:o,s:t,l:r}]of Object.entries(sr))L[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Mo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},L),{gray100:L.gray[100],gray200:L.gray[200],gray300:L.gray[300],gray400:L.gray[400],gray500:L.gray[500],gray600:L.gray[600],gray700:L.gray[700],gray800:L.gray[800],gray900:L.gray[900],blue400:L.blue[400],blue500:L.blue[500],blue800:L.blue[800],blue900:L.blue[900],green400:L.blue[400],green500:L.green[500],green800:L.green[800],red500:L.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Wo={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Lo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var Ao={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var lr="px",pr=e=>typeof e=="number"?`${4*e}${lr}`:e,dr=[-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"],$o=Object.fromEntries(dr.map(e=>[e,pr(e)]));var No={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 Ne=d(a(d(a({},Io),{colors:a(a({},Mo),Lo)}),No),{radii:Wo,shadows:Ao,space:$o});function Be(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,Be(l,s,t)):r[s]=l,r},{})}function eo(e){let o=Be(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Vo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Vo(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var oo=eo(Ne),T=Vo(Ne);var ur=new Set(["alt","size","src"]),mr=cr__default.default.all.filter(e=>e.indexOf("-")!=0&&!ur.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),fr=Object.fromEntries(mr),Ve=Be(T.colors),gr={color:Ve,backgroundColor:Ve,borderColor:Ve,border:a(a({},T.borderWidths),Ve),borderRadius:T.radii,borderWidth:T.borderWidths,boxShadow:T.shadows,fontFamily:T.fontFamilies,fontSize:T.fontSizes,fontWeight:T.fontWeights,gap:T.space,lineHeight:T.lineHeights,margin:T.space,marginBottom:T.space,marginLeft:T.space,marginRight:T.space,marginTop:T.space,padding:T.space,paddingBottom:T.space,paddingLeft:T.space,paddingRight:T.space,paddingTop:T.space},_o=a(a({},fr),gr),zo={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"]},Uo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function yr(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 Ko=new Map(Object.entries(_o).map(([e,o])=>[e,yr(o)])),xr=new Map(Object.entries(zo).map(([e,o])=>[e,new Set(o)])),br=new Set(["height","width"]),hr=new Set(["canvas","embed","iframe","img","input","object","video"]);function jo(e){let[o,t]=e.split(":");return [o,Uo.has(t)?t:null]}function Go(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([i,s])=>{let[l,c]=jo(i),u=xr.get(l);u!=null&&(u.forEach(g=>{let h=`${g}${c?":"+c:""}`;t[h]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,c]=jo(i),u=Ko.get(l);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(h=>{var x;return (x=u.get(h.toString()))!=null?x:h}).join(" ");}else u.has(s.toString())?n(c)[l]=u.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!hr.has(o)||!br.has(l))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&Ko.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Cr(){if(typeof window=="undefined"){let{JSDOM:e}=ar("jsdom");return new e("<!DOCTYPE html>").window}return window}function Jo(e){return e?{__html:Pr__default.default(Cr()).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"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Fr(e){return e&&`fr-${e}`}function Yo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Yo(o)).join(" "):Fr(e))}function wr(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,i=f(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:h}=Go(i,u),x=Yo(n),m=t||x?clsx.clsx(t,x):void 0,w=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsxRuntime.jsx(u,d(a({className:m,css:w},h),{ref:s,dangerouslySetInnerHTML:Jo(o)})):jsxRuntime.jsx(u,d(a({className:m,css:w},h),{ref:s,children:o}))}var y=io__namespace.forwardRef(wr);var D={};ee(D,{Link:()=>Zr,Plain:()=>en,Primary:()=>Yr,Secondary:()=>Qr});var C={};ee(C,{Body1:()=>Vr,Body2:()=>_r,Caption:()=>zr,Display1:()=>Mr,Display2:()=>Wr,H1:()=>Lr,H2:()=>Ar,H3:()=>$r,H4:()=>Nr});var to={};ee(to,{Body1:()=>Er,Body2:()=>Or,Caption:()=>Ir,Display1:()=>Tr,Display2:()=>Br,H1:()=>vr,H2:()=>Rr,H3:()=>kr,H4:()=>Dr});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Tr=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Br=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),vr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Rr=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),kr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Dr=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Er=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Or=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Ir=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Hr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Hr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=io__namespace.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,i=f(c,["as","children"]);return jsxRuntime.jsx(y,d(a(a({as:r},to[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Mr=te.Display1,Wr=te.Display2,Lr=te.H1,Ar=te.H2,$r=te.H3,Nr=te.H4,Vr=te.Body1,_r=te.Body2,zr=te.Caption;var no={};ee(no,{Link:()=>Jr,Plain:()=>Xr,Primary:()=>jr,Secondary:()=>Gr,loadingCSSStyle:()=>ro});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},jr=d(a({},_e),{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"}),Gr=d(a({},_e),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Jr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Xr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),qr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),ro={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:qr+" 1s ease infinite"}};function ze(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,i=f(l,["as","children","part","title","variant"]);var u;let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(y,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},no[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?ro:{})}),i),{loading:void 0,children:[o,r&&jsxRuntime.jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Yr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function Qr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function Zr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Link",children:e}))}function en(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var P={};ee(P,{Column:()=>rn,Row:()=>tn});var tn=io__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),rn=io__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function ao(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=f(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(K,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:u},step:g})=>{var S,B,E,v,H;let h=(S=g.props)!=null?S:{},x=(E=(B=g.primaryButton)==null?void 0:B.title)!=null?E:g.primaryButtonTitle,m=(H=(v=g.secondaryButton)==null?void 0:v.title)!=null?H:g.secondaryButtonTitle,w=!!g.$state.blocked;return jsxRuntime.jsxs(b,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),h),{children:[g.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:g.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:w,title:m,onClick:c}),jsxRuntime.jsx(b.Primary,{disabled:w,title:x,onClick:l}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:s})]}))}}))}var Ke={};ee(Ke,{Carousel:()=>ct,Collapsible:()=>Ue,CollapsibleStep:()=>De});var Re={};ee(Re,{Bar:()=>xe,Dots:()=>rt,Segments:()=>it});function xe(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(y,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function rt(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?T.colors.blue500:T.colors.blue800},l));return jsxRuntime.jsx(y,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function it(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsxRuntime.jsx(P.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function nn(){return jsxRuntime.jsx(y,{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 at(t){var r=t,{checked:e=!1}=r,o=f(r,["checked"]);return jsxRuntime.jsx(y,d(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsxRuntime.jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(nn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=io.useContext(O),n={"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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:io.useCallback((i,s,l=!0)=>I(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:io.useCallback((i,s)=>I(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function lt({onPrimary:e,onSecondary:o,step:t}){var c,u;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s}=t.$state,l=s||!i?jsxRuntime.jsx(at,{checked:s,marginLeft:"auto"}):jsxRuntime.jsx(y,{as:outline.LockClosedIcon,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:i,opacity:i?.5:1,children:[jsxRuntime.jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),l]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(P.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:s,onClick:n,title:(c=t.secondaryButton)==null?void 0:c.title}),jsxRuntime.jsx(b.Primary,{disabled:s||i,onClick:r,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}var dt=react.keyframes`
|
|
51
|
+
var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnPropertyDescriptors;var Ae=Object.getOwnPropertySymbols;var Eo=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var ko=(e,o,t)=>o in e?Do(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Eo.call(o,t)&&ko(e,t,o[t]);if(Ae)for(var t of Ae(o))Oo.call(o,t)&&ko(e,t,o[t]);return e},d=(e,o)=>nr(e,ir(o));var ar=(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 r in e)Eo.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Ae)for(var r of Ae(e))o.indexOf(r)<0&&Oo.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Do(e,t,{get:o[t],enumerable:!0});};var I=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{l(t.next(c));}catch(u){n(u);}},s=c=>{try{l(t.throw(c));}catch(u){n(u);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((t=t.apply(e,o)).next());});var Io={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Ho=[...$e],oo=[...$e];Ho[4]=40;oo[4]=60;var sr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Ho},red:{h:9,s:90,l:oo},yellow:{h:50,s:90,l:oo}};var L={};for(let[e,{h:o,s:t,l:r}]of Object.entries(sr))L[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Mo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},L),{gray100:L.gray[100],gray200:L.gray[200],gray300:L.gray[300],gray400:L.gray[400],gray500:L.gray[500],gray600:L.gray[600],gray700:L.gray[700],gray800:L.gray[800],gray900:L.gray[900],blue400:L.blue[400],blue500:L.blue[500],blue800:L.blue[800],blue900:L.blue[900],green400:L.blue[400],green500:L.green[500],green800:L.green[800],red500:L.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Wo={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Lo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var Ao={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var lr="px",pr=e=>typeof e=="number"?`${4*e}${lr}`:e,dr=[-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"],$o=Object.fromEntries(dr.map(e=>[e,pr(e)]));var No={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 Ne=d(a(d(a({},Io),{colors:a(a({},Mo),Lo)}),No),{radii:Wo,shadows:Ao,space:$o});function Be(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,Be(l,s,t)):r[s]=l,r},{})}function to(e){let o=Be(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Vo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Vo(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var ro=to(Ne),T=Vo(Ne);var ur=new Set(["alt","size","src"]),mr=cr__default.default.all.filter(e=>e.indexOf("-")!=0&&!ur.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),fr=Object.fromEntries(mr),Ve=Be(T.colors),gr={color:Ve,backgroundColor:Ve,borderColor:Ve,border:a(a({},T.borderWidths),Ve),borderRadius:T.radii,borderWidth:T.borderWidths,boxShadow:T.shadows,fontFamily:T.fontFamilies,fontSize:T.fontSizes,fontWeight:T.fontWeights,gap:T.space,lineHeight:T.lineHeights,margin:T.space,marginBottom:T.space,marginLeft:T.space,marginRight:T.space,marginTop:T.space,padding:T.space,paddingBottom:T.space,paddingLeft:T.space,paddingRight:T.space,paddingTop:T.space},_o=a(a({},fr),gr),zo={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"]},Ko=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function yr(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 Uo=new Map(Object.entries(_o).map(([e,o])=>[e,yr(o)])),xr=new Map(Object.entries(zo).map(([e,o])=>[e,new Set(o)])),br=new Set(["height","width"]),hr=new Set(["canvas","embed","iframe","img","input","object","video"]);function jo(e){let[o,t]=e.split(":");return [o,Ko.has(t)?t:null]}function Go(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([i,s])=>{let[l,c]=jo(i),u=xr.get(l);u!=null&&(u.forEach(g=>{let h=`${g}${c?":"+c:""}`;t[h]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,c]=jo(i),u=Uo.get(l);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(h=>{var x;return (x=u.get(h.toString()))!=null?x:h}).join(" ");}else u.has(s.toString())?n(c)[l]=u.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!hr.has(o)||!br.has(l))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&Uo.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Cr(){if(typeof window=="undefined"){let{JSDOM:e}=ar("jsdom");return new e("<!DOCTYPE html>").window}return window}function Jo(e){return e?{__html:Pr__default.default(Cr()).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"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Fr(e){return e&&`fr-${e}`}function Yo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Yo(o)).join(" "):Fr(e))}function wr(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,i=f(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:h}=Go(i,u),x=Yo(n),m=t||x?clsx.clsx(t,x):void 0,w=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsxRuntime.jsx(u,d(a({className:m,css:w},h),{ref:s,dangerouslySetInnerHTML:Jo(o)})):jsxRuntime.jsx(u,d(a({className:m,css:w},h),{ref:s,children:o}))}var y=so__namespace.forwardRef(wr);var D={};ee(D,{Link:()=>Zr,Plain:()=>en,Primary:()=>Yr,Secondary:()=>Qr});var C={};ee(C,{Body1:()=>Vr,Body2:()=>_r,Caption:()=>zr,Display1:()=>Mr,Display2:()=>Wr,H1:()=>Lr,H2:()=>Ar,H3:()=>$r,H4:()=>Nr});var no={};ee(no,{Body1:()=>Er,Body2:()=>Or,Caption:()=>Ir,Display1:()=>Tr,Display2:()=>Br,H1:()=>vr,H2:()=>Rr,H3:()=>kr,H4:()=>Dr});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Tr=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Br=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),vr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Rr=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),kr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Dr=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Er=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Or=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Ir=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Hr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Hr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=so__namespace.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,i=f(c,["as","children"]);return jsxRuntime.jsx(y,d(a(a({as:r},no[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Mr=te.Display1,Wr=te.Display2,Lr=te.H1,Ar=te.H2,$r=te.H3,Nr=te.H4,Vr=te.Body1,_r=te.Body2,zr=te.Caption;var ao={};ee(ao,{Link:()=>Jr,Plain:()=>Xr,Primary:()=>jr,Secondary:()=>Gr,loadingCSSStyle:()=>io});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},jr=d(a({},_e),{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"}),Gr=d(a({},_e),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Jr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Xr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),qr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),io={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:qr+" 1s ease infinite"}};function ze(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,i=f(l,["as","children","part","title","variant"]);var u;let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(y,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},ao[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?io:{})}),i),{loading:void 0,children:[o,r&&jsxRuntime.jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Yr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function Qr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function Zr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Link",children:e}))}function en(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var P={};ee(P,{Column:()=>rn,Row:()=>tn});var tn=so__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),rn=so__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function lo(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=f(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(U,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:u},step:g})=>{var S,B,E,v,H;let h=(S=g.props)!=null?S:{},x=(E=(B=g.primaryButton)==null?void 0:B.title)!=null?E:g.primaryButtonTitle,m=(H=(v=g.secondaryButton)==null?void 0:v.title)!=null?H:g.secondaryButtonTitle,w=!!g.$state.blocked;return jsxRuntime.jsxs(b,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),h),{children:[g.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:g.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:w,title:m,onClick:c}),jsxRuntime.jsx(b.Primary,{disabled:w,title:x,onClick:l}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:s})]}))}}))}var Ue={};ee(Ue,{Carousel:()=>ct,Collapsible:()=>Ke,CollapsibleStep:()=>De});var Re={};ee(Re,{Bar:()=>xe,Dots:()=>rt,Segments:()=>it});function xe(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(y,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function rt(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?T.colors.blue500:T.colors.blue800},l));return jsxRuntime.jsx(y,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function it(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((s,l)=>jsxRuntime.jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsxRuntime.jsx(P.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function nn(){return jsxRuntime.jsx(y,{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 at(t){var r=t,{checked:e=!1}=r,o=f(r,["checked"]);return jsxRuntime.jsx(y,d(a({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsxRuntime.jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(nn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=so.useContext(O),n={"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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:so.useCallback((i,s,l=!0)=>I(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:so.useCallback((i,s)=>I(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function lt({onPrimary:e,onSecondary:o,step:t}){var c,u;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s}=t.$state,l=s||!i?jsxRuntime.jsx(at,{checked:s,marginLeft:"auto"}):jsxRuntime.jsx(y,{as:outline.LockClosedIcon,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:i,opacity:i?.5:1,children:[jsxRuntime.jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),l]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(P.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:s,onClick:n,title:(c=t.secondaryButton)==null?void 0:c.title}),jsxRuntime.jsx(b.Primary,{disabled:s||i,onClick:r,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}var dt=react.keyframes`
|
|
52
52
|
from {
|
|
53
53
|
opacity: 0;
|
|
54
54
|
}
|
|
55
55
|
to {
|
|
56
56
|
opacity: 1;
|
|
57
57
|
}
|
|
58
|
-
`;function ct(o){var e=f(o,[]);let[t,r]=un__default.default({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step"}),[n,i]=
|
|
58
|
+
`;function ct(o){var e=f(o,[]);let[t,r]=un__default.default({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step"}),[n,i]=so.useState(),[s,l]=so.useState();return so.useLayoutEffect(()=>{r&&(n==null&&i(r.canScrollNext()),s==null&&l(r.canScrollPrev()),r.on("select",()=>{i(r.canScrollNext()),l(r.canScrollPrev());}));},[r]),jsxRuntime.jsx(U,d(a({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:({flow:c})=>{let u=c.getNumberOfCompletedSteps(),g=c.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:T.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxRuntime.jsxs(P.Column,{part:"carousel-header-content",children:[jsxRuntime.jsx(C.H3,{children:c.title}),jsxRuntime.jsx(C.Body2,{color:"neutral.400",children:c.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxRuntime.jsxs(C.Body2,{fontWeight:"demibold",part:"progress-text",children:[u,"/",g]}),jsxRuntime.jsx(xe,{current:u,total:g,minWidth:"200px"})]})]}),jsxRuntime.jsxs(y,{margin:`0 ${T.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:t,children:[jsxRuntime.jsx(P.Row,{gap:4,part:"carousel-content",children:Array.from(c.steps.values()).map(h=>jsxRuntime.jsx(lt,{onPrimary:e.onPrimary,onSecondary:e.onSecondary,step:h},h.id))}),s&&jsxRuntime.jsx(P.Column,{animation:`${dt} 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(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>r.scrollPrev(),padding:"2",children:jsxRuntime.jsx(outline.ArrowLeftIcon,{height:"24px",width:"24px"})})}),n&&jsxRuntime.jsx(P.Column,{animation:`${dt} 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(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>r.scrollNext(),padding:"2",children:jsxRuntime.jsx(outline.ArrowRightIcon,{height:"24px",width:"24px"})})})]})]})}}))}var De={};ee(De,{Content:()=>uo,Root:()=>mo,Trigger:()=>fo});var gn=react.keyframes`
|
|
59
59
|
from {
|
|
60
60
|
height: 0;
|
|
61
61
|
opacity: 0;
|
|
@@ -73,7 +73,7 @@ var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnProp
|
|
|
73
73
|
height: 0;
|
|
74
74
|
opacity: 0;
|
|
75
75
|
}
|
|
76
|
-
`,xn=()=>jsxRuntime.jsx(y,{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 bn({checked:e=!1}){return jsxRuntime.jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(xn,{})})})}function po({children:e}){return jsxRuntime.jsx(he__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${gn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${yn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function co(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(he__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(b,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function uo({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(he__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.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",children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(bn,{checked:e}),jsxRuntime.jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:t})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var mt=io.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ft({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var m,w,S,B,E,v;let{$state:{blocked:i,completed:s},subtitle:l,title:c}=n,u=(w=(m=n.primaryButton)==null?void 0:m.title)!=null?w:n.primaryButtonTitle,g=(B=(S=n.secondaryButton)==null?void 0:S.title)!=null?B:n.secondaryButtonTitle,h=(E=n.props)!=null?E:{},x=!!(s||i);return jsxRuntime.jsxs(co,d(a({open:t,onOpenChange:r},h),{children:[jsxRuntime.jsx(uo,{isBlocked:n.$state.blocked,isCompleted:s,title:c}),jsxRuntime.jsxs(po,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(v=n.videoUri)!=null?v:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:l}),jsxRuntime.jsxs(P.Row,{gap:3,children:[jsxRuntime.jsx(b.Secondary,{disabled:x,title:g,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var Sn={default:ft};function Fn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:u}=io.useContext(mt),{handlePrimary:g,handleSecondary:h}=re(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,m=(S=u[o.type])!=null?S:ft;function w(B){return I(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(m,d(a({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:g,handleSecondary:h}),o.id)}function Ue(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=io.useState(null),h=a(a({},Sn),i);return jsxRuntime.jsx(mt.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:h},children:jsxRuntime.jsx(K,d(a({as:b,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:m}=B,w=f(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,F])=>F.$state.visible===!0).map(([,F])=>jsxRuntime.jsx(Fn,d(a({flow:x,handleDismiss:m},w),{step:F}),F.id)),H=x.getNumberOfCompletedSteps(),W=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:m,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(C.Body2,{fontWeight:"demibold",children:[H,"/",W]}),jsxRuntime.jsx(xe,{current:H,total:W,flexGrow:1})]})]}),v]})}}))})}var En=new Set(["required","min","max","minLength","maxLength","pattern"]);function On({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=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 i=Object.fromEntries(Object.entries(t).filter(([l])=>En.has(l))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function yt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var v,H,W,F,R,k;let{__readOnly:s}=io.useContext(O),l=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=io.useState(!1),g=[],{control:h,handleSubmit:x}=l,m=(v=i.props)!=null?v:{};function w(V,Se){u(!0),t(Se,V,s===!0).then(()=>u(!1));}(H=i.fields)==null||H.forEach(V=>{e[V.type]!=null&&g.push(jsxRuntime.jsx(On,{control:h,fieldComponent:e[V.type],fieldData:V,submit:x(w)},`${i.flow.id}-${V.id}`));});let S=(F=(W=i.primaryButton)==null?void 0:W.title)!=null?F:i.primaryButtonTitle,B=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,E=!!(i.$state.blocked||!l.formState.isValid);return jsxRuntime.jsxs(P.Column,d(a({gap:5,part:"form-step"},m),{children:[jsxRuntime.jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},l),{children:g})),jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(D.Secondary,{disabled:E,onClick:r,title:B}),jsxRuntime.jsx(D.Primary,{disabled:E||c,onClick:x(w),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function xt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function mo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Ee={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ne({children:e,field:o,fieldData:t,fieldState:r}){var u;let{id:n,label:i,placeholder:s}=t,{error:l}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),Ee),{"aria-invalid":!!l,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(mo,{id:n,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(xt,{error:l})]})}var Ln=()=>jsxRuntime.jsx(y,{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"})}),An=io__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(C.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Ce__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{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(y,{as:Ce__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",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(Ln,{})})})})]}));function fo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsxRuntime.jsx(An,{value:s,label:i},s));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsx(Ce__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Vn=io__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(N__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(N__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function go(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:l})=>jsxRuntime.jsx(Vn,{value:l,label:s},l));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsxs(N__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(N__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Body2,d(a({},Ee),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(N__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(N__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(N__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,d(a({},Ee),{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(N__namespace.Viewport,{children:i})}))})]})}))}function yo(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(C.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Tt(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(C.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var _n={radio:fo,select:go,text:yo,textarea:Tt};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let s=Object.assign({},_n,e);return jsxRuntime.jsx(K,d(a({flowId:o,part:["form",t]},r),{children:l=>jsxRuntime.jsx(yt,a({fieldTypes:s},l))}))}var Je={};ee(Je,{NPS:()=>Ge});function Rt({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?D.Primary:D.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(C.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsxRuntime.jsx(C.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ge(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsxRuntime.jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Rt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:d(a({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},n))}function me(e,{onComplete:o,onDismiss:t}={}){let r=io.useRef(null);return io.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&I(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:io.useCallback(n=>I(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Xe(){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]=io.useState(e),[r,n]=io.useState(null),i=io.useCallback(s=>{n(s);},[]);return io.useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var qn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Et(r){var n=r,{style:e={},part:o=""}=n,t=f(n,["style","part"]);return jsxRuntime.jsxs(y,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${qn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function xo(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Zn(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function bo(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let i=Zn(o);return i?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,a({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 fe(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsxRuntime.jsx(o==="video"?bo:xo,a({src:e},t))}function It({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var qe={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ht(e,o){var i,s,l,c,u;let t=Object.fromEntries(qe.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(qe.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!qe.content.includes(g)&&!qe.root.includes(g)&&(n[g]=e[g]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},h=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,m=(c=t.style)!=null?c:{},w=(u=t.side)!=null?u:"bottom",S=t.align;t.style=d(a({},m),{[h(S,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var Mt=react.keyframes`
|
|
76
|
+
`,xn=()=>jsxRuntime.jsx(y,{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 bn({checked:e=!1}){return jsxRuntime.jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(xn,{})})})}function uo({children:e}){return jsxRuntime.jsx(he__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${gn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${yn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function mo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(he__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(b,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function fo({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(he__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.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",children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(bn,{checked:e}),jsxRuntime.jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:t})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var mt=so.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ft({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var m,w,S,B,E,v;let{$state:{blocked:i,completed:s},subtitle:l,title:c}=n,u=(w=(m=n.primaryButton)==null?void 0:m.title)!=null?w:n.primaryButtonTitle,g=(B=(S=n.secondaryButton)==null?void 0:S.title)!=null?B:n.secondaryButtonTitle,h=(E=n.props)!=null?E:{},x=!!(s||i);return jsxRuntime.jsxs(mo,d(a({open:t,onOpenChange:r},h),{children:[jsxRuntime.jsx(fo,{isBlocked:n.$state.blocked,isCompleted:s,title:c}),jsxRuntime.jsxs(uo,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(v=n.videoUri)!=null?v:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:l}),jsxRuntime.jsxs(P.Row,{gap:3,children:[jsxRuntime.jsx(b.Secondary,{disabled:x,title:g,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var Sn={default:ft};function Fn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:u}=so.useContext(mt),{handlePrimary:g,handleSecondary:h}=re(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,m=(S=u[o.type])!=null?S:ft;function w(B){return I(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(m,d(a({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:g,handleSecondary:h}),o.id)}function Ke(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=so.useState(null),h=a(a({},Sn),i);return jsxRuntime.jsx(mt.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:h},children:jsxRuntime.jsx(U,d(a({as:b,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:m}=B,w=f(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,F])=>F.$state.visible===!0).map(([,F])=>jsxRuntime.jsx(Fn,d(a({flow:x,handleDismiss:m},w),{step:F}),F.id)),H=x.getNumberOfCompletedSteps(),W=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:m,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(C.Body2,{fontWeight:"demibold",children:[H,"/",W]}),jsxRuntime.jsx(xe,{current:H,total:W,flexGrow:1})]})]}),v]})}}))})}var En=new Set(["required","min","max","minLength","maxLength","pattern"]);function On({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=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 i=Object.fromEntries(Object.entries(t).filter(([l])=>En.has(l))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function yt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var v,H,W,F,R,k;let{__readOnly:s}=so.useContext(O),l=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=so.useState(!1),g=[],{control:h,handleSubmit:x}=l,m=(v=i.props)!=null?v:{};function w(V,Se){u(!0),t(Se,V,s===!0).then(()=>u(!1));}(H=i.fields)==null||H.forEach(V=>{e[V.type]!=null&&g.push(jsxRuntime.jsx(On,{control:h,fieldComponent:e[V.type],fieldData:V,submit:x(w)},`${i.flow.id}-${V.id}`));});let S=(F=(W=i.primaryButton)==null?void 0:W.title)!=null?F:i.primaryButtonTitle,B=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,E=!!(i.$state.blocked||!l.formState.isValid);return jsxRuntime.jsxs(P.Column,d(a({gap:5,part:"form-step"},m),{children:[jsxRuntime.jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},l),{children:g})),jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(D.Secondary,{disabled:E,onClick:r,title:B}),jsxRuntime.jsx(D.Primary,{disabled:E||c,onClick:x(w),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function xt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function go({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Ee={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ne({children:e,field:o,fieldData:t,fieldState:r}){var u;let{id:n,label:i,placeholder:s}=t,{error:l}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),Ee),{"aria-invalid":!!l,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(go,{id:n,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(xt,{error:l})]})}var Ln=()=>jsxRuntime.jsx(y,{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"})}),An=so__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(C.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Ce__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{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(y,{as:Ce__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",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(Ln,{})})})})]}));function yo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsxRuntime.jsx(An,{value:s,label:i},s));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsx(Ce__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Vn=so__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(N__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(N__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function xo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:l})=>jsxRuntime.jsx(Vn,{value:l,label:s},l));return jsxRuntime.jsx(ne,d(a({},e),{children:()=>jsxRuntime.jsxs(N__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(N__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Body2,d(a({},Ee),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(N__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(N__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(N__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,d(a({},Ee),{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(N__namespace.Viewport,{children:i})}))})]})}))}function bo(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(C.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Tt(e){return jsxRuntime.jsx(ne,d(a({},e),{children:o=>jsxRuntime.jsx(C.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var _n={radio:yo,select:xo,text:bo,textarea:Tt};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let s=Object.assign({},_n,e);return jsxRuntime.jsx(U,d(a({flowId:o,part:["form",t]},r),{children:l=>jsxRuntime.jsx(yt,a({fieldTypes:s},l))}))}var Je={};ee(Je,{NPS:()=>Ge});function Rt({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?D.Primary:D.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(C.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsxRuntime.jsx(C.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ge(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsxRuntime.jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Rt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:d(a({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},n))}function fe(e,{onComplete:o,onDismiss:t}={}){let r=so.useRef(null);return so.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&I(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:so.useCallback(n=>I(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Xe(){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]=so.useState(e),[r,n]=so.useState(null),i=so.useCallback(s=>{n(s);},[]);return so.useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var qn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Et(r){var n=r,{style:e={},part:o=""}=n,t=f(n,["style","part"]);return jsxRuntime.jsxs(y,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${qn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function qe(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Zn(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ye(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let i=Zn(o);return i?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,a({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 le(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Ye:qe,a({src:e},t))}function It({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var Qe={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ht(e,o){var i,s,l,c,u;let t=Object.fromEntries(Qe.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(Qe.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!Qe.content.includes(g)&&!Qe.root.includes(g)&&(n[g]=e[g]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},h=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,m=(c=t.style)!=null?c:{},w=(u=t.side)!=null?u:"bottom",S=t.align;t.style=d(a({},m),{[h(S,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var Mt=react.keyframes`
|
|
77
77
|
from {
|
|
78
78
|
opacity: 0;
|
|
79
79
|
}
|
|
@@ -83,7 +83,7 @@ var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnProp
|
|
|
83
83
|
to {
|
|
84
84
|
opacity: 1;
|
|
85
85
|
}
|
|
86
|
-
`;function Wt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,i=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=Xe(),{node:h,rect:x,ref:m}=Xe(),Ro=Ht(i,u),{contentProps:w,otherProps:Le}=Ro,we=Le,{part:S}=we,B=f(we,["part"]),{rootProps:E}=Ro,[v,H]=io.useState(w.align),[W,F]=io.useState(w.side),[R,k]=io.useState(0),[V,Se]=io.useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");v!==_&&H(_),W!==Q&&F(Q);}let se=io.useRef(null);if(io.useEffect(()=>{let _=document.querySelector(e);_!=null?(m(_),se.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),io.useEffect(()=>{function _(ye){if(ye.matches(e))return Wt(ye)?ye:null;let le=ye.querySelectorAll(e);return le.length>0&&Wt(le[0])?le[0]:null}let Q=new MutationObserver(ye=>{for(let le of ye)if(le.type==="childList"){for(let Te of le.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let pe=_(Te);if(pe!=null){m(pe),se.current=pe,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",pe);break}}for(let Te of le.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let pe=_(Te);if(pe!=null){m(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",pe);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),io.useEffect(()=>{let{scrollX:_,scrollY:Q}=window;k(x.left+_),Se(x.top+Q);},[x.left,x.top]),h==null)return null;let We="0";typeof window!="undefined"&&(We=window.getComputedStyle(h).borderRadius);let Fe=It({props:i,alignAttr:v,sideAttr:W});return jsxRuntime.jsxs(Z__namespace.Root,d(a({defaultOpen:!0},E),{children:[jsxRuntime.jsx(Z__namespace.Anchor,{virtualRef:se}),jsxRuntime.jsx(Z__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(y,a({animation:`${Mt} 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:x.height,left:R,top:V,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Z__namespace.Content,d(a({asChild:!0},w),{ref:g,children:jsxRuntime.jsxs(b,d(a({animation:`${Mt} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:n},B),{children:[jsxRuntime.jsx(Et,{style:Fe}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(Z__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsxRuntime.jsx(fe,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,d(a({part:"title"},o),{children:e}))};function Lt(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=u,l=f(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,H,W,F,R;let{handleDismiss:g}=me(o,{onDismiss:t}),{handlePrimary:h,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),m=(E=s.props)!=null?E:{},w=(H=(v=s.primaryButton)==null?void 0:v.title)!=null?H:s.primaryButtonTitle,S=(F=(W=s.secondaryButton)==null?void 0:W.title)!=null?F:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxRuntime.jsxs($,d(a(a({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},l),m),{onEscapeKeyDown:k=>{typeof r=="function"&&r(k),k.defaultPrevented||g(k);},children:[e&&jsxRuntime.jsx($.Close,{onClick:g}),jsxRuntime.jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:s.title}),jsxRuntime.jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsxRuntime.jsx($.Primary,{disabled:B,onClick:h,title:w})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=io.useContext(O),[i,s]=io.useState(!1);io.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),io.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function l(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:l}}function So(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=io.useState(!1),{flow:u}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:h,unregisterComponent:x}=io.useContext(O);me(u,{onComplete:o});let{isCurrentModal:m,removeModal:w}=Ie(u);if(io.useEffect(()=>{!(u!=null&&u.isVisible)&&m&&w();},[u==null?void 0:u.isVisible,m]),io.useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!m||(h(e,()=>{l||c(!0);}),!g||!l))return null;let S=u.getCurrentStep();return S==null||S.start(),jsxRuntime.jsx(Lt,a({"data-flow-id":u.id,flow:u,part:["tour",r],step:S},n))}function Vt(e){let[o,t]=io.useState(),[r,n]=io.useState(),{flow:i}=ie(r),{frigade:s}=io.useContext(O);return io.useEffect(()=>{I(this,null,function*(){var u;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(u=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:u.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,i==null?void 0:i.isVisible]),{collection:o,currentFlow:i}}function Fo(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,u;let i={ANNOUNCEMENT:wo,BANNER:ao,CARD:b,CHECKLIST:Ue,EMBEDDED_TIP:b,FORM:Oe,NPS_SURVEY:Ge,TOUR:So},{currentFlow:s}=Vt(e),l=(u=i[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?u:null;return s==null||l==null?null:jsxRuntime.jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(l,{flowId:s.id},s.id)}))}function He(){let{frigade:e}=io.useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function zt(){let[e,o]=io.useState(),{frigade:t}=He();return io.useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(Fo,{as:null,collectionId:e})}var O=io.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Ut(){let{frigade:e}=He();return io.useEffect(()=>{I(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function Xt(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?eo(n):{},[u,g]=io.useState(new Set),h=io.useRef(new Map),x=io.useRef(),[m,w]=io.useState(!1),S=io.useMemo(()=>(w(!1),x.current=void 0,g(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);io.useEffect(()=>{if(i.__flowStateOverrides){let F=S.getConfig();F.__flowStateOverrides=i.__flowStateOverrides,S.reload(F);}},[i.__flowStateOverrides]);function B(){let F=[...h.current.entries()].map(([R,k])=>[R,k.callback]);S.batchRegister(F),w(!0);}function E(F,R){if(x.current&&clearTimeout(x.current),m){h.current.has(F)?S.getFlow(F).then(k=>R(k.isVisible)):(S.getFlow(F).then(k=>k.register(R)),h.current.set(F,{callback:R}));return}h.current.has(F)||h.current.set(F,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(F){h.current.has(F)&&S.getFlow(F).then(R=>{h.current.delete(F),R==null||R.unregister();});}let H=r!=null?r:(F,R="_self")=>{window.open(F,R);};io.useEffect(()=>()=>{S.destroy();},[]);let W=u.size>0?u.values().next().value:null;return jsxRuntime.jsxs(O.Provider,{value:d(a({modals:u,setModals:g,currentModal:W,navigate:H},i),{frigade:S,registerComponent:E,unregisterComponent:v,hasInitialized:m}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},oo),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:T,children:[t&&jsxRuntime.jsx(zt,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(Ut,{})]})}function ie(e,o){let[t,r]=io.useState(),[,n]=io.useState(""),{frigade:i}=io.useContext(O),s=io.useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,i]);return io.useEffect(()=>{if(!(!(i!=null&&i.isReady())||e==null))return I(this,null,function*(){let l=yield i.getFlow(e);if(!l||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[e,i,s]),io.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function K(u){var g=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var we,Q;let[h,x]=io.useState(!1),{flow:m}=ie(t,{variables:l}),_=a(a({},(we=m==null?void 0:m.props)!=null?we:{}),c),{dismissible:w=!1,forceMount:S=!1,modal:B=!1}=_,E=f(_,["dismissible","forceMount","modal"]),{hasInitialized:v,registerComponent:H,unregisterComponent:W}=io.useContext(O),F=m==null?void 0:m.getCurrentStep(),{handleDismiss:R}=me(m,{onComplete:r,onDismiss:n}),{handlePrimary:k,handleSecondary:V}=re(F,{onPrimary:i,onSecondary:s}),Se=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((Q=m==null?void 0:m.rawData)==null?void 0:Q.flowType),{isCurrentModal:se,removeModal:We}=Ie(m,Se);io.useEffect(()=>{!(m!=null&&m.isVisible)&&se&&We();},[m==null?void 0:m.isVisible,se]),io.useEffect(()=>()=>{W(t);},[]),io.useEffect(()=>{(m!=null&&m.isCompleted||m!=null&&m.isSkipped)&&W(t);},[m==null?void 0:m.isCompleted,m==null?void 0:m.isSkipped]);let Fe=S&&((m==null?void 0:m.isCompleted)||(m==null?void 0:m.isSkipped));if(!m||!Fe&&!se||(H(t,()=>{h||x(!0);}),!m.isVisible&&!Fe)||!v||!h)return null;(Fe||!m.isCompleted&&!m.isSkipped)&&F.start();let Ro=e===null?io.Fragment:e!=null?e:y,Le=d(a({},E),{"data-flow-id":m.id});return jsxRuntime.jsx(Ro,d(a({},e===null?{}:Le),{children:o({flow:m,handleDismiss:R,handlePrimary:k,handleSecondary:V,parentProps:{dismissible:w,flowId:t,variables:l,containerProps:Le},step:F})}))}function er(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsxRuntime.jsx(K,d(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:c})=>{var h,x,m,w;let u=(x=(h=c.primaryButton)==null?void 0:h.title)!=null?x:c.primaryButtonTitle,g=(w=(m=c.secondaryButton)==null?void 0:m.title)!=null?w:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:g,onClick:s}),jsxRuntime.jsx(b.Primary,{title:u,onClick:i})]})]})}}))}var b=io__namespace.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=f(i,["children","flowId"]);var l;if(o!=null)return jsxRuntime.jsx(er,a({flowId:o},t));let s=(l=t.as)!=null?l:P.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(D.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));b.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{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:t})]}))};b.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(fe,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,d(a({display:"block",part:"title"},o),{children:e}))};var Qe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function tr(e){let o=Object.fromEntries(Qe.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Qe.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Qe.content.some(i=>i===n)&&!Qe.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Ii=react.keyframes`
|
|
86
|
+
`;function Wt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,i=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=Xe(),{node:h,rect:x,ref:m}=Xe(),Ro=Ht(i,u),{contentProps:w,otherProps:Le}=Ro,we=Le,{part:S}=we,B=f(we,["part"]),{rootProps:E}=Ro,[v,H]=so.useState(w.align),[W,F]=so.useState(w.side),[R,k]=so.useState(0),[V,Se]=so.useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");v!==_&&H(_),W!==Q&&F(Q);}let se=so.useRef(null);if(so.useEffect(()=>{let _=document.querySelector(e);_!=null?(m(_),se.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),so.useEffect(()=>{function _(ye){if(ye.matches(e))return Wt(ye)?ye:null;let pe=ye.querySelectorAll(e);return pe.length>0&&Wt(pe[0])?pe[0]:null}let Q=new MutationObserver(ye=>{for(let pe of ye)if(pe.type==="childList"){for(let Te of pe.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){m(de),se.current=de,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",de);break}}for(let Te of pe.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){m(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",de);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),so.useEffect(()=>{let{scrollX:_,scrollY:Q}=window;k(x.left+_),Se(x.top+Q);},[x.left,x.top]),h==null)return null;let We="0";typeof window!="undefined"&&(We=window.getComputedStyle(h).borderRadius);let Fe=It({props:i,alignAttr:v,sideAttr:W});return jsxRuntime.jsxs(Z__namespace.Root,d(a({defaultOpen:!0},E),{children:[jsxRuntime.jsx(Z__namespace.Anchor,{virtualRef:se}),jsxRuntime.jsx(Z__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(y,a({animation:`${Mt} 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:x.height,left:R,top:V,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Z__namespace.Content,d(a({asChild:!0},w),{ref:g,children:jsxRuntime.jsxs(b,d(a({animation:`${Mt} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:n},B),{children:[jsxRuntime.jsx(Et,{style:Fe}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(Z__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsxRuntime.jsx(le,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,d(a({part:"title"},o),{children:e}))};function Lt(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=u,l=f(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,H,W,F,R;let{handleDismiss:g}=fe(o,{onDismiss:t}),{handlePrimary:h,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),m=(E=s.props)!=null?E:{},w=(H=(v=s.primaryButton)==null?void 0:v.title)!=null?H:s.primaryButtonTitle,S=(F=(W=s.secondaryButton)==null?void 0:W.title)!=null?F:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxRuntime.jsxs($,d(a(a({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},l),m),{onEscapeKeyDown:k=>{typeof r=="function"&&r(k),k.defaultPrevented||g(k);},children:[e&&jsxRuntime.jsx($.Close,{onClick:g}),jsxRuntime.jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:s.title}),jsxRuntime.jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsxRuntime.jsx($.Primary,{disabled:B,onClick:h,title:w})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=so.useContext(O),[i,s]=so.useState(!1);so.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),so.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function l(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:l}}function So(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=so.useState(!1),{flow:u}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:h,unregisterComponent:x}=so.useContext(O);fe(u,{onComplete:o});let{isCurrentModal:m,removeModal:w}=Ie(u);if(so.useEffect(()=>{!(u!=null&&u.isVisible)&&m&&w();},[u==null?void 0:u.isVisible,m]),so.useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!m||(h(e,()=>{l||c(!0);}),!g||!l))return null;let S=u.getCurrentStep();return S==null||S.start(),jsxRuntime.jsx(Lt,a({"data-flow-id":u.id,flow:u,part:["tour",r],step:S},n))}function Vt(e){let[o,t]=so.useState(),[r,n]=so.useState(),{flow:i}=ie(r),{frigade:s}=so.useContext(O);return so.useEffect(()=>{I(this,null,function*(){var u;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(u=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:u.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,i==null?void 0:i.isVisible]),{collection:o,currentFlow:i}}function Fo(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,u;let i={ANNOUNCEMENT:wo,BANNER:lo,CARD:b,CHECKLIST:Ke,EMBEDDED_TIP:b,FORM:Oe,NPS_SURVEY:Ge,TOUR:So},{currentFlow:s}=Vt(e),l=(u=i[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?u:null;return s==null||l==null?null:jsxRuntime.jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(l,{flowId:s.id},s.id)}))}function He(){let{frigade:e}=so.useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function zt(){let[e,o]=so.useState(),{frigade:t}=He();return so.useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(Fo,{as:null,collectionId:e})}var O=so.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Kt(){let{frigade:e}=He();return so.useEffect(()=>{I(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function Xt(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?to(n):{},[u,g]=so.useState(new Set),h=so.useRef(new Map),x=so.useRef(),[m,w]=so.useState(!1),S=so.useMemo(()=>(w(!1),x.current=void 0,g(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);so.useEffect(()=>{if(i.__flowStateOverrides){let F=S.getConfig();F.__flowStateOverrides=i.__flowStateOverrides,S.reload(F);}},[i.__flowStateOverrides]);function B(){let F=[...h.current.entries()].map(([R,k])=>[R,k.callback]);S.batchRegister(F),w(!0);}function E(F,R){if(x.current&&clearTimeout(x.current),m){h.current.has(F)?S.getFlow(F).then(k=>R(k.isVisible)):(S.getFlow(F).then(k=>k.register(R)),h.current.set(F,{callback:R}));return}h.current.has(F)||h.current.set(F,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(F){h.current.has(F)&&S.getFlow(F).then(R=>{h.current.delete(F),R==null||R.unregister();});}let H=r!=null?r:(F,R="_self")=>{window.open(F,R);};so.useEffect(()=>()=>{S.destroy();},[]);let W=u.size>0?u.values().next().value:null;return jsxRuntime.jsxs(O.Provider,{value:d(a({modals:u,setModals:g,currentModal:W,navigate:H},i),{frigade:S,registerComponent:E,unregisterComponent:v,hasInitialized:m}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},ro),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:T,children:[t&&jsxRuntime.jsx(zt,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(Kt,{})]})}function ie(e,o){let[t,r]=so.useState(),[,n]=so.useState(""),{frigade:i}=so.useContext(O),s=so.useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,i]);return so.useEffect(()=>{if(!(!(i!=null&&i.isReady())||e==null))return I(this,null,function*(){let l=yield i.getFlow(e);if(!l||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[e,i,s]),so.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function U(u){var g=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var we,Q;let[h,x]=so.useState(!1),{flow:m}=ie(t,{variables:l}),_=a(a({},(we=m==null?void 0:m.props)!=null?we:{}),c),{dismissible:w=!1,forceMount:S=!1,modal:B=!1}=_,E=f(_,["dismissible","forceMount","modal"]),{hasInitialized:v,registerComponent:H,unregisterComponent:W}=so.useContext(O),F=m==null?void 0:m.getCurrentStep(),{handleDismiss:R}=fe(m,{onComplete:r,onDismiss:n}),{handlePrimary:k,handleSecondary:V}=re(F,{onPrimary:i,onSecondary:s}),Se=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((Q=m==null?void 0:m.rawData)==null?void 0:Q.flowType),{isCurrentModal:se,removeModal:We}=Ie(m,Se);so.useEffect(()=>{!(m!=null&&m.isVisible)&&se&&We();},[m==null?void 0:m.isVisible,se]),so.useEffect(()=>()=>{W(t);},[]),so.useEffect(()=>{(m!=null&&m.isCompleted||m!=null&&m.isSkipped)&&W(t);},[m==null?void 0:m.isCompleted,m==null?void 0:m.isSkipped]);let Fe=S&&((m==null?void 0:m.isCompleted)||(m==null?void 0:m.isSkipped));if(!m||!Fe&&!se||(H(t,()=>{h||x(!0);}),!m.isVisible&&!Fe)||!v||!h)return null;(Fe||!m.isCompleted&&!m.isSkipped)&&F.start();let Ro=e===null?so.Fragment:e!=null?e:y,Le=d(a({},E),{"data-flow-id":m.id});return jsxRuntime.jsx(Ro,d(a({},e===null?{}:Le),{children:o({flow:m,handleDismiss:R,handlePrimary:k,handleSecondary:V,parentProps:{dismissible:w,flowId:t,variables:l,containerProps:Le},step:F})}))}function er(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsxRuntime.jsx(U,d(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:c})=>{var h,x,m,w;let u=(x=(h=c.primaryButton)==null?void 0:h.title)!=null?x:c.primaryButtonTitle,g=(w=(m=c.secondaryButton)==null?void 0:m.title)!=null?w:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:g,onClick:s}),jsxRuntime.jsx(b.Primary,{title:u,onClick:i})]})]})}}))}var b=so__namespace.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=f(i,["children","flowId"]);var l;if(o!=null)return jsxRuntime.jsx(er,a({flowId:o},t));let s=(l=t.as)!=null?l:P.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(D.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));b.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{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:t})]}))};b.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(le,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,d(a({display:"block",part:"title"},o),{children:e}))};var eo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function tr(e){let o=Object.fromEntries(eo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(eo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!eo.content.some(i=>i===n)&&!eo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Ii=react.keyframes`
|
|
87
87
|
from {
|
|
88
88
|
opacity: 0;
|
|
89
89
|
}
|
|
@@ -93,36 +93,39 @@ var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnProp
|
|
|
93
93
|
to {
|
|
94
94
|
opacity: 1;
|
|
95
95
|
}
|
|
96
|
-
`;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:g}=tr(r),h=g,{zIndex:c}=h,u=f(h,["zIndex"]);return jsxRuntime.jsx(
|
|
96
|
+
`;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:g}=tr(r),h=g,{zIndex:c}=h,u=f(h,["zIndex"]);return jsxRuntime.jsx(K__namespace.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(K__namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${Ii} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(K__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(K__namespace.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},l),{children:jsxRuntime.jsx(b,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}M.Dismiss=e=>jsxRuntime.jsx(K__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(K__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(C.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsxRuntime.jsx(le,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?T.colors.blue500:T.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsxRuntime.jsx(K__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(C.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var rr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function wo(r){var n=r,{flowId:e,part:o}=n,t=f(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([l])=>rr.some(c=>l===c))),s=Object.fromEntries(Object.entries(t).filter(([l])=>rr.indexOf(l)===-1));return jsxRuntime.jsx(U,d(a({as:null,flowId:e},i),{children:({flow:l,handleDismiss:c,handlePrimary:u,handleSecondary:g,parentProps:{containerProps:h,dismissible:x},step:m})=>{var v,H,W,F,R,k;let w=(v=m.props)!=null?v:{},S=(W=(H=m.primaryButton)==null?void 0:H.title)!=null?W:m.primaryButtonTitle,B=(R=(F=m.secondaryButton)==null?void 0:F.title)!=null?R:m.secondaryButtonTitle,E=!!m.$state.blocked;return jsxRuntime.jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},h),s),{onEscapeKeyDown:V=>{if(t.dismissible===!1){V.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(V),V.defaultPrevented||c(V);},children:jsxRuntime.jsxs(P.Column,d(a({gap:5,part:"announcement-step"},w),{children:[x&&jsxRuntime.jsx(M.Dismiss,{onClick:c}),jsxRuntime.jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(M.Title,{children:m.title}),jsxRuntime.jsx(M.Subtitle,{children:m.subtitle})]}),jsxRuntime.jsx(M.Media,{src:(k=m.videoUri)!=null?k:m.imageUri,type:m.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(M.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx(M.Secondary,{disabled:E,onClick:g,title:B}),S&&jsxRuntime.jsx(M.Primary,{disabled:E,onClick:u,title:S})]})]}))}))}}))}function Wi(){let{userId:e,frigade:o}=so.useContext(O);function t(n){return I(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return I(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function Ai(){var n;let{frigade:e}=so.useContext(O);function o(i){return I(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,i);})}function t(i,s){return I(this,null,function*(){yield e.track(i,s);})}function r(i,s){return I(this,null,function*(){yield e.group(i,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
|
|
97
97
|
|
|
98
98
|
exports.FrigadeJS = js__namespace;
|
|
99
99
|
exports.Announcement = wo;
|
|
100
|
-
exports.Banner =
|
|
100
|
+
exports.Banner = lo;
|
|
101
101
|
exports.BaseField = ne;
|
|
102
102
|
exports.Box = y;
|
|
103
103
|
exports.Button = D;
|
|
104
104
|
exports.Card = b;
|
|
105
|
-
exports.Checklist =
|
|
105
|
+
exports.Checklist = Ue;
|
|
106
106
|
exports.Collection = Fo;
|
|
107
107
|
exports.Dialog = M;
|
|
108
108
|
exports.Flex = P;
|
|
109
|
-
exports.Flow =
|
|
109
|
+
exports.Flow = U;
|
|
110
110
|
exports.Form = Oe;
|
|
111
|
-
exports.
|
|
111
|
+
exports.Image = qe;
|
|
112
|
+
exports.Label = go;
|
|
113
|
+
exports.Media = le;
|
|
112
114
|
exports.Progress = Re;
|
|
113
115
|
exports.Provider = Xt;
|
|
114
|
-
exports.RadioField =
|
|
115
|
-
exports.SelectField =
|
|
116
|
+
exports.RadioField = yo;
|
|
117
|
+
exports.SelectField = xo;
|
|
116
118
|
exports.Survey = Je;
|
|
117
119
|
exports.Text = C;
|
|
118
|
-
exports.TextField =
|
|
120
|
+
exports.TextField = bo;
|
|
119
121
|
exports.Tooltip = $;
|
|
120
122
|
exports.Tour = So;
|
|
121
|
-
exports.
|
|
123
|
+
exports.Video = Ye;
|
|
124
|
+
exports.themeVariables = ro;
|
|
122
125
|
exports.tokens = Ne;
|
|
123
126
|
exports.useBoundingClientRect = Xe;
|
|
124
127
|
exports.useFlow = ie;
|
|
125
|
-
exports.useFlowHandlers =
|
|
128
|
+
exports.useFlowHandlers = fe;
|
|
126
129
|
exports.useFrigade = He;
|
|
127
130
|
exports.useGroup = Ai;
|
|
128
131
|
exports.useModal = Ie;
|