@frigade/react 2.4.24 → 2.4.26
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 +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
6
6
|
var yo = require('react');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
|
-
var
|
|
8
|
+
var Er = require('known-css-properties');
|
|
9
9
|
var Vr = require('dompurify');
|
|
10
10
|
var js = require('@frigade/js');
|
|
11
11
|
var kn = require('embla-carousel-react');
|
|
@@ -36,9 +36,9 @@ function _interopNamespace(e) {
|
|
|
36
36
|
return Object.freeze(n);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var ___namespace = /*#__PURE__*/_interopNamespace(_);
|
|
40
40
|
var yo__namespace = /*#__PURE__*/_interopNamespace(yo);
|
|
41
|
-
var
|
|
41
|
+
var Er__default = /*#__PURE__*/_interopDefault(Er);
|
|
42
42
|
var Vr__default = /*#__PURE__*/_interopDefault(Vr);
|
|
43
43
|
var js__namespace = /*#__PURE__*/_interopNamespace(js);
|
|
44
44
|
var kn__default = /*#__PURE__*/_interopDefault(kn);
|
|
@@ -48,14 +48,14 @@ var W__namespace = /*#__PURE__*/_interopNamespace(W);
|
|
|
48
48
|
var Ze__namespace = /*#__PURE__*/_interopNamespace(Ze);
|
|
49
49
|
var ee__namespace = /*#__PURE__*/_interopNamespace(ee);
|
|
50
50
|
|
|
51
|
-
var Vo=Object.defineProperty,wr=Object.defineProperties;var Fr=Object.getOwnPropertyDescriptors;var _e=Object.getOwnPropertySymbols;var $o=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable;var Lo=(e,o,t)=>o in e?Vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))$o.call(o,t)&&Lo(e,t,o[t]);if(_e)for(var t of _e(o))No.call(o,t)&&Lo(e,t,o[t]);return e},s=(e,o)=>wr(e,Fr(o));var vr=(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)$o.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&_e)for(var n of _e(e))o.indexOf(n)<0&&No.call(e,n)&&(t[n]=e[n]);return t};var oe=(e,o)=>{for(var t in o)Vo(e,t,{get:o[t],enumerable:!0});};var L=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{d(t.next(c));}catch(u){r(u);}},l=c=>{try{d(t.throw(c));}catch(u){r(u);}},d=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,l);d((t=t.apply(e,o)).next());});function Pe(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var zo={borderWidths:{md:"1px"}};var ze=[5,10,20,35,50,65,80,95,98],Go=[...ze],po=[...ze];Go[4]=40;po[4]=60;var Tr={blue:{h:213,s:100,l:ze},gray:{h:220,s:10,l:ze},green:{h:141,s:90,l:Go},red:{h:9,s:90,l:po},yellow:{h:50,s:90,l:po}};var H={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Tr))H[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var Uo=s(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 Ko={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,jo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var Jo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Br="px",Rr=e=>typeof e=="number"?`${4*e}${Br}`:e,kr=[-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"],Xo=Object.fromEntries(kr.map(e=>[e,Rr(e)]));var qo={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 Ge=s(i(s(i({},zo),{colors:i(i({},Uo),jo)}),qo),{radii:Ko,shadows:Jo,space:Xo});function Ee(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let l=`${o.length?`${o}${t}`:""}${r}`,d=e[r];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(n,Ee(d,l,t)):n[l]=d,n},{})}function co(e){let o=Ee(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 Yo(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]=Yo(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var uo=co(Ge),R=Yo(Ge);var Er=new Set(["alt","size","src"]),Or=Dr__default.default.all.filter(e=>e.indexOf("-")!=0&&!Er.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Ir=Object.fromEntries(Or),Ue=Ee(R.colors),Hr={color:Ue,backgroundColor:Ue,borderColor:Ue,border:i(i({},R.borderWidths),Ue),borderRadius:R.radii,borderWidth:R.borderWidths,boxShadow:R.shadows,fontFamily:R.fontFamilies,fontSize:R.fontSizes,fontWeight:R.fontWeights,gap:R.space,lineHeight:R.lineHeights,margin:R.space,marginBottom:R.space,marginLeft:R.space,marginRight:R.space,marginTop:R.space,padding:R.space,paddingBottom:R.space,paddingLeft:R.space,paddingRight:R.space,paddingTop:R.space},Zo=i(i({},Ir),Hr),Qo={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"]},et=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Wr(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 ot=new Map(Object.entries(Zo).map(([e,o])=>[e,Wr(o)])),Mr=new Map(Object.entries(Qo).map(([e,o])=>[e,new Set(o)])),Ar=new Set(["height","width"]),Lr=new Set(["canvas","embed","iframe","img","input","object","video"]);function tt(e){let[o,t]=e.split(":");return [o,et.has(t)?t:null]}function rt(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,l])=>{let[d,c]=tt(a),u=Mr.get(d);u!=null&&(u.forEach(f=>{let y=`${f}${c?":"+c:""}`;t[y]=l;}),delete t[a]);}),Object.entries(t).forEach(([a,l])=>{let[d,c]=tt(a),u=ot.get(d);if(u!=null){if(l==null)delete t[a];else if(typeof l=="string"&&l.indexOf(" ")>-1){let f=l.split(" ");r(c)[d]=f.map(y=>{var x;return (x=u.get(y.toString()))!=null?x:y}).join(" ");}else u.has(l.toString())?r(c)[d]=u.get(l.toString()):r(c)[d]=l;(typeof o!="string"||!Lr.has(o)||!Ar.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let l=a.substring(1);a.indexOf("_")===0&&ot.has(l)&&(t[l]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function $r(){if(typeof window=="undefined"){let{JSDOM:e}=vr("jsdom");return new e("<!DOCTYPE html>").window}return window}function nt(e){return e?{__html:Vr__default.default($r()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function _r(e){return e&&`fr-${e}`}function lt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>lt(o)).join(" "):_r(e))}function zr(d,l){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:f,unmatchedProps:y}=rt(a,u),x=lt(r),h=t||x?clsx.clsx(t,x):void 0,w=[{boxSizing:"border-box"},f,n];return typeof o=="string"?jsxRuntime.jsx(u,s(i({className:h,css:w},y),{ref:l,dangerouslySetInnerHTML:nt(o)})):jsxRuntime.jsx(u,s(i({className:h,css:w},y),{ref:l,children:o}))}var g=yo__namespace.forwardRef(zr);var D={};oe(D,{Link:()=>bn,Plain:()=>Pn,Primary:()=>xn,Secondary:()=>hn});var S={};oe(S,{Body1:()=>ln,Body2:()=>sn,Caption:()=>pn,Display1:()=>en,Display2:()=>on,H1:()=>tn,H2:()=>rn,H3:()=>nn,H4:()=>an});var mo={};oe(mo,{Body1:()=>qr,Body2:()=>Yr,Caption:()=>Zr,Display1:()=>Gr,Display2:()=>Ur,H1:()=>Kr,H2:()=>jr,H3:()=>Jr,H4:()=>Xr});var te={color:"neutral.foreground",fontFamily:"default",margin:"0"},Gr=s(i({},te),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Ur=s(i({},te),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Kr=s(i({},te),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),jr=s(i({},te),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Jr=s(i({},te),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Xr=s(i({},te),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),qr=s(i({},te),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Yr=s(i({},te),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Zr=s(i({},te),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Qr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],re=Object.fromEntries(Qr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=yo__namespace.forwardRef((d,l)=>{var c=d,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsxRuntime.jsx(g,s(i(i({as:n},mo[e]),a),{ref:l,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),en=re.Display1,on=re.Display2,tn=re.H1,rn=re.H2,nn=re.H3,an=re.H4,ln=re.Body1,sn=re.Body2,pn=re.Caption;var go={};oe(go,{Link:()=>fn,Plain:()=>gn,Primary:()=>un,Secondary:()=>mn,loadingCSSStyle:()=>fo});var Ke={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},un=s(i({},Ke),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),mn=s(i({},Ke),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),fn=s(i({},Ke),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),gn=s(i({},Ke),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),yn=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),fo={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:yn+" 1s ease infinite"}};function je(l){var d=l,{as:e,children:o,part:t,title:n,variant:r="Primary"}=d,a=m(d,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxRuntime.jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${c}`,t]},go[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?fo:{})}),a),{loading:void 0,children:[o,n&&jsxRuntime.jsx(S.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function xn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Primary",children:e}))}function hn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Secondary",children:e}))}function bn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Link",children:e}))}function Pn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Plain",children:e}))}var P={};oe(P,{Column:()=>wn,Row:()=>Sn});var Sn=yo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),wn=yo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function xo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsxRuntime.jsx(G,s(i({as:null,flowId:o},n),{children:({handleDismiss:l,handlePrimary:d,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var k,B,F,C,v;let y=(k=f.props)!=null?k:{},x=(F=(B=f.primaryButton)==null?void 0:B.title)!=null?F:f.primaryButtonTitle,h=(v=(C=f.secondaryButton)==null?void 0:C.title)!=null?v:f.secondaryButtonTitle,w=f.$state.blocked;return jsxRuntime.jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),y),{children:[f.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:f.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:w,title:h,onClick:c}),jsxRuntime.jsx(b.Primary,{disabled:w,title:x,onClick:d}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:l})]}))}}))}var qe={};oe(qe,{Carousel:()=>Rt,Collapsible:()=>Xe,CollapsibleStep:()=>We});var Ie={};oe(Ie,{Bar:()=>Ce,Dots:()=>mt,Segments:()=>gt});function Ce(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,l=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function mt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((l,d)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?R.colors.blue500:R.colors.blue800},d));return jsxRuntime.jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function gt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((l,d)=>jsxRuntime.jsx(g,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(P.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function xt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function Fn(){return jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ht(t){var n=t,{checked:e=!1}=n,o=m(n,["checked"]);return jsxRuntime.jsx(g,s(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsxRuntime.jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Fn,{})})}))}function ne(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=yo.useContext(V),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:yo.useCallback((a,l,d=!0)=>L(this,null,function*(){if((yield o==null?void 0:o(e,a,l))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(l,d)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,d),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:yo.useCallback((a,l)=>L(this,null,function*(){if((yield t==null?void 0:t(e,a,l))===!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(l),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Pt({onPrimary:e,onSecondary:o,step:t}){var u,f;let{handlePrimary:n,handleSecondary:r}=ne(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:l,skipped:d}=t.$state,c=l||d||!a?jsxRuntime.jsx(ht,{checked:l||d,marginLeft:"auto"}):jsxRuntime.jsx(g,{as:xt,height:"22px",marginLeft:"auto",width:"22px"});return jsxRuntime.jsxs(b,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxRuntime.jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(P.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsxRuntime.jsx(b.Secondary,{disabled:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsxRuntime.jsx(b.Primary,{disabled:a,onClick:n,title:(f=t.primaryButton)==null?void 0:f.title})]})]})}function St(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Ft(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var vt=react.keyframes`
|
|
51
|
+
var Vo=Object.defineProperty,wr=Object.defineProperties;var Fr=Object.getOwnPropertyDescriptors;var ze=Object.getOwnPropertySymbols;var $o=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable;var Lo=(e,o,t)=>o in e?Vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))$o.call(o,t)&&Lo(e,t,o[t]);if(ze)for(var t of ze(o))No.call(o,t)&&Lo(e,t,o[t]);return e},s=(e,o)=>wr(e,Fr(o));var vr=(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)$o.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ze)for(var n of ze(e))o.indexOf(n)<0&&No.call(e,n)&&(t[n]=e[n]);return t};var oe=(e,o)=>{for(var t in o)Vo(e,t,{get:o[t],enumerable:!0});};var L=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{d(t.next(c));}catch(u){r(u);}},l=c=>{try{d(t.throw(c));}catch(u){r(u);}},d=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,l);d((t=t.apply(e,o)).next());});function Pe(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var _o={borderWidths:{md:"1px"}};var _e=[5,10,20,35,50,65,80,95,98],Go=[..._e],po=[..._e];Go[4]=40;po[4]=60;var Tr={blue:{h:213,s:100,l:_e},gray:{h:220,s:10,l:_e},green:{h:141,s:90,l:Go},red:{h:9,s:90,l:po},yellow:{h:50,s:90,l:po}};var H={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Tr))H[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var Uo=s(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 Ko={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,jo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var Jo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Br="px",Rr=e=>typeof e=="number"?`${4*e}${Br}`:e,kr=[-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"],Xo=Object.fromEntries(kr.map(e=>[e,Rr(e)]));var qo={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 Ge=s(i(s(i({},_o),{colors:i(i({},Uo),jo)}),qo),{radii:Ko,shadows:Jo,space:Xo});function De(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let l=`${o.length?`${o}${t}`:""}${r}`,d=e[r];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(n,De(d,l,t)):n[l]=d,n},{})}function co(e){let o=De(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 Yo(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]=Yo(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var uo=co(Ge),R=Yo(Ge);var Dr=new Set(["alt","size","src"]),Or=Er__default.default.all.filter(e=>e.indexOf("-")!=0&&!Dr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Ir=Object.fromEntries(Or),Ue=De(R.colors),Hr={color:Ue,backgroundColor:Ue,borderColor:Ue,border:i(i({},R.borderWidths),Ue),borderRadius:R.radii,borderWidth:R.borderWidths,boxShadow:R.shadows,fontFamily:R.fontFamilies,fontSize:R.fontSizes,fontWeight:R.fontWeights,gap:R.space,lineHeight:R.lineHeights,margin:R.space,marginBottom:R.space,marginLeft:R.space,marginRight:R.space,marginTop:R.space,padding:R.space,paddingBottom:R.space,paddingLeft:R.space,paddingRight:R.space,paddingTop:R.space},Zo=i(i({},Ir),Hr),Qo={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"]},et=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Wr(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 ot=new Map(Object.entries(Zo).map(([e,o])=>[e,Wr(o)])),Mr=new Map(Object.entries(Qo).map(([e,o])=>[e,new Set(o)])),Ar=new Set(["height","width"]),Lr=new Set(["canvas","embed","iframe","img","input","object","video"]);function tt(e){let[o,t]=e.split(":");return [o,et.has(t)?t:null]}function rt(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,l])=>{let[d,c]=tt(a),u=Mr.get(d);u!=null&&(u.forEach(f=>{let y=`${f}${c?":"+c:""}`;t[y]=l;}),delete t[a]);}),Object.entries(t).forEach(([a,l])=>{let[d,c]=tt(a),u=ot.get(d);if(u!=null){if(l==null)delete t[a];else if(typeof l=="string"&&l.indexOf(" ")>-1){let f=l.split(" ");r(c)[d]=f.map(y=>{var x;return (x=u.get(y.toString()))!=null?x:y}).join(" ");}else u.has(l.toString())?r(c)[d]=u.get(l.toString()):r(c)[d]=l;(typeof o!="string"||!Lr.has(o)||!Ar.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let l=a.substring(1);a.indexOf("_")===0&&ot.has(l)&&(t[l]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function $r(){if(typeof window=="undefined"){let{JSDOM:e}=vr("jsdom");return new e("<!DOCTYPE html>").window}return window}function nt(e){return e?{__html:Vr__default.default($r()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function zr(e){return e&&`fr-${e}`}function lt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>lt(o)).join(" "):zr(e))}function _r(d,l){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:f,unmatchedProps:y}=rt(a,u),x=lt(r),h=t||x?clsx.clsx(t,x):void 0,w=[{boxSizing:"border-box"},f,n];return typeof o=="string"?jsxRuntime.jsx(u,s(i({className:h,css:w},y),{ref:l,dangerouslySetInnerHTML:nt(o)})):jsxRuntime.jsx(u,s(i({className:h,css:w},y),{ref:l,children:o}))}var g=yo__namespace.forwardRef(_r);var E={};oe(E,{Link:()=>bn,Plain:()=>Pn,Primary:()=>xn,Secondary:()=>hn});var S={};oe(S,{Body1:()=>ln,Body2:()=>sn,Caption:()=>pn,Display1:()=>en,Display2:()=>on,H1:()=>tn,H2:()=>rn,H3:()=>nn,H4:()=>an});var mo={};oe(mo,{Body1:()=>qr,Body2:()=>Yr,Caption:()=>Zr,Display1:()=>Gr,Display2:()=>Ur,H1:()=>Kr,H2:()=>jr,H3:()=>Jr,H4:()=>Xr});var te={color:"neutral.foreground",fontFamily:"default",margin:"0"},Gr=s(i({},te),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Ur=s(i({},te),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Kr=s(i({},te),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),jr=s(i({},te),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Jr=s(i({},te),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Xr=s(i({},te),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),qr=s(i({},te),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Yr=s(i({},te),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Zr=s(i({},te),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Qr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],re=Object.fromEntries(Qr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=yo__namespace.forwardRef((d,l)=>{var c=d,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsxRuntime.jsx(g,s(i(i({as:n},mo[e]),a),{ref:l,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),en=re.Display1,on=re.Display2,tn=re.H1,rn=re.H2,nn=re.H3,an=re.H4,ln=re.Body1,sn=re.Body2,pn=re.Caption;var go={};oe(go,{Link:()=>fn,Plain:()=>gn,Primary:()=>un,Secondary:()=>mn,loadingCSSStyle:()=>fo});var Ke={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},un=s(i({},Ke),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),mn=s(i({},Ke),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),fn=s(i({},Ke),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),gn=s(i({},Ke),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),yn=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),fo={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:yn+" 1s ease infinite"}};function je(l){var d=l,{as:e,children:o,part:t,title:n,variant:r="Primary"}=d,a=m(d,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxRuntime.jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${c}`,t]},go[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?fo:{})}),a),{loading:void 0,children:[o,n&&jsxRuntime.jsx(S.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function xn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Primary",children:e}))}function hn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Secondary",children:e}))}function bn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Link",children:e}))}function Pn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(je,s(i({},o),{variant:"Plain",children:e}))}var P={};oe(P,{Column:()=>wn,Row:()=>Sn});var Sn=yo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),wn=yo__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function xo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsxRuntime.jsx(G,s(i({as:null,flowId:o},n),{children:({handleDismiss:l,handlePrimary:d,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var k,B,F,C,v;let y=(k=f.props)!=null?k:{},x=(F=(B=f.primaryButton)==null?void 0:B.title)!=null?F:f.primaryButtonTitle,h=(v=(C=f.secondaryButton)==null?void 0:C.title)!=null?v:f.secondaryButtonTitle,w=f.$state.blocked;return jsxRuntime.jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),y),{children:[f.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:f.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:w,title:h,onClick:c}),jsxRuntime.jsx(b.Primary,{disabled:w,title:x,onClick:d}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:l})]}))}}))}var qe={};oe(qe,{Carousel:()=>Rt,Collapsible:()=>Xe,CollapsibleStep:()=>We});var Ie={};oe(Ie,{Bar:()=>Ce,Dots:()=>mt,Segments:()=>gt});function Ce(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,l=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function mt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((l,d)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?R.colors.blue500:R.colors.blue800},d));return jsxRuntime.jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function gt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((l,d)=>jsxRuntime.jsx(g,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(P.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function xt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function Fn(){return jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ht(t){var n=t,{checked:e=!1}=n,o=m(n,["checked"]);return jsxRuntime.jsx(g,s(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsxRuntime.jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Fn,{})})}))}function ne(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=yo.useContext(V),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:yo.useCallback((a,l,d=!0)=>L(this,null,function*(){if((yield o==null?void 0:o(e,a,l))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(l,d)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,d),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:yo.useCallback((a,l)=>L(this,null,function*(){if((yield t==null?void 0:t(e,a,l))===!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(l),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Pt({onPrimary:e,onSecondary:o,step:t}){var u,f;let{handlePrimary:n,handleSecondary:r}=ne(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:l,skipped:d}=t.$state,c=l||d||!a?jsxRuntime.jsx(ht,{checked:l||d,marginLeft:"auto"}):jsxRuntime.jsx(g,{as:xt,height:"22px",marginLeft:"auto",width:"22px"});return jsxRuntime.jsxs(b,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxRuntime.jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(P.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsxRuntime.jsx(b.Secondary,{disabled:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsxRuntime.jsx(b.Primary,{disabled:a,onClick:n,title:(f=t.primaryButton)==null?void 0:f.title})]})]})}function St(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Ft(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var vt=react.keyframes`
|
|
52
52
|
from {
|
|
53
53
|
opacity: 0;
|
|
54
54
|
}
|
|
55
55
|
to {
|
|
56
56
|
opacity: 1;
|
|
57
57
|
}
|
|
58
|
-
`;function Tt({flow:e,sort:o,onPrimary:t,onSecondary:n}){var k,B;let[r,a]=yo.useState(),[l]=yo.useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(B=(k=Array.from(e.steps.values()).find(F=>!F.$state.completed&&!F.$state.skipped))==null?void 0:k.order)!=null?B:0}),[d,c]=kn__default.default(l),[u,f]=yo.useState(),[y,x]=yo.useState();yo.useLayoutEffect(()=>{c&&(u==null&&f(c.canScrollNext()),y==null&&x(c.canScrollPrev()),c.on("select",()=>{f(c.canScrollNext()),x(c.canScrollPrev());}));},[c]),yo.useEffect(()=>{if(!r){let F=Array.from(e.steps.values()),C=F.filter(T=>T.$state.completed||T.$state.skipped).sort((T,
|
|
58
|
+
`;function Tt({flow:e,sort:o,onPrimary:t,onSecondary:n}){var k,B;let[r,a]=yo.useState(),[l]=yo.useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(B=(k=Array.from(e.steps.values()).find(F=>!F.$state.completed&&!F.$state.skipped))==null?void 0:k.order)!=null?B:0}),[d,c]=kn__default.default(l),[u,f]=yo.useState(),[y,x]=yo.useState();yo.useLayoutEffect(()=>{c&&(u==null&&f(c.canScrollNext()),y==null&&x(c.canScrollPrev()),c.on("select",()=>{f(c.canScrollNext()),x(c.canScrollPrev());}));},[c]),yo.useEffect(()=>{if(!r){let F=Array.from(e.steps.values()),C=F.filter(T=>T.$state.completed||T.$state.skipped).sort((T,D)=>T.order-D.order),v=F.filter(T=>!T.$state.completed&&!T.$state.skipped).sort((T,D)=>T.order-D.order);a(o==="completed-last"?[...v,...C].map(T=>T.id):F.map(T=>T.id));}},[]);let h=e.getNumberOfCompletedSteps(),w=e.getNumberOfAvailableSteps();return r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:R.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxRuntime.jsxs(P.Column,{part:"carousel-header-content",children:[jsxRuntime.jsx(S.H3,{children:e.title}),jsxRuntime.jsx(S.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxRuntime.jsxs(S.Body2,{fontWeight:"demibold",part:"progress-text",children:[h,"/",w]}),jsxRuntime.jsx(Ce,{current:h,total:w,minWidth:"200px"})]})]}),jsxRuntime.jsxs(g,{margin:`0 ${R.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:d,children:[jsxRuntime.jsx(P.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((F,C)=>r.indexOf(F.id)-r.indexOf(C.id)).map(F=>jsxRuntime.jsx(Pt,{onPrimary:t,onSecondary:n,step:F},F.id))}),y&&jsxRuntime.jsx(P.Column,{animation:`${vt} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsxRuntime.jsx(E.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>c.scrollPrev(),padding:"2",children:jsxRuntime.jsx(Ft,{height:"24px",width:"24px"})})}),u&&jsxRuntime.jsx(P.Column,{animation:`${vt} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsxRuntime.jsx(E.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>c.scrollNext(),padding:"2",children:jsxRuntime.jsx(St,{height:"24px",width:"24px"})})})]})]}):null}function Rt(o){var e=m(o,[]);return jsxRuntime.jsx(G,s(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsxRuntime.jsx(Tt,i(i({},e),t))}))}var We={};oe(We,{Content:()=>Po,Root:()=>Co,Trigger:()=>So});function Et(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var Dn=react.keyframes`
|
|
59
59
|
from {
|
|
60
60
|
height: 0;
|
|
61
61
|
opacity: 0;
|
|
@@ -73,7 +73,7 @@ var Vo=Object.defineProperty,wr=Object.defineProperties;var Fr=Object.getOwnProp
|
|
|
73
73
|
height: 0;
|
|
74
74
|
opacity: 0;
|
|
75
75
|
}
|
|
76
|
-
`,In=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Hn({checked:e=!1}){return jsxRuntime.jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(In,{})})})}function Po({children:e}){return jsxRuntime.jsx(we__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${En} 300ms ease-out`},'&[data-state="closed"]':{animation:`${On} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsxRuntime.jsx(g,{}),e]})})}function Co(a){var l=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=l,r=m(l,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(we__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function So({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(we__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Hn,{checked:e}),jsxRuntime.jsx(S.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsxRuntime.jsx(g,{as:Dt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ot=yo.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function It({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var w,k,B,F,C,v;let{$state:{blocked:a,completed:l,skipped:d},subtitle:c,title:u}=r,f=(k=(w=r.primaryButton)==null?void 0:w.title)!=null?k:r.primaryButtonTitle,y=(F=(B=r.secondaryButton)==null?void 0:B.title)!=null?F:r.secondaryButtonTitle,x=(C=r.props)!=null?C:{},h=!!a;return jsxRuntime.jsxs(Co,s(i({open:t,onOpenChange:n},x),{children:[jsxRuntime.jsx(So,{isBlocked:r.$state.blocked,isCompleted:l||d,title:u}),jsxRuntime.jsxs(Po,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(v=r.videoUri)!=null?v:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:c}),jsxRuntime.jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsxRuntime.jsx(b.Secondary,{title:y,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:h,title:f,onClick:e})]})]})]}))}var Ln={default:It};function Vn(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var k;let{onPrimary:a,onSecondary:l,openStepId:d,setOpenStepId:c,stepTypes:u}=yo.useContext(Ot),{handlePrimary:f,handleSecondary:y}=ne(o,{onPrimary:a,onSecondary:l}),x=(d!=null?d:e.getCurrentStep().id)===o.id,h=(k=u[o.type])!=null?k:It;function w(B){return L(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(h,s(i({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:f,handleSecondary:y}),o.id)}function Xe(d){var c=d,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,l=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=yo.useState(null),y=i(i({},Ln),a);return jsxRuntime.jsx(Ot.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:n,stepTypes:y},children:jsxRuntime.jsx(G,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},l),{children:k=>{var B=k,{flow:x,handleDismiss:h}=B,w=m(B,["flow","handleDismiss"]);let C=Array.from(x.steps.entries()).filter(([,E])=>E.$state.visible===!0).map(([,E])=>jsxRuntime.jsx(Vn,s(i({flow:x,handleDismiss:h},w),{step:E}),E.id)),v=x.getNumberOfCompletedSteps(),T=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(S.Body2,{fontWeight:"demibold",children:[v,"/",T]}),jsxRuntime.jsx(Ce,{current:v,total:T,flexGrow:1})]})]}),C]})}}))})}var Jn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Xn({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(t).filter(([d])=>Jn.has(d))),l=reactHookForm.useController({name:t.id,control:o,rules:a});return jsxRuntime.jsx(e,s(i({},l),{fieldData:t,formContext:r,submit:n}))}function Wt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var v,T,E,K,I,j;let{__readOnly:l}=yo.useContext(V),d=((v=a.fields)!=null?v:[]).filter(A=>e[A.type]!=null&&A.id),c=reactHookForm.useForm({delayError:2e3,mode:"onChange",defaultValues:d.reduce((A,J)=>{var ke;return A[J.id]=(ke=J.value)!=null?ke:"",A},{})}),[u,f]=yo.useState(!1),y=[],{control:x,handleSubmit:h}=c,w=(T=a.props)!=null?T:{};function k(A,J){f(!0),t(J,A,l===!0).then(()=>f(!1));}d.forEach(A=>{e[A.type]!=null&&y.push(jsxRuntime.jsx(Xn,{control:x,fieldComponent:e[A.type],fieldData:A,submit:h(k)},`${a.flow.id}-${A.id}`));});let B=(K=(E=a.primaryButton)==null?void 0:E.title)!=null?K:a.primaryButtonTitle,F=(j=(I=a.secondaryButton)==null?void 0:I.title)!=null?j:a.secondaryButtonTitle,C=!!(a.$state.blocked||!c.formState.isValid);return yo.useEffect(()=>{c.reset();},[a]),jsxRuntime.jsxs(P.Column,s(i({gap:5,part:"form-step"},w),{children:[jsxRuntime.jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(reactHookForm.FormProvider,s(i({},c),{children:y})),jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[F&&jsxRuntime.jsx(D.Secondary,{onClick:n,title:F}),jsxRuntime.jsx(D.Primary,{disabled:C||u,onClick:h(k),title:B!=null?B:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Mt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(S.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function wo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(S.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Fo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Me=s(i({},Fo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),Ye={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function Q({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:l}=t,{error:d}=n,c=s(i(i(i({id:r},o),l?{placeholder:l}:{}),Me),{"aria-invalid":!!d,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(wo,{id:r,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(Mt,{error:d})]})}function ve(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var ei=yo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(S.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Te__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(g,s(i({as:Te__namespace.Indicator},Ye),{children:jsxRuntime.jsx(ve,{height:"14",width:"14"})}))})})]}));function vo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:l})=>jsxRuntime.jsx(ei,{value:l,label:a},l));return jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsx(Te__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Nt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function zt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=yo__namespace.useState([]);function l(d){let c=[];r.includes(d)?c=[...r.filter(u=>u!==d)]:c=[...r,d],a(c),o(c);}return jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsx(P.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:d,value:c})=>jsxRuntime.jsx(Ze__namespace.Root,{value:r.includes(c)?c:void 0,onCheckedChange:()=>l(c),asChild:!0,children:jsxRuntime.jsxs(g,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsxRuntime.jsx(S.Body2,{part:"field-check-label",children:d}),jsxRuntime.jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(Ze__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,s(i({},Ye),{children:jsxRuntime.jsx(ve,{height:"14",width:"14"})}))})})]})},c))})}))}var ri=yo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(W__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(W__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(S.Body2,{part:"field-select-option-label",children:e})})})}));function To(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:l,value:d})=>jsxRuntime.jsx(ri,{value:d,label:l},d));return e.fieldData.multiple?jsxRuntime.jsx(zt,i({},e)):jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsxs(W__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(W__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.Body2,s(i({},Me),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(W__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(W__namespace.Icon,{children:jsxRuntime.jsx(g,{as:Nt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(W__namespace.Portal,{children:jsxRuntime.jsx(W__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,s(i({},Me),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(W__namespace.Viewport,{children:a})}))})})]})}))}function Bo(e){return jsxRuntime.jsx(Q,s(i({},e),{children:o=>jsxRuntime.jsx(S.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Ro(e){return jsxRuntime.jsx(Q,s(i({},e),{children:o=>jsxRuntime.jsx(S.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function Jt(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxRuntime.jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsxRuntime.jsx(Ze__namespace.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsxRuntime.jsx(g,s(i({},Fo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsxRuntime.jsx(Ze__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsxRuntime.jsx(ve,{height:"14",fill:"currentColor"})})})}))}),jsxRuntime.jsx(S.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var ii={checkbox:Jt,radio:vo,select:To,text:Bo,textarea:Ro};function Re(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let l=Object.assign({},ii,e);return jsxRuntime.jsx(G,s(i({flowId:o,part:["form",t]},n),{children:d=>jsxRuntime.jsx(Wt,i({fieldTypes:l},d))}))}var oo={};oe(oo,{NPS:()=>Le});function Yt({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((l,d)=>{let c=e.value===d?D.Primary:D.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(d),t();},title:`${d}`,css:{".fr-button-title":{fontSize:"15px"}}},d)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(S.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsxRuntime.jsx(S.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Le(a){var l=a,{as:e=O,flowId:o,fieldTypes:t,part:n}=l,r=m(l,["as","flowId","fieldTypes","part"]);let{flow:d}=ae(o);return jsxRuntime.jsx(Re,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Yt},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||d.skip();},part:["nps",n],css:s(i({},!d||d.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function xe(e,{onComplete:o,onDismiss:t}={}){let n=yo.useRef(null);return yo.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&L(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:yo.useCallback(r=>L(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function to(){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]=yo.useState(e),[n,r]=yo.useState(null),a=yo.useCallback(l=>{r(l);},[]);return yo.useLayoutEffect(()=>{if(!n)return;let l=()=>{let d=n.getBoundingClientRect();t(d);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),{node:n,rect:o,ref:a}}var mi=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function er(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${mi}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function ro(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function yi(e){var o,t,n,r,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function no(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=yi(o);return a?jsxRuntime.jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function pe(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?no:ro,i({src:e},t))}function tr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},l="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};r[d[n]]=l;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=l:r.bottom=l:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=l:r.top=l:["top","bottom"].includes(n)?r.left=`calc(50% + ${l})`:r.top=`calc(50% + ${l})`,r}var io={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function rr(e,o){var a,l,d,c,u;let t=Object.fromEntries(io.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n=Object.fromEntries(io.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r={};for(let f of Object.keys(e))!io.content.includes(f)&&!io.root.includes(f)&&(r[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},y=(F,C)=>["top","bottom"].includes(C)?F=="after"?"marginLeft":"marginRight":F=="after"?"marginTop":"marginBottom",x=(d=t.alignOffset)!=null?d:0,h=(c=t.style)!=null?c:{},w=(u=t.side)!=null?u:"bottom",k=t.align;t.style=s(i({},h),{[y(k,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=f[k];}return {contentProps:t,otherProps:r,rootProps:n}}var nr=react.keyframes`
|
|
76
|
+
`,In=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Hn({checked:e=!1}){return jsxRuntime.jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(In,{})})})}function Po({children:e}){return jsxRuntime.jsx(we__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${Dn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${On} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsxRuntime.jsx(g,{}),e]})})}function Co(a){var l=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=l,r=m(l,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(we__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function So({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(we__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Hn,{checked:e}),jsxRuntime.jsx(S.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsxRuntime.jsx(g,{as:Et,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ot=yo.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function It({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var w,k,B,F,C,v;let{$state:{blocked:a,completed:l,skipped:d},subtitle:c,title:u}=r,f=(k=(w=r.primaryButton)==null?void 0:w.title)!=null?k:r.primaryButtonTitle,y=(F=(B=r.secondaryButton)==null?void 0:B.title)!=null?F:r.secondaryButtonTitle,x=(C=r.props)!=null?C:{},h=!!a;return jsxRuntime.jsxs(Co,s(i({open:t,onOpenChange:n},x),{children:[jsxRuntime.jsx(So,{isBlocked:r.$state.blocked,isCompleted:l||d,title:u}),jsxRuntime.jsxs(Po,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(v=r.videoUri)!=null?v:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:c}),jsxRuntime.jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsxRuntime.jsx(b.Secondary,{title:y,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:h,title:f,onClick:e})]})]})]}))}var Ln={default:It};function Vn(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var k;let{onPrimary:a,onSecondary:l,openStepId:d,setOpenStepId:c,stepTypes:u}=yo.useContext(Ot),{handlePrimary:f,handleSecondary:y}=ne(o,{onPrimary:a,onSecondary:l}),x=(d!=null?d:e.getCurrentStep().id)===o.id,h=(k=u[o.type])!=null?k:It;function w(B){return L(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(h,s(i({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:f,handleSecondary:y}),o.id)}function Xe(d){var c=d,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,l=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=yo.useState(null),y=i(i({},Ln),a);return jsxRuntime.jsx(Ot.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:n,stepTypes:y},children:jsxRuntime.jsx(G,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},l),{children:k=>{var B=k,{flow:x,handleDismiss:h}=B,w=m(B,["flow","handleDismiss"]);let C=Array.from(x.steps.entries()).filter(([,D])=>D.$state.visible===!0).map(([,D])=>jsxRuntime.jsx(Vn,s(i({flow:x,handleDismiss:h},w),{step:D}),D.id)),v=x.getNumberOfCompletedSteps(),T=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(S.Body2,{fontWeight:"demibold",children:[v,"/",T]}),jsxRuntime.jsx(Ce,{current:v,total:T,flexGrow:1})]})]}),C]})}}))})}var Jn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Xn({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(t).filter(([d])=>Jn.has(d))),l=reactHookForm.useController({name:t.id,control:o,rules:a});return jsxRuntime.jsx(e,s(i({},l),{fieldData:t,formContext:r,submit:n}))}function Wt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var v,T,D,K,I,j;let{__readOnly:l}=yo.useContext(V),d=((v=a.fields)!=null?v:[]).filter(A=>e[A.type]!=null&&A.id),c=reactHookForm.useForm({delayError:2e3,mode:"onChange",defaultValues:d.reduce((A,J)=>{var ke;return A[J.id]=(ke=J.value)!=null?ke:"",A},{})}),[u,f]=yo.useState(!1),y=[],{control:x,handleSubmit:h}=c,w=(T=a.props)!=null?T:{};function k(A,J){f(!0),t(J,A,l===!0).then(()=>f(!1));}d.forEach(A=>{e[A.type]!=null&&y.push(jsxRuntime.jsx(Xn,{control:x,fieldComponent:e[A.type],fieldData:A,submit:h(k)},`${a.flow.id}-${A.id}`));});let B=(K=(D=a.primaryButton)==null?void 0:D.title)!=null?K:a.primaryButtonTitle,F=(j=(I=a.secondaryButton)==null?void 0:I.title)!=null?j:a.secondaryButtonTitle,C=!!(a.$state.blocked||!c.formState.isValid);return yo.useEffect(()=>{c.clearErrors();},[a]),jsxRuntime.jsxs(P.Column,s(i({gap:5,part:"form-step"},w),{children:[jsxRuntime.jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(reactHookForm.FormProvider,s(i({},c),{children:y})),jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[F&&jsxRuntime.jsx(E.Secondary,{onClick:n,title:F}),jsxRuntime.jsx(E.Primary,{disabled:C||u,onClick:h(k),title:B!=null?B:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Mt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(S.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function wo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(S.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Fo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Me=s(i({},Fo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),Ye={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function Q({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:l}=t,{error:d}=n,c=s(i(i(i({id:r},o),l?{placeholder:l}:{}),Me),{"aria-invalid":!!d,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(wo,{id:r,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(Mt,{error:d})]})}function ve(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var ei=yo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(S.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Te__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(g,s(i({as:Te__namespace.Indicator},Ye),{children:jsxRuntime.jsx(ve,{height:"14",width:"14"})}))})})]}));function vo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:l})=>jsxRuntime.jsx(ei,{value:l,label:a},l));return jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsx(Te__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Nt(e){return jsxRuntime.jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function _t(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=yo__namespace.useState([]);function l(d){let c=[];r.includes(d)?c=[...r.filter(u=>u!==d)]:c=[...r,d],a(c),o(c);}return jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsx(P.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:d,value:c})=>jsxRuntime.jsx(Ze__namespace.Root,{value:r.includes(c)?c:void 0,onCheckedChange:()=>l(c),asChild:!0,children:jsxRuntime.jsxs(g,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsxRuntime.jsx(S.Body2,{part:"field-check-label",children:d}),jsxRuntime.jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(Ze__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,s(i({},Ye),{children:jsxRuntime.jsx(ve,{height:"14",width:"14"})}))})})]})},c))})}))}var ri=yo__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(W__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(W__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(S.Body2,{part:"field-select-option-label",children:e})})})}));function To(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:l,value:d})=>jsxRuntime.jsx(ri,{value:d,label:l},d));return e.fieldData.multiple?jsxRuntime.jsx(_t,i({},e)):jsxRuntime.jsx(Q,s(i({},e),{children:()=>jsxRuntime.jsxs(W__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(W__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.Body2,s(i({},Me),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(W__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(W__namespace.Icon,{children:jsxRuntime.jsx(g,{as:Nt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(W__namespace.Portal,{children:jsxRuntime.jsx(W__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,s(i({},Me),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(W__namespace.Viewport,{children:a})}))})})]})}))}function Bo(e){return jsxRuntime.jsx(Q,s(i({},e),{children:o=>jsxRuntime.jsx(S.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Ro(e){return jsxRuntime.jsx(Q,s(i({},e),{children:o=>jsxRuntime.jsx(S.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function Jt(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxRuntime.jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsxRuntime.jsx(Ze__namespace.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsxRuntime.jsx(g,s(i({},Fo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsxRuntime.jsx(Ze__namespace.Indicator,{asChild:!0,children:jsxRuntime.jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsxRuntime.jsx(ve,{height:"14",fill:"currentColor"})})})}))}),jsxRuntime.jsx(S.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var ii={checkbox:Jt,radio:vo,select:To,text:Bo,textarea:Ro};function Re(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let l=Object.assign({},ii,e);return jsxRuntime.jsx(G,s(i({flowId:o,part:["form",t]},n),{children:d=>jsxRuntime.jsx(Wt,i({fieldTypes:l},d))}))}var oo={};oe(oo,{NPS:()=>Le});function Yt({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((l,d)=>{let c=e.value===d?E.Primary:E.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(d),t();},title:`${d}`,css:{".fr-button-title":{fontSize:"15px"}}},d)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(S.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsxRuntime.jsx(S.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Le(a){var l=a,{as:e=O,flowId:o,fieldTypes:t,part:n}=l,r=m(l,["as","flowId","fieldTypes","part"]);let{flow:d}=ae(o);return jsxRuntime.jsx(Re,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Yt},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||d.skip();},part:["nps",n],css:s(i({},!d||d.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function xe(e,{onComplete:o,onDismiss:t}={}){let n=yo.useRef(null);return yo.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&L(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:yo.useCallback(r=>L(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function to(){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]=yo.useState(e),[n,r]=yo.useState(null),a=yo.useCallback(l=>{r(l);},[]);return yo.useLayoutEffect(()=>{if(!n)return;let l=()=>{let d=n.getBoundingClientRect();t(d);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),{node:n,rect:o,ref:a}}var mi=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function er(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${mi}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function ro(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function yi(e){var o,t,n,r,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function no(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=yi(o);return a?jsxRuntime.jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function de(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?no:ro,i({src:e},t))}function tr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},l="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};r[d[n]]=l;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=l:r.bottom=l:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=l:r.top=l:["top","bottom"].includes(n)?r.left=`calc(50% + ${l})`:r.top=`calc(50% + ${l})`,r}var io={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function rr(e,o){var a,l,d,c,u;let t=Object.fromEntries(io.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n=Object.fromEntries(io.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r={};for(let f of Object.keys(e))!io.content.includes(f)&&!io.root.includes(f)&&(r[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},y=(F,C)=>["top","bottom"].includes(C)?F=="after"?"marginLeft":"marginRight":F=="after"?"marginTop":"marginBottom",x=(d=t.alignOffset)!=null?d:0,h=(c=t.style)!=null?c:{},w=(u=t.side)!=null?u:"bottom",k=t.align;t.style=s(i({},h),{[y(k,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=f[k];}return {contentProps:t,otherProps:r,rootProps:n}}var nr=react.keyframes`
|
|
77
77
|
from {
|
|
78
78
|
opacity: 0;
|
|
79
79
|
}
|
|
@@ -83,7 +83,7 @@ var Vo=Object.defineProperty,wr=Object.defineProperties;var Fr=Object.getOwnProp
|
|
|
83
83
|
to {
|
|
84
84
|
opacity: 1;
|
|
85
85
|
}
|
|
86
|
-
`;function ir(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(l){var d=l,{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:f}=to(),{node:y,rect:x,ref:h}=to(),ta=rr(a,u),{contentProps:w,otherProps:Sr}=ta,Ao=Sr,{part:k}=Ao,B=m(Ao,["part"]),{rootProps:F}=ta,[C,v]=yo.useState(w.align),[T,E]=yo.useState(w.side),[K,I]=yo.useState(0),[j,A]=yo.useState(0);if(c!==null){let q=c.getAttribute("data-align"),ce=c.getAttribute("data-side");C!==q&&v(q),T!==ce&&E(ce);}let J=yo.useRef(null);if(yo.useEffect(()=>{let q=document.querySelector(e);q!=null?(h(q),J.current=q):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),yo.useEffect(()=>{function q(be){if(be.matches(e))return ir(be)?be:null;let ue=be.querySelectorAll(e);return ue.length>0&&ir(ue[0])?ue[0]:null}let ce=new MutationObserver(be=>{for(let ue of be)if(ue.type==="childList"){for(let De of ue.addedNodes){if(De.nodeType!==Node.ELEMENT_NODE)continue;let me=q(De);if(me!=null){h(me),J.current=me,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",me);break}}for(let De of ue.removedNodes){if(De.nodeType!==Node.ELEMENT_NODE)continue;let me=q(De);if(me!=null){h(null),J.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",me);break}}}});return ce.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ce.disconnect()},[]),yo.useEffect(()=>{let{scrollX:q,scrollY:ce}=window;I(x.left+q),A(x.top+ce);},[x.left,x.top]),y==null)return null;let ke="0";typeof window!="undefined"&&(ke=window.getComputedStyle(y).borderRadius);let Cr=tr({props:a,alignAttr:C,sideAttr:T});return jsxRuntime.jsxs(ee__namespace.Root,s(i({defaultOpen:!0},F),{children:[jsxRuntime.jsx(ee__namespace.Anchor,{virtualRef:J}),jsxRuntime.jsx(ee__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(g,i({animation:`${nr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ke,height:x.height,left:K,top:j,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(ee__namespace.Content,s(i({asChild:!0},w),{ref:f,children:jsxRuntime.jsxs(b,s(i({animation:`${nr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",k],pointerEvents:"auto",style:r},B),{children:[jsxRuntime.jsx(er,{style:Cr}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(ee__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(Pe,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(pe,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.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(S.Body2,s(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(D.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(S.Body2,s(i({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,s(i({part:"title"},o),{children:e}))};function ar(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:l}=u,d=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var F,C,v,T,E,K;let{handleDismiss:f}=xe(o,{onDismiss:t}),{handlePrimary:y,handleSecondary:x}=ne(l,{onPrimary:r,onSecondary:a}),h=(F=l.props)!=null?F:{},w=(v=(C=l.primaryButton)==null?void 0:C.title)!=null?v:l.primaryButtonTitle,k=(E=(T=l.secondaryButton)==null?void 0:T.title)!=null?E:l.secondaryButtonTitle,B=l.$state.blocked;return jsxRuntime.jsxs($,s(i(i({anchor:l.selector,collisionPadding:12,onOpenAutoFocus:I=>I.preventDefault(),onPointerDownOutside:I=>I.preventDefault(),onInteractOutside:I=>I.preventDefault()},d),h),{onEscapeKeyDown:I=>{typeof n=="function"&&n(I),I.defaultPrevented||f(I);},children:[e&&jsxRuntime.jsx($.Close,{onClick:f}),jsxRuntime.jsx($.Media,{src:(K=l.videoUri)!=null?K:l.imageUri,type:l.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:l.title}),jsxRuntime.jsx($.Subtitle,{color:"neutral.400",children:l.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:B,onClick:x,title:k}),jsxRuntime.jsx($.Primary,{disabled:B,onClick:y,title:w})]})]}),l.id)}var de=new Set;function Ve(e,o=!0){let t=yo.useCallback(()=>{de.has(e==null?void 0:e.id)&&de.delete(e==null?void 0:e.id);},[de,o]),n=yo.useCallback(()=>{o&&(e!=null&&e.isVisible)&&!de.has(e.id)&&de.add(e.id);},[de,o]);yo.useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=de.size>0?de.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id):!0}}function Oo(a){var l=a,{flowId:e,onComplete:o,variables:t,part:n}=l,r=m(l,["flowId","onComplete","variables","part"]);yo.useState(!1);let {flow:u}=ae(e,{variables:t});xe(u,{onComplete:o});let{isCurrentModal:f}=Ve(u);if(!(u!=null&&u.isVisible)||!f)return null;let y=u.getCurrentStep();return y==null||y.start(),jsxRuntime.jsx(ar,i({"data-flow-id":u.id,flow:u,part:["tour",n],step:y},r))}function sr(e){var u,f,y;let{frigade:o}=yo.useContext(V),[,t]=yo.useState(!1),n,r=yo.useCallback(x=>{o.getCollection(e).then(()=>{x();});let h=()=>{clearTimeout(n),n=setTimeout(()=>{t(w=>!w),x();},100);};return o.onStateChange(h),()=>{o.removeStateChangeHandler(h);}},[e]),a=yo.useSyncExternalStore(r,()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x},()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x}),d=(y=((f=(u=a==null?void 0:a.flows)==null?void 0:u.map(x=>s(i({},x),{flow:o.getFlowSync(x.flowId)})))!=null?f:[]).find(({flow:x})=>x.isVisible))==null?void 0:y.flowId,{flow:c}=ae(d);return {collection:a,currentFlow:c}}function Io(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var c,u,f;let a={ANNOUNCEMENT:Ho,BANNER:xo,CARD:b,CHECKLIST:Xe,EMBEDDED_TIP:b,FORM:Re,NPS_SURVEY:Le,SURVEY:Le,TOUR:Oo},{currentFlow:l}=sr(e),d=(u=a[(c=l==null?void 0:l.rawData)==null?void 0:c.flowType])!=null?u:null;return l==null||d==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===js.FlowType.FORM?jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(Re,{flowId:l.id,as:O},l.id)})):jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(d,{flowId:l.id},l.id)}))}function $e(){let{frigade:e}=yo.useContext(V);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function pr(){let[e,o]=yo.useState(),{frigade:t}=$e();return yo.useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsxRuntime.jsx(Io,{as:null,collectionId:e})}var V=yo.createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function dr(){let{frigade:e}=$e();return yo.useEffect(()=>{L(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}function fr(l){var d=l,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=d,a=m(d,["children","css","defaultCollection","navigate","theme"]);let c=r?co(r):{},u=yo.useRef(new Map),f=yo.useRef(),[y,x]=yo.useState(!1),h=yo.useMemo(()=>(x(!1),f.current=void 0,new js.Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides})),[a.userId,a.groupId,a.apiKey]);yo.useEffect(()=>{if(a.__flowStateOverrides){let C=h.getConfig();C.__flowStateOverrides=a.__flowStateOverrides,h.reload(C);}},[a.__flowStateOverrides]);function w(){let C=[...u.current.entries()].map(([v,T])=>[v,T.callback]);h.batchRegister(C),x(!0);}function k(C,v){if(f.current&&clearTimeout(f.current),y){u.current.has(C)?h.getFlow(C).then(T=>v(T.isVisible)):(h.getFlow(C).then(T=>T.register(v)),u.current.set(C,{callback:v}));return}u.current.has(C)||u.current.set(C,{callback:v}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>w(),0);}function B(C){u.current.has(C)&&h.getFlow(C).then(v=>{u.current.delete(C),v==null||v.unregister();});}let F=n!=null?n:(C,v="_self")=>{window.open(C,v);};return yo.useEffect(()=>()=>{h.destroy();},[]),jsxRuntime.jsxs(V.Provider,{value:s(i({navigate:F},a),{frigade:h,registerComponent:k,unregisterComponent:B,hasInitialized:y}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i(i({},uo),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:R,children:[t&&jsxRuntime.jsx(pr,{}),e]}),a.preloadImages!==!1&&jsxRuntime.jsx(dr,{})]})}function ae(e,o){let{frigade:t}=yo.useContext(V),[,n]=yo.useState(!1),r=yo.useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=c=>{c.id===e&&setTimeout(()=>{n(u=>!u),l();},0);};return t==null||t.onStateChange(d),()=>{t.removeStateChangeHandler(d);}},[e]),a=yo.useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a,isLoading:t!=null&&t.hasFailedToLoad()?!1:!a}}function G(u){var f=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:l,variables:d}=f,c=m(f,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var j,J;let{flow:y}=ae(t,{variables:d}),A=i(i({},(j=y==null?void 0:y.props)!=null?j:{}),c),{dismissible:x=!1,forceMount:h=!1}=A,w=m(A,["dismissible","forceMount"]),k=y==null?void 0:y.getCurrentStep(),{handleDismiss:B}=xe(y,{onComplete:n,onDismiss:r}),{handlePrimary:F,handleSecondary:C}=ne(k,{onPrimary:a,onSecondary:l}),v=(w==null?void 0:w.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((J=y==null?void 0:y.rawData)==null?void 0:J.flowType),{isCurrentModal:T}=Ve(y,v),E=h&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!E||!E&&!T)return null;(E||!y.isCompleted&&!y.isSkipped)&&k.start();let K=e===null?yo.Fragment:e!=null?e:g,I=s(i({},w),{"data-flow-id":y.id});return jsxRuntime.jsx(K,s(i({},e===null?{}:I),{children:o({flow:y,handleDismiss:B,handlePrimary:F,handleSecondary:C,parentProps:{dismissible:x,flowId:t,variables:d,containerProps:I},step:k})}))}function xr(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(G,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:l,parentProps:{dismissible:d},step:c})=>{var y,x,h,w;let u=(x=(y=c.primaryButton)==null?void 0:y.title)!=null?x:c.primaryButtonTitle,f=(w=(h=c.secondaryButton)==null?void 0:h.title)!=null?w:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:d,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:f,onClick:l}),jsxRuntime.jsx(b.Primary,{title:u,onClick:a})]})]})}}))}var b=yo__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(xr,i({flowId:o},t));let l=(d=t.as)!=null?d:P.Column;return jsxRuntime.jsx(l,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(D.Plain,s(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Pe,{height:"20",fill:"currentColor"})}));b.Header=a=>{var l=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=l,r=m(l,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};b.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,s(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,s(i({display:"block",part:"title"},o),{children:e}))};var so={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function br(e){let o=Object.fromEntries(so.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(so.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!so.content.some(a=>a===r)&&!so.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Xi=react.keyframes`
|
|
86
|
+
`;function ir(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(l){var d=l,{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:f}=to(),{node:y,rect:x,ref:h}=to(),ta=rr(a,u),{contentProps:w,otherProps:Sr}=ta,Ao=Sr,{part:k}=Ao,B=m(Ao,["part"]),{rootProps:F}=ta,[C,v]=yo.useState(w.align),[T,D]=yo.useState(w.side),[K,I]=yo.useState(0),[j,A]=yo.useState(0);if(c!==null){let q=c.getAttribute("data-align"),ce=c.getAttribute("data-side");C!==q&&v(q),T!==ce&&D(ce);}let J=yo.useRef(null);if(yo.useEffect(()=>{let q=document.querySelector(e);q!=null?(h(q),J.current=q):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),yo.useEffect(()=>{function q(be){if(be.matches(e))return ir(be)?be:null;let ue=be.querySelectorAll(e);return ue.length>0&&ir(ue[0])?ue[0]:null}let ce=new MutationObserver(be=>{for(let ue of be)if(ue.type==="childList"){for(let Ee of ue.addedNodes){if(Ee.nodeType!==Node.ELEMENT_NODE)continue;let me=q(Ee);if(me!=null){h(me),J.current=me,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",me);break}}for(let Ee of ue.removedNodes){if(Ee.nodeType!==Node.ELEMENT_NODE)continue;let me=q(Ee);if(me!=null){h(null),J.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",me);break}}}});return ce.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ce.disconnect()},[]),yo.useEffect(()=>{let{scrollX:q,scrollY:ce}=window;I(x.left+q),A(x.top+ce);},[x.left,x.top]),y==null)return null;let ke="0";typeof window!="undefined"&&(ke=window.getComputedStyle(y).borderRadius);let Cr=tr({props:a,alignAttr:C,sideAttr:T});return jsxRuntime.jsxs(ee__namespace.Root,s(i({defaultOpen:!0},F),{children:[jsxRuntime.jsx(ee__namespace.Anchor,{virtualRef:J}),jsxRuntime.jsx(ee__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(g,i({animation:`${nr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ke,height:x.height,left:K,top:j,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(ee__namespace.Content,s(i({asChild:!0},w),{ref:f,children:jsxRuntime.jsxs(b,s(i({animation:`${nr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",k],pointerEvents:"auto",style:r},B),{children:[jsxRuntime.jsx(er,{style:Cr}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(ee__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(E.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(Pe,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(de,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(E.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(S.Body2,s(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(E.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(S.Body2,s(i({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,s(i({part:"title"},o),{children:e}))};function ar(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:l}=u,d=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var F,C,v,T,D,K;let{handleDismiss:f}=xe(o,{onDismiss:t}),{handlePrimary:y,handleSecondary:x}=ne(l,{onPrimary:r,onSecondary:a}),h=(F=l.props)!=null?F:{},w=(v=(C=l.primaryButton)==null?void 0:C.title)!=null?v:l.primaryButtonTitle,k=(D=(T=l.secondaryButton)==null?void 0:T.title)!=null?D:l.secondaryButtonTitle,B=l.$state.blocked;return jsxRuntime.jsxs($,s(i(i({anchor:l.selector,collisionPadding:12,onOpenAutoFocus:I=>I.preventDefault(),onPointerDownOutside:I=>I.preventDefault(),onInteractOutside:I=>I.preventDefault()},d),h),{onEscapeKeyDown:I=>{typeof n=="function"&&n(I),I.defaultPrevented||f(I);},children:[e&&jsxRuntime.jsx($.Close,{onClick:f}),jsxRuntime.jsx($.Media,{src:(K=l.videoUri)!=null?K:l.imageUri,type:l.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:l.title}),jsxRuntime.jsx($.Subtitle,{color:"neutral.400",children:l.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:B,onClick:x,title:k}),jsxRuntime.jsx($.Primary,{disabled:B,onClick:y,title:w})]})]}),l.id)}var le=new Set;function Ve(e,o=!0){let t=yo.useCallback(()=>{le.has(e==null?void 0:e.id)&&le.delete(e==null?void 0:e.id);},[le,o]),n=yo.useCallback(()=>{o&&(e!=null&&e.isVisible)&&!le.has(e.id)&&le.add(e.id);},[le,o]);yo.useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=le.size>0?le.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||le.size==0:!0}}function Oo(a){var l=a,{flowId:e,onComplete:o,variables:t,part:n}=l,r=m(l,["flowId","onComplete","variables","part"]);yo.useState(!1);let {flow:u}=ae(e,{variables:t});xe(u,{onComplete:o});let{isCurrentModal:f}=Ve(u);if(!(u!=null&&u.isVisible)||!f)return null;let y=u.getCurrentStep();return y==null||y.start(),jsxRuntime.jsx(ar,i({"data-flow-id":u.id,flow:u,part:["tour",n],step:y},r))}function sr(e){var u,f,y;let{frigade:o}=yo.useContext(V),[,t]=yo.useState(!1),n,r=yo.useCallback(x=>{o.getCollection(e).then(()=>{x();});let h=()=>{clearTimeout(n),n=setTimeout(()=>{t(w=>!w),x();},100);};return o.onStateChange(h),()=>{o.removeStateChangeHandler(h);}},[e]),a=yo.useSyncExternalStore(r,()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x},()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x}),d=(y=((f=(u=a==null?void 0:a.flows)==null?void 0:u.map(x=>s(i({},x),{flow:o.getFlowSync(x.flowId)})))!=null?f:[]).find(({flow:x})=>x.isVisible))==null?void 0:y.flowId,{flow:c}=ae(d);return {collection:a,currentFlow:c}}function Io(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var c,u,f;let a={ANNOUNCEMENT:Ho,BANNER:xo,CARD:b,CHECKLIST:Xe,EMBEDDED_TIP:b,FORM:Re,NPS_SURVEY:Le,SURVEY:Le,TOUR:Oo},{currentFlow:l}=sr(e),d=(u=a[(c=l==null?void 0:l.rawData)==null?void 0:c.flowType])!=null?u:null;return l==null||d==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===js.FlowType.FORM?jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(Re,{flowId:l.id,as:O},l.id)})):jsxRuntime.jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(d,{flowId:l.id},l.id)}))}function $e(){let{frigade:e}=yo.useContext(V);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function pr(){let[e,o]=yo.useState(),{frigade:t}=$e();return yo.useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsxRuntime.jsx(Io,{as:null,collectionId:e})}var V=yo.createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function dr(){let{frigade:e}=$e();return yo.useEffect(()=>{L(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}function fr(l){var d=l,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=d,a=m(d,["children","css","defaultCollection","navigate","theme"]);let c=r?co(r):{},u=yo.useRef(new Map),f=yo.useRef(),[y,x]=yo.useState(!1),h=yo.useMemo(()=>(x(!1),f.current=void 0,new js.Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides})),[a.userId,a.groupId,a.apiKey]);yo.useEffect(()=>{if(a.__flowStateOverrides){let C=h.getConfig();C.__flowStateOverrides=a.__flowStateOverrides,h.reload(C);}},[a.__flowStateOverrides]);function w(){let C=[...u.current.entries()].map(([v,T])=>[v,T.callback]);h.batchRegister(C),x(!0);}function k(C,v){if(f.current&&clearTimeout(f.current),y){u.current.has(C)?h.getFlow(C).then(T=>v(T.isVisible)):(h.getFlow(C).then(T=>T.register(v)),u.current.set(C,{callback:v}));return}u.current.has(C)||u.current.set(C,{callback:v}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>w(),0);}function B(C){u.current.has(C)&&h.getFlow(C).then(v=>{u.current.delete(C),v==null||v.unregister();});}let F=n!=null?n:(C,v="_self")=>{window.open(C,v);};return yo.useEffect(()=>()=>{h.destroy();},[]),jsxRuntime.jsxs(V.Provider,{value:s(i({navigate:F},a),{frigade:h,registerComponent:k,unregisterComponent:B,hasInitialized:y}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i(i({},uo),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:R,children:[t&&jsxRuntime.jsx(pr,{}),e]}),a.preloadImages!==!1&&jsxRuntime.jsx(dr,{})]})}function ae(e,o){let{frigade:t}=yo.useContext(V),[,n]=yo.useState(!1),r=yo.useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=c=>{c.id===e&&setTimeout(()=>{n(u=>!u),l();},0);};return t==null||t.onStateChange(d),()=>{t.removeStateChangeHandler(d);}},[e]),a=yo.useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a,isLoading:t!=null&&t.hasFailedToLoad()?!1:!a}}function G(u){var f=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:l,variables:d}=f,c=m(f,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var j,J;let{flow:y}=ae(t,{variables:d}),A=i(i({},(j=y==null?void 0:y.props)!=null?j:{}),c),{dismissible:x=!1,forceMount:h=!1}=A,w=m(A,["dismissible","forceMount"]),k=y==null?void 0:y.getCurrentStep(),{handleDismiss:B}=xe(y,{onComplete:n,onDismiss:r}),{handlePrimary:F,handleSecondary:C}=ne(k,{onPrimary:a,onSecondary:l}),v=(w==null?void 0:w.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((J=y==null?void 0:y.rawData)==null?void 0:J.flowType),{isCurrentModal:T}=Ve(y,v),D=h&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!D||!D&&!T)return null;(D||!y.isCompleted&&!y.isSkipped)&&k.start();let K=e===null?yo.Fragment:e!=null?e:g,I=s(i({},w),{"data-flow-id":y.id});return jsxRuntime.jsx(K,s(i({},e===null?{}:I),{children:o({flow:y,handleDismiss:B,handlePrimary:F,handleSecondary:C,parentProps:{dismissible:x,flowId:t,variables:d,containerProps:I},step:k})}))}function xr(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(G,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:l,parentProps:{dismissible:d},step:c})=>{var y,x,h,w;let u=(x=(y=c.primaryButton)==null?void 0:y.title)!=null?x:c.primaryButtonTitle,f=(w=(h=c.secondaryButton)==null?void 0:h.title)!=null?w:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:d,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:f,onClick:l}),jsxRuntime.jsx(b.Primary,{title:u,onClick:a})]})]})}}))}var b=yo__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(xr,i({flowId:o},t));let l=(d=t.as)!=null?d:P.Column;return jsxRuntime.jsx(l,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(E.Plain,s(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Pe,{height:"20",fill:"currentColor"})}));b.Header=a=>{var l=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=l,r=m(l,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(de,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(E.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(E.Secondary,i({title:o,onClick:e},t))};b.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,s(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,s(i({display:"block",part:"title"},o),{children:e}))};var so={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function br(e){let o=Object.fromEntries(so.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(so.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!so.content.some(a=>a===r)&&!so.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Xi=react.keyframes`
|
|
87
87
|
from {
|
|
88
88
|
opacity: 0;
|
|
89
89
|
}
|
|
@@ -93,14 +93,14 @@ var Vo=Object.defineProperty,wr=Object.defineProperties;var Fr=Object.getOwnProp
|
|
|
93
93
|
to {
|
|
94
94
|
opacity: 1;
|
|
95
95
|
}
|
|
96
|
-
`;function O(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:l,contentProps:d,otherProps:f}=br(n),y=f,{zIndex:c}=y,u=m(y,["zIndex"]);return jsxRuntime.jsx(
|
|
96
|
+
`;function O(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:l,contentProps:d,otherProps:f}=br(n),y=f,{zIndex:c}=y,u=m(y,["zIndex"]);return jsxRuntime.jsx(___namespace.Root,s(i({defaultOpen:!0,modal:t},l),{children:jsxRuntime.jsx(___namespace.Portal,{children:jsxRuntime.jsxs(g,{animation:`${Xi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c!=null?c:10,children:[t&&jsxRuntime.jsx(___namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(___namespace.Content,s(i({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},d),{children:jsxRuntime.jsx(b,s(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}O.Dismiss=e=>jsxRuntime.jsx(___namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(E.Plain,s(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(Pe,{height:"20",fill:"currentColor"})}))});O.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Description,{asChild:!0,children:jsxRuntime.jsx(S.Body2,s(i({part:"subtitle"},o),{children:e}))})};O.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(de,i({borderRadius:"md",src:e},o))};O.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(E.Primary,i({title:o,onClick:e},t))};O.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?R.colors.primary.surface:R.colors.neutral[700],part:e===r?"progress-dot-selected":"progress-dot"},r));return jsxRuntime.jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};O.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(E.Secondary,i({title:o,onClick:e},t))};O.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Title,{asChild:!0,children:jsxRuntime.jsx(S.H4,s(i({part:"title"},o),{children:e}))})};O.displayName="Dialog";var Pr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Ho(n){var r=n,{flowId:e,part:o}=r,t=m(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([d])=>Pr.some(c=>d===c))),l=Object.fromEntries(Object.entries(t).filter(([d])=>Pr.indexOf(d)===-1));return jsxRuntime.jsx(G,s(i({as:null,flowId:e},a),{children:({flow:d,handleDismiss:c,handlePrimary:u,handleSecondary:f,parentProps:{containerProps:y,dismissible:x},step:h})=>{var C,v,T,D,K,I;let w=(C=h.props)!=null?C:{},k=(T=(v=h.primaryButton)==null?void 0:v.title)!=null?T:h.primaryButtonTitle,B=(K=(D=h.secondaryButton)==null?void 0:D.title)!=null?K:h.secondaryButtonTitle,F=h.$state.blocked;return jsxRuntime.jsx(O,s(i(i({part:["announcement",o],textAlign:"center"},y),l),{onEscapeKeyDown:j=>{if(t.dismissible===!1){j.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(j),j.defaultPrevented||c(j);},children:jsxRuntime.jsxs(P.Column,s(i({gap:5,part:"announcement-step"},w),{children:[x&&jsxRuntime.jsx(O.Dismiss,{onClick:c}),jsxRuntime.jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(O.Title,{children:h.title}),jsxRuntime.jsx(O.Subtitle,{children:h.subtitle})]}),jsxRuntime.jsx(O.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(I=h.videoUri)!=null?I:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image",width:"100%"}),jsxRuntime.jsx(O.ProgressDots,{current:d.getCurrentStepIndex(),total:d.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx(O.Secondary,{disabled:F,onClick:f,title:B}),k&&jsxRuntime.jsx(O.Primary,{disabled:F,onClick:u,title:k})]})]}))}))}}))}function Zi(){let{userId:e,frigade:o}=yo.useContext(V);function t(r){return L(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return L(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function ea(){var r;let{frigade:e}=yo.useContext(V);function o(a){return L(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,l){return L(this,null,function*(){yield e.track(a,l);})}function n(a,l){return L(this,null,function*(){yield e.group(a,l);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
|
|
97
97
|
|
|
98
98
|
exports.FrigadeJS = js__namespace;
|
|
99
99
|
exports.Announcement = Ho;
|
|
100
100
|
exports.Banner = xo;
|
|
101
101
|
exports.BaseField = Q;
|
|
102
102
|
exports.Box = g;
|
|
103
|
-
exports.Button =
|
|
103
|
+
exports.Button = E;
|
|
104
104
|
exports.Card = b;
|
|
105
105
|
exports.Checklist = qe;
|
|
106
106
|
exports.Collection = Io;
|
|
@@ -110,7 +110,7 @@ exports.Flow = G;
|
|
|
110
110
|
exports.Form = Re;
|
|
111
111
|
exports.Image = ro;
|
|
112
112
|
exports.Label = wo;
|
|
113
|
-
exports.Media =
|
|
113
|
+
exports.Media = de;
|
|
114
114
|
exports.Progress = Ie;
|
|
115
115
|
exports.Provider = fr;
|
|
116
116
|
exports.RadioField = vo;
|