@frigade/react 2.4.13 → 2.4.15
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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import * as L from '@radix-ui/react-select';
|
|
|
18
18
|
import * as eo from '@radix-ui/react-checkbox';
|
|
19
19
|
import * as oe from '@radix-ui/react-popover';
|
|
20
20
|
|
|
21
|
-
var zo=Object.defineProperty,kr=Object.defineProperties;var Er=Object.getOwnPropertyDescriptors;var Ge=Object.getOwnPropertySymbols;var _o=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable;var No=(e,o,t)=>o in e?zo(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)&&No(e,t,o[t]);if(Ge)for(var t of Ge(o))Go.call(o,t)&&No(e,t,o[t]);return e},l=(e,o)=>kr(e,Er(o));var Dr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var n in e)_o.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Ge)for(var n of Ge(e))o.indexOf(n)<0&&Go.call(e,n)&&(t[n]=e[n]);return t};var te=(e,o)=>{for(var t in o)zo(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{p(t.next(c));}catch(u){r(u);}},s=c=>{try{p(t.throw(c));}catch(u){r(u);}},p=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,s);p((t=t.apply(e,o)).next());});function Pe(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var Ko={borderWidths:{md:"1px"}};var Ue=[5,10,20,35,50,65,80,95,98],jo=[...Ue],uo=[...Ue];jo[4]=40;uo[4]=60;var Or={blue:{h:213,s:100,l:Ue},gray:{h:220,s:10,l:Ue},green:{h:141,s:90,l:jo},red:{h:9,s:90,l:uo},yellow:{h:50,s:90,l:uo}};var A={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Or))A[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var Jo=l(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Xo={md:"8px",lg:"20px",round:"50%"};var d=e=>`var(--fr-colors-${e})`,qo={negative:{100:d("red-100"),200:d("red-200"),300:d("red-300"),400:d("red-400"),500:d("red-500"),600:d("red-600"),700:d("red-700"),800:d("red-800"),900:d("red-900"),background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500"),active:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")},focus:{background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500")},hover:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")}},neutral:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("neutral-800"),foreground:d("black"),surface:d("neutral-700"),active:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},focus:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},hover:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")}},positive:{100:d("green-100"),200:d("green-200"),300:d("green-300"),400:d("green-400"),500:d("green-500"),600:d("green-600"),700:d("green-700"),800:d("green-800"),900:d("green-900"),background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500"),active:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")},focus:{background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500")},hover:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")}},primary:{100:d("blue-100"),200:d("blue-200"),300:d("blue-300"),400:d("blue-400"),500:d("blue-500"),600:d("blue-600"),700:d("blue-700"),800:d("blue-800"),900:d("blue-900"),background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500"),active:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")},focus:{background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500")},hover:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")}},secondary:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900"),active:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")},focus:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900")},hover:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")}}};var Zo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ir="px",Hr=e=>typeof e=="number"?`${4*e}${Ir}`:e,Mr=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Yo=Object.fromEntries(Mr.map(e=>[e,Hr(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 Ke=l(i(l(i({},Ko),{colors:i(i({},Jo),qo)}),Qo),{radii:Xo,shadows:Zo,space:Yo});function Oe(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,Oe(p,s,t)):n[s]=p,n},{})}function mo(e){let o=Oe(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 et(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]=et(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var fo=mo(Ke),R=et(Ke);var Ar=new Set(["alt","size","src"]),Lr=Wr.all.filter(e=>e.indexOf("-")!=0&&!Ar.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Vr=Object.fromEntries(Lr),je=Oe(R.colors),$r={color:je,backgroundColor:je,borderColor:je,border:i(i({},R.borderWidths),je),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},ot=i(i({},Vr),$r),tt={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"]},rt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Nr(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 nt=new Map(Object.entries(ot).map(([e,o])=>[e,Nr(o)])),zr=new Map(Object.entries(tt).map(([e,o])=>[e,new Set(o)])),_r=new Set(["height","width"]),Gr=new Set(["canvas","embed","iframe","img","input","object","video"]);function it(e){let[o,t]=e.split(":");return [o,rt.has(t)?t:null]}function at(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let p=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([a,s])=>{let[p,c]=it(a),u=zr.get(p);u!=null&&(u.forEach(y=>{let b=`${y}${c?":"+c:""}`;t[b]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[p,c]=it(a),u=nt.get(p);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let y=s.split(" ");r(c)[p]=y.map(b=>{var x;return (x=u.get(b.toString()))!=null?x:b}).join(" ");}else u.has(s.toString())?r(c)[p]=u.get(s.toString()):r(c)[p]=s;(typeof o!="string"||!Gr.has(o)||!_r.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&nt.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function Kr(){if(typeof window=="undefined"){let{JSDOM:e}=Dr("jsdom");return new e("<!DOCTYPE html>").window}return window}function st(e){return e?{__html:Ur(Kr()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Jr(e){return e&&`fr-${e}`}function dt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>dt(o)).join(" "):Jr(e))}function Xr(p,s){var c=p,{as:e,children:o,className:t,css:n={},part:r}=c,a=f(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:y,unmatchedProps:b}=at(a,u),x=dt(r),m=t||x?clsx(t,x):void 0,F=[{boxSizing:"border-box"},y,n];return typeof o=="string"?jsx(u,l(i({className:m,css:F},b),{ref:s,dangerouslySetInnerHTML:st(o)})):jsx(u,l(i({className:m,css:F},b),{ref:s,children:o}))}var g=ho.forwardRef(Xr);var I={};te(I,{Link:()=>vn,Plain:()=>Tn,Primary:()=>wn,Secondary:()=>Fn});var C={};te(C,{Body1:()=>mn,Body2:()=>fn,Caption:()=>gn,Display1:()=>sn,Display2:()=>ln,H1:()=>pn,H2:()=>dn,H3:()=>cn,H4:()=>un});var go={};te(go,{Body1:()=>tn,Body2:()=>rn,Caption:()=>nn,Display1:()=>qr,Display2:()=>Zr,H1:()=>Yr,H2:()=>Qr,H3:()=>en,H4:()=>on});var re={color:"neutral.foreground",fontFamily:"default",margin:"0"},qr=l(i({},re),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Zr=l(i({},re),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Yr=l(i({},re),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Qr=l(i({},re),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),en=l(i({},re),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),on=l(i({},re),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),tn=l(i({},re),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),rn=l(i({},re),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),nn=l(i({},re),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var an=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ne=Object.fromEntries(an.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ho.forwardRef((p,s)=>{var c=p,{as:n=o,children:r}=c,a=f(c,["as","children"]);return jsx(g,l(i(i({as:n},go[e]),a),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),sn=ne.Display1,ln=ne.Display2,pn=ne.H1,dn=ne.H2,cn=ne.H3,un=ne.H4,mn=ne.Body1,fn=ne.Body2,gn=ne.Caption;var xo={};te(xo,{Link:()=>Pn,Plain:()=>Cn,Primary:()=>hn,Secondary:()=>bn,loadingCSSStyle:()=>yo});var Je={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},hn=l(i({},Je),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),bn=l(i({},Je),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Pn=l(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Cn=l(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Sn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),yo={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:Sn+" 1s ease infinite"}};function Xe(s){var p=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,a=f(p,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxs(g,l(i(l(i({as:e!=null?e:"button",part:[`button-${c}`,t]},xo[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?yo:{})}),a),{loading:void 0,children:[o,n&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function wn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Primary",children:e}))}function Fn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Secondary",children:e}))}function vn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Link",children:e}))}function Tn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Plain",children:e}))}var P={};te(P,{Column:()=>kn,Row:()=>Rn});var Rn=ho.forwardRef((e,o)=>jsx(g,l(i({display:"flex",flexDirection:"row"},e),{ref:o}))),kn=ho.forwardRef((e,o)=>jsx(g,l(i({display:"flex",flexDirection:"column"},e),{ref:o})));function bo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=f(a,["dismissible","flowId","part"]);return jsx(j,l(i({as:null,flowId:o},n),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:y})=>{var S,B,v,k,E;let b=(S=y.props)!=null?S:{},x=(v=(B=y.primaryButton)==null?void 0:B.title)!=null?v:y.primaryButtonTitle,m=(E=(k=y.secondaryButton)==null?void 0:k.title)!=null?E:y.secondaryButtonTitle,F=y.$state.blocked;return jsxs(h,l(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),b),{children:[y.imageUri&&jsx(g,{as:"img",part:"image",src:y.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:y.title}),jsx(h.Subtitle,{part:"subtitle",children:y.subtitle})]}),jsx(h.Secondary,{disabled:F,title:m,onClick:c}),jsx(h.Primary,{disabled:F,title:x,onClick:p}),e&&jsx(h.Dismiss,{onClick:s})]}))}}))}var Ye={};te(Ye,{Carousel:()=>Dt,Collapsible:()=>Ze,CollapsibleStep:()=>We});var He={};te(He,{Bar:()=>Ce,Dots:()=>yt,Segments:()=>ht});function Ce(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(g,l(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function yt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,p)=>jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?R.colors.blue500:R.colors.blue800},p));return jsx(g,l(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function ht(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=[...Array(o)].map((s,p)=>jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(P.Row,l(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Pt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function En(){return jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ct(t){var n=t,{checked:e=!1}=n,o=f(n,["checked"]);return jsx(g,l(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&&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:jsx(En,{})})}))}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(H),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:useCallback((a,s,p=!0)=>W(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,s)=>W(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function wt({onPrimary:e,onSecondary:o,step:t}){var u,y;let{handlePrimary:n,handleSecondary:r}=ie(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:s,skipped:p}=t.$state,c=s||p||!a?jsx(Ct,{checked:s||p,marginLeft:"auto"}):jsx(g,{as:Pt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(h,{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:[jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(h.Title,{children:t.title}),jsx(h.Subtitle,{children:t.subtitle}),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:[jsx(h.Secondary,{disabled:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(h.Primary,{disabled:a,onClick:n,title:(y=t.primaryButton)==null?void 0:y.title})]})]})}function vt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Bt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var Rt=keyframes`
|
|
21
|
+
var zo=Object.defineProperty,kr=Object.defineProperties;var Er=Object.getOwnPropertyDescriptors;var Ge=Object.getOwnPropertySymbols;var _o=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable;var No=(e,o,t)=>o in e?zo(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)&&No(e,t,o[t]);if(Ge)for(var t of Ge(o))Go.call(o,t)&&No(e,t,o[t]);return e},l=(e,o)=>kr(e,Er(o));var Dr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var n in e)_o.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Ge)for(var n of Ge(e))o.indexOf(n)<0&&Go.call(e,n)&&(t[n]=e[n]);return t};var te=(e,o)=>{for(var t in o)zo(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{p(t.next(c));}catch(u){r(u);}},s=c=>{try{p(t.throw(c));}catch(u){r(u);}},p=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,s);p((t=t.apply(e,o)).next());});function Pe(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var Ko={borderWidths:{md:"1px"}};var Ue=[5,10,20,35,50,65,80,95,98],jo=[...Ue],uo=[...Ue];jo[4]=40;uo[4]=60;var Or={blue:{h:213,s:100,l:Ue},gray:{h:220,s:10,l:Ue},green:{h:141,s:90,l:jo},red:{h:9,s:90,l:uo},yellow:{h:50,s:90,l:uo}};var A={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Or))A[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var Jo=l(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Xo={md:"8px",lg:"20px",round:"50%"};var d=e=>`var(--fr-colors-${e})`,qo={negative:{100:d("red-100"),200:d("red-200"),300:d("red-300"),400:d("red-400"),500:d("red-500"),600:d("red-600"),700:d("red-700"),800:d("red-800"),900:d("red-900"),background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500"),active:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")},focus:{background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500")},hover:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")}},neutral:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("neutral-800"),foreground:d("black"),surface:d("neutral-700"),active:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},focus:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},hover:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")}},positive:{100:d("green-100"),200:d("green-200"),300:d("green-300"),400:d("green-400"),500:d("green-500"),600:d("green-600"),700:d("green-700"),800:d("green-800"),900:d("green-900"),background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500"),active:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")},focus:{background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500")},hover:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")}},primary:{100:d("blue-100"),200:d("blue-200"),300:d("blue-300"),400:d("blue-400"),500:d("blue-500"),600:d("blue-600"),700:d("blue-700"),800:d("blue-800"),900:d("blue-900"),background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500"),active:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")},focus:{background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500")},hover:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")}},secondary:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900"),active:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")},focus:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900")},hover:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")}}};var Zo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ir="px",Hr=e=>typeof e=="number"?`${4*e}${Ir}`:e,Mr=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Yo=Object.fromEntries(Mr.map(e=>[e,Hr(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 Ke=l(i(l(i({},Ko),{colors:i(i({},Jo),qo)}),Qo),{radii:Xo,shadows:Zo,space:Yo});function Oe(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,Oe(p,s,t)):n[s]=p,n},{})}function mo(e){let o=Oe(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 et(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]=et(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var fo=mo(Ke),R=et(Ke);var Ar=new Set(["alt","size","src"]),Lr=Wr.all.filter(e=>e.indexOf("-")!=0&&!Ar.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Vr=Object.fromEntries(Lr),je=Oe(R.colors),$r={color:je,backgroundColor:je,borderColor:je,border:i(i({},R.borderWidths),je),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},ot=i(i({},Vr),$r),tt={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"]},rt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Nr(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 nt=new Map(Object.entries(ot).map(([e,o])=>[e,Nr(o)])),zr=new Map(Object.entries(tt).map(([e,o])=>[e,new Set(o)])),_r=new Set(["height","width"]),Gr=new Set(["canvas","embed","iframe","img","input","object","video"]);function it(e){let[o,t]=e.split(":");return [o,rt.has(t)?t:null]}function at(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let p=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([a,s])=>{let[p,c]=it(a),u=zr.get(p);u!=null&&(u.forEach(y=>{let b=`${y}${c?":"+c:""}`;t[b]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[p,c]=it(a),u=nt.get(p);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let y=s.split(" ");r(c)[p]=y.map(b=>{var x;return (x=u.get(b.toString()))!=null?x:b}).join(" ");}else u.has(s.toString())?r(c)[p]=u.get(s.toString()):r(c)[p]=s;(typeof o!="string"||!Gr.has(o)||!_r.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&nt.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function Kr(){if(typeof window=="undefined"){let{JSDOM:e}=Dr("jsdom");return new e("<!DOCTYPE html>").window}return window}function st(e){return e?{__html:Ur(Kr()).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 Jr(e){return e&&`fr-${e}`}function dt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>dt(o)).join(" "):Jr(e))}function Xr(p,s){var c=p,{as:e,children:o,className:t,css:n={},part:r}=c,a=f(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:y,unmatchedProps:b}=at(a,u),x=dt(r),m=t||x?clsx(t,x):void 0,F=[{boxSizing:"border-box"},y,n];return typeof o=="string"?jsx(u,l(i({className:m,css:F},b),{ref:s,dangerouslySetInnerHTML:st(o)})):jsx(u,l(i({className:m,css:F},b),{ref:s,children:o}))}var g=ho.forwardRef(Xr);var I={};te(I,{Link:()=>vn,Plain:()=>Tn,Primary:()=>wn,Secondary:()=>Fn});var C={};te(C,{Body1:()=>mn,Body2:()=>fn,Caption:()=>gn,Display1:()=>sn,Display2:()=>ln,H1:()=>pn,H2:()=>dn,H3:()=>cn,H4:()=>un});var go={};te(go,{Body1:()=>tn,Body2:()=>rn,Caption:()=>nn,Display1:()=>qr,Display2:()=>Zr,H1:()=>Yr,H2:()=>Qr,H3:()=>en,H4:()=>on});var re={color:"neutral.foreground",fontFamily:"default",margin:"0"},qr=l(i({},re),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Zr=l(i({},re),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Yr=l(i({},re),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Qr=l(i({},re),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),en=l(i({},re),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),on=l(i({},re),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),tn=l(i({},re),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),rn=l(i({},re),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),nn=l(i({},re),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var an=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ne=Object.fromEntries(an.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ho.forwardRef((p,s)=>{var c=p,{as:n=o,children:r}=c,a=f(c,["as","children"]);return jsx(g,l(i(i({as:n},go[e]),a),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),sn=ne.Display1,ln=ne.Display2,pn=ne.H1,dn=ne.H2,cn=ne.H3,un=ne.H4,mn=ne.Body1,fn=ne.Body2,gn=ne.Caption;var xo={};te(xo,{Link:()=>Pn,Plain:()=>Cn,Primary:()=>hn,Secondary:()=>bn,loadingCSSStyle:()=>yo});var Je={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},hn=l(i({},Je),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),bn=l(i({},Je),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Pn=l(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Cn=l(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Sn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),yo={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:Sn+" 1s ease infinite"}};function Xe(s){var p=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,a=f(p,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxs(g,l(i(l(i({as:e!=null?e:"button",part:[`button-${c}`,t]},xo[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?yo:{})}),a),{loading:void 0,children:[o,n&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function wn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Primary",children:e}))}function Fn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Secondary",children:e}))}function vn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Link",children:e}))}function Tn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Xe,l(i({},o),{variant:"Plain",children:e}))}var P={};te(P,{Column:()=>kn,Row:()=>Rn});var Rn=ho.forwardRef((e,o)=>jsx(g,l(i({display:"flex",flexDirection:"row"},e),{ref:o}))),kn=ho.forwardRef((e,o)=>jsx(g,l(i({display:"flex",flexDirection:"column"},e),{ref:o})));function bo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=f(a,["dismissible","flowId","part"]);return jsx(j,l(i({as:null,flowId:o},n),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:y})=>{var S,B,v,k,E;let b=(S=y.props)!=null?S:{},x=(v=(B=y.primaryButton)==null?void 0:B.title)!=null?v:y.primaryButtonTitle,m=(E=(k=y.secondaryButton)==null?void 0:k.title)!=null?E:y.secondaryButtonTitle,F=y.$state.blocked;return jsxs(h,l(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),b),{children:[y.imageUri&&jsx(g,{as:"img",part:"image",src:y.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:y.title}),jsx(h.Subtitle,{part:"subtitle",children:y.subtitle})]}),jsx(h.Secondary,{disabled:F,title:m,onClick:c}),jsx(h.Primary,{disabled:F,title:x,onClick:p}),e&&jsx(h.Dismiss,{onClick:s})]}))}}))}var Ye={};te(Ye,{Carousel:()=>Dt,Collapsible:()=>Ze,CollapsibleStep:()=>We});var He={};te(He,{Bar:()=>Ce,Dots:()=>yt,Segments:()=>ht});function Ce(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(g,l(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function yt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,p)=>jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?R.colors.blue500:R.colors.blue800},p));return jsx(g,l(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function ht(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=[...Array(o)].map((s,p)=>jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(P.Row,l(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Pt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function En(){return jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ct(t){var n=t,{checked:e=!1}=n,o=f(n,["checked"]);return jsx(g,l(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&&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:jsx(En,{})})}))}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(H),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:useCallback((a,s,p=!0)=>W(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,s)=>W(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function wt({onPrimary:e,onSecondary:o,step:t}){var u,y;let{handlePrimary:n,handleSecondary:r}=ie(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:s,skipped:p}=t.$state,c=s||p||!a?jsx(Ct,{checked:s||p,marginLeft:"auto"}):jsx(g,{as:Pt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(h,{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:[jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(h.Title,{children:t.title}),jsx(h.Subtitle,{children:t.subtitle}),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:[jsx(h.Secondary,{disabled:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(h.Primary,{disabled:a,onClick:n,title:(y=t.primaryButton)==null?void 0:y.title})]})]})}function vt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Bt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var Rt=keyframes`
|
|
22
22
|
from {
|
|
23
23
|
opacity: 0;
|
|
24
24
|
}
|
|
@@ -43,7 +43,7 @@ var zo=Object.defineProperty,kr=Object.defineProperties;var Er=Object.getOwnProp
|
|
|
43
43
|
height: 0;
|
|
44
44
|
opacity: 0;
|
|
45
45
|
}
|
|
46
|
-
`,Vn=()=>jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function $n({checked:e=!1}){return 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&&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:jsx(Vn,{})})})}function So({children:e}){return jsx(we.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${An} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Ln} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(g,{}),e]})})}function wo(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=f(s,["children","disabled","onOpenChange","open"]);return jsx(we.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(h,l(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Fo({isCompleted:e,isBlocked:o,title:t}){return jsx(we.Trigger,{asChild:!0,children: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:[jsxs(P.Row,{alignItems:"center",gap:2,children:[jsx($n,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(g,{as:It,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Mt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Wt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var F,S,B,v,k,E;let{$state:{blocked:a,completed:s,skipped:p},subtitle:c,title:u}=r,y=(S=(F=r.primaryButton)==null?void 0:F.title)!=null?S:r.primaryButtonTitle,b=(v=(B=r.secondaryButton)==null?void 0:B.title)!=null?v:r.secondaryButtonTitle,x=(k=r.props)!=null?k:{},m=!!a;return jsxs(wo,l(i({open:t,onOpenChange:n},x),{children:[jsx(Fo,{isBlocked:r.$state.blocked,isCompleted:s||p,title:u}),jsxs(So,{children:[jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(E=r.videoUri)!=null?E:r.imageUri,type:r.videoUri?"video":"image"}),jsx(h.Subtitle,{color:"neutral.400",children:c}),jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsx(h.Secondary,{title:b,onClick:o}),jsx(h.Primary,{disabled:m,title:y,onClick:e})]})]})]}))}var Gn={default:Wt};function Un(n){var r=n,{flow:e,step:o}=r,t=f(r,["flow","step"]);var S;let{onPrimary:a,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=useContext(Mt),{handlePrimary:y,handleSecondary:b}=ie(o,{onPrimary:a,onSecondary:s}),x=(p!=null?p:e.getCurrentStep().id)===o.id,m=(S=u[o.type])!=null?S:Wt;function F(B){return W(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(m,l(i({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:y,handleSecondary:b}),o.id)}function Ze(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,y]=useState(null),b=i(i({},Gn),a);return jsx(Mt.Provider,{value:{openStepId:u,setOpenStepId:y,onPrimary:t,onSecondary:n,stepTypes:b},children:jsx(j,l(i({as:h,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:S=>{var B=S,{flow:x,handleDismiss:m}=B,F=f(B,["flow","handleDismiss"]);let k=Array.from(x.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(Un,l(i({flow:x,handleDismiss:m},F),{step:w}),w.id)),E=x.getNumberOfCompletedSteps(),T=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsx(h.Header,{dismissible:e,handleDismiss:m,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[E,"/",T]}),jsx(Ce,{current:E,total:T,flexGrow:1})]})]}),k]})}}))})}var Qn=new Set(["required","min","max","minLength","maxLength","pattern"]);function ei({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(t).filter(([p])=>Qn.has(p))),s=useController({name:t.id,control:o,rules:a});return jsx(e,l(i({},s),{fieldData:t,formContext:r,submit:n}))}function Lt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var E,T,w,D,O,q;let{__readOnly:s}=useContext(H),p=((E=a.fields)!=null?E:[]).filter(N=>e[N.type]!=null&&N.id),c=useForm({delayError:2e3,mode:"onChange",defaultValues:p.reduce((N,K)=>{var ce;return N[K.id]=(ce=K.value)!=null?ce:"",N},{})}),[u,y]=useState(!1),b=[],{control:x,handleSubmit:m}=c,F=(T=a.props)!=null?T:{};function S(N,K){y(!0),t(K,N,s===!0).then(()=>y(!1));}p.forEach(N=>{e[N.type]!=null&&b.push(jsx(ei,{control:x,fieldComponent:e[N.type],fieldData:N,submit:m(S)},`${a.flow.id}-${N.id}`));});let B=(D=(w=a.primaryButton)==null?void 0:w.title)!=null?D:a.primaryButtonTitle,v=(q=(O=a.secondaryButton)==null?void 0:O.title)!=null?q:a.secondaryButtonTitle,k=!!(a.$state.blocked||!c.formState.isValid);return jsxs(P.Column,l(i({gap:5,part:"form-step"},F),{children:[jsx(h.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,l(i({},c),{children:b})),jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[v&&jsx(I.Secondary,{onClick:n,title:v}),jsx(I.Primary,{disabled:k||u,onClick:m(S),title:B!=null?B:"Submit",loading:u})]},"form-footer")]}))}function Vt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function vo({children:e,id:o,required:t=!1}){return jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var To={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Ae=l(i({},To),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),Qe={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:s}=t,{error:p}=n,c=l(i(i(i({id:r},o),s?{placeholder:s}:{}),Ae),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxs(g,{part:"field",children:[jsx(vo,{id:r,required:!!t.required,children:a}),e(c),jsx(Vt,{error:p})]})}function ve(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var ii=ho.forwardRef(({label:e,value:o},t)=>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:[jsx(C.Body2,{part:"field-radio-label",children:e}),jsx(Te.Item,{id:o,value:o,ref:t,asChild:!0,children: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:jsx(g,l(i({as:Te.Indicator},Qe),{children:jsx(ve,{height:"14",width:"14"})}))})})]}));function Bo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:s})=>jsx(ii,{value:s,label:a},s));return jsx(Q,l(i({},e),{children:()=>jsx(Te.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Gt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function Kt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=ho.useState([]);function s(p){let c=[];r.includes(p)?c=[...r.filter(u=>u!==p)]:c=[...r,p],a(c),o(c);}return jsx(Q,l(i({},e),{children:()=>jsx(P.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:p,value:c})=>jsx(eo.Root,{value:r.includes(c)?c:void 0,onCheckedChange:()=>s(c),asChild:!0,children: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:[jsx(C.Body2,{part:"field-check-label",children:p}),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:jsx(eo.Indicator,{asChild:!0,children:jsx(g,l(i({},Qe),{children:jsx(ve,{height:"14",width:"14"})}))})})]})},c))})}))}var li=ho.forwardRef(({label:e,value:o},t)=>jsx(L.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(L.ItemText,{asChild:!0,children:jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function Ro(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:s,value:p})=>jsx(li,{value:p,label:s},p));return e.fieldData.multiple?jsx(Kt,i({},e)):jsx(Q,l(i({},e),{children:()=>jsxs(L.Root,{value:t,onValueChange:o,children:[jsx(L.Trigger,{asChild:!0,children:jsxs(C.Body2,l(i({},Ae),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(L.Value,{placeholder:r!=null?r:"Select one"}),jsx(L.Icon,{children:jsx(g,{as:Gt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(L.Portal,{children:jsx(L.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,l(i({},Ae),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(L.Viewport,{children:a})}))})})]})}))}function ko(e){return jsx(Q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Eo(e){return jsx(Q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function Zt(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(eo.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(g,l(i({},To),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"blue900",part:"field-checkbox",id:a,children:jsx(eo.Indicator,{asChild:!0,children:jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(ve,{height:"14",fill:"currentColor"})})})}))}),jsx(C.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var di={checkbox:Zt,radio:Bo,select:Ro,text:ko,textarea:Eo};function Re(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=f(a,["fieldTypes","flowId","part"]);let s=Object.assign({},di,e);return jsx(j,l(i({flowId:o,part:["form",t]},n),{children:p=>jsx(Lt,i({fieldTypes:s},p))}))}var ro={};te(ro,{NPS:()=>Ve});function er({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((s,p)=>{let c=e.value===p?I.Primary:I.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxs(P.Column,{gap:2,children:[jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(C.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(C.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Ve(a){var s=a,{as:e=M,flowId:o,fieldTypes:t,part:n}=s,r=f(s,["as","flowId","fieldTypes","part"]);let{flow:p}=se(o);return jsx(Re,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:er},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",n],css:l(i({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function xe(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&W(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:useCallback(r=>W(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function no(){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]=useState(e),[n,r]=useState(null),a=useCallback(s=>{r(s);},[]);return useLayoutEffect(()=>{if(!n)return;let s=()=>{let p=n.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:a}}var hi=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function rr(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxs(g,l(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${hi}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function io(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Ci(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 ao(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let a=Ci(o);return a?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")?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=f(r,["src","type"]);return jsx(o==="video"?ao:io,i({src:e},t))}function ir({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var so={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function ar(e,o){var a,s,p,c,u;let t=Object.fromEntries(so.content.map(y=>[y,e[y]]).filter(y=>y[1]!==void 0)),n=Object.fromEntries(so.root.map(y=>[y,e[y]]).filter(y=>y[1]!==void 0)),r={};for(let y of Object.keys(e))!so.content.includes(y)&&!so.root.includes(y)&&(r[y]=e[y]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let y={after:"end",before:"start"},b=(v,k)=>["top","bottom"].includes(k)?v=="after"?"marginLeft":"marginRight":v=="after"?"marginTop":"marginBottom",x=(p=t.alignOffset)!=null?p:0,m=(c=t.style)!=null?c:{},F=(u=t.side)!=null?u:"bottom",S=t.align;t.style=l(i({},m),{[b(S,F)]:x});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=y[S];}return {contentProps:t,otherProps:r,rootProps:n}}var sr=keyframes`
|
|
46
|
+
`,Vn=()=>jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function $n({checked:e=!1}){return 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&&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:jsx(Vn,{})})})}function So({children:e}){return jsx(we.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${An} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Ln} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(g,{}),e]})})}function wo(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=f(s,["children","disabled","onOpenChange","open"]);return jsx(we.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(h,l(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Fo({isCompleted:e,isBlocked:o,title:t}){return jsx(we.Trigger,{asChild:!0,children: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:[jsxs(P.Row,{alignItems:"center",gap:2,children:[jsx($n,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(g,{as:It,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Mt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Wt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var F,S,B,v,k,E;let{$state:{blocked:a,completed:s,skipped:p},subtitle:c,title:u}=r,y=(S=(F=r.primaryButton)==null?void 0:F.title)!=null?S:r.primaryButtonTitle,b=(v=(B=r.secondaryButton)==null?void 0:B.title)!=null?v:r.secondaryButtonTitle,x=(k=r.props)!=null?k:{},m=!!a;return jsxs(wo,l(i({open:t,onOpenChange:n},x),{children:[jsx(Fo,{isBlocked:r.$state.blocked,isCompleted:s||p,title:u}),jsxs(So,{children:[jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(E=r.videoUri)!=null?E:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(h.Subtitle,{color:"neutral.400",children:c}),jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsx(h.Secondary,{title:b,onClick:o}),jsx(h.Primary,{disabled:m,title:y,onClick:e})]})]})]}))}var Gn={default:Wt};function Un(n){var r=n,{flow:e,step:o}=r,t=f(r,["flow","step"]);var S;let{onPrimary:a,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=useContext(Mt),{handlePrimary:y,handleSecondary:b}=ie(o,{onPrimary:a,onSecondary:s}),x=(p!=null?p:e.getCurrentStep().id)===o.id,m=(S=u[o.type])!=null?S:Wt;function F(B){return W(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(m,l(i({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:y,handleSecondary:b}),o.id)}function Ze(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,y]=useState(null),b=i(i({},Gn),a);return jsx(Mt.Provider,{value:{openStepId:u,setOpenStepId:y,onPrimary:t,onSecondary:n,stepTypes:b},children:jsx(j,l(i({as:h,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:S=>{var B=S,{flow:x,handleDismiss:m}=B,F=f(B,["flow","handleDismiss"]);let k=Array.from(x.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(Un,l(i({flow:x,handleDismiss:m},F),{step:w}),w.id)),E=x.getNumberOfCompletedSteps(),T=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsx(h.Header,{dismissible:e,handleDismiss:m,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[E,"/",T]}),jsx(Ce,{current:E,total:T,flexGrow:1})]})]}),k]})}}))})}var Qn=new Set(["required","min","max","minLength","maxLength","pattern"]);function ei({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(t).filter(([p])=>Qn.has(p))),s=useController({name:t.id,control:o,rules:a});return jsx(e,l(i({},s),{fieldData:t,formContext:r,submit:n}))}function Lt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var E,T,w,D,O,q;let{__readOnly:s}=useContext(H),p=((E=a.fields)!=null?E:[]).filter(N=>e[N.type]!=null&&N.id),c=useForm({delayError:2e3,mode:"onChange",defaultValues:p.reduce((N,K)=>{var ce;return N[K.id]=(ce=K.value)!=null?ce:"",N},{})}),[u,y]=useState(!1),b=[],{control:x,handleSubmit:m}=c,F=(T=a.props)!=null?T:{};function S(N,K){y(!0),t(K,N,s===!0).then(()=>y(!1));}p.forEach(N=>{e[N.type]!=null&&b.push(jsx(ei,{control:x,fieldComponent:e[N.type],fieldData:N,submit:m(S)},`${a.flow.id}-${N.id}`));});let B=(D=(w=a.primaryButton)==null?void 0:w.title)!=null?D:a.primaryButtonTitle,v=(q=(O=a.secondaryButton)==null?void 0:O.title)!=null?q:a.secondaryButtonTitle,k=!!(a.$state.blocked||!c.formState.isValid);return jsxs(P.Column,l(i({gap:5,part:"form-step"},F),{children:[jsx(h.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,l(i({},c),{children:b})),jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[v&&jsx(I.Secondary,{onClick:n,title:v}),jsx(I.Primary,{disabled:k||u,onClick:m(S),title:B!=null?B:"Submit",loading:u})]},"form-footer")]}))}function Vt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function vo({children:e,id:o,required:t=!1}){return jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var To={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Ae=l(i({},To),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),Qe={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:s}=t,{error:p}=n,c=l(i(i(i({id:r},o),s?{placeholder:s}:{}),Ae),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxs(g,{part:"field",children:[jsx(vo,{id:r,required:!!t.required,children:a}),e(c),jsx(Vt,{error:p})]})}function ve(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var ii=ho.forwardRef(({label:e,value:o},t)=>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:[jsx(C.Body2,{part:"field-radio-label",children:e}),jsx(Te.Item,{id:o,value:o,ref:t,asChild:!0,children: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:jsx(g,l(i({as:Te.Indicator},Qe),{children:jsx(ve,{height:"14",width:"14"})}))})})]}));function Bo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:s})=>jsx(ii,{value:s,label:a},s));return jsx(Q,l(i({},e),{children:()=>jsx(Te.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Gt(e){return jsx("svg",l(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function Kt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=ho.useState([]);function s(p){let c=[];r.includes(p)?c=[...r.filter(u=>u!==p)]:c=[...r,p],a(c),o(c);}return jsx(Q,l(i({},e),{children:()=>jsx(P.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:p,value:c})=>jsx(eo.Root,{value:r.includes(c)?c:void 0,onCheckedChange:()=>s(c),asChild:!0,children: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:[jsx(C.Body2,{part:"field-check-label",children:p}),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:jsx(eo.Indicator,{asChild:!0,children:jsx(g,l(i({},Qe),{children:jsx(ve,{height:"14",width:"14"})}))})})]})},c))})}))}var li=ho.forwardRef(({label:e,value:o},t)=>jsx(L.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(L.ItemText,{asChild:!0,children:jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function Ro(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:s,value:p})=>jsx(li,{value:p,label:s},p));return e.fieldData.multiple?jsx(Kt,i({},e)):jsx(Q,l(i({},e),{children:()=>jsxs(L.Root,{value:t,onValueChange:o,children:[jsx(L.Trigger,{asChild:!0,children:jsxs(C.Body2,l(i({},Ae),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(L.Value,{placeholder:r!=null?r:"Select one"}),jsx(L.Icon,{children:jsx(g,{as:Gt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(L.Portal,{children:jsx(L.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,l(i({},Ae),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(L.Viewport,{children:a})}))})})]})}))}function ko(e){return jsx(Q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Eo(e){return jsx(Q,l(i({},e),{children:o=>jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function Zt(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(eo.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(g,l(i({},To),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"blue900",part:"field-checkbox",id:a,children:jsx(eo.Indicator,{asChild:!0,children:jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(ve,{height:"14",fill:"currentColor"})})})}))}),jsx(C.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var di={checkbox:Zt,radio:Bo,select:Ro,text:ko,textarea:Eo};function Re(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=f(a,["fieldTypes","flowId","part"]);let s=Object.assign({},di,e);return jsx(j,l(i({flowId:o,part:["form",t]},n),{children:p=>jsx(Lt,i({fieldTypes:s},p))}))}var ro={};te(ro,{NPS:()=>Ve});function er({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((s,p)=>{let c=e.value===p?I.Primary:I.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxs(P.Column,{gap:2,children:[jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(C.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(C.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Ve(a){var s=a,{as:e=M,flowId:o,fieldTypes:t,part:n}=s,r=f(s,["as","flowId","fieldTypes","part"]);let{flow:p}=se(o);return jsx(Re,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:er},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",n],css:l(i({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function xe(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&W(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:useCallback(r=>W(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function no(){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]=useState(e),[n,r]=useState(null),a=useCallback(s=>{r(s);},[]);return useLayoutEffect(()=>{if(!n)return;let s=()=>{let p=n.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:a}}var hi=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function rr(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxs(g,l(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${hi}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function io(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Ci(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 ao(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let a=Ci(o);return a?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")?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=f(r,["src","type"]);return jsx(o==="video"?ao:io,i({src:e},t))}function ir({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var so={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function ar(e,o){var a,s,p,c,u;let t=Object.fromEntries(so.content.map(y=>[y,e[y]]).filter(y=>y[1]!==void 0)),n=Object.fromEntries(so.root.map(y=>[y,e[y]]).filter(y=>y[1]!==void 0)),r={};for(let y of Object.keys(e))!so.content.includes(y)&&!so.root.includes(y)&&(r[y]=e[y]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let y={after:"end",before:"start"},b=(v,k)=>["top","bottom"].includes(k)?v=="after"?"marginLeft":"marginRight":v=="after"?"marginTop":"marginBottom",x=(p=t.alignOffset)!=null?p:0,m=(c=t.style)!=null?c:{},F=(u=t.side)!=null?u:"bottom",S=t.align;t.style=l(i({},m),{[b(S,F)]:x});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=y[S];}return {contentProps:t,otherProps:r,rootProps:n}}var sr=keyframes`
|
|
47
47
|
from {
|
|
48
48
|
opacity: 0;
|
|
49
49
|
}
|
|
@@ -53,7 +53,7 @@ var zo=Object.defineProperty,kr=Object.defineProperties;var Er=Object.getOwnProp
|
|
|
53
53
|
to {
|
|
54
54
|
opacity: 1;
|
|
55
55
|
}
|
|
56
|
-
`;function lr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var p=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=p,a=f(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:y}=no(),{node:b,rect:x,ref:m}=no(),$o=ar(a,u),{contentProps:F,otherProps:_e}=$o,Ee=_e,{part:S}=Ee,B=f(Ee,["part"]),{rootProps:v}=$o,[k,E]=useState(F.align),[T,w]=useState(F.side),[D,O]=useState(0),[q,N]=useState(0);if(c!==null){let _=c.getAttribute("data-align"),ee=c.getAttribute("data-side");k!==_&&E(_),T!==ee&&w(ee);}let K=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(m(_),K.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function _(be){if(be.matches(e))return lr(be)?be:null;let ue=be.querySelectorAll(e);return ue.length>0&&lr(ue[0])?ue[0]:null}let ee=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=_(De);if(me!=null){m(me),K.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=_(De);if(me!=null){m(null),K.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",me);break}}}});return ee.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ee.disconnect()},[]),useEffect(()=>{let{scrollX:_,scrollY:ee}=window;O(x.left+_),N(x.top+ee);},[x.left,x.top]),b==null)return null;let ce="0";typeof window!="undefined"&&(ce=window.getComputedStyle(b).borderRadius);let ke=ir({props:a,alignAttr:k,sideAttr:T});return jsxs(oe.Root,l(i({defaultOpen:!0},v),{children:[jsx(oe.Anchor,{virtualRef:K}),jsx(oe.Portal,{children:jsxs(Fragment,{children:[n&&jsx(g,i({animation:`${sr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ce,height:x.height,left:D,top:q,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(oe.Content,l(i({asChild:!0},F),{ref:y,children:jsxs(h,l(i({animation:`${sr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:r},B),{children:[jsx(rr,{style:ke}),o]}))}))]})})]}))}$.Close=e=>jsx(oe.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,l(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(de,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(I.Primary,i({title:o,onClick:e},t))};$.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"progress"},o),{children:e}))};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};$.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.H4,l(i({part:"title"},o),{children:e}))};function pr(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:s}=u,p=f(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var v,k,E,T,w,D;let{handleDismiss:y}=xe(o,{onDismiss:t}),{handlePrimary:b,handleSecondary:x}=ie(s,{onPrimary:r,onSecondary:a}),m=(v=s.props)!=null?v:{},F=(E=(k=s.primaryButton)==null?void 0:k.title)!=null?E:s.primaryButtonTitle,S=(w=(T=s.secondaryButton)==null?void 0:T.title)!=null?w:s.secondaryButtonTitle,B=s.$state.blocked;return jsxs($,l(i(i({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:O=>O.preventDefault(),onPointerDownOutside:O=>O.preventDefault(),onInteractOutside:O=>O.preventDefault()},p),m),{onEscapeKeyDown:O=>{typeof n=="function"&&n(O),O.defaultPrevented||y(O);},children:[e&&jsx($.Close,{onClick:y}),jsx($.Media,{src:(D=s.videoUri)!=null?D:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsx($.Title,{children:s.title}),jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsx($.Primary,{disabled:B,onClick:b,title:F})]})]}),s.id)}function $e(e,o=!0){let{currentModal:t,modals:n,setModals:r}=useContext(H),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:a||!o,removeModal:p}}function Ho(a){var s=a,{flowId:e,onComplete:o,variables:t,part:n}=s,r=f(s,["flowId","onComplete","variables","part"]);let[p,c]=useState(!1),{flow:u}=se(e,{variables:t}),{hasInitialized:y,registerComponent:b,unregisterComponent:x}=useContext(H);xe(u,{onComplete:o});let{isCurrentModal:m,removeModal:F}=$e(u);if(useEffect(()=>{!(u!=null&&u.isVisible)&&m&&F();},[u==null?void 0:u.isVisible,m]),useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!m||(b(e,()=>{p||c(!0);}),!y||!p))return null;let S=u.getCurrentStep();return S==null||S.start(),jsx(pr,i({"data-flow-id":u.id,flow:u,part:["tour",n],step:S},r))}function mr(e){let[o,t]=useState(),[n,r]=useState(),{flow:a}=se(n),{frigade:s}=useContext(H);return useEffect(()=>{W(this,null,function*(){var u;let p=yield s.getCollection(e);if(!p||s.hasFailedToLoad()){t(void 0);return}let c=(u=p.flows.find(({flow:y})=>y.isVisible))==null?void 0:u.flow;c!=null&&c.id!==n&&r(c.id),t(p);});},[e,a==null?void 0:a.isVisible]),{collection:o,currentFlow:a}}function Mo(n){var r=n,{collectionId:e,part:o}=r,t=f(r,["collectionId","part"]);var c,u,y;let a={ANNOUNCEMENT:Wo,BANNER:bo,CARD:h,CHECKLIST:Ze,EMBEDDED_TIP:h,FORM:Re,NPS_SURVEY:Ve,SURVEY:Ve,TOUR:Ho},{currentFlow:s}=mr(e),p=(u=a[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?u:null;return s==null||p==null?null:((y=s==null?void 0:s.rawData)==null?void 0:y.flowType)===FlowType.FORM?jsx(g,l(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(Re,{flowId:s.id,as:M},s.id)})):jsx(g,l(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(p,{flowId:s.id},s.id)}))}function Ne(){let{frigade:e}=useContext(H);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function fr(){let[e,o]=useState(),{frigade:t}=Ne();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(Mo,{as:null,collectionId:e})}var H=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function gr(){let{frigade:e}=Ne();return useEffect(()=>{W(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 Pr(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,a=f(p,["children","css","defaultCollection","navigate","theme"]);let c=r?mo(r):{},[u,y]=useState(new Set),b=useRef(new Map),x=useRef(),[m,F]=useState(!1),S=useMemo(()=>(F(!1),x.current=void 0,y(new Set),new 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]);useEffect(()=>{if(a.__flowStateOverrides){let w=S.getConfig();w.__flowStateOverrides=a.__flowStateOverrides,S.reload(w);}},[a.__flowStateOverrides]);function B(){let w=[...b.current.entries()].map(([D,O])=>[D,O.callback]);S.batchRegister(w),F(!0);}function v(w,D){if(x.current&&clearTimeout(x.current),m){b.current.has(w)?S.getFlow(w).then(O=>D(O.isVisible)):(S.getFlow(w).then(O=>O.register(D)),b.current.set(w,{callback:D}));return}b.current.has(w)||b.current.set(w,{callback:D}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function k(w){b.current.has(w)&&S.getFlow(w).then(D=>{b.current.delete(w),D==null||D.unregister();});}let E=n!=null?n:(w,D="_self")=>{window.open(w,D);};useEffect(()=>()=>{S.destroy();},[]);let T=u.size>0?u.values().next().value:null;return jsxs(H.Provider,{value:l(i({modals:u,setModals:y,currentModal:T,navigate:E},a),{frigade:S,registerComponent:v,unregisterComponent:k,hasInitialized:m}),children:[jsx(Global,{styles:{":root":i(i(i({},fo),c),o)}}),jsxs(ThemeProvider,{theme:R,children:[t&&jsx(fr,{}),e]}),a.preloadImages!==!1&&jsx(gr,{})]})}function se(e,o){let[t,n]=useState(),[,r]=useState(""),{frigade:a}=useContext(H),s=useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{n(p),r(Math.random().toString());},0));},[o==null?void 0:o.variables,e,a]);return useEffect(()=>{if(!(!(a!=null&&a.isReady())||e==null))return W(this,null,function*(){let p=yield a.getFlow(e);if(!p||a.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),n(p);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}},[e,a,s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function j(u){var y=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:s,variables:p}=y,c=f(y,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var Ee,ee;let[b,x]=useState(!1),{flow:m}=se(t,{variables:p}),_=i(i({},(Ee=m==null?void 0:m.props)!=null?Ee:{}),c),{dismissible:F=!1,forceMount:S=!1,modal:B=!1}=_,v=f(_,["dismissible","forceMount","modal"]),{hasInitialized:k,registerComponent:E,unregisterComponent:T}=useContext(H),w=m==null?void 0:m.getCurrentStep(),{handleDismiss:D}=xe(m,{onComplete:n,onDismiss:r}),{handlePrimary:O,handleSecondary:q}=ie(w,{onPrimary:a,onSecondary:s}),N=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((ee=m==null?void 0:m.rawData)==null?void 0:ee.flowType),{isCurrentModal:K,removeModal:ce}=$e(m,N);useEffect(()=>{!(m!=null&&m.isVisible)&&K&&ce();},[m==null?void 0:m.isVisible,K]),useEffect(()=>()=>{T(t);},[]),useEffect(()=>{(m!=null&&m.isCompleted||m!=null&&m.isSkipped)&&T(t);},[m==null?void 0:m.isCompleted,m==null?void 0:m.isSkipped]);let ke=S&&((m==null?void 0:m.isCompleted)||(m==null?void 0:m.isSkipped));if(!m||!ke&&!K||(E(t,()=>{b||x(!0);}),!m.isVisible&&!ke)||!k||!b)return null;(ke||!m.isCompleted&&!m.isSkipped)&&w.start();let $o=e===null?Fragment$1:e!=null?e:g,_e=l(i({},v),{"data-flow-id":m.id});return jsx($o,l(i({},e===null?{}:_e),{children:o({flow:m,handleDismiss:D,handlePrimary:O,handleSecondary:q,parentProps:{dismissible:F,flowId:t,variables:p,containerProps:_e},step:w})}))}function vr(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsx(j,l(i({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var b,x,m,F;let u=(x=(b=c.primaryButton)==null?void 0:b.title)!=null?x:c.primaryButtonTitle,y=(F=(m=c.secondaryButton)==null?void 0:m.title)!=null?F:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:p,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsx(h.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:y,onClick:s}),jsx(h.Primary,{title:u,onClick:a})]})]})}}))}var h=ho.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=f(a,["children","flowId"]);var p;if(o!=null)return jsx(vr,i({flowId:o},t));let s=(p=t.as)!=null?p:P.Column;return jsx(s,l(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});h.Dismiss=e=>jsx(I.Plain,l(i({part:"dismiss",padding:0},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}));h.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(P.Row,l(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};h.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(de,i({borderRadius:"md",src:e},o))};h.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Primary,i({title:o,onClick:e},t))};h.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.Body2,l(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};h.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.H4,l(i({display:"block",part:"title"},o),{children:e}))};var co={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Br(e){let o=Object.fromEntries(co.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(co.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!co.content.some(a=>a===r)&&!co.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Qi=keyframes`
|
|
56
|
+
`;function lr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var p=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=p,a=f(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:y}=no(),{node:b,rect:x,ref:m}=no(),$o=ar(a,u),{contentProps:F,otherProps:_e}=$o,Ee=_e,{part:S}=Ee,B=f(Ee,["part"]),{rootProps:v}=$o,[k,E]=useState(F.align),[T,w]=useState(F.side),[D,O]=useState(0),[q,N]=useState(0);if(c!==null){let _=c.getAttribute("data-align"),ee=c.getAttribute("data-side");k!==_&&E(_),T!==ee&&w(ee);}let K=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(m(_),K.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function _(be){if(be.matches(e))return lr(be)?be:null;let ue=be.querySelectorAll(e);return ue.length>0&&lr(ue[0])?ue[0]:null}let ee=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=_(De);if(me!=null){m(me),K.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=_(De);if(me!=null){m(null),K.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",me);break}}}});return ee.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ee.disconnect()},[]),useEffect(()=>{let{scrollX:_,scrollY:ee}=window;O(x.left+_),N(x.top+ee);},[x.left,x.top]),b==null)return null;let ce="0";typeof window!="undefined"&&(ce=window.getComputedStyle(b).borderRadius);let ke=ir({props:a,alignAttr:k,sideAttr:T});return jsxs(oe.Root,l(i({defaultOpen:!0},v),{children:[jsx(oe.Anchor,{virtualRef:K}),jsx(oe.Portal,{children:jsxs(Fragment,{children:[n&&jsx(g,i({animation:`${sr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ce,height:x.height,left:D,top:q,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(oe.Content,l(i({asChild:!0},F),{ref:y,children:jsxs(h,l(i({animation:`${sr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:r},B),{children:[jsx(rr,{style:ke}),o]}))}))]})})]}))}$.Close=e=>jsx(oe.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,l(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null: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=f(r,["onClick","title"]);return o==null?null:jsx(I.Primary,i({title:o,onClick:e},t))};$.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"progress"},o),{children:e}))};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};$.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.H4,l(i({part:"title"},o),{children:e}))};function pr(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:s}=u,p=f(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var v,k,E,T,w,D;let{handleDismiss:y}=xe(o,{onDismiss:t}),{handlePrimary:b,handleSecondary:x}=ie(s,{onPrimary:r,onSecondary:a}),m=(v=s.props)!=null?v:{},F=(E=(k=s.primaryButton)==null?void 0:k.title)!=null?E:s.primaryButtonTitle,S=(w=(T=s.secondaryButton)==null?void 0:T.title)!=null?w:s.secondaryButtonTitle,B=s.$state.blocked;return jsxs($,l(i(i({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:O=>O.preventDefault(),onPointerDownOutside:O=>O.preventDefault(),onInteractOutside:O=>O.preventDefault()},p),m),{onEscapeKeyDown:O=>{typeof n=="function"&&n(O),O.defaultPrevented||y(O);},children:[e&&jsx($.Close,{onClick:y}),jsx($.Media,{src:(D=s.videoUri)!=null?D:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsx($.Title,{children:s.title}),jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsx($.Primary,{disabled:B,onClick:b,title:F})]})]}),s.id)}function $e(e,o=!0){let{currentModal:t,modals:n,setModals:r}=useContext(H),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:a||!o,removeModal:p}}function Ho(a){var s=a,{flowId:e,onComplete:o,variables:t,part:n}=s,r=f(s,["flowId","onComplete","variables","part"]);let[p,c]=useState(!1),{flow:u}=se(e,{variables:t}),{hasInitialized:y,registerComponent:b,unregisterComponent:x}=useContext(H);xe(u,{onComplete:o});let{isCurrentModal:m,removeModal:F}=$e(u);if(useEffect(()=>{!(u!=null&&u.isVisible)&&m&&F();},[u==null?void 0:u.isVisible,m]),useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!m||(b(e,()=>{p||c(!0);}),!y||!p))return null;let S=u.getCurrentStep();return S==null||S.start(),jsx(pr,i({"data-flow-id":u.id,flow:u,part:["tour",n],step:S},r))}function mr(e){let[o,t]=useState(),[n,r]=useState(),{flow:a}=se(n),{frigade:s}=useContext(H);return useEffect(()=>{W(this,null,function*(){var u;let p=yield s.getCollection(e);if(!p||s.hasFailedToLoad()){t(void 0);return}let c=(u=p.flows.find(({flow:y})=>y.isVisible))==null?void 0:u.flow;c!=null&&c.id!==n&&r(c.id),t(p);});},[e,a==null?void 0:a.isVisible]),{collection:o,currentFlow:a}}function Mo(n){var r=n,{collectionId:e,part:o}=r,t=f(r,["collectionId","part"]);var c,u,y;let a={ANNOUNCEMENT:Wo,BANNER:bo,CARD:h,CHECKLIST:Ze,EMBEDDED_TIP:h,FORM:Re,NPS_SURVEY:Ve,SURVEY:Ve,TOUR:Ho},{currentFlow:s}=mr(e),p=(u=a[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?u:null;return s==null||p==null?null:((y=s==null?void 0:s.rawData)==null?void 0:y.flowType)===FlowType.FORM?jsx(g,l(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(Re,{flowId:s.id,as:M},s.id)})):jsx(g,l(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(p,{flowId:s.id},s.id)}))}function Ne(){let{frigade:e}=useContext(H);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function fr(){let[e,o]=useState(),{frigade:t}=Ne();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(Mo,{as:null,collectionId:e})}var H=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function gr(){let{frigade:e}=Ne();return useEffect(()=>{W(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 Pr(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,a=f(p,["children","css","defaultCollection","navigate","theme"]);let c=r?mo(r):{},[u,y]=useState(new Set),b=useRef(new Map),x=useRef(),[m,F]=useState(!1),S=useMemo(()=>(F(!1),x.current=void 0,y(new Set),new 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]);useEffect(()=>{if(a.__flowStateOverrides){let w=S.getConfig();w.__flowStateOverrides=a.__flowStateOverrides,S.reload(w);}},[a.__flowStateOverrides]);function B(){let w=[...b.current.entries()].map(([D,O])=>[D,O.callback]);S.batchRegister(w),F(!0);}function v(w,D){if(x.current&&clearTimeout(x.current),m){b.current.has(w)?S.getFlow(w).then(O=>D(O.isVisible)):(S.getFlow(w).then(O=>O.register(D)),b.current.set(w,{callback:D}));return}b.current.has(w)||b.current.set(w,{callback:D}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function k(w){b.current.has(w)&&S.getFlow(w).then(D=>{b.current.delete(w),D==null||D.unregister();});}let E=n!=null?n:(w,D="_self")=>{window.open(w,D);};useEffect(()=>()=>{S.destroy();},[]);let T=u.size>0?u.values().next().value:null;return jsxs(H.Provider,{value:l(i({modals:u,setModals:y,currentModal:T,navigate:E},a),{frigade:S,registerComponent:v,unregisterComponent:k,hasInitialized:m}),children:[jsx(Global,{styles:{":root":i(i(i({},fo),c),o)}}),jsxs(ThemeProvider,{theme:R,children:[t&&jsx(fr,{}),e]}),a.preloadImages!==!1&&jsx(gr,{})]})}function se(e,o){let[t,n]=useState(),[,r]=useState(""),{frigade:a}=useContext(H),s=useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{n(p),r(Math.random().toString());},0));},[o==null?void 0:o.variables,e,a]);return useEffect(()=>{if(!(!(a!=null&&a.isReady())||e==null))return W(this,null,function*(){let p=yield a.getFlow(e);if(!p||a.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),n(p);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}},[e,a,s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function j(u){var y=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:s,variables:p}=y,c=f(y,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var Ee,ee;let[b,x]=useState(!1),{flow:m}=se(t,{variables:p}),_=i(i({},(Ee=m==null?void 0:m.props)!=null?Ee:{}),c),{dismissible:F=!1,forceMount:S=!1,modal:B=!1}=_,v=f(_,["dismissible","forceMount","modal"]),{hasInitialized:k,registerComponent:E,unregisterComponent:T}=useContext(H),w=m==null?void 0:m.getCurrentStep(),{handleDismiss:D}=xe(m,{onComplete:n,onDismiss:r}),{handlePrimary:O,handleSecondary:q}=ie(w,{onPrimary:a,onSecondary:s}),N=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((ee=m==null?void 0:m.rawData)==null?void 0:ee.flowType),{isCurrentModal:K,removeModal:ce}=$e(m,N);useEffect(()=>{!(m!=null&&m.isVisible)&&K&&ce();},[m==null?void 0:m.isVisible,K]),useEffect(()=>()=>{T(t);},[]),useEffect(()=>{(m!=null&&m.isCompleted||m!=null&&m.isSkipped)&&T(t);},[m==null?void 0:m.isCompleted,m==null?void 0:m.isSkipped]);let ke=S&&((m==null?void 0:m.isCompleted)||(m==null?void 0:m.isSkipped));if(!m||!ke&&!K||(E(t,()=>{b||x(!0);}),!m.isVisible&&!ke)||!k||!b)return null;(ke||!m.isCompleted&&!m.isSkipped)&&w.start();let $o=e===null?Fragment$1:e!=null?e:g,_e=l(i({},v),{"data-flow-id":m.id});return jsx($o,l(i({},e===null?{}:_e),{children:o({flow:m,handleDismiss:D,handlePrimary:O,handleSecondary:q,parentProps:{dismissible:F,flowId:t,variables:p,containerProps:_e},step:w})}))}function vr(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsx(j,l(i({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var b,x,m,F;let u=(x=(b=c.primaryButton)==null?void 0:b.title)!=null?x:c.primaryButtonTitle,y=(F=(m=c.secondaryButton)==null?void 0:m.title)!=null?F:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:p,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsx(h.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:y,onClick:s}),jsx(h.Primary,{title:u,onClick:a})]})]})}}))}var h=ho.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=f(a,["children","flowId"]);var p;if(o!=null)return jsx(vr,i({flowId:o},t));let s=(p=t.as)!=null?p:P.Column;return jsx(s,l(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});h.Dismiss=e=>jsx(I.Plain,l(i({part:"dismiss",padding:0},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}));h.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(P.Row,l(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};h.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(de,i({borderRadius:"md",src:e},o))};h.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Primary,i({title:o,onClick:e},t))};h.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(I.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.Body2,l(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};h.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(C.H4,l(i({display:"block",part:"title"},o),{children:e}))};var co={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Br(e){let o=Object.fromEntries(co.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(co.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!co.content.some(a=>a===r)&&!co.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Qi=keyframes`
|
|
57
57
|
from {
|
|
58
58
|
opacity: 0;
|
|
59
59
|
}
|
|
@@ -63,7 +63,7 @@ var zo=Object.defineProperty,kr=Object.defineProperties;var Er=Object.getOwnProp
|
|
|
63
63
|
to {
|
|
64
64
|
opacity: 1;
|
|
65
65
|
}
|
|
66
|
-
`;function M(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=f(a,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:y}=Br(n),b=y,{zIndex:c}=b,u=f(b,["zIndex"]);return jsx(U.Root,l(i({defaultOpen:!0,modal:t},s),{children:jsx(U.Portal,{children:jsxs(g,{animation:`${Qi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c!=null?c:10,children:[jsx(U.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(U.Content,l(i({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},p),{children:jsx(h,l(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}M.Dismiss=e=>jsx(U.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,l(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(U.Description,{asChild:!0,children:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(de,i({borderRadius:"md",src:e},o))};M.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(I.Primary,i({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?R.colors.blue500:R.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};M.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(U.Title,{asChild:!0,children:jsx(C.H4,l(i({part:"title"},o),{children:e}))})};M.displayName="Dialog";var Rr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Wo(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([p])=>Rr.some(c=>p===c))),s=Object.fromEntries(Object.entries(t).filter(([p])=>Rr.indexOf(p)===-1));return jsx(j,l(i({as:null,flowId:e},a),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:y,parentProps:{containerProps:b,dismissible:x},step:m})=>{var k,E,T,w,D,O;let F=(k=m.props)!=null?k:{},S=(T=(E=m.primaryButton)==null?void 0:E.title)!=null?T:m.primaryButtonTitle,B=(D=(w=m.secondaryButton)==null?void 0:w.title)!=null?D:m.secondaryButtonTitle,v=m.$state.blocked;return jsx(M,l(i(i({part:["announcement",o],textAlign:"center"},b),s),{onEscapeKeyDown:q=>{if(t.dismissible===!1){q.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(q),q.defaultPrevented||c(q);},children:jsxs(P.Column,l(i({gap:5,part:"announcement-step"},F),{children:[x&&jsx(M.Dismiss,{onClick:c}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(M.Title,{children:m.title}),jsx(M.Subtitle,{children:m.subtitle})]}),jsx(M.Media,{src:(O=m.videoUri)!=null?O:m.imageUri,type:m.videoUri?"video":"image",
|
|
66
|
+
`;function M(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=f(a,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:y}=Br(n),b=y,{zIndex:c}=b,u=f(b,["zIndex"]);return jsx(U.Root,l(i({defaultOpen:!0,modal:t},s),{children:jsx(U.Portal,{children:jsxs(g,{animation:`${Qi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c!=null?c:10,children:[jsx(U.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(U.Content,l(i({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},p),{children:jsx(h,l(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}M.Dismiss=e=>jsx(U.Close,{"aria-label":"Close",asChild:!0,children:jsx(I.Plain,l(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(U.Description,{asChild:!0,children:jsx(C.Body2,l(i({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(de,i({borderRadius:"md",src:e},o))};M.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(I.Primary,i({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?R.colors.blue500:R.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(I.Secondary,i({title:o,onClick:e},t))};M.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(U.Title,{asChild:!0,children:jsx(C.H4,l(i({part:"title"},o),{children:e}))})};M.displayName="Dialog";var Rr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Wo(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([p])=>Rr.some(c=>p===c))),s=Object.fromEntries(Object.entries(t).filter(([p])=>Rr.indexOf(p)===-1));return jsx(j,l(i({as:null,flowId:e},a),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:y,parentProps:{containerProps:b,dismissible:x},step:m})=>{var k,E,T,w,D,O;let F=(k=m.props)!=null?k:{},S=(T=(E=m.primaryButton)==null?void 0:E.title)!=null?T:m.primaryButtonTitle,B=(D=(w=m.secondaryButton)==null?void 0:w.title)!=null?D:m.secondaryButtonTitle,v=m.$state.blocked;return jsx(M,l(i(i({part:["announcement",o],textAlign:"center"},b),s),{onEscapeKeyDown:q=>{if(t.dismissible===!1){q.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(q),q.defaultPrevented||c(q);},children:jsxs(P.Column,l(i({gap:5,part:"announcement-step"},F),{children:[x&&jsx(M.Dismiss,{onClick:c}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(M.Title,{children:m.title}),jsx(M.Subtitle,{children:m.subtitle})]}),jsx(M.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(O=m.videoUri)!=null?O:m.imageUri,transform:"translate3d(0, 0, 1px)",type:m.videoUri?"video":"image",width:"100%"}),jsx(M.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsx(M.Secondary,{disabled:v,onClick:y,title:B}),S&&jsx(M.Primary,{disabled:v,onClick:u,title:S})]})]}))}))}}))}function ta(){let{userId:e,frigade:o}=useContext(H);function t(r){return W(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return W(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function na(){var r;let{frigade:e}=useContext(H);function o(a){return W(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,s){return W(this,null,function*(){yield e.track(a,s);})}function n(a,s){return W(this,null,function*(){yield e.group(a,s);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
|
|
67
67
|
|
|
68
68
|
export { Wo as Announcement, bo as Banner, Q as BaseField, g as Box, I as Button, h as Card, Ye as Checklist, Mo as Collection, M as Dialog, P as Flex, j as Flow, Re as Form, io as Image, vo as Label, de as Media, He as Progress, Pr as Provider, Bo as RadioField, Ro as SelectField, ro as Survey, C as Text, ko as TextField, Eo as TextareaField, $ as Tooltip, Ho as Tour, ao as Video, fo as themeVariables, Ke as tokens, no as useBoundingClientRect, se as useFlow, xe as useFlowHandlers, Ne as useFrigade, na as useGroup, $e as useModal, ie as useStepHandlers, ta as useUser };
|
|
69
69
|
//# sourceMappingURL=out.js.map
|