@frigade/react 2.1.18 → 2.1.20
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 +37 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +210 -23
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('@emotion/react');
|
|
4
|
-
var
|
|
4
|
+
var _ = require('@radix-ui/react-dialog');
|
|
5
5
|
var solid = require('@heroicons/react/24/solid');
|
|
6
6
|
var je = require('react');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var Vt = require('known-css-properties');
|
|
9
|
+
var Xt = require('dompurify');
|
|
10
10
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
11
11
|
var js = require('@frigade/js');
|
|
12
12
|
var outline = require('@heroicons/react/24/outline');
|
|
13
|
-
var
|
|
13
|
+
var fe = require('@radix-ui/react-collapsible');
|
|
14
14
|
var reactHookForm = require('react-hook-form');
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
15
|
+
var ge = require('@radix-ui/react-radio-group');
|
|
16
|
+
var V = require('@radix-ui/react-select');
|
|
17
|
+
var q = require('@radix-ui/react-popover');
|
|
18
18
|
|
|
19
19
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
|
|
@@ -36,17 +36,17 @@ function _interopNamespace(e) {
|
|
|
36
36
|
return Object.freeze(n);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var ___namespace = /*#__PURE__*/_interopNamespace(_);
|
|
40
40
|
var je__namespace = /*#__PURE__*/_interopNamespace(je);
|
|
41
|
-
var
|
|
42
|
-
var
|
|
41
|
+
var Vt__default = /*#__PURE__*/_interopDefault(Vt);
|
|
42
|
+
var Xt__default = /*#__PURE__*/_interopDefault(Xt);
|
|
43
43
|
var js__namespace = /*#__PURE__*/_interopNamespace(js);
|
|
44
|
-
var me__namespace = /*#__PURE__*/_interopNamespace(me);
|
|
45
44
|
var fe__namespace = /*#__PURE__*/_interopNamespace(fe);
|
|
46
|
-
var
|
|
47
|
-
var
|
|
45
|
+
var ge__namespace = /*#__PURE__*/_interopNamespace(ge);
|
|
46
|
+
var V__namespace = /*#__PURE__*/_interopNamespace(V);
|
|
47
|
+
var q__namespace = /*#__PURE__*/_interopNamespace(q);
|
|
48
48
|
|
|
49
|
-
var ao=Object.defineProperty,Dt=Object.defineProperties;var Et=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable;var io=(e,o,t)=>o in e?ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))so.call(o,t)&&io(e,t,o[t]);if(ve)for(var t of ve(o))lo.call(o,t)&&io(e,t,o[t]);return e},p=(e,o)=>Dt(e,Et(o));var Ot=(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 u=(e,o)=>{var t={};for(var r in e)so.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&ve)for(var r of ve(e))o.indexOf(r)<0&&lo.call(e,r)&&(t[r]=e[r]);return t};var q=(e,o)=>{for(var t in o)ao(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{d(t.next(c));}catch(m){n(m);}},s=c=>{try{d(t.throw(c));}catch(m){n(m);}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var po={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Be=[5,10,20,35,50,65,80,95,98],co=[...Be],$e=[...Be];co[4]=40;$e[4]=60;var It={blue:{h:213,s:100,l:Be},gray:{h:220,s:10,l:Be},green:{h:141,s:90,l:co},red:{h:9,s:90,l:$e},yellow:{h:50,s:90,l:$e}};var H={};for(let[e,{h:o,s:t,l:r}]of Object.entries(It))H[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var uo=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},H),{gray100:H.gray[100],gray200:H.gray[200],gray300:H.gray[300],gray400:H.gray[400],gray500:H.gray[500],gray600:H.gray[600],gray700:H.gray[700],gray800:H.gray[800],gray900:H.gray[900],blue400:H.blue[400],blue500:H.blue[500],blue800:H.blue[800],blue900:H.blue[900],green400:H.blue[400],green500:H.green[500],green800:H.green[800],red500:H.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var mo={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,fo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var go={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ht="px",Mt=e=>typeof e=="number"?`${4*e}${Ht}`:e,Wt=[-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"],yo=Object.fromEntries(Wt.map(e=>[e,Mt(e)]));var xo={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 Re=p(i(p(i({},po),{colors:i(i({},uo),fo)}),xo),{radii:mo,shadows:go,space:yo});function be(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,be(d,s,t)):r[s]=d,r},{})}function Ve(e){return be(e,"--fr","-")}function ho(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=ho(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var _e=Ve(Re),w=ho(Re);var Lt=new Set(["alt","size","src"]),$t=At__default.default.all.filter(e=>e.indexOf("-")!=0&&!Lt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Vt=Object.fromEntries($t),ze=be(w.colors),_t={color:ze,backgroundColor:ze,borderColor:ze,border:w.borders,borderRadius:w.radii,borderWidth:w.borderWidths,boxShadow:w.shadows,fontFamily:w.fontFamilies,fontSize:w.fontSizes,fontWeight:w.fontWeights,gap:w.space,lineHeight:w.lineHeights,margin:w.space,marginBottom:w.space,marginLeft:w.space,marginRight:w.space,marginTop:w.space,padding:w.space,paddingBottom:w.space,paddingLeft:w.space,paddingRight:w.space,paddingTop:w.space},bo=i(i({},Vt),_t),Po={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"]},Co=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function zt(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 So=new Map(Object.entries(bo).map(([e,o])=>[e,zt(o)])),Nt=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),Kt=new Set(["height","width"]),jt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Fo(e){let[o,t]=e.split(":");return [o,Co.has(t)?t:null]}function To(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[d]==null&&(r[d]={}),r[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=Nt.get(d);m!=null&&(m.forEach(f=>{let g=`${f}${c?":"+c:""}`;t[g]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=So.get(d);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(c)[d]=f.map(g=>{var h;return (h=m.get(g.toString()))!=null?h:g}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!jt.has(o)||!Kt.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&So.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Gt(){if(typeof window=="undefined"){let{JSDOM:e}=Ot("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:Ut__default.default(Gt()).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 Xt(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):Xt(e))}function qt(d,s){var c=d,{as:e,children:o,className:t,css:r={},part:n}=c,a=u(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:f,unmatchedProps:g}=To(a,m),h=Ro(n),b=t||h?clsx.clsx(t,h):void 0,S=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsxRuntime.jsx(m,p(i({className:b,css:S},g),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsxRuntime.jsx(m,p(i({className:b,css:S},g),{ref:s,children:o}))}var y=je__namespace.forwardRef(qt);var k={};q(k,{Link:()=>Fr,Plain:()=>Tr,Primary:()=>Cr,Secondary:()=>Sr});var F={};q(F,{Body1:()=>mr,Body2:()=>fr,Caption:()=>gr,Display1:()=>sr,Display2:()=>lr,H1:()=>pr,H2:()=>dr,H3:()=>cr,H4:()=>ur});var Ne={};q(Ne,{Body1:()=>rr,Body2:()=>nr,Caption:()=>ir,Display1:()=>Yt,Display2:()=>Qt,H1:()=>Zt,H2:()=>er,H3:()=>or,H4:()=>tr});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Yt=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Qt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Zt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),er=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),or=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),tr=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),rr=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),nr=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),ir=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var ar=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(ar.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=je__namespace.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsxRuntime.jsx(y,p(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),sr=Q.Display1,lr=Q.Display2,pr=Q.H1,dr=Q.H2,cr=Q.H3,ur=Q.H4,mr=Q.Body1,fr=Q.Body2,gr=Q.Caption;var Ke={};q(Ke,{Link:()=>br,Plain:()=>Pr,Primary:()=>xr,Secondary:()=>hr});var ke={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},xr=p(i({},ke),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),hr=p(i({},ke),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),br=p(i({},ke),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Pr=p(i({},ke),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function De(s){var d=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=d,a=u(d,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(y,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function Cr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(De,p(i({},o),{variant:"Primary",children:e}))}function Sr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(De,p(i({},o),{variant:"Secondary",children:e}))}function Fr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(De,p(i({},o),{variant:"Link",children:e}))}function Tr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(De,p(i({},o),{variant:"Plain",children:e}))}var C={};q(C,{Column:()=>Br,Row:()=>vr});var vr=je__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Br=je__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var D=je.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Mo(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?Ve(t):{},[d,c]=je.useState(new Set),m=je.useRef(new Map),f=je.useRef(),[g,h]=je.useState(!1),b=je.useMemo(()=>new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowStateOverrides:r.__flowStateOverrides}),[r.userId,r.groupId,r.apiKey]);je.useEffect(()=>{if(r.__flowStateOverrides){let T=b.getConfig();T.__flowStateOverrides=r.__flowStateOverrides,b.reload(T);}},[r.__flowStateOverrides]);function S(){let T=[...m.current.entries()].map(([v,W])=>[v,W.callback]);b.batchRegister(T),h(!0);}function x(T,v){if(f.current&&clearTimeout(f.current),g){m.current.has(T)||(b.getFlow(T).then(W=>W.register(v)),m.current.set(T,{callback:v}));return}m.current.has(T)||m.current.set(T,{callback:v}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>S(),0);}function B(T){m.current.has(T)&&b.getFlow(T).then(v=>{m.current.delete(T),v.unregister();});}let R=o!=null?o:(T,v="_self")=>{window.open(T,v);};je.useEffect(()=>()=>{b.destroy();},[]);let I=d.size>0?d.values().next().value:null;return jsxRuntime.jsxs(D.Provider,{value:p(i({modals:d,setModals:c,currentModal:I,navigate:R},r),{frigade:b,registerComponent:x,unregisterComponent:B,hasInitialized:g}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},_e),s)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:w,children:e})]})}function re(e,o){let[t,r]=je.useState(),[,n]=je.useState(""),{frigade:a}=je.useContext(D),s=je.useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),r(d),n(Math.random().toString()));},[o==null?void 0:o.variables]);return je.useEffect(()=>(A(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),r(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),je.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function ne(e,{onComplete:o,onDismiss:t}={}){let r=je.useRef(null);return je.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&A(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:je.useCallback(n=>A(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=je.useContext(D),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:je.useCallback((a,s,d=!0)=>A(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&e.complete(s,d),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s,d),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:je.useCallback((a,s)=>A(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.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 Ce(e,o=!0){let{currentModal:t,modals:r,setModals:n}=je.useContext(D),[a,s]=je.useState(!1);je.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]),je.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function d(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:a||!o,removeModal:d}}function U(g){var h=g,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=h,f=u(h,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[b,S]=je.useState(!1),{flow:x}=re(r,{variables:c}),{hasInitialized:B,registerComponent:R,unregisterComponent:I}=je.useContext(D),T=x==null?void 0:x.getCurrentStep(),{handleDismiss:v}=ne(x,{onComplete:n,onDismiss:a}),{handlePrimary:W,handleSecondary:E}=ie(T,{onPrimary:s,onSecondary:d}),ge=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:ye,removeModal:de}=Ce(x,ge);je.useEffect(()=>{!(x!=null&&x.isVisible)&&ye&&de();},[x==null?void 0:x.isVisible,ye]),je.useEffect(()=>()=>{I(r);},[]);let ce=m&&((x==null?void 0:x.isCompleted)||(x==null?void 0:x.isSkipped));if(!x||!ce&&!ye||(R(r,()=>{b||S(!0);}),!x.isVisible&&!ce)||!B||!b)return null;(ce||!x.isCompleted&&!x.isSkipped)&&T.start();let Le=e===null?je.Fragment:e!=null?e:y;return jsxRuntime.jsx(Le,p(i({},e===null?{}:f),{children:o({flow:x,handleDismiss:v,handlePrimary:W,handleSecondary:E,parentProps:i({dismissible:t,flowId:r,variables:c},f),step:T})}))}function zo(e){return jsxRuntime.jsx(U,p(i({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a})=>{var c,m,f,g;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(g=(f=a.secondaryButton)==null?void 0:f.title)!=null?g:a.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(P.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(P.Secondary,{title:d,onClick:r}),jsxRuntime.jsx(P.Primary,{title:s,onClick:t})]})]})}}))}function Ue(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsxRuntime.jsx(y,i({as:"img",part:["image",e],src:o},t))}function Jr(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 Ge(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);let a=Jr(o);return a?jsxRuntime.jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Ge:Ue,i({src:e},t))}var P=je__namespace.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsxRuntime.jsx(zo,i({flowId:o},t));let s=(d=t.as)!=null?d:C.Column;return jsxRuntime.jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});P.Dismiss=e=>jsxRuntime.jsx(k.Plain,p(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}));P.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=u(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(C.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsxRuntime.jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(P.Subtitle,{color:"gray500",flexBasis:"100%",children:t})]}))};P.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ae,i({borderRadius:"md",src:e},o))};P.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(k.Primary,i({title:o,onClick:e},t))};P.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(k.Secondary,i({title:o,onClick:e},t))};P.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,p(i({display:"block",part:"subtitle"},o),{children:e}))};P.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,p(i({display:"block",part:"title"},o),{children:e}))};var Ee={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function jo(e){let o=Object.fromEntries(Ee.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Ee.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Ee.content.some(a=>a===n)&&!Ee.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var en=react.keyframes`
|
|
49
|
+
var lo=Object.defineProperty,It=Object.defineProperties;var Ht=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var po=Object.prototype.hasOwnProperty,co=Object.prototype.propertyIsEnumerable;var so=(e,o,t)=>o in e?lo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))po.call(o,t)&&so(e,t,o[t]);if(ve)for(var t of ve(o))co.call(o,t)&&so(e,t,o[t]);return e},p=(e,o)=>It(e,Ht(o));var Mt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var m=(e,o)=>{var t={};for(var n in e)po.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ve)for(var n of ve(e))o.indexOf(n)<0&&co.call(e,n)&&(t[n]=e[n]);return t};var Y=(e,o)=>{for(var t in o)lo(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{d(t.next(c));}catch(u){r(u);}},s=c=>{try{d(t.throw(c));}catch(u){r(u);}},d=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var uo={borderWidths:{md:"1px"}};var Be=[5,10,20,35,50,65,80,95,98],mo=[...Be],Ve=[...Be];mo[4]=40;Ve[4]=60;var Wt={blue:{h:213,s:100,l:Be},gray:{h:220,s:10,l:Be},green:{h:141,s:90,l:mo},red:{h:9,s:90,l:Ve},yellow:{h:50,s:90,l:Ve}};var M={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Wt))M[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var fo=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},M),{gray100:M.gray[100],gray200:M.gray[200],gray300:M.gray[300],gray400:M.gray[400],gray500:M.gray[500],gray600:M.gray[600],gray700:M.gray[700],gray800:M.gray[800],gray900:M.gray[900],blue400:M.blue[400],blue500:M.blue[500],blue800:M.blue[800],blue900:M.blue[900],green400:M.blue[400],green500:M.green[500],green800:M.green[800],red500:M.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var go={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,yo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var xo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var At="px",$t=e=>typeof e=="number"?`${4*e}${At}`:e,Lt=[-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"],bo=Object.fromEntries(Lt.map(e=>[e,$t(e)]));var ho={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 Re=p(i(p(i({},uo),{colors:i(i({},fo),yo)}),ho),{radii:go,shadows:xo,space:bo});function be(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,d=e[r];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(n,be(d,s,t)):n[s]=d,n},{})}function _e(e){let o=be(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function Po(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=Po(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var ze=_e(Re),w=Po(Re);var _t=new Set(["alt","size","src"]),zt=Vt__default.default.all.filter(e=>e.indexOf("-")!=0&&!_t.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Nt=Object.fromEntries(zt),ke=be(w.colors),Kt={color:ke,backgroundColor:ke,borderColor:ke,border:i(i({},w.borderWidths),ke),borderRadius:w.radii,borderWidth:w.borderWidths,boxShadow:w.shadows,fontFamily:w.fontFamilies,fontSize:w.fontSizes,fontWeight:w.fontWeights,gap:w.space,lineHeight:w.lineHeights,margin:w.space,marginBottom:w.space,marginLeft:w.space,marginRight:w.space,marginTop:w.space,padding:w.space,paddingBottom:w.space,paddingLeft:w.space,paddingRight:w.space,paddingTop:w.space},Co=i(i({},Nt),Kt),So={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"]},Fo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function jt(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 To=new Map(Object.entries(Co).map(([e,o])=>[e,jt(o)])),Ut=new Map(Object.entries(So).map(([e,o])=>[e,new Set(o)])),Gt=new Set(["height","width"]),Jt=new Set(["canvas","embed","iframe","img","input","object","video"]);function wo(e){let[o,t]=e.split(":");return [o,Fo.has(t)?t:null]}function vo(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[d]==null&&(n[d]={}),n[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=wo(a),u=Ut.get(d);u!=null&&(u.forEach(g=>{let h=`${g}${c?":"+c:""}`;t[h]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=wo(a),u=To.get(d);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");r(c)[d]=g.map(h=>{var f;return (f=u.get(h.toString()))!=null?f:h}).join(" ");}else u.has(s.toString())?r(c)[d]=u.get(s.toString()):r(c)[d]=s;(typeof o!="string"||!Jt.has(o)||!Gt.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&To.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function qt(){if(typeof window=="undefined"){let{JSDOM:e}=Mt("jsdom");return new e("<!DOCTYPE html>").window}return window}function Bo(e){return e?{__html:Xt__default.default(qt()).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 Qt(e){return e&&`fr-${e}`}function Do(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Do(o)).join(" "):Qt(e))}function Zt(d,s){var c=d,{as:e,children:o,className:t,css:n={},part:r}=c,a=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:h}=vo(a,u),f=Do(r),C=t||f?clsx.clsx(t,f):void 0,b=[{boxSizing:"border-box"},g,n];return typeof o=="string"?jsxRuntime.jsx(u,p(i({className:C,css:b},h),{ref:s,dangerouslySetInnerHTML:Bo(o)})):jsxRuntime.jsx(u,p(i({className:C,css:b},h),{ref:s,children:o}))}var y=je__namespace.forwardRef(Zt);var O={};Y(O,{Link:()=>vr,Plain:()=>Br,Primary:()=>Tr,Secondary:()=>wr});var F={};Y(F,{Body1:()=>yr,Body2:()=>xr,Caption:()=>br,Display1:()=>dr,Display2:()=>cr,H1:()=>ur,H2:()=>mr,H3:()=>fr,H4:()=>gr});var Ne={};Y(Ne,{Body1:()=>ar,Body2:()=>sr,Caption:()=>lr,Display1:()=>er,Display2:()=>or,H1:()=>tr,H2:()=>rr,H3:()=>nr,H4:()=>ir});var Q={color:"neutral.foreground",fontFamily:"default",margin:"0"},er=p(i({},Q),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),or=p(i({},Q),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),tr=p(i({},Q),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),rr=p(i({},Q),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),nr=p(i({},Q),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),ir=p(i({},Q),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),ar=p(i({},Q),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),sr=p(i({},Q),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),lr=p(i({},Q),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var pr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Z=Object.fromEntries(pr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=je__namespace.forwardRef((d,s)=>{var c=d,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsxRuntime.jsx(y,p(i(i({as:n},Ne[e]),a),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),dr=Z.Display1,cr=Z.Display2,ur=Z.H1,mr=Z.H2,fr=Z.H3,gr=Z.H4,yr=Z.Body1,xr=Z.Body2,br=Z.Caption;var Ke={};Y(Ke,{Link:()=>Sr,Plain:()=>Fr,Primary:()=>Pr,Secondary:()=>Cr});var De={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},Pr=p(i({},De),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),Cr=p(i({},De),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),Sr=p(i({},De),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Fr=p(i({},De),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function Oe(s){var d=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=d,a=m(d,["as","children","part","title","variant"]);let c=r.toLocaleLowerCase();return jsxRuntime.jsxs(y,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[r]),a),{children:[o,n&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:n})]}))}function Tr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Oe,p(i({},o),{variant:"Primary",children:e}))}function wr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Oe,p(i({},o),{variant:"Secondary",children:e}))}function vr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Oe,p(i({},o),{variant:"Link",children:e}))}function Br(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Oe,p(i({},o),{variant:"Plain",children:e}))}var S={};Y(S,{Column:()=>Dr,Row:()=>kr});var kr=je__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Dr=je__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var E=je.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Ao(a){var s=a,{children:e,css:o={},navigate:t,theme:n}=s,r=m(s,["children","css","navigate","theme"]);let d=n?_e(n):{},[c,u]=je.useState(new Set),g=je.useRef(new Map),h=je.useRef(),[f,C]=je.useState(!1),b=je.useMemo(()=>new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowStateOverrides:r.__flowStateOverrides}),[r.userId,r.groupId,r.apiKey]);je.useEffect(()=>{if(r.__flowStateOverrides){let T=b.getConfig();T.__flowStateOverrides=r.__flowStateOverrides,b.reload(T);}},[r.__flowStateOverrides]);function x(){let T=[...g.current.entries()].map(([B,L])=>[B,L.callback]);b.batchRegister(T),C(!0);}function v(T,B){if(h.current&&clearTimeout(h.current),f){g.current.has(T)||(b.getFlow(T).then(L=>L.register(B)),g.current.set(T,{callback:B}));return}g.current.has(T)||g.current.set(T,{callback:B}),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>x(),0);}function k(T){g.current.has(T)&&b.getFlow(T).then(B=>{g.current.delete(T),B.unregister();});}let R=t!=null?t:(T,B="_self")=>{window.open(T,B);};je.useEffect(()=>()=>{b.destroy();},[]);let H=c.size>0?c.values().next().value:null;return jsxRuntime.jsxs(E.Provider,{value:p(i({modals:c,setModals:u,currentModal:H,navigate:R},r),{frigade:b,registerComponent:v,unregisterComponent:k,hasInitialized:f}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i(i({},ze),d),o)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:w,children:e})]})}function ae(e,o){let[t,n]=je.useState(),[,r]=je.useState(""),{frigade:a}=je.useContext(E),s=je.useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),setTimeout(()=>{n(d),r(Math.random().toString());},0));},[o==null?void 0:o.variables]);return je.useEffect(()=>(A(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),n(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),je.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function se(e,{onComplete:o,onDismiss:t}={}){let n=je.useRef(null);return je.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&A(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:je.useCallback(r=>A(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function le(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=je.useContext(E),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:je.useCallback((a,s,d=!0)=>A(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&e.complete(s,d),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s,d),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:je.useCallback((a,s)=>A(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Pe(e,o=!0){let{currentModal:t,modals:n,setModals:r}=je.useContext(E),[a,s]=je.useState(!1);je.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),je.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function d(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:a||!o,removeModal:d}}function G(h){var f=h,{as:e,children:o,dismissible:t=!1,flowId:n,onComplete:r,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:u}=f,g=m(f,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[C,b]=je.useState(!1),{flow:x}=ae(n,{variables:c}),{hasInitialized:v,registerComponent:k,unregisterComponent:R}=je.useContext(E),H=x==null?void 0:x.getCurrentStep(),{handleDismiss:T}=se(x,{onComplete:r,onDismiss:a}),{handlePrimary:B,handleSecondary:L}=le(H,{onPrimary:s,onSecondary:d}),D=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:re,removeModal:Le}=Pe(x,D);je.useEffect(()=>{!(x!=null&&x.isVisible)&&re&&Le();},[x==null?void 0:x.isVisible,re]),je.useEffect(()=>()=>{R(n);},[]);let oe=u&&((x==null?void 0:x.isCompleted)||(x==null?void 0:x.isSkipped));if(!x||!oe&&!re||(k(n,()=>{C||b(!0);}),!x.isVisible&&!oe)||!v||!C)return null;(oe||!x.isCompleted&&!x.isSkipped)&&H.start();let we=e===null?je.Fragment:e!=null?e:y;return jsxRuntime.jsx(we,p(i({},e===null?{}:g),{children:o({flow:x,handleDismiss:T,handlePrimary:B,handleSecondary:L,parentProps:i({dismissible:t,flowId:n,variables:c},g),step:H})}))}function Ko(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(G,p(i({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:d},step:c})=>{var h,f,C,b;let u=(f=(h=c.primaryButton)==null?void 0:h.title)!=null?f:c.primaryButtonTitle,g=(b=(C=c.secondaryButton)==null?void 0:C.title)!=null?b:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P.Header,{dismissible:d,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(P.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(P.Secondary,{title:g,onClick:s}),jsxRuntime.jsx(P.Primary,{title:u,onClick:a})]})]})}}))}function Ue(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(y,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Yr(e){var o,t,n,r;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/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ge(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=Yr(o);return a?jsxRuntime.jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function pe(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?Ge:Ue,i({src:e},t))}var P=je__namespace.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=m(a,["children","flowId"]);var d;if(o!=null)return jsxRuntime.jsx(Ko,i({flowId:o},t));let s=(d=t.as)!=null?d:S.Column;return jsxRuntime.jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});P.Dismiss=e=>jsxRuntime.jsx(O.Plain,p(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}));P.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(S.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsxRuntime.jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(P.Subtitle,{color:"gray500",flexBasis:"100%",children:t})]}))};P.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};P.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Primary,i({title:o,onClick:e},t))};P.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(O.Secondary,i({title:o,onClick:e},t))};P.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,p(i({display:"block",part:"subtitle"},o),{children:e}))};P.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,p(i({display:"block",part:"title"},o),{children:e}))};var Ee={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Go(e){let o=Object.fromEntries(Ee.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(Ee.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!Ee.content.some(a=>a===r)&&!Ee.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var rn=react.keyframes`
|
|
50
50
|
from {
|
|
51
51
|
opacity: 0;
|
|
52
52
|
}
|
|
@@ -56,7 +56,7 @@ var ao=Object.defineProperty,Dt=Object.defineProperties;var Et=Object.getOwnProp
|
|
|
56
56
|
to {
|
|
57
57
|
opacity: 1;
|
|
58
58
|
}
|
|
59
|
-
`;function
|
|
59
|
+
`;function I(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:g}=Go(n),h=g,{zIndex:c}=h,u=m(h,["zIndex"]);return jsxRuntime.jsx(___namespace.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(___namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${rn} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(___namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(___namespace.Content,p(i({asChild:!0,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault()},d),{children:jsxRuntime.jsx(P,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}I.Dismiss=e=>jsxRuntime.jsx(___namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});I.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Description,{asChild:!0,children:jsxRuntime.jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))})};I.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};I.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,i({title:o,onClick:e},t))};I.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?w.colors.blue500:w.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));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})};I.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,i({title:o,onClick:e},t))};I.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Title,{asChild:!0,children:jsxRuntime.jsx(F.H3,p(i({part:"title"},o),{children:e}))})};I.displayName="Dialog";var Jo=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function an(n){var r=n,{flowId:e,part:o}=r,t=m(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([d])=>Jo.some(c=>d===c))),s=Object.fromEntries(Object.entries(t).filter(([d])=>Jo.indexOf(d)===-1));return jsxRuntime.jsx(G,p(i({as:null,flowId:e},a),{children:({flow:d,handleDismiss:c,handlePrimary:u,handleSecondary:g,parentProps:{dismissible:h},step:f})=>{var k,R,H,T,B,L;let C=(k=f.props)!=null?k:{},b=(H=(R=f.primaryButton)==null?void 0:R.title)!=null?H:f.primaryButtonTitle,x=(B=(T=f.secondaryButton)==null?void 0:T.title)!=null?B:f.secondaryButtonTitle,v=!!(f.$state.completed||f.$state.blocked);return jsxRuntime.jsx(I,p(i({part:["announcement",o],textAlign:"center"},s),{onEscapeKeyDown:D=>{typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(D),D.defaultPrevented||c(D);},children:jsxRuntime.jsxs(S.Column,p(i({gap:5,part:"announcement-step"},C),{children:[h&&jsxRuntime.jsx(I.Dismiss,{onClick:c}),jsxRuntime.jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(I.Title,{children:f.title}),jsxRuntime.jsx(I.Subtitle,{children:f.subtitle})]}),jsxRuntime.jsx(I.Media,{src:(L=f.videoUri)!=null?L:f.imageUri,type:f.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(I.ProgressDots,{current:d.getCurrentStepIndex(),total:d.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[x&&jsxRuntime.jsx(I.Secondary,{disabled:v,onClick:g,title:x}),b&&jsxRuntime.jsx(I.Primary,{disabled:v,onClick:u,title:b})]})]}))}))}}))}function sn(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsxRuntime.jsx(G,{as:null,flowId:o,children:({handleDismiss:s,handlePrimary:d,handleSecondary:c,step:u})=>{var b,x,v,k,R;let g=(b=u.props)!=null?b:{},h=(v=(x=u.primaryButton)==null?void 0:x.title)!=null?v:u.primaryButtonTitle,f=(R=(k=u.secondaryButton)==null?void 0:k.title)!=null?R:u.secondaryButtonTitle,C=!!(u.$state.completed||u.$state.blocked);return jsxRuntime.jsxs(P,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},n),g),{children:[u.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(P.Title,{part:"title",children:u.title}),jsxRuntime.jsx(P.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsxRuntime.jsx(P.Secondary,{disabled:C,title:f,onClick:c}),jsxRuntime.jsx(P.Primary,{disabled:C,title:h,onClick:d}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:s})]}))}})}var Ze={};Y(Ze,{Collapsible:()=>nt,CollapsibleStep:()=>Se});var Se={};Y(Se,{Content:()=>qe,Root:()=>Ye,Trigger:()=>Qe});var pn=react.keyframes`
|
|
60
60
|
from {
|
|
61
61
|
height: 0;
|
|
62
62
|
opacity: 0;
|
|
@@ -65,7 +65,7 @@ var ao=Object.defineProperty,Dt=Object.defineProperties;var Et=Object.getOwnProp
|
|
|
65
65
|
height: var(--radix-collapsible-content-height);
|
|
66
66
|
opacity: 1;
|
|
67
67
|
}
|
|
68
|
-
`,
|
|
68
|
+
`,dn=react.keyframes`
|
|
69
69
|
from {
|
|
70
70
|
height: var(--radix-collapsible-content-height);
|
|
71
71
|
opacity: 1;
|
|
@@ -74,7 +74,7 @@ var ao=Object.defineProperty,Dt=Object.defineProperties;var Et=Object.getOwnProp
|
|
|
74
74
|
height: 0;
|
|
75
75
|
opacity: 0;
|
|
76
76
|
}
|
|
77
|
-
`,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"})});function pn({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(ln,{})})})}function qe({children:e}){return jsxRuntime.jsx(me__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${an} 300ms ease-out`},'&[data-state="closed"]':{animation:`${sn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function Ye(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=u(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(me__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(P,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Qe({isCompleted:e,title:o}){return jsxRuntime.jsx(me__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(pn,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ie={};q(Ie,{Bar:()=>Oe,Dots:()=>Yo,Segments:()=>Zo});function Oe(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(y,p(i({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 Yo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?w.colors.blue500:w.colors.blue800},d));return jsxRuntime.jsx(y,p(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Zo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(C.Row,p(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}var et=je.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ot({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,b,S,x,B,R;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=n,m=(b=(h=n.primaryButton)==null?void 0:h.title)!=null?b:n.primaryButtonTitle,f=(x=(S=n.secondaryButton)==null?void 0:S.title)!=null?x:n.secondaryButtonTitle,g=(B=n.props)!=null?B:{};return jsxRuntime.jsxs(Ye,p(i({open:t,onOpenChange:r},g),{children:[jsxRuntime.jsx(Qe,{isCompleted:s,title:c}),jsxRuntime.jsxs(qe,{children:[jsxRuntime.jsx(P.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=n.videoUri)!=null?R:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(P.Subtitle,{color:"gray500",children:d}),jsxRuntime.jsxs(C.Row,{gap:3,children:[jsxRuntime.jsx(P.Secondary,{disabled:!!(s||a),title:f,onClick:o}),jsxRuntime.jsx(P.Primary,{disabled:!!(s||a),title:m,onClick:e})]})]})]}))}var mn={default:ot};function fn(r){var n=r,{flow:e,step:o}=n,t=u(n,["flow","step"]);var x;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:m}=je.useContext(et),{handlePrimary:f,handleSecondary:g}=ie(o,{onPrimary:a,onSecondary:s}),h=(d!=null?d:e.getCurrentStep().id)===o.id,b=(x=m[o.type])!=null?x:ot;function S(B){return A(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(b,p(i({flow:e,onOpenChange:S,open:h,step:o},t),{handlePrimary:f,handleSecondary:g}),o.id)}function tt(s){var d=s,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=d,a=u(d,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=je.useState(null),f=i(i({},mn),n);return jsxRuntime.jsx(et.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:f},children:jsxRuntime.jsx(U,p(i({as:P,borderWidth:"md",flowId:o,part:"checklist"},a),{children:S=>{var x=S,{flow:g,handleDismiss:h}=x,b=u(x,["flow","handleDismiss"]);let R=Array.from(g.steps.entries()).filter(([,v])=>v.$state.visible===!0).map(([,v])=>jsxRuntime.jsx(fn,p(i({flow:g,handleDismiss:h},b),{step:v}),v.id)),I=g.getNumberOfCompletedSteps(),T=g.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(P.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:g.subtitle,title:g.title}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[I,"/",T]}),jsxRuntime.jsx(Oe,{current:I,total:T,flexGrow:1})]})]}),R]})}}))})}var Pn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Cn({fieldComponent:e,control:o,fieldData:t,submit:r}){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 n=Object.fromEntries(Object.entries(t).filter(([s])=>Pn.has(s))),a=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,p(i({},a),{fieldData:t,submit:r}))}function nt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var B,R,I,T,v,W;let{__readOnly:s}=je.useContext(D),{control:d,handleSubmit:c}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[m,f]=je.useState(!1),g=[],h=(B=a.props)!=null?B:{};function b(E,ge){f(!0),t(ge,E,s===!0).then(()=>f(!1));}(R=a.fields)==null||R.forEach(E=>{e[E.type]!=null&&g.push(jsxRuntime.jsx(Cn,{control:d,fieldComponent:e[E.type],fieldData:E,submit:c(b)},`${a.flow.id}-${E.id}`));});let S=(T=(I=a.primaryButton)==null?void 0:I.title)!=null?T:a.primaryButtonTitle,x=(W=(v=a.secondaryButton)==null?void 0:v.title)!=null?W:a.secondaryButtonTitle;return jsxRuntime.jsxs(C.Column,p(i({gap:5,part:"form-step"},h),{children:[jsxRuntime.jsx(P.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),g,jsxRuntime.jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[x&&jsxRuntime.jsx(k.Secondary,{title:x,onClick:r}),jsxRuntime.jsx(k.Primary,{title:S!=null?S:"Submit",onClick:c(b),disabled:m})]},"form-footer")]}))}function it({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function at({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var we={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ee({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:d}=r,c=p(i(i(i({id:n},o),s?{placeholder:s}:{}),we),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(at,{id:n,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(it,{error:d})]})}var wn=()=>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"})}),vn=je__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(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(fe__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:fe__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(wn,{})})})})]}));function dt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsxRuntime.jsx(vn,{value:s,label:a},s));return jsxRuntime.jsx(ee,p(i({},e),{children:()=>jsxRuntime.jsx(fe__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var kn=je__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx($__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($__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function mt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:d})=>jsxRuntime.jsx(kn,{value:d,label:s},d));return jsxRuntime.jsx(ee,p(i({},e),{children:()=>jsxRuntime.jsxs($__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx($__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,p(i({},we),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx($__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx($__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx($__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,p(i({},we),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx($__namespace.Viewport,{children:a})}))})]})}))}function gt(e){return jsxRuntime.jsx(ee,p(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function xt(e){return jsxRuntime.jsx(ee,p(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var Dn={radio:dt,select:mt,text:gt,textarea:xt};function eo(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=u(n,["fieldTypes","flowId"]);let a=Object.assign({},Dn,e);return jsxRuntime.jsx(U,p(i({flowId:o,part:"form"},t),{children:s=>jsxRuntime.jsx(nt,i({fieldTypes:a},s))}))}var oo={};q(oo,{NPS:()=>Ct});function Pt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let a=e.value===n?k.Primary:k.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function Ct(n){var a=n,{as:e=O,flowId:o,fieldTypes:t}=a,r=u(a,["as","flowId","fieldTypes"]);let{flow:s}=re(o);return jsxRuntime.jsx(eo,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Pt},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||s.skip();},css:p(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"620px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function Me(){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]=je.useState(e),[r,n]=je.useState(null),a=je.useCallback(s=>{n(s);},[]);return je.useLayoutEffect(()=>{if(!r)return;let s=()=>{let d=r.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var Mn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Tt(r){var n=r,{style:e={},part:o=""}=n,t=u(n,["style","part"]);return jsxRuntime.jsxs(y,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Mn}`,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 wt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=s;let c=a();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 We={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function vt(e,o){var a,s,d,c,m;let t=Object.fromEntries(We.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(We.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!We.content.includes(f)&&!We.root.includes(f)&&(n[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},g=(R,I)=>["top","bottom"].includes(I)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",h=(d=t.alignOffset)!=null?d:0,b=(c=t.style)!=null?c:{},S=(m=t.side)!=null?m:"bottom",x=t.align;t.style=p(i({},b),{[g(x,S)]:h});let B=["top","bottom"].includes(S)?o.width:o.height;t.alignOffset=(B+h)*-1,t.align=f[x];}return {contentProps:t,otherProps:n,rootProps:r}}var Bt=react.keyframes`
|
|
77
|
+
`,cn=()=>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 un({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(cn,{})})})}function qe({children:e}){return jsxRuntime.jsx(fe__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${pn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${dn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function Ye(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=m(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(fe__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(P,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},r),{children:e}))})}function Qe({isCompleted:e,title:o}){return jsxRuntime.jsx(fe__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(un,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var He={};Y(He,{Bar:()=>Ie,Dots:()=>Zo,Segments:()=>ot});function Ie(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(y,p(i({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 Zo(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?w.colors.blue500:w.colors.blue800},d));return jsxRuntime.jsx(y,p(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function ot(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(S.Row,p(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}var tt=je.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function rt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var C,b,x,v,k,R;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=r,u=(b=(C=r.primaryButton)==null?void 0:C.title)!=null?b:r.primaryButtonTitle,g=(v=(x=r.secondaryButton)==null?void 0:x.title)!=null?v:r.secondaryButtonTitle,h=(k=r.props)!=null?k:{},f=!!(s||a);return jsxRuntime.jsxs(Ye,p(i({open:t,onOpenChange:n},h),{children:[jsxRuntime.jsx(Qe,{isCompleted:s,title:c}),jsxRuntime.jsxs(qe,{children:[jsxRuntime.jsx(P.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=r.videoUri)!=null?R:r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsx(P.Subtitle,{color:"gray500",children:d}),jsxRuntime.jsxs(S.Row,{gap:3,children:[jsxRuntime.jsx(P.Secondary,{disabled:f,title:g,onClick:o}),jsxRuntime.jsx(P.Primary,{disabled:f,title:u,onClick:e})]})]})]}))}var yn={default:rt};function xn(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var x;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:u}=je.useContext(tt),{handlePrimary:g,handleSecondary:h}=le(o,{onPrimary:a,onSecondary:s}),f=(d!=null?d:e.getCurrentStep().id)===o.id,C=(x=u[o.type])!=null?x:rt;function b(v){return A(this,null,function*(){c(v?o.id:""),v&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(C,p(i({flow:e,onOpenChange:b,open:f,step:o},t),{handlePrimary:g,handleSecondary:h}),o.id)}function nt(d){var c=d,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=je.useState(null),h=i(i({},yn),a);return jsxRuntime.jsx(tt.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:n,stepTypes:h},children:jsxRuntime.jsx(G,p(i({as:P,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:x=>{var v=x,{flow:f,handleDismiss:C}=v,b=m(v,["flow","handleDismiss"]);let R=Array.from(f.steps.entries()).filter(([,B])=>B.$state.visible===!0).map(([,B])=>jsxRuntime.jsx(xn,p(i({flow:f,handleDismiss:C},b),{step:B}),B.id)),H=f.getNumberOfCompletedSteps(),T=f.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(P.Header,{dismissible:e,handleDismiss:C,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[H,"/",T]}),jsxRuntime.jsx(Ie,{current:H,total:T,flexGrow:1})]})]}),R]})}}))})}var Fn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Tn({fieldComponent:e,control:o,fieldData:t,submit:n}){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 r=Object.fromEntries(Object.entries(t).filter(([s])=>Fn.has(s))),a=reactHookForm.useController({name:t.id,control:o,rules:r});return jsxRuntime.jsx(e,p(i({},a),{fieldData:t,submit:n}))}function at({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var k,R,H,T,B,L;let{__readOnly:s}=je.useContext(E),{control:d,handleSubmit:c}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[u,g]=je.useState(!1),h=[],f=(k=a.props)!=null?k:{};function C(D,re){g(!0),t(re,D,s===!0).then(()=>g(!1));}(R=a.fields)==null||R.forEach(D=>{e[D.type]!=null&&h.push(jsxRuntime.jsx(Tn,{control:d,fieldComponent:e[D.type],fieldData:D,submit:c(C)},`${a.flow.id}-${D.id}`));});let b=(T=(H=a.primaryButton)==null?void 0:H.title)!=null?T:a.primaryButtonTitle,x=(L=(B=a.secondaryButton)==null?void 0:B.title)!=null?L:a.secondaryButtonTitle,v=!!(a.$state.completed||a.$state.blocked);return jsxRuntime.jsxs(S.Column,p(i({gap:5,part:"form-step"},f),{children:[jsxRuntime.jsx(P.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),h,jsxRuntime.jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[x&&jsxRuntime.jsx(O.Secondary,{disabled:v,onClick:n,title:x}),jsxRuntime.jsx(O.Primary,{disabled:v||u,onClick:c(C),title:b!=null?b:"Submit"})]},"form-footer")]}))}function st({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function lt({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var Te={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function te({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:s}=t,{error:d}=n,c=p(i(i(i({id:r},o),s?{placeholder:s}:{}),Te),{"aria-invalid":!!d,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(lt,{id:r,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(st,{error:d})]})}var Rn=()=>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"})}),kn=je__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(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(ge__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:ge__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(Rn,{})})})})]}));function ut(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:s})=>jsxRuntime.jsx(kn,{value:s,label:a},s));return jsxRuntime.jsx(te,p(i({},e),{children:()=>jsxRuntime.jsx(ge__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}var En=je__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(V__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(V__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function gt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:s,value:d})=>jsxRuntime.jsx(En,{value:d,label:s},d));return jsxRuntime.jsx(te,p(i({},e),{children:()=>jsxRuntime.jsxs(V__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(V__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,p(i({},Te),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(V__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(V__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(V__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,p(i({},Te),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(V__namespace.Viewport,{children:a})}))})]})}))}function xt(e){return jsxRuntime.jsx(te,p(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function ht(e){return jsxRuntime.jsx(te,p(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var In={radio:ut,select:gt,text:xt,textarea:ht};function eo(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let s=Object.assign({},In,e);return jsxRuntime.jsx(G,p(i({flowId:o,part:["form",t]},n),{children:d=>jsxRuntime.jsx(at,i({fieldTypes:s},d))}))}var oo={};Y(oo,{NPS:()=>Ft});function St({field:e,submit:o}){let t=[...Array(11)].map((n,r)=>{let a=e.value===r?O.Primary:O.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(r),o();},title:`${r}`,css:{".fr-button-title":{fontSize:"15px"}}},r)});return jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function Ft(a){var s=a,{as:e=I,flowId:o,fieldTypes:t,part:n}=s,r=m(s,["as","flowId","fieldTypes","part"]);let{flow:d}=ae(o);return jsxRuntime.jsx(eo,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:St},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||d.skip();},part:["nps",n],css:p(i({},!d||d.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"620px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function We(){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]=je.useState(e),[n,r]=je.useState(null),a=je.useCallback(s=>{r(s);},[]);return je.useLayoutEffect(()=>{if(!n)return;let s=()=>{let d=n.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:a}}var $n=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function vt(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(y,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${$n}`,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 Bt({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};r[d[n]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var Ae={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Rt(e,o){var a,s,d,c,u;let t=Object.fromEntries(Ae.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n=Object.fromEntries(Ae.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r={};for(let g of Object.keys(e))!Ae.content.includes(g)&&!Ae.root.includes(g)&&(r[g]=e[g]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},h=(k,R)=>["top","bottom"].includes(R)?k=="after"?"marginLeft":"marginRight":k=="after"?"marginTop":"marginBottom",f=(d=t.alignOffset)!=null?d:0,C=(c=t.style)!=null?c:{},b=(u=t.side)!=null?u:"bottom",x=t.align;t.style=p(i({},C),{[h(x,b)]:f});let v=["top","bottom"].includes(b)?o.width:o.height;t.alignOffset=(v+f)*-1,t.align=g[x];}return {contentProps:t,otherProps:r,rootProps:n}}var kt=react.keyframes`
|
|
78
78
|
from {
|
|
79
79
|
opacity: 0;
|
|
80
80
|
}
|
|
@@ -84,34 +84,34 @@ var ao=Object.defineProperty,Dt=Object.defineProperties;var Et=Object.getOwnProp
|
|
|
84
84
|
to {
|
|
85
85
|
opacity: 1;
|
|
86
86
|
}
|
|
87
|
-
`;function
|
|
87
|
+
`;function $(s){var d=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=d,a=m(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=We(),{node:h,rect:f,ref:C}=We(),oi=Rt(a,u),{contentProps:b,otherProps:Et}=oi,ao=Et,{part:x}=ao,v=m(ao,["part"]),{rootProps:k}=oi,[R,H]=je.useState(b.align),[T,B]=je.useState(b.side),[L,D]=je.useState(0),[re,Le]=je.useState(0);if(c!==null){let U=c.getAttribute("data-align"),ne=c.getAttribute("data-side");R!==U&&H(U),T!==ne&&B(ne);}let oe=je.useRef(null);if(je.useEffect(()=>{let U=document.querySelector(e);U!=null?(C(U),oe.current=U):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),je.useEffect(()=>{function U(ye){if(ye.matches(e))return ye;let me=ye.querySelectorAll(e);return me.length>0?me[0]:null}let ne=new MutationObserver(ye=>{for(let me of ye)if(me.type==="childList"){for(let xe of me.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ie=U(xe);if(ie!=null){C(ie),oe.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let xe of me.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ie=U(xe);if(ie!=null){C(null),oe.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return ne.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ne.disconnect()},[]),je.useEffect(()=>{let{scrollX:U,scrollY:ne}=window;D(f.left+U),Le(f.top+ne);},[f.left,f.top]),h==null)return null;let we="0";typeof window!="undefined"&&(we=window.getComputedStyle(h).borderRadius);let io=Bt({props:a,alignAttr:R,sideAttr:T});return jsxRuntime.jsxs(q__namespace.Root,p(i({defaultOpen:!0},k),{children:[jsxRuntime.jsx(q__namespace.Anchor,{virtualRef:oe}),jsxRuntime.jsx(q__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(y,i({animation:`${kt} 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:f.height,left:L,top:re,width:f.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(q__namespace.Content,p(i({asChild:!0},b),{ref:g,children:jsxRuntime.jsxs(P,p(i({animation:`${kt} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",x],style:r},v),{children:[jsxRuntime.jsx(vt,{style:io}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(q__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(O.Plain,p(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(pe,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Primary,i({title:o,onClick:e},t))};$.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,p(i({part:"progress"},o),{children:e}))};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(O.Secondary,i({title:o,onClick:e},t))};$.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,p(i({part:"title"},o),{children:e}))};function Dt(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:s}=u,d=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var k,R,H,T,B,L;let{handleDismiss:g}=se(o,{onDismiss:t}),{handlePrimary:h,handleSecondary:f}=le(s,{onPrimary:r,onSecondary:a}),C=(k=s.props)!=null?k:{},b=(H=(R=s.primaryButton)==null?void 0:R.title)!=null?H:s.primaryButtonTitle,x=(B=(T=s.secondaryButton)==null?void 0:T.title)!=null?B:s.secondaryButtonTitle,v=!!(s.$state.completed||s.$state.blocked);return jsxRuntime.jsxs($,p(i(i({anchor:s.selector,onOpenAutoFocus:D=>D.preventDefault(),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault()},d),C),{onEscapeKeyDown:D=>{typeof n=="function"&&n(D),D.defaultPrevented||g(D);},children:[e&&jsxRuntime.jsx($.Close,{onClick:g}),jsxRuntime.jsx($.Media,{src:(L=s.videoUri)!=null?L:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(S.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:s.title}),jsxRuntime.jsx($.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxRuntime.jsxs(S.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.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:v,onClick:f,title:x}),jsxRuntime.jsx($.Primary,{disabled:v,onClick:h,title:b})]})]}),s.id)}function Un(a){var s=a,{flowId:e,onComplete:o,variables:t,part:n}=s,r=m(s,["flowId","onComplete","variables","part"]);let[d,c]=je.useState(!1),{flow:u}=ae(e,{variables:t}),{hasInitialized:g,registerComponent:h,unregisterComponent:f}=je.useContext(E);se(u,{onComplete:o});let{isCurrentModal:C,removeModal:b}=Pe(u);if(je.useEffect(()=>{!(u!=null&&u.isVisible)&&C&&b();},[u==null?void 0:u.isVisible,C]),je.useEffect(()=>()=>{f(e);},[]),u==null||u.isVisible===!1||!C||(h(e,()=>{d||c(!0);}),!g||!d))return null;let x=u.getCurrentStep();return x==null||x.start(),jsxRuntime.jsx(Dt,i({flow:u,part:["tour",n],step:x},r))}function Xn(){let{frigade:e}=je.useContext(E);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Yn(){let{userId:e,frigade:o}=je.useContext(E);function t(r){return A(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return A(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function Zn(){let{frigade:e}=je.useContext(E);function o(r){return A(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,r);})}function t(r,a){return A(this,null,function*(){yield e.track(r,a);})}function n(r,a){return A(this,null,function*(){yield e.group(r,a);})}return {groupId:e.config.groupId,setGroupId:n,addProperties:o,track:t}}
|
|
88
88
|
|
|
89
89
|
exports.FrigadeJS = js__namespace;
|
|
90
|
-
exports.Announcement =
|
|
91
|
-
exports.Banner =
|
|
90
|
+
exports.Announcement = an;
|
|
91
|
+
exports.Banner = sn;
|
|
92
92
|
exports.Box = y;
|
|
93
|
-
exports.Button =
|
|
93
|
+
exports.Button = O;
|
|
94
94
|
exports.Card = P;
|
|
95
95
|
exports.Checklist = Ze;
|
|
96
|
-
exports.Dialog =
|
|
97
|
-
exports.Flex =
|
|
98
|
-
exports.Flow =
|
|
96
|
+
exports.Dialog = I;
|
|
97
|
+
exports.Flex = S;
|
|
98
|
+
exports.Flow = G;
|
|
99
99
|
exports.Form = eo;
|
|
100
|
-
exports.Progress =
|
|
101
|
-
exports.Provider =
|
|
100
|
+
exports.Progress = He;
|
|
101
|
+
exports.Provider = Ao;
|
|
102
102
|
exports.Survey = oo;
|
|
103
103
|
exports.Text = F;
|
|
104
|
-
exports.Tooltip =
|
|
105
|
-
exports.Tour =
|
|
106
|
-
exports.themeVariables =
|
|
104
|
+
exports.Tooltip = $;
|
|
105
|
+
exports.Tour = Un;
|
|
106
|
+
exports.themeVariables = ze;
|
|
107
107
|
exports.tokens = Re;
|
|
108
|
-
exports.useBoundingClientRect =
|
|
109
|
-
exports.useFlow =
|
|
110
|
-
exports.useFlowHandlers =
|
|
111
|
-
exports.useFrigade =
|
|
112
|
-
exports.useGroup =
|
|
113
|
-
exports.useModal =
|
|
114
|
-
exports.useStepHandlers =
|
|
115
|
-
exports.useUser =
|
|
108
|
+
exports.useBoundingClientRect = We;
|
|
109
|
+
exports.useFlow = ae;
|
|
110
|
+
exports.useFlowHandlers = se;
|
|
111
|
+
exports.useFrigade = Xn;
|
|
112
|
+
exports.useGroup = Zn;
|
|
113
|
+
exports.useModal = Pe;
|
|
114
|
+
exports.useStepHandlers = le;
|
|
115
|
+
exports.useUser = Yn;
|
|
116
116
|
//# sourceMappingURL=out.js.map
|
|
117
117
|
//# sourceMappingURL=index.cjs.map
|