@ledgerhq/device-management-kit-devtools-rozenite 0.0.0-develop-20261117000828 → 0.0.0-develop-20261119133251

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.js CHANGED
@@ -1,19 +1,19 @@
1
- function vA(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(n,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var yA=e=>e.disabled||Array.isArray(e.accessibilityStates)&&e.accessibilityStates.indexOf("disabled")>-1,bA={adjustable:"slider",button:"button",header:"heading",image:"img",imagebutton:null,keyboardkey:null,label:null,link:"link",none:"presentation",search:"search",summary:"region",text:null},oE=e=>{var t=e.accessibilityRole,r=e.role,n=r||t;if(n){var o=bA[n];if(o!==null)return o||n}},xA={article:"article",banner:"header",blockquote:"blockquote",button:"button",code:"code",complementary:"aside",contentinfo:"footer",deletion:"del",emphasis:"em",figure:"figure",insertion:"ins",form:"form",list:"ul",listitem:"li",main:"main",navigation:"nav",paragraph:"p",region:"section",strong:"strong"},wA={},SA=function(t){t===void 0&&(t=wA);var r=t.role||t.accessibilityRole;if(r==="label")return"label";var n=oE(t);if(n){if(n==="heading"){var o=t.accessibilityLevel||t["aria-level"];return o!=null?"h"+o:"h1"}return xA[n]}},sE={isDisabled:yA,propsToAccessibilityComponent:SA,propsToAriaRole:oE};function ul(e){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ul(e)}function EA(e,t){if(ul(e)!="object"||!e)return e;var r;if(typeof Symbol<"u"&&(r=e[Symbol.toPrimitive])!==void 0){var n=r.call(e,t);if(ul(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CA(e){var t=EA(e,"string");return ul(t)=="symbol"?t:t+""}function kA(e,t,r){return(t=CA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function js(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nb(Object(r),!0).forEach(function(n){kA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sd(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ou={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},RA=["ms","Moz","O","Webkit"],_A=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(Ou).forEach(e=>{RA.forEach(t=>{Ou[_A(t,e)]=Ou[e]})});var $A=e=>e==="currentcolor"||e==="currentColor"||e==="inherit"||e.indexOf("var(")===0;function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function aE(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var o=!1;try{o=this instanceof n}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var _p,ib;function AA(){if(ib)return _p;ib=1;function e(C){if(typeof C=="number")return C>>>0===C&&C>=0&&C<=4294967295?C:null;if(typeof C!="string")return null;const R=h();let k;if(k=R.hex6.exec(C))return parseInt(k[1]+"ff",16)>>>0;const $=S(C);return $??((k=R.rgb.exec(C))?(m(k[1])<<24|m(k[2])<<16|m(k[3])<<8|255)>>>0:(k=R.rgba.exec(C))?k[6]!==void 0?(m(k[6])<<24|m(k[7])<<16|m(k[8])<<8|w(k[9]))>>>0:(m(k[2])<<24|m(k[3])<<16|m(k[4])<<8|w(k[5]))>>>0:(k=R.hex3.exec(C))?parseInt(k[1]+k[1]+k[2]+k[2]+k[3]+k[3]+"ff",16)>>>0:(k=R.hex8.exec(C))?parseInt(k[1],16)>>>0:(k=R.hex4.exec(C))?parseInt(k[1]+k[1]+k[2]+k[2]+k[3]+k[3]+k[4]+k[4],16)>>>0:(k=R.hsl.exec(C))?(r(y(k[1]),E(k[2]),E(k[3]))|255)>>>0:(k=R.hsla.exec(C))?k[6]!==void 0?(r(y(k[6]),E(k[7]),E(k[8]))|w(k[9]))>>>0:(r(y(k[2]),E(k[3]),E(k[4]))|w(k[5]))>>>0:(k=R.hwb.exec(C))?(n(y(k[1]),E(k[2]),E(k[3]))|255)>>>0:null)}function t(C,R,k){return k<0&&(k+=1),k>1&&(k-=1),k<1/6?C+(R-C)*6*k:k<1/2?R:k<2/3?C+(R-C)*(2/3-k)*6:C}function r(C,R,k){const $=k<.5?k*(1+R):k+R-k*R,A=2*k-$,D=t(A,$,C+1/3),N=t(A,$,C),P=t(A,$,C-1/3);return Math.round(D*255)<<24|Math.round(N*255)<<16|Math.round(P*255)<<8}function n(C,R,k){if(R+k>=1){const N=Math.round(R*255/(R+k));return N<<24|N<<16|N<<8}const $=t(0,1,C+1/3)*(1-R-k)+R,A=t(0,1,C)*(1-R-k)+R,D=t(0,1,C-1/3)*(1-R-k)+R;return Math.round($*255)<<24|Math.round(A*255)<<16|Math.round(D*255)<<8}const o="[-+]?\\d*\\.?\\d+",a=o+"%";function l(...C){return"\\(\\s*("+C.join(")\\s*,?\\s*(")+")\\s*\\)"}function u(...C){return"\\(\\s*("+C.slice(0,C.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+C[C.length-1]+")\\s*\\)"}function d(...C){return"\\(\\s*("+C.join(")\\s*,\\s*(")+")\\s*\\)"}let p;function h(){return p===void 0&&(p={rgb:new RegExp("rgb"+l(o,o,o)),rgba:new RegExp("rgba("+d(o,o,o,o)+"|"+u(o,o,o,o)+")"),hsl:new RegExp("hsl"+l(o,a,a)),hsla:new RegExp("hsla("+d(o,a,a,o)+"|"+u(o,a,a,o)+")"),hwb:new RegExp("hwb"+l(o,a,a)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),p}function m(C){const R=parseInt(C,10);return R<0?0:R>255?255:R}function y(C){return(parseFloat(C)%360+360)%360/360}function w(C){const R=parseFloat(C);return R<0?0:R>1?255:Math.round(R*255)}function E(C){const R=parseFloat(C);return R<0?0:R>100?1:R/100}function S(C){switch(C){case"transparent":return 0;case"aliceblue":return 4042850303;case"antiquewhite":return 4209760255;case"aqua":return 16777215;case"aquamarine":return 2147472639;case"azure":return 4043309055;case"beige":return 4126530815;case"bisque":return 4293182719;case"black":return 255;case"blanchedalmond":return 4293643775;case"blue":return 65535;case"blueviolet":return 2318131967;case"brown":return 2771004159;case"burlywood":return 3736635391;case"burntsienna":return 3934150143;case"cadetblue":return 1604231423;case"chartreuse":return 2147418367;case"chocolate":return 3530104575;case"coral":return 4286533887;case"cornflowerblue":return 1687547391;case"cornsilk":return 4294499583;case"crimson":return 3692313855;case"cyan":return 16777215;case"darkblue":return 35839;case"darkcyan":return 9145343;case"darkgoldenrod":return 3095792639;case"darkgray":return 2846468607;case"darkgreen":return 6553855;case"darkgrey":return 2846468607;case"darkkhaki":return 3182914559;case"darkmagenta":return 2332068863;case"darkolivegreen":return 1433087999;case"darkorange":return 4287365375;case"darkorchid":return 2570243327;case"darkred":return 2332033279;case"darksalmon":return 3918953215;case"darkseagreen":return 2411499519;case"darkslateblue":return 1211993087;case"darkslategray":return 793726975;case"darkslategrey":return 793726975;case"darkturquoise":return 13554175;case"darkviolet":return 2483082239;case"deeppink":return 4279538687;case"deepskyblue":return 12582911;case"dimgray":return 1768516095;case"dimgrey":return 1768516095;case"dodgerblue":return 512819199;case"firebrick":return 2988581631;case"floralwhite":return 4294635775;case"forestgreen":return 579543807;case"fuchsia":return 4278255615;case"gainsboro":return 3705462015;case"ghostwhite":return 4177068031;case"gold":return 4292280575;case"goldenrod":return 3668254975;case"gray":return 2155905279;case"green":return 8388863;case"greenyellow":return 2919182335;case"grey":return 2155905279;case"honeydew":return 4043305215;case"hotpink":return 4285117695;case"indianred":return 3445382399;case"indigo":return 1258324735;case"ivory":return 4294963455;case"khaki":return 4041641215;case"lavender":return 3873897215;case"lavenderblush":return 4293981695;case"lawngreen":return 2096890111;case"lemonchiffon":return 4294626815;case"lightblue":return 2916673279;case"lightcoral":return 4034953471;case"lightcyan":return 3774873599;case"lightgoldenrodyellow":return 4210742015;case"lightgray":return 3553874943;case"lightgreen":return 2431553791;case"lightgrey":return 3553874943;case"lightpink":return 4290167295;case"lightsalmon":return 4288707327;case"lightseagreen":return 548580095;case"lightskyblue":return 2278488831;case"lightslategray":return 2005441023;case"lightslategrey":return 2005441023;case"lightsteelblue":return 2965692159;case"lightyellow":return 4294959359;case"lime":return 16711935;case"limegreen":return 852308735;case"linen":return 4210091775;case"magenta":return 4278255615;case"maroon":return 2147483903;case"mediumaquamarine":return 1724754687;case"mediumblue":return 52735;case"mediumorchid":return 3126187007;case"mediumpurple":return 2473647103;case"mediumseagreen":return 1018393087;case"mediumslateblue":return 2070474495;case"mediumspringgreen":return 16423679;case"mediumturquoise":return 1221709055;case"mediumvioletred":return 3340076543;case"midnightblue":return 421097727;case"mintcream":return 4127193855;case"mistyrose":return 4293190143;case"moccasin":return 4293178879;case"navajowhite":return 4292783615;case"navy":return 33023;case"oldlace":return 4260751103;case"olive":return 2155872511;case"olivedrab":return 1804477439;case"orange":return 4289003775;case"orangered":return 4282712319;case"orchid":return 3664828159;case"palegoldenrod":return 4008225535;case"palegreen":return 2566625535;case"paleturquoise":return 2951671551;case"palevioletred":return 3681588223;case"papayawhip":return 4293907967;case"peachpuff":return 4292524543;case"peru":return 3448061951;case"pink":return 4290825215;case"plum":return 3718307327;case"powderblue":return 2967529215;case"purple":return 2147516671;case"rebeccapurple":return 1714657791;case"red":return 4278190335;case"rosybrown":return 3163525119;case"royalblue":return 1097458175;case"saddlebrown":return 2336560127;case"salmon":return 4202722047;case"sandybrown":return 4104413439;case"seagreen":return 780883967;case"seashell":return 4294307583;case"sienna":return 2689740287;case"silver":return 3233857791;case"skyblue":return 2278484991;case"slateblue":return 1784335871;case"slategray":return 1887473919;case"slategrey":return 1887473919;case"snow":return 4294638335;case"springgreen":return 16744447;case"steelblue":return 1182971135;case"tan":return 3535047935;case"teal":return 8421631;case"thistle":return 3636451583;case"tomato":return 4284696575;case"turquoise":return 1088475391;case"violet":return 4001558271;case"wheat":return 4125012991;case"white":return 4294967295;case"whitesmoke":return 4126537215;case"yellow":return 4294902015;case"yellowgreen":return 2597139199}return null}return _p=e,_p}var TA=AA();const LA=Qr(TA);var IA=e=>{if(e==null)return e;var t=LA(e);if(t!=null)return t=(t<<24|t>>>8)>>>0,t},Tg=function(t,r){if(r===void 0&&(r=1),t!=null){if(typeof t=="string"&&$A(t))return t;var n=IA(t);if(n!=null){var o=n>>16&255,a=n>>8&255,l=n&255,u=(n>>24&255)/255,d=(u*r).toFixed(2);return"rgba("+o+","+a+","+l+","+d+")"}}},OA={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function mr(e,t){var r=e;return(t==null||!Ou[t])&&typeof e=="number"?r=e+"px":t!=null&&OA[t]&&(r=Tg(e)),r}var zo=!!(typeof window<"u"&&window.document&&window.document.createElement),NA={},PA=!zo||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports("text-decoration-line","none")||window.CSS.supports("-webkit-text-decoration-line","none")),DA="monospace,monospace",ob='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',jA={borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderBlockColor:["borderTopColor","borderBottomColor"],borderInlineColor:["borderRightColor","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderStyle:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],borderBlockStyle:["borderTopStyle","borderBottomStyle"],borderInlineStyle:["borderRightStyle","borderLeftStyle"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderBlockWidth:["borderTopWidth","borderBottomWidth"],borderInlineWidth:["borderRightWidth","borderLeftWidth"],insetBlock:["top","bottom"],insetInline:["left","right"],marginBlock:["marginTop","marginBottom"],marginInline:["marginRight","marginLeft"],paddingBlock:["paddingTop","paddingBottom"],paddingInline:["paddingRight","paddingLeft"],overflow:["overflowX","overflowY"],overscrollBehavior:["overscrollBehaviorX","overscrollBehaviorY"],borderBlockStartColor:["borderTopColor"],borderBlockStartStyle:["borderTopStyle"],borderBlockStartWidth:["borderTopWidth"],borderBlockEndColor:["borderBottomColor"],borderBlockEndStyle:["borderBottomStyle"],borderBlockEndWidth:["borderBottomWidth"],borderEndStartRadius:["borderBottomLeftRadius"],borderEndEndRadius:["borderBottomRightRadius"],borderStartStartRadius:["borderTopLeftRadius"],borderStartEndRadius:["borderTopRightRadius"],insetBlockEnd:["bottom"],insetBlockStart:["top"],marginBlockStart:["marginTop"],marginBlockEnd:["marginBottom"],paddingBlockStart:["paddingTop"],paddingBlockEnd:["paddingBottom"]},lE=(e,t)=>{if(!e)return NA;var r={},n=function(){var u=e[o];if(u==null)return"continue";if(o==="backgroundClip")u==="text"&&(r.backgroundClip=u,r.WebkitBackgroundClip=u);else if(o==="flex")u===-1?(r.flexGrow=0,r.flexShrink=1,r.flexBasis="auto"):r.flex=u;else if(o==="font")r[o]=u.replace("System",ob);else if(o==="fontFamily")if(u.indexOf("System")>-1){var d=u.split(/,\s*/);d[d.indexOf("System")]=ob,r[o]=d.join(",")}else u==="monospace"?r[o]=DA:r[o]=u;else if(o==="textDecorationLine")PA?r.textDecorationLine=u:r.textDecoration=u;else if(o==="writingDirection")r.direction=u;else{var p=mr(e[o],o),h=jA[o];t&&o==="inset"?(e.insetInline==null&&(r.left=p,r.right=p),e.insetBlock==null&&(r.top=p,r.bottom=p)):t&&o==="margin"?(e.marginInline==null&&(r.marginLeft=p,r.marginRight=p),e.marginBlock==null&&(r.marginTop=p,r.marginBottom=p)):t&&o==="padding"?(e.paddingInline==null&&(r.paddingLeft=p,r.paddingRight=p),e.paddingBlock==null&&(r.paddingTop=p,r.paddingBottom=p)):h?h.forEach((m,y)=>{e[m]==null&&(r[m]=p)}):r[o]=p}};for(var o in e)var a=n();return r};function MA(e,t){for(var r=e.length,n=t^r,o=0,a;r>=4;)a=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)^a,r-=4,++o;switch(r){case 3:n^=(e.charCodeAt(o+2)&255)<<16;case 2:n^=(e.charCodeAt(o+1)&255)<<8;case 1:n^=e.charCodeAt(o)&255,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)}return n^=n>>>13,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>15,n>>>0}var zA=e=>MA(e,1).toString(36),FA=/[A-Z]/g,BA=/^ms-/,$p={};function UA(e){return"-"+e.toLowerCase()}function VA(e){if(e in $p)return $p[e];var t=e.replace(FA,UA);return $p[e]=BA.test(t)?"-"+t:t}var tu={},ru={},nu={},sb;function cE(){if(sb)return nu;sb=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.default=e;function e(t){return t.charAt(0).toUpperCase()+t.slice(1)}return nu}var ab;function WA(){if(ab)return ru;ab=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.default=n;var e=cE(),t=r(e);function r(o){return o&&o.__esModule?o:{default:o}}function n(o,a,l){var u=o[a];if(u&&l.hasOwnProperty(a))for(var d=(0,t.default)(a),p=0;p<u.length;++p){var h=u[p]+d;l[h]||(l[h]=l[a])}return l}return ru}var iu={},lb;function HA(){if(lb)return iu;lb=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.default=e;function e(t,r,n,o,a){for(var l=0,u=t.length;l<u;++l){var d=t[l](r,n,o,a);if(d)return d}}return iu}var ou={},cb;function qA(){if(cb)return ou;cb=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.default=t;function e(r,n){r.indexOf(n)===-1&&r.push(n)}function t(r,n){if(Array.isArray(n))for(var o=0,a=n.length;o<a;++o)e(r,n[o]);else e(r,n)}return ou}var su={},ub;function GA(){if(ub)return su;ub=1,Object.defineProperty(su,"__esModule",{value:!0}),su.default=e;function e(t){return t instanceof Object&&!Array.isArray(t)}return su}var db;function XA(){if(db)return tu;db=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.default=p;var e=WA(),t=d(e),r=HA(),n=d(r),o=qA(),a=d(o),l=GA(),u=d(l);function d(h){return h&&h.__esModule?h:{default:h}}function p(h){var m=h.prefixMap,y=h.plugins;return function w(E){for(var S in E){var C=E[S];if((0,u.default)(C))E[S]=w(C);else if(Array.isArray(C)){for(var R=[],k=0,$=C.length;k<$;++k){var A=(0,n.default)(y,S,C[k],E,m);(0,a.default)(R,A||C[k])}R.length>0&&(E[S]=R)}else{var D=(0,n.default)(y,S,C,E,m);D&&(E[S]=D),E=(0,t.default)(m,S,E)}}return E}}return tu}var YA=XA();const KA=Qr(YA);var au={};function Nu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nu=function(r){return typeof r}:Nu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Nu(e)}function QA(e){return tT(e)||eT(e)||ZA(e)||JA()}function JA(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZA(e,t){if(e){if(typeof e=="string")return Cm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cm(e,t)}}function eT(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function tT(e){if(Array.isArray(e))return Cm(e)}function Cm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fb(e){return e.filter(function(t,r){return e.lastIndexOf(t)===r})}function uE(e){for(var t=0,r=arguments.length<=1?0:arguments.length-1;t<r;++t){var n=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];for(var o in n){var a=n[o],l=e[o];if(l&&a){if(Array.isArray(l)){e[o]=fb(l.concat(a));continue}if(Array.isArray(a)){e[o]=fb([l].concat(QA(a)));continue}if(Nu(a)==="object"){e[o]=uE({},l,a);continue}}e[o]=a}}return e}var rT=/-([a-z])/g,nT=/^Ms/g,Ap={};function iT(e){return e[1].toUpperCase()}function dE(e){if(Ap.hasOwnProperty(e))return Ap[e];var t=e.replace(rT,iT).replace(nT,"ms");return Ap[e]=t,t}var oT=/[A-Z]/g,sT=/^ms-/,Tp={};function aT(e){return"-"+e.toLowerCase()}function fE(e){if(Tp.hasOwnProperty(e))return Tp[e];var t=e.replace(oT,aT);return Tp[e]=sT.test(t)?"-"+t:t}const lT=Object.freeze(Object.defineProperty({__proto__:null,default:fE},Symbol.toStringTag,{value:"Module"}));function Ed(e){return fE(e)}function pE(e,t){return Ed(e)+":"+t}function cT(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=pE(r,n))}return t}var uT=/^(Webkit|Moz|O|ms)/;function dT(e){return uT.test(e)}var fT=/-webkit-|-moz-|-ms-/;function pT(e){return typeof e=="string"&&fT.test(e)}var dl={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pb=["animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","order"],hb=["Webkit","ms","Moz","O"];function hT(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}for(var Lp=0,mT=pb.length;Lp<mT;++Lp){var mb=pb[Lp];dl[mb]=!0;for(var Ip=0,gT=hb.length;Ip<gT;++Ip)dl[hT(hb[Ip],mb)]=!0}for(var vT in dl)dl[Ed(vT)]=!0;function yT(e){return dl.hasOwnProperty(e)}var bT=/^(ms|Webkit|Moz|O)/;function hE(e){var t=e.replace(bT,"");return t.charAt(0).toLowerCase()+t.slice(1)}function xT(e){return hE(dE(e))}function wT(e,t){return t.join(";"+Ed(e)+":")}var ST=/(-ms-|-webkit-|-moz-|-o-)/g;function ET(e){return typeof e=="string"?e.replace(ST,""):e}const CT=Object.freeze(Object.defineProperty({__proto__:null,assignStyle:uE,camelCaseProperty:dE,cssifyDeclaration:pE,cssifyObject:cT,hyphenateProperty:Ed,isPrefixedProperty:dT,isPrefixedValue:pT,isUnitlessProperty:yT,normalizeProperty:xT,resolveArrayValue:wT,unprefixProperty:hE,unprefixValue:ET},Symbol.toStringTag,{value:"Module"})),kT=aE(CT);var gb;function RT(){if(gb)return au;gb=1,Object.defineProperty(au,"__esModule",{value:!0}),au.default=n;var e=kT,t=/cross-fade\(/g,r=["-webkit-",""];function n(o,a){if(typeof a=="string"&&!(0,e.isPrefixedValue)(a)&&a.indexOf("cross-fade(")!==-1)return r.map(function(l){return a.replace(t,l+"cross-fade(")})}return au}var _T=RT();const $T=Qr(_T);var lu={},Op={},vb;function mE(){return vb||(vb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var t=/-webkit-|-moz-|-ms-/;function r(n){return typeof n=="string"&&t.test(n)}})(Op)),Op}var yb;function AT(){if(yb)return lu;yb=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.default=o;var e=mE(),t=r(e);function r(a){return a&&a.__esModule?a:{default:a}}var n=["-webkit-",""];function o(a,l){if(typeof l=="string"&&!(0,t.default)(l)&&l.indexOf("image-set(")>-1)return n.map(function(u){return l.replace(/image-set\(/g,u+"image-set(")})}return lu}var TT=AT();const LT=Qr(TT);var cu={},bb;function IT(){if(bb)return cu;bb=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.default=t;var e={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function t(r,n,o){if(Object.prototype.hasOwnProperty.call(e,r))for(var a=e[r],l=0,u=a.length;l<u;++l)o[a[l]]=n}return cu}var OT=IT();const NT=Qr(OT);var uu={},xb;function PT(){if(xb)return uu;xb=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.default=e;function e(t,r){if(t==="position"&&r==="sticky")return["-webkit-sticky","sticky"]}return uu}var DT=PT();const jT=Qr(DT);var du={},wb;function MT(){if(wb)return du;wb=1,Object.defineProperty(du,"__esModule",{value:!0}),du.default=n;var e=["-webkit-","-moz-",""],t={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},r={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function n(o,a){if(t.hasOwnProperty(o)&&r.hasOwnProperty(a))return e.map(function(l){return l+a})}return du}var zT=MT();const FT=Qr(zT);var fu={},Np={};const BT=aE(lT);var Sb;function UT(){return Sb||(Sb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var t=BT,r=n(t);function n(a){return a&&a.__esModule?a:{default:a}}function o(a){return(0,r.default)(a)}})(Np)),Np}var Eb;function VT(){if(Eb)return fu;Eb=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.default=h;var e=UT(),t=l(e),r=mE(),n=l(r),o=cE(),a=l(o);function l(m){return m&&m.__esModule?m:{default:m}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},d={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function p(m,y){if((0,n.default)(m))return m;for(var w=m.split(/,(?![^()]*(?:\([^()]*\))?\))/g),E=0,S=w.length;E<S;++E){var C=w[E],R=[C];for(var k in y){var $=(0,t.default)(k);if(C.indexOf($)>-1&&$!=="order")for(var A=y[k],D=0,N=A.length;D<N;++D)R.unshift(C.replace($,d[A[D]]+$))}w[E]=R.join(",")}return w.join(",")}function h(m,y,w,E){if(typeof y=="string"&&u.hasOwnProperty(m)){var S=p(y,E),C=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(k){return!/-moz-|-ms-/.test(k)}).join(",");if(m.indexOf("Webkit")>-1)return C;var R=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(k){return!/-webkit-|-ms-/.test(k)}).join(",");return m.indexOf("Moz")>-1?R:(w["Webkit"+(0,a.default)(m)]=C,w["Moz"+(0,a.default)(m)]=R,S)}}return fu}var WT=VT();const HT=Qr(WT);var mt=["Webkit"],qT=["Moz"],GT=["Webkit","Moz"],It=["Webkit","ms"],XT=["Webkit","Moz","ms"];const YT={plugins:[$T,LT,NT,jT,FT,HT],prefixMap:{appearance:XT,userSelect:GT,textEmphasisPosition:It,textEmphasis:It,textEmphasisStyle:It,textEmphasisColor:It,boxDecorationBreak:It,clipPath:mt,maskImage:It,maskMode:It,maskRepeat:It,maskPosition:It,maskClip:It,maskOrigin:It,maskSize:It,maskComposite:It,mask:It,maskBorderSource:It,maskBorderMode:It,maskBorderSlice:It,maskBorderWidth:It,maskBorderOutset:It,maskBorderRepeat:It,maskBorder:It,maskType:It,textDecorationStyle:mt,textDecorationSkip:mt,textDecorationLine:mt,textDecorationColor:mt,filter:mt,breakAfter:mt,breakBefore:mt,breakInside:mt,columnCount:mt,columnFill:mt,columnGap:mt,columnRule:mt,columnRuleColor:mt,columnRuleStyle:mt,columnRuleWidth:mt,columns:mt,columnSpan:mt,columnWidth:mt,backdropFilter:mt,hyphens:mt,flowInto:mt,flowFrom:mt,regionFragment:mt,textOrientation:mt,tabSize:qT,fontKerning:mt,textSizeAdjust:mt}};var KT=KA(YT),QT=["animationKeyframes"],Cb=new Map,JT={},ZT=1,eL=3,tL={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},km="borderTopLeftRadius",Rm="borderTopRightRadius",_m="borderBottomLeftRadius",$m="borderBottomRightRadius",Am="borderLeftColor",Tm="borderLeftStyle",Lm="borderLeftWidth",Im="borderRightColor",Om="borderRightStyle",Nm="borderRightWidth",Pm="right",Dm="marginLeft",jm="marginRight",Mm="paddingLeft",zm="paddingRight",Fm="left",Yu={[km]:Rm,[Rm]:km,[_m]:$m,[$m]:_m,[Am]:Im,[Tm]:Om,[Lm]:Nm,[Im]:Am,[Om]:Tm,[Nm]:Lm,[Fm]:Pm,[Dm]:jm,[jm]:Dm,[Mm]:zm,[zm]:Mm,[Pm]:Fm},sl={borderStartStartRadius:km,borderStartEndRadius:Rm,borderEndStartRadius:_m,borderEndEndRadius:$m,borderInlineStartColor:Am,borderInlineStartStyle:Tm,borderInlineStartWidth:Lm,borderInlineEndColor:Im,borderInlineEndStyle:Om,borderInlineEndWidth:Nm,insetInlineEnd:Pm,insetInlineStart:Fm,marginInlineStart:Dm,marginInlineEnd:jm,paddingInlineStart:Mm,paddingInlineEnd:zm},gE=["clear","float","textAlign"];function rL(e){var t={$$css:!0},r=[];function n(o,a,l){var u=oL(l,a),d=a+u,p=Cb.get(d),h;if(p!=null)h=p[0],r.push(p[1]);else{var m=o!==a?d:u;h=Lg("r",o,m);var y=tL[o]||eL,w=sL(h,a,l),E=[w,y];r.push(E),Cb.set(d,[h,E])}return h}return Object.keys(e).sort().forEach(o=>{var a=e[o];if(a!=null){var l;if(gE.indexOf(o)>-1){var u=n(o,o,"left"),d=n(o,o,"right");a==="start"?l=[u,d]:a==="end"&&(l=[d,u])}var p=sl[o];if(p!=null){var h=n(o,p,a),m=n(o,Yu[p],a);l=[h,m]}if(o==="transitionProperty"){for(var y=Array.isArray(a)?a:[a],w=[],E=0;E<y.length;E++){var S=y[E];typeof S=="string"&&sl[S]!=null&&w.push(E)}if(w.length>0){var C=[...y],R=[...y];w.forEach(k=>{var $=C[k];if(typeof $=="string"){var A=sl[$],D=Yu[A];C[k]=A,R[k]=D;var N=n(o,o,C),P=n(o,o,R);l=[N,P]}})}}l==null?l=n(o,o,a):t.$$css$localize=!0,t[o]=l}}),[t,r]}function nL(e,t){var r={$$css:!0},n=[],o=e.animationKeyframes,a=Sd(e,QT),l=Lg("css",t,JSON.stringify(e)),u="."+l,d;if(o!=null){var p=vE(o),h=p[0],m=p[1];d=h.join(","),n.push(...m)}var y=ei(js(js({},a),{},{animationName:d}));return n.push(""+u+y),r[l]=l,[r,[[n,ZT]]]}function iL(e,t){var r=e||JT,n={},o={},a=function(){var p=r[l],h=l,m=p;if(!Object.prototype.hasOwnProperty.call(r,l)||p==null)return"continue";gE.indexOf(l)>-1&&(p==="start"?m=t?"right":"left":p==="end"&&(m=t?"left":"right"));var y=sl[l];if(y!=null&&(h=t?Yu[y]:y),l==="transitionProperty"){var w=Array.isArray(p)?p:[p];w.forEach((E,S)=>{if(typeof E=="string"){var C=sl[E];C!=null&&(w[S]=t?Yu[C]:C,m=w.join(" "))}})}n[h]||(o[h]=m),h===l&&(n[h]=!0)};for(var l in r)var u=a();return lE(o,!0)}function oL(e,t){var r=mr(e,t);return typeof r!="string"?JSON.stringify(r||""):r}function sL(e,t,r){var n=[],o="."+e;switch(t){case"animationKeyframes":{var a=vE(r),l=a[0],u=a[1],d=ei({animationName:l.join(",")});n.push(""+o+d,...u);break}case"placeholderTextColor":{var p=ei({color:r,opacity:1});n.push(o+"::-webkit-input-placeholder"+p,o+"::-moz-placeholder"+p,o+":-ms-input-placeholder"+p,o+"::placeholder"+p);break}case"pointerEvents":{var h=r;if(r==="auto"||r==="box-only"){if(h="auto!important",r==="box-only"){var m=ei({pointerEvents:"none"});n.push(o+">*"+m)}}else if((r==="none"||r==="box-none")&&(h="none!important",r==="box-none")){var y=ei({pointerEvents:"auto"});n.push(o+" * "+y)}var w=ei({pointerEvents:h});n.push(""+o+w);break}case"scrollbarWidth":{r==="none"&&n.push(o+"::-webkit-scrollbar{display:none}");var E=ei({scrollbarWidth:r});n.push(""+o+E);break}default:{var S=ei({[t]:r});n.push(""+o+S);break}}return n}function ei(e){var t=KT(lE(e)),r=Object.keys(t).map(n=>{var o=t[n],a=VA(n);return Array.isArray(o)?o.map(l=>a+":"+l).join(";"):a+":"+o}).sort().join(";");return"{"+r+";}"}function Lg(e,t,r){var n=zA(t+r);return e+"-"+n}function aL(e){var t=["-webkit-",""],r=Lg("r","animation",JSON.stringify(e)),n="{"+Object.keys(e).map(a=>{var l=e[a],u=ei(l);return""+a+u}).join("")+"}",o=t.map(a=>"@"+a+"keyframes "+r+n);return[r,o]}function vE(e){if(typeof e=="number")throw new Error("Invalid CSS keyframes type: "+typeof e);var t=[],r=[],n=Array.isArray(e)?e:[e];return n.forEach(o=>{if(typeof o=="string")t.push(o);else{var a=aL(o),l=a[0],u=a[1];t.push(l),r.push(...u)}}),[t,r]}function Pp(e,t,r){if(zo){var n=t??document,o=n.getElementById(e);if(o==null)if(o=document.createElement("style"),o.setAttribute("id",e),typeof r=="string"&&o.appendChild(document.createTextNode(r)),n instanceof ShadowRoot)n.insertBefore(o,n.firstChild);else{var a=n.head;a&&a.insertBefore(o,a.firstChild)}return o.sheet}else return null}var lL=Array.prototype.slice;function Dp(e){var t={},r={};if(e!=null){var n;lL.call(e.cssRules).forEach((l,u)=>{var d=l.cssText;if(d.indexOf("stylesheet-group")>-1)n=dL(l),t[n]={start:u,rules:[d]};else{var p=Rb(d);p!=null&&(r[p]=!0,t[n].rules.push(d))}})}function o(l,u,d){var p=kb(t),h=p.indexOf(u),m=h+1,y=p[m],w=y!=null&&t[y].start!=null?t[y].start:l.cssRules.length,E=pL(l,d,w);if(E){t[u].start==null&&(t[u].start=w);for(var S=m;S<p.length;S+=1){var C=p[S],R=t[C].start||0;t[C].start=R+1}}return E}var a={getTextContent(){return kb(t).map(l=>{var u=t[l].rules,d=u.shift();return u.sort(),u.unshift(d),u.join(`
1
+ function xA(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(n,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var wA=e=>e.disabled||Array.isArray(e.accessibilityStates)&&e.accessibilityStates.indexOf("disabled")>-1,SA={adjustable:"slider",button:"button",header:"heading",image:"img",imagebutton:null,keyboardkey:null,label:null,link:"link",none:"presentation",search:"search",summary:"region",text:null},aE=e=>{var t=e.accessibilityRole,r=e.role,n=r||t;if(n){var o=SA[n];if(o!==null)return o||n}},EA={article:"article",banner:"header",blockquote:"blockquote",button:"button",code:"code",complementary:"aside",contentinfo:"footer",deletion:"del",emphasis:"em",figure:"figure",insertion:"ins",form:"form",list:"ul",listitem:"li",main:"main",navigation:"nav",paragraph:"p",region:"section",strong:"strong"},CA={},kA=function(t){t===void 0&&(t=CA);var r=t.role||t.accessibilityRole;if(r==="label")return"label";var n=aE(t);if(n){if(n==="heading"){var o=t.accessibilityLevel||t["aria-level"];return o!=null?"h"+o:"h1"}return EA[n]}},lE={isDisabled:wA,propsToAccessibilityComponent:kA,propsToAriaRole:aE};function ul(e){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ul(e)}function RA(e,t){if(ul(e)!="object"||!e)return e;var r;if(typeof Symbol<"u"&&(r=e[Symbol.toPrimitive])!==void 0){var n=r.call(e,t);if(ul(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _A(e){var t=RA(e,"string");return ul(t)=="symbol"?t:t+""}function $A(e,t,r){return(t=_A(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function js(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nb(Object(r),!0).forEach(function(n){$A(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sd(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ou={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},AA=["ms","Moz","O","Webkit"],TA=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(Ou).forEach(e=>{AA.forEach(t=>{Ou[TA(t,e)]=Ou[e]})});var LA=e=>e==="currentcolor"||e==="currentColor"||e==="inherit"||e.indexOf("var(")===0;function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cE(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var o=!1;try{o=this instanceof n}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var $p,ib;function IA(){if(ib)return $p;ib=1;function e(C){if(typeof C=="number")return C>>>0===C&&C>=0&&C<=4294967295?C:null;if(typeof C!="string")return null;const R=h();let k;if(k=R.hex6.exec(C))return parseInt(k[1]+"ff",16)>>>0;const $=S(C);return $??((k=R.rgb.exec(C))?(m(k[1])<<24|m(k[2])<<16|m(k[3])<<8|255)>>>0:(k=R.rgba.exec(C))?k[6]!==void 0?(m(k[6])<<24|m(k[7])<<16|m(k[8])<<8|w(k[9]))>>>0:(m(k[2])<<24|m(k[3])<<16|m(k[4])<<8|w(k[5]))>>>0:(k=R.hex3.exec(C))?parseInt(k[1]+k[1]+k[2]+k[2]+k[3]+k[3]+"ff",16)>>>0:(k=R.hex8.exec(C))?parseInt(k[1],16)>>>0:(k=R.hex4.exec(C))?parseInt(k[1]+k[1]+k[2]+k[2]+k[3]+k[3]+k[4]+k[4],16)>>>0:(k=R.hsl.exec(C))?(r(y(k[1]),E(k[2]),E(k[3]))|255)>>>0:(k=R.hsla.exec(C))?k[6]!==void 0?(r(y(k[6]),E(k[7]),E(k[8]))|w(k[9]))>>>0:(r(y(k[2]),E(k[3]),E(k[4]))|w(k[5]))>>>0:(k=R.hwb.exec(C))?(n(y(k[1]),E(k[2]),E(k[3]))|255)>>>0:null)}function t(C,R,k){return k<0&&(k+=1),k>1&&(k-=1),k<1/6?C+(R-C)*6*k:k<1/2?R:k<2/3?C+(R-C)*(2/3-k)*6:C}function r(C,R,k){const $=k<.5?k*(1+R):k+R-k*R,A=2*k-$,D=t(A,$,C+1/3),N=t(A,$,C),P=t(A,$,C-1/3);return Math.round(D*255)<<24|Math.round(N*255)<<16|Math.round(P*255)<<8}function n(C,R,k){if(R+k>=1){const N=Math.round(R*255/(R+k));return N<<24|N<<16|N<<8}const $=t(0,1,C+1/3)*(1-R-k)+R,A=t(0,1,C)*(1-R-k)+R,D=t(0,1,C-1/3)*(1-R-k)+R;return Math.round($*255)<<24|Math.round(A*255)<<16|Math.round(D*255)<<8}const o="[-+]?\\d*\\.?\\d+",a=o+"%";function l(...C){return"\\(\\s*("+C.join(")\\s*,?\\s*(")+")\\s*\\)"}function u(...C){return"\\(\\s*("+C.slice(0,C.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+C[C.length-1]+")\\s*\\)"}function d(...C){return"\\(\\s*("+C.join(")\\s*,\\s*(")+")\\s*\\)"}let p;function h(){return p===void 0&&(p={rgb:new RegExp("rgb"+l(o,o,o)),rgba:new RegExp("rgba("+d(o,o,o,o)+"|"+u(o,o,o,o)+")"),hsl:new RegExp("hsl"+l(o,a,a)),hsla:new RegExp("hsla("+d(o,a,a,o)+"|"+u(o,a,a,o)+")"),hwb:new RegExp("hwb"+l(o,a,a)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),p}function m(C){const R=parseInt(C,10);return R<0?0:R>255?255:R}function y(C){return(parseFloat(C)%360+360)%360/360}function w(C){const R=parseFloat(C);return R<0?0:R>1?255:Math.round(R*255)}function E(C){const R=parseFloat(C);return R<0?0:R>100?1:R/100}function S(C){switch(C){case"transparent":return 0;case"aliceblue":return 4042850303;case"antiquewhite":return 4209760255;case"aqua":return 16777215;case"aquamarine":return 2147472639;case"azure":return 4043309055;case"beige":return 4126530815;case"bisque":return 4293182719;case"black":return 255;case"blanchedalmond":return 4293643775;case"blue":return 65535;case"blueviolet":return 2318131967;case"brown":return 2771004159;case"burlywood":return 3736635391;case"burntsienna":return 3934150143;case"cadetblue":return 1604231423;case"chartreuse":return 2147418367;case"chocolate":return 3530104575;case"coral":return 4286533887;case"cornflowerblue":return 1687547391;case"cornsilk":return 4294499583;case"crimson":return 3692313855;case"cyan":return 16777215;case"darkblue":return 35839;case"darkcyan":return 9145343;case"darkgoldenrod":return 3095792639;case"darkgray":return 2846468607;case"darkgreen":return 6553855;case"darkgrey":return 2846468607;case"darkkhaki":return 3182914559;case"darkmagenta":return 2332068863;case"darkolivegreen":return 1433087999;case"darkorange":return 4287365375;case"darkorchid":return 2570243327;case"darkred":return 2332033279;case"darksalmon":return 3918953215;case"darkseagreen":return 2411499519;case"darkslateblue":return 1211993087;case"darkslategray":return 793726975;case"darkslategrey":return 793726975;case"darkturquoise":return 13554175;case"darkviolet":return 2483082239;case"deeppink":return 4279538687;case"deepskyblue":return 12582911;case"dimgray":return 1768516095;case"dimgrey":return 1768516095;case"dodgerblue":return 512819199;case"firebrick":return 2988581631;case"floralwhite":return 4294635775;case"forestgreen":return 579543807;case"fuchsia":return 4278255615;case"gainsboro":return 3705462015;case"ghostwhite":return 4177068031;case"gold":return 4292280575;case"goldenrod":return 3668254975;case"gray":return 2155905279;case"green":return 8388863;case"greenyellow":return 2919182335;case"grey":return 2155905279;case"honeydew":return 4043305215;case"hotpink":return 4285117695;case"indianred":return 3445382399;case"indigo":return 1258324735;case"ivory":return 4294963455;case"khaki":return 4041641215;case"lavender":return 3873897215;case"lavenderblush":return 4293981695;case"lawngreen":return 2096890111;case"lemonchiffon":return 4294626815;case"lightblue":return 2916673279;case"lightcoral":return 4034953471;case"lightcyan":return 3774873599;case"lightgoldenrodyellow":return 4210742015;case"lightgray":return 3553874943;case"lightgreen":return 2431553791;case"lightgrey":return 3553874943;case"lightpink":return 4290167295;case"lightsalmon":return 4288707327;case"lightseagreen":return 548580095;case"lightskyblue":return 2278488831;case"lightslategray":return 2005441023;case"lightslategrey":return 2005441023;case"lightsteelblue":return 2965692159;case"lightyellow":return 4294959359;case"lime":return 16711935;case"limegreen":return 852308735;case"linen":return 4210091775;case"magenta":return 4278255615;case"maroon":return 2147483903;case"mediumaquamarine":return 1724754687;case"mediumblue":return 52735;case"mediumorchid":return 3126187007;case"mediumpurple":return 2473647103;case"mediumseagreen":return 1018393087;case"mediumslateblue":return 2070474495;case"mediumspringgreen":return 16423679;case"mediumturquoise":return 1221709055;case"mediumvioletred":return 3340076543;case"midnightblue":return 421097727;case"mintcream":return 4127193855;case"mistyrose":return 4293190143;case"moccasin":return 4293178879;case"navajowhite":return 4292783615;case"navy":return 33023;case"oldlace":return 4260751103;case"olive":return 2155872511;case"olivedrab":return 1804477439;case"orange":return 4289003775;case"orangered":return 4282712319;case"orchid":return 3664828159;case"palegoldenrod":return 4008225535;case"palegreen":return 2566625535;case"paleturquoise":return 2951671551;case"palevioletred":return 3681588223;case"papayawhip":return 4293907967;case"peachpuff":return 4292524543;case"peru":return 3448061951;case"pink":return 4290825215;case"plum":return 3718307327;case"powderblue":return 2967529215;case"purple":return 2147516671;case"rebeccapurple":return 1714657791;case"red":return 4278190335;case"rosybrown":return 3163525119;case"royalblue":return 1097458175;case"saddlebrown":return 2336560127;case"salmon":return 4202722047;case"sandybrown":return 4104413439;case"seagreen":return 780883967;case"seashell":return 4294307583;case"sienna":return 2689740287;case"silver":return 3233857791;case"skyblue":return 2278484991;case"slateblue":return 1784335871;case"slategray":return 1887473919;case"slategrey":return 1887473919;case"snow":return 4294638335;case"springgreen":return 16744447;case"steelblue":return 1182971135;case"tan":return 3535047935;case"teal":return 8421631;case"thistle":return 3636451583;case"tomato":return 4284696575;case"turquoise":return 1088475391;case"violet":return 4001558271;case"wheat":return 4125012991;case"white":return 4294967295;case"whitesmoke":return 4126537215;case"yellow":return 4294902015;case"yellowgreen":return 2597139199}return null}return $p=e,$p}var OA=IA();const NA=Qr(OA);var PA=e=>{if(e==null)return e;var t=NA(e);if(t!=null)return t=(t<<24|t>>>8)>>>0,t},Lg=function(t,r){if(r===void 0&&(r=1),t!=null){if(typeof t=="string"&&LA(t))return t;var n=PA(t);if(n!=null){var o=n>>16&255,a=n>>8&255,l=n&255,u=(n>>24&255)/255,d=(u*r).toFixed(2);return"rgba("+o+","+a+","+l+","+d+")"}}},DA={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function mr(e,t){var r=e;return(t==null||!Ou[t])&&typeof e=="number"?r=e+"px":t!=null&&DA[t]&&(r=Lg(e)),r}var zo=!!(typeof window<"u"&&window.document&&window.document.createElement),jA={},MA=!zo||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports("text-decoration-line","none")||window.CSS.supports("-webkit-text-decoration-line","none")),zA="monospace,monospace",ob='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',FA={borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderBlockColor:["borderTopColor","borderBottomColor"],borderInlineColor:["borderRightColor","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderStyle:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],borderBlockStyle:["borderTopStyle","borderBottomStyle"],borderInlineStyle:["borderRightStyle","borderLeftStyle"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderBlockWidth:["borderTopWidth","borderBottomWidth"],borderInlineWidth:["borderRightWidth","borderLeftWidth"],insetBlock:["top","bottom"],insetInline:["left","right"],marginBlock:["marginTop","marginBottom"],marginInline:["marginRight","marginLeft"],paddingBlock:["paddingTop","paddingBottom"],paddingInline:["paddingRight","paddingLeft"],overflow:["overflowX","overflowY"],overscrollBehavior:["overscrollBehaviorX","overscrollBehaviorY"],borderBlockStartColor:["borderTopColor"],borderBlockStartStyle:["borderTopStyle"],borderBlockStartWidth:["borderTopWidth"],borderBlockEndColor:["borderBottomColor"],borderBlockEndStyle:["borderBottomStyle"],borderBlockEndWidth:["borderBottomWidth"],borderEndStartRadius:["borderBottomLeftRadius"],borderEndEndRadius:["borderBottomRightRadius"],borderStartStartRadius:["borderTopLeftRadius"],borderStartEndRadius:["borderTopRightRadius"],insetBlockEnd:["bottom"],insetBlockStart:["top"],marginBlockStart:["marginTop"],marginBlockEnd:["marginBottom"],paddingBlockStart:["paddingTop"],paddingBlockEnd:["paddingBottom"]},uE=(e,t)=>{if(!e)return jA;var r={},n=function(){var u=e[o];if(u==null)return"continue";if(o==="backgroundClip")u==="text"&&(r.backgroundClip=u,r.WebkitBackgroundClip=u);else if(o==="flex")u===-1?(r.flexGrow=0,r.flexShrink=1,r.flexBasis="auto"):r.flex=u;else if(o==="font")r[o]=u.replace("System",ob);else if(o==="fontFamily")if(u.indexOf("System")>-1){var d=u.split(/,\s*/);d[d.indexOf("System")]=ob,r[o]=d.join(",")}else u==="monospace"?r[o]=zA:r[o]=u;else if(o==="textDecorationLine")MA?r.textDecorationLine=u:r.textDecoration=u;else if(o==="writingDirection")r.direction=u;else{var p=mr(e[o],o),h=FA[o];t&&o==="inset"?(e.insetInline==null&&(r.left=p,r.right=p),e.insetBlock==null&&(r.top=p,r.bottom=p)):t&&o==="margin"?(e.marginInline==null&&(r.marginLeft=p,r.marginRight=p),e.marginBlock==null&&(r.marginTop=p,r.marginBottom=p)):t&&o==="padding"?(e.paddingInline==null&&(r.paddingLeft=p,r.paddingRight=p),e.paddingBlock==null&&(r.paddingTop=p,r.paddingBottom=p)):h?h.forEach((m,y)=>{e[m]==null&&(r[m]=p)}):r[o]=p}};for(var o in e)var a=n();return r};function BA(e,t){for(var r=e.length,n=t^r,o=0,a;r>=4;)a=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)^a,r-=4,++o;switch(r){case 3:n^=(e.charCodeAt(o+2)&255)<<16;case 2:n^=(e.charCodeAt(o+1)&255)<<8;case 1:n^=e.charCodeAt(o)&255,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)}return n^=n>>>13,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>15,n>>>0}var UA=e=>BA(e,1).toString(36),VA=/[A-Z]/g,WA=/^ms-/,Ap={};function HA(e){return"-"+e.toLowerCase()}function qA(e){if(e in Ap)return Ap[e];var t=e.replace(VA,HA);return Ap[e]=WA.test(t)?"-"+t:t}var tu={},ru={},nu={},sb;function dE(){if(sb)return nu;sb=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.default=e;function e(t){return t.charAt(0).toUpperCase()+t.slice(1)}return nu}var ab;function GA(){if(ab)return ru;ab=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.default=n;var e=dE(),t=r(e);function r(o){return o&&o.__esModule?o:{default:o}}function n(o,a,l){var u=o[a];if(u&&l.hasOwnProperty(a))for(var d=(0,t.default)(a),p=0;p<u.length;++p){var h=u[p]+d;l[h]||(l[h]=l[a])}return l}return ru}var iu={},lb;function XA(){if(lb)return iu;lb=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.default=e;function e(t,r,n,o,a){for(var l=0,u=t.length;l<u;++l){var d=t[l](r,n,o,a);if(d)return d}}return iu}var ou={},cb;function YA(){if(cb)return ou;cb=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.default=t;function e(r,n){r.indexOf(n)===-1&&r.push(n)}function t(r,n){if(Array.isArray(n))for(var o=0,a=n.length;o<a;++o)e(r,n[o]);else e(r,n)}return ou}var su={},ub;function KA(){if(ub)return su;ub=1,Object.defineProperty(su,"__esModule",{value:!0}),su.default=e;function e(t){return t instanceof Object&&!Array.isArray(t)}return su}var db;function QA(){if(db)return tu;db=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.default=p;var e=GA(),t=d(e),r=XA(),n=d(r),o=YA(),a=d(o),l=KA(),u=d(l);function d(h){return h&&h.__esModule?h:{default:h}}function p(h){var m=h.prefixMap,y=h.plugins;return function w(E){for(var S in E){var C=E[S];if((0,u.default)(C))E[S]=w(C);else if(Array.isArray(C)){for(var R=[],k=0,$=C.length;k<$;++k){var A=(0,n.default)(y,S,C[k],E,m);(0,a.default)(R,A||C[k])}R.length>0&&(E[S]=R)}else{var D=(0,n.default)(y,S,C,E,m);D&&(E[S]=D),E=(0,t.default)(m,S,E)}}return E}}return tu}var JA=QA();const ZA=Qr(JA);var au={};function Nu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nu=function(r){return typeof r}:Nu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Nu(e)}function eT(e){return iT(e)||nT(e)||rT(e)||tT()}function tT(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rT(e,t){if(e){if(typeof e=="string")return km(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return km(e,t)}}function nT(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function iT(e){if(Array.isArray(e))return km(e)}function km(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fb(e){return e.filter(function(t,r){return e.lastIndexOf(t)===r})}function fE(e){for(var t=0,r=arguments.length<=1?0:arguments.length-1;t<r;++t){var n=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];for(var o in n){var a=n[o],l=e[o];if(l&&a){if(Array.isArray(l)){e[o]=fb(l.concat(a));continue}if(Array.isArray(a)){e[o]=fb([l].concat(eT(a)));continue}if(Nu(a)==="object"){e[o]=fE({},l,a);continue}}e[o]=a}}return e}var oT=/-([a-z])/g,sT=/^Ms/g,Tp={};function aT(e){return e[1].toUpperCase()}function pE(e){if(Tp.hasOwnProperty(e))return Tp[e];var t=e.replace(oT,aT).replace(sT,"ms");return Tp[e]=t,t}var lT=/[A-Z]/g,cT=/^ms-/,Lp={};function uT(e){return"-"+e.toLowerCase()}function hE(e){if(Lp.hasOwnProperty(e))return Lp[e];var t=e.replace(lT,uT);return Lp[e]=cT.test(t)?"-"+t:t}const dT=Object.freeze(Object.defineProperty({__proto__:null,default:hE},Symbol.toStringTag,{value:"Module"}));function Ed(e){return hE(e)}function mE(e,t){return Ed(e)+":"+t}function fT(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=mE(r,n))}return t}var pT=/^(Webkit|Moz|O|ms)/;function hT(e){return pT.test(e)}var mT=/-webkit-|-moz-|-ms-/;function gT(e){return typeof e=="string"&&mT.test(e)}var dl={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pb=["animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","order"],hb=["Webkit","ms","Moz","O"];function vT(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}for(var Ip=0,yT=pb.length;Ip<yT;++Ip){var mb=pb[Ip];dl[mb]=!0;for(var Op=0,bT=hb.length;Op<bT;++Op)dl[vT(hb[Op],mb)]=!0}for(var xT in dl)dl[Ed(xT)]=!0;function wT(e){return dl.hasOwnProperty(e)}var ST=/^(ms|Webkit|Moz|O)/;function gE(e){var t=e.replace(ST,"");return t.charAt(0).toLowerCase()+t.slice(1)}function ET(e){return gE(pE(e))}function CT(e,t){return t.join(";"+Ed(e)+":")}var kT=/(-ms-|-webkit-|-moz-|-o-)/g;function RT(e){return typeof e=="string"?e.replace(kT,""):e}const _T=Object.freeze(Object.defineProperty({__proto__:null,assignStyle:fE,camelCaseProperty:pE,cssifyDeclaration:mE,cssifyObject:fT,hyphenateProperty:Ed,isPrefixedProperty:hT,isPrefixedValue:gT,isUnitlessProperty:wT,normalizeProperty:ET,resolveArrayValue:CT,unprefixProperty:gE,unprefixValue:RT},Symbol.toStringTag,{value:"Module"})),$T=cE(_T);var gb;function AT(){if(gb)return au;gb=1,Object.defineProperty(au,"__esModule",{value:!0}),au.default=n;var e=$T,t=/cross-fade\(/g,r=["-webkit-",""];function n(o,a){if(typeof a=="string"&&!(0,e.isPrefixedValue)(a)&&a.indexOf("cross-fade(")!==-1)return r.map(function(l){return a.replace(t,l+"cross-fade(")})}return au}var TT=AT();const LT=Qr(TT);var lu={},Np={},vb;function vE(){return vb||(vb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var t=/-webkit-|-moz-|-ms-/;function r(n){return typeof n=="string"&&t.test(n)}})(Np)),Np}var yb;function IT(){if(yb)return lu;yb=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.default=o;var e=vE(),t=r(e);function r(a){return a&&a.__esModule?a:{default:a}}var n=["-webkit-",""];function o(a,l){if(typeof l=="string"&&!(0,t.default)(l)&&l.indexOf("image-set(")>-1)return n.map(function(u){return l.replace(/image-set\(/g,u+"image-set(")})}return lu}var OT=IT();const NT=Qr(OT);var cu={},bb;function PT(){if(bb)return cu;bb=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.default=t;var e={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function t(r,n,o){if(Object.prototype.hasOwnProperty.call(e,r))for(var a=e[r],l=0,u=a.length;l<u;++l)o[a[l]]=n}return cu}var DT=PT();const jT=Qr(DT);var uu={},xb;function MT(){if(xb)return uu;xb=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.default=e;function e(t,r){if(t==="position"&&r==="sticky")return["-webkit-sticky","sticky"]}return uu}var zT=MT();const FT=Qr(zT);var du={},wb;function BT(){if(wb)return du;wb=1,Object.defineProperty(du,"__esModule",{value:!0}),du.default=n;var e=["-webkit-","-moz-",""],t={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},r={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function n(o,a){if(t.hasOwnProperty(o)&&r.hasOwnProperty(a))return e.map(function(l){return l+a})}return du}var UT=BT();const VT=Qr(UT);var fu={},Pp={};const WT=cE(dT);var Sb;function HT(){return Sb||(Sb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var t=WT,r=n(t);function n(a){return a&&a.__esModule?a:{default:a}}function o(a){return(0,r.default)(a)}})(Pp)),Pp}var Eb;function qT(){if(Eb)return fu;Eb=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.default=h;var e=HT(),t=l(e),r=vE(),n=l(r),o=dE(),a=l(o);function l(m){return m&&m.__esModule?m:{default:m}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},d={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function p(m,y){if((0,n.default)(m))return m;for(var w=m.split(/,(?![^()]*(?:\([^()]*\))?\))/g),E=0,S=w.length;E<S;++E){var C=w[E],R=[C];for(var k in y){var $=(0,t.default)(k);if(C.indexOf($)>-1&&$!=="order")for(var A=y[k],D=0,N=A.length;D<N;++D)R.unshift(C.replace($,d[A[D]]+$))}w[E]=R.join(",")}return w.join(",")}function h(m,y,w,E){if(typeof y=="string"&&u.hasOwnProperty(m)){var S=p(y,E),C=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(k){return!/-moz-|-ms-/.test(k)}).join(",");if(m.indexOf("Webkit")>-1)return C;var R=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(k){return!/-webkit-|-ms-/.test(k)}).join(",");return m.indexOf("Moz")>-1?R:(w["Webkit"+(0,a.default)(m)]=C,w["Moz"+(0,a.default)(m)]=R,S)}}return fu}var GT=qT();const XT=Qr(GT);var mt=["Webkit"],YT=["Moz"],KT=["Webkit","Moz"],It=["Webkit","ms"],QT=["Webkit","Moz","ms"];const JT={plugins:[LT,NT,jT,FT,VT,XT],prefixMap:{appearance:QT,userSelect:KT,textEmphasisPosition:It,textEmphasis:It,textEmphasisStyle:It,textEmphasisColor:It,boxDecorationBreak:It,clipPath:mt,maskImage:It,maskMode:It,maskRepeat:It,maskPosition:It,maskClip:It,maskOrigin:It,maskSize:It,maskComposite:It,mask:It,maskBorderSource:It,maskBorderMode:It,maskBorderSlice:It,maskBorderWidth:It,maskBorderOutset:It,maskBorderRepeat:It,maskBorder:It,maskType:It,textDecorationStyle:mt,textDecorationSkip:mt,textDecorationLine:mt,textDecorationColor:mt,filter:mt,breakAfter:mt,breakBefore:mt,breakInside:mt,columnCount:mt,columnFill:mt,columnGap:mt,columnRule:mt,columnRuleColor:mt,columnRuleStyle:mt,columnRuleWidth:mt,columns:mt,columnSpan:mt,columnWidth:mt,backdropFilter:mt,hyphens:mt,flowInto:mt,flowFrom:mt,regionFragment:mt,textOrientation:mt,tabSize:YT,fontKerning:mt,textSizeAdjust:mt}};var ZT=ZA(JT),eL=["animationKeyframes"],Cb=new Map,tL={},rL=1,nL=3,iL={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},Rm="borderTopLeftRadius",_m="borderTopRightRadius",$m="borderBottomLeftRadius",Am="borderBottomRightRadius",Tm="borderLeftColor",Lm="borderLeftStyle",Im="borderLeftWidth",Om="borderRightColor",Nm="borderRightStyle",Pm="borderRightWidth",Dm="right",jm="marginLeft",Mm="marginRight",zm="paddingLeft",Fm="paddingRight",Bm="left",Yu={[Rm]:_m,[_m]:Rm,[$m]:Am,[Am]:$m,[Tm]:Om,[Lm]:Nm,[Im]:Pm,[Om]:Tm,[Nm]:Lm,[Pm]:Im,[Bm]:Dm,[jm]:Mm,[Mm]:jm,[zm]:Fm,[Fm]:zm,[Dm]:Bm},sl={borderStartStartRadius:Rm,borderStartEndRadius:_m,borderEndStartRadius:$m,borderEndEndRadius:Am,borderInlineStartColor:Tm,borderInlineStartStyle:Lm,borderInlineStartWidth:Im,borderInlineEndColor:Om,borderInlineEndStyle:Nm,borderInlineEndWidth:Pm,insetInlineEnd:Dm,insetInlineStart:Bm,marginInlineStart:jm,marginInlineEnd:Mm,paddingInlineStart:zm,paddingInlineEnd:Fm},yE=["clear","float","textAlign"];function oL(e){var t={$$css:!0},r=[];function n(o,a,l){var u=lL(l,a),d=a+u,p=Cb.get(d),h;if(p!=null)h=p[0],r.push(p[1]);else{var m=o!==a?d:u;h=Ig("r",o,m);var y=iL[o]||nL,w=cL(h,a,l),E=[w,y];r.push(E),Cb.set(d,[h,E])}return h}return Object.keys(e).sort().forEach(o=>{var a=e[o];if(a!=null){var l;if(yE.indexOf(o)>-1){var u=n(o,o,"left"),d=n(o,o,"right");a==="start"?l=[u,d]:a==="end"&&(l=[d,u])}var p=sl[o];if(p!=null){var h=n(o,p,a),m=n(o,Yu[p],a);l=[h,m]}if(o==="transitionProperty"){for(var y=Array.isArray(a)?a:[a],w=[],E=0;E<y.length;E++){var S=y[E];typeof S=="string"&&sl[S]!=null&&w.push(E)}if(w.length>0){var C=[...y],R=[...y];w.forEach(k=>{var $=C[k];if(typeof $=="string"){var A=sl[$],D=Yu[A];C[k]=A,R[k]=D;var N=n(o,o,C),P=n(o,o,R);l=[N,P]}})}}l==null?l=n(o,o,a):t.$$css$localize=!0,t[o]=l}}),[t,r]}function sL(e,t){var r={$$css:!0},n=[],o=e.animationKeyframes,a=Sd(e,eL),l=Ig("css",t,JSON.stringify(e)),u="."+l,d;if(o!=null){var p=bE(o),h=p[0],m=p[1];d=h.join(","),n.push(...m)}var y=ei(js(js({},a),{},{animationName:d}));return n.push(""+u+y),r[l]=l,[r,[[n,rL]]]}function aL(e,t){var r=e||tL,n={},o={},a=function(){var p=r[l],h=l,m=p;if(!Object.prototype.hasOwnProperty.call(r,l)||p==null)return"continue";yE.indexOf(l)>-1&&(p==="start"?m=t?"right":"left":p==="end"&&(m=t?"left":"right"));var y=sl[l];if(y!=null&&(h=t?Yu[y]:y),l==="transitionProperty"){var w=Array.isArray(p)?p:[p];w.forEach((E,S)=>{if(typeof E=="string"){var C=sl[E];C!=null&&(w[S]=t?Yu[C]:C,m=w.join(" "))}})}n[h]||(o[h]=m),h===l&&(n[h]=!0)};for(var l in r)var u=a();return uE(o,!0)}function lL(e,t){var r=mr(e,t);return typeof r!="string"?JSON.stringify(r||""):r}function cL(e,t,r){var n=[],o="."+e;switch(t){case"animationKeyframes":{var a=bE(r),l=a[0],u=a[1],d=ei({animationName:l.join(",")});n.push(""+o+d,...u);break}case"placeholderTextColor":{var p=ei({color:r,opacity:1});n.push(o+"::-webkit-input-placeholder"+p,o+"::-moz-placeholder"+p,o+":-ms-input-placeholder"+p,o+"::placeholder"+p);break}case"pointerEvents":{var h=r;if(r==="auto"||r==="box-only"){if(h="auto!important",r==="box-only"){var m=ei({pointerEvents:"none"});n.push(o+">*"+m)}}else if((r==="none"||r==="box-none")&&(h="none!important",r==="box-none")){var y=ei({pointerEvents:"auto"});n.push(o+" * "+y)}var w=ei({pointerEvents:h});n.push(""+o+w);break}case"scrollbarWidth":{r==="none"&&n.push(o+"::-webkit-scrollbar{display:none}");var E=ei({scrollbarWidth:r});n.push(""+o+E);break}default:{var S=ei({[t]:r});n.push(""+o+S);break}}return n}function ei(e){var t=ZT(uE(e)),r=Object.keys(t).map(n=>{var o=t[n],a=qA(n);return Array.isArray(o)?o.map(l=>a+":"+l).join(";"):a+":"+o}).sort().join(";");return"{"+r+";}"}function Ig(e,t,r){var n=UA(t+r);return e+"-"+n}function uL(e){var t=["-webkit-",""],r=Ig("r","animation",JSON.stringify(e)),n="{"+Object.keys(e).map(a=>{var l=e[a],u=ei(l);return""+a+u}).join("")+"}",o=t.map(a=>"@"+a+"keyframes "+r+n);return[r,o]}function bE(e){if(typeof e=="number")throw new Error("Invalid CSS keyframes type: "+typeof e);var t=[],r=[],n=Array.isArray(e)?e:[e];return n.forEach(o=>{if(typeof o=="string")t.push(o);else{var a=uL(o),l=a[0],u=a[1];t.push(l),r.push(...u)}}),[t,r]}function Dp(e,t,r){if(zo){var n=t??document,o=n.getElementById(e);if(o==null)if(o=document.createElement("style"),o.setAttribute("id",e),typeof r=="string"&&o.appendChild(document.createTextNode(r)),n instanceof ShadowRoot)n.insertBefore(o,n.firstChild);else{var a=n.head;a&&a.insertBefore(o,a.firstChild)}return o.sheet}else return null}var dL=Array.prototype.slice;function jp(e){var t={},r={};if(e!=null){var n;dL.call(e.cssRules).forEach((l,u)=>{var d=l.cssText;if(d.indexOf("stylesheet-group")>-1)n=hL(l),t[n]={start:u,rules:[d]};else{var p=Rb(d);p!=null&&(r[p]=!0,t[n].rules.push(d))}})}function o(l,u,d){var p=kb(t),h=p.indexOf(u),m=h+1,y=p[m],w=y!=null&&t[y].start!=null?t[y].start:l.cssRules.length,E=gL(l,d,w);if(E){t[u].start==null&&(t[u].start=w);for(var S=m;S<p.length;S+=1){var C=p[S],R=t[C].start||0;t[C].start=R+1}}return E}var a={getTextContent(){return kb(t).map(l=>{var u=t[l].rules,d=u.shift();return u.sort(),u.unshift(d),u.join(`
3
3
  `)}).join(`
4
- `)},insert(l,u){var d=Number(u);if(t[d]==null){var p=cL(d);t[d]={start:null,rules:[p]},e!=null&&o(e,d,p)}var h=Rb(l);if(h!=null&&r[h]==null&&(r[h]=!0,t[d].rules.push(l),e!=null)){var m=o(e,d,l);m||t[d].rules.pop()}}};return a}function cL(e){return'[stylesheet-group="'+e+'"]{}'}var uL=/["']/g;function dL(e){return Number(e.selectorText.split(uL)[1])}function kb(e){return Object.keys(e).map(Number).sort((t,r)=>t>r?1:-1)}var fL=/\s*([,])\s*/g;function Rb(e){var t=e.split("{")[0].trim();return t!==""?t.replace(fL,"$1"):null}function pL(e,t,r){try{return e.insertRule(t,r),!0}catch{return!1}}var hL="react-native-stylesheet",jp=new WeakMap,pn=[],_b=["html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}","body{margin:0;}","button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}","input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"];function Ig(e,t){t===void 0&&(t=hL);var r;if(zo){var n=e!=null?e.getRootNode():document;if(pn.length===0)r=Dp(Pp(t)),_b.forEach(u=>{r.insert(u,0)}),jp.set(n,pn.length),pn.push(r);else{var o=jp.get(n);if(o==null){var a=pn[0],l=a!=null?a.getTextContent():"";r=Dp(Pp(t,n,l)),jp.set(n,pn.length),pn.push(r)}else r=pn[o]}}else pn.length===0?(r=Dp(Pp(t)),_b.forEach(u=>{r.insert(u,0)}),pn.push(r)):r=pn[0];return{getTextContent(){return r.getTextContent()},id:t,insert(u,d){pn.forEach(p=>{p.insert(u,d)})}}}var pu={},$b;function mL(){if($b)return pu;$b=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.localizeStyle=n;var e=new WeakMap,t="$$css$localize";function r(o,a){var l={};for(var u in o)if(u!==t){var d=o[u];Array.isArray(d)?l[u]=a?d[1]:d[0]:l[u]=d}return l}function n(o,a){if(o[t]!=null){var l=a?1:0;if(e.has(o)){var u=e.get(o),d=u[l];return d==null&&(d=r(o,a),u[l]=d,e.set(o,u)),d}var p=r(o,a),h=new Array(2);return h[l]=p,e.set(o,h),p}return o}return pu}var Mp,Ab;function gL(){return Ab||(Ab=1,Mp=mL()),Mp}var vL=gL(),yL={},yE={height:0,width:0},bL=e=>{var t=e.shadowColor,r=e.shadowOffset,n=e.shadowOpacity,o=e.shadowRadius,a=r||yE,l=a.height,u=a.width,d=mr(u),p=mr(l),h=mr(o||0),m=Tg(t||"black",n);if(m!=null&&d!=null&&p!=null&&h!=null)return d+" "+p+" "+h+" "+m},xL=e=>{var t=e.textShadowColor,r=e.textShadowOffset,n=e.textShadowRadius,o=r||yE,a=o.height,l=o.width,u=n||0,d=mr(l),p=mr(a),h=mr(u),m=mr(t,"textShadowColor");if(m&&(a!==0||l!==0||u!==0)&&d!=null&&p!=null&&h!=null)return d+" "+p+" "+h+" "+m},wL=e=>{if(typeof e=="string")return e;var t=mr(e.offsetX)||0,r=mr(e.offsetY)||0,n=mr(e.blurRadius)||0,o=mr(e.spreadDistance)||0,a=Tg(e.color)||"black",l=e.inset?"inset ":"";return""+l+t+" "+r+" "+n+" "+o+" "+a},SL=e=>e.map(wL).join(", "),EL=e=>{var t=Object.keys(e)[0],r=e[t];if(t==="matrix"||t==="matrix3d")return t+"("+r.join(",")+")";var n=mr(r,t);return t+"("+n+")"},CL=e=>e.map(EL).join(" "),kL=e=>e.map(t=>mr(t)).join(" "),RL={borderBottomEndRadius:"borderEndEndRadius",borderBottomStartRadius:"borderEndStartRadius",borderTopEndRadius:"borderStartEndRadius",borderTopStartRadius:"borderStartStartRadius",borderEndColor:"borderInlineEndColor",borderEndStyle:"borderInlineEndStyle",borderEndWidth:"borderInlineEndWidth",borderStartColor:"borderInlineStartColor",borderStartStyle:"borderInlineStartStyle",borderStartWidth:"borderInlineStartWidth",end:"insetInlineEnd",marginEnd:"marginInlineEnd",marginHorizontal:"marginInline",marginStart:"marginInlineStart",marginVertical:"marginBlock",paddingEnd:"paddingInlineEnd",paddingHorizontal:"paddingInline",paddingStart:"paddingInlineStart",paddingVertical:"paddingBlock",start:"insetInlineStart"},_L={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},bE=function(t,r){r===void 0&&(r={});var n=t||yL,o={};if(r.shadow,n.shadowColor!=null||n.shadowOffset!=null||n.shadowOpacity!=null||n.shadowRadius!=null){var a=bL(n);a!=null&&(o.boxShadow=a)}if(r.textShadow,n.textShadowColor!=null||n.textShadowOffset!=null||n.textShadowRadius!=null){var l=xL(n);if(l!=null&&o.textShadow==null){var u=n.textShadow,d=u?u+", "+l:l;o.textShadow=d}}for(var p in n)if(!(_L[p]!=null||p==="shadowColor"||p==="shadowOffset"||p==="shadowOpacity"||p==="shadowRadius"||p==="textShadowColor"||p==="textShadowOffset"||p==="textShadowRadius")){var h=n[p],m=RL[p]||p,y=h;if(!(!Object.prototype.hasOwnProperty.call(n,p)||m!==p&&n[m]!=null))if(m==="aspectRatio"&&typeof y=="number")o[m]=y.toString();else if(m==="boxShadow"){Array.isArray(y)&&(y=SL(y));var w=o.boxShadow;o.boxShadow=w?y+", "+w:y}else m==="fontVariant"?(Array.isArray(y)&&y.length>0&&(y=y.join(" ")),o[m]=y):m==="textAlignVertical"?n.verticalAlign==null&&(o.verticalAlign=y==="center"?"middle":y):m==="transform"?(Array.isArray(y)&&(y=CL(y)),o.transform=y):m==="transformOrigin"?(Array.isArray(y)&&(y=kL(y)),o.transformOrigin=y):o[m]=y}return o},Xa={},Tb;function $L(){if(Tb)return Xa;Tb=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.styleq=void 0;var e=new WeakMap,t="$$css";function r(o){var a,l,u;return o!=null&&(a=o.disableCache===!0,l=o.disableMix===!0,u=o.transform),function(){for(var p=[],h="",m=null,y=a?null:e,w=new Array(arguments.length),E=0;E<arguments.length;E++)w[E]=arguments[E];for(;w.length>0;){var S=w.pop();if(!(S==null||S===!1)){if(Array.isArray(S)){for(var C=0;C<S.length;C++)w.push(S[C]);continue}var R=u!=null?u(S):S;if(R.$$css){var k="";if(y!=null&&y.has(R)){var $=y.get(R);$!=null&&(k=$[0],p.push.apply(p,$[1]),y=$[2])}else{var A=[];for(var D in R){var N=R[D];D!==t&&(typeof N=="string"||N===null?p.includes(D)||(p.push(D),y!=null&&A.push(D),typeof N=="string"&&(k+=k?" "+N:N)):console.error("styleq: ".concat(D," typeof ").concat(String(N),' is not "string" or "null".')))}if(y!=null){var P=new WeakMap;y.set(R,[k,A,P]),y=P}}k&&(h=h?k+" "+h:k)}else if(l)m==null&&(m={}),m=Object.assign({},R,m);else{var I=null;for(var re in R){var Z=R[re];Z!==void 0&&(p.includes(re)||(Z!=null&&(m==null&&(m={}),I==null&&(I={}),I[re]=Z),p.push(re),y=null))}I!=null&&(m=Object.assign(I,m))}}}var ee=[h,m];return ee}}var n=r();return Xa.styleq=n,n.factory=r,Xa}var AL=$L(),TL=["writingDirection"],xE=new WeakMap,Ku=Ig(),wE={shadow:!0,textShadow:!0};function LL(e,t){t===void 0&&(t={});var r=t,n=r.writingDirection,o=Sd(r,TL),a=n==="rtl";return AL.styleq.factory({transform(l){var u=xE.get(l);return u!=null?vL.localizeStyle(u,a):bE(l,js(js({},wE),o))}})(e)}function SE(e){e.forEach(t=>{var r=t[0],n=t[1];Ku!=null&&r.forEach(o=>{Ku.insert(o,n)})})}function IL(e){var t=rL(bE(e,wE)),r=t[0],n=t[1];return SE(n),r}function OL(e,t){var r=nL(e,t),n=r[0],o=r[1];return SE(o),n}var EE={position:"absolute",left:0,right:0,top:0,bottom:0},NL=CE({x:js({},EE)}).x;function CE(e){return Object.keys(e).forEach(t=>{var r=e[t];if(r!=null&&r.$$css!==!0){var n;t.indexOf("$raw")>-1?n=OL(r,t.split("$raw")[0]):n=IL(r),xE.set(r,n)}}),e}function PL(e,t){return[e,t]}function DL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.flat(1/0),o={},a=0;a<n.length;a++){var l=n[a];l!=null&&typeof l=="object"&&Object.assign(o,l)}return o}function jL(){return{id:Ku.id,textContent:Ku.getTextContent()}}function di(e,t){t===void 0&&(t={});var r=t.writingDirection==="rtl",n=LL(e,t);return Array.isArray(n)&&n[1]!=null&&(n[1]=iL(n[1],r)),n}di.absoluteFill=NL;di.absoluteFillObject=EE;di.create=CE;di.compose=PL;di.flatten=DL;di.getSheet=jL;di.hairlineWidth=1;zo&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=di.flatten);var Rl=di,ML=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],zL={},FL=Object.prototype.hasOwnProperty,BL=Array.isArray,UL=/[A-Z]/g;function VL(e){return"-"+e.toLowerCase()}function WL(e){return e.replace(UL,VL)}function Ss(e){return BL(e)?e.join(" "):e}var HL=Rl.create({auto:{pointerEvents:"auto"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"},none:{pointerEvents:"none"}}),qL=(e,t,r)=>{t||(t=zL);var n=t,o=n["aria-activedescendant"],a=n.accessibilityActiveDescendant,l=n["aria-atomic"],u=n.accessibilityAtomic,d=n["aria-autocomplete"],p=n.accessibilityAutoComplete,h=n["aria-busy"],m=n.accessibilityBusy,y=n["aria-checked"],w=n.accessibilityChecked,E=n["aria-colcount"],S=n.accessibilityColumnCount,C=n["aria-colindex"],R=n.accessibilityColumnIndex,k=n["aria-colspan"],$=n.accessibilityColumnSpan,A=n["aria-controls"],D=n.accessibilityControls,N=n["aria-current"],P=n.accessibilityCurrent,I=n["aria-describedby"],re=n.accessibilityDescribedBy,Z=n["aria-details"],ee=n.accessibilityDetails,ne=n["aria-disabled"],X=n.accessibilityDisabled,F=n["aria-errormessage"],V=n.accessibilityErrorMessage,H=n["aria-expanded"],O=n.accessibilityExpanded,L=n["aria-flowto"],U=n.accessibilityFlowTo,z=n["aria-haspopup"],T=n.accessibilityHasPopup,M=n["aria-hidden"],te=n.accessibilityHidden,le=n["aria-invalid"],G=n.accessibilityInvalid,fe=n["aria-keyshortcuts"],be=n.accessibilityKeyShortcuts,pe=n["aria-label"],ue=n.accessibilityLabel,ge=n["aria-labelledby"],qe=n.accessibilityLabelledBy,Xe=n["aria-level"],we=n.accessibilityLevel,ze=n["aria-live"],We=n.accessibilityLiveRegion,tt=n["aria-modal"],De=n.accessibilityModal,Fe=n["aria-multiline"],lt=n.accessibilityMultiline,Ne=n["aria-multiselectable"],oe=n.accessibilityMultiSelectable,Se=n["aria-orientation"],Je=n.accessibilityOrientation,ht=n["aria-owns"],Bt=n.accessibilityOwns,Ut=n["aria-placeholder"],jt=n.accessibilityPlaceholder,Vt=n["aria-posinset"],bt=n.accessibilityPosInSet,rt=n["aria-pressed"],q=n.accessibilityPressed,Q=n["aria-readonly"],ie=n.accessibilityReadOnly,se=n["aria-required"],Ce=n.accessibilityRequired;n.role,n.accessibilityRole;var Ve=n["aria-roledescription"],Ke=n.accessibilityRoleDescription,Pe=n["aria-rowcount"],he=n.accessibilityRowCount,ve=n["aria-rowindex"],ye=n.accessibilityRowIndex,xe=n["aria-rowspan"],Ue=n.accessibilityRowSpan,Ze=n["aria-selected"],dt=n.accessibilitySelected,Wt=n["aria-setsize"],Zr=n.accessibilitySetSize,en=n["aria-sort"],pi=n.accessibilitySort,wn=n["aria-valuemax"],tn=n.accessibilityValueMax,Sn=n["aria-valuemin"],sa=n.accessibilityValueMin,En=n["aria-valuenow"],Ho=n.accessibilityValueNow,to=n["aria-valuetext"],aa=n.accessibilityValueText,qo=n.dataSet,Go=n.focusable,Fl=n.id,Bn=n.nativeID,la=n.pointerEvents,Bl=n.style,ro=n.tabIndex,ca=n.testID,Ae=Sd(n,ML),Ul=ne||X,Br=sE.propsToAriaRole(t),Vl=o??a;Vl!=null&&(Ae["aria-activedescendant"]=Vl);var Wl=l!=null?o:u;Wl!=null&&(Ae["aria-atomic"]=Wl);var Ct=d??p;Ct!=null&&(Ae["aria-autocomplete"]=Ct);var Hl=h??m;Hl!=null&&(Ae["aria-busy"]=Hl);var Xo=y??w;Xo!=null&&(Ae["aria-checked"]=Xo);var ua=E??S;ua!=null&&(Ae["aria-colcount"]=ua);var no=C??R;no!=null&&(Ae["aria-colindex"]=no);var ql=k??$;ql!=null&&(Ae["aria-colspan"]=ql);var da=A??D;da!=null&&(Ae["aria-controls"]=Ss(da));var io=N??P;io!=null&&(Ae["aria-current"]=io);var Ir=I??re;Ir!=null&&(Ae["aria-describedby"]=Ss(Ir));var Gl=Z??ee;Gl!=null&&(Ae["aria-details"]=Gl),Ul===!0&&(Ae["aria-disabled"]=!0,(e==="button"||e==="form"||e==="input"||e==="select"||e==="textarea")&&(Ae.disabled=!0));var vr=F??V;vr!=null&&(Ae["aria-errormessage"]=vr);var Xl=H??O;Xl!=null&&(Ae["aria-expanded"]=Xl);var Yl=L??U;Yl!=null&&(Ae["aria-flowto"]=Ss(Yl));var Kl=z??T;Kl!=null&&(Ae["aria-haspopup"]=Kl);var oo=M??te;oo===!0&&(Ae["aria-hidden"]=oo);var so=le??G;so!=null&&(Ae["aria-invalid"]=so);var hi=fe??be;hi!=null&&(Ae["aria-keyshortcuts"]=Ss(hi));var ao=pe??ue;ao!=null&&(Ae["aria-label"]=ao);var Ql=ge??qe;Ql!=null&&(Ae["aria-labelledby"]=Ss(Ql));var Jl=Xe??we;Jl!=null&&(Ae["aria-level"]=Jl);var lo=ze??We;lo!=null&&(Ae["aria-live"]=lo==="none"?"off":lo);var fa=tt??De;fa!=null&&(Ae["aria-modal"]=fa);var Yo=Fe??lt;Yo!=null&&(Ae["aria-multiline"]=Yo);var mi=Ne??oe;mi!=null&&(Ae["aria-multiselectable"]=mi);var Zl=Se??Je;Zl!=null&&(Ae["aria-orientation"]=Zl);var Ko=ht??Bt;Ko!=null&&(Ae["aria-owns"]=Ss(Ko));var it=Ut??jt;it!=null&&(Ae["aria-placeholder"]=it);var pa=Vt??bt;pa!=null&&(Ae["aria-posinset"]=pa);var ha=rt??q;ha!=null&&(Ae["aria-pressed"]=ha);var Qo=Q??ie;Qo!=null&&(Ae["aria-readonly"]=Qo,(e==="input"||e==="select"||e==="textarea")&&(Ae.readOnly=!0));var ma=se??Ce;ma!=null&&(Ae["aria-required"]=ma,(e==="input"||e==="select"||e==="textarea")&&(Ae.required=Ce)),Br!=null&&(Ae.role=Br==="none"?"presentation":Br);var ga=Ve??Ke;ga!=null&&(Ae["aria-roledescription"]=ga);var va=Pe??he;va!=null&&(Ae["aria-rowcount"]=va);var Jo=ve??ye;Jo!=null&&(Ae["aria-rowindex"]=Jo);var co=xe??Ue;co!=null&&(Ae["aria-rowspan"]=co);var rn=Ze??dt;rn!=null&&(Ae["aria-selected"]=rn);var nn=Wt??Zr;nn!=null&&(Ae["aria-setsize"]=nn);var on=en??pi;on!=null&&(Ae["aria-sort"]=on);var gi=wn??tn;gi!=null&&(Ae["aria-valuemax"]=gi);var yi=Sn??sa;yi!=null&&(Ae["aria-valuemin"]=yi);var sn=En??Ho;sn!=null&&(Ae["aria-valuenow"]=sn);var ec=to??aa;if(ec!=null&&(Ae["aria-valuetext"]=ec),qo!=null){for(var Zo in qo)if(FL.call(qo,Zo)){var uo=WL(Zo),tc=qo[Zo];tc!=null&&(Ae["data-"+uo]=tc)}}ro===0||ro==="0"||ro===-1||ro==="-1"?Ae.tabIndex=ro:(Go===!1&&(Ae.tabIndex="-1"),e==="a"||e==="button"||e==="input"||e==="select"||e==="textarea"?(Go===!1||X===!0)&&(Ae.tabIndex="-1"):Br==="button"||Br==="checkbox"||Br==="link"||Br==="radio"||Br==="textbox"||Br==="switch"?Go!==!1&&(Ae.tabIndex="0"):Go===!0&&(Ae.tabIndex="0"));var ya=Rl([Bl,la&&HL[la]],js({writingDirection:"ltr"},r)),fo=ya[0],ba=ya[1];fo&&(Ae.className=fo),ba&&(Ae.style=ba);var rc=Fl??Bn;return rc!=null&&(Ae.id=rc),ca!=null&&(Ae["data-testid"]=ca),Ae.type==null&&e==="button"&&(Ae.type="button"),Ae},zp={exports:{}},Ye={},Lb;function GL(){if(Lb)return Ye;Lb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=m&&T[m]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function C(T,M,te){this.props=T,this.context=M,this.refs=S,this.updater=te||w}C.prototype.isReactComponent={},C.prototype.setState=function(T,M){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,M,"setState")},C.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function R(){}R.prototype=C.prototype;function k(T,M,te){this.props=T,this.context=M,this.refs=S,this.updater=te||w}var $=k.prototype=new R;$.constructor=k,E($,C.prototype),$.isPureReactComponent=!0;var A=Array.isArray,D=Object.prototype.hasOwnProperty,N={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function I(T,M,te){var le,G={},fe=null,be=null;if(M!=null)for(le in M.ref!==void 0&&(be=M.ref),M.key!==void 0&&(fe=""+M.key),M)D.call(M,le)&&!P.hasOwnProperty(le)&&(G[le]=M[le]);var pe=arguments.length-2;if(pe===1)G.children=te;else if(1<pe){for(var ue=Array(pe),ge=0;ge<pe;ge++)ue[ge]=arguments[ge+2];G.children=ue}if(T&&T.defaultProps)for(le in pe=T.defaultProps,pe)G[le]===void 0&&(G[le]=pe[le]);return{$$typeof:e,type:T,key:fe,ref:be,props:G,_owner:N.current}}function re(T,M){return{$$typeof:e,type:T.type,key:M,ref:T.ref,props:T.props,_owner:T._owner}}function Z(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function ee(T){var M={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(te){return M[te]})}var ne=/\/+/g;function X(T,M){return typeof T=="object"&&T!==null&&T.key!=null?ee(""+T.key):M.toString(36)}function F(T,M,te,le,G){var fe=typeof T;(fe==="undefined"||fe==="boolean")&&(T=null);var be=!1;if(T===null)be=!0;else switch(fe){case"string":case"number":be=!0;break;case"object":switch(T.$$typeof){case e:case t:be=!0}}if(be)return be=T,G=G(be),T=le===""?"."+X(be,0):le,A(G)?(te="",T!=null&&(te=T.replace(ne,"$&/")+"/"),F(G,M,te,"",function(ge){return ge})):G!=null&&(Z(G)&&(G=re(G,te+(!G.key||be&&be.key===G.key?"":(""+G.key).replace(ne,"$&/")+"/")+T)),M.push(G)),1;if(be=0,le=le===""?".":le+":",A(T))for(var pe=0;pe<T.length;pe++){fe=T[pe];var ue=le+X(fe,pe);be+=F(fe,M,te,ue,G)}else if(ue=y(T),typeof ue=="function")for(T=ue.call(T),pe=0;!(fe=T.next()).done;)fe=fe.value,ue=le+X(fe,pe++),be+=F(fe,M,te,ue,G);else if(fe==="object")throw M=String(T),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.");return be}function V(T,M,te){if(T==null)return T;var le=[],G=0;return F(T,le,"","",function(fe){return M.call(te,fe,G++)}),le}function H(T){if(T._status===-1){var M=T._result;M=M(),M.then(function(te){(T._status===0||T._status===-1)&&(T._status=1,T._result=te)},function(te){(T._status===0||T._status===-1)&&(T._status=2,T._result=te)}),T._status===-1&&(T._status=0,T._result=M)}if(T._status===1)return T._result.default;throw T._result}var O={current:null},L={transition:null},U={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:L,ReactCurrentOwner:N};function z(){throw Error("act(...) is not supported in production builds of React.")}return Ye.Children={map:V,forEach:function(T,M,te){V(T,function(){M.apply(this,arguments)},te)},count:function(T){var M=0;return V(T,function(){M++}),M},toArray:function(T){return V(T,function(M){return M})||[]},only:function(T){if(!Z(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Ye.Component=C,Ye.Fragment=r,Ye.Profiler=o,Ye.PureComponent=k,Ye.StrictMode=n,Ye.Suspense=d,Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,Ye.act=z,Ye.cloneElement=function(T,M,te){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var le=E({},T.props),G=T.key,fe=T.ref,be=T._owner;if(M!=null){if(M.ref!==void 0&&(fe=M.ref,be=N.current),M.key!==void 0&&(G=""+M.key),T.type&&T.type.defaultProps)var pe=T.type.defaultProps;for(ue in M)D.call(M,ue)&&!P.hasOwnProperty(ue)&&(le[ue]=M[ue]===void 0&&pe!==void 0?pe[ue]:M[ue])}var ue=arguments.length-2;if(ue===1)le.children=te;else if(1<ue){pe=Array(ue);for(var ge=0;ge<ue;ge++)pe[ge]=arguments[ge+2];le.children=pe}return{$$typeof:e,type:T.type,key:G,ref:fe,props:le,_owner:be}},Ye.createContext=function(T){return T={$$typeof:l,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:a,_context:T},T.Consumer=T},Ye.createElement=I,Ye.createFactory=function(T){var M=I.bind(null,T);return M.type=T,M},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(T){return{$$typeof:u,render:T}},Ye.isValidElement=Z,Ye.lazy=function(T){return{$$typeof:h,_payload:{_status:-1,_result:T},_init:H}},Ye.memo=function(T,M){return{$$typeof:p,type:T,compare:M===void 0?null:M}},Ye.startTransition=function(T){var M=L.transition;L.transition={};try{T()}finally{L.transition=M}},Ye.unstable_act=z,Ye.useCallback=function(T,M){return O.current.useCallback(T,M)},Ye.useContext=function(T){return O.current.useContext(T)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(T){return O.current.useDeferredValue(T)},Ye.useEffect=function(T,M){return O.current.useEffect(T,M)},Ye.useId=function(){return O.current.useId()},Ye.useImperativeHandle=function(T,M,te){return O.current.useImperativeHandle(T,M,te)},Ye.useInsertionEffect=function(T,M){return O.current.useInsertionEffect(T,M)},Ye.useLayoutEffect=function(T,M){return O.current.useLayoutEffect(T,M)},Ye.useMemo=function(T,M){return O.current.useMemo(T,M)},Ye.useReducer=function(T,M,te){return O.current.useReducer(T,M,te)},Ye.useRef=function(T){return O.current.useRef(T)},Ye.useState=function(T){return O.current.useState(T)},Ye.useSyncExternalStore=function(T,M,te){return O.current.useSyncExternalStore(T,M,te)},Ye.useTransition=function(){return O.current.useTransition()},Ye.version="18.3.1",Ye}var Ib;function Og(){return Ib||(Ib=1,zp.exports=GL()),zp.exports}var x=Og();const Ee=Qr(x),_l=vA({__proto__:null,default:Ee},[x]);var XL=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Ob=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","far","glk","he","iw","khw","ks","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]),Nb=new Map;function YL(e){var t=Nb.get(e);if(t)return t;var r=!1;if(Intl.Locale)try{var n=new Intl.Locale(e).maximize().script;r=XL.has(n)}catch{var o=e.split("-")[0];r=Ob.has(o)}else{var a=e.split("-")[0];r=Ob.has(a)}return Nb.set(e,r),r}var KL={direction:"ltr",locale:"en-US"},kE=x.createContext(KL);function RE(e){return YL(e)?"rtl":"ltr"}function QL(e){var t=e.direction,r=e.locale,n=e.children,o=t||r;return o?Ee.createElement(kE.Provider,{children:n,value:{direction:r?RE(r):t,locale:r}}):n}function JL(){return x.useContext(kE)}var ZL=(e,t,r)=>{var n;e&&e.constructor===String&&(n=sE.propsToAccessibilityComponent(t));var o=n||e,a=qL(o,t,r),l=Ee.createElement(o,a),u=a.dir?Ee.createElement(QL,{children:l,direction:a.dir,locale:a.lang}):l;return u},hu={},Fp={exports:{}},Er={},Bp={exports:{}},Up={},Pb;function eI(){return Pb||(Pb=1,(function(e){function t(L,U){var z=L.length;L.push(U);e:for(;0<z;){var T=z-1>>>1,M=L[T];if(0<o(M,U))L[T]=U,L[z]=M,z=T;else break e}}function r(L){return L.length===0?null:L[0]}function n(L){if(L.length===0)return null;var U=L[0],z=L.pop();if(z!==U){L[0]=z;e:for(var T=0,M=L.length,te=M>>>1;T<te;){var le=2*(T+1)-1,G=L[le],fe=le+1,be=L[fe];if(0>o(G,z))fe<M&&0>o(be,G)?(L[T]=be,L[fe]=z,T=fe):(L[T]=G,L[le]=z,T=le);else if(fe<M&&0>o(be,z))L[T]=be,L[fe]=z,T=fe;else break e}}return U}function o(L,U){var z=L.sortIndex-U.sortIndex;return z!==0?z:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],h=1,m=null,y=3,w=!1,E=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(L){for(var U=r(p);U!==null;){if(U.callback===null)n(p);else if(U.startTime<=L)n(p),U.sortIndex=U.expirationTime,t(d,U);else break;U=r(p)}}function A(L){if(S=!1,$(L),!E)if(r(d)!==null)E=!0,H(D);else{var U=r(p);U!==null&&O(A,U.startTime-L)}}function D(L,U){E=!1,S&&(S=!1,R(I),I=-1),w=!0;var z=y;try{for($(U),m=r(d);m!==null&&(!(m.expirationTime>U)||L&&!ee());){var T=m.callback;if(typeof T=="function"){m.callback=null,y=m.priorityLevel;var M=T(m.expirationTime<=U);U=e.unstable_now(),typeof M=="function"?m.callback=M:m===r(d)&&n(d),$(U)}else n(d);m=r(d)}if(m!==null)var te=!0;else{var le=r(p);le!==null&&O(A,le.startTime-U),te=!1}return te}finally{m=null,y=z,w=!1}}var N=!1,P=null,I=-1,re=5,Z=-1;function ee(){return!(e.unstable_now()-Z<re)}function ne(){if(P!==null){var L=e.unstable_now();Z=L;var U=!0;try{U=P(!0,L)}finally{U?X():(N=!1,P=null)}}else N=!1}var X;if(typeof k=="function")X=function(){k(ne)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,V=F.port2;F.port1.onmessage=ne,X=function(){V.postMessage(null)}}else X=function(){C(ne,0)};function H(L){P=L,N||(N=!0,X())}function O(L,U){I=C(function(){L(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){E||w||(E=!0,H(D))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return r(d)},e.unstable_next=function(L){switch(y){case 1:case 2:case 3:var U=3;break;default:U=y}var z=y;y=U;try{return L()}finally{y=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,U){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var z=y;y=L;try{return U()}finally{y=z}},e.unstable_scheduleCallback=function(L,U,z){var T=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?T+z:T):z=T,L){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=z+M,L={id:h++,callback:U,priorityLevel:L,startTime:z,expirationTime:M,sortIndex:-1},z>T?(L.sortIndex=z,t(p,L),r(d)===null&&L===r(p)&&(S?(R(I),I=-1):S=!0,O(A,z-T))):(L.sortIndex=M,t(d,L),E||w||(E=!0,H(D))),L},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(L){var U=y;return function(){var z=y;y=U;try{return L.apply(this,arguments)}finally{y=z}}}})(Up)),Up}var Db;function tI(){return Db||(Db=1,Bp.exports=eI()),Bp.exports}var jb;function rI(){if(jb)return Er;jb=1;var e=Og(),t=tI();function r(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,c=1;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,o={};function a(i,s){l(i,s),l(i+"Capture",s)}function l(i,s){for(o[i]=s,i=0;i<s.length;i++)n.add(s[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},m={};function y(i){return d.call(m,i)?!0:d.call(h,i)?!1:p.test(i)?m[i]=!0:(h[i]=!0,!1)}function w(i,s,c,f){if(c!==null&&c.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return f?!1:c!==null?!c.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function E(i,s,c,f){if(s===null||typeof s>"u"||w(i,s,c,f))return!0;if(f)return!1;if(c!==null)switch(c.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function S(i,s,c,f,g,b,_){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=c,this.propertyName=i,this.type=s,this.sanitizeURL=b,this.removeEmptyString=_}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new S(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];C[s]=new S(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new S(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new S(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new S(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new S(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new S(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new S(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new S(i,5,!1,i.toLowerCase(),null,!1,!1)});var R=/[\-:]([a-z])/g;function k(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(R,k);C[s]=new S(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(R,k);C[s]=new S(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(R,k);C[s]=new S(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!0,!0)});function $(i,s,c,f){var g=C.hasOwnProperty(s)?C[s]:null;(g!==null?g.type!==0:f||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(E(s,c,g,f)&&(c=null),f||g===null?y(s)&&(c===null?i.removeAttribute(s):i.setAttribute(s,""+c)):g.mustUseProperty?i[g.propertyName]=c===null?g.type===3?!1:"":c:(s=g.attributeName,f=g.attributeNamespace,c===null?i.removeAttribute(s):(g=g.type,c=g===3||g===4&&c===!0?"":""+c,f?i.setAttributeNS(f,s,c):i.setAttribute(s,c))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),N=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),ee=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),L=Symbol.iterator;function U(i){return i===null||typeof i!="object"?null:(i=L&&i[L]||i["@@iterator"],typeof i=="function"?i:null)}var z=Object.assign,T;function M(i){if(T===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);T=s&&s[1]||""}return`
4
+ `)},insert(l,u){var d=Number(u);if(t[d]==null){var p=fL(d);t[d]={start:null,rules:[p]},e!=null&&o(e,d,p)}var h=Rb(l);if(h!=null&&r[h]==null&&(r[h]=!0,t[d].rules.push(l),e!=null)){var m=o(e,d,l);m||t[d].rules.pop()}}};return a}function fL(e){return'[stylesheet-group="'+e+'"]{}'}var pL=/["']/g;function hL(e){return Number(e.selectorText.split(pL)[1])}function kb(e){return Object.keys(e).map(Number).sort((t,r)=>t>r?1:-1)}var mL=/\s*([,])\s*/g;function Rb(e){var t=e.split("{")[0].trim();return t!==""?t.replace(mL,"$1"):null}function gL(e,t,r){try{return e.insertRule(t,r),!0}catch{return!1}}var vL="react-native-stylesheet",Mp=new WeakMap,pn=[],_b=["html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}","body{margin:0;}","button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}","input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"];function Og(e,t){t===void 0&&(t=vL);var r;if(zo){var n=e!=null?e.getRootNode():document;if(pn.length===0)r=jp(Dp(t)),_b.forEach(u=>{r.insert(u,0)}),Mp.set(n,pn.length),pn.push(r);else{var o=Mp.get(n);if(o==null){var a=pn[0],l=a!=null?a.getTextContent():"";r=jp(Dp(t,n,l)),Mp.set(n,pn.length),pn.push(r)}else r=pn[o]}}else pn.length===0?(r=jp(Dp(t)),_b.forEach(u=>{r.insert(u,0)}),pn.push(r)):r=pn[0];return{getTextContent(){return r.getTextContent()},id:t,insert(u,d){pn.forEach(p=>{p.insert(u,d)})}}}var pu={},$b;function yL(){if($b)return pu;$b=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.localizeStyle=n;var e=new WeakMap,t="$$css$localize";function r(o,a){var l={};for(var u in o)if(u!==t){var d=o[u];Array.isArray(d)?l[u]=a?d[1]:d[0]:l[u]=d}return l}function n(o,a){if(o[t]!=null){var l=a?1:0;if(e.has(o)){var u=e.get(o),d=u[l];return d==null&&(d=r(o,a),u[l]=d,e.set(o,u)),d}var p=r(o,a),h=new Array(2);return h[l]=p,e.set(o,h),p}return o}return pu}var zp,Ab;function bL(){return Ab||(Ab=1,zp=yL()),zp}var xL=bL(),wL={},xE={height:0,width:0},SL=e=>{var t=e.shadowColor,r=e.shadowOffset,n=e.shadowOpacity,o=e.shadowRadius,a=r||xE,l=a.height,u=a.width,d=mr(u),p=mr(l),h=mr(o||0),m=Lg(t||"black",n);if(m!=null&&d!=null&&p!=null&&h!=null)return d+" "+p+" "+h+" "+m},EL=e=>{var t=e.textShadowColor,r=e.textShadowOffset,n=e.textShadowRadius,o=r||xE,a=o.height,l=o.width,u=n||0,d=mr(l),p=mr(a),h=mr(u),m=mr(t,"textShadowColor");if(m&&(a!==0||l!==0||u!==0)&&d!=null&&p!=null&&h!=null)return d+" "+p+" "+h+" "+m},CL=e=>{if(typeof e=="string")return e;var t=mr(e.offsetX)||0,r=mr(e.offsetY)||0,n=mr(e.blurRadius)||0,o=mr(e.spreadDistance)||0,a=Lg(e.color)||"black",l=e.inset?"inset ":"";return""+l+t+" "+r+" "+n+" "+o+" "+a},kL=e=>e.map(CL).join(", "),RL=e=>{var t=Object.keys(e)[0],r=e[t];if(t==="matrix"||t==="matrix3d")return t+"("+r.join(",")+")";var n=mr(r,t);return t+"("+n+")"},_L=e=>e.map(RL).join(" "),$L=e=>e.map(t=>mr(t)).join(" "),AL={borderBottomEndRadius:"borderEndEndRadius",borderBottomStartRadius:"borderEndStartRadius",borderTopEndRadius:"borderStartEndRadius",borderTopStartRadius:"borderStartStartRadius",borderEndColor:"borderInlineEndColor",borderEndStyle:"borderInlineEndStyle",borderEndWidth:"borderInlineEndWidth",borderStartColor:"borderInlineStartColor",borderStartStyle:"borderInlineStartStyle",borderStartWidth:"borderInlineStartWidth",end:"insetInlineEnd",marginEnd:"marginInlineEnd",marginHorizontal:"marginInline",marginStart:"marginInlineStart",marginVertical:"marginBlock",paddingEnd:"paddingInlineEnd",paddingHorizontal:"paddingInline",paddingStart:"paddingInlineStart",paddingVertical:"paddingBlock",start:"insetInlineStart"},TL={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},wE=function(t,r){r===void 0&&(r={});var n=t||wL,o={};if(r.shadow,n.shadowColor!=null||n.shadowOffset!=null||n.shadowOpacity!=null||n.shadowRadius!=null){var a=SL(n);a!=null&&(o.boxShadow=a)}if(r.textShadow,n.textShadowColor!=null||n.textShadowOffset!=null||n.textShadowRadius!=null){var l=EL(n);if(l!=null&&o.textShadow==null){var u=n.textShadow,d=u?u+", "+l:l;o.textShadow=d}}for(var p in n)if(!(TL[p]!=null||p==="shadowColor"||p==="shadowOffset"||p==="shadowOpacity"||p==="shadowRadius"||p==="textShadowColor"||p==="textShadowOffset"||p==="textShadowRadius")){var h=n[p],m=AL[p]||p,y=h;if(!(!Object.prototype.hasOwnProperty.call(n,p)||m!==p&&n[m]!=null))if(m==="aspectRatio"&&typeof y=="number")o[m]=y.toString();else if(m==="boxShadow"){Array.isArray(y)&&(y=kL(y));var w=o.boxShadow;o.boxShadow=w?y+", "+w:y}else m==="fontVariant"?(Array.isArray(y)&&y.length>0&&(y=y.join(" ")),o[m]=y):m==="textAlignVertical"?n.verticalAlign==null&&(o.verticalAlign=y==="center"?"middle":y):m==="transform"?(Array.isArray(y)&&(y=_L(y)),o.transform=y):m==="transformOrigin"?(Array.isArray(y)&&(y=$L(y)),o.transformOrigin=y):o[m]=y}return o},Xa={},Tb;function LL(){if(Tb)return Xa;Tb=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.styleq=void 0;var e=new WeakMap,t="$$css";function r(o){var a,l,u;return o!=null&&(a=o.disableCache===!0,l=o.disableMix===!0,u=o.transform),function(){for(var p=[],h="",m=null,y=a?null:e,w=new Array(arguments.length),E=0;E<arguments.length;E++)w[E]=arguments[E];for(;w.length>0;){var S=w.pop();if(!(S==null||S===!1)){if(Array.isArray(S)){for(var C=0;C<S.length;C++)w.push(S[C]);continue}var R=u!=null?u(S):S;if(R.$$css){var k="";if(y!=null&&y.has(R)){var $=y.get(R);$!=null&&(k=$[0],p.push.apply(p,$[1]),y=$[2])}else{var A=[];for(var D in R){var N=R[D];D!==t&&(typeof N=="string"||N===null?p.includes(D)||(p.push(D),y!=null&&A.push(D),typeof N=="string"&&(k+=k?" "+N:N)):console.error("styleq: ".concat(D," typeof ").concat(String(N),' is not "string" or "null".')))}if(y!=null){var P=new WeakMap;y.set(R,[k,A,P]),y=P}}k&&(h=h?k+" "+h:k)}else if(l)m==null&&(m={}),m=Object.assign({},R,m);else{var I=null;for(var re in R){var Z=R[re];Z!==void 0&&(p.includes(re)||(Z!=null&&(m==null&&(m={}),I==null&&(I={}),I[re]=Z),p.push(re),y=null))}I!=null&&(m=Object.assign(I,m))}}}var ee=[h,m];return ee}}var n=r();return Xa.styleq=n,n.factory=r,Xa}var IL=LL(),OL=["writingDirection"],SE=new WeakMap,Ku=Og(),EE={shadow:!0,textShadow:!0};function NL(e,t){t===void 0&&(t={});var r=t,n=r.writingDirection,o=Sd(r,OL),a=n==="rtl";return IL.styleq.factory({transform(l){var u=SE.get(l);return u!=null?xL.localizeStyle(u,a):wE(l,js(js({},EE),o))}})(e)}function CE(e){e.forEach(t=>{var r=t[0],n=t[1];Ku!=null&&r.forEach(o=>{Ku.insert(o,n)})})}function PL(e){var t=oL(wE(e,EE)),r=t[0],n=t[1];return CE(n),r}function DL(e,t){var r=sL(e,t),n=r[0],o=r[1];return CE(o),n}var kE={position:"absolute",left:0,right:0,top:0,bottom:0},jL=RE({x:js({},kE)}).x;function RE(e){return Object.keys(e).forEach(t=>{var r=e[t];if(r!=null&&r.$$css!==!0){var n;t.indexOf("$raw")>-1?n=DL(r,t.split("$raw")[0]):n=PL(r),SE.set(r,n)}}),e}function ML(e,t){return[e,t]}function zL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.flat(1/0),o={},a=0;a<n.length;a++){var l=n[a];l!=null&&typeof l=="object"&&Object.assign(o,l)}return o}function FL(){return{id:Ku.id,textContent:Ku.getTextContent()}}function fi(e,t){t===void 0&&(t={});var r=t.writingDirection==="rtl",n=NL(e,t);return Array.isArray(n)&&n[1]!=null&&(n[1]=aL(n[1],r)),n}fi.absoluteFill=jL;fi.absoluteFillObject=kE;fi.create=RE;fi.compose=ML;fi.flatten=zL;fi.getSheet=FL;fi.hairlineWidth=1;zo&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=fi.flatten);var Rl=fi,BL=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],UL={},VL=Object.prototype.hasOwnProperty,WL=Array.isArray,HL=/[A-Z]/g;function qL(e){return"-"+e.toLowerCase()}function GL(e){return e.replace(HL,qL)}function Ss(e){return WL(e)?e.join(" "):e}var XL=Rl.create({auto:{pointerEvents:"auto"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"},none:{pointerEvents:"none"}}),YL=(e,t,r)=>{t||(t=UL);var n=t,o=n["aria-activedescendant"],a=n.accessibilityActiveDescendant,l=n["aria-atomic"],u=n.accessibilityAtomic,d=n["aria-autocomplete"],p=n.accessibilityAutoComplete,h=n["aria-busy"],m=n.accessibilityBusy,y=n["aria-checked"],w=n.accessibilityChecked,E=n["aria-colcount"],S=n.accessibilityColumnCount,C=n["aria-colindex"],R=n.accessibilityColumnIndex,k=n["aria-colspan"],$=n.accessibilityColumnSpan,A=n["aria-controls"],D=n.accessibilityControls,N=n["aria-current"],P=n.accessibilityCurrent,I=n["aria-describedby"],re=n.accessibilityDescribedBy,Z=n["aria-details"],ee=n.accessibilityDetails,ne=n["aria-disabled"],X=n.accessibilityDisabled,F=n["aria-errormessage"],V=n.accessibilityErrorMessage,H=n["aria-expanded"],O=n.accessibilityExpanded,L=n["aria-flowto"],U=n.accessibilityFlowTo,z=n["aria-haspopup"],T=n.accessibilityHasPopup,M=n["aria-hidden"],te=n.accessibilityHidden,le=n["aria-invalid"],G=n.accessibilityInvalid,fe=n["aria-keyshortcuts"],be=n.accessibilityKeyShortcuts,pe=n["aria-label"],ue=n.accessibilityLabel,ge=n["aria-labelledby"],qe=n.accessibilityLabelledBy,Xe=n["aria-level"],we=n.accessibilityLevel,ze=n["aria-live"],We=n.accessibilityLiveRegion,tt=n["aria-modal"],De=n.accessibilityModal,Fe=n["aria-multiline"],ct=n.accessibilityMultiline,Ne=n["aria-multiselectable"],oe=n.accessibilityMultiSelectable,Se=n["aria-orientation"],Je=n.accessibilityOrientation,ht=n["aria-owns"],Ut=n.accessibilityOwns,Vt=n["aria-placeholder"],jt=n.accessibilityPlaceholder,Wt=n["aria-posinset"],bt=n.accessibilityPosInSet,rt=n["aria-pressed"],q=n.accessibilityPressed,Q=n["aria-readonly"],ie=n.accessibilityReadOnly,se=n["aria-required"],Ce=n.accessibilityRequired;n.role,n.accessibilityRole;var Ve=n["aria-roledescription"],Qe=n.accessibilityRoleDescription,Pe=n["aria-rowcount"],he=n.accessibilityRowCount,ve=n["aria-rowindex"],ye=n.accessibilityRowIndex,xe=n["aria-rowspan"],Ue=n.accessibilityRowSpan,Ze=n["aria-selected"],dt=n.accessibilitySelected,Ht=n["aria-setsize"],Zr=n.accessibilitySetSize,en=n["aria-sort"],hi=n.accessibilitySort,wn=n["aria-valuemax"],tn=n.accessibilityValueMax,Sn=n["aria-valuemin"],sa=n.accessibilityValueMin,En=n["aria-valuenow"],Ho=n.accessibilityValueNow,to=n["aria-valuetext"],aa=n.accessibilityValueText,qo=n.dataSet,Go=n.focusable,Fl=n.id,Bn=n.nativeID,la=n.pointerEvents,Bl=n.style,ro=n.tabIndex,ca=n.testID,Ae=Sd(n,BL),Ul=ne||X,Br=lE.propsToAriaRole(t),Vl=o??a;Vl!=null&&(Ae["aria-activedescendant"]=Vl);var Wl=l!=null?o:u;Wl!=null&&(Ae["aria-atomic"]=Wl);var Ct=d??p;Ct!=null&&(Ae["aria-autocomplete"]=Ct);var Hl=h??m;Hl!=null&&(Ae["aria-busy"]=Hl);var Xo=y??w;Xo!=null&&(Ae["aria-checked"]=Xo);var ua=E??S;ua!=null&&(Ae["aria-colcount"]=ua);var no=C??R;no!=null&&(Ae["aria-colindex"]=no);var ql=k??$;ql!=null&&(Ae["aria-colspan"]=ql);var da=A??D;da!=null&&(Ae["aria-controls"]=Ss(da));var io=N??P;io!=null&&(Ae["aria-current"]=io);var Ir=I??re;Ir!=null&&(Ae["aria-describedby"]=Ss(Ir));var Gl=Z??ee;Gl!=null&&(Ae["aria-details"]=Gl),Ul===!0&&(Ae["aria-disabled"]=!0,(e==="button"||e==="form"||e==="input"||e==="select"||e==="textarea")&&(Ae.disabled=!0));var vr=F??V;vr!=null&&(Ae["aria-errormessage"]=vr);var Xl=H??O;Xl!=null&&(Ae["aria-expanded"]=Xl);var Yl=L??U;Yl!=null&&(Ae["aria-flowto"]=Ss(Yl));var Kl=z??T;Kl!=null&&(Ae["aria-haspopup"]=Kl);var oo=M??te;oo===!0&&(Ae["aria-hidden"]=oo);var so=le??G;so!=null&&(Ae["aria-invalid"]=so);var mi=fe??be;mi!=null&&(Ae["aria-keyshortcuts"]=Ss(mi));var ao=pe??ue;ao!=null&&(Ae["aria-label"]=ao);var Ql=ge??qe;Ql!=null&&(Ae["aria-labelledby"]=Ss(Ql));var Jl=Xe??we;Jl!=null&&(Ae["aria-level"]=Jl);var lo=ze??We;lo!=null&&(Ae["aria-live"]=lo==="none"?"off":lo);var fa=tt??De;fa!=null&&(Ae["aria-modal"]=fa);var Yo=Fe??ct;Yo!=null&&(Ae["aria-multiline"]=Yo);var gi=Ne??oe;gi!=null&&(Ae["aria-multiselectable"]=gi);var Zl=Se??Je;Zl!=null&&(Ae["aria-orientation"]=Zl);var Ko=ht??Ut;Ko!=null&&(Ae["aria-owns"]=Ss(Ko));var it=Vt??jt;it!=null&&(Ae["aria-placeholder"]=it);var pa=Wt??bt;pa!=null&&(Ae["aria-posinset"]=pa);var ha=rt??q;ha!=null&&(Ae["aria-pressed"]=ha);var Qo=Q??ie;Qo!=null&&(Ae["aria-readonly"]=Qo,(e==="input"||e==="select"||e==="textarea")&&(Ae.readOnly=!0));var ma=se??Ce;ma!=null&&(Ae["aria-required"]=ma,(e==="input"||e==="select"||e==="textarea")&&(Ae.required=Ce)),Br!=null&&(Ae.role=Br==="none"?"presentation":Br);var ga=Ve??Qe;ga!=null&&(Ae["aria-roledescription"]=ga);var va=Pe??he;va!=null&&(Ae["aria-rowcount"]=va);var Jo=ve??ye;Jo!=null&&(Ae["aria-rowindex"]=Jo);var co=xe??Ue;co!=null&&(Ae["aria-rowspan"]=co);var rn=Ze??dt;rn!=null&&(Ae["aria-selected"]=rn);var nn=Ht??Zr;nn!=null&&(Ae["aria-setsize"]=nn);var on=en??hi;on!=null&&(Ae["aria-sort"]=on);var yi=wn??tn;yi!=null&&(Ae["aria-valuemax"]=yi);var bi=Sn??sa;bi!=null&&(Ae["aria-valuemin"]=bi);var sn=En??Ho;sn!=null&&(Ae["aria-valuenow"]=sn);var ec=to??aa;if(ec!=null&&(Ae["aria-valuetext"]=ec),qo!=null){for(var Zo in qo)if(VL.call(qo,Zo)){var uo=GL(Zo),tc=qo[Zo];tc!=null&&(Ae["data-"+uo]=tc)}}ro===0||ro==="0"||ro===-1||ro==="-1"?Ae.tabIndex=ro:(Go===!1&&(Ae.tabIndex="-1"),e==="a"||e==="button"||e==="input"||e==="select"||e==="textarea"?(Go===!1||X===!0)&&(Ae.tabIndex="-1"):Br==="button"||Br==="checkbox"||Br==="link"||Br==="radio"||Br==="textbox"||Br==="switch"?Go!==!1&&(Ae.tabIndex="0"):Go===!0&&(Ae.tabIndex="0"));var ya=Rl([Bl,la&&XL[la]],js({writingDirection:"ltr"},r)),fo=ya[0],ba=ya[1];fo&&(Ae.className=fo),ba&&(Ae.style=ba);var rc=Fl??Bn;return rc!=null&&(Ae.id=rc),ca!=null&&(Ae["data-testid"]=ca),Ae.type==null&&e==="button"&&(Ae.type="button"),Ae},Fp={exports:{}},Ye={},Lb;function KL(){if(Lb)return Ye;Lb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=m&&T[m]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function C(T,M,te){this.props=T,this.context=M,this.refs=S,this.updater=te||w}C.prototype.isReactComponent={},C.prototype.setState=function(T,M){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,M,"setState")},C.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function R(){}R.prototype=C.prototype;function k(T,M,te){this.props=T,this.context=M,this.refs=S,this.updater=te||w}var $=k.prototype=new R;$.constructor=k,E($,C.prototype),$.isPureReactComponent=!0;var A=Array.isArray,D=Object.prototype.hasOwnProperty,N={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function I(T,M,te){var le,G={},fe=null,be=null;if(M!=null)for(le in M.ref!==void 0&&(be=M.ref),M.key!==void 0&&(fe=""+M.key),M)D.call(M,le)&&!P.hasOwnProperty(le)&&(G[le]=M[le]);var pe=arguments.length-2;if(pe===1)G.children=te;else if(1<pe){for(var ue=Array(pe),ge=0;ge<pe;ge++)ue[ge]=arguments[ge+2];G.children=ue}if(T&&T.defaultProps)for(le in pe=T.defaultProps,pe)G[le]===void 0&&(G[le]=pe[le]);return{$$typeof:e,type:T,key:fe,ref:be,props:G,_owner:N.current}}function re(T,M){return{$$typeof:e,type:T.type,key:M,ref:T.ref,props:T.props,_owner:T._owner}}function Z(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function ee(T){var M={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(te){return M[te]})}var ne=/\/+/g;function X(T,M){return typeof T=="object"&&T!==null&&T.key!=null?ee(""+T.key):M.toString(36)}function F(T,M,te,le,G){var fe=typeof T;(fe==="undefined"||fe==="boolean")&&(T=null);var be=!1;if(T===null)be=!0;else switch(fe){case"string":case"number":be=!0;break;case"object":switch(T.$$typeof){case e:case t:be=!0}}if(be)return be=T,G=G(be),T=le===""?"."+X(be,0):le,A(G)?(te="",T!=null&&(te=T.replace(ne,"$&/")+"/"),F(G,M,te,"",function(ge){return ge})):G!=null&&(Z(G)&&(G=re(G,te+(!G.key||be&&be.key===G.key?"":(""+G.key).replace(ne,"$&/")+"/")+T)),M.push(G)),1;if(be=0,le=le===""?".":le+":",A(T))for(var pe=0;pe<T.length;pe++){fe=T[pe];var ue=le+X(fe,pe);be+=F(fe,M,te,ue,G)}else if(ue=y(T),typeof ue=="function")for(T=ue.call(T),pe=0;!(fe=T.next()).done;)fe=fe.value,ue=le+X(fe,pe++),be+=F(fe,M,te,ue,G);else if(fe==="object")throw M=String(T),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.");return be}function V(T,M,te){if(T==null)return T;var le=[],G=0;return F(T,le,"","",function(fe){return M.call(te,fe,G++)}),le}function H(T){if(T._status===-1){var M=T._result;M=M(),M.then(function(te){(T._status===0||T._status===-1)&&(T._status=1,T._result=te)},function(te){(T._status===0||T._status===-1)&&(T._status=2,T._result=te)}),T._status===-1&&(T._status=0,T._result=M)}if(T._status===1)return T._result.default;throw T._result}var O={current:null},L={transition:null},U={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:L,ReactCurrentOwner:N};function z(){throw Error("act(...) is not supported in production builds of React.")}return Ye.Children={map:V,forEach:function(T,M,te){V(T,function(){M.apply(this,arguments)},te)},count:function(T){var M=0;return V(T,function(){M++}),M},toArray:function(T){return V(T,function(M){return M})||[]},only:function(T){if(!Z(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Ye.Component=C,Ye.Fragment=r,Ye.Profiler=o,Ye.PureComponent=k,Ye.StrictMode=n,Ye.Suspense=d,Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,Ye.act=z,Ye.cloneElement=function(T,M,te){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var le=E({},T.props),G=T.key,fe=T.ref,be=T._owner;if(M!=null){if(M.ref!==void 0&&(fe=M.ref,be=N.current),M.key!==void 0&&(G=""+M.key),T.type&&T.type.defaultProps)var pe=T.type.defaultProps;for(ue in M)D.call(M,ue)&&!P.hasOwnProperty(ue)&&(le[ue]=M[ue]===void 0&&pe!==void 0?pe[ue]:M[ue])}var ue=arguments.length-2;if(ue===1)le.children=te;else if(1<ue){pe=Array(ue);for(var ge=0;ge<ue;ge++)pe[ge]=arguments[ge+2];le.children=pe}return{$$typeof:e,type:T.type,key:G,ref:fe,props:le,_owner:be}},Ye.createContext=function(T){return T={$$typeof:l,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:a,_context:T},T.Consumer=T},Ye.createElement=I,Ye.createFactory=function(T){var M=I.bind(null,T);return M.type=T,M},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(T){return{$$typeof:u,render:T}},Ye.isValidElement=Z,Ye.lazy=function(T){return{$$typeof:h,_payload:{_status:-1,_result:T},_init:H}},Ye.memo=function(T,M){return{$$typeof:p,type:T,compare:M===void 0?null:M}},Ye.startTransition=function(T){var M=L.transition;L.transition={};try{T()}finally{L.transition=M}},Ye.unstable_act=z,Ye.useCallback=function(T,M){return O.current.useCallback(T,M)},Ye.useContext=function(T){return O.current.useContext(T)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(T){return O.current.useDeferredValue(T)},Ye.useEffect=function(T,M){return O.current.useEffect(T,M)},Ye.useId=function(){return O.current.useId()},Ye.useImperativeHandle=function(T,M,te){return O.current.useImperativeHandle(T,M,te)},Ye.useInsertionEffect=function(T,M){return O.current.useInsertionEffect(T,M)},Ye.useLayoutEffect=function(T,M){return O.current.useLayoutEffect(T,M)},Ye.useMemo=function(T,M){return O.current.useMemo(T,M)},Ye.useReducer=function(T,M,te){return O.current.useReducer(T,M,te)},Ye.useRef=function(T){return O.current.useRef(T)},Ye.useState=function(T){return O.current.useState(T)},Ye.useSyncExternalStore=function(T,M,te){return O.current.useSyncExternalStore(T,M,te)},Ye.useTransition=function(){return O.current.useTransition()},Ye.version="18.3.1",Ye}var Ib;function Ng(){return Ib||(Ib=1,Fp.exports=KL()),Fp.exports}var x=Ng();const Ee=Qr(x),_l=xA({__proto__:null,default:Ee},[x]);var QL=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Ob=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","far","glk","he","iw","khw","ks","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]),Nb=new Map;function JL(e){var t=Nb.get(e);if(t)return t;var r=!1;if(Intl.Locale)try{var n=new Intl.Locale(e).maximize().script;r=QL.has(n)}catch{var o=e.split("-")[0];r=Ob.has(o)}else{var a=e.split("-")[0];r=Ob.has(a)}return Nb.set(e,r),r}var ZL={direction:"ltr",locale:"en-US"},_E=x.createContext(ZL);function $E(e){return JL(e)?"rtl":"ltr"}function eI(e){var t=e.direction,r=e.locale,n=e.children,o=t||r;return o?Ee.createElement(_E.Provider,{children:n,value:{direction:r?$E(r):t,locale:r}}):n}function tI(){return x.useContext(_E)}var rI=(e,t,r)=>{var n;e&&e.constructor===String&&(n=lE.propsToAccessibilityComponent(t));var o=n||e,a=YL(o,t,r),l=Ee.createElement(o,a),u=a.dir?Ee.createElement(eI,{children:l,direction:a.dir,locale:a.lang}):l;return u},hu={},Bp={exports:{}},Er={},Up={exports:{}},Vp={},Pb;function nI(){return Pb||(Pb=1,(function(e){function t(L,U){var z=L.length;L.push(U);e:for(;0<z;){var T=z-1>>>1,M=L[T];if(0<o(M,U))L[T]=U,L[z]=M,z=T;else break e}}function r(L){return L.length===0?null:L[0]}function n(L){if(L.length===0)return null;var U=L[0],z=L.pop();if(z!==U){L[0]=z;e:for(var T=0,M=L.length,te=M>>>1;T<te;){var le=2*(T+1)-1,G=L[le],fe=le+1,be=L[fe];if(0>o(G,z))fe<M&&0>o(be,G)?(L[T]=be,L[fe]=z,T=fe):(L[T]=G,L[le]=z,T=le);else if(fe<M&&0>o(be,z))L[T]=be,L[fe]=z,T=fe;else break e}}return U}function o(L,U){var z=L.sortIndex-U.sortIndex;return z!==0?z:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],h=1,m=null,y=3,w=!1,E=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(L){for(var U=r(p);U!==null;){if(U.callback===null)n(p);else if(U.startTime<=L)n(p),U.sortIndex=U.expirationTime,t(d,U);else break;U=r(p)}}function A(L){if(S=!1,$(L),!E)if(r(d)!==null)E=!0,H(D);else{var U=r(p);U!==null&&O(A,U.startTime-L)}}function D(L,U){E=!1,S&&(S=!1,R(I),I=-1),w=!0;var z=y;try{for($(U),m=r(d);m!==null&&(!(m.expirationTime>U)||L&&!ee());){var T=m.callback;if(typeof T=="function"){m.callback=null,y=m.priorityLevel;var M=T(m.expirationTime<=U);U=e.unstable_now(),typeof M=="function"?m.callback=M:m===r(d)&&n(d),$(U)}else n(d);m=r(d)}if(m!==null)var te=!0;else{var le=r(p);le!==null&&O(A,le.startTime-U),te=!1}return te}finally{m=null,y=z,w=!1}}var N=!1,P=null,I=-1,re=5,Z=-1;function ee(){return!(e.unstable_now()-Z<re)}function ne(){if(P!==null){var L=e.unstable_now();Z=L;var U=!0;try{U=P(!0,L)}finally{U?X():(N=!1,P=null)}}else N=!1}var X;if(typeof k=="function")X=function(){k(ne)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,V=F.port2;F.port1.onmessage=ne,X=function(){V.postMessage(null)}}else X=function(){C(ne,0)};function H(L){P=L,N||(N=!0,X())}function O(L,U){I=C(function(){L(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){E||w||(E=!0,H(D))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return r(d)},e.unstable_next=function(L){switch(y){case 1:case 2:case 3:var U=3;break;default:U=y}var z=y;y=U;try{return L()}finally{y=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,U){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var z=y;y=L;try{return U()}finally{y=z}},e.unstable_scheduleCallback=function(L,U,z){var T=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?T+z:T):z=T,L){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=z+M,L={id:h++,callback:U,priorityLevel:L,startTime:z,expirationTime:M,sortIndex:-1},z>T?(L.sortIndex=z,t(p,L),r(d)===null&&L===r(p)&&(S?(R(I),I=-1):S=!0,O(A,z-T))):(L.sortIndex=M,t(d,L),E||w||(E=!0,H(D))),L},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(L){var U=y;return function(){var z=y;y=U;try{return L.apply(this,arguments)}finally{y=z}}}})(Vp)),Vp}var Db;function iI(){return Db||(Db=1,Up.exports=nI()),Up.exports}var jb;function oI(){if(jb)return Er;jb=1;var e=Ng(),t=iI();function r(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,c=1;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,o={};function a(i,s){l(i,s),l(i+"Capture",s)}function l(i,s){for(o[i]=s,i=0;i<s.length;i++)n.add(s[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},m={};function y(i){return d.call(m,i)?!0:d.call(h,i)?!1:p.test(i)?m[i]=!0:(h[i]=!0,!1)}function w(i,s,c,f){if(c!==null&&c.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return f?!1:c!==null?!c.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function E(i,s,c,f){if(s===null||typeof s>"u"||w(i,s,c,f))return!0;if(f)return!1;if(c!==null)switch(c.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function S(i,s,c,f,g,b,_){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=c,this.propertyName=i,this.type=s,this.sanitizeURL=b,this.removeEmptyString=_}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new S(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];C[s]=new S(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new S(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new S(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new S(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new S(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new S(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new S(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new S(i,5,!1,i.toLowerCase(),null,!1,!1)});var R=/[\-:]([a-z])/g;function k(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(R,k);C[s]=new S(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(R,k);C[s]=new S(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(R,k);C[s]=new S(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!0,!0)});function $(i,s,c,f){var g=C.hasOwnProperty(s)?C[s]:null;(g!==null?g.type!==0:f||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(E(s,c,g,f)&&(c=null),f||g===null?y(s)&&(c===null?i.removeAttribute(s):i.setAttribute(s,""+c)):g.mustUseProperty?i[g.propertyName]=c===null?g.type===3?!1:"":c:(s=g.attributeName,f=g.attributeNamespace,c===null?i.removeAttribute(s):(g=g.type,c=g===3||g===4&&c===!0?"":""+c,f?i.setAttributeNS(f,s,c):i.setAttribute(s,c))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),N=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),ee=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),L=Symbol.iterator;function U(i){return i===null||typeof i!="object"?null:(i=L&&i[L]||i["@@iterator"],typeof i=="function"?i:null)}var z=Object.assign,T;function M(i){if(T===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);T=s&&s[1]||""}return`
5
5
  `+T+i}var te=!1;function le(i,s){if(!i||te)return"";te=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(J){var f=J}Reflect.construct(i,[],s)}else{try{s.call()}catch(J){f=J}i.call(s.prototype)}else{try{throw Error()}catch(J){f=J}i()}}catch(J){if(J&&f&&typeof J.stack=="string"){for(var g=J.stack.split(`
6
6
  `),b=f.stack.split(`
7
7
  `),_=g.length-1,j=b.length-1;1<=_&&0<=j&&g[_]!==b[j];)j--;for(;1<=_&&0<=j;_--,j--)if(g[_]!==b[j]){if(_!==1||j!==1)do if(_--,j--,0>j||g[_]!==b[j]){var B=`
8
- `+g[_].replace(" at new "," at ");return i.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",i.displayName)),B}while(1<=_&&0<=j);break}}}finally{te=!1,Error.prepareStackTrace=c}return(i=i?i.displayName||i.name:"")?M(i):""}function G(i){switch(i.tag){case 5:return M(i.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return i=le(i.type,!1),i;case 11:return i=le(i.type.render,!1),i;case 1:return i=le(i.type,!0),i;default:return""}}function fe(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case P:return"Fragment";case N:return"Portal";case re:return"Profiler";case I:return"StrictMode";case X:return"Suspense";case F:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case ee:return(i.displayName||"Context")+".Consumer";case Z:return(i._context.displayName||"Context")+".Provider";case ne:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return s=i.displayName||null,s!==null?s:fe(i.type)||"Memo";case H:s=i._payload,i=i._init;try{return fe(i(s))}catch{}}return null}function be(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(s);case 8:return s===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function pe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ue(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ge(i){var s=ue(i)?"checked":"value",c=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),f=""+i[s];if(!i.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var g=c.get,b=c.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return g.call(this)},set:function(_){f=""+_,b.call(this,_)}}),Object.defineProperty(i,s,{enumerable:c.enumerable}),{getValue:function(){return f},setValue:function(_){f=""+_},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function qe(i){i._valueTracker||(i._valueTracker=ge(i))}function Xe(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var c=s.getValue(),f="";return i&&(f=ue(i)?i.checked?"true":"false":i.value),i=f,i!==c?(s.setValue(i),!0):!1}function we(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ze(i,s){var c=s.checked;return z({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??i._wrapperState.initialChecked})}function We(i,s){var c=s.defaultValue==null?"":s.defaultValue,f=s.checked!=null?s.checked:s.defaultChecked;c=pe(s.value!=null?s.value:c),i._wrapperState={initialChecked:f,initialValue:c,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(i,s){s=s.checked,s!=null&&$(i,"checked",s,!1)}function De(i,s){tt(i,s);var c=pe(s.value),f=s.type;if(c!=null)f==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+c):i.value!==""+c&&(i.value=""+c);else if(f==="submit"||f==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?lt(i,s.type,c):s.hasOwnProperty("defaultValue")&&lt(i,s.type,pe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function Fe(i,s,c){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var f=s.type;if(!(f!=="submit"&&f!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,c||s===i.value||(i.value=s),i.defaultValue=s}c=i.name,c!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,c!==""&&(i.name=c)}function lt(i,s,c){(s!=="number"||we(i.ownerDocument)!==i)&&(c==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+c&&(i.defaultValue=""+c))}var Ne=Array.isArray;function oe(i,s,c,f){if(i=i.options,s){s={};for(var g=0;g<c.length;g++)s["$"+c[g]]=!0;for(c=0;c<i.length;c++)g=s.hasOwnProperty("$"+i[c].value),i[c].selected!==g&&(i[c].selected=g),g&&f&&(i[c].defaultSelected=!0)}else{for(c=""+pe(c),s=null,g=0;g<i.length;g++){if(i[g].value===c){i[g].selected=!0,f&&(i[g].defaultSelected=!0);return}s!==null||i[g].disabled||(s=i[g])}s!==null&&(s.selected=!0)}}function Se(i,s){if(s.dangerouslySetInnerHTML!=null)throw Error(r(91));return z({},s,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Je(i,s){var c=s.value;if(c==null){if(c=s.children,s=s.defaultValue,c!=null){if(s!=null)throw Error(r(92));if(Ne(c)){if(1<c.length)throw Error(r(93));c=c[0]}s=c}s==null&&(s=""),c=s}i._wrapperState={initialValue:pe(c)}}function ht(i,s){var c=pe(s.value),f=pe(s.defaultValue);c!=null&&(c=""+c,c!==i.value&&(i.value=c),s.defaultValue==null&&i.defaultValue!==c&&(i.defaultValue=c)),f!=null&&(i.defaultValue=""+f)}function Bt(i){var s=i.textContent;s===i._wrapperState.initialValue&&s!==""&&s!==null&&(i.value=s)}function Ut(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jt(i,s){return i==null||i==="http://www.w3.org/1999/xhtml"?Ut(s):i==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Vt,bt=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,c,f,g){MSApp.execUnsafeLocalFunction(function(){return i(s,c,f,g)})}:i})(function(i,s){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=s;else{for(Vt=Vt||document.createElement("div"),Vt.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Vt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function rt(i,s){if(s){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=s;return}}i.textContent=s}var q={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Q=["Webkit","ms","Moz","O"];Object.keys(q).forEach(function(i){Q.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),q[s]=q[i]})});function ie(i,s,c){return s==null||typeof s=="boolean"||s===""?"":c||typeof s!="number"||s===0||q.hasOwnProperty(i)&&q[i]?(""+s).trim():s+"px"}function se(i,s){i=i.style;for(var c in s)if(s.hasOwnProperty(c)){var f=c.indexOf("--")===0,g=ie(c,s[c],f);c==="float"&&(c="cssFloat"),f?i.setProperty(c,g):i[c]=g}}var Ce=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ve(i,s){if(s){if(Ce[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function Ke(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pe=null;function he(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ve=null,ye=null,xe=null;function Ue(i){if(i=Oa(i)){if(typeof ve!="function")throw Error(r(280));var s=i.stateNode;s&&(s=gc(s),ve(i.stateNode,i.type,s))}}function Ze(i){ye?xe?xe.push(i):xe=[i]:ye=i}function dt(){if(ye){var i=ye,s=xe;if(xe=ye=null,Ue(i),s)for(i=0;i<s.length;i++)Ue(s[i])}}function Wt(i,s){return i(s)}function Zr(){}var en=!1;function pi(i,s,c){if(en)return i(s,c);en=!0;try{return Wt(i,s,c)}finally{en=!1,(ye!==null||xe!==null)&&(Zr(),dt())}}function wn(i,s){var c=i.stateNode;if(c===null)return null;var f=gc(c);if(f===null)return null;c=f[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,s,typeof c));return c}var tn=!1;if(u)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){tn=!0}}),window.addEventListener("test",Sn,Sn),window.removeEventListener("test",Sn,Sn)}catch{tn=!1}function sa(i,s,c,f,g,b,_,j,B){var J=Array.prototype.slice.call(arguments,3);try{s.apply(c,J)}catch(ce){this.onError(ce)}}var En=!1,Ho=null,to=!1,aa=null,qo={onError:function(i){En=!0,Ho=i}};function Go(i,s,c,f,g,b,_,j,B){En=!1,Ho=null,sa.apply(qo,arguments)}function Fl(i,s,c,f,g,b,_,j,B){if(Go.apply(this,arguments),En){if(En){var J=Ho;En=!1,Ho=null}else throw Error(r(198));to||(to=!0,aa=J)}}function Bn(i){var s=i,c=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(c=s.return),i=s.return;while(i)}return s.tag===3?c:null}function la(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function Bl(i){if(Bn(i)!==i)throw Error(r(188))}function ro(i){var s=i.alternate;if(!s){if(s=Bn(i),s===null)throw Error(r(188));return s!==i?null:i}for(var c=i,f=s;;){var g=c.return;if(g===null)break;var b=g.alternate;if(b===null){if(f=g.return,f!==null){c=f;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===c)return Bl(g),i;if(b===f)return Bl(g),s;b=b.sibling}throw Error(r(188))}if(c.return!==f.return)c=g,f=b;else{for(var _=!1,j=g.child;j;){if(j===c){_=!0,c=g,f=b;break}if(j===f){_=!0,f=g,c=b;break}j=j.sibling}if(!_){for(j=b.child;j;){if(j===c){_=!0,c=b,f=g;break}if(j===f){_=!0,f=b,c=g;break}j=j.sibling}if(!_)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:s}function ca(i){return i=ro(i),i!==null?Ae(i):null}function Ae(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var s=Ae(i);if(s!==null)return s;i=i.sibling}return null}var Ul=t.unstable_scheduleCallback,Br=t.unstable_cancelCallback,Vl=t.unstable_shouldYield,Wl=t.unstable_requestPaint,Ct=t.unstable_now,Hl=t.unstable_getCurrentPriorityLevel,Xo=t.unstable_ImmediatePriority,ua=t.unstable_UserBlockingPriority,no=t.unstable_NormalPriority,ql=t.unstable_LowPriority,da=t.unstable_IdlePriority,io=null,Ir=null;function Gl(i){if(Ir&&typeof Ir.onCommitFiberRoot=="function")try{Ir.onCommitFiberRoot(io,i,void 0,(i.current.flags&128)===128)}catch{}}var vr=Math.clz32?Math.clz32:Kl,Xl=Math.log,Yl=Math.LN2;function Kl(i){return i>>>=0,i===0?32:31-(Xl(i)/Yl|0)|0}var oo=64,so=4194304;function hi(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ao(i,s){var c=i.pendingLanes;if(c===0)return 0;var f=0,g=i.suspendedLanes,b=i.pingedLanes,_=c&268435455;if(_!==0){var j=_&~g;j!==0?f=hi(j):(b&=_,b!==0&&(f=hi(b)))}else _=c&~g,_!==0?f=hi(_):b!==0&&(f=hi(b));if(f===0)return 0;if(s!==0&&s!==f&&(s&g)===0&&(g=f&-f,b=s&-s,g>=b||g===16&&(b&4194240)!==0))return s;if((f&4)!==0&&(f|=c&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=f;0<s;)c=31-vr(s),g=1<<c,f|=i[c],s&=~g;return f}function Ql(i,s){switch(i){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jl(i,s){for(var c=i.suspendedLanes,f=i.pingedLanes,g=i.expirationTimes,b=i.pendingLanes;0<b;){var _=31-vr(b),j=1<<_,B=g[_];B===-1?((j&c)===0||(j&f)!==0)&&(g[_]=Ql(j,s)):B<=s&&(i.expiredLanes|=j),b&=~j}}function lo(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function fa(){var i=oo;return oo<<=1,(oo&4194240)===0&&(oo=64),i}function Yo(i){for(var s=[],c=0;31>c;c++)s.push(i);return s}function mi(i,s,c){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-vr(s),i[s]=c}function Zl(i,s){var c=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var f=i.eventTimes;for(i=i.expirationTimes;0<c;){var g=31-vr(c),b=1<<g;s[g]=0,f[g]=-1,i[g]=-1,c&=~b}}function Ko(i,s){var c=i.entangledLanes|=s;for(i=i.entanglements;c;){var f=31-vr(c),g=1<<f;g&s|i[f]&s&&(i[f]|=s),c&=~g}}var it=0;function pa(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var ha,Qo,ma,ga,va,Jo=!1,co=[],rn=null,nn=null,on=null,gi=new Map,yi=new Map,sn=[],ec="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Zo(i,s){switch(i){case"focusin":case"focusout":rn=null;break;case"dragenter":case"dragleave":nn=null;break;case"mouseover":case"mouseout":on=null;break;case"pointerover":case"pointerout":gi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":yi.delete(s.pointerId)}}function uo(i,s,c,f,g,b){return i===null||i.nativeEvent!==b?(i={blockedOn:s,domEventName:c,eventSystemFlags:f,nativeEvent:b,targetContainers:[g]},s!==null&&(s=Oa(s),s!==null&&Qo(s)),i):(i.eventSystemFlags|=f,s=i.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),i)}function tc(i,s,c,f,g){switch(s){case"focusin":return rn=uo(rn,i,s,c,f,g),!0;case"dragenter":return nn=uo(nn,i,s,c,f,g),!0;case"mouseover":return on=uo(on,i,s,c,f,g),!0;case"pointerover":var b=g.pointerId;return gi.set(b,uo(gi.get(b)||null,i,s,c,f,g)),!0;case"gotpointercapture":return b=g.pointerId,yi.set(b,uo(yi.get(b)||null,i,s,c,f,g)),!0}return!1}function ya(i){var s=po(i.target);if(s!==null){var c=Bn(s);if(c!==null){if(s=c.tag,s===13){if(s=la(c),s!==null){i.blockedOn=s,va(i.priority,function(){ma(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function fo(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var c=Zd(i.domEventName,i.eventSystemFlags,s[0],i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);Pe=f,c.target.dispatchEvent(f),Pe=null}else return s=Oa(c),s!==null&&Qo(s),i.blockedOn=c,!1;s.shift()}return!0}function ba(i,s,c){fo(i)&&c.delete(s)}function rc(){Jo=!1,rn!==null&&fo(rn)&&(rn=null),nn!==null&&fo(nn)&&(nn=null),on!==null&&fo(on)&&(on=null),gi.forEach(ba),yi.forEach(ba)}function xa(i,s){i.blockedOn===s&&(i.blockedOn=null,Jo||(Jo=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,rc)))}function wa(i){function s(g){return xa(g,i)}if(0<co.length){xa(co[0],i);for(var c=1;c<co.length;c++){var f=co[c];f.blockedOn===i&&(f.blockedOn=null)}}for(rn!==null&&xa(rn,i),nn!==null&&xa(nn,i),on!==null&&xa(on,i),gi.forEach(s),yi.forEach(s),c=0;c<sn.length;c++)f=sn[c],f.blockedOn===i&&(f.blockedOn=null);for(;0<sn.length&&(c=sn[0],c.blockedOn===null);)ya(c),c.blockedOn===null&&sn.shift()}var es=A.ReactCurrentBatchConfig,nc=!0;function U_(i,s,c,f){var g=it,b=es.transition;es.transition=null;try{it=1,Jd(i,s,c,f)}finally{it=g,es.transition=b}}function V_(i,s,c,f){var g=it,b=es.transition;es.transition=null;try{it=4,Jd(i,s,c,f)}finally{it=g,es.transition=b}}function Jd(i,s,c,f){if(nc){var g=Zd(i,s,c,f);if(g===null)vf(i,s,f,ic,c),Zo(i,f);else if(tc(g,i,s,c,f))f.stopPropagation();else if(Zo(i,f),s&4&&-1<ec.indexOf(i)){for(;g!==null;){var b=Oa(g);if(b!==null&&ha(b),b=Zd(i,s,c,f),b===null&&vf(i,s,f,ic,c),b===g)break;g=b}g!==null&&f.stopPropagation()}else vf(i,s,f,null,c)}}var ic=null;function Zd(i,s,c,f){if(ic=null,i=he(f),i=po(i),i!==null)if(s=Bn(i),s===null)i=null;else if(c=s.tag,c===13){if(i=la(s),i!==null)return i;i=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null);return ic=i,null}function Vv(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Hl()){case Xo:return 1;case ua:return 4;case no:case ql:return 16;case da:return 536870912;default:return 16}default:return 16}}var bi=null,ef=null,oc=null;function Wv(){if(oc)return oc;var i,s=ef,c=s.length,f,g="value"in bi?bi.value:bi.textContent,b=g.length;for(i=0;i<c&&s[i]===g[i];i++);var _=c-i;for(f=1;f<=_&&s[c-f]===g[b-f];f++);return oc=g.slice(i,1<f?1-f:void 0)}function sc(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function ac(){return!0}function Hv(){return!1}function Or(i){function s(c,f,g,b,_){this._reactName=c,this._targetInst=g,this.type=f,this.nativeEvent=b,this.target=_,this.currentTarget=null;for(var j in i)i.hasOwnProperty(j)&&(c=i[j],this[j]=c?c(b):b[j]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?ac:Hv,this.isPropagationStopped=Hv,this}return z(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=ac)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=ac)},persist:function(){},isPersistent:ac}),s}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tf=Or(ts),Sa=z({},ts,{view:0,detail:0}),W_=Or(Sa),rf,nf,Ea,lc=z({},Sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ea&&(Ea&&i.type==="mousemove"?(rf=i.screenX-Ea.screenX,nf=i.screenY-Ea.screenY):nf=rf=0,Ea=i),rf)},movementY:function(i){return"movementY"in i?i.movementY:nf}}),qv=Or(lc),H_=z({},lc,{dataTransfer:0}),q_=Or(H_),G_=z({},Sa,{relatedTarget:0}),of=Or(G_),X_=z({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),Y_=Or(X_),K_=z({},ts,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Q_=Or(K_),J_=z({},ts,{data:0}),Gv=Or(J_),Z_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},e$={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},t$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r$(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=t$[i])?!!s[i]:!1}function sf(){return r$}var n$=z({},Sa,{key:function(i){if(i.key){var s=Z_[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=sc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?e$[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sf,charCode:function(i){return i.type==="keypress"?sc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?sc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),i$=Or(n$),o$=z({},lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xv=Or(o$),s$=z({},Sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sf}),a$=Or(s$),l$=z({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),c$=Or(l$),u$=z({},lc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),d$=Or(u$),f$=[9,13,27,32],af=u&&"CompositionEvent"in window,Ca=null;u&&"documentMode"in document&&(Ca=document.documentMode);var p$=u&&"TextEvent"in window&&!Ca,Yv=u&&(!af||Ca&&8<Ca&&11>=Ca),Kv=" ",Qv=!1;function Jv(i,s){switch(i){case"keyup":return f$.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var rs=!1;function h$(i,s){switch(i){case"compositionend":return Zv(s);case"keypress":return s.which!==32?null:(Qv=!0,Kv);case"textInput":return i=s.data,i===Kv&&Qv?null:i;default:return null}}function m$(i,s){if(rs)return i==="compositionend"||!af&&Jv(i,s)?(i=Wv(),oc=ef=bi=null,rs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Yv&&s.locale!=="ko"?null:s.data;default:return null}}var g$={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ey(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!g$[i.type]:s==="textarea"}function ty(i,s,c,f){Ze(f),s=pc(s,"onChange"),0<s.length&&(c=new tf("onChange","change",null,c,f),i.push({event:c,listeners:s}))}var ka=null,Ra=null;function v$(i){by(i,0)}function cc(i){var s=as(i);if(Xe(s))return i}function y$(i,s){if(i==="change")return s}var ry=!1;if(u){var lf;if(u){var cf="oninput"in document;if(!cf){var ny=document.createElement("div");ny.setAttribute("oninput","return;"),cf=typeof ny.oninput=="function"}lf=cf}else lf=!1;ry=lf&&(!document.documentMode||9<document.documentMode)}function iy(){ka&&(ka.detachEvent("onpropertychange",oy),Ra=ka=null)}function oy(i){if(i.propertyName==="value"&&cc(Ra)){var s=[];ty(s,Ra,i,he(i)),pi(v$,s)}}function b$(i,s,c){i==="focusin"?(iy(),ka=s,Ra=c,ka.attachEvent("onpropertychange",oy)):i==="focusout"&&iy()}function x$(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return cc(Ra)}function w$(i,s){if(i==="click")return cc(s)}function S$(i,s){if(i==="input"||i==="change")return cc(s)}function E$(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var an=typeof Object.is=="function"?Object.is:E$;function _a(i,s){if(an(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var c=Object.keys(i),f=Object.keys(s);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var g=c[f];if(!d.call(s,g)||!an(i[g],s[g]))return!1}return!0}function sy(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ay(i,s){var c=sy(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=s&&f>=s)return{node:c,offset:s-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=sy(c)}}function ly(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?ly(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function cy(){for(var i=window,s=we();s instanceof i.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)i=s.contentWindow;else break;s=we(i.document)}return s}function uf(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function C$(i){var s=cy(),c=i.focusedElem,f=i.selectionRange;if(s!==c&&c&&c.ownerDocument&&ly(c.ownerDocument.documentElement,c)){if(f!==null&&uf(c)){if(s=f.start,i=f.end,i===void 0&&(i=s),"selectionStart"in c)c.selectionStart=s,c.selectionEnd=Math.min(i,c.value.length);else if(i=(s=c.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var g=c.textContent.length,b=Math.min(f.start,g);f=f.end===void 0?b:Math.min(f.end,g),!i.extend&&b>f&&(g=f,f=b,b=g),g=ay(c,b);var _=ay(c,f);g&&_&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==_.node||i.focusOffset!==_.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),i.removeAllRanges(),b>f?(i.addRange(s),i.extend(_.node,_.offset)):(s.setEnd(_.node,_.offset),i.addRange(s)))}}for(s=[],i=c;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<s.length;c++)i=s[c],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var k$=u&&"documentMode"in document&&11>=document.documentMode,ns=null,df=null,$a=null,ff=!1;function uy(i,s,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;ff||ns==null||ns!==we(f)||(f=ns,"selectionStart"in f&&uf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),$a&&_a($a,f)||($a=f,f=pc(df,"onSelect"),0<f.length&&(s=new tf("onSelect","select",null,s,c),i.push({event:s,listeners:f}),s.target=ns)))}function uc(i,s){var c={};return c[i.toLowerCase()]=s.toLowerCase(),c["Webkit"+i]="webkit"+s,c["Moz"+i]="moz"+s,c}var is={animationend:uc("Animation","AnimationEnd"),animationiteration:uc("Animation","AnimationIteration"),animationstart:uc("Animation","AnimationStart"),transitionend:uc("Transition","TransitionEnd")},pf={},dy={};u&&(dy=document.createElement("div").style,"AnimationEvent"in window||(delete is.animationend.animation,delete is.animationiteration.animation,delete is.animationstart.animation),"TransitionEvent"in window||delete is.transitionend.transition);function dc(i){if(pf[i])return pf[i];if(!is[i])return i;var s=is[i],c;for(c in s)if(s.hasOwnProperty(c)&&c in dy)return pf[i]=s[c];return i}var fy=dc("animationend"),py=dc("animationiteration"),hy=dc("animationstart"),my=dc("transitionend"),gy=new Map,vy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xi(i,s){gy.set(i,s),a(s,[i])}for(var hf=0;hf<vy.length;hf++){var mf=vy[hf],R$=mf.toLowerCase(),_$=mf[0].toUpperCase()+mf.slice(1);xi(R$,"on"+_$)}xi(fy,"onAnimationEnd"),xi(py,"onAnimationIteration"),xi(hy,"onAnimationStart"),xi("dblclick","onDoubleClick"),xi("focusin","onFocus"),xi("focusout","onBlur"),xi(my,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Aa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$$=new Set("cancel close invalid load scroll toggle".split(" ").concat(Aa));function yy(i,s,c){var f=i.type||"unknown-event";i.currentTarget=c,Fl(f,s,void 0,i),i.currentTarget=null}function by(i,s){s=(s&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],g=f.event;f=f.listeners;e:{var b=void 0;if(s)for(var _=f.length-1;0<=_;_--){var j=f[_],B=j.instance,J=j.currentTarget;if(j=j.listener,B!==b&&g.isPropagationStopped())break e;yy(g,j,J),b=B}else for(_=0;_<f.length;_++){if(j=f[_],B=j.instance,J=j.currentTarget,j=j.listener,B!==b&&g.isPropagationStopped())break e;yy(g,j,J),b=B}}}if(to)throw i=aa,to=!1,aa=null,i}function St(i,s){var c=s[Ef];c===void 0&&(c=s[Ef]=new Set);var f=i+"__bubble";c.has(f)||(xy(s,i,2,!1),c.add(f))}function gf(i,s,c){var f=0;s&&(f|=4),xy(c,i,f,s)}var fc="_reactListening"+Math.random().toString(36).slice(2);function Ta(i){if(!i[fc]){i[fc]=!0,n.forEach(function(c){c!=="selectionchange"&&($$.has(c)||gf(c,!1,i),gf(c,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[fc]||(s[fc]=!0,gf("selectionchange",!1,s))}}function xy(i,s,c,f){switch(Vv(s)){case 1:var g=U_;break;case 4:g=V_;break;default:g=Jd}c=g.bind(null,s,c,i),g=void 0,!tn||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),f?g!==void 0?i.addEventListener(s,c,{capture:!0,passive:g}):i.addEventListener(s,c,!0):g!==void 0?i.addEventListener(s,c,{passive:g}):i.addEventListener(s,c,!1)}function vf(i,s,c,f,g){var b=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var _=f.tag;if(_===3||_===4){var j=f.stateNode.containerInfo;if(j===g||j.nodeType===8&&j.parentNode===g)break;if(_===4)for(_=f.return;_!==null;){var B=_.tag;if((B===3||B===4)&&(B=_.stateNode.containerInfo,B===g||B.nodeType===8&&B.parentNode===g))return;_=_.return}for(;j!==null;){if(_=po(j),_===null)return;if(B=_.tag,B===5||B===6){f=b=_;continue e}j=j.parentNode}}f=f.return}pi(function(){var J=b,ce=he(c),de=[];e:{var ae=gy.get(i);if(ae!==void 0){var ke=tf,Te=i;switch(i){case"keypress":if(sc(c)===0)break e;case"keydown":case"keyup":ke=i$;break;case"focusin":Te="focus",ke=of;break;case"focusout":Te="blur",ke=of;break;case"beforeblur":case"afterblur":ke=of;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=qv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=q_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=a$;break;case fy:case py:case hy:ke=Y_;break;case my:ke=c$;break;case"scroll":ke=W_;break;case"wheel":ke=d$;break;case"copy":case"cut":case"paste":ke=Q_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=Xv}var Le=(s&4)!==0,Ot=!Le&&i==="scroll",Y=Le?ae!==null?ae+"Capture":null:ae;Le=[];for(var W=J,K;W!==null;){K=W;var me=K.stateNode;if(K.tag===5&&me!==null&&(K=me,Y!==null&&(me=wn(W,Y),me!=null&&Le.push(La(W,me,K)))),Ot)break;W=W.return}0<Le.length&&(ae=new ke(ae,Te,null,c,ce),de.push({event:ae,listeners:Le}))}}if((s&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ke=i==="mouseout"||i==="pointerout",ae&&c!==Pe&&(Te=c.relatedTarget||c.fromElement)&&(po(Te)||Te[Un]))break e;if((ke||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,ke?(Te=c.relatedTarget||c.toElement,ke=J,Te=Te?po(Te):null,Te!==null&&(Ot=Bn(Te),Te!==Ot||Te.tag!==5&&Te.tag!==6)&&(Te=null)):(ke=null,Te=J),ke!==Te)){if(Le=qv,me="onMouseLeave",Y="onMouseEnter",W="mouse",(i==="pointerout"||i==="pointerover")&&(Le=Xv,me="onPointerLeave",Y="onPointerEnter",W="pointer"),Ot=ke==null?ae:as(ke),K=Te==null?ae:as(Te),ae=new Le(me,W+"leave",ke,c,ce),ae.target=Ot,ae.relatedTarget=K,me=null,po(ce)===J&&(Le=new Le(Y,W+"enter",Te,c,ce),Le.target=K,Le.relatedTarget=Ot,me=Le),Ot=me,ke&&Te)t:{for(Le=ke,Y=Te,W=0,K=Le;K;K=os(K))W++;for(K=0,me=Y;me;me=os(me))K++;for(;0<W-K;)Le=os(Le),W--;for(;0<K-W;)Y=os(Y),K--;for(;W--;){if(Le===Y||Y!==null&&Le===Y.alternate)break t;Le=os(Le),Y=os(Y)}Le=null}else Le=null;ke!==null&&wy(de,ae,ke,Le,!1),Te!==null&&Ot!==null&&wy(de,Ot,Te,Le,!0)}}e:{if(ae=J?as(J):window,ke=ae.nodeName&&ae.nodeName.toLowerCase(),ke==="select"||ke==="input"&&ae.type==="file")var Ie=y$;else if(ey(ae))if(ry)Ie=S$;else{Ie=x$;var je=b$}else(ke=ae.nodeName)&&ke.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Ie=w$);if(Ie&&(Ie=Ie(i,J))){ty(de,Ie,c,ce);break e}je&&je(i,ae,J),i==="focusout"&&(je=ae._wrapperState)&&je.controlled&&ae.type==="number"&&lt(ae,"number",ae.value)}switch(je=J?as(J):window,i){case"focusin":(ey(je)||je.contentEditable==="true")&&(ns=je,df=J,$a=null);break;case"focusout":$a=df=ns=null;break;case"mousedown":ff=!0;break;case"contextmenu":case"mouseup":case"dragend":ff=!1,uy(de,c,ce);break;case"selectionchange":if(k$)break;case"keydown":case"keyup":uy(de,c,ce)}var Me;if(af)e:{switch(i){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else rs?Jv(i,c)&&(Be="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Be="onCompositionStart");Be&&(Yv&&c.locale!=="ko"&&(rs||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&rs&&(Me=Wv()):(bi=ce,ef="value"in bi?bi.value:bi.textContent,rs=!0)),je=pc(J,Be),0<je.length&&(Be=new Gv(Be,i,null,c,ce),de.push({event:Be,listeners:je}),Me?Be.data=Me:(Me=Zv(c),Me!==null&&(Be.data=Me)))),(Me=p$?h$(i,c):m$(i,c))&&(J=pc(J,"onBeforeInput"),0<J.length&&(ce=new Gv("onBeforeInput","beforeinput",null,c,ce),de.push({event:ce,listeners:J}),ce.data=Me))}by(de,s)})}function La(i,s,c){return{instance:i,listener:s,currentTarget:c}}function pc(i,s){for(var c=s+"Capture",f=[];i!==null;){var g=i,b=g.stateNode;g.tag===5&&b!==null&&(g=b,b=wn(i,c),b!=null&&f.unshift(La(i,b,g)),b=wn(i,s),b!=null&&f.push(La(i,b,g))),i=i.return}return f}function os(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function wy(i,s,c,f,g){for(var b=s._reactName,_=[];c!==null&&c!==f;){var j=c,B=j.alternate,J=j.stateNode;if(B!==null&&B===f)break;j.tag===5&&J!==null&&(j=J,g?(B=wn(c,b),B!=null&&_.unshift(La(c,B,j))):g||(B=wn(c,b),B!=null&&_.push(La(c,B,j)))),c=c.return}_.length!==0&&i.push({event:s,listeners:_})}var A$=/\r\n?/g,T$=/\u0000|\uFFFD/g;function Sy(i){return(typeof i=="string"?i:""+i).replace(A$,`
9
- `).replace(T$,"")}function hc(i,s,c){if(s=Sy(s),Sy(i)!==s&&c)throw Error(r(425))}function mc(){}var yf=null,bf=null;function xf(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wf=typeof setTimeout=="function"?setTimeout:void 0,L$=typeof clearTimeout=="function"?clearTimeout:void 0,Ey=typeof Promise=="function"?Promise:void 0,I$=typeof queueMicrotask=="function"?queueMicrotask:typeof Ey<"u"?function(i){return Ey.resolve(null).then(i).catch(O$)}:wf;function O$(i){setTimeout(function(){throw i})}function Sf(i,s){var c=s,f=0;do{var g=c.nextSibling;if(i.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"){if(f===0){i.removeChild(g),wa(s);return}f--}else c!=="$"&&c!=="$?"&&c!=="$!"||f++;c=g}while(c);wa(s)}function wi(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return i}function Cy(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"){if(s===0)return i;s--}else c==="/$"&&s++}i=i.previousSibling}return null}var ss=Math.random().toString(36).slice(2),Cn="__reactFiber$"+ss,Ia="__reactProps$"+ss,Un="__reactContainer$"+ss,Ef="__reactEvents$"+ss,N$="__reactListeners$"+ss,P$="__reactHandles$"+ss;function po(i){var s=i[Cn];if(s)return s;for(var c=i.parentNode;c;){if(s=c[Un]||c[Cn]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(i=Cy(i);i!==null;){if(c=i[Cn])return c;i=Cy(i)}return s}i=c,c=i.parentNode}return null}function Oa(i){return i=i[Cn]||i[Un],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function as(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(r(33))}function gc(i){return i[Ia]||null}var Cf=[],ls=-1;function Si(i){return{current:i}}function Et(i){0>ls||(i.current=Cf[ls],Cf[ls]=null,ls--)}function xt(i,s){ls++,Cf[ls]=i.current,i.current=s}var Ei={},ar=Si(Ei),yr=Si(!1),ho=Ei;function cs(i,s){var c=i.type.contextTypes;if(!c)return Ei;var f=i.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===s)return f.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in c)g[b]=s[b];return f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=g),g}function br(i){return i=i.childContextTypes,i!=null}function vc(){Et(yr),Et(ar)}function ky(i,s,c){if(ar.current!==Ei)throw Error(r(168));xt(ar,s),xt(yr,c)}function Ry(i,s,c){var f=i.stateNode;if(s=s.childContextTypes,typeof f.getChildContext!="function")return c;f=f.getChildContext();for(var g in f)if(!(g in s))throw Error(r(108,be(i)||"Unknown",g));return z({},c,f)}function yc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ei,ho=ar.current,xt(ar,i),xt(yr,yr.current),!0}function _y(i,s,c){var f=i.stateNode;if(!f)throw Error(r(169));c?(i=Ry(i,s,ho),f.__reactInternalMemoizedMergedChildContext=i,Et(yr),Et(ar),xt(ar,i)):Et(yr),xt(yr,c)}var Vn=null,bc=!1,kf=!1;function $y(i){Vn===null?Vn=[i]:Vn.push(i)}function D$(i){bc=!0,$y(i)}function Ci(){if(!kf&&Vn!==null){kf=!0;var i=0,s=it;try{var c=Vn;for(it=1;i<c.length;i++){var f=c[i];do f=f(!0);while(f!==null)}Vn=null,bc=!1}catch(g){throw Vn!==null&&(Vn=Vn.slice(i+1)),Ul(Xo,Ci),g}finally{it=s,kf=!1}}return null}var us=[],ds=0,xc=null,wc=0,Ur=[],Vr=0,mo=null,Wn=1,Hn="";function go(i,s){us[ds++]=wc,us[ds++]=xc,xc=i,wc=s}function Ay(i,s,c){Ur[Vr++]=Wn,Ur[Vr++]=Hn,Ur[Vr++]=mo,mo=i;var f=Wn;i=Hn;var g=32-vr(f)-1;f&=~(1<<g),c+=1;var b=32-vr(s)+g;if(30<b){var _=g-g%5;b=(f&(1<<_)-1).toString(32),f>>=_,g-=_,Wn=1<<32-vr(s)+g|c<<g|f,Hn=b+i}else Wn=1<<b|c<<g|f,Hn=i}function Rf(i){i.return!==null&&(go(i,1),Ay(i,1,0))}function _f(i){for(;i===xc;)xc=us[--ds],us[ds]=null,wc=us[--ds],us[ds]=null;for(;i===mo;)mo=Ur[--Vr],Ur[Vr]=null,Hn=Ur[--Vr],Ur[Vr]=null,Wn=Ur[--Vr],Ur[Vr]=null}var Nr=null,Pr=null,kt=!1,ln=null;function Ty(i,s){var c=Gr(5,null,null,0);c.elementType="DELETED",c.stateNode=s,c.return=i,s=i.deletions,s===null?(i.deletions=[c],i.flags|=16):s.push(c)}function Ly(i,s){switch(i.tag){case 5:var c=i.type;return s=s.nodeType!==1||c.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(i.stateNode=s,Nr=i,Pr=wi(s.firstChild),!0):!1;case 6:return s=i.pendingProps===""||s.nodeType!==3?null:s,s!==null?(i.stateNode=s,Nr=i,Pr=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(c=mo!==null?{id:Wn,overflow:Hn}:null,i.memoizedState={dehydrated:s,treeContext:c,retryLane:1073741824},c=Gr(18,null,null,0),c.stateNode=s,c.return=i,i.child=c,Nr=i,Pr=null,!0):!1;default:return!1}}function $f(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Af(i){if(kt){var s=Pr;if(s){var c=s;if(!Ly(i,s)){if($f(i))throw Error(r(418));s=wi(c.nextSibling);var f=Nr;s&&Ly(i,s)?Ty(f,c):(i.flags=i.flags&-4097|2,kt=!1,Nr=i)}}else{if($f(i))throw Error(r(418));i.flags=i.flags&-4097|2,kt=!1,Nr=i}}}function Iy(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Nr=i}function Sc(i){if(i!==Nr)return!1;if(!kt)return Iy(i),kt=!0,!1;var s;if((s=i.tag!==3)&&!(s=i.tag!==5)&&(s=i.type,s=s!=="head"&&s!=="body"&&!xf(i.type,i.memoizedProps)),s&&(s=Pr)){if($f(i))throw Oy(),Error(r(418));for(;s;)Ty(i,s),s=wi(s.nextSibling)}if(Iy(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"){if(s===0){Pr=wi(i.nextSibling);break e}s--}else c!=="$"&&c!=="$!"&&c!=="$?"||s++}i=i.nextSibling}Pr=null}}else Pr=Nr?wi(i.stateNode.nextSibling):null;return!0}function Oy(){for(var i=Pr;i;)i=wi(i.nextSibling)}function fs(){Pr=Nr=null,kt=!1}function Tf(i){ln===null?ln=[i]:ln.push(i)}var j$=A.ReactCurrentBatchConfig;function Na(i,s,c){if(i=c.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(r(309));var f=c.stateNode}if(!f)throw Error(r(147,i));var g=f,b=""+i;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===b?s.ref:(s=function(_){var j=g.refs;_===null?delete j[b]:j[b]=_},s._stringRef=b,s)}if(typeof i!="string")throw Error(r(284));if(!c._owner)throw Error(r(290,i))}return i}function Ec(i,s){throw i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i))}function Ny(i){var s=i._init;return s(i._payload)}function Py(i){function s(Y,W){if(i){var K=Y.deletions;K===null?(Y.deletions=[W],Y.flags|=16):K.push(W)}}function c(Y,W){if(!i)return null;for(;W!==null;)s(Y,W),W=W.sibling;return null}function f(Y,W){for(Y=new Map;W!==null;)W.key!==null?Y.set(W.key,W):Y.set(W.index,W),W=W.sibling;return Y}function g(Y,W){return Y=Ii(Y,W),Y.index=0,Y.sibling=null,Y}function b(Y,W,K){return Y.index=K,i?(K=Y.alternate,K!==null?(K=K.index,K<W?(Y.flags|=2,W):K):(Y.flags|=2,W)):(Y.flags|=1048576,W)}function _(Y){return i&&Y.alternate===null&&(Y.flags|=2),Y}function j(Y,W,K,me){return W===null||W.tag!==6?(W=wp(K,Y.mode,me),W.return=Y,W):(W=g(W,K),W.return=Y,W)}function B(Y,W,K,me){var Ie=K.type;return Ie===P?ce(Y,W,K.props.children,me,K.key):W!==null&&(W.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===H&&Ny(Ie)===W.type)?(me=g(W,K.props),me.ref=Na(Y,W,K),me.return=Y,me):(me=Gc(K.type,K.key,K.props,null,Y.mode,me),me.ref=Na(Y,W,K),me.return=Y,me)}function J(Y,W,K,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==K.containerInfo||W.stateNode.implementation!==K.implementation?(W=Sp(K,Y.mode,me),W.return=Y,W):(W=g(W,K.children||[]),W.return=Y,W)}function ce(Y,W,K,me,Ie){return W===null||W.tag!==7?(W=Co(K,Y.mode,me,Ie),W.return=Y,W):(W=g(W,K),W.return=Y,W)}function de(Y,W,K){if(typeof W=="string"&&W!==""||typeof W=="number")return W=wp(""+W,Y.mode,K),W.return=Y,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case D:return K=Gc(W.type,W.key,W.props,null,Y.mode,K),K.ref=Na(Y,null,W),K.return=Y,K;case N:return W=Sp(W,Y.mode,K),W.return=Y,W;case H:var me=W._init;return de(Y,me(W._payload),K)}if(Ne(W)||U(W))return W=Co(W,Y.mode,K,null),W.return=Y,W;Ec(Y,W)}return null}function ae(Y,W,K,me){var Ie=W!==null?W.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return Ie!==null?null:j(Y,W,""+K,me);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case D:return K.key===Ie?B(Y,W,K,me):null;case N:return K.key===Ie?J(Y,W,K,me):null;case H:return Ie=K._init,ae(Y,W,Ie(K._payload),me)}if(Ne(K)||U(K))return Ie!==null?null:ce(Y,W,K,me,null);Ec(Y,K)}return null}function ke(Y,W,K,me,Ie){if(typeof me=="string"&&me!==""||typeof me=="number")return Y=Y.get(K)||null,j(W,Y,""+me,Ie);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case D:return Y=Y.get(me.key===null?K:me.key)||null,B(W,Y,me,Ie);case N:return Y=Y.get(me.key===null?K:me.key)||null,J(W,Y,me,Ie);case H:var je=me._init;return ke(Y,W,K,je(me._payload),Ie)}if(Ne(me)||U(me))return Y=Y.get(K)||null,ce(W,Y,me,Ie,null);Ec(W,me)}return null}function Te(Y,W,K,me){for(var Ie=null,je=null,Me=W,Be=W=0,er=null;Me!==null&&Be<K.length;Be++){Me.index>Be?(er=Me,Me=null):er=Me.sibling;var ot=ae(Y,Me,K[Be],me);if(ot===null){Me===null&&(Me=er);break}i&&Me&&ot.alternate===null&&s(Y,Me),W=b(ot,W,Be),je===null?Ie=ot:je.sibling=ot,je=ot,Me=er}if(Be===K.length)return c(Y,Me),kt&&go(Y,Be),Ie;if(Me===null){for(;Be<K.length;Be++)Me=de(Y,K[Be],me),Me!==null&&(W=b(Me,W,Be),je===null?Ie=Me:je.sibling=Me,je=Me);return kt&&go(Y,Be),Ie}for(Me=f(Y,Me);Be<K.length;Be++)er=ke(Me,Y,Be,K[Be],me),er!==null&&(i&&er.alternate!==null&&Me.delete(er.key===null?Be:er.key),W=b(er,W,Be),je===null?Ie=er:je.sibling=er,je=er);return i&&Me.forEach(function(Oi){return s(Y,Oi)}),kt&&go(Y,Be),Ie}function Le(Y,W,K,me){var Ie=U(K);if(typeof Ie!="function")throw Error(r(150));if(K=Ie.call(K),K==null)throw Error(r(151));for(var je=Ie=null,Me=W,Be=W=0,er=null,ot=K.next();Me!==null&&!ot.done;Be++,ot=K.next()){Me.index>Be?(er=Me,Me=null):er=Me.sibling;var Oi=ae(Y,Me,ot.value,me);if(Oi===null){Me===null&&(Me=er);break}i&&Me&&Oi.alternate===null&&s(Y,Me),W=b(Oi,W,Be),je===null?Ie=Oi:je.sibling=Oi,je=Oi,Me=er}if(ot.done)return c(Y,Me),kt&&go(Y,Be),Ie;if(Me===null){for(;!ot.done;Be++,ot=K.next())ot=de(Y,ot.value,me),ot!==null&&(W=b(ot,W,Be),je===null?Ie=ot:je.sibling=ot,je=ot);return kt&&go(Y,Be),Ie}for(Me=f(Y,Me);!ot.done;Be++,ot=K.next())ot=ke(Me,Y,Be,ot.value,me),ot!==null&&(i&&ot.alternate!==null&&Me.delete(ot.key===null?Be:ot.key),W=b(ot,W,Be),je===null?Ie=ot:je.sibling=ot,je=ot);return i&&Me.forEach(function(gA){return s(Y,gA)}),kt&&go(Y,Be),Ie}function Ot(Y,W,K,me){if(typeof K=="object"&&K!==null&&K.type===P&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case D:e:{for(var Ie=K.key,je=W;je!==null;){if(je.key===Ie){if(Ie=K.type,Ie===P){if(je.tag===7){c(Y,je.sibling),W=g(je,K.props.children),W.return=Y,Y=W;break e}}else if(je.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===H&&Ny(Ie)===je.type){c(Y,je.sibling),W=g(je,K.props),W.ref=Na(Y,je,K),W.return=Y,Y=W;break e}c(Y,je);break}else s(Y,je);je=je.sibling}K.type===P?(W=Co(K.props.children,Y.mode,me,K.key),W.return=Y,Y=W):(me=Gc(K.type,K.key,K.props,null,Y.mode,me),me.ref=Na(Y,W,K),me.return=Y,Y=me)}return _(Y);case N:e:{for(je=K.key;W!==null;){if(W.key===je)if(W.tag===4&&W.stateNode.containerInfo===K.containerInfo&&W.stateNode.implementation===K.implementation){c(Y,W.sibling),W=g(W,K.children||[]),W.return=Y,Y=W;break e}else{c(Y,W);break}else s(Y,W);W=W.sibling}W=Sp(K,Y.mode,me),W.return=Y,Y=W}return _(Y);case H:return je=K._init,Ot(Y,W,je(K._payload),me)}if(Ne(K))return Te(Y,W,K,me);if(U(K))return Le(Y,W,K,me);Ec(Y,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,W!==null&&W.tag===6?(c(Y,W.sibling),W=g(W,K),W.return=Y,Y=W):(c(Y,W),W=wp(K,Y.mode,me),W.return=Y,Y=W),_(Y)):c(Y,W)}return Ot}var ps=Py(!0),Dy=Py(!1),Cc=Si(null),kc=null,hs=null,Lf=null;function If(){Lf=hs=kc=null}function Of(i){var s=Cc.current;Et(Cc),i._currentValue=s}function Nf(i,s,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),i===c)break;i=i.return}}function ms(i,s){kc=i,Lf=hs=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(xr=!0),i.firstContext=null)}function Wr(i){var s=i._currentValue;if(Lf!==i)if(i={context:i,memoizedValue:s,next:null},hs===null){if(kc===null)throw Error(r(308));hs=i,kc.dependencies={lanes:0,firstContext:i}}else hs=hs.next=i;return s}var vo=null;function Pf(i){vo===null?vo=[i]:vo.push(i)}function jy(i,s,c,f){var g=s.interleaved;return g===null?(c.next=c,Pf(s)):(c.next=g.next,g.next=c),s.interleaved=c,qn(i,f)}function qn(i,s){i.lanes|=s;var c=i.alternate;for(c!==null&&(c.lanes|=s),c=i,i=i.return;i!==null;)i.childLanes|=s,c=i.alternate,c!==null&&(c.childLanes|=s),c=i,i=i.return;return c.tag===3?c.stateNode:null}var ki=!1;function Df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function My(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Gn(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function Ri(i,s,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(nt&2)!==0){var g=f.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),f.pending=s,qn(i,c)}return g=f.interleaved,g===null?(s.next=s,Pf(f)):(s.next=g.next,g.next=s),f.interleaved=s,qn(i,c)}function Rc(i,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194240)!==0)){var f=s.lanes;f&=i.pendingLanes,c|=f,s.lanes=c,Ko(i,c)}}function zy(i,s){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var g=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var _={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};b===null?g=b=_:b=b.next=_,c=c.next}while(c!==null);b===null?g=b=s:b=b.next=s}else g=b=s;c={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:f.shared,effects:f.effects},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=s}function _c(i,s,c,f){var g=i.updateQueue;ki=!1;var b=g.firstBaseUpdate,_=g.lastBaseUpdate,j=g.shared.pending;if(j!==null){g.shared.pending=null;var B=j,J=B.next;B.next=null,_===null?b=J:_.next=J,_=B;var ce=i.alternate;ce!==null&&(ce=ce.updateQueue,j=ce.lastBaseUpdate,j!==_&&(j===null?ce.firstBaseUpdate=J:j.next=J,ce.lastBaseUpdate=B))}if(b!==null){var de=g.baseState;_=0,ce=J=B=null,j=b;do{var ae=j.lane,ke=j.eventTime;if((f&ae)===ae){ce!==null&&(ce=ce.next={eventTime:ke,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var Te=i,Le=j;switch(ae=s,ke=c,Le.tag){case 1:if(Te=Le.payload,typeof Te=="function"){de=Te.call(ke,de,ae);break e}de=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Le.payload,ae=typeof Te=="function"?Te.call(ke,de,ae):Te,ae==null)break e;de=z({},de,ae);break e;case 2:ki=!0}}j.callback!==null&&j.lane!==0&&(i.flags|=64,ae=g.effects,ae===null?g.effects=[j]:ae.push(j))}else ke={eventTime:ke,lane:ae,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ce===null?(J=ce=ke,B=de):ce=ce.next=ke,_|=ae;if(j=j.next,j===null){if(j=g.shared.pending,j===null)break;ae=j,j=ae.next,ae.next=null,g.lastBaseUpdate=ae,g.shared.pending=null}}while(!0);if(ce===null&&(B=de),g.baseState=B,g.firstBaseUpdate=J,g.lastBaseUpdate=ce,s=g.shared.interleaved,s!==null){g=s;do _|=g.lane,g=g.next;while(g!==s)}else b===null&&(g.shared.lanes=0);xo|=_,i.lanes=_,i.memoizedState=de}}function Fy(i,s,c){if(i=s.effects,s.effects=null,i!==null)for(s=0;s<i.length;s++){var f=i[s],g=f.callback;if(g!==null){if(f.callback=null,f=c,typeof g!="function")throw Error(r(191,g));g.call(f)}}}var Pa={},kn=Si(Pa),Da=Si(Pa),ja=Si(Pa);function yo(i){if(i===Pa)throw Error(r(174));return i}function jf(i,s){switch(xt(ja,s),xt(Da,i),xt(kn,Pa),i=s.nodeType,i){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:jt(null,"");break;default:i=i===8?s.parentNode:s,s=i.namespaceURI||null,i=i.tagName,s=jt(s,i)}Et(kn),xt(kn,s)}function gs(){Et(kn),Et(Da),Et(ja)}function By(i){yo(ja.current);var s=yo(kn.current),c=jt(s,i.type);s!==c&&(xt(Da,i),xt(kn,c))}function Mf(i){Da.current===i&&(Et(kn),Et(Da))}var $t=Si(0);function $c(i){for(var s=i;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var zf=[];function Ff(){for(var i=0;i<zf.length;i++)zf[i]._workInProgressVersionPrimary=null;zf.length=0}var Ac=A.ReactCurrentDispatcher,Bf=A.ReactCurrentBatchConfig,bo=0,At=null,Ht=null,Jt=null,Tc=!1,Ma=!1,za=0,M$=0;function lr(){throw Error(r(321))}function Uf(i,s){if(s===null)return!1;for(var c=0;c<s.length&&c<i.length;c++)if(!an(i[c],s[c]))return!1;return!0}function Vf(i,s,c,f,g,b){if(bo=b,At=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Ac.current=i===null||i.memoizedState===null?U$:V$,i=c(f,g),Ma){b=0;do{if(Ma=!1,za=0,25<=b)throw Error(r(301));b+=1,Jt=Ht=null,s.updateQueue=null,Ac.current=W$,i=c(f,g)}while(Ma)}if(Ac.current=Oc,s=Ht!==null&&Ht.next!==null,bo=0,Jt=Ht=At=null,Tc=!1,s)throw Error(r(300));return i}function Wf(){var i=za!==0;return za=0,i}function Rn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?At.memoizedState=Jt=i:Jt=Jt.next=i,Jt}function Hr(){if(Ht===null){var i=At.alternate;i=i!==null?i.memoizedState:null}else i=Ht.next;var s=Jt===null?At.memoizedState:Jt.next;if(s!==null)Jt=s,Ht=i;else{if(i===null)throw Error(r(310));Ht=i,i={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Jt===null?At.memoizedState=Jt=i:Jt=Jt.next=i}return Jt}function Fa(i,s){return typeof s=="function"?s(i):s}function Hf(i){var s=Hr(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=Ht,g=f.baseQueue,b=c.pending;if(b!==null){if(g!==null){var _=g.next;g.next=b.next,b.next=_}f.baseQueue=g=b,c.pending=null}if(g!==null){b=g.next,f=f.baseState;var j=_=null,B=null,J=b;do{var ce=J.lane;if((bo&ce)===ce)B!==null&&(B=B.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),f=J.hasEagerState?J.eagerState:i(f,J.action);else{var de={lane:ce,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};B===null?(j=B=de,_=f):B=B.next=de,At.lanes|=ce,xo|=ce}J=J.next}while(J!==null&&J!==b);B===null?_=f:B.next=j,an(f,s.memoizedState)||(xr=!0),s.memoizedState=f,s.baseState=_,s.baseQueue=B,c.lastRenderedState=f}if(i=c.interleaved,i!==null){g=i;do b=g.lane,At.lanes|=b,xo|=b,g=g.next;while(g!==i)}else g===null&&(c.lanes=0);return[s.memoizedState,c.dispatch]}function qf(i){var s=Hr(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,g=c.pending,b=s.memoizedState;if(g!==null){c.pending=null;var _=g=g.next;do b=i(b,_.action),_=_.next;while(_!==g);an(b,s.memoizedState)||(xr=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),c.lastRenderedState=b}return[b,f]}function Uy(){}function Vy(i,s){var c=At,f=Hr(),g=s(),b=!an(f.memoizedState,g);if(b&&(f.memoizedState=g,xr=!0),f=f.queue,Gf(qy.bind(null,c,f,i),[i]),f.getSnapshot!==s||b||Jt!==null&&Jt.memoizedState.tag&1){if(c.flags|=2048,Ba(9,Hy.bind(null,c,f,g,s),void 0,null),Zt===null)throw Error(r(349));(bo&30)!==0||Wy(c,s,g)}return g}function Wy(i,s,c){i.flags|=16384,i={getSnapshot:s,value:c},s=At.updateQueue,s===null?(s={lastEffect:null,stores:null},At.updateQueue=s,s.stores=[i]):(c=s.stores,c===null?s.stores=[i]:c.push(i))}function Hy(i,s,c,f){s.value=c,s.getSnapshot=f,Gy(s)&&Xy(i)}function qy(i,s,c){return c(function(){Gy(s)&&Xy(i)})}function Gy(i){var s=i.getSnapshot;i=i.value;try{var c=s();return!an(i,c)}catch{return!0}}function Xy(i){var s=qn(i,1);s!==null&&fn(s,i,1,-1)}function Yy(i){var s=Rn();return typeof i=="function"&&(i=i()),s.memoizedState=s.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:i},s.queue=i,i=i.dispatch=B$.bind(null,At,i),[s.memoizedState,i]}function Ba(i,s,c,f){return i={tag:i,create:s,destroy:c,deps:f,next:null},s=At.updateQueue,s===null?(s={lastEffect:null,stores:null},At.updateQueue=s,s.lastEffect=i.next=i):(c=s.lastEffect,c===null?s.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,s.lastEffect=i)),i}function Ky(){return Hr().memoizedState}function Lc(i,s,c,f){var g=Rn();At.flags|=i,g.memoizedState=Ba(1|s,c,void 0,f===void 0?null:f)}function Ic(i,s,c,f){var g=Hr();f=f===void 0?null:f;var b=void 0;if(Ht!==null){var _=Ht.memoizedState;if(b=_.destroy,f!==null&&Uf(f,_.deps)){g.memoizedState=Ba(s,c,b,f);return}}At.flags|=i,g.memoizedState=Ba(1|s,c,b,f)}function Qy(i,s){return Lc(8390656,8,i,s)}function Gf(i,s){return Ic(2048,8,i,s)}function Jy(i,s){return Ic(4,2,i,s)}function Zy(i,s){return Ic(4,4,i,s)}function e0(i,s){if(typeof s=="function")return i=i(),s(i),function(){s(null)};if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function t0(i,s,c){return c=c!=null?c.concat([i]):null,Ic(4,4,e0.bind(null,s,i),c)}function Xf(){}function r0(i,s){var c=Hr();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&Uf(s,f[1])?f[0]:(c.memoizedState=[i,s],i)}function n0(i,s){var c=Hr();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&Uf(s,f[1])?f[0]:(i=i(),c.memoizedState=[i,s],i)}function i0(i,s,c){return(bo&21)===0?(i.baseState&&(i.baseState=!1,xr=!0),i.memoizedState=c):(an(c,s)||(c=fa(),At.lanes|=c,xo|=c,i.baseState=!0),s)}function z$(i,s){var c=it;it=c!==0&&4>c?c:4,i(!0);var f=Bf.transition;Bf.transition={};try{i(!1),s()}finally{it=c,Bf.transition=f}}function o0(){return Hr().memoizedState}function F$(i,s,c){var f=Ti(i);if(c={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null},s0(i))a0(s,c);else if(c=jy(i,s,c,f),c!==null){var g=pr();fn(c,i,f,g),l0(c,s,f)}}function B$(i,s,c){var f=Ti(i),g={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null};if(s0(i))a0(s,g);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var _=s.lastRenderedState,j=b(_,c);if(g.hasEagerState=!0,g.eagerState=j,an(j,_)){var B=s.interleaved;B===null?(g.next=g,Pf(s)):(g.next=B.next,B.next=g),s.interleaved=g;return}}catch{}c=jy(i,s,g,f),c!==null&&(g=pr(),fn(c,i,f,g),l0(c,s,f))}}function s0(i){var s=i.alternate;return i===At||s!==null&&s===At}function a0(i,s){Ma=Tc=!0;var c=i.pending;c===null?s.next=s:(s.next=c.next,c.next=s),i.pending=s}function l0(i,s,c){if((c&4194240)!==0){var f=s.lanes;f&=i.pendingLanes,c|=f,s.lanes=c,Ko(i,c)}}var Oc={readContext:Wr,useCallback:lr,useContext:lr,useEffect:lr,useImperativeHandle:lr,useInsertionEffect:lr,useLayoutEffect:lr,useMemo:lr,useReducer:lr,useRef:lr,useState:lr,useDebugValue:lr,useDeferredValue:lr,useTransition:lr,useMutableSource:lr,useSyncExternalStore:lr,useId:lr,unstable_isNewReconciler:!1},U$={readContext:Wr,useCallback:function(i,s){return Rn().memoizedState=[i,s===void 0?null:s],i},useContext:Wr,useEffect:Qy,useImperativeHandle:function(i,s,c){return c=c!=null?c.concat([i]):null,Lc(4194308,4,e0.bind(null,s,i),c)},useLayoutEffect:function(i,s){return Lc(4194308,4,i,s)},useInsertionEffect:function(i,s){return Lc(4,2,i,s)},useMemo:function(i,s){var c=Rn();return s=s===void 0?null:s,i=i(),c.memoizedState=[i,s],i},useReducer:function(i,s,c){var f=Rn();return s=c!==void 0?c(s):s,f.memoizedState=f.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},f.queue=i,i=i.dispatch=F$.bind(null,At,i),[f.memoizedState,i]},useRef:function(i){var s=Rn();return i={current:i},s.memoizedState=i},useState:Yy,useDebugValue:Xf,useDeferredValue:function(i){return Rn().memoizedState=i},useTransition:function(){var i=Yy(!1),s=i[0];return i=z$.bind(null,i[1]),Rn().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,c){var f=At,g=Rn();if(kt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),Zt===null)throw Error(r(349));(bo&30)!==0||Wy(f,s,c)}g.memoizedState=c;var b={value:c,getSnapshot:s};return g.queue=b,Qy(qy.bind(null,f,b,i),[i]),f.flags|=2048,Ba(9,Hy.bind(null,f,b,c,s),void 0,null),c},useId:function(){var i=Rn(),s=Zt.identifierPrefix;if(kt){var c=Hn,f=Wn;c=(f&~(1<<32-vr(f)-1)).toString(32)+c,s=":"+s+"R"+c,c=za++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=M$++,s=":"+s+"r"+c.toString(32)+":";return i.memoizedState=s},unstable_isNewReconciler:!1},V$={readContext:Wr,useCallback:r0,useContext:Wr,useEffect:Gf,useImperativeHandle:t0,useInsertionEffect:Jy,useLayoutEffect:Zy,useMemo:n0,useReducer:Hf,useRef:Ky,useState:function(){return Hf(Fa)},useDebugValue:Xf,useDeferredValue:function(i){var s=Hr();return i0(s,Ht.memoizedState,i)},useTransition:function(){var i=Hf(Fa)[0],s=Hr().memoizedState;return[i,s]},useMutableSource:Uy,useSyncExternalStore:Vy,useId:o0,unstable_isNewReconciler:!1},W$={readContext:Wr,useCallback:r0,useContext:Wr,useEffect:Gf,useImperativeHandle:t0,useInsertionEffect:Jy,useLayoutEffect:Zy,useMemo:n0,useReducer:qf,useRef:Ky,useState:function(){return qf(Fa)},useDebugValue:Xf,useDeferredValue:function(i){var s=Hr();return Ht===null?s.memoizedState=i:i0(s,Ht.memoizedState,i)},useTransition:function(){var i=qf(Fa)[0],s=Hr().memoizedState;return[i,s]},useMutableSource:Uy,useSyncExternalStore:Vy,useId:o0,unstable_isNewReconciler:!1};function cn(i,s){if(i&&i.defaultProps){s=z({},s),i=i.defaultProps;for(var c in i)s[c]===void 0&&(s[c]=i[c]);return s}return s}function Yf(i,s,c,f){s=i.memoizedState,c=c(f,s),c=c==null?s:z({},s,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Nc={isMounted:function(i){return(i=i._reactInternals)?Bn(i)===i:!1},enqueueSetState:function(i,s,c){i=i._reactInternals;var f=pr(),g=Ti(i),b=Gn(f,g);b.payload=s,c!=null&&(b.callback=c),s=Ri(i,b,g),s!==null&&(fn(s,i,g,f),Rc(s,i,g))},enqueueReplaceState:function(i,s,c){i=i._reactInternals;var f=pr(),g=Ti(i),b=Gn(f,g);b.tag=1,b.payload=s,c!=null&&(b.callback=c),s=Ri(i,b,g),s!==null&&(fn(s,i,g,f),Rc(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var c=pr(),f=Ti(i),g=Gn(c,f);g.tag=2,s!=null&&(g.callback=s),s=Ri(i,g,f),s!==null&&(fn(s,i,f,c),Rc(s,i,f))}};function c0(i,s,c,f,g,b,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,b,_):s.prototype&&s.prototype.isPureReactComponent?!_a(c,f)||!_a(g,b):!0}function u0(i,s,c){var f=!1,g=Ei,b=s.contextType;return typeof b=="object"&&b!==null?b=Wr(b):(g=br(s)?ho:ar.current,f=s.contextTypes,b=(f=f!=null)?cs(i,g):Ei),s=new s(c,b),i.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Nc,i.stateNode=s,s._reactInternals=i,f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=b),s}function d0(i,s,c,f){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,f),s.state!==i&&Nc.enqueueReplaceState(s,s.state,null)}function Kf(i,s,c,f){var g=i.stateNode;g.props=c,g.state=i.memoizedState,g.refs={},Df(i);var b=s.contextType;typeof b=="object"&&b!==null?g.context=Wr(b):(b=br(s)?ho:ar.current,g.context=cs(i,b)),g.state=i.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(Yf(i,s,b,c),g.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(s=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),s!==g.state&&Nc.enqueueReplaceState(g,g.state,null),_c(i,c,g,f),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function vs(i,s){try{var c="",f=s;do c+=G(f),f=f.return;while(f);var g=c}catch(b){g=`
8
+ `+g[_].replace(" at new "," at ");return i.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",i.displayName)),B}while(1<=_&&0<=j);break}}}finally{te=!1,Error.prepareStackTrace=c}return(i=i?i.displayName||i.name:"")?M(i):""}function G(i){switch(i.tag){case 5:return M(i.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return i=le(i.type,!1),i;case 11:return i=le(i.type.render,!1),i;case 1:return i=le(i.type,!0),i;default:return""}}function fe(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case P:return"Fragment";case N:return"Portal";case re:return"Profiler";case I:return"StrictMode";case X:return"Suspense";case F:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case ee:return(i.displayName||"Context")+".Consumer";case Z:return(i._context.displayName||"Context")+".Provider";case ne:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return s=i.displayName||null,s!==null?s:fe(i.type)||"Memo";case H:s=i._payload,i=i._init;try{return fe(i(s))}catch{}}return null}function be(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(s);case 8:return s===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function pe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ue(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ge(i){var s=ue(i)?"checked":"value",c=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),f=""+i[s];if(!i.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var g=c.get,b=c.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return g.call(this)},set:function(_){f=""+_,b.call(this,_)}}),Object.defineProperty(i,s,{enumerable:c.enumerable}),{getValue:function(){return f},setValue:function(_){f=""+_},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function qe(i){i._valueTracker||(i._valueTracker=ge(i))}function Xe(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var c=s.getValue(),f="";return i&&(f=ue(i)?i.checked?"true":"false":i.value),i=f,i!==c?(s.setValue(i),!0):!1}function we(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ze(i,s){var c=s.checked;return z({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??i._wrapperState.initialChecked})}function We(i,s){var c=s.defaultValue==null?"":s.defaultValue,f=s.checked!=null?s.checked:s.defaultChecked;c=pe(s.value!=null?s.value:c),i._wrapperState={initialChecked:f,initialValue:c,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(i,s){s=s.checked,s!=null&&$(i,"checked",s,!1)}function De(i,s){tt(i,s);var c=pe(s.value),f=s.type;if(c!=null)f==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+c):i.value!==""+c&&(i.value=""+c);else if(f==="submit"||f==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?ct(i,s.type,c):s.hasOwnProperty("defaultValue")&&ct(i,s.type,pe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function Fe(i,s,c){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var f=s.type;if(!(f!=="submit"&&f!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,c||s===i.value||(i.value=s),i.defaultValue=s}c=i.name,c!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,c!==""&&(i.name=c)}function ct(i,s,c){(s!=="number"||we(i.ownerDocument)!==i)&&(c==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+c&&(i.defaultValue=""+c))}var Ne=Array.isArray;function oe(i,s,c,f){if(i=i.options,s){s={};for(var g=0;g<c.length;g++)s["$"+c[g]]=!0;for(c=0;c<i.length;c++)g=s.hasOwnProperty("$"+i[c].value),i[c].selected!==g&&(i[c].selected=g),g&&f&&(i[c].defaultSelected=!0)}else{for(c=""+pe(c),s=null,g=0;g<i.length;g++){if(i[g].value===c){i[g].selected=!0,f&&(i[g].defaultSelected=!0);return}s!==null||i[g].disabled||(s=i[g])}s!==null&&(s.selected=!0)}}function Se(i,s){if(s.dangerouslySetInnerHTML!=null)throw Error(r(91));return z({},s,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Je(i,s){var c=s.value;if(c==null){if(c=s.children,s=s.defaultValue,c!=null){if(s!=null)throw Error(r(92));if(Ne(c)){if(1<c.length)throw Error(r(93));c=c[0]}s=c}s==null&&(s=""),c=s}i._wrapperState={initialValue:pe(c)}}function ht(i,s){var c=pe(s.value),f=pe(s.defaultValue);c!=null&&(c=""+c,c!==i.value&&(i.value=c),s.defaultValue==null&&i.defaultValue!==c&&(i.defaultValue=c)),f!=null&&(i.defaultValue=""+f)}function Ut(i){var s=i.textContent;s===i._wrapperState.initialValue&&s!==""&&s!==null&&(i.value=s)}function Vt(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jt(i,s){return i==null||i==="http://www.w3.org/1999/xhtml"?Vt(s):i==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Wt,bt=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,c,f,g){MSApp.execUnsafeLocalFunction(function(){return i(s,c,f,g)})}:i})(function(i,s){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=s;else{for(Wt=Wt||document.createElement("div"),Wt.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Wt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function rt(i,s){if(s){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=s;return}}i.textContent=s}var q={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Q=["Webkit","ms","Moz","O"];Object.keys(q).forEach(function(i){Q.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),q[s]=q[i]})});function ie(i,s,c){return s==null||typeof s=="boolean"||s===""?"":c||typeof s!="number"||s===0||q.hasOwnProperty(i)&&q[i]?(""+s).trim():s+"px"}function se(i,s){i=i.style;for(var c in s)if(s.hasOwnProperty(c)){var f=c.indexOf("--")===0,g=ie(c,s[c],f);c==="float"&&(c="cssFloat"),f?i.setProperty(c,g):i[c]=g}}var Ce=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ve(i,s){if(s){if(Ce[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function Qe(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pe=null;function he(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ve=null,ye=null,xe=null;function Ue(i){if(i=Oa(i)){if(typeof ve!="function")throw Error(r(280));var s=i.stateNode;s&&(s=gc(s),ve(i.stateNode,i.type,s))}}function Ze(i){ye?xe?xe.push(i):xe=[i]:ye=i}function dt(){if(ye){var i=ye,s=xe;if(xe=ye=null,Ue(i),s)for(i=0;i<s.length;i++)Ue(s[i])}}function Ht(i,s){return i(s)}function Zr(){}var en=!1;function hi(i,s,c){if(en)return i(s,c);en=!0;try{return Ht(i,s,c)}finally{en=!1,(ye!==null||xe!==null)&&(Zr(),dt())}}function wn(i,s){var c=i.stateNode;if(c===null)return null;var f=gc(c);if(f===null)return null;c=f[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,s,typeof c));return c}var tn=!1;if(u)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){tn=!0}}),window.addEventListener("test",Sn,Sn),window.removeEventListener("test",Sn,Sn)}catch{tn=!1}function sa(i,s,c,f,g,b,_,j,B){var J=Array.prototype.slice.call(arguments,3);try{s.apply(c,J)}catch(ce){this.onError(ce)}}var En=!1,Ho=null,to=!1,aa=null,qo={onError:function(i){En=!0,Ho=i}};function Go(i,s,c,f,g,b,_,j,B){En=!1,Ho=null,sa.apply(qo,arguments)}function Fl(i,s,c,f,g,b,_,j,B){if(Go.apply(this,arguments),En){if(En){var J=Ho;En=!1,Ho=null}else throw Error(r(198));to||(to=!0,aa=J)}}function Bn(i){var s=i,c=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(c=s.return),i=s.return;while(i)}return s.tag===3?c:null}function la(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function Bl(i){if(Bn(i)!==i)throw Error(r(188))}function ro(i){var s=i.alternate;if(!s){if(s=Bn(i),s===null)throw Error(r(188));return s!==i?null:i}for(var c=i,f=s;;){var g=c.return;if(g===null)break;var b=g.alternate;if(b===null){if(f=g.return,f!==null){c=f;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===c)return Bl(g),i;if(b===f)return Bl(g),s;b=b.sibling}throw Error(r(188))}if(c.return!==f.return)c=g,f=b;else{for(var _=!1,j=g.child;j;){if(j===c){_=!0,c=g,f=b;break}if(j===f){_=!0,f=g,c=b;break}j=j.sibling}if(!_){for(j=b.child;j;){if(j===c){_=!0,c=b,f=g;break}if(j===f){_=!0,f=b,c=g;break}j=j.sibling}if(!_)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:s}function ca(i){return i=ro(i),i!==null?Ae(i):null}function Ae(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var s=Ae(i);if(s!==null)return s;i=i.sibling}return null}var Ul=t.unstable_scheduleCallback,Br=t.unstable_cancelCallback,Vl=t.unstable_shouldYield,Wl=t.unstable_requestPaint,Ct=t.unstable_now,Hl=t.unstable_getCurrentPriorityLevel,Xo=t.unstable_ImmediatePriority,ua=t.unstable_UserBlockingPriority,no=t.unstable_NormalPriority,ql=t.unstable_LowPriority,da=t.unstable_IdlePriority,io=null,Ir=null;function Gl(i){if(Ir&&typeof Ir.onCommitFiberRoot=="function")try{Ir.onCommitFiberRoot(io,i,void 0,(i.current.flags&128)===128)}catch{}}var vr=Math.clz32?Math.clz32:Kl,Xl=Math.log,Yl=Math.LN2;function Kl(i){return i>>>=0,i===0?32:31-(Xl(i)/Yl|0)|0}var oo=64,so=4194304;function mi(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ao(i,s){var c=i.pendingLanes;if(c===0)return 0;var f=0,g=i.suspendedLanes,b=i.pingedLanes,_=c&268435455;if(_!==0){var j=_&~g;j!==0?f=mi(j):(b&=_,b!==0&&(f=mi(b)))}else _=c&~g,_!==0?f=mi(_):b!==0&&(f=mi(b));if(f===0)return 0;if(s!==0&&s!==f&&(s&g)===0&&(g=f&-f,b=s&-s,g>=b||g===16&&(b&4194240)!==0))return s;if((f&4)!==0&&(f|=c&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=f;0<s;)c=31-vr(s),g=1<<c,f|=i[c],s&=~g;return f}function Ql(i,s){switch(i){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jl(i,s){for(var c=i.suspendedLanes,f=i.pingedLanes,g=i.expirationTimes,b=i.pendingLanes;0<b;){var _=31-vr(b),j=1<<_,B=g[_];B===-1?((j&c)===0||(j&f)!==0)&&(g[_]=Ql(j,s)):B<=s&&(i.expiredLanes|=j),b&=~j}}function lo(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function fa(){var i=oo;return oo<<=1,(oo&4194240)===0&&(oo=64),i}function Yo(i){for(var s=[],c=0;31>c;c++)s.push(i);return s}function gi(i,s,c){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-vr(s),i[s]=c}function Zl(i,s){var c=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var f=i.eventTimes;for(i=i.expirationTimes;0<c;){var g=31-vr(c),b=1<<g;s[g]=0,f[g]=-1,i[g]=-1,c&=~b}}function Ko(i,s){var c=i.entangledLanes|=s;for(i=i.entanglements;c;){var f=31-vr(c),g=1<<f;g&s|i[f]&s&&(i[f]|=s),c&=~g}}var it=0;function pa(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var ha,Qo,ma,ga,va,Jo=!1,co=[],rn=null,nn=null,on=null,yi=new Map,bi=new Map,sn=[],ec="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Zo(i,s){switch(i){case"focusin":case"focusout":rn=null;break;case"dragenter":case"dragleave":nn=null;break;case"mouseover":case"mouseout":on=null;break;case"pointerover":case"pointerout":yi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":bi.delete(s.pointerId)}}function uo(i,s,c,f,g,b){return i===null||i.nativeEvent!==b?(i={blockedOn:s,domEventName:c,eventSystemFlags:f,nativeEvent:b,targetContainers:[g]},s!==null&&(s=Oa(s),s!==null&&Qo(s)),i):(i.eventSystemFlags|=f,s=i.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),i)}function tc(i,s,c,f,g){switch(s){case"focusin":return rn=uo(rn,i,s,c,f,g),!0;case"dragenter":return nn=uo(nn,i,s,c,f,g),!0;case"mouseover":return on=uo(on,i,s,c,f,g),!0;case"pointerover":var b=g.pointerId;return yi.set(b,uo(yi.get(b)||null,i,s,c,f,g)),!0;case"gotpointercapture":return b=g.pointerId,bi.set(b,uo(bi.get(b)||null,i,s,c,f,g)),!0}return!1}function ya(i){var s=po(i.target);if(s!==null){var c=Bn(s);if(c!==null){if(s=c.tag,s===13){if(s=la(c),s!==null){i.blockedOn=s,va(i.priority,function(){ma(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function fo(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var c=ef(i.domEventName,i.eventSystemFlags,s[0],i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);Pe=f,c.target.dispatchEvent(f),Pe=null}else return s=Oa(c),s!==null&&Qo(s),i.blockedOn=c,!1;s.shift()}return!0}function ba(i,s,c){fo(i)&&c.delete(s)}function rc(){Jo=!1,rn!==null&&fo(rn)&&(rn=null),nn!==null&&fo(nn)&&(nn=null),on!==null&&fo(on)&&(on=null),yi.forEach(ba),bi.forEach(ba)}function xa(i,s){i.blockedOn===s&&(i.blockedOn=null,Jo||(Jo=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,rc)))}function wa(i){function s(g){return xa(g,i)}if(0<co.length){xa(co[0],i);for(var c=1;c<co.length;c++){var f=co[c];f.blockedOn===i&&(f.blockedOn=null)}}for(rn!==null&&xa(rn,i),nn!==null&&xa(nn,i),on!==null&&xa(on,i),yi.forEach(s),bi.forEach(s),c=0;c<sn.length;c++)f=sn[c],f.blockedOn===i&&(f.blockedOn=null);for(;0<sn.length&&(c=sn[0],c.blockedOn===null);)ya(c),c.blockedOn===null&&sn.shift()}var es=A.ReactCurrentBatchConfig,nc=!0;function H_(i,s,c,f){var g=it,b=es.transition;es.transition=null;try{it=1,Zd(i,s,c,f)}finally{it=g,es.transition=b}}function q_(i,s,c,f){var g=it,b=es.transition;es.transition=null;try{it=4,Zd(i,s,c,f)}finally{it=g,es.transition=b}}function Zd(i,s,c,f){if(nc){var g=ef(i,s,c,f);if(g===null)yf(i,s,f,ic,c),Zo(i,f);else if(tc(g,i,s,c,f))f.stopPropagation();else if(Zo(i,f),s&4&&-1<ec.indexOf(i)){for(;g!==null;){var b=Oa(g);if(b!==null&&ha(b),b=ef(i,s,c,f),b===null&&yf(i,s,f,ic,c),b===g)break;g=b}g!==null&&f.stopPropagation()}else yf(i,s,f,null,c)}}var ic=null;function ef(i,s,c,f){if(ic=null,i=he(f),i=po(i),i!==null)if(s=Bn(i),s===null)i=null;else if(c=s.tag,c===13){if(i=la(s),i!==null)return i;i=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null);return ic=i,null}function Vv(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Hl()){case Xo:return 1;case ua:return 4;case no:case ql:return 16;case da:return 536870912;default:return 16}default:return 16}}var xi=null,tf=null,oc=null;function Wv(){if(oc)return oc;var i,s=tf,c=s.length,f,g="value"in xi?xi.value:xi.textContent,b=g.length;for(i=0;i<c&&s[i]===g[i];i++);var _=c-i;for(f=1;f<=_&&s[c-f]===g[b-f];f++);return oc=g.slice(i,1<f?1-f:void 0)}function sc(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function ac(){return!0}function Hv(){return!1}function Or(i){function s(c,f,g,b,_){this._reactName=c,this._targetInst=g,this.type=f,this.nativeEvent=b,this.target=_,this.currentTarget=null;for(var j in i)i.hasOwnProperty(j)&&(c=i[j],this[j]=c?c(b):b[j]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?ac:Hv,this.isPropagationStopped=Hv,this}return z(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=ac)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=ac)},persist:function(){},isPersistent:ac}),s}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rf=Or(ts),Sa=z({},ts,{view:0,detail:0}),G_=Or(Sa),nf,of,Ea,lc=z({},Sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:af,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ea&&(Ea&&i.type==="mousemove"?(nf=i.screenX-Ea.screenX,of=i.screenY-Ea.screenY):of=nf=0,Ea=i),nf)},movementY:function(i){return"movementY"in i?i.movementY:of}}),qv=Or(lc),X_=z({},lc,{dataTransfer:0}),Y_=Or(X_),K_=z({},Sa,{relatedTarget:0}),sf=Or(K_),Q_=z({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),J_=Or(Q_),Z_=z({},ts,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),e$=Or(Z_),t$=z({},ts,{data:0}),Gv=Or(t$),r$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n$={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},i$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o$(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=i$[i])?!!s[i]:!1}function af(){return o$}var s$=z({},Sa,{key:function(i){if(i.key){var s=r$[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=sc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?n$[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:af,charCode:function(i){return i.type==="keypress"?sc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?sc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),a$=Or(s$),l$=z({},lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xv=Or(l$),c$=z({},Sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:af}),u$=Or(c$),d$=z({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),f$=Or(d$),p$=z({},lc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),h$=Or(p$),m$=[9,13,27,32],lf=u&&"CompositionEvent"in window,Ca=null;u&&"documentMode"in document&&(Ca=document.documentMode);var g$=u&&"TextEvent"in window&&!Ca,Yv=u&&(!lf||Ca&&8<Ca&&11>=Ca),Kv=" ",Qv=!1;function Jv(i,s){switch(i){case"keyup":return m$.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var rs=!1;function v$(i,s){switch(i){case"compositionend":return Zv(s);case"keypress":return s.which!==32?null:(Qv=!0,Kv);case"textInput":return i=s.data,i===Kv&&Qv?null:i;default:return null}}function y$(i,s){if(rs)return i==="compositionend"||!lf&&Jv(i,s)?(i=Wv(),oc=tf=xi=null,rs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Yv&&s.locale!=="ko"?null:s.data;default:return null}}var b$={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ey(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!b$[i.type]:s==="textarea"}function ty(i,s,c,f){Ze(f),s=pc(s,"onChange"),0<s.length&&(c=new rf("onChange","change",null,c,f),i.push({event:c,listeners:s}))}var ka=null,Ra=null;function x$(i){by(i,0)}function cc(i){var s=as(i);if(Xe(s))return i}function w$(i,s){if(i==="change")return s}var ry=!1;if(u){var cf;if(u){var uf="oninput"in document;if(!uf){var ny=document.createElement("div");ny.setAttribute("oninput","return;"),uf=typeof ny.oninput=="function"}cf=uf}else cf=!1;ry=cf&&(!document.documentMode||9<document.documentMode)}function iy(){ka&&(ka.detachEvent("onpropertychange",oy),Ra=ka=null)}function oy(i){if(i.propertyName==="value"&&cc(Ra)){var s=[];ty(s,Ra,i,he(i)),hi(x$,s)}}function S$(i,s,c){i==="focusin"?(iy(),ka=s,Ra=c,ka.attachEvent("onpropertychange",oy)):i==="focusout"&&iy()}function E$(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return cc(Ra)}function C$(i,s){if(i==="click")return cc(s)}function k$(i,s){if(i==="input"||i==="change")return cc(s)}function R$(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var an=typeof Object.is=="function"?Object.is:R$;function _a(i,s){if(an(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var c=Object.keys(i),f=Object.keys(s);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var g=c[f];if(!d.call(s,g)||!an(i[g],s[g]))return!1}return!0}function sy(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ay(i,s){var c=sy(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=s&&f>=s)return{node:c,offset:s-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=sy(c)}}function ly(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?ly(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function cy(){for(var i=window,s=we();s instanceof i.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)i=s.contentWindow;else break;s=we(i.document)}return s}function df(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function _$(i){var s=cy(),c=i.focusedElem,f=i.selectionRange;if(s!==c&&c&&c.ownerDocument&&ly(c.ownerDocument.documentElement,c)){if(f!==null&&df(c)){if(s=f.start,i=f.end,i===void 0&&(i=s),"selectionStart"in c)c.selectionStart=s,c.selectionEnd=Math.min(i,c.value.length);else if(i=(s=c.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var g=c.textContent.length,b=Math.min(f.start,g);f=f.end===void 0?b:Math.min(f.end,g),!i.extend&&b>f&&(g=f,f=b,b=g),g=ay(c,b);var _=ay(c,f);g&&_&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==_.node||i.focusOffset!==_.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),i.removeAllRanges(),b>f?(i.addRange(s),i.extend(_.node,_.offset)):(s.setEnd(_.node,_.offset),i.addRange(s)))}}for(s=[],i=c;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<s.length;c++)i=s[c],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var $$=u&&"documentMode"in document&&11>=document.documentMode,ns=null,ff=null,$a=null,pf=!1;function uy(i,s,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;pf||ns==null||ns!==we(f)||(f=ns,"selectionStart"in f&&df(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),$a&&_a($a,f)||($a=f,f=pc(ff,"onSelect"),0<f.length&&(s=new rf("onSelect","select",null,s,c),i.push({event:s,listeners:f}),s.target=ns)))}function uc(i,s){var c={};return c[i.toLowerCase()]=s.toLowerCase(),c["Webkit"+i]="webkit"+s,c["Moz"+i]="moz"+s,c}var is={animationend:uc("Animation","AnimationEnd"),animationiteration:uc("Animation","AnimationIteration"),animationstart:uc("Animation","AnimationStart"),transitionend:uc("Transition","TransitionEnd")},hf={},dy={};u&&(dy=document.createElement("div").style,"AnimationEvent"in window||(delete is.animationend.animation,delete is.animationiteration.animation,delete is.animationstart.animation),"TransitionEvent"in window||delete is.transitionend.transition);function dc(i){if(hf[i])return hf[i];if(!is[i])return i;var s=is[i],c;for(c in s)if(s.hasOwnProperty(c)&&c in dy)return hf[i]=s[c];return i}var fy=dc("animationend"),py=dc("animationiteration"),hy=dc("animationstart"),my=dc("transitionend"),gy=new Map,vy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function wi(i,s){gy.set(i,s),a(s,[i])}for(var mf=0;mf<vy.length;mf++){var gf=vy[mf],A$=gf.toLowerCase(),T$=gf[0].toUpperCase()+gf.slice(1);wi(A$,"on"+T$)}wi(fy,"onAnimationEnd"),wi(py,"onAnimationIteration"),wi(hy,"onAnimationStart"),wi("dblclick","onDoubleClick"),wi("focusin","onFocus"),wi("focusout","onBlur"),wi(my,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Aa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),L$=new Set("cancel close invalid load scroll toggle".split(" ").concat(Aa));function yy(i,s,c){var f=i.type||"unknown-event";i.currentTarget=c,Fl(f,s,void 0,i),i.currentTarget=null}function by(i,s){s=(s&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],g=f.event;f=f.listeners;e:{var b=void 0;if(s)for(var _=f.length-1;0<=_;_--){var j=f[_],B=j.instance,J=j.currentTarget;if(j=j.listener,B!==b&&g.isPropagationStopped())break e;yy(g,j,J),b=B}else for(_=0;_<f.length;_++){if(j=f[_],B=j.instance,J=j.currentTarget,j=j.listener,B!==b&&g.isPropagationStopped())break e;yy(g,j,J),b=B}}}if(to)throw i=aa,to=!1,aa=null,i}function St(i,s){var c=s[Cf];c===void 0&&(c=s[Cf]=new Set);var f=i+"__bubble";c.has(f)||(xy(s,i,2,!1),c.add(f))}function vf(i,s,c){var f=0;s&&(f|=4),xy(c,i,f,s)}var fc="_reactListening"+Math.random().toString(36).slice(2);function Ta(i){if(!i[fc]){i[fc]=!0,n.forEach(function(c){c!=="selectionchange"&&(L$.has(c)||vf(c,!1,i),vf(c,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[fc]||(s[fc]=!0,vf("selectionchange",!1,s))}}function xy(i,s,c,f){switch(Vv(s)){case 1:var g=H_;break;case 4:g=q_;break;default:g=Zd}c=g.bind(null,s,c,i),g=void 0,!tn||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),f?g!==void 0?i.addEventListener(s,c,{capture:!0,passive:g}):i.addEventListener(s,c,!0):g!==void 0?i.addEventListener(s,c,{passive:g}):i.addEventListener(s,c,!1)}function yf(i,s,c,f,g){var b=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var _=f.tag;if(_===3||_===4){var j=f.stateNode.containerInfo;if(j===g||j.nodeType===8&&j.parentNode===g)break;if(_===4)for(_=f.return;_!==null;){var B=_.tag;if((B===3||B===4)&&(B=_.stateNode.containerInfo,B===g||B.nodeType===8&&B.parentNode===g))return;_=_.return}for(;j!==null;){if(_=po(j),_===null)return;if(B=_.tag,B===5||B===6){f=b=_;continue e}j=j.parentNode}}f=f.return}hi(function(){var J=b,ce=he(c),de=[];e:{var ae=gy.get(i);if(ae!==void 0){var ke=rf,Te=i;switch(i){case"keypress":if(sc(c)===0)break e;case"keydown":case"keyup":ke=a$;break;case"focusin":Te="focus",ke=sf;break;case"focusout":Te="blur",ke=sf;break;case"beforeblur":case"afterblur":ke=sf;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=qv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=Y_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=u$;break;case fy:case py:case hy:ke=J_;break;case my:ke=f$;break;case"scroll":ke=G_;break;case"wheel":ke=h$;break;case"copy":case"cut":case"paste":ke=e$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=Xv}var Le=(s&4)!==0,Nt=!Le&&i==="scroll",Y=Le?ae!==null?ae+"Capture":null:ae;Le=[];for(var W=J,K;W!==null;){K=W;var me=K.stateNode;if(K.tag===5&&me!==null&&(K=me,Y!==null&&(me=wn(W,Y),me!=null&&Le.push(La(W,me,K)))),Nt)break;W=W.return}0<Le.length&&(ae=new ke(ae,Te,null,c,ce),de.push({event:ae,listeners:Le}))}}if((s&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ke=i==="mouseout"||i==="pointerout",ae&&c!==Pe&&(Te=c.relatedTarget||c.fromElement)&&(po(Te)||Te[Un]))break e;if((ke||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,ke?(Te=c.relatedTarget||c.toElement,ke=J,Te=Te?po(Te):null,Te!==null&&(Nt=Bn(Te),Te!==Nt||Te.tag!==5&&Te.tag!==6)&&(Te=null)):(ke=null,Te=J),ke!==Te)){if(Le=qv,me="onMouseLeave",Y="onMouseEnter",W="mouse",(i==="pointerout"||i==="pointerover")&&(Le=Xv,me="onPointerLeave",Y="onPointerEnter",W="pointer"),Nt=ke==null?ae:as(ke),K=Te==null?ae:as(Te),ae=new Le(me,W+"leave",ke,c,ce),ae.target=Nt,ae.relatedTarget=K,me=null,po(ce)===J&&(Le=new Le(Y,W+"enter",Te,c,ce),Le.target=K,Le.relatedTarget=Nt,me=Le),Nt=me,ke&&Te)t:{for(Le=ke,Y=Te,W=0,K=Le;K;K=os(K))W++;for(K=0,me=Y;me;me=os(me))K++;for(;0<W-K;)Le=os(Le),W--;for(;0<K-W;)Y=os(Y),K--;for(;W--;){if(Le===Y||Y!==null&&Le===Y.alternate)break t;Le=os(Le),Y=os(Y)}Le=null}else Le=null;ke!==null&&wy(de,ae,ke,Le,!1),Te!==null&&Nt!==null&&wy(de,Nt,Te,Le,!0)}}e:{if(ae=J?as(J):window,ke=ae.nodeName&&ae.nodeName.toLowerCase(),ke==="select"||ke==="input"&&ae.type==="file")var Oe=w$;else if(ey(ae))if(ry)Oe=k$;else{Oe=E$;var je=S$}else(ke=ae.nodeName)&&ke.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Oe=C$);if(Oe&&(Oe=Oe(i,J))){ty(de,Oe,c,ce);break e}je&&je(i,ae,J),i==="focusout"&&(je=ae._wrapperState)&&je.controlled&&ae.type==="number"&&ct(ae,"number",ae.value)}switch(je=J?as(J):window,i){case"focusin":(ey(je)||je.contentEditable==="true")&&(ns=je,ff=J,$a=null);break;case"focusout":$a=ff=ns=null;break;case"mousedown":pf=!0;break;case"contextmenu":case"mouseup":case"dragend":pf=!1,uy(de,c,ce);break;case"selectionchange":if($$)break;case"keydown":case"keyup":uy(de,c,ce)}var Me;if(lf)e:{switch(i){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else rs?Jv(i,c)&&(Be="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Be="onCompositionStart");Be&&(Yv&&c.locale!=="ko"&&(rs||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&rs&&(Me=Wv()):(xi=ce,tf="value"in xi?xi.value:xi.textContent,rs=!0)),je=pc(J,Be),0<je.length&&(Be=new Gv(Be,i,null,c,ce),de.push({event:Be,listeners:je}),Me?Be.data=Me:(Me=Zv(c),Me!==null&&(Be.data=Me)))),(Me=g$?v$(i,c):y$(i,c))&&(J=pc(J,"onBeforeInput"),0<J.length&&(ce=new Gv("onBeforeInput","beforeinput",null,c,ce),de.push({event:ce,listeners:J}),ce.data=Me))}by(de,s)})}function La(i,s,c){return{instance:i,listener:s,currentTarget:c}}function pc(i,s){for(var c=s+"Capture",f=[];i!==null;){var g=i,b=g.stateNode;g.tag===5&&b!==null&&(g=b,b=wn(i,c),b!=null&&f.unshift(La(i,b,g)),b=wn(i,s),b!=null&&f.push(La(i,b,g))),i=i.return}return f}function os(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function wy(i,s,c,f,g){for(var b=s._reactName,_=[];c!==null&&c!==f;){var j=c,B=j.alternate,J=j.stateNode;if(B!==null&&B===f)break;j.tag===5&&J!==null&&(j=J,g?(B=wn(c,b),B!=null&&_.unshift(La(c,B,j))):g||(B=wn(c,b),B!=null&&_.push(La(c,B,j)))),c=c.return}_.length!==0&&i.push({event:s,listeners:_})}var I$=/\r\n?/g,O$=/\u0000|\uFFFD/g;function Sy(i){return(typeof i=="string"?i:""+i).replace(I$,`
9
+ `).replace(O$,"")}function hc(i,s,c){if(s=Sy(s),Sy(i)!==s&&c)throw Error(r(425))}function mc(){}var bf=null,xf=null;function wf(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Sf=typeof setTimeout=="function"?setTimeout:void 0,N$=typeof clearTimeout=="function"?clearTimeout:void 0,Ey=typeof Promise=="function"?Promise:void 0,P$=typeof queueMicrotask=="function"?queueMicrotask:typeof Ey<"u"?function(i){return Ey.resolve(null).then(i).catch(D$)}:Sf;function D$(i){setTimeout(function(){throw i})}function Ef(i,s){var c=s,f=0;do{var g=c.nextSibling;if(i.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"){if(f===0){i.removeChild(g),wa(s);return}f--}else c!=="$"&&c!=="$?"&&c!=="$!"||f++;c=g}while(c);wa(s)}function Si(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return i}function Cy(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"){if(s===0)return i;s--}else c==="/$"&&s++}i=i.previousSibling}return null}var ss=Math.random().toString(36).slice(2),Cn="__reactFiber$"+ss,Ia="__reactProps$"+ss,Un="__reactContainer$"+ss,Cf="__reactEvents$"+ss,j$="__reactListeners$"+ss,M$="__reactHandles$"+ss;function po(i){var s=i[Cn];if(s)return s;for(var c=i.parentNode;c;){if(s=c[Un]||c[Cn]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(i=Cy(i);i!==null;){if(c=i[Cn])return c;i=Cy(i)}return s}i=c,c=i.parentNode}return null}function Oa(i){return i=i[Cn]||i[Un],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function as(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(r(33))}function gc(i){return i[Ia]||null}var kf=[],ls=-1;function Ei(i){return{current:i}}function Et(i){0>ls||(i.current=kf[ls],kf[ls]=null,ls--)}function xt(i,s){ls++,kf[ls]=i.current,i.current=s}var Ci={},lr=Ei(Ci),yr=Ei(!1),ho=Ci;function cs(i,s){var c=i.type.contextTypes;if(!c)return Ci;var f=i.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===s)return f.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in c)g[b]=s[b];return f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=g),g}function br(i){return i=i.childContextTypes,i!=null}function vc(){Et(yr),Et(lr)}function ky(i,s,c){if(lr.current!==Ci)throw Error(r(168));xt(lr,s),xt(yr,c)}function Ry(i,s,c){var f=i.stateNode;if(s=s.childContextTypes,typeof f.getChildContext!="function")return c;f=f.getChildContext();for(var g in f)if(!(g in s))throw Error(r(108,be(i)||"Unknown",g));return z({},c,f)}function yc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ci,ho=lr.current,xt(lr,i),xt(yr,yr.current),!0}function _y(i,s,c){var f=i.stateNode;if(!f)throw Error(r(169));c?(i=Ry(i,s,ho),f.__reactInternalMemoizedMergedChildContext=i,Et(yr),Et(lr),xt(lr,i)):Et(yr),xt(yr,c)}var Vn=null,bc=!1,Rf=!1;function $y(i){Vn===null?Vn=[i]:Vn.push(i)}function z$(i){bc=!0,$y(i)}function ki(){if(!Rf&&Vn!==null){Rf=!0;var i=0,s=it;try{var c=Vn;for(it=1;i<c.length;i++){var f=c[i];do f=f(!0);while(f!==null)}Vn=null,bc=!1}catch(g){throw Vn!==null&&(Vn=Vn.slice(i+1)),Ul(Xo,ki),g}finally{it=s,Rf=!1}}return null}var us=[],ds=0,xc=null,wc=0,Ur=[],Vr=0,mo=null,Wn=1,Hn="";function go(i,s){us[ds++]=wc,us[ds++]=xc,xc=i,wc=s}function Ay(i,s,c){Ur[Vr++]=Wn,Ur[Vr++]=Hn,Ur[Vr++]=mo,mo=i;var f=Wn;i=Hn;var g=32-vr(f)-1;f&=~(1<<g),c+=1;var b=32-vr(s)+g;if(30<b){var _=g-g%5;b=(f&(1<<_)-1).toString(32),f>>=_,g-=_,Wn=1<<32-vr(s)+g|c<<g|f,Hn=b+i}else Wn=1<<b|c<<g|f,Hn=i}function _f(i){i.return!==null&&(go(i,1),Ay(i,1,0))}function $f(i){for(;i===xc;)xc=us[--ds],us[ds]=null,wc=us[--ds],us[ds]=null;for(;i===mo;)mo=Ur[--Vr],Ur[Vr]=null,Hn=Ur[--Vr],Ur[Vr]=null,Wn=Ur[--Vr],Ur[Vr]=null}var Nr=null,Pr=null,kt=!1,ln=null;function Ty(i,s){var c=Gr(5,null,null,0);c.elementType="DELETED",c.stateNode=s,c.return=i,s=i.deletions,s===null?(i.deletions=[c],i.flags|=16):s.push(c)}function Ly(i,s){switch(i.tag){case 5:var c=i.type;return s=s.nodeType!==1||c.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(i.stateNode=s,Nr=i,Pr=Si(s.firstChild),!0):!1;case 6:return s=i.pendingProps===""||s.nodeType!==3?null:s,s!==null?(i.stateNode=s,Nr=i,Pr=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(c=mo!==null?{id:Wn,overflow:Hn}:null,i.memoizedState={dehydrated:s,treeContext:c,retryLane:1073741824},c=Gr(18,null,null,0),c.stateNode=s,c.return=i,i.child=c,Nr=i,Pr=null,!0):!1;default:return!1}}function Af(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Tf(i){if(kt){var s=Pr;if(s){var c=s;if(!Ly(i,s)){if(Af(i))throw Error(r(418));s=Si(c.nextSibling);var f=Nr;s&&Ly(i,s)?Ty(f,c):(i.flags=i.flags&-4097|2,kt=!1,Nr=i)}}else{if(Af(i))throw Error(r(418));i.flags=i.flags&-4097|2,kt=!1,Nr=i}}}function Iy(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Nr=i}function Sc(i){if(i!==Nr)return!1;if(!kt)return Iy(i),kt=!0,!1;var s;if((s=i.tag!==3)&&!(s=i.tag!==5)&&(s=i.type,s=s!=="head"&&s!=="body"&&!wf(i.type,i.memoizedProps)),s&&(s=Pr)){if(Af(i))throw Oy(),Error(r(418));for(;s;)Ty(i,s),s=Si(s.nextSibling)}if(Iy(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"){if(s===0){Pr=Si(i.nextSibling);break e}s--}else c!=="$"&&c!=="$!"&&c!=="$?"||s++}i=i.nextSibling}Pr=null}}else Pr=Nr?Si(i.stateNode.nextSibling):null;return!0}function Oy(){for(var i=Pr;i;)i=Si(i.nextSibling)}function fs(){Pr=Nr=null,kt=!1}function Lf(i){ln===null?ln=[i]:ln.push(i)}var F$=A.ReactCurrentBatchConfig;function Na(i,s,c){if(i=c.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(r(309));var f=c.stateNode}if(!f)throw Error(r(147,i));var g=f,b=""+i;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===b?s.ref:(s=function(_){var j=g.refs;_===null?delete j[b]:j[b]=_},s._stringRef=b,s)}if(typeof i!="string")throw Error(r(284));if(!c._owner)throw Error(r(290,i))}return i}function Ec(i,s){throw i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i))}function Ny(i){var s=i._init;return s(i._payload)}function Py(i){function s(Y,W){if(i){var K=Y.deletions;K===null?(Y.deletions=[W],Y.flags|=16):K.push(W)}}function c(Y,W){if(!i)return null;for(;W!==null;)s(Y,W),W=W.sibling;return null}function f(Y,W){for(Y=new Map;W!==null;)W.key!==null?Y.set(W.key,W):Y.set(W.index,W),W=W.sibling;return Y}function g(Y,W){return Y=Oi(Y,W),Y.index=0,Y.sibling=null,Y}function b(Y,W,K){return Y.index=K,i?(K=Y.alternate,K!==null?(K=K.index,K<W?(Y.flags|=2,W):K):(Y.flags|=2,W)):(Y.flags|=1048576,W)}function _(Y){return i&&Y.alternate===null&&(Y.flags|=2),Y}function j(Y,W,K,me){return W===null||W.tag!==6?(W=Sp(K,Y.mode,me),W.return=Y,W):(W=g(W,K),W.return=Y,W)}function B(Y,W,K,me){var Oe=K.type;return Oe===P?ce(Y,W,K.props.children,me,K.key):W!==null&&(W.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===H&&Ny(Oe)===W.type)?(me=g(W,K.props),me.ref=Na(Y,W,K),me.return=Y,me):(me=Gc(K.type,K.key,K.props,null,Y.mode,me),me.ref=Na(Y,W,K),me.return=Y,me)}function J(Y,W,K,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==K.containerInfo||W.stateNode.implementation!==K.implementation?(W=Ep(K,Y.mode,me),W.return=Y,W):(W=g(W,K.children||[]),W.return=Y,W)}function ce(Y,W,K,me,Oe){return W===null||W.tag!==7?(W=Co(K,Y.mode,me,Oe),W.return=Y,W):(W=g(W,K),W.return=Y,W)}function de(Y,W,K){if(typeof W=="string"&&W!==""||typeof W=="number")return W=Sp(""+W,Y.mode,K),W.return=Y,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case D:return K=Gc(W.type,W.key,W.props,null,Y.mode,K),K.ref=Na(Y,null,W),K.return=Y,K;case N:return W=Ep(W,Y.mode,K),W.return=Y,W;case H:var me=W._init;return de(Y,me(W._payload),K)}if(Ne(W)||U(W))return W=Co(W,Y.mode,K,null),W.return=Y,W;Ec(Y,W)}return null}function ae(Y,W,K,me){var Oe=W!==null?W.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return Oe!==null?null:j(Y,W,""+K,me);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case D:return K.key===Oe?B(Y,W,K,me):null;case N:return K.key===Oe?J(Y,W,K,me):null;case H:return Oe=K._init,ae(Y,W,Oe(K._payload),me)}if(Ne(K)||U(K))return Oe!==null?null:ce(Y,W,K,me,null);Ec(Y,K)}return null}function ke(Y,W,K,me,Oe){if(typeof me=="string"&&me!==""||typeof me=="number")return Y=Y.get(K)||null,j(W,Y,""+me,Oe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case D:return Y=Y.get(me.key===null?K:me.key)||null,B(W,Y,me,Oe);case N:return Y=Y.get(me.key===null?K:me.key)||null,J(W,Y,me,Oe);case H:var je=me._init;return ke(Y,W,K,je(me._payload),Oe)}if(Ne(me)||U(me))return Y=Y.get(K)||null,ce(W,Y,me,Oe,null);Ec(W,me)}return null}function Te(Y,W,K,me){for(var Oe=null,je=null,Me=W,Be=W=0,er=null;Me!==null&&Be<K.length;Be++){Me.index>Be?(er=Me,Me=null):er=Me.sibling;var ot=ae(Y,Me,K[Be],me);if(ot===null){Me===null&&(Me=er);break}i&&Me&&ot.alternate===null&&s(Y,Me),W=b(ot,W,Be),je===null?Oe=ot:je.sibling=ot,je=ot,Me=er}if(Be===K.length)return c(Y,Me),kt&&go(Y,Be),Oe;if(Me===null){for(;Be<K.length;Be++)Me=de(Y,K[Be],me),Me!==null&&(W=b(Me,W,Be),je===null?Oe=Me:je.sibling=Me,je=Me);return kt&&go(Y,Be),Oe}for(Me=f(Y,Me);Be<K.length;Be++)er=ke(Me,Y,Be,K[Be],me),er!==null&&(i&&er.alternate!==null&&Me.delete(er.key===null?Be:er.key),W=b(er,W,Be),je===null?Oe=er:je.sibling=er,je=er);return i&&Me.forEach(function(Ni){return s(Y,Ni)}),kt&&go(Y,Be),Oe}function Le(Y,W,K,me){var Oe=U(K);if(typeof Oe!="function")throw Error(r(150));if(K=Oe.call(K),K==null)throw Error(r(151));for(var je=Oe=null,Me=W,Be=W=0,er=null,ot=K.next();Me!==null&&!ot.done;Be++,ot=K.next()){Me.index>Be?(er=Me,Me=null):er=Me.sibling;var Ni=ae(Y,Me,ot.value,me);if(Ni===null){Me===null&&(Me=er);break}i&&Me&&Ni.alternate===null&&s(Y,Me),W=b(Ni,W,Be),je===null?Oe=Ni:je.sibling=Ni,je=Ni,Me=er}if(ot.done)return c(Y,Me),kt&&go(Y,Be),Oe;if(Me===null){for(;!ot.done;Be++,ot=K.next())ot=de(Y,ot.value,me),ot!==null&&(W=b(ot,W,Be),je===null?Oe=ot:je.sibling=ot,je=ot);return kt&&go(Y,Be),Oe}for(Me=f(Y,Me);!ot.done;Be++,ot=K.next())ot=ke(Me,Y,Be,ot.value,me),ot!==null&&(i&&ot.alternate!==null&&Me.delete(ot.key===null?Be:ot.key),W=b(ot,W,Be),je===null?Oe=ot:je.sibling=ot,je=ot);return i&&Me.forEach(function(bA){return s(Y,bA)}),kt&&go(Y,Be),Oe}function Nt(Y,W,K,me){if(typeof K=="object"&&K!==null&&K.type===P&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case D:e:{for(var Oe=K.key,je=W;je!==null;){if(je.key===Oe){if(Oe=K.type,Oe===P){if(je.tag===7){c(Y,je.sibling),W=g(je,K.props.children),W.return=Y,Y=W;break e}}else if(je.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===H&&Ny(Oe)===je.type){c(Y,je.sibling),W=g(je,K.props),W.ref=Na(Y,je,K),W.return=Y,Y=W;break e}c(Y,je);break}else s(Y,je);je=je.sibling}K.type===P?(W=Co(K.props.children,Y.mode,me,K.key),W.return=Y,Y=W):(me=Gc(K.type,K.key,K.props,null,Y.mode,me),me.ref=Na(Y,W,K),me.return=Y,Y=me)}return _(Y);case N:e:{for(je=K.key;W!==null;){if(W.key===je)if(W.tag===4&&W.stateNode.containerInfo===K.containerInfo&&W.stateNode.implementation===K.implementation){c(Y,W.sibling),W=g(W,K.children||[]),W.return=Y,Y=W;break e}else{c(Y,W);break}else s(Y,W);W=W.sibling}W=Ep(K,Y.mode,me),W.return=Y,Y=W}return _(Y);case H:return je=K._init,Nt(Y,W,je(K._payload),me)}if(Ne(K))return Te(Y,W,K,me);if(U(K))return Le(Y,W,K,me);Ec(Y,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,W!==null&&W.tag===6?(c(Y,W.sibling),W=g(W,K),W.return=Y,Y=W):(c(Y,W),W=Sp(K,Y.mode,me),W.return=Y,Y=W),_(Y)):c(Y,W)}return Nt}var ps=Py(!0),Dy=Py(!1),Cc=Ei(null),kc=null,hs=null,If=null;function Of(){If=hs=kc=null}function Nf(i){var s=Cc.current;Et(Cc),i._currentValue=s}function Pf(i,s,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),i===c)break;i=i.return}}function ms(i,s){kc=i,If=hs=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(xr=!0),i.firstContext=null)}function Wr(i){var s=i._currentValue;if(If!==i)if(i={context:i,memoizedValue:s,next:null},hs===null){if(kc===null)throw Error(r(308));hs=i,kc.dependencies={lanes:0,firstContext:i}}else hs=hs.next=i;return s}var vo=null;function Df(i){vo===null?vo=[i]:vo.push(i)}function jy(i,s,c,f){var g=s.interleaved;return g===null?(c.next=c,Df(s)):(c.next=g.next,g.next=c),s.interleaved=c,qn(i,f)}function qn(i,s){i.lanes|=s;var c=i.alternate;for(c!==null&&(c.lanes|=s),c=i,i=i.return;i!==null;)i.childLanes|=s,c=i.alternate,c!==null&&(c.childLanes|=s),c=i,i=i.return;return c.tag===3?c.stateNode:null}var Ri=!1;function jf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function My(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Gn(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function _i(i,s,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(nt&2)!==0){var g=f.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),f.pending=s,qn(i,c)}return g=f.interleaved,g===null?(s.next=s,Df(f)):(s.next=g.next,g.next=s),f.interleaved=s,qn(i,c)}function Rc(i,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194240)!==0)){var f=s.lanes;f&=i.pendingLanes,c|=f,s.lanes=c,Ko(i,c)}}function zy(i,s){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var g=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var _={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};b===null?g=b=_:b=b.next=_,c=c.next}while(c!==null);b===null?g=b=s:b=b.next=s}else g=b=s;c={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:f.shared,effects:f.effects},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=s}function _c(i,s,c,f){var g=i.updateQueue;Ri=!1;var b=g.firstBaseUpdate,_=g.lastBaseUpdate,j=g.shared.pending;if(j!==null){g.shared.pending=null;var B=j,J=B.next;B.next=null,_===null?b=J:_.next=J,_=B;var ce=i.alternate;ce!==null&&(ce=ce.updateQueue,j=ce.lastBaseUpdate,j!==_&&(j===null?ce.firstBaseUpdate=J:j.next=J,ce.lastBaseUpdate=B))}if(b!==null){var de=g.baseState;_=0,ce=J=B=null,j=b;do{var ae=j.lane,ke=j.eventTime;if((f&ae)===ae){ce!==null&&(ce=ce.next={eventTime:ke,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var Te=i,Le=j;switch(ae=s,ke=c,Le.tag){case 1:if(Te=Le.payload,typeof Te=="function"){de=Te.call(ke,de,ae);break e}de=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Le.payload,ae=typeof Te=="function"?Te.call(ke,de,ae):Te,ae==null)break e;de=z({},de,ae);break e;case 2:Ri=!0}}j.callback!==null&&j.lane!==0&&(i.flags|=64,ae=g.effects,ae===null?g.effects=[j]:ae.push(j))}else ke={eventTime:ke,lane:ae,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ce===null?(J=ce=ke,B=de):ce=ce.next=ke,_|=ae;if(j=j.next,j===null){if(j=g.shared.pending,j===null)break;ae=j,j=ae.next,ae.next=null,g.lastBaseUpdate=ae,g.shared.pending=null}}while(!0);if(ce===null&&(B=de),g.baseState=B,g.firstBaseUpdate=J,g.lastBaseUpdate=ce,s=g.shared.interleaved,s!==null){g=s;do _|=g.lane,g=g.next;while(g!==s)}else b===null&&(g.shared.lanes=0);xo|=_,i.lanes=_,i.memoizedState=de}}function Fy(i,s,c){if(i=s.effects,s.effects=null,i!==null)for(s=0;s<i.length;s++){var f=i[s],g=f.callback;if(g!==null){if(f.callback=null,f=c,typeof g!="function")throw Error(r(191,g));g.call(f)}}}var Pa={},kn=Ei(Pa),Da=Ei(Pa),ja=Ei(Pa);function yo(i){if(i===Pa)throw Error(r(174));return i}function Mf(i,s){switch(xt(ja,s),xt(Da,i),xt(kn,Pa),i=s.nodeType,i){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:jt(null,"");break;default:i=i===8?s.parentNode:s,s=i.namespaceURI||null,i=i.tagName,s=jt(s,i)}Et(kn),xt(kn,s)}function gs(){Et(kn),Et(Da),Et(ja)}function By(i){yo(ja.current);var s=yo(kn.current),c=jt(s,i.type);s!==c&&(xt(Da,i),xt(kn,c))}function zf(i){Da.current===i&&(Et(kn),Et(Da))}var $t=Ei(0);function $c(i){for(var s=i;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ff=[];function Bf(){for(var i=0;i<Ff.length;i++)Ff[i]._workInProgressVersionPrimary=null;Ff.length=0}var Ac=A.ReactCurrentDispatcher,Uf=A.ReactCurrentBatchConfig,bo=0,At=null,qt=null,Jt=null,Tc=!1,Ma=!1,za=0,B$=0;function cr(){throw Error(r(321))}function Vf(i,s){if(s===null)return!1;for(var c=0;c<s.length&&c<i.length;c++)if(!an(i[c],s[c]))return!1;return!0}function Wf(i,s,c,f,g,b){if(bo=b,At=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Ac.current=i===null||i.memoizedState===null?H$:q$,i=c(f,g),Ma){b=0;do{if(Ma=!1,za=0,25<=b)throw Error(r(301));b+=1,Jt=qt=null,s.updateQueue=null,Ac.current=G$,i=c(f,g)}while(Ma)}if(Ac.current=Oc,s=qt!==null&&qt.next!==null,bo=0,Jt=qt=At=null,Tc=!1,s)throw Error(r(300));return i}function Hf(){var i=za!==0;return za=0,i}function Rn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?At.memoizedState=Jt=i:Jt=Jt.next=i,Jt}function Hr(){if(qt===null){var i=At.alternate;i=i!==null?i.memoizedState:null}else i=qt.next;var s=Jt===null?At.memoizedState:Jt.next;if(s!==null)Jt=s,qt=i;else{if(i===null)throw Error(r(310));qt=i,i={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},Jt===null?At.memoizedState=Jt=i:Jt=Jt.next=i}return Jt}function Fa(i,s){return typeof s=="function"?s(i):s}function qf(i){var s=Hr(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=qt,g=f.baseQueue,b=c.pending;if(b!==null){if(g!==null){var _=g.next;g.next=b.next,b.next=_}f.baseQueue=g=b,c.pending=null}if(g!==null){b=g.next,f=f.baseState;var j=_=null,B=null,J=b;do{var ce=J.lane;if((bo&ce)===ce)B!==null&&(B=B.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),f=J.hasEagerState?J.eagerState:i(f,J.action);else{var de={lane:ce,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};B===null?(j=B=de,_=f):B=B.next=de,At.lanes|=ce,xo|=ce}J=J.next}while(J!==null&&J!==b);B===null?_=f:B.next=j,an(f,s.memoizedState)||(xr=!0),s.memoizedState=f,s.baseState=_,s.baseQueue=B,c.lastRenderedState=f}if(i=c.interleaved,i!==null){g=i;do b=g.lane,At.lanes|=b,xo|=b,g=g.next;while(g!==i)}else g===null&&(c.lanes=0);return[s.memoizedState,c.dispatch]}function Gf(i){var s=Hr(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,g=c.pending,b=s.memoizedState;if(g!==null){c.pending=null;var _=g=g.next;do b=i(b,_.action),_=_.next;while(_!==g);an(b,s.memoizedState)||(xr=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),c.lastRenderedState=b}return[b,f]}function Uy(){}function Vy(i,s){var c=At,f=Hr(),g=s(),b=!an(f.memoizedState,g);if(b&&(f.memoizedState=g,xr=!0),f=f.queue,Xf(qy.bind(null,c,f,i),[i]),f.getSnapshot!==s||b||Jt!==null&&Jt.memoizedState.tag&1){if(c.flags|=2048,Ba(9,Hy.bind(null,c,f,g,s),void 0,null),Zt===null)throw Error(r(349));(bo&30)!==0||Wy(c,s,g)}return g}function Wy(i,s,c){i.flags|=16384,i={getSnapshot:s,value:c},s=At.updateQueue,s===null?(s={lastEffect:null,stores:null},At.updateQueue=s,s.stores=[i]):(c=s.stores,c===null?s.stores=[i]:c.push(i))}function Hy(i,s,c,f){s.value=c,s.getSnapshot=f,Gy(s)&&Xy(i)}function qy(i,s,c){return c(function(){Gy(s)&&Xy(i)})}function Gy(i){var s=i.getSnapshot;i=i.value;try{var c=s();return!an(i,c)}catch{return!0}}function Xy(i){var s=qn(i,1);s!==null&&fn(s,i,1,-1)}function Yy(i){var s=Rn();return typeof i=="function"&&(i=i()),s.memoizedState=s.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:i},s.queue=i,i=i.dispatch=W$.bind(null,At,i),[s.memoizedState,i]}function Ba(i,s,c,f){return i={tag:i,create:s,destroy:c,deps:f,next:null},s=At.updateQueue,s===null?(s={lastEffect:null,stores:null},At.updateQueue=s,s.lastEffect=i.next=i):(c=s.lastEffect,c===null?s.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,s.lastEffect=i)),i}function Ky(){return Hr().memoizedState}function Lc(i,s,c,f){var g=Rn();At.flags|=i,g.memoizedState=Ba(1|s,c,void 0,f===void 0?null:f)}function Ic(i,s,c,f){var g=Hr();f=f===void 0?null:f;var b=void 0;if(qt!==null){var _=qt.memoizedState;if(b=_.destroy,f!==null&&Vf(f,_.deps)){g.memoizedState=Ba(s,c,b,f);return}}At.flags|=i,g.memoizedState=Ba(1|s,c,b,f)}function Qy(i,s){return Lc(8390656,8,i,s)}function Xf(i,s){return Ic(2048,8,i,s)}function Jy(i,s){return Ic(4,2,i,s)}function Zy(i,s){return Ic(4,4,i,s)}function e0(i,s){if(typeof s=="function")return i=i(),s(i),function(){s(null)};if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function t0(i,s,c){return c=c!=null?c.concat([i]):null,Ic(4,4,e0.bind(null,s,i),c)}function Yf(){}function r0(i,s){var c=Hr();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&Vf(s,f[1])?f[0]:(c.memoizedState=[i,s],i)}function n0(i,s){var c=Hr();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&Vf(s,f[1])?f[0]:(i=i(),c.memoizedState=[i,s],i)}function i0(i,s,c){return(bo&21)===0?(i.baseState&&(i.baseState=!1,xr=!0),i.memoizedState=c):(an(c,s)||(c=fa(),At.lanes|=c,xo|=c,i.baseState=!0),s)}function U$(i,s){var c=it;it=c!==0&&4>c?c:4,i(!0);var f=Uf.transition;Uf.transition={};try{i(!1),s()}finally{it=c,Uf.transition=f}}function o0(){return Hr().memoizedState}function V$(i,s,c){var f=Li(i);if(c={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null},s0(i))a0(s,c);else if(c=jy(i,s,c,f),c!==null){var g=pr();fn(c,i,f,g),l0(c,s,f)}}function W$(i,s,c){var f=Li(i),g={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null};if(s0(i))a0(s,g);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var _=s.lastRenderedState,j=b(_,c);if(g.hasEagerState=!0,g.eagerState=j,an(j,_)){var B=s.interleaved;B===null?(g.next=g,Df(s)):(g.next=B.next,B.next=g),s.interleaved=g;return}}catch{}c=jy(i,s,g,f),c!==null&&(g=pr(),fn(c,i,f,g),l0(c,s,f))}}function s0(i){var s=i.alternate;return i===At||s!==null&&s===At}function a0(i,s){Ma=Tc=!0;var c=i.pending;c===null?s.next=s:(s.next=c.next,c.next=s),i.pending=s}function l0(i,s,c){if((c&4194240)!==0){var f=s.lanes;f&=i.pendingLanes,c|=f,s.lanes=c,Ko(i,c)}}var Oc={readContext:Wr,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useInsertionEffect:cr,useLayoutEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useMutableSource:cr,useSyncExternalStore:cr,useId:cr,unstable_isNewReconciler:!1},H$={readContext:Wr,useCallback:function(i,s){return Rn().memoizedState=[i,s===void 0?null:s],i},useContext:Wr,useEffect:Qy,useImperativeHandle:function(i,s,c){return c=c!=null?c.concat([i]):null,Lc(4194308,4,e0.bind(null,s,i),c)},useLayoutEffect:function(i,s){return Lc(4194308,4,i,s)},useInsertionEffect:function(i,s){return Lc(4,2,i,s)},useMemo:function(i,s){var c=Rn();return s=s===void 0?null:s,i=i(),c.memoizedState=[i,s],i},useReducer:function(i,s,c){var f=Rn();return s=c!==void 0?c(s):s,f.memoizedState=f.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},f.queue=i,i=i.dispatch=V$.bind(null,At,i),[f.memoizedState,i]},useRef:function(i){var s=Rn();return i={current:i},s.memoizedState=i},useState:Yy,useDebugValue:Yf,useDeferredValue:function(i){return Rn().memoizedState=i},useTransition:function(){var i=Yy(!1),s=i[0];return i=U$.bind(null,i[1]),Rn().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,c){var f=At,g=Rn();if(kt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),Zt===null)throw Error(r(349));(bo&30)!==0||Wy(f,s,c)}g.memoizedState=c;var b={value:c,getSnapshot:s};return g.queue=b,Qy(qy.bind(null,f,b,i),[i]),f.flags|=2048,Ba(9,Hy.bind(null,f,b,c,s),void 0,null),c},useId:function(){var i=Rn(),s=Zt.identifierPrefix;if(kt){var c=Hn,f=Wn;c=(f&~(1<<32-vr(f)-1)).toString(32)+c,s=":"+s+"R"+c,c=za++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=B$++,s=":"+s+"r"+c.toString(32)+":";return i.memoizedState=s},unstable_isNewReconciler:!1},q$={readContext:Wr,useCallback:r0,useContext:Wr,useEffect:Xf,useImperativeHandle:t0,useInsertionEffect:Jy,useLayoutEffect:Zy,useMemo:n0,useReducer:qf,useRef:Ky,useState:function(){return qf(Fa)},useDebugValue:Yf,useDeferredValue:function(i){var s=Hr();return i0(s,qt.memoizedState,i)},useTransition:function(){var i=qf(Fa)[0],s=Hr().memoizedState;return[i,s]},useMutableSource:Uy,useSyncExternalStore:Vy,useId:o0,unstable_isNewReconciler:!1},G$={readContext:Wr,useCallback:r0,useContext:Wr,useEffect:Xf,useImperativeHandle:t0,useInsertionEffect:Jy,useLayoutEffect:Zy,useMemo:n0,useReducer:Gf,useRef:Ky,useState:function(){return Gf(Fa)},useDebugValue:Yf,useDeferredValue:function(i){var s=Hr();return qt===null?s.memoizedState=i:i0(s,qt.memoizedState,i)},useTransition:function(){var i=Gf(Fa)[0],s=Hr().memoizedState;return[i,s]},useMutableSource:Uy,useSyncExternalStore:Vy,useId:o0,unstable_isNewReconciler:!1};function cn(i,s){if(i&&i.defaultProps){s=z({},s),i=i.defaultProps;for(var c in i)s[c]===void 0&&(s[c]=i[c]);return s}return s}function Kf(i,s,c,f){s=i.memoizedState,c=c(f,s),c=c==null?s:z({},s,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Nc={isMounted:function(i){return(i=i._reactInternals)?Bn(i)===i:!1},enqueueSetState:function(i,s,c){i=i._reactInternals;var f=pr(),g=Li(i),b=Gn(f,g);b.payload=s,c!=null&&(b.callback=c),s=_i(i,b,g),s!==null&&(fn(s,i,g,f),Rc(s,i,g))},enqueueReplaceState:function(i,s,c){i=i._reactInternals;var f=pr(),g=Li(i),b=Gn(f,g);b.tag=1,b.payload=s,c!=null&&(b.callback=c),s=_i(i,b,g),s!==null&&(fn(s,i,g,f),Rc(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var c=pr(),f=Li(i),g=Gn(c,f);g.tag=2,s!=null&&(g.callback=s),s=_i(i,g,f),s!==null&&(fn(s,i,f,c),Rc(s,i,f))}};function c0(i,s,c,f,g,b,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,b,_):s.prototype&&s.prototype.isPureReactComponent?!_a(c,f)||!_a(g,b):!0}function u0(i,s,c){var f=!1,g=Ci,b=s.contextType;return typeof b=="object"&&b!==null?b=Wr(b):(g=br(s)?ho:lr.current,f=s.contextTypes,b=(f=f!=null)?cs(i,g):Ci),s=new s(c,b),i.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Nc,i.stateNode=s,s._reactInternals=i,f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=b),s}function d0(i,s,c,f){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,f),s.state!==i&&Nc.enqueueReplaceState(s,s.state,null)}function Qf(i,s,c,f){var g=i.stateNode;g.props=c,g.state=i.memoizedState,g.refs={},jf(i);var b=s.contextType;typeof b=="object"&&b!==null?g.context=Wr(b):(b=br(s)?ho:lr.current,g.context=cs(i,b)),g.state=i.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(Kf(i,s,b,c),g.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(s=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),s!==g.state&&Nc.enqueueReplaceState(g,g.state,null),_c(i,c,g,f),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function vs(i,s){try{var c="",f=s;do c+=G(f),f=f.return;while(f);var g=c}catch(b){g=`
10
10
  Error generating stack: `+b.message+`
11
- `+b.stack}return{value:i,source:s,stack:g,digest:null}}function Qf(i,s,c){return{value:i,source:null,stack:c??null,digest:s??null}}function Jf(i,s){try{console.error(s.value)}catch(c){setTimeout(function(){throw c})}}var H$=typeof WeakMap=="function"?WeakMap:Map;function f0(i,s,c){c=Gn(-1,c),c.tag=3,c.payload={element:null};var f=s.value;return c.callback=function(){Bc||(Bc=!0,pp=f),Jf(i,s)},c}function p0(i,s,c){c=Gn(-1,c),c.tag=3;var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=s.value;c.payload=function(){return f(g)},c.callback=function(){Jf(i,s)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(c.callback=function(){Jf(i,s),typeof f!="function"&&($i===null?$i=new Set([this]):$i.add(this));var _=s.stack;this.componentDidCatch(s.value,{componentStack:_!==null?_:""})}),c}function h0(i,s,c){var f=i.pingCache;if(f===null){f=i.pingCache=new H$;var g=new Set;f.set(s,g)}else g=f.get(s),g===void 0&&(g=new Set,f.set(s,g));g.has(c)||(g.add(c),i=oA.bind(null,i,s,c),s.then(i,i))}function m0(i){do{var s;if((s=i.tag===13)&&(s=i.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return i;i=i.return}while(i!==null);return null}function g0(i,s,c,f,g){return(i.mode&1)===0?(i===s?i.flags|=65536:(i.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(s=Gn(-1,1),s.tag=2,Ri(c,s,1))),c.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var q$=A.ReactCurrentOwner,xr=!1;function fr(i,s,c,f){s.child=i===null?Dy(s,null,c,f):ps(s,i.child,c,f)}function v0(i,s,c,f,g){c=c.render;var b=s.ref;return ms(s,g),f=Vf(i,s,c,f,b,g),c=Wf(),i!==null&&!xr?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Xn(i,s,g)):(kt&&c&&Rf(s),s.flags|=1,fr(i,s,f,g),s.child)}function y0(i,s,c,f,g){if(i===null){var b=c.type;return typeof b=="function"&&!xp(b)&&b.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(s.tag=15,s.type=b,b0(i,s,b,f,g)):(i=Gc(c.type,null,f,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(b=i.child,(i.lanes&g)===0){var _=b.memoizedProps;if(c=c.compare,c=c!==null?c:_a,c(_,f)&&i.ref===s.ref)return Xn(i,s,g)}return s.flags|=1,i=Ii(b,f),i.ref=s.ref,i.return=s,s.child=i}function b0(i,s,c,f,g){if(i!==null){var b=i.memoizedProps;if(_a(b,f)&&i.ref===s.ref)if(xr=!1,s.pendingProps=f=b,(i.lanes&g)!==0)(i.flags&131072)!==0&&(xr=!0);else return s.lanes=i.lanes,Xn(i,s,g)}return Zf(i,s,c,f,g)}function x0(i,s,c){var f=s.pendingProps,g=f.children,b=i!==null?i.memoizedState:null;if(f.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},xt(bs,Dr),Dr|=c;else{if((c&1073741824)===0)return i=b!==null?b.baseLanes|c:c,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:i,cachePool:null,transitions:null},s.updateQueue=null,xt(bs,Dr),Dr|=i,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=b!==null?b.baseLanes:c,xt(bs,Dr),Dr|=f}else b!==null?(f=b.baseLanes|c,s.memoizedState=null):f=c,xt(bs,Dr),Dr|=f;return fr(i,s,g,c),s.child}function w0(i,s){var c=s.ref;(i===null&&c!==null||i!==null&&i.ref!==c)&&(s.flags|=512,s.flags|=2097152)}function Zf(i,s,c,f,g){var b=br(c)?ho:ar.current;return b=cs(s,b),ms(s,g),c=Vf(i,s,c,f,b,g),f=Wf(),i!==null&&!xr?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Xn(i,s,g)):(kt&&f&&Rf(s),s.flags|=1,fr(i,s,c,g),s.child)}function S0(i,s,c,f,g){if(br(c)){var b=!0;yc(s)}else b=!1;if(ms(s,g),s.stateNode===null)Dc(i,s),u0(s,c,f),Kf(s,c,f,g),f=!0;else if(i===null){var _=s.stateNode,j=s.memoizedProps;_.props=j;var B=_.context,J=c.contextType;typeof J=="object"&&J!==null?J=Wr(J):(J=br(c)?ho:ar.current,J=cs(s,J));var ce=c.getDerivedStateFromProps,de=typeof ce=="function"||typeof _.getSnapshotBeforeUpdate=="function";de||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==f||B!==J)&&d0(s,_,f,J),ki=!1;var ae=s.memoizedState;_.state=ae,_c(s,f,_,g),B=s.memoizedState,j!==f||ae!==B||yr.current||ki?(typeof ce=="function"&&(Yf(s,c,ce,f),B=s.memoizedState),(j=ki||c0(s,c,j,f,ae,B,J))?(de||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(s.flags|=4194308)):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=B),_.props=f,_.state=B,_.context=J,f=j):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{_=s.stateNode,My(i,s),j=s.memoizedProps,J=s.type===s.elementType?j:cn(s.type,j),_.props=J,de=s.pendingProps,ae=_.context,B=c.contextType,typeof B=="object"&&B!==null?B=Wr(B):(B=br(c)?ho:ar.current,B=cs(s,B));var ke=c.getDerivedStateFromProps;(ce=typeof ke=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==de||ae!==B)&&d0(s,_,f,B),ki=!1,ae=s.memoizedState,_.state=ae,_c(s,f,_,g);var Te=s.memoizedState;j!==de||ae!==Te||yr.current||ki?(typeof ke=="function"&&(Yf(s,c,ke,f),Te=s.memoizedState),(J=ki||c0(s,c,J,f,ae,Te,B)||!1)?(ce||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(f,Te,B),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(f,Te,B)),typeof _.componentDidUpdate=="function"&&(s.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=Te),_.props=f,_.state=Te,_.context=B,f=J):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=1024),f=!1)}return ep(i,s,c,f,b,g)}function ep(i,s,c,f,g,b){w0(i,s);var _=(s.flags&128)!==0;if(!f&&!_)return g&&_y(s,c,!1),Xn(i,s,b);f=s.stateNode,q$.current=s;var j=_&&typeof c.getDerivedStateFromError!="function"?null:f.render();return s.flags|=1,i!==null&&_?(s.child=ps(s,i.child,null,b),s.child=ps(s,null,j,b)):fr(i,s,j,b),s.memoizedState=f.state,g&&_y(s,c,!0),s.child}function E0(i){var s=i.stateNode;s.pendingContext?ky(i,s.pendingContext,s.pendingContext!==s.context):s.context&&ky(i,s.context,!1),jf(i,s.containerInfo)}function C0(i,s,c,f,g){return fs(),Tf(g),s.flags|=256,fr(i,s,c,f),s.child}var tp={dehydrated:null,treeContext:null,retryLane:0};function rp(i){return{baseLanes:i,cachePool:null,transitions:null}}function k0(i,s,c){var f=s.pendingProps,g=$t.current,b=!1,_=(s.flags&128)!==0,j;if((j=_)||(j=i!==null&&i.memoizedState===null?!1:(g&2)!==0),j?(b=!0,s.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),xt($t,g&1),i===null)return Af(s),i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((s.mode&1)===0?s.lanes=1:i.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(_=f.children,i=f.fallback,b?(f=s.mode,b=s.child,_={mode:"hidden",children:_},(f&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=_):b=Xc(_,f,0,null),i=Co(i,f,c,null),b.return=s,i.return=s,b.sibling=i,s.child=b,s.child.memoizedState=rp(c),s.memoizedState=tp,i):np(s,_));if(g=i.memoizedState,g!==null&&(j=g.dehydrated,j!==null))return G$(i,s,_,f,j,g,c);if(b){b=f.fallback,_=s.mode,g=i.child,j=g.sibling;var B={mode:"hidden",children:f.children};return(_&1)===0&&s.child!==g?(f=s.child,f.childLanes=0,f.pendingProps=B,s.deletions=null):(f=Ii(g,B),f.subtreeFlags=g.subtreeFlags&14680064),j!==null?b=Ii(j,b):(b=Co(b,_,c,null),b.flags|=2),b.return=s,f.return=s,f.sibling=b,s.child=f,f=b,b=s.child,_=i.child.memoizedState,_=_===null?rp(c):{baseLanes:_.baseLanes|c,cachePool:null,transitions:_.transitions},b.memoizedState=_,b.childLanes=i.childLanes&~c,s.memoizedState=tp,f}return b=i.child,i=b.sibling,f=Ii(b,{mode:"visible",children:f.children}),(s.mode&1)===0&&(f.lanes=c),f.return=s,f.sibling=null,i!==null&&(c=s.deletions,c===null?(s.deletions=[i],s.flags|=16):c.push(i)),s.child=f,s.memoizedState=null,f}function np(i,s){return s=Xc({mode:"visible",children:s},i.mode,0,null),s.return=i,i.child=s}function Pc(i,s,c,f){return f!==null&&Tf(f),ps(s,i.child,null,c),i=np(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function G$(i,s,c,f,g,b,_){if(c)return s.flags&256?(s.flags&=-257,f=Qf(Error(r(422))),Pc(i,s,_,f)):s.memoizedState!==null?(s.child=i.child,s.flags|=128,null):(b=f.fallback,g=s.mode,f=Xc({mode:"visible",children:f.children},g,0,null),b=Co(b,g,_,null),b.flags|=2,f.return=s,b.return=s,f.sibling=b,s.child=f,(s.mode&1)!==0&&ps(s,i.child,null,_),s.child.memoizedState=rp(_),s.memoizedState=tp,b);if((s.mode&1)===0)return Pc(i,s,_,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var j=f.dgst;return f=j,b=Error(r(419)),f=Qf(b,f,void 0),Pc(i,s,_,f)}if(j=(_&i.childLanes)!==0,xr||j){if(f=Zt,f!==null){switch(_&-_){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(f.suspendedLanes|_))!==0?0:g,g!==0&&g!==b.retryLane&&(b.retryLane=g,qn(i,g),fn(f,i,g,-1))}return bp(),f=Qf(Error(r(421))),Pc(i,s,_,f)}return g.data==="$?"?(s.flags|=128,s.child=i.child,s=sA.bind(null,i),g._reactRetry=s,null):(i=b.treeContext,Pr=wi(g.nextSibling),Nr=s,kt=!0,ln=null,i!==null&&(Ur[Vr++]=Wn,Ur[Vr++]=Hn,Ur[Vr++]=mo,Wn=i.id,Hn=i.overflow,mo=s),s=np(s,f.children),s.flags|=4096,s)}function R0(i,s,c){i.lanes|=s;var f=i.alternate;f!==null&&(f.lanes|=s),Nf(i.return,s,c)}function ip(i,s,c,f,g){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:g}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=f,b.tail=c,b.tailMode=g)}function _0(i,s,c){var f=s.pendingProps,g=f.revealOrder,b=f.tail;if(fr(i,s,f.children,c),f=$t.current,(f&2)!==0)f=f&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&R0(i,c,s);else if(i.tag===19)R0(i,c,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}f&=1}if(xt($t,f),(s.mode&1)===0)s.memoizedState=null;else switch(g){case"forwards":for(c=s.child,g=null;c!==null;)i=c.alternate,i!==null&&$c(i)===null&&(g=c),c=c.sibling;c=g,c===null?(g=s.child,s.child=null):(g=c.sibling,c.sibling=null),ip(s,!1,g,c,b);break;case"backwards":for(c=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&$c(i)===null){s.child=g;break}i=g.sibling,g.sibling=c,c=g,g=i}ip(s,!0,c,null,b);break;case"together":ip(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Dc(i,s){(s.mode&1)===0&&i!==null&&(i.alternate=null,s.alternate=null,s.flags|=2)}function Xn(i,s,c){if(i!==null&&(s.dependencies=i.dependencies),xo|=s.lanes,(c&s.childLanes)===0)return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,c=Ii(i,i.pendingProps),s.child=c,c.return=s;i.sibling!==null;)i=i.sibling,c=c.sibling=Ii(i,i.pendingProps),c.return=s;c.sibling=null}return s.child}function X$(i,s,c){switch(s.tag){case 3:E0(s),fs();break;case 5:By(s);break;case 1:br(s.type)&&yc(s);break;case 4:jf(s,s.stateNode.containerInfo);break;case 10:var f=s.type._context,g=s.memoizedProps.value;xt(Cc,f._currentValue),f._currentValue=g;break;case 13:if(f=s.memoizedState,f!==null)return f.dehydrated!==null?(xt($t,$t.current&1),s.flags|=128,null):(c&s.child.childLanes)!==0?k0(i,s,c):(xt($t,$t.current&1),i=Xn(i,s,c),i!==null?i.sibling:null);xt($t,$t.current&1);break;case 19:if(f=(c&s.childLanes)!==0,(i.flags&128)!==0){if(f)return _0(i,s,c);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),xt($t,$t.current),f)break;return null;case 22:case 23:return s.lanes=0,x0(i,s,c)}return Xn(i,s,c)}var $0,op,A0,T0;$0=function(i,s){for(var c=s.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},op=function(){},A0=function(i,s,c,f){var g=i.memoizedProps;if(g!==f){i=s.stateNode,yo(kn.current);var b=null;switch(c){case"input":g=ze(i,g),f=ze(i,f),b=[];break;case"select":g=z({},g,{value:void 0}),f=z({},f,{value:void 0}),b=[];break;case"textarea":g=Se(i,g),f=Se(i,f),b=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(i.onclick=mc)}Ve(c,f);var _;c=null;for(J in g)if(!f.hasOwnProperty(J)&&g.hasOwnProperty(J)&&g[J]!=null)if(J==="style"){var j=g[J];for(_ in j)j.hasOwnProperty(_)&&(c||(c={}),c[_]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(o.hasOwnProperty(J)?b||(b=[]):(b=b||[]).push(J,null));for(J in f){var B=f[J];if(j=g?.[J],f.hasOwnProperty(J)&&B!==j&&(B!=null||j!=null))if(J==="style")if(j){for(_ in j)!j.hasOwnProperty(_)||B&&B.hasOwnProperty(_)||(c||(c={}),c[_]="");for(_ in B)B.hasOwnProperty(_)&&j[_]!==B[_]&&(c||(c={}),c[_]=B[_])}else c||(b||(b=[]),b.push(J,c)),c=B;else J==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,j=j?j.__html:void 0,B!=null&&j!==B&&(b=b||[]).push(J,B)):J==="children"?typeof B!="string"&&typeof B!="number"||(b=b||[]).push(J,""+B):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(o.hasOwnProperty(J)?(B!=null&&J==="onScroll"&&St("scroll",i),b||j===B||(b=[])):(b=b||[]).push(J,B))}c&&(b=b||[]).push("style",c);var J=b;(s.updateQueue=J)&&(s.flags|=4)}},T0=function(i,s,c,f){c!==f&&(s.flags|=4)};function Ua(i,s){if(!kt)switch(i.tailMode){case"hidden":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function cr(i){var s=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(s)for(var g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=f,i.childLanes=c,s}function Y$(i,s,c){var f=s.pendingProps;switch(_f(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cr(s),null;case 1:return br(s.type)&&vc(),cr(s),null;case 3:return f=s.stateNode,gs(),Et(yr),Et(ar),Ff(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(Sc(s)?s.flags|=4:i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ln!==null&&(gp(ln),ln=null))),op(i,s),cr(s),null;case 5:Mf(s);var g=yo(ja.current);if(c=s.type,i!==null&&s.stateNode!=null)A0(i,s,c,f,g),i.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!f){if(s.stateNode===null)throw Error(r(166));return cr(s),null}if(i=yo(kn.current),Sc(s)){f=s.stateNode,c=s.type;var b=s.memoizedProps;switch(f[Cn]=s,f[Ia]=b,i=(s.mode&1)!==0,c){case"dialog":St("cancel",f),St("close",f);break;case"iframe":case"object":case"embed":St("load",f);break;case"video":case"audio":for(g=0;g<Aa.length;g++)St(Aa[g],f);break;case"source":St("error",f);break;case"img":case"image":case"link":St("error",f),St("load",f);break;case"details":St("toggle",f);break;case"input":We(f,b),St("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!b.multiple},St("invalid",f);break;case"textarea":Je(f,b),St("invalid",f)}Ve(c,b),g=null;for(var _ in b)if(b.hasOwnProperty(_)){var j=b[_];_==="children"?typeof j=="string"?f.textContent!==j&&(b.suppressHydrationWarning!==!0&&hc(f.textContent,j,i),g=["children",j]):typeof j=="number"&&f.textContent!==""+j&&(b.suppressHydrationWarning!==!0&&hc(f.textContent,j,i),g=["children",""+j]):o.hasOwnProperty(_)&&j!=null&&_==="onScroll"&&St("scroll",f)}switch(c){case"input":qe(f),Fe(f,b,!0);break;case"textarea":qe(f),Bt(f);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(f.onclick=mc)}f=g,s.updateQueue=f,f!==null&&(s.flags|=4)}else{_=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Ut(c)),i==="http://www.w3.org/1999/xhtml"?c==="script"?(i=_.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof f.is=="string"?i=_.createElement(c,{is:f.is}):(i=_.createElement(c),c==="select"&&(_=i,f.multiple?_.multiple=!0:f.size&&(_.size=f.size))):i=_.createElementNS(i,c),i[Cn]=s,i[Ia]=f,$0(i,s,!1,!1),s.stateNode=i;e:{switch(_=Ke(c,f),c){case"dialog":St("cancel",i),St("close",i),g=f;break;case"iframe":case"object":case"embed":St("load",i),g=f;break;case"video":case"audio":for(g=0;g<Aa.length;g++)St(Aa[g],i);g=f;break;case"source":St("error",i),g=f;break;case"img":case"image":case"link":St("error",i),St("load",i),g=f;break;case"details":St("toggle",i),g=f;break;case"input":We(i,f),g=ze(i,f),St("invalid",i);break;case"option":g=f;break;case"select":i._wrapperState={wasMultiple:!!f.multiple},g=z({},f,{value:void 0}),St("invalid",i);break;case"textarea":Je(i,f),g=Se(i,f),St("invalid",i);break;default:g=f}Ve(c,g),j=g;for(b in j)if(j.hasOwnProperty(b)){var B=j[b];b==="style"?se(i,B):b==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&bt(i,B)):b==="children"?typeof B=="string"?(c!=="textarea"||B!=="")&&rt(i,B):typeof B=="number"&&rt(i,""+B):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(o.hasOwnProperty(b)?B!=null&&b==="onScroll"&&St("scroll",i):B!=null&&$(i,b,B,_))}switch(c){case"input":qe(i),Fe(i,f,!1);break;case"textarea":qe(i),Bt(i);break;case"option":f.value!=null&&i.setAttribute("value",""+pe(f.value));break;case"select":i.multiple=!!f.multiple,b=f.value,b!=null?oe(i,!!f.multiple,b,!1):f.defaultValue!=null&&oe(i,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=mc)}switch(c){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return cr(s),null;case 6:if(i&&s.stateNode!=null)T0(i,s,i.memoizedProps,f);else{if(typeof f!="string"&&s.stateNode===null)throw Error(r(166));if(c=yo(ja.current),yo(kn.current),Sc(s)){if(f=s.stateNode,c=s.memoizedProps,f[Cn]=s,(b=f.nodeValue!==c)&&(i=Nr,i!==null))switch(i.tag){case 3:hc(f.nodeValue,c,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&hc(f.nodeValue,c,(i.mode&1)!==0)}b&&(s.flags|=4)}else f=(c.nodeType===9?c:c.ownerDocument).createTextNode(f),f[Cn]=s,s.stateNode=f}return cr(s),null;case 13:if(Et($t),f=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(kt&&Pr!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Oy(),fs(),s.flags|=98560,b=!1;else if(b=Sc(s),f!==null&&f.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Cn]=s}else fs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;cr(s),b=!1}else ln!==null&&(gp(ln),ln=null),b=!0;if(!b)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=c,s):(f=f!==null,f!==(i!==null&&i.memoizedState!==null)&&f&&(s.child.flags|=8192,(s.mode&1)!==0&&(i===null||($t.current&1)!==0?qt===0&&(qt=3):bp())),s.updateQueue!==null&&(s.flags|=4),cr(s),null);case 4:return gs(),op(i,s),i===null&&Ta(s.stateNode.containerInfo),cr(s),null;case 10:return Of(s.type._context),cr(s),null;case 17:return br(s.type)&&vc(),cr(s),null;case 19:if(Et($t),b=s.memoizedState,b===null)return cr(s),null;if(f=(s.flags&128)!==0,_=b.rendering,_===null)if(f)Ua(b,!1);else{if(qt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(_=$c(i),_!==null){for(s.flags|=128,Ua(b,!1),f=_.updateQueue,f!==null&&(s.updateQueue=f,s.flags|=4),s.subtreeFlags=0,f=c,c=s.child;c!==null;)b=c,i=f,b.flags&=14680066,_=b.alternate,_===null?(b.childLanes=0,b.lanes=i,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=_.childLanes,b.lanes=_.lanes,b.child=_.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=_.memoizedProps,b.memoizedState=_.memoizedState,b.updateQueue=_.updateQueue,b.type=_.type,i=_.dependencies,b.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),c=c.sibling;return xt($t,$t.current&1|2),s.child}i=i.sibling}b.tail!==null&&Ct()>xs&&(s.flags|=128,f=!0,Ua(b,!1),s.lanes=4194304)}else{if(!f)if(i=$c(_),i!==null){if(s.flags|=128,f=!0,c=i.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),Ua(b,!0),b.tail===null&&b.tailMode==="hidden"&&!_.alternate&&!kt)return cr(s),null}else 2*Ct()-b.renderingStartTime>xs&&c!==1073741824&&(s.flags|=128,f=!0,Ua(b,!1),s.lanes=4194304);b.isBackwards?(_.sibling=s.child,s.child=_):(c=b.last,c!==null?c.sibling=_:s.child=_,b.last=_)}return b.tail!==null?(s=b.tail,b.rendering=s,b.tail=s.sibling,b.renderingStartTime=Ct(),s.sibling=null,c=$t.current,xt($t,f?c&1|2:c&1),s):(cr(s),null);case 22:case 23:return yp(),f=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==f&&(s.flags|=8192),f&&(s.mode&1)!==0?(Dr&1073741824)!==0&&(cr(s),s.subtreeFlags&6&&(s.flags|=8192)):cr(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function K$(i,s){switch(_f(s),s.tag){case 1:return br(s.type)&&vc(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return gs(),Et(yr),Et(ar),Ff(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return Mf(s),null;case 13:if(Et($t),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));fs()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return Et($t),null;case 4:return gs(),null;case 10:return Of(s.type._context),null;case 22:case 23:return yp(),null;case 24:return null;default:return null}}var jc=!1,ur=!1,Q$=typeof WeakSet=="function"?WeakSet:Set,$e=null;function ys(i,s){var c=i.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(f){Lt(i,s,f)}else c.current=null}function sp(i,s,c){try{c()}catch(f){Lt(i,s,f)}}var L0=!1;function J$(i,s){if(yf=nc,i=cy(),uf(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var g=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var _=0,j=-1,B=-1,J=0,ce=0,de=i,ae=null;t:for(;;){for(var ke;de!==c||g!==0&&de.nodeType!==3||(j=_+g),de!==b||f!==0&&de.nodeType!==3||(B=_+f),de.nodeType===3&&(_+=de.nodeValue.length),(ke=de.firstChild)!==null;)ae=de,de=ke;for(;;){if(de===i)break t;if(ae===c&&++J===g&&(j=_),ae===b&&++ce===f&&(B=_),(ke=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=ke}c=j===-1||B===-1?null:{start:j,end:B}}else c=null}c=c||{start:0,end:0}}else c=null;for(bf={focusedElem:i,selectionRange:c},nc=!1,$e=s;$e!==null;)if(s=$e,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,$e=i;else for(;$e!==null;){s=$e;try{var Te=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var Le=Te.memoizedProps,Ot=Te.memoizedState,Y=s.stateNode,W=Y.getSnapshotBeforeUpdate(s.elementType===s.type?Le:cn(s.type,Le),Ot);Y.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var K=s.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(me){Lt(s,s.return,me)}if(i=s.sibling,i!==null){i.return=s.return,$e=i;break}$e=s.return}return Te=L0,L0=!1,Te}function Va(i,s,c){var f=s.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&i)===i){var b=g.destroy;g.destroy=void 0,b!==void 0&&sp(s,c,b)}g=g.next}while(g!==f)}}function Mc(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&i)===i){var f=c.create;c.destroy=f()}c=c.next}while(c!==s)}}function ap(i){var s=i.ref;if(s!==null){var c=i.stateNode;i.tag,i=c,typeof s=="function"?s(i):s.current=i}}function I0(i){var s=i.alternate;s!==null&&(i.alternate=null,I0(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[Cn],delete s[Ia],delete s[Ef],delete s[N$],delete s[P$])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function O0(i){return i.tag===5||i.tag===3||i.tag===4}function N0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||O0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function lp(i,s,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?c.nodeType===8?c.parentNode.insertBefore(i,s):c.insertBefore(i,s):(c.nodeType===8?(s=c.parentNode,s.insertBefore(i,c)):(s=c,s.appendChild(i)),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=mc));else if(f!==4&&(i=i.child,i!==null))for(lp(i,s,c),i=i.sibling;i!==null;)lp(i,s,c),i=i.sibling}function cp(i,s,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?c.insertBefore(i,s):c.appendChild(i);else if(f!==4&&(i=i.child,i!==null))for(cp(i,s,c),i=i.sibling;i!==null;)cp(i,s,c),i=i.sibling}var rr=null,un=!1;function _i(i,s,c){for(c=c.child;c!==null;)P0(i,s,c),c=c.sibling}function P0(i,s,c){if(Ir&&typeof Ir.onCommitFiberUnmount=="function")try{Ir.onCommitFiberUnmount(io,c)}catch{}switch(c.tag){case 5:ur||ys(c,s);case 6:var f=rr,g=un;rr=null,_i(i,s,c),rr=f,un=g,rr!==null&&(un?(i=rr,c=c.stateNode,i.nodeType===8?i.parentNode.removeChild(c):i.removeChild(c)):rr.removeChild(c.stateNode));break;case 18:rr!==null&&(un?(i=rr,c=c.stateNode,i.nodeType===8?Sf(i.parentNode,c):i.nodeType===1&&Sf(i,c),wa(i)):Sf(rr,c.stateNode));break;case 4:f=rr,g=un,rr=c.stateNode.containerInfo,un=!0,_i(i,s,c),rr=f,un=g;break;case 0:case 11:case 14:case 15:if(!ur&&(f=c.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var b=g,_=b.destroy;b=b.tag,_!==void 0&&((b&2)!==0||(b&4)!==0)&&sp(c,s,_),g=g.next}while(g!==f)}_i(i,s,c);break;case 1:if(!ur&&(ys(c,s),f=c.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=c.memoizedProps,f.state=c.memoizedState,f.componentWillUnmount()}catch(j){Lt(c,s,j)}_i(i,s,c);break;case 21:_i(i,s,c);break;case 22:c.mode&1?(ur=(f=ur)||c.memoizedState!==null,_i(i,s,c),ur=f):_i(i,s,c);break;default:_i(i,s,c)}}function D0(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var c=i.stateNode;c===null&&(c=i.stateNode=new Q$),s.forEach(function(f){var g=aA.bind(null,i,f);c.has(f)||(c.add(f),f.then(g,g))})}}function dn(i,s){var c=s.deletions;if(c!==null)for(var f=0;f<c.length;f++){var g=c[f];try{var b=i,_=s,j=_;e:for(;j!==null;){switch(j.tag){case 5:rr=j.stateNode,un=!1;break e;case 3:rr=j.stateNode.containerInfo,un=!0;break e;case 4:rr=j.stateNode.containerInfo,un=!0;break e}j=j.return}if(rr===null)throw Error(r(160));P0(b,_,g),rr=null,un=!1;var B=g.alternate;B!==null&&(B.return=null),g.return=null}catch(J){Lt(g,s,J)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)j0(s,i),s=s.sibling}function j0(i,s){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(dn(s,i),_n(i),f&4){try{Va(3,i,i.return),Mc(3,i)}catch(Le){Lt(i,i.return,Le)}try{Va(5,i,i.return)}catch(Le){Lt(i,i.return,Le)}}break;case 1:dn(s,i),_n(i),f&512&&c!==null&&ys(c,c.return);break;case 5:if(dn(s,i),_n(i),f&512&&c!==null&&ys(c,c.return),i.flags&32){var g=i.stateNode;try{rt(g,"")}catch(Le){Lt(i,i.return,Le)}}if(f&4&&(g=i.stateNode,g!=null)){var b=i.memoizedProps,_=c!==null?c.memoizedProps:b,j=i.type,B=i.updateQueue;if(i.updateQueue=null,B!==null)try{j==="input"&&b.type==="radio"&&b.name!=null&&tt(g,b),Ke(j,_);var J=Ke(j,b);for(_=0;_<B.length;_+=2){var ce=B[_],de=B[_+1];ce==="style"?se(g,de):ce==="dangerouslySetInnerHTML"?bt(g,de):ce==="children"?rt(g,de):$(g,ce,de,J)}switch(j){case"input":De(g,b);break;case"textarea":ht(g,b);break;case"select":var ae=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!b.multiple;var ke=b.value;ke!=null?oe(g,!!b.multiple,ke,!1):ae!==!!b.multiple&&(b.defaultValue!=null?oe(g,!!b.multiple,b.defaultValue,!0):oe(g,!!b.multiple,b.multiple?[]:"",!1))}g[Ia]=b}catch(Le){Lt(i,i.return,Le)}}break;case 6:if(dn(s,i),_n(i),f&4){if(i.stateNode===null)throw Error(r(162));g=i.stateNode,b=i.memoizedProps;try{g.nodeValue=b}catch(Le){Lt(i,i.return,Le)}}break;case 3:if(dn(s,i),_n(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{wa(s.containerInfo)}catch(Le){Lt(i,i.return,Le)}break;case 4:dn(s,i),_n(i);break;case 13:dn(s,i),_n(i),g=i.child,g.flags&8192&&(b=g.memoizedState!==null,g.stateNode.isHidden=b,!b||g.alternate!==null&&g.alternate.memoizedState!==null||(fp=Ct())),f&4&&D0(i);break;case 22:if(ce=c!==null&&c.memoizedState!==null,i.mode&1?(ur=(J=ur)||ce,dn(s,i),ur=J):dn(s,i),_n(i),f&8192){if(J=i.memoizedState!==null,(i.stateNode.isHidden=J)&&!ce&&(i.mode&1)!==0)for($e=i,ce=i.child;ce!==null;){for(de=$e=ce;$e!==null;){switch(ae=$e,ke=ae.child,ae.tag){case 0:case 11:case 14:case 15:Va(4,ae,ae.return);break;case 1:ys(ae,ae.return);var Te=ae.stateNode;if(typeof Te.componentWillUnmount=="function"){f=ae,c=ae.return;try{s=f,Te.props=s.memoizedProps,Te.state=s.memoizedState,Te.componentWillUnmount()}catch(Le){Lt(f,c,Le)}}break;case 5:ys(ae,ae.return);break;case 22:if(ae.memoizedState!==null){F0(de);continue}}ke!==null?(ke.return=ae,$e=ke):F0(de)}ce=ce.sibling}e:for(ce=null,de=i;;){if(de.tag===5){if(ce===null){ce=de;try{g=de.stateNode,J?(b=g.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(j=de.stateNode,B=de.memoizedProps.style,_=B!=null&&B.hasOwnProperty("display")?B.display:null,j.style.display=ie("display",_))}catch(Le){Lt(i,i.return,Le)}}}else if(de.tag===6){if(ce===null)try{de.stateNode.nodeValue=J?"":de.memoizedProps}catch(Le){Lt(i,i.return,Le)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===i)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===i)break e;for(;de.sibling===null;){if(de.return===null||de.return===i)break e;ce===de&&(ce=null),de=de.return}ce===de&&(ce=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:dn(s,i),_n(i),f&4&&D0(i);break;case 21:break;default:dn(s,i),_n(i)}}function _n(i){var s=i.flags;if(s&2){try{e:{for(var c=i.return;c!==null;){if(O0(c)){var f=c;break e}c=c.return}throw Error(r(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(rt(g,""),f.flags&=-33);var b=N0(i);cp(i,b,g);break;case 3:case 4:var _=f.stateNode.containerInfo,j=N0(i);lp(i,j,_);break;default:throw Error(r(161))}}catch(B){Lt(i,i.return,B)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Z$(i,s,c){$e=i,M0(i)}function M0(i,s,c){for(var f=(i.mode&1)!==0;$e!==null;){var g=$e,b=g.child;if(g.tag===22&&f){var _=g.memoizedState!==null||jc;if(!_){var j=g.alternate,B=j!==null&&j.memoizedState!==null||ur;j=jc;var J=ur;if(jc=_,(ur=B)&&!J)for($e=g;$e!==null;)_=$e,B=_.child,_.tag===22&&_.memoizedState!==null?B0(g):B!==null?(B.return=_,$e=B):B0(g);for(;b!==null;)$e=b,M0(b),b=b.sibling;$e=g,jc=j,ur=J}z0(i)}else(g.subtreeFlags&8772)!==0&&b!==null?(b.return=g,$e=b):z0(i)}}function z0(i){for(;$e!==null;){var s=$e;if((s.flags&8772)!==0){var c=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:ur||Mc(5,s);break;case 1:var f=s.stateNode;if(s.flags&4&&!ur)if(c===null)f.componentDidMount();else{var g=s.elementType===s.type?c.memoizedProps:cn(s.type,c.memoizedProps);f.componentDidUpdate(g,c.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var b=s.updateQueue;b!==null&&Fy(s,b,f);break;case 3:var _=s.updateQueue;if(_!==null){if(c=null,s.child!==null)switch(s.child.tag){case 5:c=s.child.stateNode;break;case 1:c=s.child.stateNode}Fy(s,_,c)}break;case 5:var j=s.stateNode;if(c===null&&s.flags&4){c=j;var B=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&c.focus();break;case"img":B.src&&(c.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var J=s.alternate;if(J!==null){var ce=J.memoizedState;if(ce!==null){var de=ce.dehydrated;de!==null&&wa(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}ur||s.flags&512&&ap(s)}catch(ae){Lt(s,s.return,ae)}}if(s===i){$e=null;break}if(c=s.sibling,c!==null){c.return=s.return,$e=c;break}$e=s.return}}function F0(i){for(;$e!==null;){var s=$e;if(s===i){$e=null;break}var c=s.sibling;if(c!==null){c.return=s.return,$e=c;break}$e=s.return}}function B0(i){for(;$e!==null;){var s=$e;try{switch(s.tag){case 0:case 11:case 15:var c=s.return;try{Mc(4,s)}catch(B){Lt(s,c,B)}break;case 1:var f=s.stateNode;if(typeof f.componentDidMount=="function"){var g=s.return;try{f.componentDidMount()}catch(B){Lt(s,g,B)}}var b=s.return;try{ap(s)}catch(B){Lt(s,b,B)}break;case 5:var _=s.return;try{ap(s)}catch(B){Lt(s,_,B)}}}catch(B){Lt(s,s.return,B)}if(s===i){$e=null;break}var j=s.sibling;if(j!==null){j.return=s.return,$e=j;break}$e=s.return}}var eA=Math.ceil,zc=A.ReactCurrentDispatcher,up=A.ReactCurrentOwner,qr=A.ReactCurrentBatchConfig,nt=0,Zt=null,Mt=null,nr=0,Dr=0,bs=Si(0),qt=0,Wa=null,xo=0,Fc=0,dp=0,Ha=null,wr=null,fp=0,xs=1/0,Yn=null,Bc=!1,pp=null,$i=null,Uc=!1,Ai=null,Vc=0,qa=0,hp=null,Wc=-1,Hc=0;function pr(){return(nt&6)!==0?Ct():Wc!==-1?Wc:Wc=Ct()}function Ti(i){return(i.mode&1)===0?1:(nt&2)!==0&&nr!==0?nr&-nr:j$.transition!==null?(Hc===0&&(Hc=fa()),Hc):(i=it,i!==0||(i=window.event,i=i===void 0?16:Vv(i.type)),i)}function fn(i,s,c,f){if(50<qa)throw qa=0,hp=null,Error(r(185));mi(i,c,f),((nt&2)===0||i!==Zt)&&(i===Zt&&((nt&2)===0&&(Fc|=c),qt===4&&Li(i,nr)),Sr(i,f),c===1&&nt===0&&(s.mode&1)===0&&(xs=Ct()+500,bc&&Ci()))}function Sr(i,s){var c=i.callbackNode;Jl(i,s);var f=ao(i,i===Zt?nr:0);if(f===0)c!==null&&Br(c),i.callbackNode=null,i.callbackPriority=0;else if(s=f&-f,i.callbackPriority!==s){if(c!=null&&Br(c),s===1)i.tag===0?D$(V0.bind(null,i)):$y(V0.bind(null,i)),I$(function(){(nt&6)===0&&Ci()}),c=null;else{switch(pa(f)){case 1:c=Xo;break;case 4:c=ua;break;case 16:c=no;break;case 536870912:c=da;break;default:c=no}c=Q0(c,U0.bind(null,i))}i.callbackPriority=s,i.callbackNode=c}}function U0(i,s){if(Wc=-1,Hc=0,(nt&6)!==0)throw Error(r(327));var c=i.callbackNode;if(ws()&&i.callbackNode!==c)return null;var f=ao(i,i===Zt?nr:0);if(f===0)return null;if((f&30)!==0||(f&i.expiredLanes)!==0||s)s=qc(i,f);else{s=f;var g=nt;nt|=2;var b=H0();(Zt!==i||nr!==s)&&(Yn=null,xs=Ct()+500,So(i,s));do try{nA();break}catch(j){W0(i,j)}while(!0);If(),zc.current=b,nt=g,Mt!==null?s=0:(Zt=null,nr=0,s=qt)}if(s!==0){if(s===2&&(g=lo(i),g!==0&&(f=g,s=mp(i,g))),s===1)throw c=Wa,So(i,0),Li(i,f),Sr(i,Ct()),c;if(s===6)Li(i,f);else{if(g=i.current.alternate,(f&30)===0&&!tA(g)&&(s=qc(i,f),s===2&&(b=lo(i),b!==0&&(f=b,s=mp(i,b))),s===1))throw c=Wa,So(i,0),Li(i,f),Sr(i,Ct()),c;switch(i.finishedWork=g,i.finishedLanes=f,s){case 0:case 1:throw Error(r(345));case 2:Eo(i,wr,Yn);break;case 3:if(Li(i,f),(f&130023424)===f&&(s=fp+500-Ct(),10<s)){if(ao(i,0)!==0)break;if(g=i.suspendedLanes,(g&f)!==f){pr(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=wf(Eo.bind(null,i,wr,Yn),s);break}Eo(i,wr,Yn);break;case 4:if(Li(i,f),(f&4194240)===f)break;for(s=i.eventTimes,g=-1;0<f;){var _=31-vr(f);b=1<<_,_=s[_],_>g&&(g=_),f&=~b}if(f=g,f=Ct()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*eA(f/1960))-f,10<f){i.timeoutHandle=wf(Eo.bind(null,i,wr,Yn),f);break}Eo(i,wr,Yn);break;case 5:Eo(i,wr,Yn);break;default:throw Error(r(329))}}}return Sr(i,Ct()),i.callbackNode===c?U0.bind(null,i):null}function mp(i,s){var c=Ha;return i.current.memoizedState.isDehydrated&&(So(i,s).flags|=256),i=qc(i,s),i!==2&&(s=wr,wr=c,s!==null&&gp(s)),i}function gp(i){wr===null?wr=i:wr.push.apply(wr,i)}function tA(i){for(var s=i;;){if(s.flags&16384){var c=s.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var f=0;f<c.length;f++){var g=c[f],b=g.getSnapshot;g=g.value;try{if(!an(b(),g))return!1}catch{return!1}}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Li(i,s){for(s&=~dp,s&=~Fc,i.suspendedLanes|=s,i.pingedLanes&=~s,i=i.expirationTimes;0<s;){var c=31-vr(s),f=1<<c;i[c]=-1,s&=~f}}function V0(i){if((nt&6)!==0)throw Error(r(327));ws();var s=ao(i,0);if((s&1)===0)return Sr(i,Ct()),null;var c=qc(i,s);if(i.tag!==0&&c===2){var f=lo(i);f!==0&&(s=f,c=mp(i,f))}if(c===1)throw c=Wa,So(i,0),Li(i,s),Sr(i,Ct()),c;if(c===6)throw Error(r(345));return i.finishedWork=i.current.alternate,i.finishedLanes=s,Eo(i,wr,Yn),Sr(i,Ct()),null}function vp(i,s){var c=nt;nt|=1;try{return i(s)}finally{nt=c,nt===0&&(xs=Ct()+500,bc&&Ci())}}function wo(i){Ai!==null&&Ai.tag===0&&(nt&6)===0&&ws();var s=nt;nt|=1;var c=qr.transition,f=it;try{if(qr.transition=null,it=1,i)return i()}finally{it=f,qr.transition=c,nt=s,(nt&6)===0&&Ci()}}function yp(){Dr=bs.current,Et(bs)}function So(i,s){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;if(c!==-1&&(i.timeoutHandle=-1,L$(c)),Mt!==null)for(c=Mt.return;c!==null;){var f=c;switch(_f(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&vc();break;case 3:gs(),Et(yr),Et(ar),Ff();break;case 5:Mf(f);break;case 4:gs();break;case 13:Et($t);break;case 19:Et($t);break;case 10:Of(f.type._context);break;case 22:case 23:yp()}c=c.return}if(Zt=i,Mt=i=Ii(i.current,null),nr=Dr=s,qt=0,Wa=null,dp=Fc=xo=0,wr=Ha=null,vo!==null){for(s=0;s<vo.length;s++)if(c=vo[s],f=c.interleaved,f!==null){c.interleaved=null;var g=f.next,b=c.pending;if(b!==null){var _=b.next;b.next=g,f.next=_}c.pending=f}vo=null}return i}function W0(i,s){do{var c=Mt;try{if(If(),Ac.current=Oc,Tc){for(var f=At.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}Tc=!1}if(bo=0,Jt=Ht=At=null,Ma=!1,za=0,up.current=null,c===null||c.return===null){qt=1,Wa=s,Mt=null;break}e:{var b=i,_=c.return,j=c,B=s;if(s=nr,j.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var J=B,ce=j,de=ce.tag;if((ce.mode&1)===0&&(de===0||de===11||de===15)){var ae=ce.alternate;ae?(ce.updateQueue=ae.updateQueue,ce.memoizedState=ae.memoizedState,ce.lanes=ae.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var ke=m0(_);if(ke!==null){ke.flags&=-257,g0(ke,_,j,b,s),ke.mode&1&&h0(b,J,s),s=ke,B=J;var Te=s.updateQueue;if(Te===null){var Le=new Set;Le.add(B),s.updateQueue=Le}else Te.add(B);break e}else{if((s&1)===0){h0(b,J,s),bp();break e}B=Error(r(426))}}else if(kt&&j.mode&1){var Ot=m0(_);if(Ot!==null){(Ot.flags&65536)===0&&(Ot.flags|=256),g0(Ot,_,j,b,s),Tf(vs(B,j));break e}}b=B=vs(B,j),qt!==4&&(qt=2),Ha===null?Ha=[b]:Ha.push(b),b=_;do{switch(b.tag){case 3:b.flags|=65536,s&=-s,b.lanes|=s;var Y=f0(b,B,s);zy(b,Y);break e;case 1:j=B;var W=b.type,K=b.stateNode;if((b.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&($i===null||!$i.has(K)))){b.flags|=65536,s&=-s,b.lanes|=s;var me=p0(b,j,s);zy(b,me);break e}}b=b.return}while(b!==null)}G0(c)}catch(Ie){s=Ie,Mt===c&&c!==null&&(Mt=c=c.return);continue}break}while(!0)}function H0(){var i=zc.current;return zc.current=Oc,i===null?Oc:i}function bp(){(qt===0||qt===3||qt===2)&&(qt=4),Zt===null||(xo&268435455)===0&&(Fc&268435455)===0||Li(Zt,nr)}function qc(i,s){var c=nt;nt|=2;var f=H0();(Zt!==i||nr!==s)&&(Yn=null,So(i,s));do try{rA();break}catch(g){W0(i,g)}while(!0);if(If(),nt=c,zc.current=f,Mt!==null)throw Error(r(261));return Zt=null,nr=0,qt}function rA(){for(;Mt!==null;)q0(Mt)}function nA(){for(;Mt!==null&&!Vl();)q0(Mt)}function q0(i){var s=K0(i.alternate,i,Dr);i.memoizedProps=i.pendingProps,s===null?G0(i):Mt=s,up.current=null}function G0(i){var s=i;do{var c=s.alternate;if(i=s.return,(s.flags&32768)===0){if(c=Y$(c,s,Dr),c!==null){Mt=c;return}}else{if(c=K$(c,s),c!==null){c.flags&=32767,Mt=c;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{qt=6,Mt=null;return}}if(s=s.sibling,s!==null){Mt=s;return}Mt=s=i}while(s!==null);qt===0&&(qt=5)}function Eo(i,s,c){var f=it,g=qr.transition;try{qr.transition=null,it=1,iA(i,s,c,f)}finally{qr.transition=g,it=f}return null}function iA(i,s,c,f){do ws();while(Ai!==null);if((nt&6)!==0)throw Error(r(327));c=i.finishedWork;var g=i.finishedLanes;if(c===null)return null;if(i.finishedWork=null,i.finishedLanes=0,c===i.current)throw Error(r(177));i.callbackNode=null,i.callbackPriority=0;var b=c.lanes|c.childLanes;if(Zl(i,b),i===Zt&&(Mt=Zt=null,nr=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||Uc||(Uc=!0,Q0(no,function(){return ws(),null})),b=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||b){b=qr.transition,qr.transition=null;var _=it;it=1;var j=nt;nt|=4,up.current=null,J$(i,c),j0(c,i),C$(bf),nc=!!yf,bf=yf=null,i.current=c,Z$(c),Wl(),nt=j,it=_,qr.transition=b}else i.current=c;if(Uc&&(Uc=!1,Ai=i,Vc=g),b=i.pendingLanes,b===0&&($i=null),Gl(c.stateNode),Sr(i,Ct()),s!==null)for(f=i.onRecoverableError,c=0;c<s.length;c++)g=s[c],f(g.value,{componentStack:g.stack,digest:g.digest});if(Bc)throw Bc=!1,i=pp,pp=null,i;return(Vc&1)!==0&&i.tag!==0&&ws(),b=i.pendingLanes,(b&1)!==0?i===hp?qa++:(qa=0,hp=i):qa=0,Ci(),null}function ws(){if(Ai!==null){var i=pa(Vc),s=qr.transition,c=it;try{if(qr.transition=null,it=16>i?16:i,Ai===null)var f=!1;else{if(i=Ai,Ai=null,Vc=0,(nt&6)!==0)throw Error(r(331));var g=nt;for(nt|=4,$e=i.current;$e!==null;){var b=$e,_=b.child;if(($e.flags&16)!==0){var j=b.deletions;if(j!==null){for(var B=0;B<j.length;B++){var J=j[B];for($e=J;$e!==null;){var ce=$e;switch(ce.tag){case 0:case 11:case 15:Va(8,ce,b)}var de=ce.child;if(de!==null)de.return=ce,$e=de;else for(;$e!==null;){ce=$e;var ae=ce.sibling,ke=ce.return;if(I0(ce),ce===J){$e=null;break}if(ae!==null){ae.return=ke,$e=ae;break}$e=ke}}}var Te=b.alternate;if(Te!==null){var Le=Te.child;if(Le!==null){Te.child=null;do{var Ot=Le.sibling;Le.sibling=null,Le=Ot}while(Le!==null)}}$e=b}}if((b.subtreeFlags&2064)!==0&&_!==null)_.return=b,$e=_;else e:for(;$e!==null;){if(b=$e,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:Va(9,b,b.return)}var Y=b.sibling;if(Y!==null){Y.return=b.return,$e=Y;break e}$e=b.return}}var W=i.current;for($e=W;$e!==null;){_=$e;var K=_.child;if((_.subtreeFlags&2064)!==0&&K!==null)K.return=_,$e=K;else e:for(_=W;$e!==null;){if(j=$e,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:Mc(9,j)}}catch(Ie){Lt(j,j.return,Ie)}if(j===_){$e=null;break e}var me=j.sibling;if(me!==null){me.return=j.return,$e=me;break e}$e=j.return}}if(nt=g,Ci(),Ir&&typeof Ir.onPostCommitFiberRoot=="function")try{Ir.onPostCommitFiberRoot(io,i)}catch{}f=!0}return f}finally{it=c,qr.transition=s}}return!1}function X0(i,s,c){s=vs(c,s),s=f0(i,s,1),i=Ri(i,s,1),s=pr(),i!==null&&(mi(i,1,s),Sr(i,s))}function Lt(i,s,c){if(i.tag===3)X0(i,i,c);else for(;s!==null;){if(s.tag===3){X0(s,i,c);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&($i===null||!$i.has(f))){i=vs(c,i),i=p0(s,i,1),s=Ri(s,i,1),i=pr(),s!==null&&(mi(s,1,i),Sr(s,i));break}}s=s.return}}function oA(i,s,c){var f=i.pingCache;f!==null&&f.delete(s),s=pr(),i.pingedLanes|=i.suspendedLanes&c,Zt===i&&(nr&c)===c&&(qt===4||qt===3&&(nr&130023424)===nr&&500>Ct()-fp?So(i,0):dp|=c),Sr(i,s)}function Y0(i,s){s===0&&((i.mode&1)===0?s=1:(s=so,so<<=1,(so&130023424)===0&&(so=4194304)));var c=pr();i=qn(i,s),i!==null&&(mi(i,s,c),Sr(i,c))}function sA(i){var s=i.memoizedState,c=0;s!==null&&(c=s.retryLane),Y0(i,c)}function aA(i,s){var c=0;switch(i.tag){case 13:var f=i.stateNode,g=i.memoizedState;g!==null&&(c=g.retryLane);break;case 19:f=i.stateNode;break;default:throw Error(r(314))}f!==null&&f.delete(s),Y0(i,c)}var K0;K0=function(i,s,c){if(i!==null)if(i.memoizedProps!==s.pendingProps||yr.current)xr=!0;else{if((i.lanes&c)===0&&(s.flags&128)===0)return xr=!1,X$(i,s,c);xr=(i.flags&131072)!==0}else xr=!1,kt&&(s.flags&1048576)!==0&&Ay(s,wc,s.index);switch(s.lanes=0,s.tag){case 2:var f=s.type;Dc(i,s),i=s.pendingProps;var g=cs(s,ar.current);ms(s,c),g=Vf(null,s,f,i,g,c);var b=Wf();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,br(f)?(b=!0,yc(s)):b=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Df(s),g.updater=Nc,s.stateNode=g,g._reactInternals=s,Kf(s,f,i,c),s=ep(null,s,f,!0,b,c)):(s.tag=0,kt&&b&&Rf(s),fr(null,s,g,c),s=s.child),s;case 16:f=s.elementType;e:{switch(Dc(i,s),i=s.pendingProps,g=f._init,f=g(f._payload),s.type=f,g=s.tag=cA(f),i=cn(f,i),g){case 0:s=Zf(null,s,f,i,c);break e;case 1:s=S0(null,s,f,i,c);break e;case 11:s=v0(null,s,f,i,c);break e;case 14:s=y0(null,s,f,cn(f.type,i),c);break e}throw Error(r(306,f,""))}return s;case 0:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),Zf(i,s,f,g,c);case 1:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),S0(i,s,f,g,c);case 3:e:{if(E0(s),i===null)throw Error(r(387));f=s.pendingProps,b=s.memoizedState,g=b.element,My(i,s),_c(s,f,null,c);var _=s.memoizedState;if(f=_.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){g=vs(Error(r(423)),s),s=C0(i,s,f,c,g);break e}else if(f!==g){g=vs(Error(r(424)),s),s=C0(i,s,f,c,g);break e}else for(Pr=wi(s.stateNode.containerInfo.firstChild),Nr=s,kt=!0,ln=null,c=Dy(s,null,f,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(fs(),f===g){s=Xn(i,s,c);break e}fr(i,s,f,c)}s=s.child}return s;case 5:return By(s),i===null&&Af(s),f=s.type,g=s.pendingProps,b=i!==null?i.memoizedProps:null,_=g.children,xf(f,g)?_=null:b!==null&&xf(f,b)&&(s.flags|=32),w0(i,s),fr(i,s,_,c),s.child;case 6:return i===null&&Af(s),null;case 13:return k0(i,s,c);case 4:return jf(s,s.stateNode.containerInfo),f=s.pendingProps,i===null?s.child=ps(s,null,f,c):fr(i,s,f,c),s.child;case 11:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),v0(i,s,f,g,c);case 7:return fr(i,s,s.pendingProps,c),s.child;case 8:return fr(i,s,s.pendingProps.children,c),s.child;case 12:return fr(i,s,s.pendingProps.children,c),s.child;case 10:e:{if(f=s.type._context,g=s.pendingProps,b=s.memoizedProps,_=g.value,xt(Cc,f._currentValue),f._currentValue=_,b!==null)if(an(b.value,_)){if(b.children===g.children&&!yr.current){s=Xn(i,s,c);break e}}else for(b=s.child,b!==null&&(b.return=s);b!==null;){var j=b.dependencies;if(j!==null){_=b.child;for(var B=j.firstContext;B!==null;){if(B.context===f){if(b.tag===1){B=Gn(-1,c&-c),B.tag=2;var J=b.updateQueue;if(J!==null){J=J.shared;var ce=J.pending;ce===null?B.next=B:(B.next=ce.next,ce.next=B),J.pending=B}}b.lanes|=c,B=b.alternate,B!==null&&(B.lanes|=c),Nf(b.return,c,s),j.lanes|=c;break}B=B.next}}else if(b.tag===10)_=b.type===s.type?null:b.child;else if(b.tag===18){if(_=b.return,_===null)throw Error(r(341));_.lanes|=c,j=_.alternate,j!==null&&(j.lanes|=c),Nf(_,c,s),_=b.sibling}else _=b.child;if(_!==null)_.return=b;else for(_=b;_!==null;){if(_===s){_=null;break}if(b=_.sibling,b!==null){b.return=_.return,_=b;break}_=_.return}b=_}fr(i,s,g.children,c),s=s.child}return s;case 9:return g=s.type,f=s.pendingProps.children,ms(s,c),g=Wr(g),f=f(g),s.flags|=1,fr(i,s,f,c),s.child;case 14:return f=s.type,g=cn(f,s.pendingProps),g=cn(f.type,g),y0(i,s,f,g,c);case 15:return b0(i,s,s.type,s.pendingProps,c);case 17:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),Dc(i,s),s.tag=1,br(f)?(i=!0,yc(s)):i=!1,ms(s,c),u0(s,f,g),Kf(s,f,g,c),ep(null,s,f,!0,i,c);case 19:return _0(i,s,c);case 22:return x0(i,s,c)}throw Error(r(156,s.tag))};function Q0(i,s){return Ul(i,s)}function lA(i,s,c,f){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(i,s,c,f){return new lA(i,s,c,f)}function xp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function cA(i){if(typeof i=="function")return xp(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ne)return 11;if(i===V)return 14}return 2}function Ii(i,s){var c=i.alternate;return c===null?(c=Gr(i.tag,s,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=s,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&14680064,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,s=i.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c}function Gc(i,s,c,f,g,b){var _=2;if(f=i,typeof i=="function")xp(i)&&(_=1);else if(typeof i=="string")_=5;else e:switch(i){case P:return Co(c.children,g,b,s);case I:_=8,g|=8;break;case re:return i=Gr(12,c,s,g|2),i.elementType=re,i.lanes=b,i;case X:return i=Gr(13,c,s,g),i.elementType=X,i.lanes=b,i;case F:return i=Gr(19,c,s,g),i.elementType=F,i.lanes=b,i;case O:return Xc(c,g,b,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Z:_=10;break e;case ee:_=9;break e;case ne:_=11;break e;case V:_=14;break e;case H:_=16,f=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return s=Gr(_,c,s,g),s.elementType=i,s.type=f,s.lanes=b,s}function Co(i,s,c,f){return i=Gr(7,i,f,s),i.lanes=c,i}function Xc(i,s,c,f){return i=Gr(22,i,f,s),i.elementType=O,i.lanes=c,i.stateNode={isHidden:!1},i}function wp(i,s,c){return i=Gr(6,i,null,s),i.lanes=c,i}function Sp(i,s,c){return s=Gr(4,i.children!==null?i.children:[],i.key,s),s.lanes=c,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function uA(i,s,c,f,g){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yo(0),this.expirationTimes=Yo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yo(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Ep(i,s,c,f,g,b,_,j,B){return i=new uA(i,s,c,j,B),s===1?(s=1,b===!0&&(s|=8)):s=0,b=Gr(3,null,null,s),i.current=b,b.stateNode=i,b.memoizedState={element:f,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},Df(b),i}function dA(i,s,c){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:f==null?null:""+f,children:i,containerInfo:s,implementation:c}}function J0(i){if(!i)return Ei;i=i._reactInternals;e:{if(Bn(i)!==i||i.tag!==1)throw Error(r(170));var s=i;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(br(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(r(171))}if(i.tag===1){var c=i.type;if(br(c))return Ry(i,c,s)}return s}function Z0(i,s,c,f,g,b,_,j,B){return i=Ep(c,f,!0,i,g,b,_,j,B),i.context=J0(null),c=i.current,f=pr(),g=Ti(c),b=Gn(f,g),b.callback=s??null,Ri(c,b,g),i.current.lanes=g,mi(i,g,f),Sr(i,f),i}function Yc(i,s,c,f){var g=s.current,b=pr(),_=Ti(g);return c=J0(c),s.context===null?s.context=c:s.pendingContext=c,s=Gn(b,_),s.payload={element:i},f=f===void 0?null:f,f!==null&&(s.callback=f),i=Ri(g,s,_),i!==null&&(fn(i,g,_,b),Rc(i,g,_)),_}function Kc(i){return i=i.current,i.child?(i.child.tag===5,i.child.stateNode):null}function eb(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<s?c:s}}function Cp(i,s){eb(i,s),(i=i.alternate)&&eb(i,s)}function fA(){return null}var tb=typeof reportError=="function"?reportError:function(i){console.error(i)};function kp(i){this._internalRoot=i}Qc.prototype.render=kp.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));Yc(i,s,null,null)},Qc.prototype.unmount=kp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;wo(function(){Yc(null,i,null,null)}),s[Un]=null}};function Qc(i){this._internalRoot=i}Qc.prototype.unstable_scheduleHydration=function(i){if(i){var s=ga();i={blockedOn:null,target:i,priority:s};for(var c=0;c<sn.length&&s!==0&&s<sn[c].priority;c++);sn.splice(c,0,i),c===0&&ya(i)}};function Rp(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Jc(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function rb(){}function pA(i,s,c,f,g){if(g){if(typeof f=="function"){var b=f;f=function(){var J=Kc(_);b.call(J)}}var _=Z0(s,f,i,0,null,!1,!1,"",rb);return i._reactRootContainer=_,i[Un]=_.current,Ta(i.nodeType===8?i.parentNode:i),wo(),_}for(;g=i.lastChild;)i.removeChild(g);if(typeof f=="function"){var j=f;f=function(){var J=Kc(B);j.call(J)}}var B=Ep(i,0,!1,null,null,!1,!1,"",rb);return i._reactRootContainer=B,i[Un]=B.current,Ta(i.nodeType===8?i.parentNode:i),wo(function(){Yc(s,B,c,f)}),B}function Zc(i,s,c,f,g){var b=c._reactRootContainer;if(b){var _=b;if(typeof g=="function"){var j=g;g=function(){var B=Kc(_);j.call(B)}}Yc(s,_,i,g)}else _=pA(c,s,i,g,f);return Kc(_)}ha=function(i){switch(i.tag){case 3:var s=i.stateNode;if(s.current.memoizedState.isDehydrated){var c=hi(s.pendingLanes);c!==0&&(Ko(s,c|1),Sr(s,Ct()),(nt&6)===0&&(xs=Ct()+500,Ci()))}break;case 13:wo(function(){var f=qn(i,1);if(f!==null){var g=pr();fn(f,i,1,g)}}),Cp(i,1)}},Qo=function(i){if(i.tag===13){var s=qn(i,134217728);if(s!==null){var c=pr();fn(s,i,134217728,c)}Cp(i,134217728)}},ma=function(i){if(i.tag===13){var s=Ti(i),c=qn(i,s);if(c!==null){var f=pr();fn(c,i,s,f)}Cp(i,s)}},ga=function(){return it},va=function(i,s){var c=it;try{return it=i,s()}finally{it=c}},ve=function(i,s,c){switch(s){case"input":if(De(i,c),s=c.name,c.type==="radio"&&s!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<c.length;s++){var f=c[s];if(f!==i&&f.form===i.form){var g=gc(f);if(!g)throw Error(r(90));Xe(f),De(f,g)}}}break;case"textarea":ht(i,c);break;case"select":s=c.value,s!=null&&oe(i,!!c.multiple,s,!1)}},Wt=vp,Zr=wo;var hA={usingClientEntryPoint:!1,Events:[Oa,as,gc,Ze,dt,vp]},Ga={findFiberByHostInstance:po,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mA={bundleType:Ga.bundleType,version:Ga.version,rendererPackageName:Ga.rendererPackageName,rendererConfig:Ga.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ca(i),i===null?null:i.stateNode},findFiberByHostInstance:Ga.findFiberByHostInstance||fA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eu.isDisabled&&eu.supportsFiber)try{io=eu.inject(mA),Ir=eu}catch{}}return Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hA,Er.createPortal=function(i,s){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rp(s))throw Error(r(200));return dA(i,s,null,c)},Er.createRoot=function(i,s){if(!Rp(i))throw Error(r(299));var c=!1,f="",g=tb;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Ep(i,1,!1,null,null,c,!1,f,g),i[Un]=s.current,Ta(i.nodeType===8?i.parentNode:i),new kp(s)},Er.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=ca(s),i=i===null?null:i.stateNode,i},Er.flushSync=function(i){return wo(i)},Er.hydrate=function(i,s,c){if(!Jc(s))throw Error(r(200));return Zc(null,i,s,!0,c)},Er.hydrateRoot=function(i,s,c){if(!Rp(i))throw Error(r(405));var f=c!=null&&c.hydratedSources||null,g=!1,b="",_=tb;if(c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onRecoverableError!==void 0&&(_=c.onRecoverableError)),s=Z0(s,null,i,1,c??null,g,!1,b,_),i[Un]=s.current,Ta(i),f)for(i=0;i<f.length;i++)c=f[i],g=c._getVersion,g=g(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,g]:s.mutableSourceEagerHydrationData.push(c,g);return new Qc(s)},Er.render=function(i,s,c){if(!Jc(s))throw Error(r(200));return Zc(null,i,s,!1,c)},Er.unmountComponentAtNode=function(i){if(!Jc(i))throw Error(r(40));return i._reactRootContainer?(wo(function(){Zc(null,null,i,!1,function(){i._reactRootContainer=null,i[Un]=null})}),!0):!1},Er.unstable_batchedUpdates=vp,Er.unstable_renderSubtreeIntoContainer=function(i,s,c,f){if(!Jc(c))throw Error(r(200));if(i==null||i._reactInternals===void 0)throw Error(r(38));return Zc(i,s,c,!1,f)},Er.version="18.3.1-next-f1338f8080-20240426",Er}var Mb;function _E(){if(Mb)return Fp.exports;Mb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Fp.exports=rI(),Fp.exports}var zb;function nI(){if(zb)return hu;zb=1;var e=_E();return hu.createRoot=e.createRoot,hu.hydrateRoot=e.hydrateRoot,hu}var $E=nI();function iI(e,t){return Ig(t),$E.hydrateRoot(t,e)}function oI(e,t){Ig(t);var r=$E.createRoot(t);return r.render(e),r}function sI(e){return e.unmount(),!0}var Bm=e=>{if(e!=null){var t=e.nodeType===1;if(t&&typeof e.getBoundingClientRect=="function")return e.getBoundingClientRect()}},al={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},aI=["ms","Moz","O","Webkit"],lI=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(al).forEach(e=>{aI.forEach(t=>{al[lI(t,e)]=al[e]})});function cI(e,t,r){var n=t==null||typeof t=="boolean"||t==="";return n?"":!r&&typeof t=="number"&&t!==0&&!(al.hasOwnProperty(e)&&al[e])?t+"px":(""+t).trim()}function uI(e,t){var r=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,a=cI(n,t[n],o);n==="float"&&(n="cssFloat"),o?r.setProperty(n,a):r[n]=a}}var Fb=e=>{var t=e.offsetHeight,r=e.offsetWidth,n=e.offsetLeft,o=e.offsetTop;for(e=e.offsetParent;e&&e.nodeType===1;)n+=e.offsetLeft+e.clientLeft-e.scrollLeft,o+=e.offsetTop+e.clientTop-e.scrollTop,e=e.offsetParent;return o-=window.scrollY,n-=window.scrollX,{width:r,height:t,top:o,left:n}},Bb=(e,t,r)=>{var n=t||e&&e.parentNode;e&&n&&setTimeout(()=>{if(e.isConnected&&n.isConnected){var o=Fb(n),a=Fb(e),l=a.height,u=a.left,d=a.top,p=a.width,h=u-o.left,m=d-o.top;r(h,m,p,l,u,d)}},0)},dI={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},Pu={blur(e){try{e.blur()}catch{}},focus(e){try{var t=e.nodeName;e.getAttribute("tabIndex")==null&&e.isContentEditable!==!0&&dI[t]==null&&e.setAttribute("tabIndex","-1"),e.focus()}catch{}},measure(e,t){Bb(e,null,t)},measureInWindow(e,t){e&&setTimeout(()=>{var r=Bm(e),n=r.height,o=r.left,a=r.top,l=r.width;t(o,a,l,n)},0)},measureLayout(e,t,r,n){Bb(e,t,n)},updateView(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];switch(r){case"style":{uI(e,n);break}case"class":case"className":{e.setAttribute("class",n);break}case"text":case"value":e.value=n;break;default:e.setAttribute(r,n)}}},configureNextLayoutAnimation(e,t){t()},setLayoutAnimationEnabledExperimental(){}};function Um(){return Um=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Um.apply(null,arguments)}var fI={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},pI={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},hI={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},mI={onBlur:!0,onFocus:!0},gI={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},vI={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},yI={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},bI={style:!0};function xI(e,t){var r={};for(var n in e)e.hasOwnProperty(n)&&t[n]===!0&&(r[n]=e[n]);return r}var Ub=zo?x.useLayoutEffect:x.useEffect,Vm="__reactLayoutHandler",Vp=null;function wI(){return zo&&typeof window.ResizeObserver<"u"&&Vp==null&&(Vp=new window.ResizeObserver(function(e){e.forEach(t=>{var r=t.target,n=r[Vm];typeof n=="function"&&Pu.measure(r,(o,a,l,u,d,p)=>{var h={nativeEvent:{layout:{x:o,y:a,width:l,height:u,left:d,top:p}},timeStamp:Date.now()};Object.defineProperty(h.nativeEvent,"target",{enumerable:!0,get:()=>t.target}),n(h)})})})),Vp}function SI(e,t){var r=wI();Ub(()=>{var n=e.current;n!=null&&(n[Vm]=t)},[e,t]),Ub(()=>{var n=e.current;return n!=null&&r!=null&&(typeof n[Vm]=="function"?r.observe(n):r.unobserve(n)),()=>{n!=null&&r!=null&&r.unobserve(n)}},[e,r])}function EI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(o){t.forEach(a=>{if(a!=null){if(typeof a=="function"){a(o);return}if(typeof a=="object"){a.current=o;return}console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(a))}})}}function CI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return x.useMemo(()=>EI(...t),[...t])}var Vb=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():Object.freeze({});function kI(e){var t=x.useRef(Vb);return t.current===Vb&&(t.current=e()),t.current}function RI(e){e.pointerEvents,e.style;var t=kI(()=>r=>{r!=null&&(r.measure=n=>Pu.measure(r,n),r.measureLayout=(n,o,a)=>Pu.measureLayout(r,n,a,o),r.measureInWindow=n=>Pu.measureInWindow(r,n))});return t}var Wb=()=>{},_I={},$I=[];function Hb(e){return e>20?e%20:e}function AE(e,t){var r,n=!1,o,a,l=e.changedTouches,u=e.type,d=e.metaKey===!0,p=e.shiftKey===!0,h=l&&l[0].force||0,m=Hb(l&&l[0].identifier||0),y=l&&l[0].clientX||e.clientX,w=l&&l[0].clientY||e.clientY,E=l&&l[0].pageX||e.pageX,S=l&&l[0].pageY||e.pageY,C=typeof e.preventDefault=="function"?e.preventDefault.bind(e):Wb,R=e.timeStamp;function k(P){return Array.prototype.slice.call(P).map(I=>({force:I.force,identifier:Hb(I.identifier),get locationX(){return D(I.clientX)},get locationY(){return N(I.clientY)},pageX:I.pageX,pageY:I.pageY,target:I.target,timestamp:R}))}if(l!=null)o=k(l),a=k(e.touches);else{var $=[{force:h,identifier:m,get locationX(){return D(y)},get locationY(){return N(w)},pageX:E,pageY:S,target:e.target,timestamp:R}];o=$,a=u==="mouseup"||u==="dragstart"?$I:$}var A={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:e.defaultPrevented,dispatchConfig:_I,eventPhase:e.eventPhase,isDefaultPrevented(){return e.defaultPrevented},isPropagationStopped(){return n},isTrusted:e.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:d,shiftKey:p,changedTouches:o,force:h,identifier:m,get locationX(){return D(y)},get locationY(){return N(w)},pageX:E,pageY:S,target:e.target,timestamp:R,touches:a,type:u},persist:Wb,preventDefault:C,stopPropagation(){n=!0},target:e.target,timeStamp:R,touchHistory:t.touchHistory};function D(P){if(r=r||Bm(A.currentTarget),r)return P-r.left}function N(P){if(r=r||Bm(A.currentTarget),r)return P-r.top}return A}var AI="mousedown",TI="mousemove",LI="mouseup",II="dragstart",OI="touchstart",NI="touchmove",PI="touchend",DI="touchcancel",jI="scroll",MI="select",zI="selectionchange";function TE(e){return e===OI||e===AI}function LE(e){return e===NI||e===TI}function IE(e){return e===PI||e===LI||OE(e)}function OE(e){return e===DI||e===II}function FI(e){return e===jI}function BI(e){return e===MI||e===zI}function UI(){var e=window.getSelection(),t=e.toString(),r=e.anchorNode,n=e.focusNode,o=r&&r.nodeType===window.Node.TEXT_NODE||n&&n.nodeType===window.Node.TEXT_NODE;return t.length>=1&&t!==`
12
- `&&o}var NE="__reactResponderId";function VI(e){if(e.type==="selectionchange"){var t=window.getSelection().anchorNode;return qb(t)}else{var r=e.composedPath!=null?e.composedPath():qb(e.target);return r}}function qb(e){for(var t=[];e!=null&&e!==document.body;)t.push(e),e=e.parentNode;return t}function WI(e){return e!=null?e[NE]:null}function HI(e,t){e!=null&&(e[NE]=t)}function qI(e){for(var t=[],r=[],n=VI(e),o=0;o<n.length;o++){var a=n[o],l=WI(a);l!=null&&(t.push(l),r.push(a))}return{idPath:t,nodePath:r}}function GI(e,t){var r=e.length,n=t.length;if(r===0||n===0||e[r-1]!==t[n-1])return null;var o=e[0],a=0,l=t[0],u=0;r-n>0&&(a=r-n,o=e[a],r=n),n-r>0&&(u=n-r,l=t[u],n=r);for(var d=r;d--;){if(o===l)return o;o=e[a++],l=t[u++]}return null}function XI(e,t){if(!t||t.length===0)return!1;for(var r=0;r<t.length;r++){var n=t[r].target;if(n!=null&&e.contains(n))return!0}return!1}function YI(e){return e.type==="selectionchange"?UI():e.type==="select"}function KI(e){var t=e.altKey,r=e.button,n=e.buttons,o=e.ctrlKey,a=e.type,l=a==="touchstart"||a==="touchmove",u=a==="mousedown"&&(r===0||n===1),d=a==="mousemove"&&n===1,p=t===!1&&o===!1;return!!(l||u&&p||d&&p)}var Gb=20;function Kr(e){return e.timeStamp||e.timestamp}function QI(e){return{touchActive:!0,startPageX:e.pageX,startPageY:e.pageY,startTimeStamp:Kr(e),currentPageX:e.pageX,currentPageY:e.pageY,currentTimeStamp:Kr(e),previousPageX:e.pageX,previousPageY:e.pageY,previousTimeStamp:Kr(e)}}function JI(e,t){e.touchActive=!0,e.startPageX=t.pageX,e.startPageY=t.pageY,e.startTimeStamp=Kr(t),e.currentPageX=t.pageX,e.currentPageY=t.pageY,e.currentTimeStamp=Kr(t),e.previousPageX=t.pageX,e.previousPageY=t.pageY,e.previousTimeStamp=Kr(t)}function Ng(e){var t=e.identifier;return t==null&&console.error("Touch object is missing identifier."),t}function ZI(e,t){var r=Ng(e),n=t.touchBank[r];n?JI(n,e):t.touchBank[r]=QI(e),t.mostRecentTimeStamp=Kr(e)}function e3(e,t){var r=t.touchBank[Ng(e)];r?(r.touchActive=!0,r.previousPageX=r.currentPageX,r.previousPageY=r.currentPageY,r.previousTimeStamp=r.currentTimeStamp,r.currentPageX=e.pageX,r.currentPageY=e.pageY,r.currentTimeStamp=Kr(e),t.mostRecentTimeStamp=Kr(e)):console.warn(`Cannot record touch move without a touch start.
13
- `,"Touch Move: "+PE(e)+`
14
- `,"Touch Bank: "+DE(t))}function t3(e,t){var r=t.touchBank[Ng(e)];r?(r.touchActive=!1,r.previousPageX=r.currentPageX,r.previousPageY=r.currentPageY,r.previousTimeStamp=r.currentTimeStamp,r.currentPageX=e.pageX,r.currentPageY=e.pageY,r.currentTimeStamp=Kr(e),t.mostRecentTimeStamp=Kr(e)):console.warn(`Cannot record touch end without a touch start.
15
- `,"Touch End: "+PE(e)+`
16
- `,"Touch Bank: "+DE(t))}function PE(e){return JSON.stringify({identifier:e.identifier,pageX:e.pageX,pageY:e.pageY,timestamp:Kr(e)})}function DE(e){var t=e.touchBank,r=JSON.stringify(t.slice(0,Gb));return t.length>Gb&&(r+=" (original size: "+t.length+")"),r}class r3{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(t,r){var n=this._touchHistory;if(LE(t))r.changedTouches.forEach(u=>e3(u,n));else if(TE(t))r.changedTouches.forEach(u=>ZI(u,n)),n.numberActiveTouches=r.touches.length,n.numberActiveTouches===1&&(n.indexOfSingleActiveTouch=r.touches[0].identifier);else if(IE(t)&&(r.changedTouches.forEach(u=>t3(u,n)),n.numberActiveTouches=r.touches.length,n.numberActiveTouches===1))for(var o=n.touchBank,a=0;a<o.length;a++){var l=o[a];if(l!=null&&l.touchActive){n.indexOfSingleActiveTouch=a;break}}}get touchHistory(){return this._touchHistory}}var n3={},Xb=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],Yb=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],i3=["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}],o3={touchstart:Xb,mousedown:Xb,touchmove:Yb,mousemove:Yb,scroll:i3},Wm={id:null,idPath:null,node:null},Qu=new Map,Ni=!1,$n=0,In={id:null,node:null,idPath:null},Hm=new r3;function fl(e){In=e}function pl(e){var t=Qu.get(e);return t??n3}function Wp(e){var t=e.type,r=e.target;if(t==="touchstart"&&(Ni=!0),(t==="touchmove"||$n>1)&&(Ni=!1),!(t==="mousedown"&&Ni||t==="mousemove"&&Ni||t==="mousemove"&&$n<1)){if(Ni&&t==="mouseup"){$n===0&&(Ni=!1);return}var n=TE(t)&&KI(e),o=LE(t),a=IE(t),l=FI(t),u=BI(t),d=AE(e,Hm);(n||o||a)&&(e.touches?$n=e.touches.length:n?$n=1:a&&($n=0),Hm.recordTouchTrack(t,d.nativeEvent));var p=qI(e),h=!1,m;if(n||o||l&&$n>0){var y=In.idPath,w=p.idPath;if(y!=null&&w!=null){var E=GI(y,w);if(E!=null){var S=w.indexOf(E),C=S+(E===In.id?1:0);p={idPath:w.slice(C),nodePath:p.nodePath.slice(C)}}else p=null}p!=null&&(m=s3(p,e,d),m!=null&&(a3(d,m),h=!0))}if(In.id!=null&&In.node!=null){var R=In,k=R.id,$=R.node,A=pl(k),D=A.onResponderStart,N=A.onResponderMove,P=A.onResponderEnd,I=A.onResponderRelease,re=A.onResponderTerminate,Z=A.onResponderTerminationRequest;if(d.bubbles=!1,d.cancelable=!1,d.currentTarget=$,n)D!=null&&(d.dispatchConfig.registrationName="onResponderStart",D(d));else if(o)N!=null&&(d.dispatchConfig.registrationName="onResponderMove",N(d));else{var ee=OE(t)||t==="contextmenu"||t==="blur"&&r===window||t==="blur"&&r.contains($)&&e.relatedTarget!==$||l&&$n===0||l&&r.contains($)&&r!==$||u&&YI(e),ne=a&&!ee&&!XI($,e.touches);if(a&&P!=null&&(d.dispatchConfig.registrationName="onResponderEnd",P(d)),ne&&(I!=null&&(d.dispatchConfig.registrationName="onResponderRelease",I(d)),fl(Wm)),ee){var X=!0;(t==="contextmenu"||t==="scroll"||t==="selectionchange")&&(h?X=!1:Z!=null&&(d.dispatchConfig.registrationName="onResponderTerminationRequest",Z(d)===!1&&(X=!1))),X&&(re!=null&&(d.dispatchConfig.registrationName="onResponderTerminate",re(d)),fl(Wm),Ni=!1,$n=0)}}}}}function s3(e,t,r){var n=o3[t.type];if(n!=null){for(var o=e.idPath,a=e.nodePath,l=n[0],u=n[1],d=n[2].bubbles,p=function(N,P,I){var re=pl(N),Z=re[I];if(Z!=null&&(r.currentTarget=P,Z(r)===!0)){var ee=o.slice(o.indexOf(N));return{id:N,node:P,idPath:ee}}},h=o.length-1;h>=0;h--){var m=o[h],y=a[h],w=p(m,y,l);if(w!=null)return w;if(r.isPropagationStopped()===!0)return}if(d)for(var E=0;E<o.length;E++){var S=o[E],C=a[E],R=p(S,C,u);if(R!=null)return R;if(r.isPropagationStopped()===!0)return}else{var k=o[0],$=a[0],A=t.target;if(A===$)return p(k,$,u)}}}function a3(e,t){var r=In,n=r.id,o=r.node,a=t.id,l=t.node,u=pl(a),d=u.onResponderGrant,p=u.onResponderReject;if(e.bubbles=!1,e.cancelable=!1,e.currentTarget=l,n==null)d!=null&&(e.currentTarget=l,e.dispatchConfig.registrationName="onResponderGrant",d(e)),fl(t);else{var h=pl(n),m=h.onResponderTerminate,y=h.onResponderTerminationRequest,w=!0;y!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName="onResponderTerminationRequest",y(e)===!1&&(w=!1)),w?(m!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName="onResponderTerminate",m(e)),d!=null&&(e.currentTarget=l,e.dispatchConfig.registrationName="onResponderGrant",d(e)),fl(t)):p!=null&&(e.currentTarget=l,e.dispatchConfig.registrationName="onResponderReject",p(e))}}var l3=["blur","scroll"],c3=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"];function u3(){zo&&window.__reactResponderSystemActive==null&&(window.addEventListener("blur",Wp),c3.forEach(e=>{document.addEventListener(e,Wp)}),l3.forEach(e=>{document.addEventListener(e,Wp,!0)}),window.__reactResponderSystemActive=!0)}function d3(e,t,r){HI(t,e),Qu.set(e,r)}function Kb(e){In.id===e&&f3(),Qu.has(e)&&Qu.delete(e)}function f3(){var e=In,t=e.id,r=e.node;if(t!=null&&r!=null){var n=pl(t),o=n.onResponderTerminate;if(o!=null){var a=AE({},Hm);a.currentTarget=r,o(a)}fl(Wm)}Ni=!1,$n=0}function p3(){return In.node}var h3={},m3=0;function g3(e){var t=x.useRef(null);return t.current==null&&(t.current=e()),t.current}function v3(e,t){t===void 0&&(t=h3);var r=g3(()=>m3++),n=x.useRef(!1);x.useEffect(()=>(u3(),()=>{Kb(r)}),[r]),x.useEffect(()=>{var o=t,a=o.onMoveShouldSetResponder,l=o.onMoveShouldSetResponderCapture,u=o.onScrollShouldSetResponder,d=o.onScrollShouldSetResponderCapture,p=o.onSelectionChangeShouldSetResponder,h=o.onSelectionChangeShouldSetResponderCapture,m=o.onStartShouldSetResponder,y=o.onStartShouldSetResponderCapture,w=a!=null||l!=null||u!=null||d!=null||p!=null||h!=null||m!=null||y!=null,E=e.current;w?(d3(r,E,t),n.current=!0):n.current&&(Kb(r),n.current=!1)},[t,e,r]),x.useDebugValue({isResponder:e.current===p3()}),x.useDebugValue(t)}var y3=x.createContext(!1),b3=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],x3=Object.assign({},fI,pI,hI,mI,gI,vI,yI,bI,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),w3=e=>xI(e,x3),qm=x.forwardRef((e,t)=>{var r=e.hrefAttrs,n=e.onLayout,o=e.onMoveShouldSetResponder,a=e.onMoveShouldSetResponderCapture,l=e.onResponderEnd,u=e.onResponderGrant,d=e.onResponderMove,p=e.onResponderReject,h=e.onResponderRelease,m=e.onResponderStart,y=e.onResponderTerminate,w=e.onResponderTerminationRequest,E=e.onScrollShouldSetResponder,S=e.onScrollShouldSetResponderCapture,C=e.onSelectionChangeShouldSetResponder,R=e.onSelectionChangeShouldSetResponderCapture,k=e.onStartShouldSetResponder,$=e.onStartShouldSetResponderCapture,A=Sd(e,b3),D=x.useContext(y3),N=x.useRef(null),P=JL(),I=P.direction;SI(N,n),v3(N,{onMoveShouldSetResponder:o,onMoveShouldSetResponderCapture:a,onResponderEnd:l,onResponderGrant:u,onResponderMove:d,onResponderReject:p,onResponderRelease:h,onResponderStart:m,onResponderTerminate:y,onResponderTerminationRequest:w,onScrollShouldSetResponder:E,onScrollShouldSetResponderCapture:S,onSelectionChangeShouldSetResponder:C,onSelectionChangeShouldSetResponderCapture:R,onStartShouldSetResponder:k,onStartShouldSetResponderCapture:$});var re="div",Z=e.lang!=null?RE(e.lang):null,ee=e.dir||Z,ne=ee||I,X=w3(A);if(X.dir=ee,X.style=[Qb.view$raw,D&&Qb.inline,e.style],e.href!=null&&(re="a",r!=null)){var F=r.download,V=r.rel,H=r.target;F!=null&&(X.download=F),V!=null&&(X.rel=V),typeof H=="string"&&(X.target=H.charAt(0)!=="_"?"_"+H:H)}var O=RI(X),L=CI(N,O,t);return X.ref=L,ZL(re,X,{writingDirection:ne})});qm.displayName="View";var Qb=Rl.create({view$raw:{alignContent:"flex-start",alignItems:"stretch",backgroundColor:"transparent",border:"0 solid black",boxSizing:"border-box",display:"flex",flexBasis:"auto",flexDirection:"column",flexShrink:0,listStyle:"none",margin:0,minHeight:0,minWidth:0,padding:0,position:"relative",textDecoration:"none",zIndex:0},inline:{display:"inline-flex"}}),Hp,Jb;function S3(){if(Jb)return Hp;Jb=1;function e(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(!t){var l;if(r===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=0;l=new Error(r.replace(/%s/g,function(){return String(o[u++])})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}return Hp=e,Hp}var E3=S3();const Du=Qr(E3);var C3=x.createContext(null),Pg=x.forwardRef((e,t)=>{var r=e.children,n=e.WrapperComponent,o=x.createElement(qm,{children:r,key:1,style:Zb.appContainer});return n&&(o=x.createElement(n,null,o)),x.createElement(C3.Provider,{value:e.rootTag},x.createElement(qm,{ref:t,style:Zb.appContainer},o))});Pg.displayName="AppContainer";var Zb=Rl.create({appContainer:{flex:1,pointerEvents:"box-none"}});function k3(e,t,r,n){var o=n.hydrate,a=n.initialProps,l=n.rootTag,u=o?iI:oI;return Du(l,"Expect to have a valid rootTag, instead got ",l),u(Ee.createElement(Pg,{WrapperComponent:t,ref:r,rootTag:l},Ee.createElement(e,a)),l)}function R3(e,t,r){var n=Ee.createElement(Pg,{WrapperComponent:r,rootTag:{}},Ee.createElement(e,t)),o=a=>{var l=Rl.getSheet();return Ee.createElement("style",Um({},a,{dangerouslySetInnerHTML:{__html:l.textContent},id:l.id}))};return{element:n,getStyleElement:o}}var ex={},Kn={},qp=e=>e(),Ya;class hl{static getAppKeys(){return Object.keys(Kn)}static getApplication(t,r){return Du(Kn[t]&&Kn[t].getApplication,"Application "+t+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),Kn[t].getApplication(r)}static registerComponent(t,r){return Kn[t]={getApplication:n=>R3(qp(r),n?n.initialProps:ex,Ya&&Ya(n)),run:n=>k3(qp(r),Ya&&Ya(n),n.callback,{hydrate:n.hydrate||!1,initialProps:n.initialProps||ex,mode:n.mode||"concurrent",rootTag:n.rootTag})},t}static registerConfig(t){t.forEach(r=>{var n=r.appKey,o=r.component,a=r.run;a?hl.registerRunnable(n,a):(Du(o,"No component provider passed in"),hl.registerComponent(n,o))})}static registerRunnable(t,r){return Kn[t]={run:r},t}static runApplication(t,r){return Du(Kn[t]&&Kn[t].run,'Application "'+t+'" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'),Kn[t].run(r)}static setComponentProviderInstrumentationHook(t){qp=t}static setWrapperComponentProvider(t){Ya=t}static unmountApplicationComponentAtRootTag(t){sI(t)}}var Lr=_E();const _3=Qr(Lr);var Gp={exports:{}},Ka={};var tx;function $3(){if(tx)return Ka;tx=1;var e=Og(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,p){var h,m={},y=null,w=null;p!==void 0&&(y=""+p),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(w=d.ref);for(h in d)n.call(d,h)&&!a.hasOwnProperty(h)&&(m[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:t,type:u,key:y,ref:w,props:m,_owner:o.current}}return Ka.Fragment=r,Ka.jsx=l,Ka.jsxs=l,Ka}var rx;function A3(){return rx||(rx=1,Gp.exports=$3()),Gp.exports}var v=A3();const T3={en:{id:"en"}},L3=T3.en.id;function I3({prop:e,defaultProp:t,onChange:r}){const[n,o]=x.useState(e??t),a=e!==void 0,l=a?e:n,u=x.useRef(r);u.current=r;const d=x.useRef(l),p=x.useCallback(h=>{const m=typeof h=="function"?h(d.current):h;a||x.startTransition(()=>{o(m)}),u.current?.(m),d.current=m},[a]);return x.useEffect(()=>{e!==void 0&&(o(e),d.current=e)},[e]),[l,p]}function O3(e,t){if(Object.is(e,t))return!0;const r=e,n=t,o=Object.keys(r),a=Object.keys(n);return o.length!==a.length?!1:o.every(l=>Object.prototype.hasOwnProperty.call(n,l)&&Object.is(r[l],n[l]))}function Cd(e,t){const r=x.createContext(t),n=({children:a,value:l})=>{const u=x.useRef(l);return O3(u.current,l)||(u.current=l),v.jsx(r.Provider,{value:u.current,children:a})};n.displayName=e+"Provider";function o({consumerName:a,contextRequired:l}){const u=x.useContext(r);if(u)return u;if(l)throw new Error(`${a} must be used within ${e}`);return t||{}}return[n,o]}const[RV,N3]=Cd("Disabled",{disabled:!1}),Ks=({consumerName:e,contextRequired:t,mergeWith:r})=>{const n=N3({consumerName:e,contextRequired:t??!1});return!!(r?.disabled||n.disabled)},P3=(e,t)=>{let r=e;for(const n of t){if(r==null)return;r=r[n]}return r},D3=/\{\{\s*(\w+)\s*\}\}/g,j3=(e,t)=>t?e.replace(D3,(r,n)=>Object.hasOwn(t,n)?String(t[n]):r):e,M3=(e,t,r)=>{if(!e)return r;const n=e.toLowerCase().replaceAll("_","-"),o=a=>t.find(l=>l.toLowerCase()===a);return o(n)??o(n.split("-")[0])??r},nx=(e,t)=>{const r=P3(e??{},t.split("."));return typeof r=="string"?r:void 0},z3=({dictionaries:e,defaultLocale:t,fallbackLocale:r=t})=>{const n=Object.keys(e),o=(d,p,h)=>{const m=nx(e[d],p)??nx(e[r],p)??p;return j3(m,h)},a=d=>({locale:d,t:(p,h)=>o(d,p,h)}),l=x.createContext({locale:t,t:d=>d}),u=({locale:d,children:p})=>{const h=M3(d,n,t),m=x.useMemo(()=>a(h),[h]);return v.jsx(l.Provider,{value:m,children:p})};return u.displayName="TranslationsProvider",{TranslationsProvider:u,useTranslations:()=>x.useContext(l),translate:o}},F3={closeAriaLabel:"Schließen"},B3={addressInput:{qrCodeAriaLabel:"QR-Code scannen"},amountDisplay:{amountHiddenAriaLabel:"Betrag ausgeblendet"},avatar:{defaultAriaLabel:"Benutzer-Avatar"},baseInput:{clearInputAriaLabel:"Eingabe löschen"},spinner:{loadingAriaLabel:"Wird geladen"},dialogHeader:{goBackAriaLabel:"Zurück",closeAriaLabel:"Schließen"},banner:{closeAriaLabel:"Schließen"},link:{opensInNewTabAriaLabel:"(Öffnet in neuem Tab)"},navBar:{goBackAriaLabel:"Zurück"},sideBar:{navigationAriaLabel:"Seitenleistennavigation",collapseAriaLabel:"Seitenleiste ausblenden",expandAriaLabel:"Seitenleiste anzeigen"},stepper:{progressAriaLabel:"Schritt {{currentStep}} von {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},U3={common:F3,components:B3},V3={closeAriaLabel:"Close"},W3={addressInput:{qrCodeAriaLabel:"Scan QR code"},amountDisplay:{amountHiddenAriaLabel:"Amount hidden"},avatar:{defaultAriaLabel:"User avatar"},baseInput:{clearInputAriaLabel:"Clear input"},spinner:{loadingAriaLabel:"Loading"},dialogHeader:{goBackAriaLabel:"Go back",closeAriaLabel:"Close"},banner:{closeAriaLabel:"Close"},link:{opensInNewTabAriaLabel:"(opens in a new tab)"},navBar:{goBackAriaLabel:"Go back"},sideBar:{navigationAriaLabel:"Sidebar navigation",collapseAriaLabel:"Collapse sidebar",expandAriaLabel:"Expand sidebar"},stepper:{progressAriaLabel:"Step {{currentStep}} of {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"},chart:{emptyLabel:"No data",loadingAriaLabel:"Loading chart",defaultAriaLabel:"Chart"},select:{searchPlaceholder:"Search"},subheader:{moreInfoAriaLabel:"More information"}},H3={common:V3,components:W3},q3={closeAriaLabel:"Cerrar"},G3={addressInput:{qrCodeAriaLabel:"Escanear código QR"},amountDisplay:{amountHiddenAriaLabel:"Importe oculto"},avatar:{defaultAriaLabel:"Avatar de usuario"},baseInput:{clearInputAriaLabel:"Borrar entrada"},spinner:{loadingAriaLabel:"Cargando"},dialogHeader:{goBackAriaLabel:"Volver",closeAriaLabel:"Cerrar"},banner:{closeAriaLabel:"Cerrar"},link:{opensInNewTabAriaLabel:"(se abre en una pestaña nueva)"},navBar:{goBackAriaLabel:"Volver"},sideBar:{navigationAriaLabel:"Navegación de barra lateral",collapseAriaLabel:"Colapsar barra lateral",expandAriaLabel:"Expandir barra lateral"},stepper:{progressAriaLabel:"Paso {{currentStep}} de {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},X3={common:q3,components:G3},Y3={closeAriaLabel:"Fermer"},K3={addressInput:{qrCodeAriaLabel:"Scanner le code QR"},amountDisplay:{amountHiddenAriaLabel:"Montant masqué"},avatar:{defaultAriaLabel:"Avatar de l'utilisateur"},baseInput:{clearInputAriaLabel:"Effacer la saisie"},spinner:{loadingAriaLabel:"Chargement"},dialogHeader:{goBackAriaLabel:"Retour",closeAriaLabel:"Fermer"},banner:{closeAriaLabel:"Fermer"},link:{opensInNewTabAriaLabel:"(s'ouvre dans un nouvel onglet)"},navBar:{goBackAriaLabel:"Retour"},sideBar:{navigationAriaLabel:"Menu de navigation latéral",collapseAriaLabel:"Réduire la barre latérale",expandAriaLabel:"Développer la barre latérale"},stepper:{progressAriaLabel:"Étape {{currentStep}} sur {{totalSteps}}"},table:{ascAriaLabel:"Trier par ordre croissant",descAriaLabel:"Trier par ordre décroissant"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},Q3={common:Y3,components:K3},J3={closeAriaLabel:"閉じる"},Z3={addressInput:{qrCodeAriaLabel:"QRコードをスキャン"},amountDisplay:{amountHiddenAriaLabel:"金額非表示"},avatar:{defaultAriaLabel:"ユーザーアバター"},baseInput:{clearInputAriaLabel:"インプットを削除"},spinner:{loadingAriaLabel:"読み込み中"},dialogHeader:{goBackAriaLabel:"戻る",closeAriaLabel:"閉じる"},banner:{closeAriaLabel:"閉じる"},link:{opensInNewTabAriaLabel:"(新しいタブで開く)"},navBar:{goBackAriaLabel:"戻る"},sideBar:{navigationAriaLabel:"サイドバーナビゲーション",collapseAriaLabel:"サイドバーを閉じる",expandAriaLabel:"サイドバーを開く"},stepper:{progressAriaLabel:"ステップ{{currentStep}}/{{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},eO={common:J3,components:Z3},tO={closeAriaLabel:"닫기"},rO={addressInput:{qrCodeAriaLabel:"QR 코드 스캔"},amountDisplay:{amountHiddenAriaLabel:"금액 숨김"},avatar:{defaultAriaLabel:"사용자 아바타"},baseInput:{clearInputAriaLabel:"입력 값 지우기"},spinner:{loadingAriaLabel:"로딩중"},dialogHeader:{goBackAriaLabel:"돌아가기",closeAriaLabel:"닫기"},banner:{closeAriaLabel:"닫기"},link:{opensInNewTabAriaLabel:"(새 탭에서 열기)"},navBar:{goBackAriaLabel:"돌아가기"},sideBar:{navigationAriaLabel:"사이드바 탐색",collapseAriaLabel:"사이드바 접기",expandAriaLabel:"사이드바 펼치기"},stepper:{progressAriaLabel:"{{totalSteps}} 중 {{currentStep}} 단계"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},nO={common:tO,components:rO},iO={closeAriaLabel:"Fechar"},oO={addressInput:{qrCodeAriaLabel:"Escanear QR Code"},amountDisplay:{amountHiddenAriaLabel:"Valor oculto"},avatar:{defaultAriaLabel:"Avatar do usuário"},baseInput:{clearInputAriaLabel:"Limpar input"},spinner:{loadingAriaLabel:"Carregando"},dialogHeader:{goBackAriaLabel:"Voltar",closeAriaLabel:"Fechar"},banner:{closeAriaLabel:"Fechar"},link:{opensInNewTabAriaLabel:"(abre em uma nova aba)"},navBar:{goBackAriaLabel:"Voltar"},sideBar:{navigationAriaLabel:"Barra de navegação lateral",collapseAriaLabel:"Recolher barra lateral",expandAriaLabel:"Expandir barra lateral"},stepper:{progressAriaLabel:"Passo {{currentStep}} de {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},sO={common:iO,components:oO},aO={closeAriaLabel:"Закрыть"},lO={addressInput:{qrCodeAriaLabel:"Сканировать QR-код"},amountDisplay:{amountHiddenAriaLabel:"Сумма скрыта"},avatar:{defaultAriaLabel:"Аватар пользователя"},baseInput:{clearInputAriaLabel:"Очистить поле"},spinner:{loadingAriaLabel:"Загрузка"},dialogHeader:{goBackAriaLabel:"Назад",closeAriaLabel:"Закрыть"},banner:{closeAriaLabel:"Закрыть"},link:{opensInNewTabAriaLabel:"(открывается в новой вкладке)"},navBar:{goBackAriaLabel:"Назад"},sideBar:{navigationAriaLabel:"Боковое меню",collapseAriaLabel:"Скрыть боковое меню",expandAriaLabel:"Показать боковое меню"},stepper:{progressAriaLabel:"Шаг {{currentStep}} из {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},cO={common:aO,components:lO},uO={closeAriaLabel:"ปิด"},dO={addressInput:{qrCodeAriaLabel:"สแกน QR Code"},amountDisplay:{amountHiddenAriaLabel:"ยอดเงินถูกซ่อน"},avatar:{defaultAriaLabel:"อวาตาร์ผู้ใช้"},baseInput:{clearInputAriaLabel:"ล้างอินพุต"},spinner:{loadingAriaLabel:"กำลังโหลด"},dialogHeader:{goBackAriaLabel:"ย้อนกลับ",closeAriaLabel:"ปิด"},banner:{closeAriaLabel:"ปิด"},link:{opensInNewTabAriaLabel:"(เปิดในแท็บใหม่)"},navBar:{goBackAriaLabel:"ย้อนกลับ"},sideBar:{navigationAriaLabel:"เมนูนำทางด้านข้าง",collapseAriaLabel:"ซ่อนแถบด้านข้าง",expandAriaLabel:"เปิดแถบด้านข้าง"},stepper:{progressAriaLabel:"ขั้นตอนที่ {{currentStep}} จาก {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},fO={common:uO,components:dO},pO={closeAriaLabel:"Kapat"},hO={addressInput:{qrCodeAriaLabel:"Karekodu okut"},amountDisplay:{amountHiddenAriaLabel:"Tutar gizlendi"},avatar:{defaultAriaLabel:"Kullanıcı avatarı"},baseInput:{clearInputAriaLabel:"Girdiyi temizle"},spinner:{loadingAriaLabel:"Yükleniyor"},dialogHeader:{goBackAriaLabel:"Geri dön",closeAriaLabel:"Kapat"},banner:{closeAriaLabel:"Kapat"},link:{opensInNewTabAriaLabel:"(yeni sekmede açılır)"},navBar:{goBackAriaLabel:"Geri dön"},sideBar:{navigationAriaLabel:"Kenar çubuğu menüsü",collapseAriaLabel:"Kenar çubuğunu daralt",expandAriaLabel:"Kenar çubuğunu genişlet"},stepper:{progressAriaLabel:"Adım {{totalSteps}} / {{currentStep}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},mO={common:pO,components:hO},gO={closeAriaLabel:"关闭"},vO={addressInput:{qrCodeAriaLabel:"扫描二维码"},amountDisplay:{amountHiddenAriaLabel:"金额已隐藏"},avatar:{defaultAriaLabel:"用户头像"},baseInput:{clearInputAriaLabel:"清空输入框"},spinner:{loadingAriaLabel:"加载中"},dialogHeader:{goBackAriaLabel:"返回",closeAriaLabel:"关闭"},banner:{closeAriaLabel:"关闭"},link:{opensInNewTabAriaLabel:"(在新选项卡中打开)"},navBar:{goBackAriaLabel:"返回"},sideBar:{navigationAriaLabel:"侧边栏导航",collapseAriaLabel:"折叠侧边栏",expandAriaLabel:"展开侧边栏"},stepper:{progressAriaLabel:"第 {{currentStep}} / {{totalSteps}} 步"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},yO={common:gO,components:vO},bO={de:U3,en:H3,es:X3,fr:Q3,ja:eO,ko:nO,pt:sO,ru:cO,th:fO,tr:mO,zh:yO},{TranslationsProvider:xO,useTranslations:jE}=z3({dictionaries:bO,defaultLocale:L3});function ME(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ME(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function zE(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ME(e))&&(n&&(n+=" "),n+=t);return n}const wO=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},SO=(e,t)=>({classGroupId:e,validator:t}),FE=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Ju="-",ix=[],EO="arbitrary..",CO=e=>{const t=RO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return kO(l);const u=l.split(Ju),d=u[0]===""&&u.length>1?1:0;return BE(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=n[l],p=r[l];return d?p?wO(p,d):d:p||ix}return r[l]||ix}}},BE=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],a=r.nextPart.get(o);if(a){const p=BE(e,t+1,a);if(p)return p}const l=r.validators;if(l===null)return;const u=t===0?e.join(Ju):e.slice(t).join(Ju),d=l.length;for(let p=0;p<d;p++){const h=l[p];if(h.validator(u))return h.classGroupId}},kO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?EO+n:void 0})(),RO=e=>{const{theme:t,classGroups:r}=e;return _O(r,t)},_O=(e,t)=>{const r=FE();for(const n in e){const o=e[n];Dg(o,r,n,t)}return r},Dg=(e,t,r,n)=>{const o=e.length;for(let a=0;a<o;a++){const l=e[a];$O(l,t,r,n)}},$O=(e,t,r,n)=>{if(typeof e=="string"){AO(e,t,r);return}if(typeof e=="function"){TO(e,t,r,n);return}LO(e,t,r,n)},AO=(e,t,r)=>{const n=e===""?t:UE(t,e);n.classGroupId=r},TO=(e,t,r,n)=>{if(IO(e)){Dg(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(SO(r,e))},LO=(e,t,r,n)=>{const o=Object.entries(e),a=o.length;for(let l=0;l<a;l++){const[u,d]=o[l];Dg(d,UE(t,u),r,n)}},UE=(e,t)=>{let r=e;const n=t.split(Ju),o=n.length;for(let a=0;a<o;a++){const l=n[a];let u=r.nextPart.get(l);u||(u=FE(),r.nextPart.set(l,u)),r=u}return r},IO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,OO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(a,l)=>{r[a]=l,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let l=r[a];if(l!==void 0)return l;if((l=n[a])!==void 0)return o(a,l),l},set(a,l){a in r?r[a]=l:o(a,l)}}},Gm="!",ox=":",NO=[],sx=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),PO=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const a=[];let l=0,u=0,d=0,p;const h=o.length;for(let S=0;S<h;S++){const C=o[S];if(l===0&&u===0){if(C===ox){a.push(o.slice(d,S)),d=S+1;continue}if(C==="/"){p=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const m=a.length===0?o:o.slice(d);let y=m,w=!1;m.endsWith(Gm)?(y=m.slice(0,-1),w=!0):m.startsWith(Gm)&&(y=m.slice(1),w=!0);const E=p&&p>d?p-d:void 0;return sx(a,w,y,E)};if(t){const o=t+ox,a=n;n=l=>l.startsWith(o)?a(l.slice(o.length)):sx(NO,!1,l,void 0,!0)}if(r){const o=n;n=a=>r({className:a,parseClassName:o})}return n},DO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let a=0;a<r.length;a++){const l=r[a],u=l[0]==="[",d=t.has(l);u||d?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(l)):o.push(l)}return o.length>0&&(o.sort(),n.push(...o)),n}},jO=e=>({cache:OO(e.cacheSize),parseClassName:PO(e),sortModifiers:DO(e),postfixLookupClassGroupIds:MO(e),...CO(e)}),MO=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},zO=/\s+/,FO=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:l}=t,u=[],d=e.trim().split(zO);let p="";for(let h=d.length-1;h>=0;h-=1){const m=d[h],{isExternal:y,modifiers:w,hasImportantModifier:E,baseClassName:S,maybePostfixModifierPosition:C}=r(m);if(y){p=m+(p.length>0?" "+p:p);continue}let R=!!C,k;if(R){const P=S.substring(0,C);k=n(P);const I=k&&l[k]?n(S):void 0;I&&I!==k&&(k=I,R=!1)}else k=n(S);if(!k){if(!R){p=m+(p.length>0?" "+p:p);continue}if(k=n(S),!k){p=m+(p.length>0?" "+p:p);continue}R=!1}const $=w.length===0?"":w.length===1?w[0]:a(w).join(":"),A=E?$+Gm:$,D=A+k;if(u.indexOf(D)>-1)continue;u.push(D);const N=o(k,R);for(let P=0;P<N.length;++P){const I=N[P];u.push(A+I)}p=m+(p.length>0?" "+p:p)}return p},BO=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=VE(r))&&(o&&(o+=" "),o+=n);return o},VE=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=VE(e[n]))&&(r&&(r+=" "),r+=t);return r},ax=(e,...t)=>{let r,n,o,a;const l=d=>{const p=t.reduce((h,m)=>m(h),e());return r=jO(p),n=r.cache.get,o=r.cache.set,a=u,u(d)},u=d=>{const p=n(d);if(p)return p;const h=FO(d,r);return o(d,h),h};return a=l,(...d)=>a(BO(...d))},UO=[],Gt=e=>{const t=r=>r[e]||UO;return t.isThemeGetter=!0,t.themeKey=e,t},WE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,VO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,WO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,GO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>VO.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),mn=e=>!!e&&Number.isInteger(Number(e)),ju=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),An=e=>WO.test(e),jg=()=>!0,YO=e=>HO.test(e)&&!qO.test(e),Mg=()=>!1,KO=e=>GO.test(e),QO=e=>XO.test(e),qE=e=>!Re(e)&&!_e(e),GE=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),XE=e=>Xi(e,iC,Mg),Re=e=>WE.test(e),Pi=e=>Xi(e,oC,YO),Xm=e=>Xi(e,JO,Ge),YE=e=>Xi(e,aC,jg),KE=e=>Xi(e,sC,Mg),Ym=e=>Xi(e,rC,Mg),QE=e=>Xi(e,nC,QO),tl=e=>Xi(e,lC,KO),_e=e=>HE.test(e),Rs=e=>Fo(e,oC),JE=e=>Fo(e,sC),Km=e=>Fo(e,rC),ZE=e=>Fo(e,iC),eC=e=>Fo(e,nC),rl=e=>Fo(e,lC,!0),tC=e=>Fo(e,aC,!0),Xi=(e,t,r)=>{const n=WE.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Fo=(e,t,r=!1)=>{const n=HE.exec(e);return n?n[1]?t(n[1]):r:!1},rC=e=>e==="position"||e==="percentage",nC=e=>e==="image"||e==="url",iC=e=>e==="length"||e==="size"||e==="bg-size",oC=e=>e==="length",JO=e=>e==="number",sC=e=>e==="family-name",aC=e=>e==="number"||e==="weight",lC=e=>e==="shadow",Xp=Object.defineProperty({__proto__:null,isAny:jg,isAnyNonArbitrary:qE,isArbitraryFamilyName:KE,isArbitraryImage:QE,isArbitraryLength:Pi,isArbitraryNumber:Xm,isArbitraryPosition:Ym,isArbitraryShadow:tl,isArbitrarySize:XE,isArbitraryValue:Re,isArbitraryVariable:_e,isArbitraryVariableFamilyName:JE,isArbitraryVariableImage:eC,isArbitraryVariableLength:Rs,isArbitraryVariablePosition:Km,isArbitraryVariableShadow:rl,isArbitraryVariableSize:ZE,isArbitraryVariableWeight:tC,isArbitraryWeight:YE,isFraction:Jn,isInteger:mn,isNamedContainerQuery:GE,isNumber:Ge,isPercent:ju,isTshirtSize:An},Symbol.toStringTag,{value:"Module"}),lx=()=>{const e=Gt("color"),t=Gt("font"),r=Gt("text"),n=Gt("font-weight"),o=Gt("tracking"),a=Gt("leading"),l=Gt("breakpoint"),u=Gt("container"),d=Gt("spacing"),p=Gt("radius"),h=Gt("shadow"),m=Gt("inset-shadow"),y=Gt("text-shadow"),w=Gt("drop-shadow"),E=Gt("blur"),S=Gt("perspective"),C=Gt("aspect"),R=Gt("ease"),k=Gt("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...A(),_e,Re],N=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],I=()=>[_e,Re,d],re=()=>[Jn,"full","auto",...I()],Z=()=>[mn,"none","subgrid",_e,Re],ee=()=>["auto",{span:["full",mn,_e,Re]},mn,_e,Re],ne=()=>[mn,"auto",_e,Re],X=()=>["auto","min","max","fr",_e,Re],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...I()],O=()=>[Jn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],L=()=>[u,Jn,"screen","full","dvw","lvw","svw","min","max","fit",...I()],U=()=>[Jn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],z=()=>[e,_e,Re],T=()=>[...A(),Km,Ym,{position:[_e,Re]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",ZE,XE,{size:[_e,Re]}],le=()=>[ju,Rs,Pi],G=()=>["","none","full",p,_e,Re],fe=()=>["",Ge,Rs,Pi],be=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Ge,ju,Km,Ym],ge=()=>["","none",E,_e,Re],qe=()=>["none",Ge,_e,Re],Xe=()=>["none",Ge,_e,Re],we=()=>[Ge,_e,Re],ze=()=>[Jn,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[An],breakpoint:[An],color:[jg],container:[An],"drop-shadow":[An],ease:["in","out","in-out"],font:[qE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[An],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[An],shadow:[An],spacing:["px",Ge],text:[An],"text-shadow":[An],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jn,Re,_e,C]}],container:["container"],"container-type":[{"@container":["","normal","size",_e,Re]}],"container-named":[GE],columns:[{columns:[Ge,"auto",Re,_e,u]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[mn,"auto",_e,Re]}],basis:[{basis:[Jn,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,Jn,"auto","initial","none",Re]}],grow:[{grow:["",Ge,_e,Re]}],shrink:[{shrink:["",Ge,_e,Re]}],order:[{order:[mn,"first","last","none",_e,Re]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[u,"screen",...O()]}],"min-w":[{"min-w":[u,"screen","none",...O()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh","none",...O()]}],"font-size":[{text:["base",r,Rs,Pi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,tC,YE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ju,Re]}],"font-family":[{font:[JE,KE,t]}],"font-features":[{"font-features":[Re]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,_e,Re]}],"line-clamp":[{"line-clamp":[Ge,"none",_e,Xm]}],leading:[{leading:["none",a,...I()]}],"list-image":[{"list-image":["none",_e,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",_e,Pi]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ge,"auto",_e,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[mn,_e,Re]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_e,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mn,_e,Re],radial:["",_e,Re],conic:["",mn,_e,Re]},eC,QE]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,_e,Re]}],"outline-w":[{outline:["",Ge,Rs,Pi]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","inner","none",h,rl,tl]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",m,rl,tl]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ge,Pi]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",y,rl,tl]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ge,_e,Re]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[_e,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Re]}],filter:[{filter:["","none",_e,Re]}],blur:[{blur:ge()}],brightness:[{brightness:[Ge,_e,Re]}],contrast:[{contrast:[Ge,_e,Re]}],"drop-shadow":[{"drop-shadow":["","none",w,rl,tl]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ge,_e,Re]}],"hue-rotate":[{"hue-rotate":[Ge,_e,Re]}],invert:[{invert:["",Ge,_e,Re]}],saturate:[{saturate:[Ge,_e,Re]}],sepia:[{sepia:["",Ge,_e,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Re]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,_e,Re]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,_e,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,_e,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,_e,Re]}],"backdrop-invert":[{"backdrop-invert":["",Ge,_e,Re]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,_e,Re]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,_e,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,_e,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",_e,Re]}],ease:[{ease:["linear","initial",R,_e,Re]}],delay:[{delay:[Ge,_e,Re]}],animate:[{animate:["none",k,_e,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,_e,Re]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:qe()}],"rotate-x":[{"rotate-x":qe()}],"rotate-y":[{"rotate-y":qe()}],"rotate-z":[{"rotate-z":qe()}],scale:[{scale:Xe()}],"scale-x":[{"scale-x":Xe()}],"scale-y":[{"scale-y":Xe()}],"scale-z":[{"scale-z":Xe()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[_e,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[mn,_e,Re]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_e,Re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_e,Re]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ge,Rs,Pi,Xm]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ZO=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:o={},override:a={}})=>(_s(e,"cacheSize",t),_s(e,"prefix",r),_s(e,"experimentalParseClassName",n),mu(e.theme,a.theme),mu(e.classGroups,a.classGroups),mu(e.conflictingClassGroups,a.conflictingClassGroups),mu(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),_s(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),_s(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),gu(e.theme,o.theme),gu(e.classGroups,o.classGroups),gu(e.conflictingClassGroups,o.conflictingClassGroups),gu(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Qm(e,o,"postfixLookupClassGroups"),Qm(e,o,"orderSensitiveModifiers"),e),_s=(e,t,r)=>{r!==void 0&&(e[t]=r)},mu=(e,t)=>{if(t)for(const r in t)_s(e,r,t[r])},gu=(e,t)=>{if(t)for(const r in t)Qm(e,t,r)},Qm=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},eN=(e,...t)=>typeof e=="function"?ax(lx,e,...t):ax(()=>ZO(lx(),e),...t),cx=e=>e.flatMap(t=>[`${t}`,`${t}-semi-bold`]),Yp=(e,t)=>Array.from({length:t-e+1},(r,n)=>e+n),tN=e=>/^(overlay-)?\d+$/.test(e),rN=eN({override:{classGroups:{"font-size":[{text:[Xp.isTshirtSize,Xp.isArbitraryVariableLength,Xp.isArbitraryLength]}]}},extend:{theme:{radius:["xxs"]},classGroups:{typography:[{"responsive-display":Yp(1,4).map(String),heading:cx(Yp(0,5)),body:cx(Yp(1,4))}],"bg-image":[{bg:[{gradient:[e=>!tN(e)]}]}]},conflictingClassGroups:{typography:["font-size","font-weight","font-family","leading","tracking"]}}});function Qt(...e){return rN(zE(e))}const ux=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dx=zE,kr=(e,t)=>r=>{var n;if(t?.variants==null)return dx(e,r?.class,r?.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(p=>{const h=r?.[p],m=a?.[p];if(h===null)return null;const y=ux(h)||ux(m);return o[p][y]}),u=r&&Object.entries(r).reduce((p,h)=>{let[m,y]=h;return y===void 0||(p[m]=y),p},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((p,h)=>{let{class:m,className:y,...w}=h;return Object.entries(w).every(E=>{let[S,C]=E;return Array.isArray(C)?C.includes({...a,...u}[S]):{...a,...u}[S]===C})?[...p,m,y]:p},[]);return dx(e,l,d,r?.class,r?.className)},nN=kr("inline-block shrink-0",{variants:{size:{12:"icon-h-12 icon-w-12 icon-stroke-12",16:"icon-h-16 icon-w-16 icon-stroke-16",20:"icon-h-20 icon-w-20 icon-stroke-20",32:"icon-h-32 icon-w-32 icon-stroke-32",24:"icon-h-24 icon-w-24 icon-stroke-24",40:"icon-h-40 icon-w-40 icon-stroke-40",48:"icon-h-48 icon-w-48 icon-stroke-48",56:"icon-h-56 icon-w-56 icon-stroke-56"}},defaultVariants:{size:24}}),iN=({ref:e,size:t=24,className:r="",children:n,viewBox:o,xmlns:a,...l})=>x.createElement("svg",{ref:e,fill:"none","aria-hidden":"true",xmlns:a,viewBox:o,className:Qt(nN({size:t}),"inline-block",r),...l},n),pt=(e,t)=>{const r=({ref:n,className:o,disabled:a,...l})=>{const u=Ks({consumerName:e,mergeWith:{disabled:a}});return x.createElement(iN,{ref:n,className:Qt(o,u&&"text-disabled"),viewBox:t.props.viewBox,...l,children:t.props.children})};return r.displayName=e,r},oN=pt("InformationFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M8 1.35a6.65 6.65 0 0 1 0 13.3A6.646 6.646 0 0 1 1.35 8c0-3.679 2.978-6.65 6.65-6.65m0 6a.65.65 0 0 0-.65.65v3.333a.65.65 0 1 0 1.3 0V8A.65.65 0 0 0 8 7.35m-.01-2.666-.003-.001-.009.001a.814.814 0 0 0-.797.732l-.005.084.005.08c.04.395.373.737.813.737.242 0 .443-.11.575-.241A.82.82 0 0 0 8.81 5.5.82.82 0 0 0 8 4.684l-.006-.001zm-.003 1.3L7.9 5.975l-.002-.001c.03.004.059.01.089.01"})})),sN=pt("DeleteCircleFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.5 8c0-3.596 2.91-6.5 6.5-6.5a6.5 6.5 0 1 1 0 13c-3.596 0-6.5-2.91-6.5-6.5m4.967-2.24a.5.5 0 0 0-.707.707L7.293 8 5.76 9.533a.5.5 0 0 0 .707.707L8 8.707l1.533 1.533a.5.5 0 0 0 .707-.707L8.707 8l1.533-1.533a.5.5 0 0 0-.707-.707L8 7.293z",clipRule:"evenodd"})})),aN=pt("CheckmarkCircleFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M8.001 1.35a6.65 6.65 0 1 1-.003 13.301A6.65 6.65 0 0 1 8.001 1.35m2.795 4.58a.67.67 0 0 0-.944 0L7.064 8.718l-.963-.962a.666.666 0 1 0-.943.942l1.444 1.445a.67.67 0 0 0 1.027-.105l3.167-3.164a.667.667 0 0 0 0-.942"})}));function ti(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function fx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zg(...e){return t=>{let r=!1;const n=e.map(o=>{const a=fx(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():fx(e[o],null)}}}}function Bo(...e){return x.useCallback(zg(...e),e)}function cC(e,t=[]){let r=[];function n(a,l){const u=x.createContext(l),d=r.length;r=[...r,l];const p=m=>{const{scope:y,children:w,...E}=m,S=y?.[e]?.[d]||u,C=x.useMemo(()=>E,Object.values(E));return v.jsx(S.Provider,{value:C,children:w})};p.displayName=a+"Provider";function h(m,y){const w=y?.[e]?.[d]||u,E=x.useContext(w);if(E)return E;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[p,h]}const o=()=>{const a=r.map(l=>x.createContext(l));return function(u){const d=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return o.scopeName=e,[n,lN(o,...t)]}function lN(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const l=n.reduce((u,{useScope:d,scopeName:p})=>{const m=d(a)[`__scope${p}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function cN(e){const t=uN(e),r=x.forwardRef((n,o)=>{const{children:a,...l}=n,u=x.Children.toArray(a),d=u.find(fN);if(d){const p=d.props.children,h=u.map(m=>m===d?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:m);return v.jsx(t,{...l,ref:o,children:x.isValidElement(p)?x.cloneElement(p,void 0,h):null})}return v.jsx(t,{...l,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function uN(e){const t=x.forwardRef((r,n)=>{const{children:o,...a}=r;if(x.isValidElement(o)){const l=hN(o),u=pN(a,o.props);return o.type!==x.Fragment&&(u.ref=n?zg(n,l):l),x.cloneElement(o,u)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uC=Symbol("radix.slottable");function dN(e){const t=({children:r})=>v.jsx(v.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=uC,t}function fN(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uC}function pN(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...u)=>{const d=a(...u);return o(...u),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function hN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yi=mN.reduce((e,t)=>{const r=cN(`Primitive.${t}`),n=x.forwardRef((o,a)=>{const{asChild:l,...u}=o,d=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(d,{...u,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function gN(e,t){e&&Lr.flushSync(()=>e.dispatchEvent(t))}function kd(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function vN(e,t=globalThis?.document){const r=kd(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var yN="DismissableLayer",Jm="dismissableLayer.update",bN="dismissableLayer.pointerDownOutside",xN="dismissableLayer.focusOutside",px,dC=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fC=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,p=x.useContext(dC),[h,m]=x.useState(null),y=h?.ownerDocument??globalThis?.document,[,w]=x.useState({}),E=Bo(t,P=>m(P)),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(C),k=h?S.indexOf(h):-1,$=p.layersWithOutsidePointerEventsDisabled.size>0,A=k>=R,D=EN(P=>{const I=P.target,re=[...p.branches].some(Z=>Z.contains(I));!A||re||(o?.(P),l?.(P),P.defaultPrevented||u?.())},y),N=CN(P=>{const I=P.target;[...p.branches].some(Z=>Z.contains(I))||(a?.(P),l?.(P),P.defaultPrevented||u?.())},y);return vN(P=>{k===p.layers.size-1&&(n?.(P),!P.defaultPrevented&&u&&(P.preventDefault(),u()))},y),x.useEffect(()=>{if(h)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(px=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(h)),p.layers.add(h),hx(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=px)}},[h,y,r,p]),x.useEffect(()=>()=>{h&&(p.layers.delete(h),p.layersWithOutsidePointerEventsDisabled.delete(h),hx())},[h,p]),x.useEffect(()=>{const P=()=>w({});return document.addEventListener(Jm,P),()=>document.removeEventListener(Jm,P)},[]),v.jsx(Yi.div,{...d,ref:E,style:{pointerEvents:$?A?"auto":"none":void 0,...e.style},onFocusCapture:ti(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ti(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ti(e.onPointerDownCapture,D.onPointerDownCapture)})});fC.displayName=yN;var wN="DismissableLayerBranch",SN=x.forwardRef((e,t)=>{const r=x.useContext(dC),n=x.useRef(null),o=Bo(t,n);return x.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),v.jsx(Yi.div,{...e,ref:o})});SN.displayName=wN;function EN(e,t=globalThis?.document){const r=kd(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!n.current){let d=function(){pC(bN,r,p,{discrete:!0})};const p={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function CN(e,t=globalThis?.document){const r=kd(e),n=x.useRef(!1);return x.useEffect(()=>{const o=a=>{a.target&&!n.current&&pC(xN,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function hx(){const e=new CustomEvent(Jm);document.dispatchEvent(e)}function pC(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?gN(o,a):o.dispatchEvent(a)}var Wi=globalThis?.document?x.useLayoutEffect:()=>{},kN=_l[" useId ".trim().toString()]||(()=>{}),RN=0;function _N(e){const[t,r]=x.useState(kN());return Wi(()=>{r(n=>n??String(RN++))},[e]),t?`radix-${t}`:""}const $N=["top","right","bottom","left"],Hi=Math.min,ri=Math.max,Zu=Math.round,vu=Math.floor,ni=e=>({x:e,y:e}),AN={left:"right",right:"left",bottom:"top",top:"bottom"};function hC(e,t,r){return ri(e,Hi(t,r))}function ai(e,t){return typeof e=="function"?e(t):e}function qi(e){return e.split("-")[0]}function Qs(e){return e.split("-")[1]}function Fg(e){return e==="x"?"y":"x"}function Bg(e){return e==="y"?"height":"width"}function On(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ug(e){return Fg(On(e))}function TN(e,t,r){r===void 0&&(r=!1);const n=Qs(e),o=Ug(e),a=Bg(o);let l=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=ed(l)),[l,ed(l)]}function LN(e){const t=ed(e);return[Zm(e),t,Zm(t)]}function Zm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const mx=["left","right"],gx=["right","left"],IN=["top","bottom"],ON=["bottom","top"];function NN(e,t,r){switch(e){case"top":case"bottom":return r?t?gx:mx:t?mx:gx;case"left":case"right":return t?IN:ON;default:return[]}}function PN(e,t,r,n){const o=Qs(e);let a=NN(qi(e),r==="start",n);return o&&(a=a.map(l=>l+"-"+o),t&&(a=a.concat(a.map(Zm)))),a}function ed(e){const t=qi(e);return AN[t]+e.slice(t.length)}function DN(e){var t,r,n,o;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function mC(e){return typeof e!="number"?DN(e):{top:e,right:e,bottom:e,left:e}}function td(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function vx(e,t,r){let{reference:n,floating:o}=e;const a=On(t),l=Ug(t),u=Bg(l),d=qi(t),p=a==="y",h=n.x+n.width/2-o.width/2,m=n.y+n.height/2-o.height/2,y=n[u]/2-o[u]/2;let w;switch(d){case"top":w={x:h,y:n.y-o.height};break;case"bottom":w={x:h,y:n.y+n.height};break;case"right":w={x:n.x+n.width,y:m};break;case"left":w={x:n.x-o.width,y:m};break;default:w={x:n.x,y:n.y}}const E=Qs(t);return E&&(w[l]+=y*(E==="end"?1:-1)*(r&&p?-1:1)),w}async function jN(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:y=!1,padding:w=0}=ai(t,e),E=mC(w),C=u[y?m==="floating"?"reference":"floating":m],R=td(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(C)))==null||r?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:p,rootBoundary:h,strategy:d})),k=m==="floating"?{x:n,y:o,width:l.floating.width,height:l.floating.height}:l.reference,$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),A=await(a.isElement==null?void 0:a.isElement($))&&await(a.getScale==null?void 0:a.getScale($))||{x:1,y:1},D=td(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:$,strategy:d}):k);return{top:(R.top-D.top+E.top)/A.y,bottom:(D.bottom-R.bottom+E.bottom)/A.y,left:(R.left-D.left+E.left)/A.x,right:(D.right-R.right+E.right)/A.x}}const MN=50,zN=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:l}=r,u=l.detectOverflow?l:{...l,detectOverflow:jN},d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=vx(p,n,d),y=n,w=0;const E={};for(let S=0;S<a.length;S++){const C=a[S];if(!C)continue;const{name:R,fn:k}=C,{x:$,y:A,data:D,reset:N}=await k({x:h,y:m,initialPlacement:n,placement:y,strategy:o,middlewareData:E,rects:p,platform:u,elements:{reference:e,floating:t}});h=$??h,m=A??m,E[R]={...E[R],...D},N&&w<MN&&(w++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(p=N.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:h,y:m}=vx(p,y,d)),S=-1)}return{x:h,y:m,placement:y,strategy:o,middlewareData:E}},FN=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:p,padding:h=0}=ai(e,t)||{};if(p==null)return{};const m=mC(h),y={x:r,y:n},w=Ug(o),E=Bg(w),S=await l.getDimensions(p),C=w==="y",R=C?"top":"left",k=C?"bottom":"right",$=C?"clientHeight":"clientWidth",A=a.reference[E]+a.reference[w]-y[w]-a.floating[E],D=y[w]-a.reference[w],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let P=N?N[$]:0;(!P||!await(l.isElement==null?void 0:l.isElement(N)))&&(P=u.floating[$]||a.floating[E]);const I=A/2-D/2,re=P/2-S[E]/2-1,Z=Hi(m[R],re),ee=Hi(m[k],re),ne=P-S[E]-ee,X=P/2-S[E]/2+I,F=hC(Z,X,ne),V=!d.arrow&&Qs(o)!=null&&X!==F&&a.reference[E]/2-(X<Z?Z:ee)-S[E]/2<0,H=V?X<Z?X-Z:X-ne:0;return{[w]:y[w]+H,data:{[w]:F,centerOffset:X-F-H,...V&&{alignmentOffset:H}},reset:V}}}),BN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:p}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...C}=ai(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const R=qi(o),k=On(u),$=qi(u)===u,A=await(d.isRTL==null?void 0:d.isRTL(p.floating)),D=y||($||!S?[ed(u)]:LN(u)),N=E!=="none";!y&&N&&D.push(...PN(u,S,E,A));const P=[u,...D],I=await d.detectOverflow(t,C),re=[];let Z=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&re.push(I[R]),m){const F=TN(o,l,A);re.push(I[F[0]],I[F[1]])}if(Z=[...Z,{placement:o,overflows:re}],!re.every(F=>F<=0)){var ee,ne;const F=(((ee=a.flip)==null?void 0:ee.index)||0)+1,V=P[F];if(V&&(!(m==="alignment"?k!==On(V):!1)||Z.every(L=>On(L.placement)===k?L.overflows[0]>0:!0)))return{data:{index:F,overflows:Z},reset:{placement:V}};let H=(ne=Z.filter(O=>O.overflows[0]<=0).sort((O,L)=>O.overflows[1]-L.overflows[1])[0])==null?void 0:ne.placement;if(!H)switch(w){case"bestFit":{var X;const O=(X=Z.filter(L=>{if(N){const U=On(L.placement);return U===k||U==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(U=>U>0).reduce((U,z)=>U+z,0)]).sort((L,U)=>L[1]-U[1])[0])==null?void 0:X[0];O&&(H=O);break}case"initialPlacement":H=u;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function yx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bx(e){return $N.some(t=>e[t]>=0)}const UN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=ai(e,t);switch(o){case"referenceHidden":{const l=await n.detectOverflow(t,{...a,elementContext:"reference"}),u=yx(l,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:bx(u)}}}case"escaped":{const l=await n.detectOverflow(t,{...a,altBoundary:!0}),u=yx(l,r.floating);return{data:{escapedOffsets:u,escaped:bx(u)}}}default:return{}}}}},gC=new Set(["left","top"]);async function VN(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),l=qi(r),u=Qs(r),d=On(r)==="y",p=gC.has(l)?-1:1,h=a&&d?-1:1,m=ai(t,e);let{mainAxis:y,crossAxis:w,alignmentAxis:E}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof E=="number"&&(w=u==="end"?E*-1:E),d?{x:w*h,y:y*p}:{x:y*p,y:w*h}}const WN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:l,middlewareData:u}=t,d=await VN(t,e);return l===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:a+d.y,data:{...d,placement:l}}}}},HN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:k=>{let{x:$,y:A}=k;return{x:$,y:A}}},...p}=ai(e,t),h={x:r,y:n},m=await a.detectOverflow(t,p),y=On(o),w=Fg(y);let E=h[w],S=h[y];const C=(k,$)=>hC($+m[k==="y"?"top":"left"],$,$-m[k==="y"?"bottom":"right"]);l&&(E=C(w,E)),u&&(S=C(y,S));const R=d.fn({...t,[w]:E,[y]:S});return{...R,data:{x:R.x-r,y:R.y-n,enabled:{[w]:l,[y]:u}}}}}},qN=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,n;const{x:o,y:a,placement:l,rects:u,middlewareData:d}=t,{offset:p=0,mainAxis:h=!0,crossAxis:m=!0}=ai(e,t),y={x:o,y:a},w=On(l),E=Fg(w);let S=y[E],C=y[w];const R=ai(p,t),k=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(r=R.mainAxis)!=null?r:0,crossAxis:(n=R.crossAxis)!=null?n:0};if(h){const D=E==="y"?"height":"width",N=u.reference[E]-u.floating[D]+k.mainAxis,P=u.reference[E]+u.reference[D]-k.mainAxis;S<N?S=N:S>P&&(S=P)}if(m){var $,A;const D=E==="y"?"width":"height",N=gC.has(qi(l)),P=u.reference[w]-u.floating[D]+(N&&(($=d.offset)==null?void 0:$[w])||0)+(N?0:k.crossAxis),I=u.reference[w]+u.reference[D]+(N?0:((A=d.offset)==null?void 0:A[w])||0)-(N?k.crossAxis:0);C<P?C=P:C>I&&(C=I)}return{[E]:S,[w]:C}}}},GN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:a}=t,{apply:l=()=>{},...u}=ai(e,t),d=await o.detectOverflow(t,u),p=qi(r),h=Qs(r),m=On(r)==="y",{width:y,height:w}=n.floating;let E,S;p==="top"||p==="bottom"?(E=p,S=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(S=p,E=h==="end"?"top":"bottom");const C=w-d.top-d.bottom,R=y-d.left-d.right,k=Hi(w-d[E],C),$=Hi(y-d[S],R),A=t.middlewareData.shift,D=!A;let N=k,P=$;A!=null&&A.enabled.x&&(P=R),A!=null&&A.enabled.y&&(N=C),D&&!h&&(m?P=y-2*ri(d.left,d.right):N=w-2*ri(d.top,d.bottom)),await l({...t,availableWidth:P,availableHeight:N});const I=await o.getDimensions(a.floating);return y!==I.width||w!==I.height?{reset:{rects:!0}}:{}}}};function Rd(){return typeof window<"u"}function Js(e){return vC(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fi(e){var t;return(t=(vC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vC(e){return Rd()?e instanceof Node||e instanceof _r(e).Node:!1}function jn(e){return Rd()?e instanceof Element||e instanceof _r(e).Element:!1}function Ki(e){return Rd()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function xx(e){return!Rd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function _d(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&o!=="inline"&&o!=="contents"}function XN(e){return/^(table|td|th)$/.test(Js(e))}function $d(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const YN=/transform|translate|scale|rotate|perspective|filter/,KN=/paint|layout|strict|content/,ko=e=>!!e&&e!=="none";let Kp;function Vg(e){const t=jn(e)?Mn(e):e;return ko(t.transform)||ko(t.translate)||ko(t.scale)||ko(t.rotate)||ko(t.perspective)||!Wg()&&(ko(t.backdropFilter)||ko(t.filter))||YN.test(t.willChange||"")||KN.test(t.contain||"")}function QN(e){let t=Po(e);for(;Ki(t)&&!ml(t);){if(Vg(t))return t;if($d(t))return null;t=Po(t)}return null}function Wg(){return Kp==null&&(Kp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kp}function ml(e){return/^(html|body|#document)$/.test(Js(e))}function Mn(e){return _r(e).getComputedStyle(e)}function Ad(e){return jn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Po(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xx(e)&&e.host||fi(e);return xx(t)?t.host:t}function yC(e){const t=Po(e);return ml(t)?(e.ownerDocument||e).body:Ki(t)&&_d(t)?t:yC(t)}function gl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=yC(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),l=_r(o);if(a){const u=eg(l);return t.concat(l,l.visualViewport||[],_d(o)?o:[],u&&r?gl(u):[])}else return t.concat(o,gl(o,[],r))}function eg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bC(e){const t=Mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ki(e),a=o?e.offsetWidth:r,l=o?e.offsetHeight:n,u=Zu(r)!==a||Zu(n)!==l;return u&&(r=a,n=l),{width:r,height:n,$:u}}function Hg(e){return jn(e)?e:e.contextElement}function Os(e){const t=Hg(e);if(!Ki(t))return ni(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=bC(t);let l=(a?Zu(r.width):r.width)/n,u=(a?Zu(r.height):r.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const JN=ni(0);function xC(e){const t=_r(e);return!Wg()||!t.visualViewport?JN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZN(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===_r(e)}function Do(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=Hg(e);let l=ni(1);t&&(n?jn(n)&&(l=Os(n)):l=Os(e));const u=ZN(a,r,n)?xC(a):ni(0);let d=(o.left+u.x)/l.x,p=(o.top+u.y)/l.y,h=o.width/l.x,m=o.height/l.y;if(a&&n){const y=_r(a),w=jn(n)?_r(n):n;let E=y,S=eg(E);for(;S&&w!==E;){const C=Os(S),R=S.getBoundingClientRect(),k=Mn(S),$=R.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,A=R.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,p*=C.y,h*=C.x,m*=C.y,d+=$,p+=A,E=_r(S),S=eg(E)}}return td({width:h,height:m,x:d,y:p})}function Td(e,t){const r=Ad(e).scrollLeft;return t?t.left+r:Do(fi(e)).left+r}function wC(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Td(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function eP(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",l=fi(n),u=t?$d(t.floating):!1;if(n===l||u&&a)return r;let d={scrollLeft:0,scrollTop:0},p=ni(1);const h=ni(0),m=Ki(n);if((m||!a)&&((Js(n)!=="body"||_d(l))&&(d=Ad(n)),m)){const w=Do(n);p=Os(n),h.x=w.x+n.clientLeft,h.y=w.y+n.clientTop}const y=l&&!m&&!a?wC(l,d):ni(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-d.scrollLeft*p.x+h.x+y.x,y:r.y*p.y-d.scrollTop*p.y+h.y+y.y}}function tP(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function rP(e){const t=Ad(e),r=e.ownerDocument.body,n=ri(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ri(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-t.scrollLeft+Td(e);const l=-t.scrollTop;return Mn(r).direction==="rtl"&&(a+=ri(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:a,y:l}}const nP=25;function iP(e,t,r){r===void 0&&(r="viewport");const n=r==="layoutViewport",o=_r(e),a=fi(e),l=o.visualViewport;let u=a.clientWidth,d=a.clientHeight,p=0,h=0;if(l){const y=!Wg()||t==="fixed";n?y||(p=-l.offsetLeft,h=-l.offsetTop):(u=l.width,d=l.height,y&&(p=l.offsetLeft,h=l.offsetTop))}if(Td(a)<=0){const y=a.ownerDocument,w=y.body,E=getComputedStyle(w),S=y.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(a.clientWidth-w.clientWidth-S),R=getComputedStyle(a).scrollbarGutter==="stable both-edges"?C/2:C;R<=nP&&(u-=R)}return{width:u,height:d,x:p,y:h}}function oP(e,t){const r=Do(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Os(e),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=o*a.x,p=n*a.y;return{width:l,height:u,x:d,y:p}}function wx(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=iP(e,r,t);else if(t==="document")n=rP(fi(e));else if(jn(t))n=oP(t,r);else{const o=xC(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return td(n)}function sP(e,t){const r=t.get(e);if(r)return r;let n=gl(e,[],!1).filter(u=>jn(u)&&Js(u)!=="body"),o=null;const a=Mn(e).position==="fixed";let l=a?Po(e):e;for(;jn(l)&&!ml(l);){const u=Mn(l),d=Vg(l),p=o?o.position:a?"fixed":"";!d&&(p==="fixed"||p==="absolute"&&u.position==="static")?n=n.filter(m=>m!==l):o=u,l=Po(l)}return t.set(e,n),n}function aP(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const l=[...r==="clippingAncestors"?$d(t)?[]:sP(t,this._c):[].concat(r),n],u=wx(t,l[0],o);let d=u.top,p=u.right,h=u.bottom,m=u.left;for(let y=1;y<l.length;y++){const w=wx(t,l[y],o);d=ri(w.top,d),p=Hi(w.right,p),h=Hi(w.bottom,h),m=ri(w.left,m)}return{width:p-m,height:h-d,x:m,y:d}}function lP(e){const{width:t,height:r}=bC(e);return{width:t,height:r}}function cP(e,t,r){const n=Ki(t),o=fi(t),a=r==="fixed",l=Do(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=ni(0);if((n||!a)&&((Js(t)!=="body"||_d(o))&&(u=Ad(t)),n)){const y=Do(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}!n&&o&&(d.x=Td(o));const p=o&&!n&&!a?wC(o,u):ni(0),h=l.left+u.scrollLeft-d.x-p.x,m=l.top+u.scrollTop-d.y-p.y;return{x:h,y:m,width:l.width,height:l.height}}function Qp(e){return Mn(e).position==="static"}function Sx(e,t){if(!Ki(e)||Mn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return fi(e)===r&&(r=r.ownerDocument.body),r}function SC(e,t){const r=_r(e);if($d(e))return r;if(!Ki(e)){let o=Po(e);for(;o&&!ml(o);){if(jn(o)&&!Qp(o))return o;o=Po(o)}return r}let n=Sx(e,t);for(;n&&XN(n)&&Qp(n);)n=Sx(n,t);return n&&ml(n)&&Qp(n)&&!Vg(n)?r:n||QN(e)||r}const uP=async function(e){const t=this.getOffsetParent||SC,r=this.getDimensions,n=await r(e.floating);return{reference:cP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function dP(e){return Mn(e).direction==="rtl"}const fP={convertOffsetParentRelativeRectToViewportRelativeRect:eP,getDocumentElement:fi,getClippingRect:aP,getOffsetParent:SC,getElementRects:uP,getClientRects:tP,getDimensions:lP,getScale:Os,isElement:jn,isRTL:dP};function EC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pP(e,t,r){let n=null,o;const a=fi(e);function l(){var h;clearTimeout(o),(h=n)==null||h.disconnect(),n=null}function u(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),l();const y=e.getBoundingClientRect(),{left:w,top:E,width:S,height:C}=y;if(h||t(),!S||!C)return;const R=vu(E),k=vu(a.clientWidth-(w+S)),$=vu(a.clientHeight-(E+C)),A=vu(w),N={rootMargin:-R+"px "+-k+"px "+-$+"px "+-A+"px",threshold:ri(0,Hi(1,m))||1};let P=!0;function I(re){const Z=re[0].intersectionRatio;if(!EC(y,e.getBoundingClientRect()))return u();if(Z!==m){if(!P)return u();Z?u(!1,Z):o=setTimeout(()=>{u(!1,1e-7)},1e3)}P=!1}try{n=new IntersectionObserver(I,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(I,N)}n.observe(e)}const d=_r(e),p=()=>u(r);return d.addEventListener("resize",p),u(!0),()=>{d.removeEventListener("resize",p),l()}}function hP(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,p=Hg(e),h=o||a?[...p?gl(p):[],...t?gl(t):[]]:[];h.forEach(R=>{o&&R.addEventListener("scroll",r),a&&R.addEventListener("resize",r)});const m=p&&u?pP(p,r,a):null;let y=-1,w=null;l&&(w=new ResizeObserver(R=>{let[k]=R;k&&k.target===p&&w&&t&&(w.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var $;($=w)==null||$.observe(t)})),r()}),p&&!d&&w.observe(p),t&&w.observe(t));let E,S=d?Do(e):null;d&&C();function C(){const R=Do(e);S&&!EC(S,R)&&r(),S=R,E=requestAnimationFrame(C)}return r(),()=>{var R;h.forEach(k=>{o&&k.removeEventListener("scroll",r),a&&k.removeEventListener("resize",r)}),m?.(),(R=w)==null||R.disconnect(),w=null,d&&cancelAnimationFrame(E)}}const mP=WN,gP=HN,vP=BN,yP=GN,bP=UN,Ex=FN,xP=qN,wP=(e,t,r)=>{const n=new Map,o=r??{},a={...fP,...o.platform,_c:n};return zN(e,t,{...o,platform:a})};var SP=typeof document<"u",EP=function(){},Mu=SP?x.useLayoutEffect:EP;function rd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!rd(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!rd(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function CC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cx(e,t){const r=CC(e);return Math.round(t*r)/r}function Jp(e){const t=x.useRef(e);return Mu(()=>{t.current=e}),t}function CP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:p}=e,[h,m]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,w]=x.useState(n);rd(y,n)||w(n);const[E,S]=x.useState(null),[C,R]=x.useState(null),k=x.useCallback(L=>{L!==N.current&&(N.current=L,S(L))},[]),$=x.useCallback(L=>{L!==P.current&&(P.current=L,R(L))},[]),A=a||E,D=l||C,N=x.useRef(null),P=x.useRef(null),I=x.useRef(h),re=d!=null,Z=Jp(d),ee=Jp(o),ne=Jp(p),X=x.useCallback(()=>{if(!N.current||!P.current)return;const L={placement:t,strategy:r,middleware:y};ee.current&&(L.platform=ee.current),wP(N.current,P.current,L).then(U=>{const z={...U,isPositioned:ne.current!==!1};F.current&&!rd(I.current,z)&&(I.current=z,Lr.flushSync(()=>{m(z)}))})},[y,t,r,ee,ne]);Mu(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[p]);const F=x.useRef(!1);Mu(()=>(F.current=!0,()=>{F.current=!1}),[]),Mu(()=>{if(A&&(N.current=A),D&&(P.current=D),A&&D){if(Z.current)return Z.current(A,D,X);X()}},[A,D,X,Z,re]);const V=x.useMemo(()=>({reference:N,floating:P,setReference:k,setFloating:$}),[k,$]),H=x.useMemo(()=>({reference:A,floating:D}),[A,D]),O=x.useMemo(()=>{const L={position:r,left:0,top:0};if(!H.floating)return L;const U=Cx(H.floating,h.x),z=Cx(H.floating,h.y);return u?{...L,transform:"translate("+U+"px, "+z+"px)",...CC(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:U,top:z}},[r,u,H.floating,h.x,h.y]);return x.useMemo(()=>({...h,update:X,refs:V,elements:H,floatingStyles:O}),[h,X,V,H,O])}const kP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ex({element:n.current,padding:o}).fn(r):{}:n?Ex({element:n,padding:o}).fn(r):{}}}},RP=(e,t)=>{const r=mP(e);return{name:r.name,fn:r.fn,options:[e,t]}},_P=(e,t)=>{const r=gP(e);return{name:r.name,fn:r.fn,options:[e,t]}},$P=(e,t)=>({fn:xP(e).fn,options:[e,t]}),AP=(e,t)=>{const r=vP(e);return{name:r.name,fn:r.fn,options:[e,t]}},TP=(e,t)=>{const r=yP(e);return{name:r.name,fn:r.fn,options:[e,t]}},LP=(e,t)=>{const r=bP(e);return{name:r.name,fn:r.fn,options:[e,t]}},IP=(e,t)=>{const r=kP(e);return{name:r.name,fn:r.fn,options:[e,t]}};var OP="Arrow",kC=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return v.jsx(Yi.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});kC.displayName=OP;var NP=kC;function PP(e){const[t,r]=x.useState(void 0);return Wi(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let l,u;if("borderBoxSize"in a){const d=a.borderBoxSize,p=Array.isArray(d)?d[0]:d;l=p.inlineSize,u=p.blockSize}else l=e.offsetWidth,u=e.offsetHeight;r({width:l,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var qg="Popper",[RC,_C]=cC(qg),[DP,$C]=RC(qg),AC=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return v.jsx(DP,{scope:t,anchor:n,onAnchorChange:o,children:r})};AC.displayName=qg;var TC="PopperAnchor",LC=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=$C(TC,r),l=x.useRef(null),u=Bo(t,l),d=x.useRef(null);return x.useEffect(()=>{const p=d.current;d.current=n?.current||l.current,p!==d.current&&a.onAnchorChange(d.current)}),n?null:v.jsx(Yi.div,{...o,ref:u})});LC.displayName=TC;var Gg="PopperContent",[jP,MP]=RC(Gg),IC=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:p=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:w="optimized",onPlaced:E,...S}=e,C=$C(Gg,r),[R,k]=x.useState(null),$=Bo(t,be=>k(be)),[A,D]=x.useState(null),N=PP(A),P=N?.width??0,I=N?.height??0,re=n+(a!=="center"?"-"+a:""),Z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},ee=Array.isArray(p)?p:[p],ne=ee.length>0,X={padding:Z,boundary:ee.filter(FP),altBoundary:ne},{refs:F,floatingStyles:V,placement:H,isPositioned:O,middlewareData:L}=CP({strategy:"fixed",placement:re,whileElementsMounted:(...be)=>hP(...be,{animationFrame:w==="always"}),elements:{reference:C.anchor},middleware:[RP({mainAxis:o+I,alignmentAxis:l}),d&&_P({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?$P():void 0,...X}),d&&AP({...X}),TP({...X,apply:({elements:be,rects:pe,availableWidth:ue,availableHeight:ge})=>{const{width:qe,height:Xe}=pe.reference,we=be.floating.style;we.setProperty("--radix-popper-available-width",`${ue}px`),we.setProperty("--radix-popper-available-height",`${ge}px`),we.setProperty("--radix-popper-anchor-width",`${qe}px`),we.setProperty("--radix-popper-anchor-height",`${Xe}px`)}}),A&&IP({element:A,padding:u}),BP({arrowWidth:P,arrowHeight:I}),y&&LP({strategy:"referenceHidden",...X})]}),[U,z]=PC(H),T=kd(E);Wi(()=>{O&&T?.()},[O,T]);const M=L.arrow?.x,te=L.arrow?.y,le=L.arrow?.centerOffset!==0,[G,fe]=x.useState();return Wi(()=>{R&&fe(window.getComputedStyle(R).zIndex)},[R]),v.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:O?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(jP,{scope:r,placedSide:U,onArrowChange:D,arrowX:M,arrowY:te,shouldHideArrow:le,children:v.jsx(Yi.div,{"data-side":U,"data-align":z,...S,ref:$,style:{...S.style,animation:O?void 0:"none"}})})})});IC.displayName=Gg;var OC="PopperArrow",zP={top:"bottom",right:"left",bottom:"top",left:"right"},NC=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=MP(OC,n),l=zP[a.placedSide];return v.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:v.jsx(NP,{...o,ref:r,style:{...o.style,display:"block"}})})});NC.displayName=OC;function FP(e){return e!==null}var BP=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,l=o.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[p,h]=PC(r),m={start:"0%",center:"50%",end:"100%"}[h],y=(o.arrow?.x??0)+u/2,w=(o.arrow?.y??0)+d/2;let E="",S="";return p==="bottom"?(E=l?m:`${y}px`,S=`${-d}px`):p==="top"?(E=l?m:`${y}px`,S=`${n.floating.height+d}px`):p==="right"?(E=`${-d}px`,S=l?m:`${w}px`):p==="left"&&(E=`${n.floating.width+d}px`,S=l?m:`${w}px`),{data:{x:E,y:S}}}});function PC(e){const[t,r="center"]=e.split("-");return[t,r]}var UP=AC,VP=LC,WP=IC,HP=NC,qP="Portal",DC=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,a]=x.useState(!1);Wi(()=>a(!0),[]);const l=r||o&&globalThis?.document?.body;return l?_3.createPortal(v.jsx(Yi.div,{...n,ref:t}),l):null});DC.displayName=qP;function GP(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Xg=e=>{const{present:t,children:r}=e,n=XP(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),a=Bo(n.ref,YP(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:a}):null};Xg.displayName="Presence";function XP(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=GP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const p=yu(n.current);a.current=u==="mounted"?p:"none"},[u]),Wi(()=>{const p=n.current,h=o.current;if(h!==e){const y=a.current,w=yu(p);e?d("MOUNT"):w==="none"||p?.display==="none"?d("UNMOUNT"):d(h&&y!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),Wi(()=>{if(t){let p;const h=t.ownerDocument.defaultView??window,m=w=>{const S=yu(n.current).includes(CSS.escape(w.animationName));if(w.target===t&&S&&(d("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},y=w=>{w.target===t&&(a.current=yu(n.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{h.clearTimeout(p),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(p=>{n.current=p?getComputedStyle(p):null,r(p)},[])}}function yu(e){return e?.animationName||"none"}function YP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var KP=_l[" useInsertionEffect ".trim().toString()]||Wi;function QP({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,l]=JP({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:o;{const h=x.useRef(e!==void 0);x.useEffect(()=>{const m=h.current;m!==u&&console.warn(`${n} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,n])}const p=x.useCallback(h=>{if(u){const m=ZP(h)?h(e):h;m!==e&&l.current?.(m)}else a(h)},[u,e,a,l]);return[d,p]}function JP({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),a=x.useRef(t);return KP(()=>{a.current=t},[t]),x.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function ZP(e){return typeof e=="function"}var eD=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tD="VisuallyHidden",jC=x.forwardRef((e,t)=>v.jsx(Yi.span,{...e,ref:t,style:{...eD,...e.style}}));jC.displayName=tD;var rD=jC,[Ld]=cC("Tooltip",[_C]),Id=_C(),MC="TooltipProvider",nD=700,tg="tooltip.open",[iD,Yg]=Ld(MC),zC=e=>{const{__scopeTooltip:t,delayDuration:r=nD,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,l=x.useRef(!0),u=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),v.jsx(iD,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(p=>{u.current=p},[]),disableHoverableContent:o,children:a})};zC.displayName=MC;var vl="Tooltip",[oD,$l]=Ld(vl),FC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=e,d=Yg(vl,e.__scopeTooltip),p=Id(t),[h,m]=x.useState(null),y=_N(),w=x.useRef(0),E=l??d.disableHoverableContent,S=u??d.delayDuration,C=x.useRef(!1),[R,k]=QP({prop:n,defaultProp:o??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(tg))):d.onClose(),a?.(P)},caller:vl}),$=x.useMemo(()=>R?C.current?"delayed-open":"instant-open":"closed",[R]),A=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,C.current=!1,k(!0)},[k]),D=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,k(!1)},[k]),N=x.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!0,k(!0),w.current=0},S)},[S,k]);return x.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),v.jsx(UP,{...p,children:v.jsx(oD,{scope:t,contentId:y,open:R,stateAttribute:$,trigger:h,onTriggerChange:m,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?N():A()},[d.isOpenDelayedRef,N,A]),onTriggerLeave:x.useCallback(()=>{E?D():(window.clearTimeout(w.current),w.current=0)},[D,E]),onOpen:A,onClose:D,disableHoverableContent:E,children:r})})};FC.displayName=vl;var rg="TooltipTrigger",BC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=$l(rg,r),a=Yg(rg,r),l=Id(r),u=x.useRef(null),d=Bo(t,u,o.onTriggerChange),p=x.useRef(!1),h=x.useRef(!1),m=x.useCallback(()=>p.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),v.jsx(VP,{asChild:!0,...l,children:v.jsx(Yi.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:d,onPointerMove:ti(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),h.current=!0)}),onPointerLeave:ti(e.onPointerLeave,()=>{o.onTriggerLeave(),h.current=!1}),onPointerDown:ti(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ti(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:ti(e.onBlur,o.onClose),onClick:ti(e.onClick,o.onClose)})})});BC.displayName=rg;var Kg="TooltipPortal",[sD,aD]=Ld(Kg,{forceMount:void 0}),UC=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=$l(Kg,t);return v.jsx(sD,{scope:t,forceMount:r,children:v.jsx(Xg,{present:r||a.open,children:v.jsx(DC,{asChild:!0,container:o,children:n})})})};UC.displayName=Kg;var Ms="TooltipContent",VC=x.forwardRef((e,t)=>{const r=aD(Ms,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,l=$l(Ms,e.__scopeTooltip);return v.jsx(Xg,{present:n||l.open,children:l.disableHoverableContent?v.jsx(WC,{side:o,...a,ref:t}):v.jsx(lD,{side:o,...a,ref:t})})}),lD=x.forwardRef((e,t)=>{const r=$l(Ms,e.__scopeTooltip),n=Yg(Ms,e.__scopeTooltip),o=x.useRef(null),a=Bo(t,o),[l,u]=x.useState(null),{trigger:d,onClose:p}=r,h=o.current,{onPointerInTransitChange:m}=n,y=x.useCallback(()=>{u(null),m(!1)},[m]),w=x.useCallback((E,S)=>{const C=E.currentTarget,R={x:E.clientX,y:E.clientY},k=fD(R,C.getBoundingClientRect()),$=pD(R,k),A=hD(S.getBoundingClientRect()),D=gD([...$,...A]);u(D),m(!0)},[m]);return x.useEffect(()=>()=>y(),[y]),x.useEffect(()=>{if(d&&h){const E=C=>w(C,h),S=C=>w(C,d);return d.addEventListener("pointerleave",E),h.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",E),h.removeEventListener("pointerleave",S)}}},[d,h,w,y]),x.useEffect(()=>{if(l){const E=S=>{const C=S.target,R={x:S.clientX,y:S.clientY},k=d?.contains(C)||h?.contains(C),$=!mD(R,l);k?y():$&&(y(),p())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[d,h,l,p,y]),v.jsx(WC,{...e,ref:a})}),[cD,uD]=Ld(vl,{isInside:!1}),dD=dN("TooltipContent"),WC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,d=$l(Ms,r),p=Id(r),{onClose:h}=d;return x.useEffect(()=>(document.addEventListener(tg,h),()=>document.removeEventListener(tg,h)),[h]),x.useEffect(()=>{if(d.trigger){const m=y=>{y.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,h]),v.jsx(fC,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:h,children:v.jsxs(WP,{"data-state":d.stateAttribute,...p,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(dD,{children:n}),v.jsx(cD,{scope:r,isInside:!0,children:v.jsx(rD,{id:d.contentId,role:"tooltip",children:o||n})})]})})});VC.displayName=Ms;var HC="TooltipArrow",qC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Id(r);return uD(HC,r).isInside?null:v.jsx(HP,{...o,...n,ref:t})});qC.displayName=HC;function fD(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function pD(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function hD(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function mD(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],d=t[l],p=u.x,h=u.y,m=d.x,y=d.y;h>n!=y>n&&r<(m-p)*(n-h)/(y-h)+p&&(o=!o)}return o}function gD(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),vD(t)}function vD(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(o.y-l.y)>=(a.y-l.y)*(o.x-l.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],l=r[r.length-2];if((a.x-l.x)*(o.y-l.y)>=(a.y-l.y)*(o.x-l.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var yD=zC,bD=FC,xD=BC,wD=UC,SD=VC,ED=qC;const CD=Qt("z-tooltip w-fit max-w-224 rounded-xs bg-interactive px-8 py-4 body-3 text-on-interactive select-none","data-[side=top]:animate-slide-in-from-bottom","data-[state=closed]:data-[side=top]:animate-slide-out-to-bottom","data-[side=bottom]:animate-slide-in-from-top","data-[state=closed]:data-[side=bottom]:animate-slide-out-to-top","data-[side=left]:animate-slide-in-from-right","data-[state=closed]:data-[side=left]:animate-slide-out-to-right","data-[side=right]:animate-slide-in-from-left","data-[state=closed]:data-[side=right]:animate-slide-out-to-left"),kD=({delayDuration:e=200,...t})=>v.jsx(yD,{"data-slot":"tooltip-provider",delayDuration:e,...t}),GC=({delayDuration:e=200,...t})=>v.jsx(kD,{delayDuration:e,children:v.jsx(bD,{"data-slot":"tooltip",...t})}),XC=({...e})=>v.jsx(xD,{"data-slot":"tooltip-trigger",...e}),YC=({className:e,sideOffset:t=0,side:r,children:n,...o})=>v.jsx(wD,{children:v.jsxs(SD,{"data-slot":"tooltip-content",side:r,sideOffset:t,className:Qt(CD,e),...o,children:[v.jsx(ED,{className:"size-10 translate-y-[calc(-50%-1px)] rotate-45 rounded-[1px] bg-interactive fill-interactive"}),v.jsx("div",{className:"relative",children:n})]})});var RD=Symbol.for("react.lazy"),nd=_l[" use ".trim().toString()];function _D(e){return typeof e=="object"&&e!==null&&"then"in e}function KC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===RD&&"_payload"in e&&_D(e._payload)}function $D(e){const t=TD(e),r=x.forwardRef((n,o)=>{let{children:a,...l}=n;KC(a)&&typeof nd=="function"&&(a=nd(a._payload));const u=x.Children.toArray(a),d=u.find(OD);if(d){const p=d.props.children,h=u.map(m=>m===d?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:m);return v.jsx(t,{...l,ref:o,children:x.isValidElement(p)?x.cloneElement(p,void 0,h):null})}return v.jsx(t,{...l,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}var AD=$D("Slot");function TD(e){const t=x.forwardRef((r,n)=>{let{children:o,...a}=r;if(KC(o)&&typeof nd=="function"&&(o=nd(o._payload)),x.isValidElement(o)){const l=PD(o),u=ND(a,o.props);return o.type!==x.Fragment&&(u.ref=n?zg(n,l):l),x.cloneElement(o,u)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var QC=Symbol("radix.slottable");function LD(e){const t=({children:r})=>v.jsx(v.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=QC,t}var ID=LD("Slottable");function OD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QC}function ND(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...u)=>{const d=a(...u);return o(...u),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function PD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const yl=({ref:e,className:t,size:r=16,...n})=>{const{t:o}=jE();return v.jsx("svg",{className:Qt("shrink-0 animate-spin text-base",t),xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 16 16",fill:"none","aria-label":o("components.spinner.loadingAriaLabel"),role:"img",ref:e,...n,children:v.jsx("path",{d:"M8 1.5C11.5899 1.5 14.5 4.41015 14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",fill:"none"})})},DD=kr("inline-flex size-fit cursor-pointer items-center justify-center rounded-full transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",{variants:{appearance:{base:"bg-interactive text-on-interactive hover:bg-interactive-hover active:bg-interactive-pressed",gray:"bg-muted text-base hover:bg-muted-hover active:bg-muted-pressed",accent:"bg-accent text-on-accent hover:bg-accent-hover active:bg-accent-pressed",transparent:"bg-muted-transparent text-base hover:bg-muted-transparent-hover active:bg-muted-transparent-pressed","no-background":"bg-transparent text-base hover:bg-base-transparent-hover active:bg-base-transparent-pressed disabled:bg-base-transparent",red:"bg-error-transparent text-error hover:bg-error-transparent-hover active:bg-error-transparent-pressed"},disabled:{true:"",false:""},loading:{true:"",false:""},size:{xs:"p-8",sm:"p-10",md:"p-12",lg:"p-16"},isFull:{true:"w-full"}},compoundVariants:[{disabled:!0,loading:!1,class:"cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"},{disabled:!0,loading:!0,class:"cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"}],defaultVariants:{appearance:"base",size:"md",isFull:!1}}),kx=kr("shrink-0",{variants:{appearance:{base:"text-on-interactive",accent:"text-on-accent",red:"text-error",gray:"text-base","no-background":"text-base",transparent:"text-base"},disabled:{true:"text-disabled"}}}),JC=({ref:e,className:t,appearance:r="base",size:n,isFull:o,disabled:a=!1,asChild:l=!1,icon:u,loading:d=!1,children:p,onClick:h,...m})=>{const y=Ks({consumerName:"BaseButton",mergeWith:{disabled:a}}),w=n?{xs:16,sm:20,md:24,lg:24}[n]:24;return v.jsxs(l?AD:"button",{className:Qt(DD({disabled:y,loading:d,appearance:r,size:n,isFull:o}),t),ref:e,"data-disabled":y||void 0,disabled:y,onClick:h,...l?{}:{type:"button"},...m,children:[d&&v.jsx(yl,{size:w,className:kx({appearance:r,disabled:y})}),!d&&u&&v.jsx(u,{size:w,className:kx({appearance:r,disabled:y})}),p&&(l?v.jsx(ID,{children:p}):v.jsx("span",{className:"line-clamp-2 text-left",children:p}))]})},sr=({ref:e,className:t,icon:r,tooltip:n=!1,tooltipPlacement:o="top",tooltipText:a,onTooltipOpenChange:l,"aria-label":u,...d})=>{const p=v.jsx(JC,{ref:e,icon:r,className:Qt("shrink-0",t),"aria-label":u,...d});return n?v.jsxs(GC,{onOpenChange:l,children:[v.jsx(XC,{asChild:!0,children:p}),v.jsx(YC,{side:o,children:a||u})]}):p},id=pt("Close",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m3.333 3.333 9.334 9.334m0-9.334-9.334 9.334"})})),jD=pt("WarningFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.773 2.506c-.79-1.388-2.789-1.392-3.575 0v.002L1.1 11.44c-.784 1.372.206 3.08 1.787 3.08h10.212c1.576 0 2.572-1.712 1.787-3.08zM8.5 6.253a.5.5 0 1 0-1 0v2.494a.5.5 0 1 0 1 0zm-.507 3.997h-.006q-.021 0-.041.002a.665.665 0 0 0-.62.665c0 .35.285.666.667.666.197 0 .361-.088.47-.197a.67.67 0 0 0 .197-.47.67.67 0 0 0-.667-.666",clipRule:"evenodd"})})),MD={info:v.jsx(oN,{className:"text-base"}),success:v.jsx(aN,{className:"text-success"}),warning:v.jsx(jD,{className:"text-warning"}),error:v.jsx(sN,{className:"text-error"})},zD={root:kr("flex w-full items-start gap-8 rounded-md p-12 text-base",{variants:{appearance:{info:"bg-surface",success:"bg-success-transparent",warning:"bg-warning-transparent",error:"bg-error-transparent"}}})},ng=({ref:e,appearance:t="info",title:r,description:n,primaryAction:o,secondaryAction:a,className:l,onClose:u,closeAriaLabel:d,...p})=>{const{t:h}=jE(),m=MD[t];return v.jsxs("div",{ref:e,className:Qt(zD.root({appearance:t}),l),...p,children:[v.jsx("div",{className:"flex shrink-0 items-start py-4",children:m}),v.jsxs("div",{className:"mr-8 flex flex-1 flex-col gap-8 py-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[r&&v.jsx("h3",{className:"line-clamp-2 body-1-semi-bold",children:r}),n&&v.jsx("div",{className:Qt("line-clamp-5 body-2",!r&&"mt-2"),children:n})]}),(o||a)&&v.jsxs("div",{className:"flex flex-wrap gap-4",children:[o,a]})]}),u&&v.jsx(sr,{appearance:"transparent",size:"xs",icon:id,onClick:()=>u(),"aria-label":d||h("components.banner.closeAriaLabel")})]})},FD=kr("",{variants:{size:{sm:"px-16 py-10 body-2-semi-bold",md:"px-16 py-12 body-1-semi-bold",lg:"p-16 body-1-semi-bold"}},defaultVariants:{size:"md"}}),BD=({ref:e,className:t,loading:r,disabled:n,children:o,size:a,icon:l,...u})=>v.jsx(JC,{ref:e,size:a,disabled:n,icon:l,loading:r,className:Qt(FD({size:a}),"gap-8",t),...u,children:o}),Od=pt("ChevronUp",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M10.667 9.333 8 6.667 5.333 9.333"})})),zs=pt("ChevronDown",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M5.333 6.667 8 9.333l2.667-2.666"})})),Nd=pt("ChevronRight",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M6.667 10.667 9.333 8 6.667 5.333"})})),Pd=pt("Check",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M13.333 4.333 6 11.667 2.667 8.333"})})),UD=({inputRef:e,checked:t,setChecked:r,form:n})=>{x.useEffect(()=>{const o=e.current?.querySelector("input"),a=o?.form;if(!o||!a)return;let l;const u=()=>{l=setTimeout(()=>{o.checked!==t&&r(o.checked)})};return a.addEventListener("reset",u),()=>{a.removeEventListener("reset",u),clearTimeout(l)}},[e,t,r,n])},VD="relative inline-flex size-20 shrink-0 align-middle",WD=Qt("flex size-full items-center justify-center rounded-xs transition-colors","peer-focus-visible:ring-2 peer-focus-visible:ring-focus peer-focus-visible:ring-offset-2","data-[state=unchecked]:border data-[state=unchecked]:border-muted data-[state=unchecked]:bg-base","data-[state=unchecked]:peer-hover:bg-base-hover","data-[state=unchecked]:peer-active:bg-base-pressed","data-[state=unchecked]:peer-disabled:border-disabled data-[state=unchecked]:peer-disabled:bg-base","data-[state=checked]:bg-active data-[state=checked]:text-on-accent","data-[state=checked]:peer-hover:bg-active-hover","data-[state=checked]:peer-active:bg-active-pressed","data-[state=checked]:peer-disabled:bg-disabled data-[state=checked]:peer-disabled:text-disabled"),Qg=({ref:e,className:t,checked:r,defaultChecked:n=!1,onCheckedChange:o,disabled:a,...l})=>{const u=Ks({consumerName:"Checkbox",mergeWith:{disabled:a}}),[d,p]=I3({prop:r,defaultProp:n,onChange:o}),h=d?"checked":"unchecked",m=x.useRef(null);return UD({inputRef:m,checked:d,setChecked:p,form:l.form}),v.jsxs("span",{ref:m,className:Qt(VD,t),children:[v.jsx("input",{...l,ref:e,type:"checkbox",checked:d,disabled:u,"data-state":h,"data-disabled":u?"":void 0,className:"peer absolute inset-0 m-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",onChange:y=>p(y.target.checked)}),v.jsx("span",{"aria-hidden":!0,"data-state":h,className:WD,children:d&&v.jsx(Pd,{size:16})})]})},HD=e=>{const t=getComputedStyle(e).direction==="rtl",r=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft),o=n>0,a=n<r-1;return{canScrollLeft:t?a:o,canScrollRight:t?o:a}};function qD(e){const[t,r]=x.useState(!1),[n,o]=x.useState(!1);return x.useLayoutEffect(()=>{const a=e.current;if(!a)return;const l=()=>{const m=HD(a);r(m.canScrollLeft),o(m.canScrollRight)};l(),a.addEventListener("scroll",l,{passive:!0});const u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(l);u?.observe(a);let d=null;const p=()=>{const m=a.firstElementChild;m!==d&&(d&&u?.unobserve(d),m&&u?.observe(m),d=m)};p();const h=new MutationObserver(()=>{p(),l()});return h.observe(a,{childList:!0}),()=>{a.removeEventListener("scroll",l),u?.disconnect(),h.disconnect()}},[e]),{canScrollLeft:t,canScrollRight:n}}const GD=kr("flex shrink-0 items-center justify-center rounded-full",{variants:{fill:{transparent:"bg-muted-transparent",plain:""},appearance:{base:"",success:"",error:"",warning:"",muted:"","decorative-blue":"","decorative-pink":"","decorative-purple":"","decorative-green":"","decorative-turquoise":"","decorative-yellow":"","decorative-orange":"","decorative-red":""},size:{32:"spot-h-32 spot-w-32",40:"spot-h-40 spot-w-40",48:"spot-h-48 spot-w-48",56:"spot-h-56 spot-w-56",72:"spot-h-72 spot-w-72"}},compoundVariants:[{fill:"plain",appearance:"base",class:"bg-muted"},{fill:"plain",appearance:"success",class:"bg-success"},{fill:"plain",appearance:"error",class:"bg-error"},{fill:"plain",appearance:"warning",class:"bg-warning"},{fill:"plain",appearance:"muted",class:"bg-muted-pressed"},{fill:"plain",appearance:"decorative-blue",class:"bg-decorative-blue"},{fill:"plain",appearance:"decorative-pink",class:"bg-decorative-pink"},{fill:"plain",appearance:"decorative-purple",class:"bg-decorative-purple"},{fill:"plain",appearance:"decorative-green",class:"bg-decorative-green"},{fill:"plain",appearance:"decorative-turquoise",class:"bg-decorative-turquoise"},{fill:"plain",appearance:"decorative-yellow",class:"bg-decorative-yellow"},{fill:"plain",appearance:"decorative-orange",class:"bg-decorative-orange"},{fill:"plain",appearance:"decorative-red",class:"bg-decorative-red"}]}),XD=kr("",{variants:{fill:{transparent:"",plain:""},appearance:{base:"",success:"",error:"",warning:"",muted:"","decorative-blue":"","decorative-pink":"","decorative-purple":"","decorative-green":"","decorative-turquoise":"","decorative-yellow":"","decorative-orange":"","decorative-red":""},disabled:{true:"text-disabled",false:""}},compoundVariants:[{disabled:!1,fill:"transparent",appearance:"base",class:"text-base"},{disabled:!1,fill:"transparent",appearance:"success",class:"text-success"},{disabled:!1,fill:"transparent",appearance:"error",class:"text-error"},{disabled:!1,fill:"transparent",appearance:"warning",class:"text-warning"},{disabled:!1,fill:"transparent",appearance:"muted",class:"text-muted"},{disabled:!1,fill:"transparent",appearance:"decorative-blue",class:"text-decorative-blue"},{disabled:!1,fill:"transparent",appearance:"decorative-pink",class:"text-decorative-pink"},{disabled:!1,fill:"transparent",appearance:"decorative-purple",class:"text-decorative-purple"},{disabled:!1,fill:"transparent",appearance:"decorative-green",class:"text-decorative-green"},{disabled:!1,fill:"transparent",appearance:"decorative-turquoise",class:"text-decorative-turquoise"},{disabled:!1,fill:"transparent",appearance:"decorative-yellow",class:"text-decorative-yellow"},{disabled:!1,fill:"transparent",appearance:"decorative-orange",class:"text-decorative-orange"},{disabled:!1,fill:"transparent",appearance:"decorative-red",class:"text-decorative-red"},{disabled:!1,fill:"plain",appearance:"base",class:"text-base"},{disabled:!1,fill:"plain",appearance:"success",class:"text-success-strong"},{disabled:!1,fill:"plain",appearance:"error",class:"text-error-strong"},{disabled:!1,fill:"plain",appearance:"warning",class:"text-warning-strong"},{disabled:!1,fill:"plain",appearance:"muted",class:"text-muted"},{disabled:!1,fill:"plain",appearance:"decorative-blue",class:"text-decorative-strong-blue"},{disabled:!1,fill:"plain",appearance:"decorative-pink",class:"text-decorative-strong-pink"},{disabled:!1,fill:"plain",appearance:"decorative-purple",class:"text-decorative-strong-purple"},{disabled:!1,fill:"plain",appearance:"decorative-green",class:"text-decorative-strong-green"},{disabled:!1,fill:"plain",appearance:"decorative-turquoise",class:"text-decorative-strong-turquoise"},{disabled:!1,fill:"plain",appearance:"decorative-yellow",class:"text-decorative-strong-yellow"},{disabled:!1,fill:"plain",appearance:"decorative-orange",class:"text-decorative-strong-orange"},{disabled:!1,fill:"plain",appearance:"decorative-red",class:"text-decorative-strong-red"}]}),YD={32:12,40:16,48:20,56:24,72:40},KD=({appearance:e="base",fill:t="transparent",icon:r,disabled:n=!1,size:o=48,className:a,ref:l,...u})=>{const d=Ks({consumerName:"Spot",mergeWith:{disabled:n}}),p=XD({appearance:e,fill:t,disabled:d});return v.jsx("div",{ref:l,className:Qt(GD({appearance:e,fill:t,size:o}),a),...u,children:v.jsx(r,{size:YD[o],className:p})})},QD=pt("Search",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",d:"m14 14-3.334-3.333m1.2-3.734a4.933 4.933 0 1 1-9.866 0 4.933 4.933 0 0 1 9.867 0Z"})}));var ig=function(e,t){return ig=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},ig(e,t)};function zn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ig(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function JD(e,t,r,n){function o(a){return a instanceof r?a:new r(function(l){l(a)})}return new(r||(r=Promise))(function(a,l){function u(h){try{p(n.next(h))}catch(m){l(m)}}function d(h){try{p(n.throw(h))}catch(m){l(m)}}function p(h){h.done?a(h.value):o(h.value).then(u,d)}p((n=n.apply(e,t||[])).next())})}function ZC(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=u(0),l.throw=u(1),l.return=u(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(p){return function(h){return d([p,h])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,p[0]&&(r=0)),r;)try{if(n=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){r.label=p[1];break}if(p[0]===6&&r.label<a[1]){r.label=a[1],a=p;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(p);break}a[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(h){p=[6,h],o=0}finally{n=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Fs(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Bs(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],l;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(u){l={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return a}function Us(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Ns(e){return this instanceof Ns?(this.v=e,this):new Ns(e)}function ZD(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",l),o[Symbol.asyncIterator]=function(){return this},o;function l(w){return function(E){return Promise.resolve(E).then(w,m)}}function u(w,E){n[w]&&(o[w]=function(S){return new Promise(function(C,R){a.push([w,S,C,R])>1||d(w,S)})},E&&(o[w]=E(o[w])))}function d(w,E){try{p(n[w](E))}catch(S){y(a[0][3],S)}}function p(w){w.value instanceof Ns?Promise.resolve(w.value.v).then(h,m):y(a[0][2],w)}function h(w){d("next",w)}function m(w){d("throw",w)}function y(w,E){w(E),a.shift(),a.length&&d(a[0][0],a[0][1])}}function ej(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Fs=="function"?Fs(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(l){return new Promise(function(u,d){l=e[a](l),o(u,d,l.done,l.value)})}}function o(a,l,u,d){Promise.resolve(d).then(function(p){a({value:p,done:u})},l)}}const tj=pt("ExternalLink",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m8 8 5-5M9.333 3H13v3.667M6 3H4.333C3.597 3 3 3.597 3 4.333v7.334C3 12.4 3.597 13 4.333 13h7.334C12.4 13 13 12.4 13 11.667V10"})})),rj=kr("inline-flex items-center justify-center gap-4 truncate rounded-xs",{variants:{appearance:{base:"bg-muted-transparent text-base",gray:"bg-muted-transparent text-muted",accent:"bg-accent text-on-accent","accent-subtle":"bg-active-subtle text-active",success:"bg-success-transparent text-success",error:"bg-error-transparent text-error",warning:"bg-warning-transparent text-warning",white:"bg-white text-black"},size:{md:"body-3",sm:"body-4"},variant:{tag:"",media:""},disabled:{true:"bg-disabled text-disabled",false:""}},compoundVariants:[{variant:"tag",size:"md",class:"px-8 py-4"},{variant:"tag",size:"sm",class:"px-4 py-2"},{variant:"media",size:"md",class:"py-4 pr-8 pl-4"},{variant:"media",size:"sm",class:"px-4 py-2"}],defaultVariants:{appearance:"accent",size:"md",disabled:!1}}),nj=({ref:e,className:t,appearance:r,size:n,variant:o,consumerName:a,label:l,disabled:u,leadingContent:d,...p})=>{const h=Ks({consumerName:a,mergeWith:{disabled:u}});return v.jsxs("div",{className:Qt(rj({appearance:r,size:n,variant:o,disabled:!!h}),t),ref:e,...p,children:[d,v.jsx("span",{className:"truncate",children:l})]})},Rx={};function yn(e,t){const r=x.useRef(Rx);return r.current===Rx&&(r.current=e(t)),r}const ij=[];function Dd(e){x.useEffect(e,ij)}const Qa=0;let li=class ek{static create(){return new ek}currentId=Qa;start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Qa,r()},t)}isStarted(){return this.currentId!==Qa}clear=()=>{this.currentId!==Qa&&(clearTimeout(this.currentId),this.currentId=Qa)};disposeEffect=()=>this.clear};function Vs(){const e=yn(li.create).current;return Dd(e.disposeEffect),e}const Zp=_l[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],oj=Zp&&Zp!==x.useLayoutEffect?Zp:e=>e();function et(e){const t=yn(sj).current;return t.next=e,oj(t.effect),t.trampoline}function sj(){const e={next:void 0,callback:aj,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function aj(){}const lj={..._l};let _x=0;function cj(e,t="mui"){const[r,n]=x.useState(e),o=e||r;return x.useEffect(()=>{r==null&&(_x+=1,n(`${t}-${_x}`))},[r,t]),o}const $x=lj.useId;function Zs(e,t){if($x!==void 0){const r=$x();return e??(t?`${t}-${r}`:r)}return cj(e,t)}const uj=()=>{},at=typeof document<"u"?x.useLayoutEffect:uj;function dj(e){const t=x.useRef(!0);t.current&&(t.current=!1,e())}function jd(){return typeof window<"u"}function Qi(e){return Jg(e)?(e.nodeName||"").toLowerCase():"#document"}function tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fn(e){var t;return(t=(Jg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jg(e){return jd()?e instanceof Node||e instanceof tr(e).Node:!1}function gt(e){return jd()?e instanceof Element||e instanceof tr(e).Element:!1}function Kt(e){return jd()?e instanceof HTMLElement||e instanceof tr(e).HTMLElement:!1}function bl(e){return!jd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tr(e).ShadowRoot}function Ji(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&o!=="inline"&&o!=="contents"}function fj(e){return/^(table|td|th)$/.test(Qi(e))}function Md(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const pj=/transform|translate|scale|rotate|perspective|filter/,hj=/paint|layout|strict|content/,Ro=e=>!!e&&e!=="none";let eh;function Zg(e){const t=gt(e)?zr(e):e;return Ro(t.transform)||Ro(t.translate)||Ro(t.scale)||Ro(t.rotate)||Ro(t.perspective)||!zd()&&(Ro(t.backdropFilter)||Ro(t.filter))||pj.test(t.willChange||"")||hj.test(t.contain||"")}function mj(e){let t=ci(e);for(;Kt(t)&&!ii(t);){if(Zg(t))return t;if(Md(t))return null;t=ci(t)}return null}function zd(){return eh==null&&(eh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),eh}function ii(e){return/^(html|body|#document)$/.test(Qi(e))}function zr(e){return tr(e).getComputedStyle(e)}function Fd(e){return gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ci(e){if(Qi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bl(e)&&e.host||Fn(e);return bl(t)?t.host:t}function tk(e){const t=ci(e);return ii(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Ji(t)?t:tk(t)}function xl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=tk(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),l=tr(o);if(a){const u=og(l);return t.concat(l,l.visualViewport||[],Ji(o)?o:[],u&&r?xl(u):[])}else return t.concat(o,xl(o,[],r))}function og(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ea=typeof navigator<"u",th=yj(),rk=xj(),nk=bj(),ik=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ok=th.platform==="MacIntel"&&th.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(th.platform),gj=ea&&/apple/i.test(navigator.vendor),sg=ea&&/android/i.test(rk)||/android/i.test(nk);ea&&rk.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const vj=nk.includes("jsdom/");function yj(){if(!ea)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function bj(){if(!ea)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function xj(){if(!ea)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}function _t(e){return e?.ownerDocument||document}const bu=null;let wj=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let o=0;o<r.length;o+=1)r[o]?.(t)};request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}};const xu=new wj;let ji=class sk{static create(){return new sk}static request(t){return xu.request(t)}static cancel(t){return xu.cancel(t)}currentId=bu;request(t){this.cancel(),this.currentId=xu.request(()=>{this.currentId=bu,t()})}cancel=()=>{this.currentId!==bu&&(xu.cancel(this.currentId),this.currentId=bu)};disposeEffect=()=>this.cancel};function ev(){const e=yn(ji.create).current;return Dd(e.disposeEffect),e}function ak(){}const Rr=Object.freeze({});let Ax={},Tx={},Lx="";function Sj(e){if(typeof document>"u")return!1;const t=_t(e);return tr(t).innerWidth-t.documentElement.clientWidth>0}function Ej(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const t=_t(e),r=t.documentElement,n=t.body,o=Ji(r)?r:n,a=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const u=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=a,r.style.scrollbarGutter=l,u===d}function Cj(e){const t=_t(e),r=t.documentElement,n=t.body,o=Ji(r)?r:n,a={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,a)}}function kj(e){const t=_t(e),r=t.documentElement,n=t.body,o=tr(r);let a=0,l=0,u=!1;const d=ji.create();if(ik&&(o.visualViewport?.scale??1)!==1)return()=>{};function p(){const y=o.getComputedStyle(r),w=o.getComputedStyle(n),E=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=r.scrollTop,l=r.scrollLeft,Ax={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},Lx=r.style.scrollBehavior,Tx={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};const S=r.scrollHeight>r.clientHeight,C=r.scrollWidth>r.clientWidth,R=y.overflowY==="scroll"||w.overflowY==="scroll",k=y.overflowX==="scroll"||w.overflowX==="scroll",$=Math.max(0,o.innerWidth-n.clientWidth),A=Math.max(0,o.innerHeight-n.clientHeight),D=parseFloat(w.marginTop)+parseFloat(w.marginBottom),N=parseFloat(w.marginLeft)+parseFloat(w.marginRight),P=Ji(r)?r:n;if(u=Ej(e),u){r.style.scrollbarGutter=E,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(S||R)&&(r.style.overflowY="scroll"),(C||k)&&(r.style.overflowX="scroll"),Object.assign(n.style,{position:"relative",height:D||A?`calc(100dvh - ${D+A}px)`:"100dvh",width:N||$?`calc(100vw - ${N+$}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),n.scrollTop=a,n.scrollLeft=l,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function h(){Object.assign(r.style,Ax),Object.assign(n.style,Tx),u||(r.scrollTop=a,r.scrollLeft=l,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=Lx)}function m(){h(),d.request(p)}return p(),o.addEventListener("resize",m),()=>{d.cancel(),h(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",m)}}let Rj=class{lockCount=0;restore=null;timeoutLock=li.create();timeoutUnlock=li.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=_t(t).documentElement,n=tr(r).getComputedStyle(r).overflowY;if(n==="hidden"||n==="clip"){this.restore=ak;return}const o=ok||!Sj(t);this.restore=o?Cj(t):kj(t)}};const _j=new Rj;function $j(e=!0,t=null){at(()=>{if(e)return _j.acquire(t)},[e,t])}function Aj(e,t){return function(r,...n){const o=new URL(e);return o.searchParams.set("code",r.toString()),n.forEach(a=>o.searchParams.append("args[]",a)),`${t} error #${r}; visit ${o} for the full message.`}}const Uo=Aj("https://base-ui.com/production-error","Base UI"),Tj=500,Lj={style:{transition:"none"}},lk="data-base-ui-click-trigger",Ij={fallbackAxisSide:"end"},Oj={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Nj=x.createContext(void 0);function Pj(){return x.useContext(Nj)?.direction??"ltr"}function Dj(e){const t=x.useRef(""),r=x.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:x.useCallback(n=>{if(n.detail===0){e(n,"keyboard");return}"pointerType"in n?e(n,n.pointerType):e(n,t.current),t.current=""},[e]),onPointerDown:r}}function jj(e,t){const r=x.useRef(e),n=et(t);at(()=>{r.current!==e&&n(r.current)},[e,n]),at(()=>{r.current=e},[e])}function Mj(e){const[t,r]=x.useState(null),n=et((l,u)=>{e||r(u||(ok?"touch":""))});jj(e,l=>{l&&!e&&r(null)});const{onClick:o,onPointerDown:a}=Dj(n);return x.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:a}}),[t,o,a])}function zt(e,t,r,n){let o=!1,a=!1;const l=Rr;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){a=!0},get isCanceled(){return o},get isPropagationAllowed(){return a},trigger:r,...l}}function ck(){const e=new Map;return{emit(t,r){e.get(t)?.forEach(n=>n(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){e.get(t)?.delete(r)}}}let zj=class{nodesRef={current:[]};events=ck();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const r=this.nodesRef.current.findIndex(n=>n===t);r!==-1&&this.nodesRef.current.splice(r,1)}};var rh={exports:{}},nh={},Ix;function Fj(){if(Ix)return nh;Ix=1;var e=Ee;function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,y){var w=y(),E=n({inst:{value:w,getSnapshot:y}}),S=E[0].inst,C=E[1];return a(function(){S.value=w,S.getSnapshot=y,d(S)&&C({inst:S})},[m,w,y]),o(function(){return d(S)&&C({inst:S}),m(function(){d(S)&&C({inst:S})})},[m]),l(w),w}function d(m){var y=m.getSnapshot;m=m.value;try{var w=y();return!r(m,w)}catch{return!0}}function p(m,y){return y()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return nh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,nh}var Ox;function uk(){return Ox||(Ox=1,rh.exports=Fj()),rh.exports}var Bj=uk(),ih={exports:{}},oh={},Nx;function Uj(){if(Nx)return oh;Nx=1;var e=Ee,t=uk();function r(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return oh.useSyncExternalStoreWithSelector=function(p,h,m,y,w){var E=a(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=u(function(){function R(N){if(!k){if(k=!0,$=N,N=y(N),w!==void 0&&S.hasValue){var P=S.value;if(w(P,N))return A=P}return A=N}if(P=A,n($,N))return P;var I=y(N);return w!==void 0&&w(P,I)?($=N,P):($=N,A=I)}var k=!1,$,A,D=m===void 0?null:m;return[function(){return R(h())},D===null?void 0:function(){return R(D())}]},[h,m,y,w]);var C=o(p,E[0],E[1]);return l(function(){S.hasValue=!0,S.value=C},[C]),d(C),C},oh}var Px;function Vj(){return Px||(Px=1,ih.exports=Uj()),ih.exports}var Wj=Vj();const Hj=parseInt(x.version,10);function tv(e){return Hj>=e}const qj=tv(19),Gj=qj?Yj:Kj;function dk(e,t,r,n,o){return Gj(e,t,r,n,o)}function Xj(e,t,r,n,o){const a=x.useCallback(()=>t(e.getSnapshot(),r,n,o),[e,t,r,n,o]);return Bj.useSyncExternalStore(e.subscribe,a,a)}function Yj(e,t,r,n,o){return Xj(e,t,r,n,o)}function Kj(e,t,r,n,o){return Wj.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,r,n,o))}let Qj=class{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,n,o){return dk(this,t,r,n,o)}},fk=class extends Qj{constructor(t,r={},n){super(t),this.context=r,this.selectors=n}useSyncedValue(t,r){x.useDebugValue(t),at(()=>{this.state[t]!==r&&this.set(t,r)},[t,r])}useSyncedValueWithCleanup(t,r){const n=this;at(()=>(n.state[t]!==r&&n.set(t,r),()=>{n.set(t,void 0)}),[n,t,r])}useSyncedValues(t){const r=this,n=Object.values(t);at(()=>{r.update(t)},[r,...n])}useControlledProp(t,r){x.useDebugValue(t);const n=r!==void 0;at(()=>{n&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})},[t,r,n])}select(t,r,n,o){const a=this.selectors[t];return a(this.state,r,n,o)}useState(t,r,n,o){return x.useDebugValue(t),dk(this,this.selectors[t],r,n,o)}useContextCallback(t,r){x.useDebugValue(t);const n=et(r??ak);this.context[t]=n}useStateSetter(t){const r=x.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(t,n)}),r.current}observe(t,r){let n;typeof t=="function"?n=t:n=this.selectors[t];let o=n(this.state);return r(o,o,this),this.subscribe(a=>{const l=n(a);if(!Object.is(o,l)){const u=o;o=l,r(l,u,this)}})}};var od=Symbol("NOT_FOUND");function Jj(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Zj(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function e6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Dx=e=>Array.isArray(e)?e:[e];function t6(e){const t=Array.isArray(e[0])?e[0]:e;return e6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function r6(e,t){const r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}function n6(e){let t;return{get(r){return t&&e(t.key,r)?t.value:od},put(r,n){t={key:r,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function i6(e,t){let r=[];function n(u){const d=r.findIndex(p=>t(u,p.key));if(d>-1){const p=r[d];return d>0&&(r.splice(d,1),r.unshift(p)),p.value}return od}function o(u,d){n(u)===od&&(r.unshift({key:u,value:d}),r.length>e&&r.pop())}function a(){return r}function l(){r=[]}return{get:n,put:o,getEntries:a,clear:l}}var o6=(e,t)=>e===t;function s6(e){return function(t,r){if(t===null||r===null||t.length!==r.length)return!1;const{length:n}=t;for(let o=0;o<n;o++)if(!e(t[o],r[o]))return!1;return!0}}function a6(e,t){const r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=o6,maxSize:o=1,resultEqualityCheck:a}=r,l=s6(n);let u=0;const d=o<=1?n6(l):i6(o,l);function p(){let h=d.get(arguments);if(h===od){if(h=e.apply(null,arguments),u++,a){const m=d.getEntries().find(y=>a(y.value,h));m&&(h=m.value,u!==0&&u--)}d.put(arguments,h)}return h}return p.clearCache=()=>{d.clear(),p.resetResultsCount()},p.resultsCount=()=>u,p.resetResultsCount=()=>{u=0},p}var l6=class{constructor(t){this.value=t}deref(){return this.value}},c6=typeof WeakRef<"u"?WeakRef:l6,u6=0,jx=1;function wu(){return{s:u6,v:void 0,o:null,p:null}}function pk(e,t={}){let r=wu();const{resultEqualityCheck:n}=t;let o,a=0;function l(){let u=r;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const w=arguments[m];if(typeof w=="function"||typeof w=="object"&&w!==null){let E=u.o;E===null&&(u.o=E=new WeakMap);const S=E.get(w);S===void 0?(u=wu(),E.set(w,u)):u=S}else{let E=u.p;E===null&&(u.p=E=new Map);const S=E.get(w);S===void 0?(u=wu(),E.set(w,u)):u=S}}const p=u;let h;if(u.s===jx)h=u.v;else if(h=e.apply(null,arguments),a++,n){const m=o?.deref?.()??o;m!=null&&n(m,h)&&(h=m,a!==0&&a--),o=typeof h=="object"&&h!==null||typeof h=="function"?new c6(h):h}return p.s=jx,p.v=h,h}return l.clearCache=()=>{r=wu(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function hk(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,l=0,u,d={},p=o.pop();typeof p=="object"&&(d=p,p=o.pop()),Jj(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const h={...r,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:w=pk,argsMemoizeOptions:E=[]}=h,S=Dx(y),C=Dx(E),R=t6(o),k=m(function(){return a++,p.apply(null,arguments)},...S),$=w(function(){l++;const A=r6(R,arguments);return u=k.apply(null,A),u},...C);return Object.assign($,{resultFunc:p,memoizedResultFunc:k,dependencies:R,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:w})};return Object.assign(n,{withTypes:()=>n}),n}var d6=hk(pk),f6=Object.assign((e,t=d6)=>{Zj(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(o=>e[o]);return t(n,(...o)=>o.reduce((a,l,u)=>(a[r[u]]=l,a),{}))},{withTypes:()=>f6});hk({memoize:a6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ct=(e,t,r,n,o,a,...l)=>{if(l.length>0)throw new Error(Uo(1));let u;if(e)u=e;else throw new Error("Missing arguments");return u};function p6(e){e.preventDefault(),e.stopPropagation()}function h6(e){return"nativeEvent"in e}function m6(e){return e.pointerType===""&&e.isTrusted?!0:sg&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function g6(e){return vj?!1:!sg&&e.width===0&&e.height===0||sg&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function wl(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function mk(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const v6={open:ct(e=>e.open),domReferenceElement:ct(e=>e.domReferenceElement),referenceElement:ct(e=>e.positionReference??e.referenceElement),floatingElement:ct(e=>e.floatingElement),floatingId:ct(e=>e.floatingId)};let rv=class extends fk{constructor(t){const{nested:r,noEmit:n,onOpenChange:o,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:ck(),nested:r,noEmit:n,triggerElements:a},v6)}setOpen=(t,r)=>{if((!t||!this.state.open||mk(r.event))&&(this.context.dataRef.current.openEvent=t?r.event:void 0),!this.context.noEmit){const n={open:t,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",n)}this.context.onOpenChange?.(t,r)}},nv=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,r){const n=this.idMap.get(t);n!==r&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(r),this.idMap.set(t,r))}delete(t){const r=this.idMap.get(t);r&&(this.elementsSet.delete(r),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const r of this.elementsSet)if(t(r))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function y6(){return new rv({open:!1,floatingElement:null,referenceElement:null,triggerElements:new nv,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function b6(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:y6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Rr,inactiveTriggerProps:Rr,popupProps:Rr}}const Su=ct(e=>e.triggerIdProp??e.activeTriggerId),x6={open:ct(e=>e.openProp??e.open),mounted:ct(e=>e.mounted),transitionStatus:ct(e=>e.transitionStatus),floatingRootContext:ct(e=>e.floatingRootContext),preventUnmountingOnClose:ct(e=>e.preventUnmountingOnClose),payload:ct(e=>e.payload),activeTriggerId:Su,activeTriggerElement:ct(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ct((e,t)=>t!==void 0&&Su(e)===t),isOpenedByTrigger:ct((e,t)=>t!==void 0&&Su(e)===t&&e.open),isMountedByTrigger:ct((e,t)=>t!==void 0&&Su(e)===t&&e.mounted),triggerProps:ct((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ct(e=>e.popupProps),popupElement:ct(e=>e.popupElement),positionerElement:ct(e=>e.positionerElement)},gk=x.createContext(null),vk=x.createContext(null),Vo=()=>x.useContext(gk)?.id||null,ta=e=>{const t=x.useContext(vk);return e??t};function w6(e){const t=Zs(),r=ta(e),n=Vo();return at(()=>{if(!t)return;const o={id:t,parentId:n};return r?.addNode(o),()=>{r?.removeNode(o)}},[r,t,n]),t}function S6(e){const{children:t,id:r}=e,n=Vo();return v.jsx(gk.Provider,{value:x.useMemo(()=>({id:r,parentId:n}),[r,n]),children:t})}function E6(e){const{children:t,externalTree:r}=e,n=yn(()=>r??new zj).current;return v.jsx(vk.Provider,{value:n,children:t})}function C6(e,t=!1,r=!1){const[n,o]=x.useState(e&&t?"idle":void 0),[a,l]=x.useState(e);return e&&!a&&(l(!0),o("starting")),!e&&a&&n!=="ending"&&!r&&o("ending"),!e&&!a&&n==="ending"&&o(void 0),at(()=>{if(!e&&a&&n!=="ending"&&r){const u=ji.request(()=>{o("ending")});return()=>{ji.cancel(u)}}},[e,a,n,r]),at(()=>{if(!e||t)return;const u=ji.request(()=>{o(void 0)});return()=>{ji.cancel(u)}},[t,e]),at(()=>{if(!e||!t)return;e&&a&&n!=="idle"&&o("starting");const u=ji.request(()=>{o("idle")});return()=>{ji.cancel(u)}},[t,e,a,o,n]),x.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:n}),[a,n])}function Zn(e){return e==null?e:"current"in e?e.current:e}let Sl=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const k6={[Sl.startingStyle]:""},R6={[Sl.endingStyle]:""},yk={transitionStatus(e){return e==="starting"?k6:e==="ending"?R6:null}};function bk(e,t=!1,r=!0){const n=ev();return et((o,a=null)=>{n.cancel();function l(){Lr.flushSync(o)}const u=Zn(e);if(u==null)return;const d=u;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let p=function(){const m=Sl.startingStyle;if(!d.hasAttribute(m)){n.request(h);return}const y=new MutationObserver(()=>{d.hasAttribute(m)||(y.disconnect(),h())});y.observe(d,{attributes:!0,attributeFilter:[m]}),a?.addEventListener("abort",()=>y.disconnect(),{once:!0})},h=function(){Promise.all(d.getAnimations().map(m=>m.finished)).then(()=>{a?.aborted||l()}).catch(()=>{const m=d.getAnimations();if(r){if(a?.aborted)return;l()}else m.length>0&&m.some(y=>y.pending||y.playState!=="finished")&&h()})};if(t){p();return}n.request(h)}})}function xk(e){const{enabled:t=!0,open:r,ref:n,onComplete:o}=e,a=et(o),l=bk(n,r,!1);x.useEffect(()=>{if(!t)return;const u=new AbortController;return l(a,u.signal),()=>{u.abort()}},[t,r,a,l])}function _6(e,t){const r=x.useRef(null),n=x.useRef(null);return x.useCallback(o=>{if(e!==void 0){if(r.current!==null){const a=r.current,l=n.current,u=t.context.triggerElements.getById(a);l&&u===l&&t.context.triggerElements.delete(a),r.current=null,n.current=null}o!==null&&(r.current=e,n.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function $6(e,t,r,n){const o=r.useState("isMountedByTrigger",e),a=_6(e,r),l=et(u=>{if(a(u),!u||!r.select("open"))return;const d=r.select("activeTriggerId");if(d===e){r.update({activeTriggerElement:u,...n});return}d==null&&r.update({activeTriggerId:e,activeTriggerElement:u,...n})});return at(()=>{o&&r.update({activeTriggerElement:t.current,...n})},[o,r,t,...Object.values(n)]),{registerTrigger:l,isMountedByThisTrigger:o}}function A6(e){const t=e.useState("open");at(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const r=e.context.triggerElements.entries().next();if(!r.done){const[n,o]=r.value;e.update({activeTriggerId:n,activeTriggerElement:o})}}},[t,e])}function T6(e,t,r){const{mounted:n,setMounted:o,transitionStatus:a}=C6(e);t.useSyncedValues({mounted:n,transitionStatus:a});const l=et(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),r?.(),t.context.onOpenChangeComplete?.(!1)}),u=t.useState("preventUnmountingOnClose");return xk({enabled:!u,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}function L6(e){const{popupStore:t,noEmit:r=!1,treatPopupAsFloatingElement:n=!1,onOpenChange:o}=e,a=Zs(),l=Vo()!=null,u=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(n?"popupElement":"positionerElement"),h=t.context.triggerElements,m=yn(()=>new rv({open:u,referenceElement:d,floatingElement:p,triggerElements:h,onOpenChange:o,floatingId:a,nested:l,noEmit:r})).current;return at(()=>{const y={open:u,floatingId:a,referenceElement:d,floatingElement:p};gt(d)&&(y.domReferenceElement=d),m.state.positionReference===m.state.referenceElement&&(y.positionReference=d),m.update(y)},[u,a,d,p,m]),m.context.onOpenChange=o,m.context.nested=l,m.context.noEmit=r,m}function sd(e){return`data-base-ui-${e}`}const ag="data-base-ui-focusable",wk="active",Sk="selected",Ek="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function $o(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function st(e,t){if(!e||!t)return!1;const r=t.getRootNode?.();if(e.contains(t))return!0;if(r&&bl(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ck(e,t){if(!gt(e))return!1;const r=e;if(t.hasElement(r))return!r.hasAttribute("data-trigger-disabled");for(const[,n]of t.entries())if(st(n,r))return!n.hasAttribute("data-trigger-disabled");return!1}function gn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function hn(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}function I6(e){return e.matches("html,body")}function iv(e){return Kt(e)&&e.matches(Ek)}function Mx(e){return e?e.getAttribute("role")==="combobox"&&iv(e):!1}function lg(e){return e?e.hasAttribute(ag)?e:e.querySelector(`[${ag}]`)||e:null}function oi(e,t,r=!0){return e.filter(n=>n.parentId===t&&(!r||n.context?.open)).flatMap(n=>[n,...oi(e,n.id,r)])}function zx(e,t){let r=[],n=e.find(o=>o.id===t)?.parentId;for(;n;){const o=e.find(a=>a.id===n);n=o?.parentId,o&&(r=r.concat(o))}return r}const Ws="trigger-press",Cr="trigger-hover",kk="outside-press",El="focus-out",Rk="escape-key",O6="imperative-action",N6={intentional:"onClick",sloppy:"onPointerDown"};function P6(){return!1}function D6(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function j6(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingElement"),{dataRef:a}=r.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:p="sloppy",referencePress:h=P6,referencePressEvent:m="sloppy",bubbles:y,externalTree:w}=t,E=ta(w),S=et(typeof d=="function"?d:()=>!1),C=typeof d=="function"?S:d,R=C!==!1,k=et(()=>p),$=x.useRef(!1),A=x.useRef(!1),D=x.useRef(!1),{escapeKey:N,outsidePress:P}=D6(y),I=x.useRef(null),re=Vs(),Z=Vs(),ee=et(()=>{Z.clear(),a.current.insideReactTree=!1}),ne=x.useRef(!1),X=x.useRef(""),F=et(h),V=et(T=>{if(!n||!l||!u||T.key!=="Escape"||ne.current)return;const M=a.current.floatingContext?.nodeId,te=E?oi(E.nodesRef.current,M):[];if(!N&&te.length>0){let fe=!0;if(te.forEach(be=>{be.context?.open&&!be.context.dataRef.current.__escapeKeyBubbles&&(fe=!1)}),!fe)return}const le=h6(T)?T.nativeEvent:T,G=zt(Rk,le);r.setOpen(!1,G),!N&&!G.isPropagationAllowed&&T.stopPropagation()}),H=et(()=>{a.current.insideReactTree=!0,Z.start(0,ee)});x.useEffect(()=>{if(!n||!l)return;a.current.__escapeKeyBubbles=N,a.current.__outsidePressBubbles=P;const T=new li,M=new li;function te(){T.clear(),ne.current=!0}function le(){T.start(zd()?5:0,()=>{ne.current=!1})}function G(){D.current=!0,M.start(0,()=>{D.current=!1})}function fe(){$.current=!1,A.current=!1}function be(){const oe=X.current,Se=oe==="pen"||!oe?"mouse":oe,Je=k(),ht=typeof Je=="function"?Je():Je;return typeof ht=="string"?ht:ht[Se]}function pe(oe){const Se=be();return Se==="intentional"&&oe.type!=="click"||Se==="sloppy"&&oe.type==="click"}function ue(oe){const Se=a.current.floatingContext?.nodeId,Je=E&&oi(E.nodesRef.current,Se).some(ht=>hn(oe,ht.context?.elements.floating));return hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement"))||Je}function ge(oe){if(pe(oe)){ee();return}if(a.current.insideReactTree){ee();return}const Se=gn(oe),Je=`[${sd("inert")}]`;let ht=Array.from(_t(r.select("floatingElement")).querySelectorAll(Je));const Bt=gt(Se)?Se.getRootNode():null;bl(Bt)&&(ht=ht.concat(Array.from(Bt.querySelectorAll(Je))));const Ut=r.context.triggerElements;if(Se&&(Ut.hasElement(Se)||Ut.hasMatchingElement(rt=>st(rt,Se))))return;let jt=gt(Se)?Se:null;for(;jt&&!ii(jt);){const rt=ci(jt);if(ii(rt)||!gt(rt))break;jt=rt}if(ht.length&&gt(Se)&&!I6(Se)&&!st(Se,r.select("floatingElement"))&&ht.every(rt=>!st(jt,rt)))return;if(Kt(Se)&&!("touches"in oe)){const rt=ii(Se),q=zr(Se),Q=/auto|scroll/,ie=rt||Q.test(q.overflowX),se=rt||Q.test(q.overflowY),Ce=ie&&Se.clientWidth>0&&Se.scrollWidth>Se.clientWidth,Ve=se&&Se.clientHeight>0&&Se.scrollHeight>Se.clientHeight,Ke=q.direction==="rtl",Pe=Ve&&(Ke?oe.offsetX<=Se.offsetWidth-Se.clientWidth:oe.offsetX>Se.clientWidth),he=Ce&&oe.offsetY>Se.clientHeight;if(Pe||he)return}if(ue(oe))return;if(be()==="intentional"&&D.current){M.clear(),D.current=!1;return}if(typeof C=="function"&&!C(oe))return;const Vt=a.current.floatingContext?.nodeId,bt=E?oi(E.nodesRef.current,Vt):[];if(bt.length>0){let rt=!0;if(bt.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__outsidePressBubbles&&(rt=!1)}),!rt)return}r.setOpen(!1,zt(kk,oe)),ee()}function qe(oe){be()!=="sloppy"||oe.pointerType==="touch"||!r.select("open")||!l||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement"))||ge(oe)}function Xe(oe){if(be()!=="sloppy"||!r.select("open")||!l||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement")))return;const Se=oe.touches[0];Se&&(I.current={startTime:Date.now(),startX:Se.clientX,startY:Se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},re.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function we(oe){X.current="touch";const Se=gn(oe);function Je(){Xe(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}function ze(oe){if(re.clear(),oe.type==="pointerdown"&&(X.current=oe.pointerType),oe.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const Se=gn(oe);function Je(){oe.type==="pointerdown"?qe(oe):ge(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}function We(oe){if(!$.current)return;const Se=A.current;if(fe(),be()==="intentional"){if(oe.type==="pointercancel"){Se&&G();return}if(!ue(oe)){if(Se){G();return}typeof C=="function"&&!C(oe)||(M.clear(),D.current=!0,ee())}}}function tt(oe){if(be()!=="sloppy"||!I.current||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement")))return;const Se=oe.touches[0];if(!Se)return;const Je=Math.abs(Se.clientX-I.current.startX),ht=Math.abs(Se.clientY-I.current.startY),Bt=Math.sqrt(Je*Je+ht*ht);Bt>5&&(I.current.dismissOnTouchEnd=!0),Bt>10&&(ge(oe),re.clear(),I.current=null)}function De(oe){const Se=gn(oe);function Je(){tt(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}function Fe(oe){be()!=="sloppy"||!I.current||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&ge(oe),re.clear(),I.current=null)}function lt(oe){const Se=gn(oe);function Je(){Fe(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}const Ne=_t(o);return u&&(Ne.addEventListener("keydown",V),Ne.addEventListener("compositionstart",te),Ne.addEventListener("compositionend",le)),R&&(Ne.addEventListener("click",ze,!0),Ne.addEventListener("pointerdown",ze,!0),Ne.addEventListener("pointerup",We,!0),Ne.addEventListener("pointercancel",We,!0),Ne.addEventListener("mousedown",ze,!0),Ne.addEventListener("mouseup",We,!0),Ne.addEventListener("touchstart",we,!0),Ne.addEventListener("touchmove",De,!0),Ne.addEventListener("touchend",lt,!0)),()=>{u&&(Ne.removeEventListener("keydown",V),Ne.removeEventListener("compositionstart",te),Ne.removeEventListener("compositionend",le)),R&&(Ne.removeEventListener("click",ze,!0),Ne.removeEventListener("pointerdown",ze,!0),Ne.removeEventListener("pointerup",We,!0),Ne.removeEventListener("pointercancel",We,!0),Ne.removeEventListener("mousedown",ze,!0),Ne.removeEventListener("mouseup",We,!0),Ne.removeEventListener("touchstart",we,!0),Ne.removeEventListener("touchmove",De,!0),Ne.removeEventListener("touchend",lt,!0)),T.clear(),M.clear(),fe(),D.current=!1}},[a,o,u,R,C,n,l,N,P,V,ee,k,E,r,re]),x.useEffect(ee,[C,ee]);const O=x.useMemo(()=>({onKeyDown:V,[N6[m]]:T=>{F()&&r.setOpen(!1,zt(Ws,T.nativeEvent))},...m!=="intentional"&&{onClick(T){F()&&r.setOpen(!1,zt(Ws,T.nativeEvent))}}}),[V,r,m,F]),L=et(T=>{if(!n||!l||T.button!==0)return;const M=gn(T.nativeEvent);st(r.select("floatingElement"),M)&&($.current||($.current=!0,A.current=!1))}),U=et(T=>{!n||!l||(T.defaultPrevented||T.nativeEvent.defaultPrevented)&&$.current&&(A.current=!0)}),z=x.useMemo(()=>({onKeyDown:V,onPointerDown:U,onMouseDown:U,onClickCapture:H,onMouseDownCapture(T){H(),L(T)},onPointerDownCapture(T){H(),L(T)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[V,H,L,U]);return x.useMemo(()=>l?{reference:O,floating:z,trigger:O}:{},[l,O,z])}const M6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function z6(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingId"),a=r.useState("domReferenceElement"),l=r.useState("floatingElement"),{role:u="dialog"}=t,d=Zs(),p=a?.id||d,h=x.useMemo(()=>lg(l)?.id||o,[l,o]),m=M6.get(u)??u,y=Vo()!=null,w=x.useMemo(()=>m==="tooltip"||u==="label"?Rr:{"aria-haspopup":m==="alertdialog"?"dialog":m,"aria-expanded":"false",...m==="listbox"&&{role:"combobox"},...m==="menu"&&y&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[m,y,u]),E=x.useMemo(()=>m==="tooltip"||u==="label"?{[`aria-${u==="label"?"labelledby":"describedby"}`]:n?h:void 0}:{...w,"aria-expanded":n?"true":"false","aria-controls":n?h:void 0,...m==="menu"&&{id:p}},[m,h,n,p,u,w]),S=x.useMemo(()=>{const R={id:h,...m&&{role:m}};return m==="tooltip"||u==="label"?R:{...R,...m==="menu"&&{"aria-labelledby":p}}},[m,h,p,u]),C=x.useCallback(({active:R,selected:k})=>{const $={role:"option",...R&&{id:`${h}-fui-option`}};switch(u){case"select":case"combobox":return{...$,"aria-selected":k}}return{}},[h,u]);return x.useMemo(()=>({reference:E,floating:S,item:C,trigger:w}),[E,S,w,C])}function Nn(e){const t=yn(F6,e).current;return t.next=e,at(t.effect),t}function F6(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let Fx=0;function sh(e,t={}){const{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(Fx);const a=()=>e?.focus({preventScroll:r});o?a():Fx=requestAnimationFrame(a)}const B6=["top","right","bottom","left"],Hs=Math.min,Mr=Math.max,ad=Math.round,Eu=Math.floor,Pn=e=>({x:e,y:e}),U6={left:"right",right:"left",bottom:"top",top:"bottom"};function cg(e,t,r){return Mr(e,Hs(t,r))}function ui(e,t){return typeof e=="function"?e(t):e}function $r(e){return e.split("-")[0]}function Zi(e){return e.split("-")[1]}function ov(e){return e==="x"?"y":"x"}function sv(e){return e==="y"?"height":"width"}function Xr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function av(e){return ov(Xr(e))}function V6(e,t,r){r===void 0&&(r=!1);const n=Zi(e),o=av(e),a=sv(o);let l=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=ld(l)),[l,ld(l)]}function W6(e){const t=ld(e);return[ug(e),t,ug(t)]}function ug(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Bx=["left","right"],Ux=["right","left"],H6=["top","bottom"],q6=["bottom","top"];function G6(e,t,r){switch(e){case"top":case"bottom":return r?t?Ux:Bx:t?Bx:Ux;case"left":case"right":return t?H6:q6;default:return[]}}function X6(e,t,r,n){const o=Zi(e);let a=G6($r(e),r==="start",n);return o&&(a=a.map(l=>l+"-"+o),t&&(a=a.concat(a.map(ug)))),a}function ld(e){const t=$r(e);return U6[t]+e.slice(t.length)}function Y6(e){return{top:0,right:0,bottom:0,left:0,...e}}function _k(e){return typeof e!="number"?Y6(e):{top:e,right:e,bottom:e,left:e}}function cd(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function K6(e){return zr(e).display!=="none"}function $k(e=[]){const t=e.map(p=>p?.reference),r=e.map(p=>p?.floating),n=e.map(p=>p?.item),o=e.map(p=>p?.trigger),a=x.useCallback(p=>Cu(p,e,"reference"),t),l=x.useCallback(p=>Cu(p,e,"floating"),r),u=x.useCallback(p=>Cu(p,e,"item"),n),d=x.useCallback(p=>Cu(p,e,"trigger"),o);return x.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:u,getTriggerProps:d}),[a,l,u,d])}function Cu(e,t,r){const n=new Map,o=r==="item",a={};r==="floating"&&(a.tabIndex=-1,a[ag]="");for(const l in e)o&&e&&(l===wk||l===Sk)||(a[l]=e[l]);for(let l=0;l<t.length;l+=1){let u;const d=t[l]?.[r];typeof d=="function"?u=e?d(e):null:u=d,u&&Vx(a,u,o,n)}return Vx(a,e,o,n),a}function Vx(e,t,r,n){for(const o in t){const a=t[o];r&&(o===wk||o===Sk)||(o.startsWith("on")?(n.has(o)||n.set(o,[]),typeof a=="function"&&(n.get(o)?.push(a),e[o]=(...l)=>n.get(o)?.map(u=>u(...l)).find(u=>u!==void 0))):e[o]=a)}}function dg(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const ll={};function Ak(e,t,r,n,o){let a={...fg(e,ll)};return t&&(a=zu(a,t)),r&&(a=zu(a,r)),n&&(a=zu(a,n)),a}function Q6(e){if(e.length===0)return ll;if(e.length===1)return fg(e[0],ll);let t={...fg(e[0],ll)};for(let r=1;r<e.length;r+=1)t=zu(t,e[r]);return t}function zu(e,t){return Tk(t)?t(e):J6(e,t)}function J6(e,t){if(!t)return e;for(const r in t){const n=t[r];switch(r){case"style":{e[r]=dg(e.style,n);break}case"className":{e[r]=Lk(e.className,n);break}default:Z6(r,n)?e[r]=eM(e[r],n):e[r]=n}}return e}function Z6(e,t){const r=e.charCodeAt(0),n=e.charCodeAt(1),o=e.charCodeAt(2);return r===111&&n===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Tk(e){return typeof e=="function"}function fg(e,t){return Tk(e)?e(t):e??ll}function eM(e,t){return t?e?r=>{if(tM(r)){const o=r;pg(o);const a=t(o);return o.baseUIHandlerPrevented||e?.(o),a}const n=t(r);return e?.(r),n}:t:e}function pg(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Lk(e,t){return t?e?t+" "+e:t:e}function tM(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}let lv=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Sl.startingStyle]="startingStyle",e[e.endingStyle=Sl.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),hg=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const rM={[hg.popupOpen]:""},nM={[hg.popupOpen]:"",[hg.pressed]:""},iM={[lv.open]:""},oM={[lv.closed]:""},sM={[lv.anchorHidden]:""},aM={open(e){return e?rM:null}},lM={open(e){return e?nM:null}},cv={open(e){return e?iM:oM},anchorHidden(e){return e?sM:null}};function ud(e,t,r,n){const o=yn(Ik).current;return uM(o,e,t,r,n)&&Ok(o,[e,t,r,n]),o.callback}function cM(e){const t=yn(Ik).current;return dM(t,e)&&Ok(t,e),t.callback}function Ik(){return{callback:null,cleanup:null,refs:[]}}function uM(e,t,r,n,o){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==n||e.refs[3]!==o}function dM(e,t){return e.refs.length!==t.length||e.refs.some((r,n)=>r!==t[n])}function Ok(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const n=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=null)switch(typeof a){case"function":{const l=a(r);typeof l=="function"&&(n[o]=l);break}case"object":{a.current=r;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=null)switch(typeof a){case"function":{const l=n[o];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}function Wx(e){if(!x.isValidElement(e))return null;const t=e,r=t.props;return(tv(19)?r?.ref:t.ref)??null}function fM(e,t){const r={};for(const n in e){const o=e[n];if(t?.hasOwnProperty(n)){const a=t[n](o);a!=null&&Object.assign(r,a);continue}o===!0?r[`data-${n.toLowerCase()}`]="":o&&(r[`data-${n.toLowerCase()}`]=o.toString())}return r}function pM(e,t){return typeof e=="function"?e(t):e}function hM(e,t){return typeof e=="function"?e(t):e}function Al(e,t,r={}){const n=t.render,o=mM(t,r);if(r.enabled===!1)return null;const a=r.state??Rr;return vM(e,n,o,a)}function mM(e,t={}){const{className:r,style:n,render:o}=e,{state:a=Rr,ref:l,props:u,stateAttributesMapping:d,enabled:p=!0}=t,h=p?pM(r,a):void 0,m=p?hM(n,a):void 0,y=p?fM(a,d):Rr,w=p?dg(y,Array.isArray(u)?Q6(u):u)??Rr:Rr;return typeof document<"u"&&(p?Array.isArray(l)?w.ref=cM([w.ref,Wx(o),...l]):w.ref=ud(w.ref,Wx(o),l):ud(null,null)),p?(h!==void 0&&(w.className=Lk(w.className,h)),m!==void 0&&(w.style=dg(w.style,m)),w):Rr}const gM=Symbol.for("react.lazy");function vM(e,t,r,n){if(t){if(typeof t=="function")return t(r,n);const o=Ak(r,t.props);o.ref=r.ref;let a=t;return a?.$$typeof===gM&&(a=x.Children.toArray(t)[0]),x.cloneElement(a,o)}if(e&&typeof e=="string")return yM(e,r);throw new Error(Uo(8))}function yM(e,t){return e==="button"?x.createElement("button",{type:"button",...t,key:t.key}):e==="img"?x.createElement("img",{alt:"",...t,key:t.key}):x.createElement(e,t)}const bM=x.createContext(void 0);function xM(e=!1){const t=x.useContext(bM);if(t===void 0&&!e)throw new Error(Uo(16));return t}function wM(e){const{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:o=0,isNativeButton:a}=e,l=n&&t!==!1,u=n&&t===!1;return{props:x.useMemo(()=>{const d={onKeyDown(p){r&&t&&p.key!=="Tab"&&p.preventDefault()}};return n||(d.tabIndex=o,!a&&r&&(d.tabIndex=t?o:-1)),(a&&(t||l)||!a&&r)&&(d["aria-disabled"]=r),a&&(!t||u)&&(d.disabled=r),d},[n,r,t,l,u,a,o])}}function SM(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:o=!0,composite:a}=e,l=x.useRef(null),u=xM(!0),d=a??u!==void 0,{props:p}=wM({focusableWhenDisabled:r,disabled:t,composite:d,tabIndex:n,isNativeButton:o}),h=x.useCallback(()=>{const w=l.current;ah(w)&&d&&t&&p.disabled===void 0&&w.disabled&&(w.disabled=!1)},[t,p.disabled,d]);at(h,[h]);const m=x.useCallback((w={})=>{const{onClick:E,onMouseDown:S,onKeyUp:C,onKeyDown:R,onPointerDown:k,...$}=w;return Ak({type:o?"button":void 0,onClick(A){if(t){A.preventDefault();return}E?.(A)},onMouseDown(A){t||S?.(A)},onKeyDown(A){if(t||(pg(A),R?.(A),A.baseUIHandlerPrevented))return;const D=A.target===A.currentTarget,N=A.currentTarget,P=ah(N),I=!o&&EM(N),re=D&&(o?P:!I),Z=A.key==="Enter",ee=A.key===" ",ne=N.getAttribute("role"),X=ne?.startsWith("menuitem")||ne==="option"||ne==="gridcell";if(D&&d&&ee){if(A.defaultPrevented&&X)return;A.preventDefault(),I||o&&P?(N.click(),A.preventBaseUIHandler()):re&&(E?.(A),A.preventBaseUIHandler());return}re&&(!o&&(ee||Z)&&A.preventDefault(),!o&&Z&&E?.(A))},onKeyUp(A){if(!t){if(pg(A),C?.(A),A.target===A.currentTarget&&o&&d&&ah(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!o&&!d&&A.key===" "&&E?.(A)}},onPointerDown(A){if(t){A.preventDefault();return}k?.(A)}},o?void 0:{role:"button"},p,$)},[t,p,d,o]),y=et(w=>{l.current=w,h()});return{getButtonProps:m,buttonRef:y}}function ah(e){return Kt(e)&&e.tagName==="BUTTON"}function EM(e){return!!(e?.tagName==="A"&&e?.href)}function CM(e){return Zs(e,"base-ui")}const kM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},RM={...kM,position:"fixed",top:0,left:0},qs=x.forwardRef(function(e,t){const[r,n]=x.useState();return at(()=>{gj&&n("button")},[]),v.jsx("span",{...e,ref:t,style:RM,"aria-hidden":r?void 0:!0,tabIndex:0,role:r,"data-base-ui-focus-guard":""})}),_M=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ek}`;function $M(e){return e?!!e.closest(_M):!1}let AM=class Nk{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new li,this.restTimeout=new li,this.handleCloseOptions=void 0}static create(){return new Nk}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};function uv(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function TM(e,t){const{scopeElement:r,referenceElement:n,floatingElement:o}=t;uv(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=r,e.pointerEventsReferenceElement=n,e.pointerEventsFloatingElement=o,r.style.pointerEvents="none",n.style.pointerEvents="auto",o.style.pointerEvents="auto"}function Pk(e){const t=yn(AM.create).current,r=e.context.dataRef.current;return r.hoverInteractionState||(r.hoverInteractionState=t),Dd(r.hoverInteractionState.disposeEffect),r.hoverInteractionState}function LM(e,t){return t!=null&&!wl(t)?0:typeof e=="function"?e():e}function Fu(e,t,r){const n=LM(e,r);return typeof n=="number"?n:n?.[t]}function Hx(e){return typeof e=="function"?e():e}function Dk(e,t){return t||e==="click"||e==="mousedown"}const IM={current:null};function OM(e,t={}){const r="rootStore"in e?e.rootStore:e,{dataRef:n,events:o}=r.context,{enabled:a=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:h=!0,triggerElementRef:m=IM,externalTree:y,isActiveTrigger:w=!0,getHandleCloseContext:E}=t,S=ta(y),C=Pk(r),R=Nn(u),k=Nn(l),$=Nn(p),A=Nn(a);w&&(C.handleCloseOptions=R.current?.__options);const D=et(()=>Dk(n.current.openEvent?.type,C.interactedInside)),N=et(ee=>Ck(ee,r.context.triggerElements)),P=et((ee,ne,X)=>{const F=r.context.triggerElements;if(F.hasElement(ne))return!ee||!st(ee,ne);if(!gt(X))return!1;const V=X;return F.hasMatchingElement(H=>st(H,V))&&(!ee||!st(ee,V))}),I=x.useCallback((ee,ne=!0)=>{const X=Fu(k.current,"close",C.pointerType);X?C.openChangeTimeout.start(X,()=>{r.setOpen(!1,zt(Cr,ee)),S?.events.emit("floating.closed",ee)}):ne&&(C.openChangeTimeout.clear(),r.setOpen(!1,zt(Cr,ee)),S?.events.emit("floating.closed",ee))},[k,r,C,S]),re=et(()=>{C.handler&&(_t(r.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0)});x.useEffect(()=>re,[re]);const Z=et(()=>{uv(C)});return x.useEffect(()=>{if(!a)return;function ee(ne){ne.open||(re(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return o.on("openchange",ee),()=>{o.off("openchange",ee)}},[a,o,C,re]),x.useEffect(()=>{if(!a)return;const ee=m.current??(w?r.select("domReferenceElement"):null);if(!gt(ee))return;function ne(F){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,d&&!wl(C.pointerType)||Hx($.current)>0&&!Fu(k.current,"open"))return;const V=Fu(k.current,"open",C.pointerType),H=F.currentTarget??null,O=r.select("domReferenceElement"),L=H==null?!1:P(O,H,F.target),U=r.select("open"),z=!U||L;L&&U?r.setOpen(!0,zt(Cr,F,H)):V?C.openChangeTimeout.start(V,()=>{z&&r.setOpen(!0,zt(Cr,F,H))}):z&&r.setOpen(!0,zt(Cr,F,H))}function X(F){if(D()){Z();return}re();const V=r.select("domReferenceElement"),H=_t(V);C.restTimeout.clear(),C.restTimeoutPending=!1;const O=n.current.floatingContext??E?.();if(!N(F.relatedTarget)){if(R.current&&O){r.select("open")||C.openChangeTimeout.clear();const L=m.current;C.handler=R.current({...O,tree:S,x:F.clientX,y:F.clientY,onClose(){Z(),re(),A.current&&!D()&&L===r.select("domReferenceElement")&&I(F,!0)}}),H.addEventListener("mousemove",C.handler),C.handler(F);return}(C.pointerType!=="touch"||!st(r.select("floatingElement"),F.relatedTarget))&&I(F)}}return h&&ee.addEventListener("mousemove",ne,{once:!0}),ee.addEventListener("mouseenter",ne),ee.addEventListener("mouseleave",X),()=>{h&&ee.removeEventListener("mousemove",ne),ee.removeEventListener("mouseenter",ne),ee.removeEventListener("mouseleave",X)}},[re,Z,n,k,I,r,a,R,C,w,P,D,N,d,h,$,m,S,A,E]),x.useMemo(()=>{if(!a)return;function ee(ne){C.pointerType=ne.pointerType}return{onPointerDown:ee,onPointerEnter:ee,onMouseMove(ne){const{nativeEvent:X}=ne,F=ne.currentTarget,V=r.select("domReferenceElement"),H=r.select("open"),O=P(V,F,ne.target);if(d&&!wl(C.pointerType))return;const L=Hx($.current);if(H&&!O||L===0||!O&&C.restTimeoutPending&&ne.movementX**2+ne.movementY**2<2)return;C.restTimeout.clear();function U(){if(C.restTimeoutPending=!1,D())return;const z=r.select("open");!C.blockMouseMove&&(!z||O)&&r.setOpen(!0,zt(Cr,X,F))}C.pointerType==="touch"?Lr.flushSync(()=>{U()}):O&&H?U():(C.restTimeoutPending=!0,C.restTimeout.start(L,U))}}},[a,C,D,P,d,r,$])}const qx=.1,NM=qx*qx,Rt=.5;function ku(e,t,r,n,o,a){return n>=t!=a>=t&&e<=(o-r)*(t-n)/(a-n)+r}function Ru(e,t,r,n,o,a,l,u,d,p){let h=!1;return ku(e,t,r,n,o,a)&&(h=!h),ku(e,t,o,a,l,u)&&(h=!h),ku(e,t,l,u,d,p)&&(h=!h),ku(e,t,d,p,r,n)&&(h=!h),h}function PM(e,t,r){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}function _u(e,t,r,n,o,a){const l=Math.min(r,o),u=Math.max(r,o),d=Math.min(n,a),p=Math.max(n,a);return e>=l&&e<=u&&t>=d&&t<=p}function DM(e={}){const{blockPointerEvents:t=!1}=e,r=new li,n=({x:o,y:a,placement:l,elements:u,onClose:d,nodeId:p,tree:h})=>{const m=l?.split("-")[0];let y=!1,w=null,E=null,S=typeof performance<"u"?performance.now():0;function C(k,$){const A=performance.now(),D=A-S;if(w===null||E===null||D===0)return w=k,E=$,S=A,!1;const N=k-w,P=$-E,I=N*N+P*P,re=D*D*NM;return w=k,E=$,S=A,I<re}function R(){r.clear(),d()}return function(k){r.clear();const $=u.domReference,A=u.floating;if(!$||!A||m==null||o==null||a==null)return;const{clientX:D,clientY:N}=k,P=gn(k),I=k.type==="mouseleave",re=st(A,P),Z=st($,P);if(re&&(y=!0,!I))return;if(Z&&(y=!1,!I)){y=!0;return}if(I&&gt(k.relatedTarget)&&st(A,k.relatedTarget))return;function ee(){return!!(h&&oi(h.nodesRef.current,p).length>0)}function ne(){ee()||R()}if(ee())return;const X=$.getBoundingClientRect(),F=A.getBoundingClientRect(),V=o>F.right-F.width/2,H=a>F.bottom-F.height/2,O=F.width>X.width,L=F.height>X.height,U=(O?X:F).left,z=(O?X:F).right,T=(L?X:F).top,M=(L?X:F).bottom;if(m==="top"&&a>=X.bottom-1||m==="bottom"&&a<=X.top+1||m==="left"&&o>=X.right-1||m==="right"&&o<=X.left+1){ne();return}let te=!1;switch(m){case"top":te=_u(D,N,U,X.top+1,z,F.bottom-1);break;case"bottom":te=_u(D,N,U,F.top+1,z,X.bottom-1);break;case"left":te=_u(D,N,F.right-1,M,X.left+1,T);break;case"right":te=_u(D,N,X.right-1,M,F.left+1,T);break}if(te)return;if(y&&!PM(D,N,X)){ne();return}if(!I&&C(D,N)){ne();return}let le=!1;switch(m){case"top":{const G=O?Rt/2:Rt*4,fe=O||V?o+G:o-G,be=O?o-G:V?o+G:o-G,pe=a+Rt+1,ue=V||O?F.bottom-Rt:F.top,ge=V?O?F.bottom-Rt:F.top:F.bottom-Rt;le=Ru(D,N,fe,pe,be,pe,F.left,ue,F.right,ge);break}case"bottom":{const G=O?Rt/2:Rt*4,fe=O||V?o+G:o-G,be=O?o-G:V?o+G:o-G,pe=a-Rt,ue=V||O?F.top+Rt:F.bottom,ge=V?O?F.top+Rt:F.bottom:F.top+Rt;le=Ru(D,N,fe,pe,be,pe,F.left,ue,F.right,ge);break}case"left":{const G=L?Rt/2:Rt*4,fe=L||H?a+G:a-G,be=L?a-G:H?a+G:a-G,pe=o+Rt+1,ue=H||L?F.right-Rt:F.left,ge=H?L?F.right-Rt:F.left:F.right-Rt;le=Ru(D,N,ue,F.top,ge,F.bottom,pe,fe,pe,be);break}case"right":{const G=L?Rt/2:Rt*4,fe=L||H?a+G:a-G,be=L?a-G:H?a+G:a-G,pe=o-Rt,ue=H||L?F.left+Rt:F.right,ge=H?L?F.left+Rt:F.right:F.left+Rt;le=Ru(D,N,pe,fe,pe,be,ue,F.top,ge,F.bottom);break}}le?y||r.start(40,ne):ne()}};return n.__options={blockPointerEvents:t},n}function jM(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.context.dataRef,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,stickIfOpen:d=!0,touchOpenDelay:p=0,reason:h=Ws}=t,m=x.useRef(void 0),y=ev(),w=Vs(),E=x.useMemo(()=>({onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const C=m.current,R=S.nativeEvent,k=r.select("open");if(S.button!==0||a==="click"||wl(C,!0)&&u)return;const $=n.current.openEvent,A=$?.type,D=r.select("domReferenceElement")!==S.currentTarget,N=k&&D||!(k&&l&&(!($&&d)||A==="click"||A==="mousedown"));if(iv(R.target)){const I=zt(h,R,R.target);N&&C==="touch"&&p>0?w.start(p,()=>{r.setOpen(!0,I)}):r.setOpen(N,I);return}const P=S.currentTarget;y.request(()=>{const I=zt(h,R,P);N&&C==="touch"&&p>0?w.start(p,()=>{r.setOpen(!0,I)}):r.setOpen(N,I)})},onClick(S){if(a==="mousedown-only")return;const C=m.current;if(a==="mousedown"&&C){m.current=void 0;return}if(wl(C,!0)&&u)return;const R=r.select("open"),k=n.current.openEvent,$=r.select("domReferenceElement")!==S.currentTarget,A=R&&$||!(R&&l&&(!(k&&d)||mk(k))),D=zt(h,S.nativeEvent,S.currentTarget);A&&C==="touch"&&p>0?w.start(p,()=>{r.setOpen(!0,D)}):r.setOpen(A,D)},onKeyDown(){m.current=void 0}}),[n,a,u,r,d,l,y,w,p,h]);return x.useMemo(()=>o?{reference:E}:Rr,[o,E])}var MM=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],dd=MM.join(","),jk=typeof Element>"u",Gs=jk?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fd=!jk&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},pd=function(e,t){var r;t===void 0&&(t=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),o=n===""||n==="true",a=o||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):pd(e.parentNode));return a},zM=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},Mk=function(e,t,r){if(pd(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(dd));return t&&Gs.call(e,dd)&&n.unshift(e),n=n.filter(r),n},hd=function(e,t,r){for(var n=[],o=Array.from(e);o.length;){var a=o.shift();if(!pd(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),u=l.length?l:a.children,d=hd(u,!0,r);r.flatten?n.push.apply(n,d):n.push({scopeParent:a,candidates:d})}else{var p=Gs.call(a,dd);p&&r.filter(a)&&(t||!e.includes(a))&&n.push(a);var h=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),m=!pd(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(h&&m){var y=hd(h===!0?a.children:h.children,!0,r);r.flatten?n.push.apply(n,y):n.push({scopeParent:a,candidates:y})}else o.unshift.apply(o,a.children)}}return n},zk=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Fk=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||zM(e))&&!zk(e)?0:e.tabIndex},FM=function(e,t){var r=Fk(e);return r<0&&t&&!zk(e)?0:r},BM=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Bk=function(e){return e.tagName==="INPUT"},UM=function(e){return Bk(e)&&e.type==="hidden"},VM=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},WM=function(e,t){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]},HM=function(e){if(!e.name)return!0;var t=e.form||fd(e),r=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},n;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")n=r(window.CSS.escape(e.name));else try{n=r(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=WM(n,e.form);return!o||o===e},qM=function(e){return Bk(e)&&e.type==="radio"},GM=function(e){return qM(e)&&!HM(e)},XM=function(e){var t,r=e&&fd(e),n=(t=r)===null||t===void 0?void 0:t.host,o=!1;if(r&&r!==e){var a,l,u;for(o=!!((a=n)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(n)||e!=null&&(u=e.ownerDocument)!==null&&u!==void 0&&u.contains(e));!o&&n;){var d,p,h;r=fd(n),n=(d=r)===null||d===void 0?void 0:d.host,o=!!((p=n)!==null&&p!==void 0&&(h=p.ownerDocument)!==null&&h!==void 0&&h.contains(n))}}return o},Gx=function(e){var t=e.getBoundingClientRect(),r=t.width,n=t.height;return r===0&&n===0},YM=function(e,t){var r=t.displayCheck,n=t.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var o=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(e).visibility==="hidden")return!0;var a=Gs.call(e,"details>summary:first-of-type"),l=a?e.parentElement:e;if(Gs.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof n=="function"){for(var u=e;e;){var d=e.parentElement,p=fd(e);if(d&&!d.shadowRoot&&n(d)===!0)return Gx(e);e.assignedSlot?e=e.assignedSlot:!d&&p!==e.ownerDocument?e=p.host:e=d}e=u}if(XM(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Gx(e);return!1},KM=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r<t.children.length;r++){var n=t.children.item(r);if(n.tagName==="LEGEND")return Gs.call(t,"fieldset[disabled] *")?!0:!n.contains(e)}return!0}t=t.parentElement}return!1},mg=function(e,t){return!(t.disabled||UM(t)||YM(t,e)||VM(t)||KM(t))},gg=function(e,t){return!(GM(t)||Fk(t)<0||!mg(e,t))},QM=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Uk=function(e){var t=[],r=[];return e.forEach(function(n,o){var a=!!n.scopeParent,l=a?n.scopeParent:n,u=FM(l,a),d=a?Uk(n.candidates):l;u===0?a?t.push.apply(t,d):t.push(l):r.push({documentOrder:o,tabIndex:u,item:n,isScope:a,content:d})}),r.sort(BM).reduce(function(n,o){return o.isScope?n.push.apply(n,o.content):n.push(o.content),n},[]).concat(t)},Tl=function(e,t){t=t||{};var r;return t.getShadowRoot?r=hd([e],t.includeContainer,{filter:gg.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:QM}):r=Mk(e,t.includeContainer,gg.bind(null,t)),Uk(r)},JM=function(e,t){t=t||{};var r;return t.getShadowRoot?r=hd([e],t.includeContainer,{filter:mg.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=Mk(e,t.includeContainer,mg.bind(null,t)),r},Vk=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Gs.call(e,dd)===!1?!1:gg(t,e)};const ra=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Wk(e,t){const r=Tl(e,ra()),n=r.length;if(n===0)return;const o=$o(_t(e)),a=r.indexOf(o),l=a===-1?t===1?0:n-1:a+t;return r[l]}function dv(e){return Wk(_t(e).body,1)||e}function Hk(e){return Wk(_t(e).body,-1)||e}function qk(e,t){if(!e)return null;const r=Tl(_t(e).body,ra()),n=r.length;if(n===0)return null;const o=r.indexOf(e);if(o===-1)return null;const a=(o+t+n)%n;return r[a]}function ZM(e){return qk(e,1)}function e4(e){return qk(e,-1)}function Ps(e,t){const r=t||e.currentTarget,n=e.relatedTarget;return!n||!st(r,n)}function t4(e){Tl(e,ra()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Xx(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const r=t.dataset.tabindex;delete t.dataset.tabindex,r?t.setAttribute("tabindex",r):t.removeAttribute("tabindex")})}const Gk=x.createContext(null),Xk=()=>x.useContext(Gk),r4=sd("portal");function n4(e={}){const{ref:t,container:r,componentProps:n=Rr,elementProps:o}=e,a=Zs(),l=Xk()?.portalNode,[u,d]=x.useState(null),[p,h]=x.useState(null),m=et(E=>{E!==null&&h(E)}),y=x.useRef(null);at(()=>{if(r===null){y.current&&(y.current=null,h(null),d(null));return}if(a==null)return;const E=(r&&(Jg(r)?r:r.current))??l??document.body;if(E==null){y.current&&(y.current=null,h(null),d(null));return}y.current!==E&&(y.current=E,h(null),d(E))},[r,l,a]);const w=Al("div",n,{ref:[t,m],props:[{id:a,[r4]:""},o]});return{portalNode:p,portalSubtree:u&&w?Lr.createPortal(w,u):null}}const i4=x.forwardRef(function(e,t){const{children:r,container:n,className:o,render:a,renderGuards:l,...u}=e,{portalNode:d,portalSubtree:p}=n4({container:n,ref:t,componentProps:e,elementProps:u}),h=x.useRef(null),m=x.useRef(null),y=x.useRef(null),w=x.useRef(null),[E,S]=x.useState(null),C=E?.modal,R=E?.open,k=typeof l=="boolean"?l:!!E&&!E.modal&&E.open&&!!d;x.useEffect(()=>{if(!d||C)return;function A(D){d&&D.relatedTarget&&Ps(D)&&(D.type==="focusin"?Xx:t4)(d)}return d.addEventListener("focusin",A,!0),d.addEventListener("focusout",A,!0),()=>{d.removeEventListener("focusin",A,!0),d.removeEventListener("focusout",A,!0)}},[d,C]),x.useEffect(()=>{!d||R||Xx(d)},[R,d]);const $=x.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:y,afterInsideRef:w,portalNode:d,setFocusManagerState:S}),[d]);return v.jsxs(x.Fragment,{children:[p,v.jsxs(Gk.Provider,{value:$,children:[k&&d&&v.jsx(qs,{"data-type":"outside",ref:h,onFocus:A=>{if(Ps(A,d))y.current?.focus();else{const D=E?E.domReference:null;Hk(D)?.focus()}}}),k&&d&&v.jsx("span",{"aria-owns":d.id,style:Oj}),d&&Lr.createPortal(r,d),k&&d&&v.jsx(qs,{"data-type":"outside",ref:m,onFocus:A=>{if(Ps(A,d))w.current?.focus();else{const D=E?E.domReference:null;dv(D)?.focus(),E?.closeOnFocusOut&&E?.onOpenChange(!1,zt(El,A.nativeEvent))}}})]})]})});function o4(e){return tv(19)?e:e?"true":void 0}const s4=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:p,padding:h=0,offsetParent:m="real"}=ui(e,t)||{};if(p==null)return{};const y=_k(h),w={x:r,y:n},E=av(o),S=sv(E),C=await l.getDimensions(p),R=E==="y",k=R?"top":"left",$=R?"bottom":"right",A=R?"clientHeight":"clientWidth",D=a.reference[S]+a.reference[E]-w[E]-a.floating[S],N=w[E]-a.reference[E],P=m==="real"?await l.getOffsetParent?.(p):u.floating;let I=u.floating[A]||a.floating[S];(!I||!await l.isElement?.(P))&&(I=u.floating[A]||a.floating[S]);const re=D/2-N/2,Z=I/2-C[S]/2-1,ee=Math.min(y[k],Z),ne=Math.min(y[$],Z),X=ee,F=I-C[S]-ne,V=I/2-C[S]/2+re,H=cg(X,V,F),O=!d.arrow&&Zi(o)!=null&&V!==H&&a.reference[S]/2-(V<X?ee:ne)-C[S]/2<0,L=O?V<X?V-X:V-F:0;return{[E]:w[E]+L,data:{[E]:H,centerOffset:V-H-L,...O&&{alignmentOffset:L}},reset:O}}}),a4=(e,t)=>({...s4(e),options:[e,t]});function Yx(e,t,r){let{reference:n,floating:o}=e;const a=Xr(t),l=av(t),u=sv(l),d=$r(t),p=a==="y",h=n.x+n.width/2-o.width/2,m=n.y+n.height/2-o.height/2,y=n[u]/2-o[u]/2;let w;switch(d){case"top":w={x:h,y:n.y-o.height};break;case"bottom":w={x:h,y:n.y+n.height};break;case"right":w={x:n.x+n.width,y:m};break;case"left":w={x:n.x-o.width,y:m};break;default:w={x:n.x,y:n.y}}switch(Zi(t)){case"start":w[l]-=y*(r&&p?-1:1);break;case"end":w[l]+=y*(r&&p?-1:1);break}return w}async function l4(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:y=!1,padding:w=0}=ui(t,e),E=_k(w),S=u[y?m==="floating"?"reference":"floating":m],C=cd(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(S)))==null||r?S:S.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:p,rootBoundary:h,strategy:d})),R=m==="floating"?{x:n,y:o,width:l.floating.width,height:l.floating.height}:l.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),$=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},A=cd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:k,strategy:d}):R);return{top:(C.top-A.top+E.top)/$.y,bottom:(A.bottom-C.bottom+E.bottom)/$.y,left:(C.left-A.left+E.left)/$.x,right:(A.right-C.right+E.right)/$.x}}const c4=50,u4=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:l}=r,u=l.detectOverflow?l:{...l,detectOverflow:l4},d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=Yx(p,n,d),y=n,w=0;const E={};for(let S=0;S<a.length;S++){const C=a[S];if(!C)continue;const{name:R,fn:k}=C,{x:$,y:A,data:D,reset:N}=await k({x:h,y:m,initialPlacement:n,placement:y,strategy:o,middlewareData:E,rects:p,platform:u,elements:{reference:e,floating:t}});h=$??h,m=A??m,E[R]={...E[R],...D},N&&w<c4&&(w++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(p=N.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:h,y:m}=Yx(p,y,d)),S=-1)}return{x:h,y:m,placement:y,strategy:o,middlewareData:E}},d4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:p}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...C}=ui(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const R=$r(o),k=Xr(u),$=$r(u)===u,A=await(d.isRTL==null?void 0:d.isRTL(p.floating)),D=y||($||!S?[ld(u)]:W6(u)),N=E!=="none";!y&&N&&D.push(...X6(u,S,E,A));const P=[u,...D],I=await d.detectOverflow(t,C),re=[];let Z=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&re.push(I[R]),m){const F=V6(o,l,A);re.push(I[F[0]],I[F[1]])}if(Z=[...Z,{placement:o,overflows:re}],!re.every(F=>F<=0)){var ee,ne;const F=(((ee=a.flip)==null?void 0:ee.index)||0)+1,V=P[F];if(V&&(!(m==="alignment"&&k!==Xr(V))||Z.every(O=>Xr(O.placement)===k?O.overflows[0]>0:!0)))return{data:{index:F,overflows:Z},reset:{placement:V}};let H=(ne=Z.filter(O=>O.overflows[0]<=0).sort((O,L)=>O.overflows[1]-L.overflows[1])[0])==null?void 0:ne.placement;if(!H)switch(w){case"bestFit":{var X;const O=(X=Z.filter(L=>{if(N){const U=Xr(L.placement);return U===k||U==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(U=>U>0).reduce((U,z)=>U+z,0)]).sort((L,U)=>L[1]-U[1])[0])==null?void 0:X[0];O&&(H=O);break}case"initialPlacement":H=u;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function Kx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qx(e){return B6.some(t=>e[t]>=0)}const f4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=ui(e,t);switch(o){case"referenceHidden":{const l=await n.detectOverflow(t,{...a,elementContext:"reference"}),u=Kx(l,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Qx(u)}}}case"escaped":{const l=await n.detectOverflow(t,{...a,altBoundary:!0}),u=Kx(l,r.floating);return{data:{escapedOffsets:u,escaped:Qx(u)}}}default:return{}}}}},Yk=new Set(["left","top"]);async function p4(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),l=$r(r),u=Zi(r),d=Xr(r)==="y",p=Yk.has(l)?-1:1,h=a&&d?-1:1,m=ui(t,e);let{mainAxis:y,crossAxis:w,alignmentAxis:E}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof E=="number"&&(w=u==="end"?E*-1:E),d?{x:w*h,y:y*p}:{x:y*p,y:w*h}}const h4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:l,middlewareData:u}=t,d=await p4(t,e);return l===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:a+d.y,data:{...d,placement:l}}}}},m4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:R=>{let{x:k,y:$}=R;return{x:k,y:$}}},...p}=ui(e,t),h={x:r,y:n},m=await a.detectOverflow(t,p),y=Xr($r(o)),w=ov(y);let E=h[w],S=h[y];if(l){const R=w==="y"?"top":"left",k=w==="y"?"bottom":"right",$=E+m[R],A=E-m[k];E=cg($,E,A)}if(u){const R=y==="y"?"top":"left",k=y==="y"?"bottom":"right",$=S+m[R],A=S-m[k];S=cg($,S,A)}const C=d.fn({...t,[w]:E,[y]:S});return{...C,data:{x:C.x-r,y:C.y-n,enabled:{[w]:l,[y]:u}}}}}},g4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:p=!0}=ui(e,t),h={x:r,y:n},m=Xr(o),y=ov(m);let w=h[y],E=h[m];const S=ui(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const $=y==="y"?"height":"width",A=a.reference[y]-a.floating[$]+C.mainAxis,D=a.reference[y]+a.reference[$]-C.mainAxis;w<A?w=A:w>D&&(w=D)}if(p){var R,k;const $=y==="y"?"width":"height",A=Yk.has($r(o)),D=a.reference[m]-a.floating[$]+(A&&((R=l.offset)==null?void 0:R[m])||0)+(A?0:C.crossAxis),N=a.reference[m]+a.reference[$]+(A?0:((k=l.offset)==null?void 0:k[m])||0)-(A?C.crossAxis:0);E<D?E=D:E>N&&(E=N)}return{[y]:w,[m]:E}}}},v4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:l,elements:u}=t,{apply:d=()=>{},...p}=ui(e,t),h=await l.detectOverflow(t,p),m=$r(o),y=Zi(o),w=Xr(o)==="y",{width:E,height:S}=a.floating;let C,R;m==="top"||m==="bottom"?(C=m,R=y===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=m,C=y==="end"?"top":"bottom");const k=S-h.top-h.bottom,$=E-h.left-h.right,A=Hs(S-h[C],k),D=Hs(E-h[R],$),N=!t.middlewareData.shift;let P=A,I=D;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=$),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=k),N&&!y){const Z=Mr(h.left,0),ee=Mr(h.right,0),ne=Mr(h.top,0),X=Mr(h.bottom,0);w?I=E-2*(Z!==0||ee!==0?Z+ee:Mr(h.left,h.right)):P=S-2*(ne!==0||X!==0?ne+X:Mr(h.top,h.bottom))}await d({...t,availableWidth:I,availableHeight:P});const re=await l.getDimensions(u.floating);return E!==re.width||S!==re.height?{reset:{rects:!0}}:{}}}};function Kk(e){const t=zr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Kt(e),a=o?e.offsetWidth:r,l=o?e.offsetHeight:n,u=ad(r)!==a||ad(n)!==l;return u&&(r=a,n=l),{width:r,height:n,$:u}}function fv(e){return gt(e)?e:e.contextElement}function Ds(e){const t=fv(e);if(!Kt(t))return Pn(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Kk(t);let l=(a?ad(r.width):r.width)/n,u=(a?ad(r.height):r.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const y4=Pn(0);function Qk(e){const t=tr(e);return!zd()||!t.visualViewport?y4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function b4(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==tr(e)?!1:t}function jo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=fv(e);let l=Pn(1);t&&(n?gt(n)&&(l=Ds(n)):l=Ds(e));const u=b4(a,r,n)?Qk(a):Pn(0);let d=(o.left+u.x)/l.x,p=(o.top+u.y)/l.y,h=o.width/l.x,m=o.height/l.y;if(a){const y=tr(a),w=n&&gt(n)?tr(n):n;let E=y,S=og(E);for(;S&&n&&w!==E;){const C=Ds(S),R=S.getBoundingClientRect(),k=zr(S),$=R.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,A=R.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,p*=C.y,h*=C.x,m*=C.y,d+=$,p+=A,E=tr(S),S=og(E)}}return cd({width:h,height:m,x:d,y:p})}function Bd(e,t){const r=Fd(e).scrollLeft;return t?t.left+r:jo(Fn(e)).left+r}function Jk(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Bd(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function x4(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",l=Fn(n),u=t?Md(t.floating):!1;if(n===l||u&&a)return r;let d={scrollLeft:0,scrollTop:0},p=Pn(1);const h=Pn(0),m=Kt(n);if((m||!m&&!a)&&((Qi(n)!=="body"||Ji(l))&&(d=Fd(n)),m)){const w=jo(n);p=Ds(n),h.x=w.x+n.clientLeft,h.y=w.y+n.clientTop}const y=l&&!m&&!a?Jk(l,d):Pn(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-d.scrollLeft*p.x+h.x+y.x,y:r.y*p.y-d.scrollTop*p.y+h.y+y.y}}function w4(e){return Array.from(e.getClientRects())}function S4(e){const t=Fn(e),r=Fd(e),n=e.ownerDocument.body,o=Mr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Mr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+Bd(e);const u=-r.scrollTop;return zr(n).direction==="rtl"&&(l+=Mr(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:l,y:u}}const Jx=25;function E4(e,t){const r=tr(e),n=Fn(e),o=r.visualViewport;let a=n.clientWidth,l=n.clientHeight,u=0,d=0;if(o){a=o.width,l=o.height;const h=zd();(!h||h&&t==="fixed")&&(u=o.offsetLeft,d=o.offsetTop)}const p=Bd(n);if(p<=0){const h=n.ownerDocument,m=h.body,y=getComputedStyle(m),w=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(n.clientWidth-m.clientWidth-w);E<=Jx&&(a-=E)}else p<=Jx&&(a+=p);return{width:a,height:l,x:u,y:d}}function C4(e,t){const r=jo(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Kt(e)?Ds(e):Pn(1),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=o*a.x,p=n*a.y;return{width:l,height:u,x:d,y:p}}function Zx(e,t,r){let n;if(t==="viewport")n=E4(e,r);else if(t==="document")n=S4(Fn(e));else if(gt(t))n=C4(t,r);else{const o=Qk(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return cd(n)}function Zk(e,t){const r=ci(e);return r===t||!gt(r)||ii(r)?!1:zr(r).position==="fixed"||Zk(r,t)}function k4(e,t){const r=t.get(e);if(r)return r;let n=xl(e,[],!1).filter(u=>gt(u)&&Qi(u)!=="body"),o=null;const a=zr(e).position==="fixed";let l=a?ci(e):e;for(;gt(l)&&!ii(l);){const u=zr(l),d=Zg(l);!d&&u.position==="fixed"&&(o=null),(a?!d&&!o:!d&&u.position==="static"&&o&&(o.position==="absolute"||o.position==="fixed")||Ji(l)&&!d&&Zk(e,l))?n=n.filter(p=>p!==l):o=u,l=ci(l)}return t.set(e,n),n}function R4(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?Md(t)?[]:k4(t,this._c):[].concat(r),n],l=Zx(t,a[0],o);let u=l.top,d=l.right,p=l.bottom,h=l.left;for(let m=1;m<a.length;m++){const y=Zx(t,a[m],o);u=Mr(y.top,u),d=Hs(y.right,d),p=Hs(y.bottom,p),h=Mr(y.left,h)}return{width:d-h,height:p-u,x:h,y:u}}function _4(e){const{width:t,height:r}=Kk(e);return{width:t,height:r}}function $4(e,t,r){const n=Kt(t),o=Fn(t),a=r==="fixed",l=jo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=Pn(0);function p(){d.x=Bd(o)}if(n||!n&&!a)if((Qi(t)!=="body"||Ji(o))&&(u=Fd(t)),n){const w=jo(t,!0,a,t);d.x=w.x+t.clientLeft,d.y=w.y+t.clientTop}else o&&p();a&&!n&&o&&p();const h=o&&!n&&!a?Jk(o,u):Pn(0),m=l.left+u.scrollLeft-d.x-h.x,y=l.top+u.scrollTop-d.y-h.y;return{x:m,y,width:l.width,height:l.height}}function lh(e){return zr(e).position==="static"}function ew(e,t){if(!Kt(e)||zr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Fn(e)===r&&(r=r.ownerDocument.body),r}function eR(e,t){const r=tr(e);if(Md(e))return r;if(!Kt(e)){let o=ci(e);for(;o&&!ii(o);){if(gt(o)&&!lh(o))return o;o=ci(o)}return r}let n=ew(e,t);for(;n&&fj(n)&&lh(n);)n=ew(n,t);return n&&ii(n)&&lh(n)&&!Zg(n)?r:n||mj(e)||r}const A4=async function(e){const t=this.getOffsetParent||eR,r=this.getDimensions,n=await r(e.floating);return{reference:$4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function T4(e){return zr(e).direction==="rtl"}const L4={convertOffsetParentRelativeRectToViewportRelativeRect:x4,getDocumentElement:Fn,getClippingRect:R4,getOffsetParent:eR,getElementRects:A4,getClientRects:w4,getDimensions:_4,getScale:Ds,isElement:gt,isRTL:T4};function tR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function I4(e,t){let r=null,n;const o=Fn(e);function a(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),a();const p=e.getBoundingClientRect(),{left:h,top:m,width:y,height:w}=p;if(u||t(),!y||!w)return;const E=Eu(m),S=Eu(o.clientWidth-(h+y)),C=Eu(o.clientHeight-(m+w)),R=Eu(h),k={rootMargin:-E+"px "+-S+"px "+-C+"px "+-R+"px",threshold:Mr(0,Hs(1,d))||1};let $=!0;function A(D){const N=D[0].intersectionRatio;if(N!==d){if(!$)return l();N?l(!1,N):n=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!tR(p,e.getBoundingClientRect())&&l(),$=!1}try{r=new IntersectionObserver(A,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(A,k)}r.observe(e)}return l(!0),a}function tw(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,p=fv(e),h=o||a?[...p?xl(p):[],...t?xl(t):[]]:[];h.forEach(R=>{o&&R.addEventListener("scroll",r,{passive:!0}),a&&R.addEventListener("resize",r)});const m=p&&u?I4(p,r):null;let y=-1,w=null;l&&(w=new ResizeObserver(R=>{let[k]=R;k&&k.target===p&&w&&t&&(w.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var $;($=w)==null||$.observe(t)})),r()}),p&&!d&&w.observe(p),t&&w.observe(t));let E,S=d?jo(e):null;d&&C();function C(){const R=jo(e);S&&!tR(S,R)&&r(),S=R,E=requestAnimationFrame(C)}return r(),()=>{var R;h.forEach(k=>{o&&k.removeEventListener("scroll",r),a&&k.removeEventListener("resize",r)}),m?.(),(R=w)==null||R.disconnect(),w=null,d&&cancelAnimationFrame(E)}}const O4=h4,N4=m4,P4=d4,D4=v4,j4=f4,M4=g4,z4=(e,t,r)=>{const n=new Map,o={platform:L4,...r},a={...o.platform,_c:n};return u4(e,t,{...o,platform:a})};var F4=typeof document<"u",B4=function(){},Bu=F4?x.useLayoutEffect:B4;function md(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!md(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!md(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function rR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rw(e,t){const r=rR(e);return Math.round(t*r)/r}function ch(e){const t=x.useRef(e);return Bu(()=>{t.current=e}),t}function U4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:p}=e,[h,m]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,w]=x.useState(n);md(y,n)||w(n);const[E,S]=x.useState(null),[C,R]=x.useState(null),k=x.useCallback(L=>{L!==N.current&&(N.current=L,S(L))},[]),$=x.useCallback(L=>{L!==P.current&&(P.current=L,R(L))},[]),A=a||E,D=l||C,N=x.useRef(null),P=x.useRef(null),I=x.useRef(h),re=d!=null,Z=ch(d),ee=ch(o),ne=ch(p),X=x.useCallback(()=>{if(!N.current||!P.current)return;const L={placement:t,strategy:r,middleware:y};ee.current&&(L.platform=ee.current),z4(N.current,P.current,L).then(U=>{const z={...U,isPositioned:ne.current!==!1};F.current&&!md(I.current,z)&&(I.current=z,Lr.flushSync(()=>{m(z)}))})},[y,t,r,ee,ne]);Bu(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[p]);const F=x.useRef(!1);Bu(()=>(F.current=!0,()=>{F.current=!1}),[]),Bu(()=>{if(A&&(N.current=A),D&&(P.current=D),A&&D){if(Z.current)return Z.current(A,D,X);X()}},[A,D,X,Z,re]);const V=x.useMemo(()=>({reference:N,floating:P,setReference:k,setFloating:$}),[k,$]),H=x.useMemo(()=>({reference:A,floating:D}),[A,D]),O=x.useMemo(()=>{const L={position:r,left:0,top:0};if(!H.floating)return L;const U=rw(H.floating,h.x),z=rw(H.floating,h.y);return u?{...L,transform:"translate("+U+"px, "+z+"px)",...rR(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:U,top:z}},[r,u,H.floating,h.x,h.y]);return x.useMemo(()=>({...h,update:X,refs:V,elements:H,floatingStyles:O}),[h,X,V,H,O])}const V4=(e,t)=>{const r=O4(e);return{name:r.name,fn:r.fn,options:[e,t]}},W4=(e,t)=>{const r=N4(e);return{name:r.name,fn:r.fn,options:[e,t]}},H4=(e,t)=>({fn:M4(e).fn,options:[e,t]}),q4=(e,t)=>{const r=P4(e);return{name:r.name,fn:r.fn,options:[e,t]}},G4=(e,t)=>{const r=D4(e);return{name:r.name,fn:r.fn,options:[e,t]}},X4=(e,t)=>{const r=j4(e);return{name:r.name,fn:r.fn,options:[e,t]}},Y4={name:"hide",async fn(e){const{width:t,height:r,x:n,y:o}=e.rects.reference,a=t===0&&r===0&&n===0&&o===0;return{data:{referenceHidden:(await X4().fn(e)).data?.referenceHidden||a}}}},Uu={sideX:"left",sideY:"top"},K4={name:"adaptiveOrigin",async fn(e){const{x:t,y:r,rects:{floating:n},elements:{floating:o},platform:a,strategy:l,placement:u}=e,d=tr(o),p=d.getComputedStyle(o);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:r,data:Uu};const h=await a.getOffsetParent?.(o);let m={width:0,height:0};if(l==="fixed"&&d?.visualViewport)m={width:d.visualViewport.width,height:d.visualViewport.height};else if(h===d){const R=_t(o);m={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await a.isElement?.(h)&&(m=await a.getDimensions(h));const y=$r(u);let w=t,E=r;y==="left"&&(w=m.width-(t+n.width)),y==="top"&&(E=m.height-(r+n.height));const S=y==="left"?"right":Uu.sideX,C=y==="top"?"bottom":Uu.sideY;return{x:w,y:E,data:{sideX:S,sideY:C}}}};function Q4(e){const{open:t=!1,onOpenChange:r,elements:n={}}=e,o=Zs(),a=Vo()!=null,l=yn(()=>new rv({open:t,onOpenChange:r,referenceElement:n.reference??null,floatingElement:n.floating??null,triggerElements:new nv,floatingId:o,nested:a,noEmit:!1})).current;return at(()=>{const u={open:t,floatingId:o};n.reference!==void 0&&(u.referenceElement=n.reference,u.domReferenceElement=gt(n.reference)?n.reference:null),n.floating!==void 0&&(u.floatingElement=n.floating),l.update(u)},[t,o,n.reference,n.floating,l]),l.context.onOpenChange=r,l.context.nested=a,l.context.noEmit=!1,l}function J4(e={}){const{nodeId:t,externalTree:r}=e,n=Q4(e),o=e.rootContext||n,a={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[l,u]=x.useState(null),d=x.useRef(null),p=ta(r);at(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const h=U4({...e,elements:{...a,...l&&{reference:l}}}),m=x.useCallback(P=>{const I=gt(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;u(I),h.refs.setReference(I)},[h.refs]),[y,w]=x.useState(null),[E,S]=x.useState(null);o.useSyncedValue("referenceElement",y),o.useSyncedValue("domReferenceElement",gt(y)?y:null),o.useSyncedValue("floatingElement",E);const C=x.useCallback(P=>{(gt(P)||P===null)&&(d.current=P,w(P)),(gt(h.refs.reference.current)||h.refs.reference.current===null||P!==null&&!gt(P))&&h.refs.setReference(P)},[h.refs,w]),R=x.useCallback(P=>{S(P),h.refs.setFloating(P)},[h.refs]),k=x.useMemo(()=>({...h.refs,setReference:C,setFloating:R,setPositionReference:m,domReference:d}),[h.refs,C,R,m]),$=x.useMemo(()=>({...h.elements,domReference:a.domReference}),[h.elements,a.domReference]),A=o.useState("open"),D=o.useState("floatingId"),N=x.useMemo(()=>({...h,dataRef:o.context.dataRef,open:A,onOpenChange:o.setOpen,events:o.context.events,floatingId:D,refs:k,elements:$,nodeId:t,rootStore:o}),[h,k,$,t,o,A,D]);return at(()=>{o.context.dataRef.current.floatingContext=N;const P=p?.nodesRef.current.find(I=>I.id===t);P&&(P.context=N)}),x.useMemo(()=>({...h,context:N,refs:k,elements:$,rootStore:o}),[h,k,$,N,o])}function nR(e,t,r){const n=e==="inline-start"||e==="inline-end";return{top:"top",right:n?r?"inline-start":"inline-end":"right",bottom:"bottom",left:n?r?"inline-end":"inline-start":"left"}[t]}function nw(e,t,r){const{rects:n,placement:o}=e;return{side:nR(t,$r(o),r),align:Zi(o)||"center",anchor:{width:n.reference.width,height:n.reference.height},positioner:{width:n.floating.width,height:n.floating.height}}}function Z4(e){const{anchor:t,positionMethod:r="absolute",side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:p=!1,arrowPadding:h=5,disableAnchorTracking:m=!1,keepMounted:y=!1,floatingRootContext:w,mounted:E,collisionAvoidance:S,shiftCrossAxis:C=!1,nodeId:R,adaptiveOrigin:k,lazyFlip:$=!1,externalTree:A}=e,[D,N]=x.useState(null);!E&&D!==null&&N(null);const P=S.side||"flip",I=S.align||"flip",re=S.fallbackAxisSide||"end",Z=typeof t=="function"?t:void 0,ee=et(Z),ne=Z?ee:t,X=Nn(t),F=Pj()==="rtl",V=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":F?"left":"right","inline-start":F?"right":"left"}[n],H=a==="center"?V:`${V}-${a}`;let O=d;const L=1,U=n==="bottom"?L:0,z=n==="top"?L:0,T=n==="right"?L:0,M=n==="left"?L:0;typeof O=="number"?O={top:O+U,right:O+M,bottom:O+z,left:O+T}:O&&(O={top:(O.top||0)+U,right:(O.right||0)+M,bottom:(O.bottom||0)+z,left:(O.left||0)+T});const te={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:O},le=x.useRef(null),G=Nn(o),fe=Nn(l),be=[V4(se=>{const Ce=nw(se,n,F),Ve=typeof G.current=="function"?G.current(Ce):G.current,Ke=typeof fe.current=="function"?fe.current(Ce):fe.current;return{mainAxis:Ve,crossAxis:Ke,alignmentAxis:Ke}},[typeof o!="function"?o:0,typeof l!="function"?l:0,F,n])],pe=I==="none"&&P!=="shift",ue=!pe&&(p||C||P==="shift"),ge=P==="none"?null:q4({...te,padding:{top:O.top+L,right:O.right+L,bottom:O.bottom+L,left:O.left+L},mainAxis:!C&&P==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:re}),qe=pe?null:W4(se=>{const Ce=_t(se.elements.floating).documentElement;return{...te,rootBoundary:C?{x:0,y:0,width:Ce.clientWidth,height:Ce.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:ue,limiter:p||C?void 0:H4(Ve=>{if(!le.current)return{};const{width:Ke,height:Pe}=le.current.getBoundingClientRect(),he=Xr($r(Ve.placement)),ve=he==="y"?Ke:Pe,ye=he==="y"?O.left+O.right:O.top+O.bottom;return{offset:ve/2+ye/2}})}},[te,p,C,O,I]);P==="shift"||I==="shift"||a==="center"?be.push(qe,ge):be.push(ge,qe),be.push(G4({...te,apply({elements:{floating:se},availableWidth:Ce,availableHeight:Ve,rects:Ke}){const Pe=se.style;Pe.setProperty("--available-width",`${Ce}px`),Pe.setProperty("--available-height",`${Ve}px`);const he=window.devicePixelRatio||1,{x:ve,y:ye,width:xe,height:Ue}=Ke.reference,Ze=(Math.round((ve+xe)*he)-Math.round(ve*he))/he,dt=(Math.round((ye+Ue)*he)-Math.round(ye*he))/he;Pe.setProperty("--anchor-width",`${Ze}px`),Pe.setProperty("--anchor-height",`${dt}px`)}}),a4(()=>({element:le.current||document.createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(se){const{elements:Ce,middlewareData:Ve,placement:Ke,rects:Pe,y:he}=se,ve=$r(Ke),ye=Xr(ve),xe=le.current,Ue=Ve.arrow?.x||0,Ze=Ve.arrow?.y||0,dt=xe?.clientWidth||0,Wt=xe?.clientHeight||0,Zr=Ue+dt/2,en=Ze+Wt/2,pi=Math.abs(Ve.shift?.y||0),wn=Pe.reference.height/2,tn=typeof o=="function"?o(nw(se,n,F)):o,Sn=pi>tn,sa={top:`${Zr}px calc(100% + ${tn}px)`,bottom:`${Zr}px ${-tn}px`,left:`calc(100% + ${tn}px) ${en}px`,right:`${-tn}px ${en}px`}[ve],En=`${Zr}px ${Pe.reference.y+wn-he}px`;return Ce.floating.style.setProperty("--transform-origin",ue&&ye==="y"&&Sn?En:sa),{}}},Y4,k),at(()=>{!E&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[E,w]);const Xe=x.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:we,elements:ze,x:We,y:tt,middlewareData:De,update:Fe,placement:lt,context:Ne,isPositioned:oe,floatingStyles:Se}=J4({rootContext:w,placement:H,middleware:be,strategy:r,whileElementsMounted:y?void 0:(...se)=>tw(...se,Xe),nodeId:R,externalTree:A}),{sideX:Je,sideY:ht}=De.adaptiveOrigin||Uu,Bt=oe?r:"fixed",Ut=x.useMemo(()=>{const se=k?{position:Bt,[Je]:We,[ht]:tt}:{position:Bt,...Se};return oe||(se.opacity=0),se},[k,Bt,Je,We,ht,tt,Se,oe]),jt=x.useRef(null);at(()=>{if(!E)return;const se=X.current,Ce=typeof se=="function"?se():se,Ve=(iw(Ce)?Ce.current:Ce)||null||null;Ve!==jt.current&&(we.setPositionReference(Ve),jt.current=Ve)},[E,we,ne,X]),x.useEffect(()=>{if(!E)return;const se=X.current;typeof se!="function"&&iw(se)&&se.current!==jt.current&&(we.setPositionReference(se.current),jt.current=se.current)},[E,we,ne,X]),x.useEffect(()=>{if(y&&E&&ze.domReference&&ze.floating)return tw(ze.domReference,ze.floating,Fe,Xe)},[y,E,ze,Fe,Xe]);const Vt=$r(lt),bt=nR(n,Vt,F),rt=Zi(lt)||"center",q=!!De.hide?.referenceHidden;at(()=>{$&&E&&oe&&N(Vt)},[$,E,oe,Vt]);const Q=x.useMemo(()=>({position:"absolute",top:De.arrow?.y,left:De.arrow?.x}),[De.arrow]),ie=De.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Ut,arrowStyles:Q,arrowRef:le,arrowUncentered:ie,side:bt,align:rt,physicalSide:Vt,anchorHidden:q,refs:we,context:Ne,isPositioned:oe,update:Fe}),[Ut,Q,le,ie,bt,rt,Vt,q,we,Ne,oe,Fe])}function iw(e){return e!=null&&"current"in e}const e2=x.forwardRef(function(e,t){const{cutout:r,...n}=e;let o;if(r){const a=r?.getBoundingClientRect();o=`polygon(
11
+ `+b.stack}return{value:i,source:s,stack:g,digest:null}}function Jf(i,s,c){return{value:i,source:null,stack:c??null,digest:s??null}}function Zf(i,s){try{console.error(s.value)}catch(c){setTimeout(function(){throw c})}}var X$=typeof WeakMap=="function"?WeakMap:Map;function f0(i,s,c){c=Gn(-1,c),c.tag=3,c.payload={element:null};var f=s.value;return c.callback=function(){Bc||(Bc=!0,hp=f),Zf(i,s)},c}function p0(i,s,c){c=Gn(-1,c),c.tag=3;var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=s.value;c.payload=function(){return f(g)},c.callback=function(){Zf(i,s)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(c.callback=function(){Zf(i,s),typeof f!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var _=s.stack;this.componentDidCatch(s.value,{componentStack:_!==null?_:""})}),c}function h0(i,s,c){var f=i.pingCache;if(f===null){f=i.pingCache=new X$;var g=new Set;f.set(s,g)}else g=f.get(s),g===void 0&&(g=new Set,f.set(s,g));g.has(c)||(g.add(c),i=lA.bind(null,i,s,c),s.then(i,i))}function m0(i){do{var s;if((s=i.tag===13)&&(s=i.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return i;i=i.return}while(i!==null);return null}function g0(i,s,c,f,g){return(i.mode&1)===0?(i===s?i.flags|=65536:(i.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(s=Gn(-1,1),s.tag=2,_i(c,s,1))),c.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var Y$=A.ReactCurrentOwner,xr=!1;function fr(i,s,c,f){s.child=i===null?Dy(s,null,c,f):ps(s,i.child,c,f)}function v0(i,s,c,f,g){c=c.render;var b=s.ref;return ms(s,g),f=Wf(i,s,c,f,b,g),c=Hf(),i!==null&&!xr?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Xn(i,s,g)):(kt&&c&&_f(s),s.flags|=1,fr(i,s,f,g),s.child)}function y0(i,s,c,f,g){if(i===null){var b=c.type;return typeof b=="function"&&!wp(b)&&b.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(s.tag=15,s.type=b,b0(i,s,b,f,g)):(i=Gc(c.type,null,f,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(b=i.child,(i.lanes&g)===0){var _=b.memoizedProps;if(c=c.compare,c=c!==null?c:_a,c(_,f)&&i.ref===s.ref)return Xn(i,s,g)}return s.flags|=1,i=Oi(b,f),i.ref=s.ref,i.return=s,s.child=i}function b0(i,s,c,f,g){if(i!==null){var b=i.memoizedProps;if(_a(b,f)&&i.ref===s.ref)if(xr=!1,s.pendingProps=f=b,(i.lanes&g)!==0)(i.flags&131072)!==0&&(xr=!0);else return s.lanes=i.lanes,Xn(i,s,g)}return ep(i,s,c,f,g)}function x0(i,s,c){var f=s.pendingProps,g=f.children,b=i!==null?i.memoizedState:null;if(f.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},xt(bs,Dr),Dr|=c;else{if((c&1073741824)===0)return i=b!==null?b.baseLanes|c:c,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:i,cachePool:null,transitions:null},s.updateQueue=null,xt(bs,Dr),Dr|=i,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=b!==null?b.baseLanes:c,xt(bs,Dr),Dr|=f}else b!==null?(f=b.baseLanes|c,s.memoizedState=null):f=c,xt(bs,Dr),Dr|=f;return fr(i,s,g,c),s.child}function w0(i,s){var c=s.ref;(i===null&&c!==null||i!==null&&i.ref!==c)&&(s.flags|=512,s.flags|=2097152)}function ep(i,s,c,f,g){var b=br(c)?ho:lr.current;return b=cs(s,b),ms(s,g),c=Wf(i,s,c,f,b,g),f=Hf(),i!==null&&!xr?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Xn(i,s,g)):(kt&&f&&_f(s),s.flags|=1,fr(i,s,c,g),s.child)}function S0(i,s,c,f,g){if(br(c)){var b=!0;yc(s)}else b=!1;if(ms(s,g),s.stateNode===null)Dc(i,s),u0(s,c,f),Qf(s,c,f,g),f=!0;else if(i===null){var _=s.stateNode,j=s.memoizedProps;_.props=j;var B=_.context,J=c.contextType;typeof J=="object"&&J!==null?J=Wr(J):(J=br(c)?ho:lr.current,J=cs(s,J));var ce=c.getDerivedStateFromProps,de=typeof ce=="function"||typeof _.getSnapshotBeforeUpdate=="function";de||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==f||B!==J)&&d0(s,_,f,J),Ri=!1;var ae=s.memoizedState;_.state=ae,_c(s,f,_,g),B=s.memoizedState,j!==f||ae!==B||yr.current||Ri?(typeof ce=="function"&&(Kf(s,c,ce,f),B=s.memoizedState),(j=Ri||c0(s,c,j,f,ae,B,J))?(de||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(s.flags|=4194308)):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=B),_.props=f,_.state=B,_.context=J,f=j):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{_=s.stateNode,My(i,s),j=s.memoizedProps,J=s.type===s.elementType?j:cn(s.type,j),_.props=J,de=s.pendingProps,ae=_.context,B=c.contextType,typeof B=="object"&&B!==null?B=Wr(B):(B=br(c)?ho:lr.current,B=cs(s,B));var ke=c.getDerivedStateFromProps;(ce=typeof ke=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j!==de||ae!==B)&&d0(s,_,f,B),Ri=!1,ae=s.memoizedState,_.state=ae,_c(s,f,_,g);var Te=s.memoizedState;j!==de||ae!==Te||yr.current||Ri?(typeof ke=="function"&&(Kf(s,c,ke,f),Te=s.memoizedState),(J=Ri||c0(s,c,J,f,ae,Te,B)||!1)?(ce||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(f,Te,B),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(f,Te,B)),typeof _.componentDidUpdate=="function"&&(s.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=Te),_.props=f,_.state=Te,_.context=B,f=J):(typeof _.componentDidUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||j===i.memoizedProps&&ae===i.memoizedState||(s.flags|=1024),f=!1)}return tp(i,s,c,f,b,g)}function tp(i,s,c,f,g,b){w0(i,s);var _=(s.flags&128)!==0;if(!f&&!_)return g&&_y(s,c,!1),Xn(i,s,b);f=s.stateNode,Y$.current=s;var j=_&&typeof c.getDerivedStateFromError!="function"?null:f.render();return s.flags|=1,i!==null&&_?(s.child=ps(s,i.child,null,b),s.child=ps(s,null,j,b)):fr(i,s,j,b),s.memoizedState=f.state,g&&_y(s,c,!0),s.child}function E0(i){var s=i.stateNode;s.pendingContext?ky(i,s.pendingContext,s.pendingContext!==s.context):s.context&&ky(i,s.context,!1),Mf(i,s.containerInfo)}function C0(i,s,c,f,g){return fs(),Lf(g),s.flags|=256,fr(i,s,c,f),s.child}var rp={dehydrated:null,treeContext:null,retryLane:0};function np(i){return{baseLanes:i,cachePool:null,transitions:null}}function k0(i,s,c){var f=s.pendingProps,g=$t.current,b=!1,_=(s.flags&128)!==0,j;if((j=_)||(j=i!==null&&i.memoizedState===null?!1:(g&2)!==0),j?(b=!0,s.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),xt($t,g&1),i===null)return Tf(s),i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((s.mode&1)===0?s.lanes=1:i.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(_=f.children,i=f.fallback,b?(f=s.mode,b=s.child,_={mode:"hidden",children:_},(f&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=_):b=Xc(_,f,0,null),i=Co(i,f,c,null),b.return=s,i.return=s,b.sibling=i,s.child=b,s.child.memoizedState=np(c),s.memoizedState=rp,i):ip(s,_));if(g=i.memoizedState,g!==null&&(j=g.dehydrated,j!==null))return K$(i,s,_,f,j,g,c);if(b){b=f.fallback,_=s.mode,g=i.child,j=g.sibling;var B={mode:"hidden",children:f.children};return(_&1)===0&&s.child!==g?(f=s.child,f.childLanes=0,f.pendingProps=B,s.deletions=null):(f=Oi(g,B),f.subtreeFlags=g.subtreeFlags&14680064),j!==null?b=Oi(j,b):(b=Co(b,_,c,null),b.flags|=2),b.return=s,f.return=s,f.sibling=b,s.child=f,f=b,b=s.child,_=i.child.memoizedState,_=_===null?np(c):{baseLanes:_.baseLanes|c,cachePool:null,transitions:_.transitions},b.memoizedState=_,b.childLanes=i.childLanes&~c,s.memoizedState=rp,f}return b=i.child,i=b.sibling,f=Oi(b,{mode:"visible",children:f.children}),(s.mode&1)===0&&(f.lanes=c),f.return=s,f.sibling=null,i!==null&&(c=s.deletions,c===null?(s.deletions=[i],s.flags|=16):c.push(i)),s.child=f,s.memoizedState=null,f}function ip(i,s){return s=Xc({mode:"visible",children:s},i.mode,0,null),s.return=i,i.child=s}function Pc(i,s,c,f){return f!==null&&Lf(f),ps(s,i.child,null,c),i=ip(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function K$(i,s,c,f,g,b,_){if(c)return s.flags&256?(s.flags&=-257,f=Jf(Error(r(422))),Pc(i,s,_,f)):s.memoizedState!==null?(s.child=i.child,s.flags|=128,null):(b=f.fallback,g=s.mode,f=Xc({mode:"visible",children:f.children},g,0,null),b=Co(b,g,_,null),b.flags|=2,f.return=s,b.return=s,f.sibling=b,s.child=f,(s.mode&1)!==0&&ps(s,i.child,null,_),s.child.memoizedState=np(_),s.memoizedState=rp,b);if((s.mode&1)===0)return Pc(i,s,_,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var j=f.dgst;return f=j,b=Error(r(419)),f=Jf(b,f,void 0),Pc(i,s,_,f)}if(j=(_&i.childLanes)!==0,xr||j){if(f=Zt,f!==null){switch(_&-_){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(f.suspendedLanes|_))!==0?0:g,g!==0&&g!==b.retryLane&&(b.retryLane=g,qn(i,g),fn(f,i,g,-1))}return xp(),f=Jf(Error(r(421))),Pc(i,s,_,f)}return g.data==="$?"?(s.flags|=128,s.child=i.child,s=cA.bind(null,i),g._reactRetry=s,null):(i=b.treeContext,Pr=Si(g.nextSibling),Nr=s,kt=!0,ln=null,i!==null&&(Ur[Vr++]=Wn,Ur[Vr++]=Hn,Ur[Vr++]=mo,Wn=i.id,Hn=i.overflow,mo=s),s=ip(s,f.children),s.flags|=4096,s)}function R0(i,s,c){i.lanes|=s;var f=i.alternate;f!==null&&(f.lanes|=s),Pf(i.return,s,c)}function op(i,s,c,f,g){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:g}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=f,b.tail=c,b.tailMode=g)}function _0(i,s,c){var f=s.pendingProps,g=f.revealOrder,b=f.tail;if(fr(i,s,f.children,c),f=$t.current,(f&2)!==0)f=f&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&R0(i,c,s);else if(i.tag===19)R0(i,c,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}f&=1}if(xt($t,f),(s.mode&1)===0)s.memoizedState=null;else switch(g){case"forwards":for(c=s.child,g=null;c!==null;)i=c.alternate,i!==null&&$c(i)===null&&(g=c),c=c.sibling;c=g,c===null?(g=s.child,s.child=null):(g=c.sibling,c.sibling=null),op(s,!1,g,c,b);break;case"backwards":for(c=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&$c(i)===null){s.child=g;break}i=g.sibling,g.sibling=c,c=g,g=i}op(s,!0,c,null,b);break;case"together":op(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Dc(i,s){(s.mode&1)===0&&i!==null&&(i.alternate=null,s.alternate=null,s.flags|=2)}function Xn(i,s,c){if(i!==null&&(s.dependencies=i.dependencies),xo|=s.lanes,(c&s.childLanes)===0)return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,c=Oi(i,i.pendingProps),s.child=c,c.return=s;i.sibling!==null;)i=i.sibling,c=c.sibling=Oi(i,i.pendingProps),c.return=s;c.sibling=null}return s.child}function Q$(i,s,c){switch(s.tag){case 3:E0(s),fs();break;case 5:By(s);break;case 1:br(s.type)&&yc(s);break;case 4:Mf(s,s.stateNode.containerInfo);break;case 10:var f=s.type._context,g=s.memoizedProps.value;xt(Cc,f._currentValue),f._currentValue=g;break;case 13:if(f=s.memoizedState,f!==null)return f.dehydrated!==null?(xt($t,$t.current&1),s.flags|=128,null):(c&s.child.childLanes)!==0?k0(i,s,c):(xt($t,$t.current&1),i=Xn(i,s,c),i!==null?i.sibling:null);xt($t,$t.current&1);break;case 19:if(f=(c&s.childLanes)!==0,(i.flags&128)!==0){if(f)return _0(i,s,c);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),xt($t,$t.current),f)break;return null;case 22:case 23:return s.lanes=0,x0(i,s,c)}return Xn(i,s,c)}var $0,sp,A0,T0;$0=function(i,s){for(var c=s.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},sp=function(){},A0=function(i,s,c,f){var g=i.memoizedProps;if(g!==f){i=s.stateNode,yo(kn.current);var b=null;switch(c){case"input":g=ze(i,g),f=ze(i,f),b=[];break;case"select":g=z({},g,{value:void 0}),f=z({},f,{value:void 0}),b=[];break;case"textarea":g=Se(i,g),f=Se(i,f),b=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(i.onclick=mc)}Ve(c,f);var _;c=null;for(J in g)if(!f.hasOwnProperty(J)&&g.hasOwnProperty(J)&&g[J]!=null)if(J==="style"){var j=g[J];for(_ in j)j.hasOwnProperty(_)&&(c||(c={}),c[_]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(o.hasOwnProperty(J)?b||(b=[]):(b=b||[]).push(J,null));for(J in f){var B=f[J];if(j=g?.[J],f.hasOwnProperty(J)&&B!==j&&(B!=null||j!=null))if(J==="style")if(j){for(_ in j)!j.hasOwnProperty(_)||B&&B.hasOwnProperty(_)||(c||(c={}),c[_]="");for(_ in B)B.hasOwnProperty(_)&&j[_]!==B[_]&&(c||(c={}),c[_]=B[_])}else c||(b||(b=[]),b.push(J,c)),c=B;else J==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,j=j?j.__html:void 0,B!=null&&j!==B&&(b=b||[]).push(J,B)):J==="children"?typeof B!="string"&&typeof B!="number"||(b=b||[]).push(J,""+B):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(o.hasOwnProperty(J)?(B!=null&&J==="onScroll"&&St("scroll",i),b||j===B||(b=[])):(b=b||[]).push(J,B))}c&&(b=b||[]).push("style",c);var J=b;(s.updateQueue=J)&&(s.flags|=4)}},T0=function(i,s,c,f){c!==f&&(s.flags|=4)};function Ua(i,s){if(!kt)switch(i.tailMode){case"hidden":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function ur(i){var s=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(s)for(var g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=f,i.childLanes=c,s}function J$(i,s,c){var f=s.pendingProps;switch($f(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ur(s),null;case 1:return br(s.type)&&vc(),ur(s),null;case 3:return f=s.stateNode,gs(),Et(yr),Et(lr),Bf(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(Sc(s)?s.flags|=4:i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ln!==null&&(vp(ln),ln=null))),sp(i,s),ur(s),null;case 5:zf(s);var g=yo(ja.current);if(c=s.type,i!==null&&s.stateNode!=null)A0(i,s,c,f,g),i.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!f){if(s.stateNode===null)throw Error(r(166));return ur(s),null}if(i=yo(kn.current),Sc(s)){f=s.stateNode,c=s.type;var b=s.memoizedProps;switch(f[Cn]=s,f[Ia]=b,i=(s.mode&1)!==0,c){case"dialog":St("cancel",f),St("close",f);break;case"iframe":case"object":case"embed":St("load",f);break;case"video":case"audio":for(g=0;g<Aa.length;g++)St(Aa[g],f);break;case"source":St("error",f);break;case"img":case"image":case"link":St("error",f),St("load",f);break;case"details":St("toggle",f);break;case"input":We(f,b),St("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!b.multiple},St("invalid",f);break;case"textarea":Je(f,b),St("invalid",f)}Ve(c,b),g=null;for(var _ in b)if(b.hasOwnProperty(_)){var j=b[_];_==="children"?typeof j=="string"?f.textContent!==j&&(b.suppressHydrationWarning!==!0&&hc(f.textContent,j,i),g=["children",j]):typeof j=="number"&&f.textContent!==""+j&&(b.suppressHydrationWarning!==!0&&hc(f.textContent,j,i),g=["children",""+j]):o.hasOwnProperty(_)&&j!=null&&_==="onScroll"&&St("scroll",f)}switch(c){case"input":qe(f),Fe(f,b,!0);break;case"textarea":qe(f),Ut(f);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(f.onclick=mc)}f=g,s.updateQueue=f,f!==null&&(s.flags|=4)}else{_=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Vt(c)),i==="http://www.w3.org/1999/xhtml"?c==="script"?(i=_.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof f.is=="string"?i=_.createElement(c,{is:f.is}):(i=_.createElement(c),c==="select"&&(_=i,f.multiple?_.multiple=!0:f.size&&(_.size=f.size))):i=_.createElementNS(i,c),i[Cn]=s,i[Ia]=f,$0(i,s,!1,!1),s.stateNode=i;e:{switch(_=Qe(c,f),c){case"dialog":St("cancel",i),St("close",i),g=f;break;case"iframe":case"object":case"embed":St("load",i),g=f;break;case"video":case"audio":for(g=0;g<Aa.length;g++)St(Aa[g],i);g=f;break;case"source":St("error",i),g=f;break;case"img":case"image":case"link":St("error",i),St("load",i),g=f;break;case"details":St("toggle",i),g=f;break;case"input":We(i,f),g=ze(i,f),St("invalid",i);break;case"option":g=f;break;case"select":i._wrapperState={wasMultiple:!!f.multiple},g=z({},f,{value:void 0}),St("invalid",i);break;case"textarea":Je(i,f),g=Se(i,f),St("invalid",i);break;default:g=f}Ve(c,g),j=g;for(b in j)if(j.hasOwnProperty(b)){var B=j[b];b==="style"?se(i,B):b==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&bt(i,B)):b==="children"?typeof B=="string"?(c!=="textarea"||B!=="")&&rt(i,B):typeof B=="number"&&rt(i,""+B):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(o.hasOwnProperty(b)?B!=null&&b==="onScroll"&&St("scroll",i):B!=null&&$(i,b,B,_))}switch(c){case"input":qe(i),Fe(i,f,!1);break;case"textarea":qe(i),Ut(i);break;case"option":f.value!=null&&i.setAttribute("value",""+pe(f.value));break;case"select":i.multiple=!!f.multiple,b=f.value,b!=null?oe(i,!!f.multiple,b,!1):f.defaultValue!=null&&oe(i,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=mc)}switch(c){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return ur(s),null;case 6:if(i&&s.stateNode!=null)T0(i,s,i.memoizedProps,f);else{if(typeof f!="string"&&s.stateNode===null)throw Error(r(166));if(c=yo(ja.current),yo(kn.current),Sc(s)){if(f=s.stateNode,c=s.memoizedProps,f[Cn]=s,(b=f.nodeValue!==c)&&(i=Nr,i!==null))switch(i.tag){case 3:hc(f.nodeValue,c,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&hc(f.nodeValue,c,(i.mode&1)!==0)}b&&(s.flags|=4)}else f=(c.nodeType===9?c:c.ownerDocument).createTextNode(f),f[Cn]=s,s.stateNode=f}return ur(s),null;case 13:if(Et($t),f=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(kt&&Pr!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Oy(),fs(),s.flags|=98560,b=!1;else if(b=Sc(s),f!==null&&f.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Cn]=s}else fs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;ur(s),b=!1}else ln!==null&&(vp(ln),ln=null),b=!0;if(!b)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=c,s):(f=f!==null,f!==(i!==null&&i.memoizedState!==null)&&f&&(s.child.flags|=8192,(s.mode&1)!==0&&(i===null||($t.current&1)!==0?Gt===0&&(Gt=3):xp())),s.updateQueue!==null&&(s.flags|=4),ur(s),null);case 4:return gs(),sp(i,s),i===null&&Ta(s.stateNode.containerInfo),ur(s),null;case 10:return Nf(s.type._context),ur(s),null;case 17:return br(s.type)&&vc(),ur(s),null;case 19:if(Et($t),b=s.memoizedState,b===null)return ur(s),null;if(f=(s.flags&128)!==0,_=b.rendering,_===null)if(f)Ua(b,!1);else{if(Gt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(_=$c(i),_!==null){for(s.flags|=128,Ua(b,!1),f=_.updateQueue,f!==null&&(s.updateQueue=f,s.flags|=4),s.subtreeFlags=0,f=c,c=s.child;c!==null;)b=c,i=f,b.flags&=14680066,_=b.alternate,_===null?(b.childLanes=0,b.lanes=i,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=_.childLanes,b.lanes=_.lanes,b.child=_.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=_.memoizedProps,b.memoizedState=_.memoizedState,b.updateQueue=_.updateQueue,b.type=_.type,i=_.dependencies,b.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),c=c.sibling;return xt($t,$t.current&1|2),s.child}i=i.sibling}b.tail!==null&&Ct()>xs&&(s.flags|=128,f=!0,Ua(b,!1),s.lanes=4194304)}else{if(!f)if(i=$c(_),i!==null){if(s.flags|=128,f=!0,c=i.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),Ua(b,!0),b.tail===null&&b.tailMode==="hidden"&&!_.alternate&&!kt)return ur(s),null}else 2*Ct()-b.renderingStartTime>xs&&c!==1073741824&&(s.flags|=128,f=!0,Ua(b,!1),s.lanes=4194304);b.isBackwards?(_.sibling=s.child,s.child=_):(c=b.last,c!==null?c.sibling=_:s.child=_,b.last=_)}return b.tail!==null?(s=b.tail,b.rendering=s,b.tail=s.sibling,b.renderingStartTime=Ct(),s.sibling=null,c=$t.current,xt($t,f?c&1|2:c&1),s):(ur(s),null);case 22:case 23:return bp(),f=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==f&&(s.flags|=8192),f&&(s.mode&1)!==0?(Dr&1073741824)!==0&&(ur(s),s.subtreeFlags&6&&(s.flags|=8192)):ur(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function Z$(i,s){switch($f(s),s.tag){case 1:return br(s.type)&&vc(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return gs(),Et(yr),Et(lr),Bf(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return zf(s),null;case 13:if(Et($t),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));fs()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return Et($t),null;case 4:return gs(),null;case 10:return Nf(s.type._context),null;case 22:case 23:return bp(),null;case 24:return null;default:return null}}var jc=!1,dr=!1,eA=typeof WeakSet=="function"?WeakSet:Set,$e=null;function ys(i,s){var c=i.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(f){Lt(i,s,f)}else c.current=null}function ap(i,s,c){try{c()}catch(f){Lt(i,s,f)}}var L0=!1;function tA(i,s){if(bf=nc,i=cy(),df(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var g=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var _=0,j=-1,B=-1,J=0,ce=0,de=i,ae=null;t:for(;;){for(var ke;de!==c||g!==0&&de.nodeType!==3||(j=_+g),de!==b||f!==0&&de.nodeType!==3||(B=_+f),de.nodeType===3&&(_+=de.nodeValue.length),(ke=de.firstChild)!==null;)ae=de,de=ke;for(;;){if(de===i)break t;if(ae===c&&++J===g&&(j=_),ae===b&&++ce===f&&(B=_),(ke=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=ke}c=j===-1||B===-1?null:{start:j,end:B}}else c=null}c=c||{start:0,end:0}}else c=null;for(xf={focusedElem:i,selectionRange:c},nc=!1,$e=s;$e!==null;)if(s=$e,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,$e=i;else for(;$e!==null;){s=$e;try{var Te=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var Le=Te.memoizedProps,Nt=Te.memoizedState,Y=s.stateNode,W=Y.getSnapshotBeforeUpdate(s.elementType===s.type?Le:cn(s.type,Le),Nt);Y.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var K=s.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(me){Lt(s,s.return,me)}if(i=s.sibling,i!==null){i.return=s.return,$e=i;break}$e=s.return}return Te=L0,L0=!1,Te}function Va(i,s,c){var f=s.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&i)===i){var b=g.destroy;g.destroy=void 0,b!==void 0&&ap(s,c,b)}g=g.next}while(g!==f)}}function Mc(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&i)===i){var f=c.create;c.destroy=f()}c=c.next}while(c!==s)}}function lp(i){var s=i.ref;if(s!==null){var c=i.stateNode;i.tag,i=c,typeof s=="function"?s(i):s.current=i}}function I0(i){var s=i.alternate;s!==null&&(i.alternate=null,I0(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[Cn],delete s[Ia],delete s[Cf],delete s[j$],delete s[M$])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function O0(i){return i.tag===5||i.tag===3||i.tag===4}function N0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||O0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function cp(i,s,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?c.nodeType===8?c.parentNode.insertBefore(i,s):c.insertBefore(i,s):(c.nodeType===8?(s=c.parentNode,s.insertBefore(i,c)):(s=c,s.appendChild(i)),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=mc));else if(f!==4&&(i=i.child,i!==null))for(cp(i,s,c),i=i.sibling;i!==null;)cp(i,s,c),i=i.sibling}function up(i,s,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?c.insertBefore(i,s):c.appendChild(i);else if(f!==4&&(i=i.child,i!==null))for(up(i,s,c),i=i.sibling;i!==null;)up(i,s,c),i=i.sibling}var rr=null,un=!1;function $i(i,s,c){for(c=c.child;c!==null;)P0(i,s,c),c=c.sibling}function P0(i,s,c){if(Ir&&typeof Ir.onCommitFiberUnmount=="function")try{Ir.onCommitFiberUnmount(io,c)}catch{}switch(c.tag){case 5:dr||ys(c,s);case 6:var f=rr,g=un;rr=null,$i(i,s,c),rr=f,un=g,rr!==null&&(un?(i=rr,c=c.stateNode,i.nodeType===8?i.parentNode.removeChild(c):i.removeChild(c)):rr.removeChild(c.stateNode));break;case 18:rr!==null&&(un?(i=rr,c=c.stateNode,i.nodeType===8?Ef(i.parentNode,c):i.nodeType===1&&Ef(i,c),wa(i)):Ef(rr,c.stateNode));break;case 4:f=rr,g=un,rr=c.stateNode.containerInfo,un=!0,$i(i,s,c),rr=f,un=g;break;case 0:case 11:case 14:case 15:if(!dr&&(f=c.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var b=g,_=b.destroy;b=b.tag,_!==void 0&&((b&2)!==0||(b&4)!==0)&&ap(c,s,_),g=g.next}while(g!==f)}$i(i,s,c);break;case 1:if(!dr&&(ys(c,s),f=c.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=c.memoizedProps,f.state=c.memoizedState,f.componentWillUnmount()}catch(j){Lt(c,s,j)}$i(i,s,c);break;case 21:$i(i,s,c);break;case 22:c.mode&1?(dr=(f=dr)||c.memoizedState!==null,$i(i,s,c),dr=f):$i(i,s,c);break;default:$i(i,s,c)}}function D0(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var c=i.stateNode;c===null&&(c=i.stateNode=new eA),s.forEach(function(f){var g=uA.bind(null,i,f);c.has(f)||(c.add(f),f.then(g,g))})}}function dn(i,s){var c=s.deletions;if(c!==null)for(var f=0;f<c.length;f++){var g=c[f];try{var b=i,_=s,j=_;e:for(;j!==null;){switch(j.tag){case 5:rr=j.stateNode,un=!1;break e;case 3:rr=j.stateNode.containerInfo,un=!0;break e;case 4:rr=j.stateNode.containerInfo,un=!0;break e}j=j.return}if(rr===null)throw Error(r(160));P0(b,_,g),rr=null,un=!1;var B=g.alternate;B!==null&&(B.return=null),g.return=null}catch(J){Lt(g,s,J)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)j0(s,i),s=s.sibling}function j0(i,s){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(dn(s,i),_n(i),f&4){try{Va(3,i,i.return),Mc(3,i)}catch(Le){Lt(i,i.return,Le)}try{Va(5,i,i.return)}catch(Le){Lt(i,i.return,Le)}}break;case 1:dn(s,i),_n(i),f&512&&c!==null&&ys(c,c.return);break;case 5:if(dn(s,i),_n(i),f&512&&c!==null&&ys(c,c.return),i.flags&32){var g=i.stateNode;try{rt(g,"")}catch(Le){Lt(i,i.return,Le)}}if(f&4&&(g=i.stateNode,g!=null)){var b=i.memoizedProps,_=c!==null?c.memoizedProps:b,j=i.type,B=i.updateQueue;if(i.updateQueue=null,B!==null)try{j==="input"&&b.type==="radio"&&b.name!=null&&tt(g,b),Qe(j,_);var J=Qe(j,b);for(_=0;_<B.length;_+=2){var ce=B[_],de=B[_+1];ce==="style"?se(g,de):ce==="dangerouslySetInnerHTML"?bt(g,de):ce==="children"?rt(g,de):$(g,ce,de,J)}switch(j){case"input":De(g,b);break;case"textarea":ht(g,b);break;case"select":var ae=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!b.multiple;var ke=b.value;ke!=null?oe(g,!!b.multiple,ke,!1):ae!==!!b.multiple&&(b.defaultValue!=null?oe(g,!!b.multiple,b.defaultValue,!0):oe(g,!!b.multiple,b.multiple?[]:"",!1))}g[Ia]=b}catch(Le){Lt(i,i.return,Le)}}break;case 6:if(dn(s,i),_n(i),f&4){if(i.stateNode===null)throw Error(r(162));g=i.stateNode,b=i.memoizedProps;try{g.nodeValue=b}catch(Le){Lt(i,i.return,Le)}}break;case 3:if(dn(s,i),_n(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{wa(s.containerInfo)}catch(Le){Lt(i,i.return,Le)}break;case 4:dn(s,i),_n(i);break;case 13:dn(s,i),_n(i),g=i.child,g.flags&8192&&(b=g.memoizedState!==null,g.stateNode.isHidden=b,!b||g.alternate!==null&&g.alternate.memoizedState!==null||(pp=Ct())),f&4&&D0(i);break;case 22:if(ce=c!==null&&c.memoizedState!==null,i.mode&1?(dr=(J=dr)||ce,dn(s,i),dr=J):dn(s,i),_n(i),f&8192){if(J=i.memoizedState!==null,(i.stateNode.isHidden=J)&&!ce&&(i.mode&1)!==0)for($e=i,ce=i.child;ce!==null;){for(de=$e=ce;$e!==null;){switch(ae=$e,ke=ae.child,ae.tag){case 0:case 11:case 14:case 15:Va(4,ae,ae.return);break;case 1:ys(ae,ae.return);var Te=ae.stateNode;if(typeof Te.componentWillUnmount=="function"){f=ae,c=ae.return;try{s=f,Te.props=s.memoizedProps,Te.state=s.memoizedState,Te.componentWillUnmount()}catch(Le){Lt(f,c,Le)}}break;case 5:ys(ae,ae.return);break;case 22:if(ae.memoizedState!==null){F0(de);continue}}ke!==null?(ke.return=ae,$e=ke):F0(de)}ce=ce.sibling}e:for(ce=null,de=i;;){if(de.tag===5){if(ce===null){ce=de;try{g=de.stateNode,J?(b=g.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(j=de.stateNode,B=de.memoizedProps.style,_=B!=null&&B.hasOwnProperty("display")?B.display:null,j.style.display=ie("display",_))}catch(Le){Lt(i,i.return,Le)}}}else if(de.tag===6){if(ce===null)try{de.stateNode.nodeValue=J?"":de.memoizedProps}catch(Le){Lt(i,i.return,Le)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===i)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===i)break e;for(;de.sibling===null;){if(de.return===null||de.return===i)break e;ce===de&&(ce=null),de=de.return}ce===de&&(ce=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:dn(s,i),_n(i),f&4&&D0(i);break;case 21:break;default:dn(s,i),_n(i)}}function _n(i){var s=i.flags;if(s&2){try{e:{for(var c=i.return;c!==null;){if(O0(c)){var f=c;break e}c=c.return}throw Error(r(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(rt(g,""),f.flags&=-33);var b=N0(i);up(i,b,g);break;case 3:case 4:var _=f.stateNode.containerInfo,j=N0(i);cp(i,j,_);break;default:throw Error(r(161))}}catch(B){Lt(i,i.return,B)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function rA(i,s,c){$e=i,M0(i)}function M0(i,s,c){for(var f=(i.mode&1)!==0;$e!==null;){var g=$e,b=g.child;if(g.tag===22&&f){var _=g.memoizedState!==null||jc;if(!_){var j=g.alternate,B=j!==null&&j.memoizedState!==null||dr;j=jc;var J=dr;if(jc=_,(dr=B)&&!J)for($e=g;$e!==null;)_=$e,B=_.child,_.tag===22&&_.memoizedState!==null?B0(g):B!==null?(B.return=_,$e=B):B0(g);for(;b!==null;)$e=b,M0(b),b=b.sibling;$e=g,jc=j,dr=J}z0(i)}else(g.subtreeFlags&8772)!==0&&b!==null?(b.return=g,$e=b):z0(i)}}function z0(i){for(;$e!==null;){var s=$e;if((s.flags&8772)!==0){var c=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:dr||Mc(5,s);break;case 1:var f=s.stateNode;if(s.flags&4&&!dr)if(c===null)f.componentDidMount();else{var g=s.elementType===s.type?c.memoizedProps:cn(s.type,c.memoizedProps);f.componentDidUpdate(g,c.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var b=s.updateQueue;b!==null&&Fy(s,b,f);break;case 3:var _=s.updateQueue;if(_!==null){if(c=null,s.child!==null)switch(s.child.tag){case 5:c=s.child.stateNode;break;case 1:c=s.child.stateNode}Fy(s,_,c)}break;case 5:var j=s.stateNode;if(c===null&&s.flags&4){c=j;var B=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&c.focus();break;case"img":B.src&&(c.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var J=s.alternate;if(J!==null){var ce=J.memoizedState;if(ce!==null){var de=ce.dehydrated;de!==null&&wa(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}dr||s.flags&512&&lp(s)}catch(ae){Lt(s,s.return,ae)}}if(s===i){$e=null;break}if(c=s.sibling,c!==null){c.return=s.return,$e=c;break}$e=s.return}}function F0(i){for(;$e!==null;){var s=$e;if(s===i){$e=null;break}var c=s.sibling;if(c!==null){c.return=s.return,$e=c;break}$e=s.return}}function B0(i){for(;$e!==null;){var s=$e;try{switch(s.tag){case 0:case 11:case 15:var c=s.return;try{Mc(4,s)}catch(B){Lt(s,c,B)}break;case 1:var f=s.stateNode;if(typeof f.componentDidMount=="function"){var g=s.return;try{f.componentDidMount()}catch(B){Lt(s,g,B)}}var b=s.return;try{lp(s)}catch(B){Lt(s,b,B)}break;case 5:var _=s.return;try{lp(s)}catch(B){Lt(s,_,B)}}}catch(B){Lt(s,s.return,B)}if(s===i){$e=null;break}var j=s.sibling;if(j!==null){j.return=s.return,$e=j;break}$e=s.return}}var nA=Math.ceil,zc=A.ReactCurrentDispatcher,dp=A.ReactCurrentOwner,qr=A.ReactCurrentBatchConfig,nt=0,Zt=null,Mt=null,nr=0,Dr=0,bs=Ei(0),Gt=0,Wa=null,xo=0,Fc=0,fp=0,Ha=null,wr=null,pp=0,xs=1/0,Yn=null,Bc=!1,hp=null,Ai=null,Uc=!1,Ti=null,Vc=0,qa=0,mp=null,Wc=-1,Hc=0;function pr(){return(nt&6)!==0?Ct():Wc!==-1?Wc:Wc=Ct()}function Li(i){return(i.mode&1)===0?1:(nt&2)!==0&&nr!==0?nr&-nr:F$.transition!==null?(Hc===0&&(Hc=fa()),Hc):(i=it,i!==0||(i=window.event,i=i===void 0?16:Vv(i.type)),i)}function fn(i,s,c,f){if(50<qa)throw qa=0,mp=null,Error(r(185));gi(i,c,f),((nt&2)===0||i!==Zt)&&(i===Zt&&((nt&2)===0&&(Fc|=c),Gt===4&&Ii(i,nr)),Sr(i,f),c===1&&nt===0&&(s.mode&1)===0&&(xs=Ct()+500,bc&&ki()))}function Sr(i,s){var c=i.callbackNode;Jl(i,s);var f=ao(i,i===Zt?nr:0);if(f===0)c!==null&&Br(c),i.callbackNode=null,i.callbackPriority=0;else if(s=f&-f,i.callbackPriority!==s){if(c!=null&&Br(c),s===1)i.tag===0?z$(V0.bind(null,i)):$y(V0.bind(null,i)),P$(function(){(nt&6)===0&&ki()}),c=null;else{switch(pa(f)){case 1:c=Xo;break;case 4:c=ua;break;case 16:c=no;break;case 536870912:c=da;break;default:c=no}c=Q0(c,U0.bind(null,i))}i.callbackPriority=s,i.callbackNode=c}}function U0(i,s){if(Wc=-1,Hc=0,(nt&6)!==0)throw Error(r(327));var c=i.callbackNode;if(ws()&&i.callbackNode!==c)return null;var f=ao(i,i===Zt?nr:0);if(f===0)return null;if((f&30)!==0||(f&i.expiredLanes)!==0||s)s=qc(i,f);else{s=f;var g=nt;nt|=2;var b=H0();(Zt!==i||nr!==s)&&(Yn=null,xs=Ct()+500,So(i,s));do try{sA();break}catch(j){W0(i,j)}while(!0);Of(),zc.current=b,nt=g,Mt!==null?s=0:(Zt=null,nr=0,s=Gt)}if(s!==0){if(s===2&&(g=lo(i),g!==0&&(f=g,s=gp(i,g))),s===1)throw c=Wa,So(i,0),Ii(i,f),Sr(i,Ct()),c;if(s===6)Ii(i,f);else{if(g=i.current.alternate,(f&30)===0&&!iA(g)&&(s=qc(i,f),s===2&&(b=lo(i),b!==0&&(f=b,s=gp(i,b))),s===1))throw c=Wa,So(i,0),Ii(i,f),Sr(i,Ct()),c;switch(i.finishedWork=g,i.finishedLanes=f,s){case 0:case 1:throw Error(r(345));case 2:Eo(i,wr,Yn);break;case 3:if(Ii(i,f),(f&130023424)===f&&(s=pp+500-Ct(),10<s)){if(ao(i,0)!==0)break;if(g=i.suspendedLanes,(g&f)!==f){pr(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Sf(Eo.bind(null,i,wr,Yn),s);break}Eo(i,wr,Yn);break;case 4:if(Ii(i,f),(f&4194240)===f)break;for(s=i.eventTimes,g=-1;0<f;){var _=31-vr(f);b=1<<_,_=s[_],_>g&&(g=_),f&=~b}if(f=g,f=Ct()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*nA(f/1960))-f,10<f){i.timeoutHandle=Sf(Eo.bind(null,i,wr,Yn),f);break}Eo(i,wr,Yn);break;case 5:Eo(i,wr,Yn);break;default:throw Error(r(329))}}}return Sr(i,Ct()),i.callbackNode===c?U0.bind(null,i):null}function gp(i,s){var c=Ha;return i.current.memoizedState.isDehydrated&&(So(i,s).flags|=256),i=qc(i,s),i!==2&&(s=wr,wr=c,s!==null&&vp(s)),i}function vp(i){wr===null?wr=i:wr.push.apply(wr,i)}function iA(i){for(var s=i;;){if(s.flags&16384){var c=s.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var f=0;f<c.length;f++){var g=c[f],b=g.getSnapshot;g=g.value;try{if(!an(b(),g))return!1}catch{return!1}}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ii(i,s){for(s&=~fp,s&=~Fc,i.suspendedLanes|=s,i.pingedLanes&=~s,i=i.expirationTimes;0<s;){var c=31-vr(s),f=1<<c;i[c]=-1,s&=~f}}function V0(i){if((nt&6)!==0)throw Error(r(327));ws();var s=ao(i,0);if((s&1)===0)return Sr(i,Ct()),null;var c=qc(i,s);if(i.tag!==0&&c===2){var f=lo(i);f!==0&&(s=f,c=gp(i,f))}if(c===1)throw c=Wa,So(i,0),Ii(i,s),Sr(i,Ct()),c;if(c===6)throw Error(r(345));return i.finishedWork=i.current.alternate,i.finishedLanes=s,Eo(i,wr,Yn),Sr(i,Ct()),null}function yp(i,s){var c=nt;nt|=1;try{return i(s)}finally{nt=c,nt===0&&(xs=Ct()+500,bc&&ki())}}function wo(i){Ti!==null&&Ti.tag===0&&(nt&6)===0&&ws();var s=nt;nt|=1;var c=qr.transition,f=it;try{if(qr.transition=null,it=1,i)return i()}finally{it=f,qr.transition=c,nt=s,(nt&6)===0&&ki()}}function bp(){Dr=bs.current,Et(bs)}function So(i,s){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;if(c!==-1&&(i.timeoutHandle=-1,N$(c)),Mt!==null)for(c=Mt.return;c!==null;){var f=c;switch($f(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&vc();break;case 3:gs(),Et(yr),Et(lr),Bf();break;case 5:zf(f);break;case 4:gs();break;case 13:Et($t);break;case 19:Et($t);break;case 10:Nf(f.type._context);break;case 22:case 23:bp()}c=c.return}if(Zt=i,Mt=i=Oi(i.current,null),nr=Dr=s,Gt=0,Wa=null,fp=Fc=xo=0,wr=Ha=null,vo!==null){for(s=0;s<vo.length;s++)if(c=vo[s],f=c.interleaved,f!==null){c.interleaved=null;var g=f.next,b=c.pending;if(b!==null){var _=b.next;b.next=g,f.next=_}c.pending=f}vo=null}return i}function W0(i,s){do{var c=Mt;try{if(Of(),Ac.current=Oc,Tc){for(var f=At.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}Tc=!1}if(bo=0,Jt=qt=At=null,Ma=!1,za=0,dp.current=null,c===null||c.return===null){Gt=1,Wa=s,Mt=null;break}e:{var b=i,_=c.return,j=c,B=s;if(s=nr,j.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var J=B,ce=j,de=ce.tag;if((ce.mode&1)===0&&(de===0||de===11||de===15)){var ae=ce.alternate;ae?(ce.updateQueue=ae.updateQueue,ce.memoizedState=ae.memoizedState,ce.lanes=ae.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var ke=m0(_);if(ke!==null){ke.flags&=-257,g0(ke,_,j,b,s),ke.mode&1&&h0(b,J,s),s=ke,B=J;var Te=s.updateQueue;if(Te===null){var Le=new Set;Le.add(B),s.updateQueue=Le}else Te.add(B);break e}else{if((s&1)===0){h0(b,J,s),xp();break e}B=Error(r(426))}}else if(kt&&j.mode&1){var Nt=m0(_);if(Nt!==null){(Nt.flags&65536)===0&&(Nt.flags|=256),g0(Nt,_,j,b,s),Lf(vs(B,j));break e}}b=B=vs(B,j),Gt!==4&&(Gt=2),Ha===null?Ha=[b]:Ha.push(b),b=_;do{switch(b.tag){case 3:b.flags|=65536,s&=-s,b.lanes|=s;var Y=f0(b,B,s);zy(b,Y);break e;case 1:j=B;var W=b.type,K=b.stateNode;if((b.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(Ai===null||!Ai.has(K)))){b.flags|=65536,s&=-s,b.lanes|=s;var me=p0(b,j,s);zy(b,me);break e}}b=b.return}while(b!==null)}G0(c)}catch(Oe){s=Oe,Mt===c&&c!==null&&(Mt=c=c.return);continue}break}while(!0)}function H0(){var i=zc.current;return zc.current=Oc,i===null?Oc:i}function xp(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),Zt===null||(xo&268435455)===0&&(Fc&268435455)===0||Ii(Zt,nr)}function qc(i,s){var c=nt;nt|=2;var f=H0();(Zt!==i||nr!==s)&&(Yn=null,So(i,s));do try{oA();break}catch(g){W0(i,g)}while(!0);if(Of(),nt=c,zc.current=f,Mt!==null)throw Error(r(261));return Zt=null,nr=0,Gt}function oA(){for(;Mt!==null;)q0(Mt)}function sA(){for(;Mt!==null&&!Vl();)q0(Mt)}function q0(i){var s=K0(i.alternate,i,Dr);i.memoizedProps=i.pendingProps,s===null?G0(i):Mt=s,dp.current=null}function G0(i){var s=i;do{var c=s.alternate;if(i=s.return,(s.flags&32768)===0){if(c=J$(c,s,Dr),c!==null){Mt=c;return}}else{if(c=Z$(c,s),c!==null){c.flags&=32767,Mt=c;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Gt=6,Mt=null;return}}if(s=s.sibling,s!==null){Mt=s;return}Mt=s=i}while(s!==null);Gt===0&&(Gt=5)}function Eo(i,s,c){var f=it,g=qr.transition;try{qr.transition=null,it=1,aA(i,s,c,f)}finally{qr.transition=g,it=f}return null}function aA(i,s,c,f){do ws();while(Ti!==null);if((nt&6)!==0)throw Error(r(327));c=i.finishedWork;var g=i.finishedLanes;if(c===null)return null;if(i.finishedWork=null,i.finishedLanes=0,c===i.current)throw Error(r(177));i.callbackNode=null,i.callbackPriority=0;var b=c.lanes|c.childLanes;if(Zl(i,b),i===Zt&&(Mt=Zt=null,nr=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||Uc||(Uc=!0,Q0(no,function(){return ws(),null})),b=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||b){b=qr.transition,qr.transition=null;var _=it;it=1;var j=nt;nt|=4,dp.current=null,tA(i,c),j0(c,i),_$(xf),nc=!!bf,xf=bf=null,i.current=c,rA(c),Wl(),nt=j,it=_,qr.transition=b}else i.current=c;if(Uc&&(Uc=!1,Ti=i,Vc=g),b=i.pendingLanes,b===0&&(Ai=null),Gl(c.stateNode),Sr(i,Ct()),s!==null)for(f=i.onRecoverableError,c=0;c<s.length;c++)g=s[c],f(g.value,{componentStack:g.stack,digest:g.digest});if(Bc)throw Bc=!1,i=hp,hp=null,i;return(Vc&1)!==0&&i.tag!==0&&ws(),b=i.pendingLanes,(b&1)!==0?i===mp?qa++:(qa=0,mp=i):qa=0,ki(),null}function ws(){if(Ti!==null){var i=pa(Vc),s=qr.transition,c=it;try{if(qr.transition=null,it=16>i?16:i,Ti===null)var f=!1;else{if(i=Ti,Ti=null,Vc=0,(nt&6)!==0)throw Error(r(331));var g=nt;for(nt|=4,$e=i.current;$e!==null;){var b=$e,_=b.child;if(($e.flags&16)!==0){var j=b.deletions;if(j!==null){for(var B=0;B<j.length;B++){var J=j[B];for($e=J;$e!==null;){var ce=$e;switch(ce.tag){case 0:case 11:case 15:Va(8,ce,b)}var de=ce.child;if(de!==null)de.return=ce,$e=de;else for(;$e!==null;){ce=$e;var ae=ce.sibling,ke=ce.return;if(I0(ce),ce===J){$e=null;break}if(ae!==null){ae.return=ke,$e=ae;break}$e=ke}}}var Te=b.alternate;if(Te!==null){var Le=Te.child;if(Le!==null){Te.child=null;do{var Nt=Le.sibling;Le.sibling=null,Le=Nt}while(Le!==null)}}$e=b}}if((b.subtreeFlags&2064)!==0&&_!==null)_.return=b,$e=_;else e:for(;$e!==null;){if(b=$e,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:Va(9,b,b.return)}var Y=b.sibling;if(Y!==null){Y.return=b.return,$e=Y;break e}$e=b.return}}var W=i.current;for($e=W;$e!==null;){_=$e;var K=_.child;if((_.subtreeFlags&2064)!==0&&K!==null)K.return=_,$e=K;else e:for(_=W;$e!==null;){if(j=$e,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:Mc(9,j)}}catch(Oe){Lt(j,j.return,Oe)}if(j===_){$e=null;break e}var me=j.sibling;if(me!==null){me.return=j.return,$e=me;break e}$e=j.return}}if(nt=g,ki(),Ir&&typeof Ir.onPostCommitFiberRoot=="function")try{Ir.onPostCommitFiberRoot(io,i)}catch{}f=!0}return f}finally{it=c,qr.transition=s}}return!1}function X0(i,s,c){s=vs(c,s),s=f0(i,s,1),i=_i(i,s,1),s=pr(),i!==null&&(gi(i,1,s),Sr(i,s))}function Lt(i,s,c){if(i.tag===3)X0(i,i,c);else for(;s!==null;){if(s.tag===3){X0(s,i,c);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ai===null||!Ai.has(f))){i=vs(c,i),i=p0(s,i,1),s=_i(s,i,1),i=pr(),s!==null&&(gi(s,1,i),Sr(s,i));break}}s=s.return}}function lA(i,s,c){var f=i.pingCache;f!==null&&f.delete(s),s=pr(),i.pingedLanes|=i.suspendedLanes&c,Zt===i&&(nr&c)===c&&(Gt===4||Gt===3&&(nr&130023424)===nr&&500>Ct()-pp?So(i,0):fp|=c),Sr(i,s)}function Y0(i,s){s===0&&((i.mode&1)===0?s=1:(s=so,so<<=1,(so&130023424)===0&&(so=4194304)));var c=pr();i=qn(i,s),i!==null&&(gi(i,s,c),Sr(i,c))}function cA(i){var s=i.memoizedState,c=0;s!==null&&(c=s.retryLane),Y0(i,c)}function uA(i,s){var c=0;switch(i.tag){case 13:var f=i.stateNode,g=i.memoizedState;g!==null&&(c=g.retryLane);break;case 19:f=i.stateNode;break;default:throw Error(r(314))}f!==null&&f.delete(s),Y0(i,c)}var K0;K0=function(i,s,c){if(i!==null)if(i.memoizedProps!==s.pendingProps||yr.current)xr=!0;else{if((i.lanes&c)===0&&(s.flags&128)===0)return xr=!1,Q$(i,s,c);xr=(i.flags&131072)!==0}else xr=!1,kt&&(s.flags&1048576)!==0&&Ay(s,wc,s.index);switch(s.lanes=0,s.tag){case 2:var f=s.type;Dc(i,s),i=s.pendingProps;var g=cs(s,lr.current);ms(s,c),g=Wf(null,s,f,i,g,c);var b=Hf();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,br(f)?(b=!0,yc(s)):b=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,jf(s),g.updater=Nc,s.stateNode=g,g._reactInternals=s,Qf(s,f,i,c),s=tp(null,s,f,!0,b,c)):(s.tag=0,kt&&b&&_f(s),fr(null,s,g,c),s=s.child),s;case 16:f=s.elementType;e:{switch(Dc(i,s),i=s.pendingProps,g=f._init,f=g(f._payload),s.type=f,g=s.tag=fA(f),i=cn(f,i),g){case 0:s=ep(null,s,f,i,c);break e;case 1:s=S0(null,s,f,i,c);break e;case 11:s=v0(null,s,f,i,c);break e;case 14:s=y0(null,s,f,cn(f.type,i),c);break e}throw Error(r(306,f,""))}return s;case 0:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),ep(i,s,f,g,c);case 1:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),S0(i,s,f,g,c);case 3:e:{if(E0(s),i===null)throw Error(r(387));f=s.pendingProps,b=s.memoizedState,g=b.element,My(i,s),_c(s,f,null,c);var _=s.memoizedState;if(f=_.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){g=vs(Error(r(423)),s),s=C0(i,s,f,c,g);break e}else if(f!==g){g=vs(Error(r(424)),s),s=C0(i,s,f,c,g);break e}else for(Pr=Si(s.stateNode.containerInfo.firstChild),Nr=s,kt=!0,ln=null,c=Dy(s,null,f,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(fs(),f===g){s=Xn(i,s,c);break e}fr(i,s,f,c)}s=s.child}return s;case 5:return By(s),i===null&&Tf(s),f=s.type,g=s.pendingProps,b=i!==null?i.memoizedProps:null,_=g.children,wf(f,g)?_=null:b!==null&&wf(f,b)&&(s.flags|=32),w0(i,s),fr(i,s,_,c),s.child;case 6:return i===null&&Tf(s),null;case 13:return k0(i,s,c);case 4:return Mf(s,s.stateNode.containerInfo),f=s.pendingProps,i===null?s.child=ps(s,null,f,c):fr(i,s,f,c),s.child;case 11:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),v0(i,s,f,g,c);case 7:return fr(i,s,s.pendingProps,c),s.child;case 8:return fr(i,s,s.pendingProps.children,c),s.child;case 12:return fr(i,s,s.pendingProps.children,c),s.child;case 10:e:{if(f=s.type._context,g=s.pendingProps,b=s.memoizedProps,_=g.value,xt(Cc,f._currentValue),f._currentValue=_,b!==null)if(an(b.value,_)){if(b.children===g.children&&!yr.current){s=Xn(i,s,c);break e}}else for(b=s.child,b!==null&&(b.return=s);b!==null;){var j=b.dependencies;if(j!==null){_=b.child;for(var B=j.firstContext;B!==null;){if(B.context===f){if(b.tag===1){B=Gn(-1,c&-c),B.tag=2;var J=b.updateQueue;if(J!==null){J=J.shared;var ce=J.pending;ce===null?B.next=B:(B.next=ce.next,ce.next=B),J.pending=B}}b.lanes|=c,B=b.alternate,B!==null&&(B.lanes|=c),Pf(b.return,c,s),j.lanes|=c;break}B=B.next}}else if(b.tag===10)_=b.type===s.type?null:b.child;else if(b.tag===18){if(_=b.return,_===null)throw Error(r(341));_.lanes|=c,j=_.alternate,j!==null&&(j.lanes|=c),Pf(_,c,s),_=b.sibling}else _=b.child;if(_!==null)_.return=b;else for(_=b;_!==null;){if(_===s){_=null;break}if(b=_.sibling,b!==null){b.return=_.return,_=b;break}_=_.return}b=_}fr(i,s,g.children,c),s=s.child}return s;case 9:return g=s.type,f=s.pendingProps.children,ms(s,c),g=Wr(g),f=f(g),s.flags|=1,fr(i,s,f,c),s.child;case 14:return f=s.type,g=cn(f,s.pendingProps),g=cn(f.type,g),y0(i,s,f,g,c);case 15:return b0(i,s,s.type,s.pendingProps,c);case 17:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:cn(f,g),Dc(i,s),s.tag=1,br(f)?(i=!0,yc(s)):i=!1,ms(s,c),u0(s,f,g),Qf(s,f,g,c),tp(null,s,f,!0,i,c);case 19:return _0(i,s,c);case 22:return x0(i,s,c)}throw Error(r(156,s.tag))};function Q0(i,s){return Ul(i,s)}function dA(i,s,c,f){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(i,s,c,f){return new dA(i,s,c,f)}function wp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function fA(i){if(typeof i=="function")return wp(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ne)return 11;if(i===V)return 14}return 2}function Oi(i,s){var c=i.alternate;return c===null?(c=Gr(i.tag,s,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=s,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&14680064,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,s=i.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c}function Gc(i,s,c,f,g,b){var _=2;if(f=i,typeof i=="function")wp(i)&&(_=1);else if(typeof i=="string")_=5;else e:switch(i){case P:return Co(c.children,g,b,s);case I:_=8,g|=8;break;case re:return i=Gr(12,c,s,g|2),i.elementType=re,i.lanes=b,i;case X:return i=Gr(13,c,s,g),i.elementType=X,i.lanes=b,i;case F:return i=Gr(19,c,s,g),i.elementType=F,i.lanes=b,i;case O:return Xc(c,g,b,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Z:_=10;break e;case ee:_=9;break e;case ne:_=11;break e;case V:_=14;break e;case H:_=16,f=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return s=Gr(_,c,s,g),s.elementType=i,s.type=f,s.lanes=b,s}function Co(i,s,c,f){return i=Gr(7,i,f,s),i.lanes=c,i}function Xc(i,s,c,f){return i=Gr(22,i,f,s),i.elementType=O,i.lanes=c,i.stateNode={isHidden:!1},i}function Sp(i,s,c){return i=Gr(6,i,null,s),i.lanes=c,i}function Ep(i,s,c){return s=Gr(4,i.children!==null?i.children:[],i.key,s),s.lanes=c,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function pA(i,s,c,f,g){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yo(0),this.expirationTimes=Yo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yo(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Cp(i,s,c,f,g,b,_,j,B){return i=new pA(i,s,c,j,B),s===1?(s=1,b===!0&&(s|=8)):s=0,b=Gr(3,null,null,s),i.current=b,b.stateNode=i,b.memoizedState={element:f,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},jf(b),i}function hA(i,s,c){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:f==null?null:""+f,children:i,containerInfo:s,implementation:c}}function J0(i){if(!i)return Ci;i=i._reactInternals;e:{if(Bn(i)!==i||i.tag!==1)throw Error(r(170));var s=i;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(br(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(r(171))}if(i.tag===1){var c=i.type;if(br(c))return Ry(i,c,s)}return s}function Z0(i,s,c,f,g,b,_,j,B){return i=Cp(c,f,!0,i,g,b,_,j,B),i.context=J0(null),c=i.current,f=pr(),g=Li(c),b=Gn(f,g),b.callback=s??null,_i(c,b,g),i.current.lanes=g,gi(i,g,f),Sr(i,f),i}function Yc(i,s,c,f){var g=s.current,b=pr(),_=Li(g);return c=J0(c),s.context===null?s.context=c:s.pendingContext=c,s=Gn(b,_),s.payload={element:i},f=f===void 0?null:f,f!==null&&(s.callback=f),i=_i(g,s,_),i!==null&&(fn(i,g,_,b),Rc(i,g,_)),_}function Kc(i){return i=i.current,i.child?(i.child.tag===5,i.child.stateNode):null}function eb(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<s?c:s}}function kp(i,s){eb(i,s),(i=i.alternate)&&eb(i,s)}function mA(){return null}var tb=typeof reportError=="function"?reportError:function(i){console.error(i)};function Rp(i){this._internalRoot=i}Qc.prototype.render=Rp.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));Yc(i,s,null,null)},Qc.prototype.unmount=Rp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;wo(function(){Yc(null,i,null,null)}),s[Un]=null}};function Qc(i){this._internalRoot=i}Qc.prototype.unstable_scheduleHydration=function(i){if(i){var s=ga();i={blockedOn:null,target:i,priority:s};for(var c=0;c<sn.length&&s!==0&&s<sn[c].priority;c++);sn.splice(c,0,i),c===0&&ya(i)}};function _p(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Jc(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function rb(){}function gA(i,s,c,f,g){if(g){if(typeof f=="function"){var b=f;f=function(){var J=Kc(_);b.call(J)}}var _=Z0(s,f,i,0,null,!1,!1,"",rb);return i._reactRootContainer=_,i[Un]=_.current,Ta(i.nodeType===8?i.parentNode:i),wo(),_}for(;g=i.lastChild;)i.removeChild(g);if(typeof f=="function"){var j=f;f=function(){var J=Kc(B);j.call(J)}}var B=Cp(i,0,!1,null,null,!1,!1,"",rb);return i._reactRootContainer=B,i[Un]=B.current,Ta(i.nodeType===8?i.parentNode:i),wo(function(){Yc(s,B,c,f)}),B}function Zc(i,s,c,f,g){var b=c._reactRootContainer;if(b){var _=b;if(typeof g=="function"){var j=g;g=function(){var B=Kc(_);j.call(B)}}Yc(s,_,i,g)}else _=gA(c,s,i,g,f);return Kc(_)}ha=function(i){switch(i.tag){case 3:var s=i.stateNode;if(s.current.memoizedState.isDehydrated){var c=mi(s.pendingLanes);c!==0&&(Ko(s,c|1),Sr(s,Ct()),(nt&6)===0&&(xs=Ct()+500,ki()))}break;case 13:wo(function(){var f=qn(i,1);if(f!==null){var g=pr();fn(f,i,1,g)}}),kp(i,1)}},Qo=function(i){if(i.tag===13){var s=qn(i,134217728);if(s!==null){var c=pr();fn(s,i,134217728,c)}kp(i,134217728)}},ma=function(i){if(i.tag===13){var s=Li(i),c=qn(i,s);if(c!==null){var f=pr();fn(c,i,s,f)}kp(i,s)}},ga=function(){return it},va=function(i,s){var c=it;try{return it=i,s()}finally{it=c}},ve=function(i,s,c){switch(s){case"input":if(De(i,c),s=c.name,c.type==="radio"&&s!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<c.length;s++){var f=c[s];if(f!==i&&f.form===i.form){var g=gc(f);if(!g)throw Error(r(90));Xe(f),De(f,g)}}}break;case"textarea":ht(i,c);break;case"select":s=c.value,s!=null&&oe(i,!!c.multiple,s,!1)}},Ht=yp,Zr=wo;var vA={usingClientEntryPoint:!1,Events:[Oa,as,gc,Ze,dt,yp]},Ga={findFiberByHostInstance:po,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yA={bundleType:Ga.bundleType,version:Ga.version,rendererPackageName:Ga.rendererPackageName,rendererConfig:Ga.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ca(i),i===null?null:i.stateNode},findFiberByHostInstance:Ga.findFiberByHostInstance||mA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eu.isDisabled&&eu.supportsFiber)try{io=eu.inject(yA),Ir=eu}catch{}}return Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vA,Er.createPortal=function(i,s){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_p(s))throw Error(r(200));return hA(i,s,null,c)},Er.createRoot=function(i,s){if(!_p(i))throw Error(r(299));var c=!1,f="",g=tb;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Cp(i,1,!1,null,null,c,!1,f,g),i[Un]=s.current,Ta(i.nodeType===8?i.parentNode:i),new Rp(s)},Er.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=ca(s),i=i===null?null:i.stateNode,i},Er.flushSync=function(i){return wo(i)},Er.hydrate=function(i,s,c){if(!Jc(s))throw Error(r(200));return Zc(null,i,s,!0,c)},Er.hydrateRoot=function(i,s,c){if(!_p(i))throw Error(r(405));var f=c!=null&&c.hydratedSources||null,g=!1,b="",_=tb;if(c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onRecoverableError!==void 0&&(_=c.onRecoverableError)),s=Z0(s,null,i,1,c??null,g,!1,b,_),i[Un]=s.current,Ta(i),f)for(i=0;i<f.length;i++)c=f[i],g=c._getVersion,g=g(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,g]:s.mutableSourceEagerHydrationData.push(c,g);return new Qc(s)},Er.render=function(i,s,c){if(!Jc(s))throw Error(r(200));return Zc(null,i,s,!1,c)},Er.unmountComponentAtNode=function(i){if(!Jc(i))throw Error(r(40));return i._reactRootContainer?(wo(function(){Zc(null,null,i,!1,function(){i._reactRootContainer=null,i[Un]=null})}),!0):!1},Er.unstable_batchedUpdates=yp,Er.unstable_renderSubtreeIntoContainer=function(i,s,c,f){if(!Jc(c))throw Error(r(200));if(i==null||i._reactInternals===void 0)throw Error(r(38));return Zc(i,s,c,!1,f)},Er.version="18.3.1-next-f1338f8080-20240426",Er}var Mb;function AE(){if(Mb)return Bp.exports;Mb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Bp.exports=oI(),Bp.exports}var zb;function sI(){if(zb)return hu;zb=1;var e=AE();return hu.createRoot=e.createRoot,hu.hydrateRoot=e.hydrateRoot,hu}var TE=sI();function aI(e,t){return Og(t),TE.hydrateRoot(t,e)}function lI(e,t){Og(t);var r=TE.createRoot(t);return r.render(e),r}function cI(e){return e.unmount(),!0}var Um=e=>{if(e!=null){var t=e.nodeType===1;if(t&&typeof e.getBoundingClientRect=="function")return e.getBoundingClientRect()}},al={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},uI=["ms","Moz","O","Webkit"],dI=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(al).forEach(e=>{uI.forEach(t=>{al[dI(t,e)]=al[e]})});function fI(e,t,r){var n=t==null||typeof t=="boolean"||t==="";return n?"":!r&&typeof t=="number"&&t!==0&&!(al.hasOwnProperty(e)&&al[e])?t+"px":(""+t).trim()}function pI(e,t){var r=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,a=fI(n,t[n],o);n==="float"&&(n="cssFloat"),o?r.setProperty(n,a):r[n]=a}}var Fb=e=>{var t=e.offsetHeight,r=e.offsetWidth,n=e.offsetLeft,o=e.offsetTop;for(e=e.offsetParent;e&&e.nodeType===1;)n+=e.offsetLeft+e.clientLeft-e.scrollLeft,o+=e.offsetTop+e.clientTop-e.scrollTop,e=e.offsetParent;return o-=window.scrollY,n-=window.scrollX,{width:r,height:t,top:o,left:n}},Bb=(e,t,r)=>{var n=t||e&&e.parentNode;e&&n&&setTimeout(()=>{if(e.isConnected&&n.isConnected){var o=Fb(n),a=Fb(e),l=a.height,u=a.left,d=a.top,p=a.width,h=u-o.left,m=d-o.top;r(h,m,p,l,u,d)}},0)},hI={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},Pu={blur(e){try{e.blur()}catch{}},focus(e){try{var t=e.nodeName;e.getAttribute("tabIndex")==null&&e.isContentEditable!==!0&&hI[t]==null&&e.setAttribute("tabIndex","-1"),e.focus()}catch{}},measure(e,t){Bb(e,null,t)},measureInWindow(e,t){e&&setTimeout(()=>{var r=Um(e),n=r.height,o=r.left,a=r.top,l=r.width;t(o,a,l,n)},0)},measureLayout(e,t,r,n){Bb(e,t,n)},updateView(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];switch(r){case"style":{pI(e,n);break}case"class":case"className":{e.setAttribute("class",n);break}case"text":case"value":e.value=n;break;default:e.setAttribute(r,n)}}},configureNextLayoutAnimation(e,t){t()},setLayoutAnimationEnabledExperimental(){}};function Vm(){return Vm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vm.apply(null,arguments)}var mI={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},gI={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},vI={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},yI={onBlur:!0,onFocus:!0},bI={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},xI={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},wI={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},SI={style:!0};function EI(e,t){var r={};for(var n in e)e.hasOwnProperty(n)&&t[n]===!0&&(r[n]=e[n]);return r}var Ub=zo?x.useLayoutEffect:x.useEffect,Wm="__reactLayoutHandler",Wp=null;function CI(){return zo&&typeof window.ResizeObserver<"u"&&Wp==null&&(Wp=new window.ResizeObserver(function(e){e.forEach(t=>{var r=t.target,n=r[Wm];typeof n=="function"&&Pu.measure(r,(o,a,l,u,d,p)=>{var h={nativeEvent:{layout:{x:o,y:a,width:l,height:u,left:d,top:p}},timeStamp:Date.now()};Object.defineProperty(h.nativeEvent,"target",{enumerable:!0,get:()=>t.target}),n(h)})})})),Wp}function kI(e,t){var r=CI();Ub(()=>{var n=e.current;n!=null&&(n[Wm]=t)},[e,t]),Ub(()=>{var n=e.current;return n!=null&&r!=null&&(typeof n[Wm]=="function"?r.observe(n):r.unobserve(n)),()=>{n!=null&&r!=null&&r.unobserve(n)}},[e,r])}function RI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(o){t.forEach(a=>{if(a!=null){if(typeof a=="function"){a(o);return}if(typeof a=="object"){a.current=o;return}console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(a))}})}}function _I(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return x.useMemo(()=>RI(...t),[...t])}var Vb=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():Object.freeze({});function $I(e){var t=x.useRef(Vb);return t.current===Vb&&(t.current=e()),t.current}function AI(e){e.pointerEvents,e.style;var t=$I(()=>r=>{r!=null&&(r.measure=n=>Pu.measure(r,n),r.measureLayout=(n,o,a)=>Pu.measureLayout(r,n,a,o),r.measureInWindow=n=>Pu.measureInWindow(r,n))});return t}var Wb=()=>{},TI={},LI=[];function Hb(e){return e>20?e%20:e}function LE(e,t){var r,n=!1,o,a,l=e.changedTouches,u=e.type,d=e.metaKey===!0,p=e.shiftKey===!0,h=l&&l[0].force||0,m=Hb(l&&l[0].identifier||0),y=l&&l[0].clientX||e.clientX,w=l&&l[0].clientY||e.clientY,E=l&&l[0].pageX||e.pageX,S=l&&l[0].pageY||e.pageY,C=typeof e.preventDefault=="function"?e.preventDefault.bind(e):Wb,R=e.timeStamp;function k(P){return Array.prototype.slice.call(P).map(I=>({force:I.force,identifier:Hb(I.identifier),get locationX(){return D(I.clientX)},get locationY(){return N(I.clientY)},pageX:I.pageX,pageY:I.pageY,target:I.target,timestamp:R}))}if(l!=null)o=k(l),a=k(e.touches);else{var $=[{force:h,identifier:m,get locationX(){return D(y)},get locationY(){return N(w)},pageX:E,pageY:S,target:e.target,timestamp:R}];o=$,a=u==="mouseup"||u==="dragstart"?LI:$}var A={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:e.defaultPrevented,dispatchConfig:TI,eventPhase:e.eventPhase,isDefaultPrevented(){return e.defaultPrevented},isPropagationStopped(){return n},isTrusted:e.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:d,shiftKey:p,changedTouches:o,force:h,identifier:m,get locationX(){return D(y)},get locationY(){return N(w)},pageX:E,pageY:S,target:e.target,timestamp:R,touches:a,type:u},persist:Wb,preventDefault:C,stopPropagation(){n=!0},target:e.target,timeStamp:R,touchHistory:t.touchHistory};function D(P){if(r=r||Um(A.currentTarget),r)return P-r.left}function N(P){if(r=r||Um(A.currentTarget),r)return P-r.top}return A}var II="mousedown",OI="mousemove",NI="mouseup",PI="dragstart",DI="touchstart",jI="touchmove",MI="touchend",zI="touchcancel",FI="scroll",BI="select",UI="selectionchange";function IE(e){return e===DI||e===II}function OE(e){return e===jI||e===OI}function NE(e){return e===MI||e===NI||PE(e)}function PE(e){return e===zI||e===PI}function VI(e){return e===FI}function WI(e){return e===BI||e===UI}function HI(){var e=window.getSelection(),t=e.toString(),r=e.anchorNode,n=e.focusNode,o=r&&r.nodeType===window.Node.TEXT_NODE||n&&n.nodeType===window.Node.TEXT_NODE;return t.length>=1&&t!==`
12
+ `&&o}var DE="__reactResponderId";function qI(e){if(e.type==="selectionchange"){var t=window.getSelection().anchorNode;return qb(t)}else{var r=e.composedPath!=null?e.composedPath():qb(e.target);return r}}function qb(e){for(var t=[];e!=null&&e!==document.body;)t.push(e),e=e.parentNode;return t}function GI(e){return e!=null?e[DE]:null}function XI(e,t){e!=null&&(e[DE]=t)}function YI(e){for(var t=[],r=[],n=qI(e),o=0;o<n.length;o++){var a=n[o],l=GI(a);l!=null&&(t.push(l),r.push(a))}return{idPath:t,nodePath:r}}function KI(e,t){var r=e.length,n=t.length;if(r===0||n===0||e[r-1]!==t[n-1])return null;var o=e[0],a=0,l=t[0],u=0;r-n>0&&(a=r-n,o=e[a],r=n),n-r>0&&(u=n-r,l=t[u],n=r);for(var d=r;d--;){if(o===l)return o;o=e[a++],l=t[u++]}return null}function QI(e,t){if(!t||t.length===0)return!1;for(var r=0;r<t.length;r++){var n=t[r].target;if(n!=null&&e.contains(n))return!0}return!1}function JI(e){return e.type==="selectionchange"?HI():e.type==="select"}function ZI(e){var t=e.altKey,r=e.button,n=e.buttons,o=e.ctrlKey,a=e.type,l=a==="touchstart"||a==="touchmove",u=a==="mousedown"&&(r===0||n===1),d=a==="mousemove"&&n===1,p=t===!1&&o===!1;return!!(l||u&&p||d&&p)}var Gb=20;function Kr(e){return e.timeStamp||e.timestamp}function e3(e){return{touchActive:!0,startPageX:e.pageX,startPageY:e.pageY,startTimeStamp:Kr(e),currentPageX:e.pageX,currentPageY:e.pageY,currentTimeStamp:Kr(e),previousPageX:e.pageX,previousPageY:e.pageY,previousTimeStamp:Kr(e)}}function t3(e,t){e.touchActive=!0,e.startPageX=t.pageX,e.startPageY=t.pageY,e.startTimeStamp=Kr(t),e.currentPageX=t.pageX,e.currentPageY=t.pageY,e.currentTimeStamp=Kr(t),e.previousPageX=t.pageX,e.previousPageY=t.pageY,e.previousTimeStamp=Kr(t)}function Pg(e){var t=e.identifier;return t==null&&console.error("Touch object is missing identifier."),t}function r3(e,t){var r=Pg(e),n=t.touchBank[r];n?t3(n,e):t.touchBank[r]=e3(e),t.mostRecentTimeStamp=Kr(e)}function n3(e,t){var r=t.touchBank[Pg(e)];r?(r.touchActive=!0,r.previousPageX=r.currentPageX,r.previousPageY=r.currentPageY,r.previousTimeStamp=r.currentTimeStamp,r.currentPageX=e.pageX,r.currentPageY=e.pageY,r.currentTimeStamp=Kr(e),t.mostRecentTimeStamp=Kr(e)):console.warn(`Cannot record touch move without a touch start.
13
+ `,"Touch Move: "+jE(e)+`
14
+ `,"Touch Bank: "+ME(t))}function i3(e,t){var r=t.touchBank[Pg(e)];r?(r.touchActive=!1,r.previousPageX=r.currentPageX,r.previousPageY=r.currentPageY,r.previousTimeStamp=r.currentTimeStamp,r.currentPageX=e.pageX,r.currentPageY=e.pageY,r.currentTimeStamp=Kr(e),t.mostRecentTimeStamp=Kr(e)):console.warn(`Cannot record touch end without a touch start.
15
+ `,"Touch End: "+jE(e)+`
16
+ `,"Touch Bank: "+ME(t))}function jE(e){return JSON.stringify({identifier:e.identifier,pageX:e.pageX,pageY:e.pageY,timestamp:Kr(e)})}function ME(e){var t=e.touchBank,r=JSON.stringify(t.slice(0,Gb));return t.length>Gb&&(r+=" (original size: "+t.length+")"),r}class o3{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(t,r){var n=this._touchHistory;if(OE(t))r.changedTouches.forEach(u=>n3(u,n));else if(IE(t))r.changedTouches.forEach(u=>r3(u,n)),n.numberActiveTouches=r.touches.length,n.numberActiveTouches===1&&(n.indexOfSingleActiveTouch=r.touches[0].identifier);else if(NE(t)&&(r.changedTouches.forEach(u=>i3(u,n)),n.numberActiveTouches=r.touches.length,n.numberActiveTouches===1))for(var o=n.touchBank,a=0;a<o.length;a++){var l=o[a];if(l!=null&&l.touchActive){n.indexOfSingleActiveTouch=a;break}}}get touchHistory(){return this._touchHistory}}var s3={},Xb=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],Yb=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],a3=["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}],l3={touchstart:Xb,mousedown:Xb,touchmove:Yb,mousemove:Yb,scroll:a3},Hm={id:null,idPath:null,node:null},Qu=new Map,Pi=!1,$n=0,In={id:null,node:null,idPath:null},qm=new o3;function fl(e){In=e}function pl(e){var t=Qu.get(e);return t??s3}function Hp(e){var t=e.type,r=e.target;if(t==="touchstart"&&(Pi=!0),(t==="touchmove"||$n>1)&&(Pi=!1),!(t==="mousedown"&&Pi||t==="mousemove"&&Pi||t==="mousemove"&&$n<1)){if(Pi&&t==="mouseup"){$n===0&&(Pi=!1);return}var n=IE(t)&&ZI(e),o=OE(t),a=NE(t),l=VI(t),u=WI(t),d=LE(e,qm);(n||o||a)&&(e.touches?$n=e.touches.length:n?$n=1:a&&($n=0),qm.recordTouchTrack(t,d.nativeEvent));var p=YI(e),h=!1,m;if(n||o||l&&$n>0){var y=In.idPath,w=p.idPath;if(y!=null&&w!=null){var E=KI(y,w);if(E!=null){var S=w.indexOf(E),C=S+(E===In.id?1:0);p={idPath:w.slice(C),nodePath:p.nodePath.slice(C)}}else p=null}p!=null&&(m=c3(p,e,d),m!=null&&(u3(d,m),h=!0))}if(In.id!=null&&In.node!=null){var R=In,k=R.id,$=R.node,A=pl(k),D=A.onResponderStart,N=A.onResponderMove,P=A.onResponderEnd,I=A.onResponderRelease,re=A.onResponderTerminate,Z=A.onResponderTerminationRequest;if(d.bubbles=!1,d.cancelable=!1,d.currentTarget=$,n)D!=null&&(d.dispatchConfig.registrationName="onResponderStart",D(d));else if(o)N!=null&&(d.dispatchConfig.registrationName="onResponderMove",N(d));else{var ee=PE(t)||t==="contextmenu"||t==="blur"&&r===window||t==="blur"&&r.contains($)&&e.relatedTarget!==$||l&&$n===0||l&&r.contains($)&&r!==$||u&&JI(e),ne=a&&!ee&&!QI($,e.touches);if(a&&P!=null&&(d.dispatchConfig.registrationName="onResponderEnd",P(d)),ne&&(I!=null&&(d.dispatchConfig.registrationName="onResponderRelease",I(d)),fl(Hm)),ee){var X=!0;(t==="contextmenu"||t==="scroll"||t==="selectionchange")&&(h?X=!1:Z!=null&&(d.dispatchConfig.registrationName="onResponderTerminationRequest",Z(d)===!1&&(X=!1))),X&&(re!=null&&(d.dispatchConfig.registrationName="onResponderTerminate",re(d)),fl(Hm),Pi=!1,$n=0)}}}}}function c3(e,t,r){var n=l3[t.type];if(n!=null){for(var o=e.idPath,a=e.nodePath,l=n[0],u=n[1],d=n[2].bubbles,p=function(N,P,I){var re=pl(N),Z=re[I];if(Z!=null&&(r.currentTarget=P,Z(r)===!0)){var ee=o.slice(o.indexOf(N));return{id:N,node:P,idPath:ee}}},h=o.length-1;h>=0;h--){var m=o[h],y=a[h],w=p(m,y,l);if(w!=null)return w;if(r.isPropagationStopped()===!0)return}if(d)for(var E=0;E<o.length;E++){var S=o[E],C=a[E],R=p(S,C,u);if(R!=null)return R;if(r.isPropagationStopped()===!0)return}else{var k=o[0],$=a[0],A=t.target;if(A===$)return p(k,$,u)}}}function u3(e,t){var r=In,n=r.id,o=r.node,a=t.id,l=t.node,u=pl(a),d=u.onResponderGrant,p=u.onResponderReject;if(e.bubbles=!1,e.cancelable=!1,e.currentTarget=l,n==null)d!=null&&(e.currentTarget=l,e.dispatchConfig.registrationName="onResponderGrant",d(e)),fl(t);else{var h=pl(n),m=h.onResponderTerminate,y=h.onResponderTerminationRequest,w=!0;y!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName="onResponderTerminationRequest",y(e)===!1&&(w=!1)),w?(m!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName="onResponderTerminate",m(e)),d!=null&&(e.currentTarget=l,e.dispatchConfig.registrationName="onResponderGrant",d(e)),fl(t)):p!=null&&(e.currentTarget=l,e.dispatchConfig.registrationName="onResponderReject",p(e))}}var d3=["blur","scroll"],f3=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"];function p3(){zo&&window.__reactResponderSystemActive==null&&(window.addEventListener("blur",Hp),f3.forEach(e=>{document.addEventListener(e,Hp)}),d3.forEach(e=>{document.addEventListener(e,Hp,!0)}),window.__reactResponderSystemActive=!0)}function h3(e,t,r){XI(t,e),Qu.set(e,r)}function Kb(e){In.id===e&&m3(),Qu.has(e)&&Qu.delete(e)}function m3(){var e=In,t=e.id,r=e.node;if(t!=null&&r!=null){var n=pl(t),o=n.onResponderTerminate;if(o!=null){var a=LE({},qm);a.currentTarget=r,o(a)}fl(Hm)}Pi=!1,$n=0}function g3(){return In.node}var v3={},y3=0;function b3(e){var t=x.useRef(null);return t.current==null&&(t.current=e()),t.current}function x3(e,t){t===void 0&&(t=v3);var r=b3(()=>y3++),n=x.useRef(!1);x.useEffect(()=>(p3(),()=>{Kb(r)}),[r]),x.useEffect(()=>{var o=t,a=o.onMoveShouldSetResponder,l=o.onMoveShouldSetResponderCapture,u=o.onScrollShouldSetResponder,d=o.onScrollShouldSetResponderCapture,p=o.onSelectionChangeShouldSetResponder,h=o.onSelectionChangeShouldSetResponderCapture,m=o.onStartShouldSetResponder,y=o.onStartShouldSetResponderCapture,w=a!=null||l!=null||u!=null||d!=null||p!=null||h!=null||m!=null||y!=null,E=e.current;w?(h3(r,E,t),n.current=!0):n.current&&(Kb(r),n.current=!1)},[t,e,r]),x.useDebugValue({isResponder:e.current===g3()}),x.useDebugValue(t)}var w3=x.createContext(!1),S3=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],E3=Object.assign({},mI,gI,vI,yI,bI,xI,wI,SI,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),C3=e=>EI(e,E3),Gm=x.forwardRef((e,t)=>{var r=e.hrefAttrs,n=e.onLayout,o=e.onMoveShouldSetResponder,a=e.onMoveShouldSetResponderCapture,l=e.onResponderEnd,u=e.onResponderGrant,d=e.onResponderMove,p=e.onResponderReject,h=e.onResponderRelease,m=e.onResponderStart,y=e.onResponderTerminate,w=e.onResponderTerminationRequest,E=e.onScrollShouldSetResponder,S=e.onScrollShouldSetResponderCapture,C=e.onSelectionChangeShouldSetResponder,R=e.onSelectionChangeShouldSetResponderCapture,k=e.onStartShouldSetResponder,$=e.onStartShouldSetResponderCapture,A=Sd(e,S3),D=x.useContext(w3),N=x.useRef(null),P=tI(),I=P.direction;kI(N,n),x3(N,{onMoveShouldSetResponder:o,onMoveShouldSetResponderCapture:a,onResponderEnd:l,onResponderGrant:u,onResponderMove:d,onResponderReject:p,onResponderRelease:h,onResponderStart:m,onResponderTerminate:y,onResponderTerminationRequest:w,onScrollShouldSetResponder:E,onScrollShouldSetResponderCapture:S,onSelectionChangeShouldSetResponder:C,onSelectionChangeShouldSetResponderCapture:R,onStartShouldSetResponder:k,onStartShouldSetResponderCapture:$});var re="div",Z=e.lang!=null?$E(e.lang):null,ee=e.dir||Z,ne=ee||I,X=C3(A);if(X.dir=ee,X.style=[Qb.view$raw,D&&Qb.inline,e.style],e.href!=null&&(re="a",r!=null)){var F=r.download,V=r.rel,H=r.target;F!=null&&(X.download=F),V!=null&&(X.rel=V),typeof H=="string"&&(X.target=H.charAt(0)!=="_"?"_"+H:H)}var O=AI(X),L=_I(N,O,t);return X.ref=L,rI(re,X,{writingDirection:ne})});Gm.displayName="View";var Qb=Rl.create({view$raw:{alignContent:"flex-start",alignItems:"stretch",backgroundColor:"transparent",border:"0 solid black",boxSizing:"border-box",display:"flex",flexBasis:"auto",flexDirection:"column",flexShrink:0,listStyle:"none",margin:0,minHeight:0,minWidth:0,padding:0,position:"relative",textDecoration:"none",zIndex:0},inline:{display:"inline-flex"}}),qp,Jb;function k3(){if(Jb)return qp;Jb=1;function e(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(!t){var l;if(r===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=0;l=new Error(r.replace(/%s/g,function(){return String(o[u++])})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}return qp=e,qp}var R3=k3();const Du=Qr(R3);var _3=x.createContext(null),Dg=x.forwardRef((e,t)=>{var r=e.children,n=e.WrapperComponent,o=x.createElement(Gm,{children:r,key:1,style:Zb.appContainer});return n&&(o=x.createElement(n,null,o)),x.createElement(_3.Provider,{value:e.rootTag},x.createElement(Gm,{ref:t,style:Zb.appContainer},o))});Dg.displayName="AppContainer";var Zb=Rl.create({appContainer:{flex:1,pointerEvents:"box-none"}});function $3(e,t,r,n){var o=n.hydrate,a=n.initialProps,l=n.rootTag,u=o?aI:lI;return Du(l,"Expect to have a valid rootTag, instead got ",l),u(Ee.createElement(Dg,{WrapperComponent:t,ref:r,rootTag:l},Ee.createElement(e,a)),l)}function A3(e,t,r){var n=Ee.createElement(Dg,{WrapperComponent:r,rootTag:{}},Ee.createElement(e,t)),o=a=>{var l=Rl.getSheet();return Ee.createElement("style",Vm({},a,{dangerouslySetInnerHTML:{__html:l.textContent},id:l.id}))};return{element:n,getStyleElement:o}}var ex={},Kn={},Gp=e=>e(),Ya;class hl{static getAppKeys(){return Object.keys(Kn)}static getApplication(t,r){return Du(Kn[t]&&Kn[t].getApplication,"Application "+t+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),Kn[t].getApplication(r)}static registerComponent(t,r){return Kn[t]={getApplication:n=>A3(Gp(r),n?n.initialProps:ex,Ya&&Ya(n)),run:n=>$3(Gp(r),Ya&&Ya(n),n.callback,{hydrate:n.hydrate||!1,initialProps:n.initialProps||ex,mode:n.mode||"concurrent",rootTag:n.rootTag})},t}static registerConfig(t){t.forEach(r=>{var n=r.appKey,o=r.component,a=r.run;a?hl.registerRunnable(n,a):(Du(o,"No component provider passed in"),hl.registerComponent(n,o))})}static registerRunnable(t,r){return Kn[t]={run:r},t}static runApplication(t,r){return Du(Kn[t]&&Kn[t].run,'Application "'+t+'" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'),Kn[t].run(r)}static setComponentProviderInstrumentationHook(t){Gp=t}static setWrapperComponentProvider(t){Ya=t}static unmountApplicationComponentAtRootTag(t){cI(t)}}var Lr=AE();const T3=Qr(Lr);var Xp={exports:{}},Ka={};var tx;function L3(){if(tx)return Ka;tx=1;var e=Ng(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,p){var h,m={},y=null,w=null;p!==void 0&&(y=""+p),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(w=d.ref);for(h in d)n.call(d,h)&&!a.hasOwnProperty(h)&&(m[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:t,type:u,key:y,ref:w,props:m,_owner:o.current}}return Ka.Fragment=r,Ka.jsx=l,Ka.jsxs=l,Ka}var rx;function I3(){return rx||(rx=1,Xp.exports=L3()),Xp.exports}var v=I3();const O3={en:{id:"en"}},N3=O3.en.id;function P3({prop:e,defaultProp:t,onChange:r}){const[n,o]=x.useState(e??t),a=e!==void 0,l=a?e:n,u=x.useRef(r);u.current=r;const d=x.useRef(l),p=x.useCallback(h=>{const m=typeof h=="function"?h(d.current):h;a||x.startTransition(()=>{o(m)}),u.current?.(m),d.current=m},[a]);return x.useEffect(()=>{e!==void 0&&(o(e),d.current=e)},[e]),[l,p]}function D3(e,t){if(Object.is(e,t))return!0;const r=e,n=t,o=Object.keys(r),a=Object.keys(n);return o.length!==a.length?!1:o.every(l=>Object.prototype.hasOwnProperty.call(n,l)&&Object.is(r[l],n[l]))}function Cd(e,t){const r=x.createContext(t),n=({children:a,value:l})=>{const u=x.useRef(l);return D3(u.current,l)||(u.current=l),v.jsx(r.Provider,{value:u.current,children:a})};n.displayName=e+"Provider";function o({consumerName:a,contextRequired:l}){const u=x.useContext(r);if(u)return u;if(l)throw new Error(`${a} must be used within ${e}`);return t||{}}return[n,o]}const[AV,j3]=Cd("Disabled",{disabled:!1}),Ks=({consumerName:e,contextRequired:t,mergeWith:r})=>{const n=j3({consumerName:e,contextRequired:t??!1});return!!(r?.disabled||n.disabled)},M3=(e,t)=>{let r=e;for(const n of t){if(r==null)return;r=r[n]}return r},z3=/\{\{\s*(\w+)\s*\}\}/g,F3=(e,t)=>t?e.replace(z3,(r,n)=>Object.hasOwn(t,n)?String(t[n]):r):e,B3=(e,t,r)=>{if(!e)return r;const n=e.toLowerCase().replaceAll("_","-"),o=a=>t.find(l=>l.toLowerCase()===a);return o(n)??o(n.split("-")[0])??r},nx=(e,t)=>{const r=M3(e??{},t.split("."));return typeof r=="string"?r:void 0},U3=({dictionaries:e,defaultLocale:t,fallbackLocale:r=t})=>{const n=Object.keys(e),o=(d,p,h)=>{const m=nx(e[d],p)??nx(e[r],p)??p;return F3(m,h)},a=d=>({locale:d,t:(p,h)=>o(d,p,h)}),l=x.createContext({locale:t,t:d=>d}),u=({locale:d,children:p})=>{const h=B3(d,n,t),m=x.useMemo(()=>a(h),[h]);return v.jsx(l.Provider,{value:m,children:p})};return u.displayName="TranslationsProvider",{TranslationsProvider:u,useTranslations:()=>x.useContext(l),translate:o}},V3={closeAriaLabel:"Schließen"},W3={addressInput:{qrCodeAriaLabel:"QR-Code scannen"},amountDisplay:{amountHiddenAriaLabel:"Betrag ausgeblendet"},avatar:{defaultAriaLabel:"Benutzer-Avatar"},baseInput:{clearInputAriaLabel:"Eingabe löschen"},spinner:{loadingAriaLabel:"Wird geladen"},dialogHeader:{goBackAriaLabel:"Zurück",closeAriaLabel:"Schließen"},banner:{closeAriaLabel:"Schließen"},link:{opensInNewTabAriaLabel:"(Öffnet in neuem Tab)"},navBar:{goBackAriaLabel:"Zurück"},sideBar:{navigationAriaLabel:"Seitenleistennavigation",collapseAriaLabel:"Seitenleiste ausblenden",expandAriaLabel:"Seitenleiste anzeigen"},stepper:{progressAriaLabel:"Schritt {{currentStep}} von {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},H3={common:V3,components:W3},q3={closeAriaLabel:"Close"},G3={addressInput:{qrCodeAriaLabel:"Scan QR code"},amountDisplay:{amountHiddenAriaLabel:"Amount hidden"},avatar:{defaultAriaLabel:"User avatar"},baseInput:{clearInputAriaLabel:"Clear input"},spinner:{loadingAriaLabel:"Loading"},dialogHeader:{goBackAriaLabel:"Go back",closeAriaLabel:"Close"},banner:{closeAriaLabel:"Close"},link:{opensInNewTabAriaLabel:"(opens in a new tab)"},navBar:{goBackAriaLabel:"Go back"},sideBar:{navigationAriaLabel:"Sidebar navigation",collapseAriaLabel:"Collapse sidebar",expandAriaLabel:"Expand sidebar"},stepper:{progressAriaLabel:"Step {{currentStep}} of {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"},chart:{emptyLabel:"No data",loadingAriaLabel:"Loading chart",defaultAriaLabel:"Chart"},select:{searchPlaceholder:"Search"},subheader:{moreInfoAriaLabel:"More information"}},X3={common:q3,components:G3},Y3={closeAriaLabel:"Cerrar"},K3={addressInput:{qrCodeAriaLabel:"Escanear código QR"},amountDisplay:{amountHiddenAriaLabel:"Importe oculto"},avatar:{defaultAriaLabel:"Avatar de usuario"},baseInput:{clearInputAriaLabel:"Borrar entrada"},spinner:{loadingAriaLabel:"Cargando"},dialogHeader:{goBackAriaLabel:"Volver",closeAriaLabel:"Cerrar"},banner:{closeAriaLabel:"Cerrar"},link:{opensInNewTabAriaLabel:"(se abre en una pestaña nueva)"},navBar:{goBackAriaLabel:"Volver"},sideBar:{navigationAriaLabel:"Navegación de barra lateral",collapseAriaLabel:"Colapsar barra lateral",expandAriaLabel:"Expandir barra lateral"},stepper:{progressAriaLabel:"Paso {{currentStep}} de {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},Q3={common:Y3,components:K3},J3={closeAriaLabel:"Fermer"},Z3={addressInput:{qrCodeAriaLabel:"Scanner le code QR"},amountDisplay:{amountHiddenAriaLabel:"Montant masqué"},avatar:{defaultAriaLabel:"Avatar de l'utilisateur"},baseInput:{clearInputAriaLabel:"Effacer la saisie"},spinner:{loadingAriaLabel:"Chargement"},dialogHeader:{goBackAriaLabel:"Retour",closeAriaLabel:"Fermer"},banner:{closeAriaLabel:"Fermer"},link:{opensInNewTabAriaLabel:"(s'ouvre dans un nouvel onglet)"},navBar:{goBackAriaLabel:"Retour"},sideBar:{navigationAriaLabel:"Menu de navigation latéral",collapseAriaLabel:"Réduire la barre latérale",expandAriaLabel:"Développer la barre latérale"},stepper:{progressAriaLabel:"Étape {{currentStep}} sur {{totalSteps}}"},table:{ascAriaLabel:"Trier par ordre croissant",descAriaLabel:"Trier par ordre décroissant"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},eO={common:J3,components:Z3},tO={closeAriaLabel:"閉じる"},rO={addressInput:{qrCodeAriaLabel:"QRコードをスキャン"},amountDisplay:{amountHiddenAriaLabel:"金額非表示"},avatar:{defaultAriaLabel:"ユーザーアバター"},baseInput:{clearInputAriaLabel:"インプットを削除"},spinner:{loadingAriaLabel:"読み込み中"},dialogHeader:{goBackAriaLabel:"戻る",closeAriaLabel:"閉じる"},banner:{closeAriaLabel:"閉じる"},link:{opensInNewTabAriaLabel:"(新しいタブで開く)"},navBar:{goBackAriaLabel:"戻る"},sideBar:{navigationAriaLabel:"サイドバーナビゲーション",collapseAriaLabel:"サイドバーを閉じる",expandAriaLabel:"サイドバーを開く"},stepper:{progressAriaLabel:"ステップ{{currentStep}}/{{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},nO={common:tO,components:rO},iO={closeAriaLabel:"닫기"},oO={addressInput:{qrCodeAriaLabel:"QR 코드 스캔"},amountDisplay:{amountHiddenAriaLabel:"금액 숨김"},avatar:{defaultAriaLabel:"사용자 아바타"},baseInput:{clearInputAriaLabel:"입력 값 지우기"},spinner:{loadingAriaLabel:"로딩중"},dialogHeader:{goBackAriaLabel:"돌아가기",closeAriaLabel:"닫기"},banner:{closeAriaLabel:"닫기"},link:{opensInNewTabAriaLabel:"(새 탭에서 열기)"},navBar:{goBackAriaLabel:"돌아가기"},sideBar:{navigationAriaLabel:"사이드바 탐색",collapseAriaLabel:"사이드바 접기",expandAriaLabel:"사이드바 펼치기"},stepper:{progressAriaLabel:"{{totalSteps}} 중 {{currentStep}} 단계"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},sO={common:iO,components:oO},aO={closeAriaLabel:"Fechar"},lO={addressInput:{qrCodeAriaLabel:"Escanear QR Code"},amountDisplay:{amountHiddenAriaLabel:"Valor oculto"},avatar:{defaultAriaLabel:"Avatar do usuário"},baseInput:{clearInputAriaLabel:"Limpar input"},spinner:{loadingAriaLabel:"Carregando"},dialogHeader:{goBackAriaLabel:"Voltar",closeAriaLabel:"Fechar"},banner:{closeAriaLabel:"Fechar"},link:{opensInNewTabAriaLabel:"(abre em uma nova aba)"},navBar:{goBackAriaLabel:"Voltar"},sideBar:{navigationAriaLabel:"Barra de navegação lateral",collapseAriaLabel:"Recolher barra lateral",expandAriaLabel:"Expandir barra lateral"},stepper:{progressAriaLabel:"Passo {{currentStep}} de {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},cO={common:aO,components:lO},uO={closeAriaLabel:"Закрыть"},dO={addressInput:{qrCodeAriaLabel:"Сканировать QR-код"},amountDisplay:{amountHiddenAriaLabel:"Сумма скрыта"},avatar:{defaultAriaLabel:"Аватар пользователя"},baseInput:{clearInputAriaLabel:"Очистить поле"},spinner:{loadingAriaLabel:"Загрузка"},dialogHeader:{goBackAriaLabel:"Назад",closeAriaLabel:"Закрыть"},banner:{closeAriaLabel:"Закрыть"},link:{opensInNewTabAriaLabel:"(открывается в новой вкладке)"},navBar:{goBackAriaLabel:"Назад"},sideBar:{navigationAriaLabel:"Боковое меню",collapseAriaLabel:"Скрыть боковое меню",expandAriaLabel:"Показать боковое меню"},stepper:{progressAriaLabel:"Шаг {{currentStep}} из {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},fO={common:uO,components:dO},pO={closeAriaLabel:"ปิด"},hO={addressInput:{qrCodeAriaLabel:"สแกน QR Code"},amountDisplay:{amountHiddenAriaLabel:"ยอดเงินถูกซ่อน"},avatar:{defaultAriaLabel:"อวาตาร์ผู้ใช้"},baseInput:{clearInputAriaLabel:"ล้างอินพุต"},spinner:{loadingAriaLabel:"กำลังโหลด"},dialogHeader:{goBackAriaLabel:"ย้อนกลับ",closeAriaLabel:"ปิด"},banner:{closeAriaLabel:"ปิด"},link:{opensInNewTabAriaLabel:"(เปิดในแท็บใหม่)"},navBar:{goBackAriaLabel:"ย้อนกลับ"},sideBar:{navigationAriaLabel:"เมนูนำทางด้านข้าง",collapseAriaLabel:"ซ่อนแถบด้านข้าง",expandAriaLabel:"เปิดแถบด้านข้าง"},stepper:{progressAriaLabel:"ขั้นตอนที่ {{currentStep}} จาก {{totalSteps}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},mO={common:pO,components:hO},gO={closeAriaLabel:"Kapat"},vO={addressInput:{qrCodeAriaLabel:"Karekodu okut"},amountDisplay:{amountHiddenAriaLabel:"Tutar gizlendi"},avatar:{defaultAriaLabel:"Kullanıcı avatarı"},baseInput:{clearInputAriaLabel:"Girdiyi temizle"},spinner:{loadingAriaLabel:"Yükleniyor"},dialogHeader:{goBackAriaLabel:"Geri dön",closeAriaLabel:"Kapat"},banner:{closeAriaLabel:"Kapat"},link:{opensInNewTabAriaLabel:"(yeni sekmede açılır)"},navBar:{goBackAriaLabel:"Geri dön"},sideBar:{navigationAriaLabel:"Kenar çubuğu menüsü",collapseAriaLabel:"Kenar çubuğunu daralt",expandAriaLabel:"Kenar çubuğunu genişlet"},stepper:{progressAriaLabel:"Adım {{totalSteps}} / {{currentStep}}"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},yO={common:gO,components:vO},bO={closeAriaLabel:"关闭"},xO={addressInput:{qrCodeAriaLabel:"扫描二维码"},amountDisplay:{amountHiddenAriaLabel:"金额已隐藏"},avatar:{defaultAriaLabel:"用户头像"},baseInput:{clearInputAriaLabel:"清空输入框"},spinner:{loadingAriaLabel:"加载中"},dialogHeader:{goBackAriaLabel:"返回",closeAriaLabel:"关闭"},banner:{closeAriaLabel:"关闭"},link:{opensInNewTabAriaLabel:"(在新选项卡中打开)"},navBar:{goBackAriaLabel:"返回"},sideBar:{navigationAriaLabel:"侧边栏导航",collapseAriaLabel:"折叠侧边栏",expandAriaLabel:"展开侧边栏"},stepper:{progressAriaLabel:"第 {{currentStep}} / {{totalSteps}} 步"},table:{ascAriaLabel:"Sort ascending",descAriaLabel:"Sort descending"},pagination:{navigationAriaLabel:"Pagination",previousPageAriaLabel:"Previous page",nextPageAriaLabel:"Next page",pageAriaLabel:"Page {{page}}"},trend:{positiveAriaLabel:"Trend up {{value}}",negativeAriaLabel:"Trend down {{value}}",neutralAriaLabel:"Neutral trend {{value}}"}},wO={common:bO,components:xO},SO={de:H3,en:X3,es:Q3,fr:eO,ja:nO,ko:sO,pt:cO,ru:fO,th:mO,tr:yO,zh:wO},{TranslationsProvider:EO,useTranslations:zE}=U3({dictionaries:SO,defaultLocale:N3});function FE(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=FE(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function BE(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=FE(e))&&(n&&(n+=" "),n+=t);return n}const CO=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},kO=(e,t)=>({classGroupId:e,validator:t}),UE=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Ju="-",ix=[],RO="arbitrary..",_O=e=>{const t=AO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return $O(l);const u=l.split(Ju),d=u[0]===""&&u.length>1?1:0;return VE(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=n[l],p=r[l];return d?p?CO(p,d):d:p||ix}return r[l]||ix}}},VE=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],a=r.nextPart.get(o);if(a){const p=VE(e,t+1,a);if(p)return p}const l=r.validators;if(l===null)return;const u=t===0?e.join(Ju):e.slice(t).join(Ju),d=l.length;for(let p=0;p<d;p++){const h=l[p];if(h.validator(u))return h.classGroupId}},$O=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?RO+n:void 0})(),AO=e=>{const{theme:t,classGroups:r}=e;return TO(r,t)},TO=(e,t)=>{const r=UE();for(const n in e){const o=e[n];jg(o,r,n,t)}return r},jg=(e,t,r,n)=>{const o=e.length;for(let a=0;a<o;a++){const l=e[a];LO(l,t,r,n)}},LO=(e,t,r,n)=>{if(typeof e=="string"){IO(e,t,r);return}if(typeof e=="function"){OO(e,t,r,n);return}NO(e,t,r,n)},IO=(e,t,r)=>{const n=e===""?t:WE(t,e);n.classGroupId=r},OO=(e,t,r,n)=>{if(PO(e)){jg(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(kO(r,e))},NO=(e,t,r,n)=>{const o=Object.entries(e),a=o.length;for(let l=0;l<a;l++){const[u,d]=o[l];jg(d,WE(t,u),r,n)}},WE=(e,t)=>{let r=e;const n=t.split(Ju),o=n.length;for(let a=0;a<o;a++){const l=n[a];let u=r.nextPart.get(l);u||(u=UE(),r.nextPart.set(l,u)),r=u}return r},PO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,DO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(a,l)=>{r[a]=l,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let l=r[a];if(l!==void 0)return l;if((l=n[a])!==void 0)return o(a,l),l},set(a,l){a in r?r[a]=l:o(a,l)}}},Xm="!",ox=":",jO=[],sx=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),MO=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const a=[];let l=0,u=0,d=0,p;const h=o.length;for(let S=0;S<h;S++){const C=o[S];if(l===0&&u===0){if(C===ox){a.push(o.slice(d,S)),d=S+1;continue}if(C==="/"){p=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const m=a.length===0?o:o.slice(d);let y=m,w=!1;m.endsWith(Xm)?(y=m.slice(0,-1),w=!0):m.startsWith(Xm)&&(y=m.slice(1),w=!0);const E=p&&p>d?p-d:void 0;return sx(a,w,y,E)};if(t){const o=t+ox,a=n;n=l=>l.startsWith(o)?a(l.slice(o.length)):sx(jO,!1,l,void 0,!0)}if(r){const o=n;n=a=>r({className:a,parseClassName:o})}return n},zO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let a=0;a<r.length;a++){const l=r[a],u=l[0]==="[",d=t.has(l);u||d?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(l)):o.push(l)}return o.length>0&&(o.sort(),n.push(...o)),n}},FO=e=>({cache:DO(e.cacheSize),parseClassName:MO(e),sortModifiers:zO(e),postfixLookupClassGroupIds:BO(e),..._O(e)}),BO=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},UO=/\s+/,VO=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:l}=t,u=[],d=e.trim().split(UO);let p="";for(let h=d.length-1;h>=0;h-=1){const m=d[h],{isExternal:y,modifiers:w,hasImportantModifier:E,baseClassName:S,maybePostfixModifierPosition:C}=r(m);if(y){p=m+(p.length>0?" "+p:p);continue}let R=!!C,k;if(R){const P=S.substring(0,C);k=n(P);const I=k&&l[k]?n(S):void 0;I&&I!==k&&(k=I,R=!1)}else k=n(S);if(!k){if(!R){p=m+(p.length>0?" "+p:p);continue}if(k=n(S),!k){p=m+(p.length>0?" "+p:p);continue}R=!1}const $=w.length===0?"":w.length===1?w[0]:a(w).join(":"),A=E?$+Xm:$,D=A+k;if(u.indexOf(D)>-1)continue;u.push(D);const N=o(k,R);for(let P=0;P<N.length;++P){const I=N[P];u.push(A+I)}p=m+(p.length>0?" "+p:p)}return p},WO=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=HE(r))&&(o&&(o+=" "),o+=n);return o},HE=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=HE(e[n]))&&(r&&(r+=" "),r+=t);return r},ax=(e,...t)=>{let r,n,o,a;const l=d=>{const p=t.reduce((h,m)=>m(h),e());return r=FO(p),n=r.cache.get,o=r.cache.set,a=u,u(d)},u=d=>{const p=n(d);if(p)return p;const h=VO(d,r);return o(d,h),h};return a=l,(...d)=>a(WO(...d))},HO=[],Xt=e=>{const t=r=>r[e]||HO;return t.isThemeGetter=!0,t.themeKey=e,t},qE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,GO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,YO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,KO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>qO.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),mn=e=>!!e&&Number.isInteger(Number(e)),ju=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),An=e=>GO.test(e),Mg=()=>!0,JO=e=>XO.test(e)&&!YO.test(e),zg=()=>!1,ZO=e=>KO.test(e),eN=e=>QO.test(e),XE=e=>!Re(e)&&!_e(e),YE=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),KE=e=>Xi(e,sC,zg),Re=e=>qE.test(e),Di=e=>Xi(e,aC,JO),Ym=e=>Xi(e,tN,Ge),QE=e=>Xi(e,cC,Mg),JE=e=>Xi(e,lC,zg),Km=e=>Xi(e,iC,zg),ZE=e=>Xi(e,oC,eN),tl=e=>Xi(e,uC,ZO),_e=e=>GE.test(e),Rs=e=>Fo(e,aC),eC=e=>Fo(e,lC),Qm=e=>Fo(e,iC),tC=e=>Fo(e,sC),rC=e=>Fo(e,oC),rl=e=>Fo(e,uC,!0),nC=e=>Fo(e,cC,!0),Xi=(e,t,r)=>{const n=qE.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Fo=(e,t,r=!1)=>{const n=GE.exec(e);return n?n[1]?t(n[1]):r:!1},iC=e=>e==="position"||e==="percentage",oC=e=>e==="image"||e==="url",sC=e=>e==="length"||e==="size"||e==="bg-size",aC=e=>e==="length",tN=e=>e==="number",lC=e=>e==="family-name",cC=e=>e==="number"||e==="weight",uC=e=>e==="shadow",Yp=Object.defineProperty({__proto__:null,isAny:Mg,isAnyNonArbitrary:XE,isArbitraryFamilyName:JE,isArbitraryImage:ZE,isArbitraryLength:Di,isArbitraryNumber:Ym,isArbitraryPosition:Km,isArbitraryShadow:tl,isArbitrarySize:KE,isArbitraryValue:Re,isArbitraryVariable:_e,isArbitraryVariableFamilyName:eC,isArbitraryVariableImage:rC,isArbitraryVariableLength:Rs,isArbitraryVariablePosition:Qm,isArbitraryVariableShadow:rl,isArbitraryVariableSize:tC,isArbitraryVariableWeight:nC,isArbitraryWeight:QE,isFraction:Jn,isInteger:mn,isNamedContainerQuery:YE,isNumber:Ge,isPercent:ju,isTshirtSize:An},Symbol.toStringTag,{value:"Module"}),lx=()=>{const e=Xt("color"),t=Xt("font"),r=Xt("text"),n=Xt("font-weight"),o=Xt("tracking"),a=Xt("leading"),l=Xt("breakpoint"),u=Xt("container"),d=Xt("spacing"),p=Xt("radius"),h=Xt("shadow"),m=Xt("inset-shadow"),y=Xt("text-shadow"),w=Xt("drop-shadow"),E=Xt("blur"),S=Xt("perspective"),C=Xt("aspect"),R=Xt("ease"),k=Xt("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...A(),_e,Re],N=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],I=()=>[_e,Re,d],re=()=>[Jn,"full","auto",...I()],Z=()=>[mn,"none","subgrid",_e,Re],ee=()=>["auto",{span:["full",mn,_e,Re]},mn,_e,Re],ne=()=>[mn,"auto",_e,Re],X=()=>["auto","min","max","fr",_e,Re],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...I()],O=()=>[Jn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],L=()=>[u,Jn,"screen","full","dvw","lvw","svw","min","max","fit",...I()],U=()=>[Jn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],z=()=>[e,_e,Re],T=()=>[...A(),Qm,Km,{position:[_e,Re]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",tC,KE,{size:[_e,Re]}],le=()=>[ju,Rs,Di],G=()=>["","none","full",p,_e,Re],fe=()=>["",Ge,Rs,Di],be=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Ge,ju,Qm,Km],ge=()=>["","none",E,_e,Re],qe=()=>["none",Ge,_e,Re],Xe=()=>["none",Ge,_e,Re],we=()=>[Ge,_e,Re],ze=()=>[Jn,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[An],breakpoint:[An],color:[Mg],container:[An],"drop-shadow":[An],ease:["in","out","in-out"],font:[XE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[An],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[An],shadow:[An],spacing:["px",Ge],text:[An],"text-shadow":[An],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jn,Re,_e,C]}],container:["container"],"container-type":[{"@container":["","normal","size",_e,Re]}],"container-named":[YE],columns:[{columns:[Ge,"auto",Re,_e,u]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[mn,"auto",_e,Re]}],basis:[{basis:[Jn,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,Jn,"auto","initial","none",Re]}],grow:[{grow:["",Ge,_e,Re]}],shrink:[{shrink:["",Ge,_e,Re]}],order:[{order:[mn,"first","last","none",_e,Re]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[u,"screen",...O()]}],"min-w":[{"min-w":[u,"screen","none",...O()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh","none",...O()]}],"font-size":[{text:["base",r,Rs,Di]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,nC,QE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ju,Re]}],"font-family":[{font:[eC,JE,t]}],"font-features":[{"font-features":[Re]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,_e,Re]}],"line-clamp":[{"line-clamp":[Ge,"none",_e,Ym]}],leading:[{leading:["none",a,...I()]}],"list-image":[{"list-image":["none",_e,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",_e,Di]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ge,"auto",_e,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[mn,_e,Re]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_e,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mn,_e,Re],radial:["",_e,Re],conic:["",mn,_e,Re]},rC,ZE]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,_e,Re]}],"outline-w":[{outline:["",Ge,Rs,Di]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","inner","none",h,rl,tl]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",m,rl,tl]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ge,Di]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",y,rl,tl]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ge,_e,Re]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[_e,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Re]}],filter:[{filter:["","none",_e,Re]}],blur:[{blur:ge()}],brightness:[{brightness:[Ge,_e,Re]}],contrast:[{contrast:[Ge,_e,Re]}],"drop-shadow":[{"drop-shadow":["","none",w,rl,tl]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ge,_e,Re]}],"hue-rotate":[{"hue-rotate":[Ge,_e,Re]}],invert:[{invert:["",Ge,_e,Re]}],saturate:[{saturate:[Ge,_e,Re]}],sepia:[{sepia:["",Ge,_e,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Re]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,_e,Re]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,_e,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,_e,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,_e,Re]}],"backdrop-invert":[{"backdrop-invert":["",Ge,_e,Re]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,_e,Re]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,_e,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,_e,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",_e,Re]}],ease:[{ease:["linear","initial",R,_e,Re]}],delay:[{delay:[Ge,_e,Re]}],animate:[{animate:["none",k,_e,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,_e,Re]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:qe()}],"rotate-x":[{"rotate-x":qe()}],"rotate-y":[{"rotate-y":qe()}],"rotate-z":[{"rotate-z":qe()}],scale:[{scale:Xe()}],"scale-x":[{"scale-x":Xe()}],"scale-y":[{"scale-y":Xe()}],"scale-z":[{"scale-z":Xe()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[_e,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[mn,_e,Re]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_e,Re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_e,Re]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ge,Rs,Di,Ym]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},rN=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:o={},override:a={}})=>(_s(e,"cacheSize",t),_s(e,"prefix",r),_s(e,"experimentalParseClassName",n),mu(e.theme,a.theme),mu(e.classGroups,a.classGroups),mu(e.conflictingClassGroups,a.conflictingClassGroups),mu(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),_s(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),_s(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),gu(e.theme,o.theme),gu(e.classGroups,o.classGroups),gu(e.conflictingClassGroups,o.conflictingClassGroups),gu(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Jm(e,o,"postfixLookupClassGroups"),Jm(e,o,"orderSensitiveModifiers"),e),_s=(e,t,r)=>{r!==void 0&&(e[t]=r)},mu=(e,t)=>{if(t)for(const r in t)_s(e,r,t[r])},gu=(e,t)=>{if(t)for(const r in t)Jm(e,t,r)},Jm=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},nN=(e,...t)=>typeof e=="function"?ax(lx,e,...t):ax(()=>rN(lx(),e),...t),cx=e=>e.flatMap(t=>[`${t}`,`${t}-semi-bold`]),Kp=(e,t)=>Array.from({length:t-e+1},(r,n)=>e+n),iN=e=>/^(overlay-)?\d+$/.test(e),oN=nN({override:{classGroups:{"font-size":[{text:[Yp.isTshirtSize,Yp.isArbitraryVariableLength,Yp.isArbitraryLength]}]}},extend:{theme:{radius:["xxs"]},classGroups:{typography:[{"responsive-display":Kp(1,4).map(String),heading:cx(Kp(0,5)),body:cx(Kp(1,4))}],"bg-image":[{bg:[{gradient:[e=>!iN(e)]}]}]},conflictingClassGroups:{typography:["font-size","font-weight","font-family","leading","tracking"]}}});function Qt(...e){return oN(BE(e))}const ux=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dx=BE,kr=(e,t)=>r=>{var n;if(t?.variants==null)return dx(e,r?.class,r?.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(p=>{const h=r?.[p],m=a?.[p];if(h===null)return null;const y=ux(h)||ux(m);return o[p][y]}),u=r&&Object.entries(r).reduce((p,h)=>{let[m,y]=h;return y===void 0||(p[m]=y),p},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((p,h)=>{let{class:m,className:y,...w}=h;return Object.entries(w).every(E=>{let[S,C]=E;return Array.isArray(C)?C.includes({...a,...u}[S]):{...a,...u}[S]===C})?[...p,m,y]:p},[]);return dx(e,l,d,r?.class,r?.className)},sN=kr("inline-block shrink-0",{variants:{size:{12:"icon-h-12 icon-w-12 icon-stroke-12",16:"icon-h-16 icon-w-16 icon-stroke-16",20:"icon-h-20 icon-w-20 icon-stroke-20",32:"icon-h-32 icon-w-32 icon-stroke-32",24:"icon-h-24 icon-w-24 icon-stroke-24",40:"icon-h-40 icon-w-40 icon-stroke-40",48:"icon-h-48 icon-w-48 icon-stroke-48",56:"icon-h-56 icon-w-56 icon-stroke-56"}},defaultVariants:{size:24}}),aN=({ref:e,size:t=24,className:r="",children:n,viewBox:o,xmlns:a,...l})=>x.createElement("svg",{ref:e,fill:"none","aria-hidden":"true",xmlns:a,viewBox:o,className:Qt(sN({size:t}),"inline-block",r),...l},n),pt=(e,t)=>{const r=({ref:n,className:o,disabled:a,...l})=>{const u=Ks({consumerName:e,mergeWith:{disabled:a}});return x.createElement(aN,{ref:n,className:Qt(o,u&&"text-disabled"),viewBox:t.props.viewBox,...l,children:t.props.children})};return r.displayName=e,r},lN=pt("InformationFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M8 1.35a6.65 6.65 0 0 1 0 13.3A6.646 6.646 0 0 1 1.35 8c0-3.679 2.978-6.65 6.65-6.65m0 6a.65.65 0 0 0-.65.65v3.333a.65.65 0 1 0 1.3 0V8A.65.65 0 0 0 8 7.35m-.01-2.666-.003-.001-.009.001a.814.814 0 0 0-.797.732l-.005.084.005.08c.04.395.373.737.813.737.242 0 .443-.11.575-.241A.82.82 0 0 0 8.81 5.5.82.82 0 0 0 8 4.684l-.006-.001zm-.003 1.3L7.9 5.975l-.002-.001c.03.004.059.01.089.01"})})),cN=pt("DeleteCircleFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.5 8c0-3.596 2.91-6.5 6.5-6.5a6.5 6.5 0 1 1 0 13c-3.596 0-6.5-2.91-6.5-6.5m4.967-2.24a.5.5 0 0 0-.707.707L7.293 8 5.76 9.533a.5.5 0 0 0 .707.707L8 8.707l1.533 1.533a.5.5 0 0 0 .707-.707L8.707 8l1.533-1.533a.5.5 0 0 0-.707-.707L8 7.293z",clipRule:"evenodd"})})),uN=pt("CheckmarkCircleFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M8.001 1.35a6.65 6.65 0 1 1-.003 13.301A6.65 6.65 0 0 1 8.001 1.35m2.795 4.58a.67.67 0 0 0-.944 0L7.064 8.718l-.963-.962a.666.666 0 1 0-.943.942l1.444 1.445a.67.67 0 0 0 1.027-.105l3.167-3.164a.667.667 0 0 0 0-.942"})}));function ti(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function fx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fg(...e){return t=>{let r=!1;const n=e.map(o=>{const a=fx(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():fx(e[o],null)}}}}function Bo(...e){return x.useCallback(Fg(...e),e)}function dC(e,t=[]){let r=[];function n(a,l){const u=x.createContext(l),d=r.length;r=[...r,l];const p=m=>{const{scope:y,children:w,...E}=m,S=y?.[e]?.[d]||u,C=x.useMemo(()=>E,Object.values(E));return v.jsx(S.Provider,{value:C,children:w})};p.displayName=a+"Provider";function h(m,y){const w=y?.[e]?.[d]||u,E=x.useContext(w);if(E)return E;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[p,h]}const o=()=>{const a=r.map(l=>x.createContext(l));return function(u){const d=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return o.scopeName=e,[n,dN(o,...t)]}function dN(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const l=n.reduce((u,{useScope:d,scopeName:p})=>{const m=d(a)[`__scope${p}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function fN(e){const t=pN(e),r=x.forwardRef((n,o)=>{const{children:a,...l}=n,u=x.Children.toArray(a),d=u.find(mN);if(d){const p=d.props.children,h=u.map(m=>m===d?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:m);return v.jsx(t,{...l,ref:o,children:x.isValidElement(p)?x.cloneElement(p,void 0,h):null})}return v.jsx(t,{...l,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function pN(e){const t=x.forwardRef((r,n)=>{const{children:o,...a}=r;if(x.isValidElement(o)){const l=vN(o),u=gN(a,o.props);return o.type!==x.Fragment&&(u.ref=n?Fg(n,l):l),x.cloneElement(o,u)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fC=Symbol("radix.slottable");function hN(e){const t=({children:r})=>v.jsx(v.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=fC,t}function mN(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fC}function gN(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...u)=>{const d=a(...u);return o(...u),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function vN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var yN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yi=yN.reduce((e,t)=>{const r=fN(`Primitive.${t}`),n=x.forwardRef((o,a)=>{const{asChild:l,...u}=o,d=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(d,{...u,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function bN(e,t){e&&Lr.flushSync(()=>e.dispatchEvent(t))}function kd(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function xN(e,t=globalThis?.document){const r=kd(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var wN="DismissableLayer",Zm="dismissableLayer.update",SN="dismissableLayer.pointerDownOutside",EN="dismissableLayer.focusOutside",px,pC=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hC=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,p=x.useContext(pC),[h,m]=x.useState(null),y=h?.ownerDocument??globalThis?.document,[,w]=x.useState({}),E=Bo(t,P=>m(P)),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(C),k=h?S.indexOf(h):-1,$=p.layersWithOutsidePointerEventsDisabled.size>0,A=k>=R,D=RN(P=>{const I=P.target,re=[...p.branches].some(Z=>Z.contains(I));!A||re||(o?.(P),l?.(P),P.defaultPrevented||u?.())},y),N=_N(P=>{const I=P.target;[...p.branches].some(Z=>Z.contains(I))||(a?.(P),l?.(P),P.defaultPrevented||u?.())},y);return xN(P=>{k===p.layers.size-1&&(n?.(P),!P.defaultPrevented&&u&&(P.preventDefault(),u()))},y),x.useEffect(()=>{if(h)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(px=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(h)),p.layers.add(h),hx(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=px)}},[h,y,r,p]),x.useEffect(()=>()=>{h&&(p.layers.delete(h),p.layersWithOutsidePointerEventsDisabled.delete(h),hx())},[h,p]),x.useEffect(()=>{const P=()=>w({});return document.addEventListener(Zm,P),()=>document.removeEventListener(Zm,P)},[]),v.jsx(Yi.div,{...d,ref:E,style:{pointerEvents:$?A?"auto":"none":void 0,...e.style},onFocusCapture:ti(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ti(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ti(e.onPointerDownCapture,D.onPointerDownCapture)})});hC.displayName=wN;var CN="DismissableLayerBranch",kN=x.forwardRef((e,t)=>{const r=x.useContext(pC),n=x.useRef(null),o=Bo(t,n);return x.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),v.jsx(Yi.div,{...e,ref:o})});kN.displayName=CN;function RN(e,t=globalThis?.document){const r=kd(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!n.current){let d=function(){mC(SN,r,p,{discrete:!0})};const p={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function _N(e,t=globalThis?.document){const r=kd(e),n=x.useRef(!1);return x.useEffect(()=>{const o=a=>{a.target&&!n.current&&mC(EN,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function hx(){const e=new CustomEvent(Zm);document.dispatchEvent(e)}function mC(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?bN(o,a):o.dispatchEvent(a)}var Wi=globalThis?.document?x.useLayoutEffect:()=>{},$N=_l[" useId ".trim().toString()]||(()=>{}),AN=0;function TN(e){const[t,r]=x.useState($N());return Wi(()=>{r(n=>n??String(AN++))},[e]),t?`radix-${t}`:""}const LN=["top","right","bottom","left"],Hi=Math.min,ri=Math.max,Zu=Math.round,vu=Math.floor,ni=e=>({x:e,y:e}),IN={left:"right",right:"left",bottom:"top",top:"bottom"};function gC(e,t,r){return ri(e,Hi(t,r))}function li(e,t){return typeof e=="function"?e(t):e}function qi(e){return e.split("-")[0]}function Qs(e){return e.split("-")[1]}function Bg(e){return e==="x"?"y":"x"}function Ug(e){return e==="y"?"height":"width"}function On(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Vg(e){return Bg(On(e))}function ON(e,t,r){r===void 0&&(r=!1);const n=Qs(e),o=Vg(e),a=Ug(o);let l=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=ed(l)),[l,ed(l)]}function NN(e){const t=ed(e);return[eg(e),t,eg(t)]}function eg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const mx=["left","right"],gx=["right","left"],PN=["top","bottom"],DN=["bottom","top"];function jN(e,t,r){switch(e){case"top":case"bottom":return r?t?gx:mx:t?mx:gx;case"left":case"right":return t?PN:DN;default:return[]}}function MN(e,t,r,n){const o=Qs(e);let a=jN(qi(e),r==="start",n);return o&&(a=a.map(l=>l+"-"+o),t&&(a=a.concat(a.map(eg)))),a}function ed(e){const t=qi(e);return IN[t]+e.slice(t.length)}function zN(e){var t,r,n,o;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function vC(e){return typeof e!="number"?zN(e):{top:e,right:e,bottom:e,left:e}}function td(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function vx(e,t,r){let{reference:n,floating:o}=e;const a=On(t),l=Vg(t),u=Ug(l),d=qi(t),p=a==="y",h=n.x+n.width/2-o.width/2,m=n.y+n.height/2-o.height/2,y=n[u]/2-o[u]/2;let w;switch(d){case"top":w={x:h,y:n.y-o.height};break;case"bottom":w={x:h,y:n.y+n.height};break;case"right":w={x:n.x+n.width,y:m};break;case"left":w={x:n.x-o.width,y:m};break;default:w={x:n.x,y:n.y}}const E=Qs(t);return E&&(w[l]+=y*(E==="end"?1:-1)*(r&&p?-1:1)),w}async function FN(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:y=!1,padding:w=0}=li(t,e),E=vC(w),C=u[y?m==="floating"?"reference":"floating":m],R=td(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(C)))==null||r?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:p,rootBoundary:h,strategy:d})),k=m==="floating"?{x:n,y:o,width:l.floating.width,height:l.floating.height}:l.reference,$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),A=await(a.isElement==null?void 0:a.isElement($))&&await(a.getScale==null?void 0:a.getScale($))||{x:1,y:1},D=td(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:$,strategy:d}):k);return{top:(R.top-D.top+E.top)/A.y,bottom:(D.bottom-R.bottom+E.bottom)/A.y,left:(R.left-D.left+E.left)/A.x,right:(D.right-R.right+E.right)/A.x}}const BN=50,UN=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:l}=r,u=l.detectOverflow?l:{...l,detectOverflow:FN},d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=vx(p,n,d),y=n,w=0;const E={};for(let S=0;S<a.length;S++){const C=a[S];if(!C)continue;const{name:R,fn:k}=C,{x:$,y:A,data:D,reset:N}=await k({x:h,y:m,initialPlacement:n,placement:y,strategy:o,middlewareData:E,rects:p,platform:u,elements:{reference:e,floating:t}});h=$??h,m=A??m,E[R]={...E[R],...D},N&&w<BN&&(w++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(p=N.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:h,y:m}=vx(p,y,d)),S=-1)}return{x:h,y:m,placement:y,strategy:o,middlewareData:E}},VN=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:p,padding:h=0}=li(e,t)||{};if(p==null)return{};const m=vC(h),y={x:r,y:n},w=Vg(o),E=Ug(w),S=await l.getDimensions(p),C=w==="y",R=C?"top":"left",k=C?"bottom":"right",$=C?"clientHeight":"clientWidth",A=a.reference[E]+a.reference[w]-y[w]-a.floating[E],D=y[w]-a.reference[w],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let P=N?N[$]:0;(!P||!await(l.isElement==null?void 0:l.isElement(N)))&&(P=u.floating[$]||a.floating[E]);const I=A/2-D/2,re=P/2-S[E]/2-1,Z=Hi(m[R],re),ee=Hi(m[k],re),ne=P-S[E]-ee,X=P/2-S[E]/2+I,F=gC(Z,X,ne),V=!d.arrow&&Qs(o)!=null&&X!==F&&a.reference[E]/2-(X<Z?Z:ee)-S[E]/2<0,H=V?X<Z?X-Z:X-ne:0;return{[w]:y[w]+H,data:{[w]:F,centerOffset:X-F-H,...V&&{alignmentOffset:H}},reset:V}}}),WN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:p}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...C}=li(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const R=qi(o),k=On(u),$=qi(u)===u,A=await(d.isRTL==null?void 0:d.isRTL(p.floating)),D=y||($||!S?[ed(u)]:NN(u)),N=E!=="none";!y&&N&&D.push(...MN(u,S,E,A));const P=[u,...D],I=await d.detectOverflow(t,C),re=[];let Z=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&re.push(I[R]),m){const F=ON(o,l,A);re.push(I[F[0]],I[F[1]])}if(Z=[...Z,{placement:o,overflows:re}],!re.every(F=>F<=0)){var ee,ne;const F=(((ee=a.flip)==null?void 0:ee.index)||0)+1,V=P[F];if(V&&(!(m==="alignment"?k!==On(V):!1)||Z.every(L=>On(L.placement)===k?L.overflows[0]>0:!0)))return{data:{index:F,overflows:Z},reset:{placement:V}};let H=(ne=Z.filter(O=>O.overflows[0]<=0).sort((O,L)=>O.overflows[1]-L.overflows[1])[0])==null?void 0:ne.placement;if(!H)switch(w){case"bestFit":{var X;const O=(X=Z.filter(L=>{if(N){const U=On(L.placement);return U===k||U==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(U=>U>0).reduce((U,z)=>U+z,0)]).sort((L,U)=>L[1]-U[1])[0])==null?void 0:X[0];O&&(H=O);break}case"initialPlacement":H=u;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function yx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bx(e){return LN.some(t=>e[t]>=0)}const HN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=li(e,t);switch(o){case"referenceHidden":{const l=await n.detectOverflow(t,{...a,elementContext:"reference"}),u=yx(l,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:bx(u)}}}case"escaped":{const l=await n.detectOverflow(t,{...a,altBoundary:!0}),u=yx(l,r.floating);return{data:{escapedOffsets:u,escaped:bx(u)}}}default:return{}}}}},yC=new Set(["left","top"]);async function qN(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),l=qi(r),u=Qs(r),d=On(r)==="y",p=yC.has(l)?-1:1,h=a&&d?-1:1,m=li(t,e);let{mainAxis:y,crossAxis:w,alignmentAxis:E}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof E=="number"&&(w=u==="end"?E*-1:E),d?{x:w*h,y:y*p}:{x:y*p,y:w*h}}const GN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:l,middlewareData:u}=t,d=await qN(t,e);return l===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:a+d.y,data:{...d,placement:l}}}}},XN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:k=>{let{x:$,y:A}=k;return{x:$,y:A}}},...p}=li(e,t),h={x:r,y:n},m=await a.detectOverflow(t,p),y=On(o),w=Bg(y);let E=h[w],S=h[y];const C=(k,$)=>gC($+m[k==="y"?"top":"left"],$,$-m[k==="y"?"bottom":"right"]);l&&(E=C(w,E)),u&&(S=C(y,S));const R=d.fn({...t,[w]:E,[y]:S});return{...R,data:{x:R.x-r,y:R.y-n,enabled:{[w]:l,[y]:u}}}}}},YN=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,n;const{x:o,y:a,placement:l,rects:u,middlewareData:d}=t,{offset:p=0,mainAxis:h=!0,crossAxis:m=!0}=li(e,t),y={x:o,y:a},w=On(l),E=Bg(w);let S=y[E],C=y[w];const R=li(p,t),k=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(r=R.mainAxis)!=null?r:0,crossAxis:(n=R.crossAxis)!=null?n:0};if(h){const D=E==="y"?"height":"width",N=u.reference[E]-u.floating[D]+k.mainAxis,P=u.reference[E]+u.reference[D]-k.mainAxis;S<N?S=N:S>P&&(S=P)}if(m){var $,A;const D=E==="y"?"width":"height",N=yC.has(qi(l)),P=u.reference[w]-u.floating[D]+(N&&(($=d.offset)==null?void 0:$[w])||0)+(N?0:k.crossAxis),I=u.reference[w]+u.reference[D]+(N?0:((A=d.offset)==null?void 0:A[w])||0)-(N?k.crossAxis:0);C<P?C=P:C>I&&(C=I)}return{[E]:S,[w]:C}}}},KN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:a}=t,{apply:l=()=>{},...u}=li(e,t),d=await o.detectOverflow(t,u),p=qi(r),h=Qs(r),m=On(r)==="y",{width:y,height:w}=n.floating;let E,S;p==="top"||p==="bottom"?(E=p,S=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(S=p,E=h==="end"?"top":"bottom");const C=w-d.top-d.bottom,R=y-d.left-d.right,k=Hi(w-d[E],C),$=Hi(y-d[S],R),A=t.middlewareData.shift,D=!A;let N=k,P=$;A!=null&&A.enabled.x&&(P=R),A!=null&&A.enabled.y&&(N=C),D&&!h&&(m?P=y-2*ri(d.left,d.right):N=w-2*ri(d.top,d.bottom)),await l({...t,availableWidth:P,availableHeight:N});const I=await o.getDimensions(a.floating);return y!==I.width||w!==I.height?{reset:{rects:!0}}:{}}}};function Rd(){return typeof window<"u"}function Js(e){return bC(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pi(e){var t;return(t=(bC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bC(e){return Rd()?e instanceof Node||e instanceof _r(e).Node:!1}function jn(e){return Rd()?e instanceof Element||e instanceof _r(e).Element:!1}function Ki(e){return Rd()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function xx(e){return!Rd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function _d(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&o!=="inline"&&o!=="contents"}function QN(e){return/^(table|td|th)$/.test(Js(e))}function $d(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const JN=/transform|translate|scale|rotate|perspective|filter/,ZN=/paint|layout|strict|content/,ko=e=>!!e&&e!=="none";let Qp;function Wg(e){const t=jn(e)?Mn(e):e;return ko(t.transform)||ko(t.translate)||ko(t.scale)||ko(t.rotate)||ko(t.perspective)||!Hg()&&(ko(t.backdropFilter)||ko(t.filter))||JN.test(t.willChange||"")||ZN.test(t.contain||"")}function eP(e){let t=Po(e);for(;Ki(t)&&!ml(t);){if(Wg(t))return t;if($d(t))return null;t=Po(t)}return null}function Hg(){return Qp==null&&(Qp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Qp}function ml(e){return/^(html|body|#document)$/.test(Js(e))}function Mn(e){return _r(e).getComputedStyle(e)}function Ad(e){return jn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Po(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xx(e)&&e.host||pi(e);return xx(t)?t.host:t}function xC(e){const t=Po(e);return ml(t)?(e.ownerDocument||e).body:Ki(t)&&_d(t)?t:xC(t)}function gl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=xC(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),l=_r(o);if(a){const u=tg(l);return t.concat(l,l.visualViewport||[],_d(o)?o:[],u&&r?gl(u):[])}else return t.concat(o,gl(o,[],r))}function tg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wC(e){const t=Mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ki(e),a=o?e.offsetWidth:r,l=o?e.offsetHeight:n,u=Zu(r)!==a||Zu(n)!==l;return u&&(r=a,n=l),{width:r,height:n,$:u}}function qg(e){return jn(e)?e:e.contextElement}function Os(e){const t=qg(e);if(!Ki(t))return ni(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=wC(t);let l=(a?Zu(r.width):r.width)/n,u=(a?Zu(r.height):r.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const tP=ni(0);function SC(e){const t=_r(e);return!Hg()||!t.visualViewport?tP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rP(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===_r(e)}function Do(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=qg(e);let l=ni(1);t&&(n?jn(n)&&(l=Os(n)):l=Os(e));const u=rP(a,r,n)?SC(a):ni(0);let d=(o.left+u.x)/l.x,p=(o.top+u.y)/l.y,h=o.width/l.x,m=o.height/l.y;if(a&&n){const y=_r(a),w=jn(n)?_r(n):n;let E=y,S=tg(E);for(;S&&w!==E;){const C=Os(S),R=S.getBoundingClientRect(),k=Mn(S),$=R.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,A=R.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,p*=C.y,h*=C.x,m*=C.y,d+=$,p+=A,E=_r(S),S=tg(E)}}return td({width:h,height:m,x:d,y:p})}function Td(e,t){const r=Ad(e).scrollLeft;return t?t.left+r:Do(pi(e)).left+r}function EC(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Td(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function nP(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",l=pi(n),u=t?$d(t.floating):!1;if(n===l||u&&a)return r;let d={scrollLeft:0,scrollTop:0},p=ni(1);const h=ni(0),m=Ki(n);if((m||!a)&&((Js(n)!=="body"||_d(l))&&(d=Ad(n)),m)){const w=Do(n);p=Os(n),h.x=w.x+n.clientLeft,h.y=w.y+n.clientTop}const y=l&&!m&&!a?EC(l,d):ni(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-d.scrollLeft*p.x+h.x+y.x,y:r.y*p.y-d.scrollTop*p.y+h.y+y.y}}function iP(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function oP(e){const t=Ad(e),r=e.ownerDocument.body,n=ri(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ri(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-t.scrollLeft+Td(e);const l=-t.scrollTop;return Mn(r).direction==="rtl"&&(a+=ri(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:a,y:l}}const sP=25;function aP(e,t,r){r===void 0&&(r="viewport");const n=r==="layoutViewport",o=_r(e),a=pi(e),l=o.visualViewport;let u=a.clientWidth,d=a.clientHeight,p=0,h=0;if(l){const y=!Hg()||t==="fixed";n?y||(p=-l.offsetLeft,h=-l.offsetTop):(u=l.width,d=l.height,y&&(p=l.offsetLeft,h=l.offsetTop))}if(Td(a)<=0){const y=a.ownerDocument,w=y.body,E=getComputedStyle(w),S=y.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(a.clientWidth-w.clientWidth-S),R=getComputedStyle(a).scrollbarGutter==="stable both-edges"?C/2:C;R<=sP&&(u-=R)}return{width:u,height:d,x:p,y:h}}function lP(e,t){const r=Do(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Os(e),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=o*a.x,p=n*a.y;return{width:l,height:u,x:d,y:p}}function wx(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=aP(e,r,t);else if(t==="document")n=oP(pi(e));else if(jn(t))n=lP(t,r);else{const o=SC(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return td(n)}function cP(e,t){const r=t.get(e);if(r)return r;let n=gl(e,[],!1).filter(u=>jn(u)&&Js(u)!=="body"),o=null;const a=Mn(e).position==="fixed";let l=a?Po(e):e;for(;jn(l)&&!ml(l);){const u=Mn(l),d=Wg(l),p=o?o.position:a?"fixed":"";!d&&(p==="fixed"||p==="absolute"&&u.position==="static")?n=n.filter(m=>m!==l):o=u,l=Po(l)}return t.set(e,n),n}function uP(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const l=[...r==="clippingAncestors"?$d(t)?[]:cP(t,this._c):[].concat(r),n],u=wx(t,l[0],o);let d=u.top,p=u.right,h=u.bottom,m=u.left;for(let y=1;y<l.length;y++){const w=wx(t,l[y],o);d=ri(w.top,d),p=Hi(w.right,p),h=Hi(w.bottom,h),m=ri(w.left,m)}return{width:p-m,height:h-d,x:m,y:d}}function dP(e){const{width:t,height:r}=wC(e);return{width:t,height:r}}function fP(e,t,r){const n=Ki(t),o=pi(t),a=r==="fixed",l=Do(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=ni(0);if((n||!a)&&((Js(t)!=="body"||_d(o))&&(u=Ad(t)),n)){const y=Do(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}!n&&o&&(d.x=Td(o));const p=o&&!n&&!a?EC(o,u):ni(0),h=l.left+u.scrollLeft-d.x-p.x,m=l.top+u.scrollTop-d.y-p.y;return{x:h,y:m,width:l.width,height:l.height}}function Jp(e){return Mn(e).position==="static"}function Sx(e,t){if(!Ki(e)||Mn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return pi(e)===r&&(r=r.ownerDocument.body),r}function CC(e,t){const r=_r(e);if($d(e))return r;if(!Ki(e)){let o=Po(e);for(;o&&!ml(o);){if(jn(o)&&!Jp(o))return o;o=Po(o)}return r}let n=Sx(e,t);for(;n&&QN(n)&&Jp(n);)n=Sx(n,t);return n&&ml(n)&&Jp(n)&&!Wg(n)?r:n||eP(e)||r}const pP=async function(e){const t=this.getOffsetParent||CC,r=this.getDimensions,n=await r(e.floating);return{reference:fP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function hP(e){return Mn(e).direction==="rtl"}const mP={convertOffsetParentRelativeRectToViewportRelativeRect:nP,getDocumentElement:pi,getClippingRect:uP,getOffsetParent:CC,getElementRects:pP,getClientRects:iP,getDimensions:dP,getScale:Os,isElement:jn,isRTL:hP};function kC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gP(e,t,r){let n=null,o;const a=pi(e);function l(){var h;clearTimeout(o),(h=n)==null||h.disconnect(),n=null}function u(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),l();const y=e.getBoundingClientRect(),{left:w,top:E,width:S,height:C}=y;if(h||t(),!S||!C)return;const R=vu(E),k=vu(a.clientWidth-(w+S)),$=vu(a.clientHeight-(E+C)),A=vu(w),N={rootMargin:-R+"px "+-k+"px "+-$+"px "+-A+"px",threshold:ri(0,Hi(1,m))||1};let P=!0;function I(re){const Z=re[0].intersectionRatio;if(!kC(y,e.getBoundingClientRect()))return u();if(Z!==m){if(!P)return u();Z?u(!1,Z):o=setTimeout(()=>{u(!1,1e-7)},1e3)}P=!1}try{n=new IntersectionObserver(I,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(I,N)}n.observe(e)}const d=_r(e),p=()=>u(r);return d.addEventListener("resize",p),u(!0),()=>{d.removeEventListener("resize",p),l()}}function vP(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,p=qg(e),h=o||a?[...p?gl(p):[],...t?gl(t):[]]:[];h.forEach(R=>{o&&R.addEventListener("scroll",r),a&&R.addEventListener("resize",r)});const m=p&&u?gP(p,r,a):null;let y=-1,w=null;l&&(w=new ResizeObserver(R=>{let[k]=R;k&&k.target===p&&w&&t&&(w.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var $;($=w)==null||$.observe(t)})),r()}),p&&!d&&w.observe(p),t&&w.observe(t));let E,S=d?Do(e):null;d&&C();function C(){const R=Do(e);S&&!kC(S,R)&&r(),S=R,E=requestAnimationFrame(C)}return r(),()=>{var R;h.forEach(k=>{o&&k.removeEventListener("scroll",r),a&&k.removeEventListener("resize",r)}),m?.(),(R=w)==null||R.disconnect(),w=null,d&&cancelAnimationFrame(E)}}const yP=GN,bP=XN,xP=WN,wP=KN,SP=HN,Ex=VN,EP=YN,CP=(e,t,r)=>{const n=new Map,o=r??{},a={...mP,...o.platform,_c:n};return UN(e,t,{...o,platform:a})};var kP=typeof document<"u",RP=function(){},Mu=kP?x.useLayoutEffect:RP;function rd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!rd(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!rd(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function RC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cx(e,t){const r=RC(e);return Math.round(t*r)/r}function Zp(e){const t=x.useRef(e);return Mu(()=>{t.current=e}),t}function _P(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:p}=e,[h,m]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,w]=x.useState(n);rd(y,n)||w(n);const[E,S]=x.useState(null),[C,R]=x.useState(null),k=x.useCallback(L=>{L!==N.current&&(N.current=L,S(L))},[]),$=x.useCallback(L=>{L!==P.current&&(P.current=L,R(L))},[]),A=a||E,D=l||C,N=x.useRef(null),P=x.useRef(null),I=x.useRef(h),re=d!=null,Z=Zp(d),ee=Zp(o),ne=Zp(p),X=x.useCallback(()=>{if(!N.current||!P.current)return;const L={placement:t,strategy:r,middleware:y};ee.current&&(L.platform=ee.current),CP(N.current,P.current,L).then(U=>{const z={...U,isPositioned:ne.current!==!1};F.current&&!rd(I.current,z)&&(I.current=z,Lr.flushSync(()=>{m(z)}))})},[y,t,r,ee,ne]);Mu(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[p]);const F=x.useRef(!1);Mu(()=>(F.current=!0,()=>{F.current=!1}),[]),Mu(()=>{if(A&&(N.current=A),D&&(P.current=D),A&&D){if(Z.current)return Z.current(A,D,X);X()}},[A,D,X,Z,re]);const V=x.useMemo(()=>({reference:N,floating:P,setReference:k,setFloating:$}),[k,$]),H=x.useMemo(()=>({reference:A,floating:D}),[A,D]),O=x.useMemo(()=>{const L={position:r,left:0,top:0};if(!H.floating)return L;const U=Cx(H.floating,h.x),z=Cx(H.floating,h.y);return u?{...L,transform:"translate("+U+"px, "+z+"px)",...RC(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:U,top:z}},[r,u,H.floating,h.x,h.y]);return x.useMemo(()=>({...h,update:X,refs:V,elements:H,floatingStyles:O}),[h,X,V,H,O])}const $P=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ex({element:n.current,padding:o}).fn(r):{}:n?Ex({element:n,padding:o}).fn(r):{}}}},AP=(e,t)=>{const r=yP(e);return{name:r.name,fn:r.fn,options:[e,t]}},TP=(e,t)=>{const r=bP(e);return{name:r.name,fn:r.fn,options:[e,t]}},LP=(e,t)=>({fn:EP(e).fn,options:[e,t]}),IP=(e,t)=>{const r=xP(e);return{name:r.name,fn:r.fn,options:[e,t]}},OP=(e,t)=>{const r=wP(e);return{name:r.name,fn:r.fn,options:[e,t]}},NP=(e,t)=>{const r=SP(e);return{name:r.name,fn:r.fn,options:[e,t]}},PP=(e,t)=>{const r=$P(e);return{name:r.name,fn:r.fn,options:[e,t]}};var DP="Arrow",_C=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return v.jsx(Yi.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});_C.displayName=DP;var jP=_C;function MP(e){const[t,r]=x.useState(void 0);return Wi(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let l,u;if("borderBoxSize"in a){const d=a.borderBoxSize,p=Array.isArray(d)?d[0]:d;l=p.inlineSize,u=p.blockSize}else l=e.offsetWidth,u=e.offsetHeight;r({width:l,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Gg="Popper",[$C,AC]=dC(Gg),[zP,TC]=$C(Gg),LC=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return v.jsx(zP,{scope:t,anchor:n,onAnchorChange:o,children:r})};LC.displayName=Gg;var IC="PopperAnchor",OC=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=TC(IC,r),l=x.useRef(null),u=Bo(t,l),d=x.useRef(null);return x.useEffect(()=>{const p=d.current;d.current=n?.current||l.current,p!==d.current&&a.onAnchorChange(d.current)}),n?null:v.jsx(Yi.div,{...o,ref:u})});OC.displayName=IC;var Xg="PopperContent",[FP,BP]=$C(Xg),NC=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:p=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:w="optimized",onPlaced:E,...S}=e,C=TC(Xg,r),[R,k]=x.useState(null),$=Bo(t,be=>k(be)),[A,D]=x.useState(null),N=MP(A),P=N?.width??0,I=N?.height??0,re=n+(a!=="center"?"-"+a:""),Z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},ee=Array.isArray(p)?p:[p],ne=ee.length>0,X={padding:Z,boundary:ee.filter(VP),altBoundary:ne},{refs:F,floatingStyles:V,placement:H,isPositioned:O,middlewareData:L}=_P({strategy:"fixed",placement:re,whileElementsMounted:(...be)=>vP(...be,{animationFrame:w==="always"}),elements:{reference:C.anchor},middleware:[AP({mainAxis:o+I,alignmentAxis:l}),d&&TP({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?LP():void 0,...X}),d&&IP({...X}),OP({...X,apply:({elements:be,rects:pe,availableWidth:ue,availableHeight:ge})=>{const{width:qe,height:Xe}=pe.reference,we=be.floating.style;we.setProperty("--radix-popper-available-width",`${ue}px`),we.setProperty("--radix-popper-available-height",`${ge}px`),we.setProperty("--radix-popper-anchor-width",`${qe}px`),we.setProperty("--radix-popper-anchor-height",`${Xe}px`)}}),A&&PP({element:A,padding:u}),WP({arrowWidth:P,arrowHeight:I}),y&&NP({strategy:"referenceHidden",...X})]}),[U,z]=jC(H),T=kd(E);Wi(()=>{O&&T?.()},[O,T]);const M=L.arrow?.x,te=L.arrow?.y,le=L.arrow?.centerOffset!==0,[G,fe]=x.useState();return Wi(()=>{R&&fe(window.getComputedStyle(R).zIndex)},[R]),v.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:O?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(FP,{scope:r,placedSide:U,onArrowChange:D,arrowX:M,arrowY:te,shouldHideArrow:le,children:v.jsx(Yi.div,{"data-side":U,"data-align":z,...S,ref:$,style:{...S.style,animation:O?void 0:"none"}})})})});NC.displayName=Xg;var PC="PopperArrow",UP={top:"bottom",right:"left",bottom:"top",left:"right"},DC=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=BP(PC,n),l=UP[a.placedSide];return v.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:v.jsx(jP,{...o,ref:r,style:{...o.style,display:"block"}})})});DC.displayName=PC;function VP(e){return e!==null}var WP=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,l=o.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[p,h]=jC(r),m={start:"0%",center:"50%",end:"100%"}[h],y=(o.arrow?.x??0)+u/2,w=(o.arrow?.y??0)+d/2;let E="",S="";return p==="bottom"?(E=l?m:`${y}px`,S=`${-d}px`):p==="top"?(E=l?m:`${y}px`,S=`${n.floating.height+d}px`):p==="right"?(E=`${-d}px`,S=l?m:`${w}px`):p==="left"&&(E=`${n.floating.width+d}px`,S=l?m:`${w}px`),{data:{x:E,y:S}}}});function jC(e){const[t,r="center"]=e.split("-");return[t,r]}var HP=LC,qP=OC,GP=NC,XP=DC,YP="Portal",MC=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,a]=x.useState(!1);Wi(()=>a(!0),[]);const l=r||o&&globalThis?.document?.body;return l?T3.createPortal(v.jsx(Yi.div,{...n,ref:t}),l):null});MC.displayName=YP;function KP(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Yg=e=>{const{present:t,children:r}=e,n=QP(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),a=Bo(n.ref,JP(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:a}):null};Yg.displayName="Presence";function QP(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=KP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const p=yu(n.current);a.current=u==="mounted"?p:"none"},[u]),Wi(()=>{const p=n.current,h=o.current;if(h!==e){const y=a.current,w=yu(p);e?d("MOUNT"):w==="none"||p?.display==="none"?d("UNMOUNT"):d(h&&y!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),Wi(()=>{if(t){let p;const h=t.ownerDocument.defaultView??window,m=w=>{const S=yu(n.current).includes(CSS.escape(w.animationName));if(w.target===t&&S&&(d("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},y=w=>{w.target===t&&(a.current=yu(n.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{h.clearTimeout(p),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(p=>{n.current=p?getComputedStyle(p):null,r(p)},[])}}function yu(e){return e?.animationName||"none"}function JP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ZP=_l[" useInsertionEffect ".trim().toString()]||Wi;function eD({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,l]=tD({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:o;{const h=x.useRef(e!==void 0);x.useEffect(()=>{const m=h.current;m!==u&&console.warn(`${n} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,n])}const p=x.useCallback(h=>{if(u){const m=rD(h)?h(e):h;m!==e&&l.current?.(m)}else a(h)},[u,e,a,l]);return[d,p]}function tD({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),a=x.useRef(t);return ZP(()=>{a.current=t},[t]),x.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function rD(e){return typeof e=="function"}var nD=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),iD="VisuallyHidden",zC=x.forwardRef((e,t)=>v.jsx(Yi.span,{...e,ref:t,style:{...nD,...e.style}}));zC.displayName=iD;var oD=zC,[Ld]=dC("Tooltip",[AC]),Id=AC(),FC="TooltipProvider",sD=700,rg="tooltip.open",[aD,Kg]=Ld(FC),BC=e=>{const{__scopeTooltip:t,delayDuration:r=sD,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,l=x.useRef(!0),u=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),v.jsx(aD,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(p=>{u.current=p},[]),disableHoverableContent:o,children:a})};BC.displayName=FC;var vl="Tooltip",[lD,$l]=Ld(vl),UC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=e,d=Kg(vl,e.__scopeTooltip),p=Id(t),[h,m]=x.useState(null),y=TN(),w=x.useRef(0),E=l??d.disableHoverableContent,S=u??d.delayDuration,C=x.useRef(!1),[R,k]=eD({prop:n,defaultProp:o??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(rg))):d.onClose(),a?.(P)},caller:vl}),$=x.useMemo(()=>R?C.current?"delayed-open":"instant-open":"closed",[R]),A=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,C.current=!1,k(!0)},[k]),D=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,k(!1)},[k]),N=x.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!0,k(!0),w.current=0},S)},[S,k]);return x.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),v.jsx(HP,{...p,children:v.jsx(lD,{scope:t,contentId:y,open:R,stateAttribute:$,trigger:h,onTriggerChange:m,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?N():A()},[d.isOpenDelayedRef,N,A]),onTriggerLeave:x.useCallback(()=>{E?D():(window.clearTimeout(w.current),w.current=0)},[D,E]),onOpen:A,onClose:D,disableHoverableContent:E,children:r})})};UC.displayName=vl;var ng="TooltipTrigger",VC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=$l(ng,r),a=Kg(ng,r),l=Id(r),u=x.useRef(null),d=Bo(t,u,o.onTriggerChange),p=x.useRef(!1),h=x.useRef(!1),m=x.useCallback(()=>p.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),v.jsx(qP,{asChild:!0,...l,children:v.jsx(Yi.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:d,onPointerMove:ti(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),h.current=!0)}),onPointerLeave:ti(e.onPointerLeave,()=>{o.onTriggerLeave(),h.current=!1}),onPointerDown:ti(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ti(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:ti(e.onBlur,o.onClose),onClick:ti(e.onClick,o.onClose)})})});VC.displayName=ng;var Qg="TooltipPortal",[cD,uD]=Ld(Qg,{forceMount:void 0}),WC=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=$l(Qg,t);return v.jsx(cD,{scope:t,forceMount:r,children:v.jsx(Yg,{present:r||a.open,children:v.jsx(MC,{asChild:!0,container:o,children:n})})})};WC.displayName=Qg;var Ms="TooltipContent",HC=x.forwardRef((e,t)=>{const r=uD(Ms,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,l=$l(Ms,e.__scopeTooltip);return v.jsx(Yg,{present:n||l.open,children:l.disableHoverableContent?v.jsx(qC,{side:o,...a,ref:t}):v.jsx(dD,{side:o,...a,ref:t})})}),dD=x.forwardRef((e,t)=>{const r=$l(Ms,e.__scopeTooltip),n=Kg(Ms,e.__scopeTooltip),o=x.useRef(null),a=Bo(t,o),[l,u]=x.useState(null),{trigger:d,onClose:p}=r,h=o.current,{onPointerInTransitChange:m}=n,y=x.useCallback(()=>{u(null),m(!1)},[m]),w=x.useCallback((E,S)=>{const C=E.currentTarget,R={x:E.clientX,y:E.clientY},k=mD(R,C.getBoundingClientRect()),$=gD(R,k),A=vD(S.getBoundingClientRect()),D=bD([...$,...A]);u(D),m(!0)},[m]);return x.useEffect(()=>()=>y(),[y]),x.useEffect(()=>{if(d&&h){const E=C=>w(C,h),S=C=>w(C,d);return d.addEventListener("pointerleave",E),h.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",E),h.removeEventListener("pointerleave",S)}}},[d,h,w,y]),x.useEffect(()=>{if(l){const E=S=>{const C=S.target,R={x:S.clientX,y:S.clientY},k=d?.contains(C)||h?.contains(C),$=!yD(R,l);k?y():$&&(y(),p())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[d,h,l,p,y]),v.jsx(qC,{...e,ref:a})}),[fD,pD]=Ld(vl,{isInside:!1}),hD=hN("TooltipContent"),qC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,d=$l(Ms,r),p=Id(r),{onClose:h}=d;return x.useEffect(()=>(document.addEventListener(rg,h),()=>document.removeEventListener(rg,h)),[h]),x.useEffect(()=>{if(d.trigger){const m=y=>{y.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,h]),v.jsx(hC,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:h,children:v.jsxs(GP,{"data-state":d.stateAttribute,...p,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(hD,{children:n}),v.jsx(fD,{scope:r,isInside:!0,children:v.jsx(oD,{id:d.contentId,role:"tooltip",children:o||n})})]})})});HC.displayName=Ms;var GC="TooltipArrow",XC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Id(r);return pD(GC,r).isInside?null:v.jsx(XP,{...o,...n,ref:t})});XC.displayName=GC;function mD(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function gD(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function vD(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function yD(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],d=t[l],p=u.x,h=u.y,m=d.x,y=d.y;h>n!=y>n&&r<(m-p)*(n-h)/(y-h)+p&&(o=!o)}return o}function bD(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),xD(t)}function xD(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(o.y-l.y)>=(a.y-l.y)*(o.x-l.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],l=r[r.length-2];if((a.x-l.x)*(o.y-l.y)>=(a.y-l.y)*(o.x-l.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var wD=BC,SD=UC,ED=VC,CD=WC,kD=HC,RD=XC;const _D=Qt("z-tooltip w-fit max-w-224 rounded-xs bg-interactive px-8 py-4 body-3 text-on-interactive select-none","data-[side=top]:animate-slide-in-from-bottom","data-[state=closed]:data-[side=top]:animate-slide-out-to-bottom","data-[side=bottom]:animate-slide-in-from-top","data-[state=closed]:data-[side=bottom]:animate-slide-out-to-top","data-[side=left]:animate-slide-in-from-right","data-[state=closed]:data-[side=left]:animate-slide-out-to-right","data-[side=right]:animate-slide-in-from-left","data-[state=closed]:data-[side=right]:animate-slide-out-to-left"),$D=({delayDuration:e=200,...t})=>v.jsx(wD,{"data-slot":"tooltip-provider",delayDuration:e,...t}),YC=({delayDuration:e=200,...t})=>v.jsx($D,{delayDuration:e,children:v.jsx(SD,{"data-slot":"tooltip",...t})}),KC=({...e})=>v.jsx(ED,{"data-slot":"tooltip-trigger",...e}),QC=({className:e,sideOffset:t=0,side:r,children:n,...o})=>v.jsx(CD,{children:v.jsxs(kD,{"data-slot":"tooltip-content",side:r,sideOffset:t,className:Qt(_D,e),...o,children:[v.jsx(RD,{className:"size-10 translate-y-[calc(-50%-1px)] rotate-45 rounded-[1px] bg-interactive fill-interactive"}),v.jsx("div",{className:"relative",children:n})]})});var AD=Symbol.for("react.lazy"),nd=_l[" use ".trim().toString()];function TD(e){return typeof e=="object"&&e!==null&&"then"in e}function JC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===AD&&"_payload"in e&&TD(e._payload)}function LD(e){const t=OD(e),r=x.forwardRef((n,o)=>{let{children:a,...l}=n;JC(a)&&typeof nd=="function"&&(a=nd(a._payload));const u=x.Children.toArray(a),d=u.find(DD);if(d){const p=d.props.children,h=u.map(m=>m===d?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:m);return v.jsx(t,{...l,ref:o,children:x.isValidElement(p)?x.cloneElement(p,void 0,h):null})}return v.jsx(t,{...l,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}var ID=LD("Slot");function OD(e){const t=x.forwardRef((r,n)=>{let{children:o,...a}=r;if(JC(o)&&typeof nd=="function"&&(o=nd(o._payload)),x.isValidElement(o)){const l=MD(o),u=jD(a,o.props);return o.type!==x.Fragment&&(u.ref=n?Fg(n,l):l),x.cloneElement(o,u)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZC=Symbol("radix.slottable");function ND(e){const t=({children:r})=>v.jsx(v.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=ZC,t}var PD=ND("Slottable");function DD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZC}function jD(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...u)=>{const d=a(...u);return o(...u),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function MD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const yl=({ref:e,className:t,size:r=16,...n})=>{const{t:o}=zE();return v.jsx("svg",{className:Qt("shrink-0 animate-spin text-base",t),xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 16 16",fill:"none","aria-label":o("components.spinner.loadingAriaLabel"),role:"img",ref:e,...n,children:v.jsx("path",{d:"M8 1.5C11.5899 1.5 14.5 4.41015 14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",fill:"none"})})},zD=kr("inline-flex size-fit cursor-pointer items-center justify-center rounded-full transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",{variants:{appearance:{base:"bg-interactive text-on-interactive hover:bg-interactive-hover active:bg-interactive-pressed",gray:"bg-muted text-base hover:bg-muted-hover active:bg-muted-pressed",accent:"bg-accent text-on-accent hover:bg-accent-hover active:bg-accent-pressed",transparent:"bg-muted-transparent text-base hover:bg-muted-transparent-hover active:bg-muted-transparent-pressed","no-background":"bg-transparent text-base hover:bg-base-transparent-hover active:bg-base-transparent-pressed disabled:bg-base-transparent",red:"bg-error-transparent text-error hover:bg-error-transparent-hover active:bg-error-transparent-pressed"},disabled:{true:"",false:""},loading:{true:"",false:""},size:{xs:"p-8",sm:"p-10",md:"p-12",lg:"p-16"},isFull:{true:"w-full"}},compoundVariants:[{disabled:!0,loading:!1,class:"cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"},{disabled:!0,loading:!0,class:"cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"}],defaultVariants:{appearance:"base",size:"md",isFull:!1}}),kx=kr("shrink-0",{variants:{appearance:{base:"text-on-interactive",accent:"text-on-accent",red:"text-error",gray:"text-base","no-background":"text-base",transparent:"text-base"},disabled:{true:"text-disabled"}}}),ek=({ref:e,className:t,appearance:r="base",size:n,isFull:o,disabled:a=!1,asChild:l=!1,icon:u,loading:d=!1,children:p,onClick:h,...m})=>{const y=Ks({consumerName:"BaseButton",mergeWith:{disabled:a}}),w=n?{xs:16,sm:20,md:24,lg:24}[n]:24;return v.jsxs(l?ID:"button",{className:Qt(zD({disabled:y,loading:d,appearance:r,size:n,isFull:o}),t),ref:e,"data-disabled":y||void 0,disabled:y,onClick:h,...l?{}:{type:"button"},...m,children:[d&&v.jsx(yl,{size:w,className:kx({appearance:r,disabled:y})}),!d&&u&&v.jsx(u,{size:w,className:kx({appearance:r,disabled:y})}),p&&(l?v.jsx(PD,{children:p}):v.jsx("span",{className:"line-clamp-2 text-left",children:p}))]})},sr=({ref:e,className:t,icon:r,tooltip:n=!1,tooltipPlacement:o="top",tooltipText:a,onTooltipOpenChange:l,"aria-label":u,...d})=>{const p=v.jsx(ek,{ref:e,icon:r,className:Qt("shrink-0",t),"aria-label":u,...d});return n?v.jsxs(YC,{onOpenChange:l,children:[v.jsx(KC,{asChild:!0,children:p}),v.jsx(QC,{side:o,children:a||u})]}):p},id=pt("Close",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m3.333 3.333 9.334 9.334m0-9.334-9.334 9.334"})})),FD=pt("WarningFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.773 2.506c-.79-1.388-2.789-1.392-3.575 0v.002L1.1 11.44c-.784 1.372.206 3.08 1.787 3.08h10.212c1.576 0 2.572-1.712 1.787-3.08zM8.5 6.253a.5.5 0 1 0-1 0v2.494a.5.5 0 1 0 1 0zm-.507 3.997h-.006q-.021 0-.041.002a.665.665 0 0 0-.62.665c0 .35.285.666.667.666.197 0 .361-.088.47-.197a.67.67 0 0 0 .197-.47.67.67 0 0 0-.667-.666",clipRule:"evenodd"})})),BD={info:v.jsx(lN,{className:"text-base"}),success:v.jsx(uN,{className:"text-success"}),warning:v.jsx(FD,{className:"text-warning"}),error:v.jsx(cN,{className:"text-error"})},UD={root:kr("flex w-full items-start gap-8 rounded-md p-12 text-base",{variants:{appearance:{info:"bg-surface",success:"bg-success-transparent",warning:"bg-warning-transparent",error:"bg-error-transparent"}}})},ig=({ref:e,appearance:t="info",title:r,description:n,primaryAction:o,secondaryAction:a,className:l,onClose:u,closeAriaLabel:d,...p})=>{const{t:h}=zE(),m=BD[t];return v.jsxs("div",{ref:e,className:Qt(UD.root({appearance:t}),l),...p,children:[v.jsx("div",{className:"flex shrink-0 items-start py-4",children:m}),v.jsxs("div",{className:"mr-8 flex flex-1 flex-col gap-8 py-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[r&&v.jsx("h3",{className:"line-clamp-2 body-1-semi-bold",children:r}),n&&v.jsx("div",{className:Qt("line-clamp-5 body-2",!r&&"mt-2"),children:n})]}),(o||a)&&v.jsxs("div",{className:"flex flex-wrap gap-4",children:[o,a]})]}),u&&v.jsx(sr,{appearance:"transparent",size:"xs",icon:id,onClick:()=>u(),"aria-label":d||h("components.banner.closeAriaLabel")})]})},VD=kr("",{variants:{size:{sm:"px-16 py-10 body-2-semi-bold",md:"px-16 py-12 body-1-semi-bold",lg:"p-16 body-1-semi-bold"}},defaultVariants:{size:"md"}}),WD=({ref:e,className:t,loading:r,disabled:n,children:o,size:a,icon:l,...u})=>v.jsx(ek,{ref:e,size:a,disabled:n,icon:l,loading:r,className:Qt(VD({size:a}),"gap-8",t),...u,children:o}),Od=pt("ChevronUp",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M10.667 9.333 8 6.667 5.333 9.333"})})),zs=pt("ChevronDown",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M5.333 6.667 8 9.333l2.667-2.666"})})),Nd=pt("ChevronRight",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M6.667 10.667 9.333 8 6.667 5.333"})})),Pd=pt("Check",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M13.333 4.333 6 11.667 2.667 8.333"})})),HD=({inputRef:e,checked:t,setChecked:r,form:n})=>{x.useEffect(()=>{const o=e.current?.querySelector("input"),a=o?.form;if(!o||!a)return;let l;const u=()=>{l=setTimeout(()=>{o.checked!==t&&r(o.checked)})};return a.addEventListener("reset",u),()=>{a.removeEventListener("reset",u),clearTimeout(l)}},[e,t,r,n])},qD="relative inline-flex size-20 shrink-0 align-middle",GD=Qt("flex size-full items-center justify-center rounded-xs transition-colors","peer-focus-visible:ring-2 peer-focus-visible:ring-focus peer-focus-visible:ring-offset-2","data-[state=unchecked]:border data-[state=unchecked]:border-muted data-[state=unchecked]:bg-base","data-[state=unchecked]:peer-hover:bg-base-hover","data-[state=unchecked]:peer-active:bg-base-pressed","data-[state=unchecked]:peer-disabled:border-disabled data-[state=unchecked]:peer-disabled:bg-base","data-[state=checked]:bg-active data-[state=checked]:text-on-accent","data-[state=checked]:peer-hover:bg-active-hover","data-[state=checked]:peer-active:bg-active-pressed","data-[state=checked]:peer-disabled:bg-disabled data-[state=checked]:peer-disabled:text-disabled"),Jg=({ref:e,className:t,checked:r,defaultChecked:n=!1,onCheckedChange:o,disabled:a,...l})=>{const u=Ks({consumerName:"Checkbox",mergeWith:{disabled:a}}),[d,p]=P3({prop:r,defaultProp:n,onChange:o}),h=d?"checked":"unchecked",m=x.useRef(null);return HD({inputRef:m,checked:d,setChecked:p,form:l.form}),v.jsxs("span",{ref:m,className:Qt(qD,t),children:[v.jsx("input",{...l,ref:e,type:"checkbox",checked:d,disabled:u,"data-state":h,"data-disabled":u?"":void 0,className:"peer absolute inset-0 m-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",onChange:y=>p(y.target.checked)}),v.jsx("span",{"aria-hidden":!0,"data-state":h,className:GD,children:d&&v.jsx(Pd,{size:16})})]})},XD=e=>{const t=getComputedStyle(e).direction==="rtl",r=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft),o=n>0,a=n<r-1;return{canScrollLeft:t?a:o,canScrollRight:t?o:a}};function YD(e){const[t,r]=x.useState(!1),[n,o]=x.useState(!1);return x.useLayoutEffect(()=>{const a=e.current;if(!a)return;const l=()=>{const m=XD(a);r(m.canScrollLeft),o(m.canScrollRight)};l(),a.addEventListener("scroll",l,{passive:!0});const u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(l);u?.observe(a);let d=null;const p=()=>{const m=a.firstElementChild;m!==d&&(d&&u?.unobserve(d),m&&u?.observe(m),d=m)};p();const h=new MutationObserver(()=>{p(),l()});return h.observe(a,{childList:!0}),()=>{a.removeEventListener("scroll",l),u?.disconnect(),h.disconnect()}},[e]),{canScrollLeft:t,canScrollRight:n}}const KD=kr("flex shrink-0 items-center justify-center rounded-full",{variants:{fill:{transparent:"bg-muted-transparent",plain:""},appearance:{base:"",success:"",error:"",warning:"",muted:"","decorative-blue":"","decorative-pink":"","decorative-purple":"","decorative-green":"","decorative-turquoise":"","decorative-yellow":"","decorative-orange":"","decorative-red":""},size:{32:"spot-h-32 spot-w-32",40:"spot-h-40 spot-w-40",48:"spot-h-48 spot-w-48",56:"spot-h-56 spot-w-56",72:"spot-h-72 spot-w-72"}},compoundVariants:[{fill:"plain",appearance:"base",class:"bg-muted"},{fill:"plain",appearance:"success",class:"bg-success"},{fill:"plain",appearance:"error",class:"bg-error"},{fill:"plain",appearance:"warning",class:"bg-warning"},{fill:"plain",appearance:"muted",class:"bg-muted-pressed"},{fill:"plain",appearance:"decorative-blue",class:"bg-decorative-blue"},{fill:"plain",appearance:"decorative-pink",class:"bg-decorative-pink"},{fill:"plain",appearance:"decorative-purple",class:"bg-decorative-purple"},{fill:"plain",appearance:"decorative-green",class:"bg-decorative-green"},{fill:"plain",appearance:"decorative-turquoise",class:"bg-decorative-turquoise"},{fill:"plain",appearance:"decorative-yellow",class:"bg-decorative-yellow"},{fill:"plain",appearance:"decorative-orange",class:"bg-decorative-orange"},{fill:"plain",appearance:"decorative-red",class:"bg-decorative-red"}]}),QD=kr("",{variants:{fill:{transparent:"",plain:""},appearance:{base:"",success:"",error:"",warning:"",muted:"","decorative-blue":"","decorative-pink":"","decorative-purple":"","decorative-green":"","decorative-turquoise":"","decorative-yellow":"","decorative-orange":"","decorative-red":""},disabled:{true:"text-disabled",false:""}},compoundVariants:[{disabled:!1,fill:"transparent",appearance:"base",class:"text-base"},{disabled:!1,fill:"transparent",appearance:"success",class:"text-success"},{disabled:!1,fill:"transparent",appearance:"error",class:"text-error"},{disabled:!1,fill:"transparent",appearance:"warning",class:"text-warning"},{disabled:!1,fill:"transparent",appearance:"muted",class:"text-muted"},{disabled:!1,fill:"transparent",appearance:"decorative-blue",class:"text-decorative-blue"},{disabled:!1,fill:"transparent",appearance:"decorative-pink",class:"text-decorative-pink"},{disabled:!1,fill:"transparent",appearance:"decorative-purple",class:"text-decorative-purple"},{disabled:!1,fill:"transparent",appearance:"decorative-green",class:"text-decorative-green"},{disabled:!1,fill:"transparent",appearance:"decorative-turquoise",class:"text-decorative-turquoise"},{disabled:!1,fill:"transparent",appearance:"decorative-yellow",class:"text-decorative-yellow"},{disabled:!1,fill:"transparent",appearance:"decorative-orange",class:"text-decorative-orange"},{disabled:!1,fill:"transparent",appearance:"decorative-red",class:"text-decorative-red"},{disabled:!1,fill:"plain",appearance:"base",class:"text-base"},{disabled:!1,fill:"plain",appearance:"success",class:"text-success-strong"},{disabled:!1,fill:"plain",appearance:"error",class:"text-error-strong"},{disabled:!1,fill:"plain",appearance:"warning",class:"text-warning-strong"},{disabled:!1,fill:"plain",appearance:"muted",class:"text-muted"},{disabled:!1,fill:"plain",appearance:"decorative-blue",class:"text-decorative-strong-blue"},{disabled:!1,fill:"plain",appearance:"decorative-pink",class:"text-decorative-strong-pink"},{disabled:!1,fill:"plain",appearance:"decorative-purple",class:"text-decorative-strong-purple"},{disabled:!1,fill:"plain",appearance:"decorative-green",class:"text-decorative-strong-green"},{disabled:!1,fill:"plain",appearance:"decorative-turquoise",class:"text-decorative-strong-turquoise"},{disabled:!1,fill:"plain",appearance:"decorative-yellow",class:"text-decorative-strong-yellow"},{disabled:!1,fill:"plain",appearance:"decorative-orange",class:"text-decorative-strong-orange"},{disabled:!1,fill:"plain",appearance:"decorative-red",class:"text-decorative-strong-red"}]}),JD={32:12,40:16,48:20,56:24,72:40},ZD=({appearance:e="base",fill:t="transparent",icon:r,disabled:n=!1,size:o=48,className:a,ref:l,...u})=>{const d=Ks({consumerName:"Spot",mergeWith:{disabled:n}}),p=QD({appearance:e,fill:t,disabled:d});return v.jsx("div",{ref:l,className:Qt(KD({appearance:e,fill:t,size:o}),a),...u,children:v.jsx(r,{size:JD[o],className:p})})},ej=pt("Search",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",d:"m14 14-3.334-3.333m1.2-3.734a4.933 4.933 0 1 1-9.866 0 4.933 4.933 0 0 1 9.867 0Z"})}));var og=function(e,t){return og=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},og(e,t)};function zn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");og(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function tj(e,t,r,n){function o(a){return a instanceof r?a:new r(function(l){l(a)})}return new(r||(r=Promise))(function(a,l){function u(h){try{p(n.next(h))}catch(m){l(m)}}function d(h){try{p(n.throw(h))}catch(m){l(m)}}function p(h){h.done?a(h.value):o(h.value).then(u,d)}p((n=n.apply(e,t||[])).next())})}function tk(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=u(0),l.throw=u(1),l.return=u(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(p){return function(h){return d([p,h])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,p[0]&&(r=0)),r;)try{if(n=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){r.label=p[1];break}if(p[0]===6&&r.label<a[1]){r.label=a[1],a=p;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(p);break}a[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(h){p=[6,h],o=0}finally{n=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Fs(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Bs(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],l;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(u){l={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return a}function Us(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Ns(e){return this instanceof Ns?(this.v=e,this):new Ns(e)}function rj(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",l),o[Symbol.asyncIterator]=function(){return this},o;function l(w){return function(E){return Promise.resolve(E).then(w,m)}}function u(w,E){n[w]&&(o[w]=function(S){return new Promise(function(C,R){a.push([w,S,C,R])>1||d(w,S)})},E&&(o[w]=E(o[w])))}function d(w,E){try{p(n[w](E))}catch(S){y(a[0][3],S)}}function p(w){w.value instanceof Ns?Promise.resolve(w.value.v).then(h,m):y(a[0][2],w)}function h(w){d("next",w)}function m(w){d("throw",w)}function y(w,E){w(E),a.shift(),a.length&&d(a[0][0],a[0][1])}}function nj(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Fs=="function"?Fs(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(l){return new Promise(function(u,d){l=e[a](l),o(u,d,l.done,l.value)})}}function o(a,l,u,d){Promise.resolve(d).then(function(p){a({value:p,done:u})},l)}}const ij=pt("ExternalLink",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m8 8 5-5M9.333 3H13v3.667M6 3H4.333C3.597 3 3 3.597 3 4.333v7.334C3 12.4 3.597 13 4.333 13h7.334C12.4 13 13 12.4 13 11.667V10"})})),oj=kr("inline-flex items-center justify-center gap-4 truncate rounded-xs",{variants:{appearance:{base:"bg-muted-transparent text-base",gray:"bg-muted-transparent text-muted",accent:"bg-accent text-on-accent","accent-subtle":"bg-active-subtle text-active",success:"bg-success-transparent text-success",error:"bg-error-transparent text-error",warning:"bg-warning-transparent text-warning",white:"bg-white text-black"},size:{md:"body-3",sm:"body-4"},variant:{tag:"",media:""},disabled:{true:"bg-disabled text-disabled",false:""}},compoundVariants:[{variant:"tag",size:"md",class:"px-8 py-4"},{variant:"tag",size:"sm",class:"px-4 py-2"},{variant:"media",size:"md",class:"py-4 pr-8 pl-4"},{variant:"media",size:"sm",class:"px-4 py-2"}],defaultVariants:{appearance:"accent",size:"md",disabled:!1}}),sj=({ref:e,className:t,appearance:r,size:n,variant:o,consumerName:a,label:l,disabled:u,leadingContent:d,...p})=>{const h=Ks({consumerName:a,mergeWith:{disabled:u}});return v.jsxs("div",{className:Qt(oj({appearance:r,size:n,variant:o,disabled:!!h}),t),ref:e,...p,children:[d,v.jsx("span",{className:"truncate",children:l})]})},Rx={};function yn(e,t){const r=x.useRef(Rx);return r.current===Rx&&(r.current=e(t)),r}const aj=[];function Dd(e){x.useEffect(e,aj)}const Qa=0;let ci=class rk{static create(){return new rk}currentId=Qa;start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Qa,r()},t)}isStarted(){return this.currentId!==Qa}clear=()=>{this.currentId!==Qa&&(clearTimeout(this.currentId),this.currentId=Qa)};disposeEffect=()=>this.clear};function Vs(){const e=yn(ci.create).current;return Dd(e.disposeEffect),e}const eh=_l[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],lj=eh&&eh!==x.useLayoutEffect?eh:e=>e();function et(e){const t=yn(cj).current;return t.next=e,lj(t.effect),t.trampoline}function cj(){const e={next:void 0,callback:uj,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function uj(){}const dj={..._l};let _x=0;function fj(e,t="mui"){const[r,n]=x.useState(e),o=e||r;return x.useEffect(()=>{r==null&&(_x+=1,n(`${t}-${_x}`))},[r,t]),o}const $x=dj.useId;function Zs(e,t){if($x!==void 0){const r=$x();return e??(t?`${t}-${r}`:r)}return fj(e,t)}const pj=()=>{},lt=typeof document<"u"?x.useLayoutEffect:pj;function hj(e){const t=x.useRef(!0);t.current&&(t.current=!1,e())}function jd(){return typeof window<"u"}function Qi(e){return Zg(e)?(e.nodeName||"").toLowerCase():"#document"}function tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fn(e){var t;return(t=(Zg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zg(e){return jd()?e instanceof Node||e instanceof tr(e).Node:!1}function gt(e){return jd()?e instanceof Element||e instanceof tr(e).Element:!1}function Kt(e){return jd()?e instanceof HTMLElement||e instanceof tr(e).HTMLElement:!1}function bl(e){return!jd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tr(e).ShadowRoot}function Ji(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&o!=="inline"&&o!=="contents"}function mj(e){return/^(table|td|th)$/.test(Qi(e))}function Md(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gj=/transform|translate|scale|rotate|perspective|filter/,vj=/paint|layout|strict|content/,Ro=e=>!!e&&e!=="none";let th;function ev(e){const t=gt(e)?zr(e):e;return Ro(t.transform)||Ro(t.translate)||Ro(t.scale)||Ro(t.rotate)||Ro(t.perspective)||!zd()&&(Ro(t.backdropFilter)||Ro(t.filter))||gj.test(t.willChange||"")||vj.test(t.contain||"")}function yj(e){let t=ui(e);for(;Kt(t)&&!ii(t);){if(ev(t))return t;if(Md(t))return null;t=ui(t)}return null}function zd(){return th==null&&(th=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),th}function ii(e){return/^(html|body|#document)$/.test(Qi(e))}function zr(e){return tr(e).getComputedStyle(e)}function Fd(e){return gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ui(e){if(Qi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bl(e)&&e.host||Fn(e);return bl(t)?t.host:t}function nk(e){const t=ui(e);return ii(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Ji(t)?t:nk(t)}function xl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=nk(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),l=tr(o);if(a){const u=sg(l);return t.concat(l,l.visualViewport||[],Ji(o)?o:[],u&&r?xl(u):[])}else return t.concat(o,xl(o,[],r))}function sg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ea=typeof navigator<"u",rh=wj(),ik=Ej(),ok=Sj(),sk=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ak=rh.platform==="MacIntel"&&rh.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(rh.platform),bj=ea&&/apple/i.test(navigator.vendor),ag=ea&&/android/i.test(ik)||/android/i.test(ok);ea&&ik.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const xj=ok.includes("jsdom/");function wj(){if(!ea)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Sj(){if(!ea)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function Ej(){if(!ea)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}function _t(e){return e?.ownerDocument||document}const bu=null;let Cj=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let o=0;o<r.length;o+=1)r[o]?.(t)};request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}};const xu=new Cj;let Mi=class lk{static create(){return new lk}static request(t){return xu.request(t)}static cancel(t){return xu.cancel(t)}currentId=bu;request(t){this.cancel(),this.currentId=xu.request(()=>{this.currentId=bu,t()})}cancel=()=>{this.currentId!==bu&&(xu.cancel(this.currentId),this.currentId=bu)};disposeEffect=()=>this.cancel};function tv(){const e=yn(Mi.create).current;return Dd(e.disposeEffect),e}function ck(){}const Rr=Object.freeze({});let Ax={},Tx={},Lx="";function kj(e){if(typeof document>"u")return!1;const t=_t(e);return tr(t).innerWidth-t.documentElement.clientWidth>0}function Rj(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const t=_t(e),r=t.documentElement,n=t.body,o=Ji(r)?r:n,a=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const u=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=a,r.style.scrollbarGutter=l,u===d}function _j(e){const t=_t(e),r=t.documentElement,n=t.body,o=Ji(r)?r:n,a={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,a)}}function $j(e){const t=_t(e),r=t.documentElement,n=t.body,o=tr(r);let a=0,l=0,u=!1;const d=Mi.create();if(sk&&(o.visualViewport?.scale??1)!==1)return()=>{};function p(){const y=o.getComputedStyle(r),w=o.getComputedStyle(n),E=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=r.scrollTop,l=r.scrollLeft,Ax={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},Lx=r.style.scrollBehavior,Tx={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};const S=r.scrollHeight>r.clientHeight,C=r.scrollWidth>r.clientWidth,R=y.overflowY==="scroll"||w.overflowY==="scroll",k=y.overflowX==="scroll"||w.overflowX==="scroll",$=Math.max(0,o.innerWidth-n.clientWidth),A=Math.max(0,o.innerHeight-n.clientHeight),D=parseFloat(w.marginTop)+parseFloat(w.marginBottom),N=parseFloat(w.marginLeft)+parseFloat(w.marginRight),P=Ji(r)?r:n;if(u=Rj(e),u){r.style.scrollbarGutter=E,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(S||R)&&(r.style.overflowY="scroll"),(C||k)&&(r.style.overflowX="scroll"),Object.assign(n.style,{position:"relative",height:D||A?`calc(100dvh - ${D+A}px)`:"100dvh",width:N||$?`calc(100vw - ${N+$}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),n.scrollTop=a,n.scrollLeft=l,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function h(){Object.assign(r.style,Ax),Object.assign(n.style,Tx),u||(r.scrollTop=a,r.scrollLeft=l,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=Lx)}function m(){h(),d.request(p)}return p(),o.addEventListener("resize",m),()=>{d.cancel(),h(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",m)}}let Aj=class{lockCount=0;restore=null;timeoutLock=ci.create();timeoutUnlock=ci.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=_t(t).documentElement,n=tr(r).getComputedStyle(r).overflowY;if(n==="hidden"||n==="clip"){this.restore=ck;return}const o=ak||!kj(t);this.restore=o?_j(t):$j(t)}};const Tj=new Aj;function Lj(e=!0,t=null){lt(()=>{if(e)return Tj.acquire(t)},[e,t])}function Ij(e,t){return function(r,...n){const o=new URL(e);return o.searchParams.set("code",r.toString()),n.forEach(a=>o.searchParams.append("args[]",a)),`${t} error #${r}; visit ${o} for the full message.`}}const Uo=Ij("https://base-ui.com/production-error","Base UI"),Oj=500,Nj={style:{transition:"none"}},uk="data-base-ui-click-trigger",Pj={fallbackAxisSide:"end"},Dj={clipPath:"inset(50%)",position:"fixed",top:0,left:0},jj=x.createContext(void 0);function Mj(){return x.useContext(jj)?.direction??"ltr"}function zj(e){const t=x.useRef(""),r=x.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:x.useCallback(n=>{if(n.detail===0){e(n,"keyboard");return}"pointerType"in n?e(n,n.pointerType):e(n,t.current),t.current=""},[e]),onPointerDown:r}}function Fj(e,t){const r=x.useRef(e),n=et(t);lt(()=>{r.current!==e&&n(r.current)},[e,n]),lt(()=>{r.current=e},[e])}function Bj(e){const[t,r]=x.useState(null),n=et((l,u)=>{e||r(u||(ak?"touch":""))});Fj(e,l=>{l&&!e&&r(null)});const{onClick:o,onPointerDown:a}=zj(n);return x.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:a}}),[t,o,a])}function Ft(e,t,r,n){let o=!1,a=!1;const l=Rr;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){a=!0},get isCanceled(){return o},get isPropagationAllowed(){return a},trigger:r,...l}}function dk(){const e=new Map;return{emit(t,r){e.get(t)?.forEach(n=>n(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){e.get(t)?.delete(r)}}}let Uj=class{nodesRef={current:[]};events=dk();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const r=this.nodesRef.current.findIndex(n=>n===t);r!==-1&&this.nodesRef.current.splice(r,1)}};var nh={exports:{}},ih={},Ix;function Vj(){if(Ix)return ih;Ix=1;var e=Ee;function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,y){var w=y(),E=n({inst:{value:w,getSnapshot:y}}),S=E[0].inst,C=E[1];return a(function(){S.value=w,S.getSnapshot=y,d(S)&&C({inst:S})},[m,w,y]),o(function(){return d(S)&&C({inst:S}),m(function(){d(S)&&C({inst:S})})},[m]),l(w),w}function d(m){var y=m.getSnapshot;m=m.value;try{var w=y();return!r(m,w)}catch{return!0}}function p(m,y){return y()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return ih.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,ih}var Ox;function fk(){return Ox||(Ox=1,nh.exports=Vj()),nh.exports}var Wj=fk(),oh={exports:{}},sh={},Nx;function Hj(){if(Nx)return sh;Nx=1;var e=Ee,t=fk();function r(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return sh.useSyncExternalStoreWithSelector=function(p,h,m,y,w){var E=a(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=u(function(){function R(N){if(!k){if(k=!0,$=N,N=y(N),w!==void 0&&S.hasValue){var P=S.value;if(w(P,N))return A=P}return A=N}if(P=A,n($,N))return P;var I=y(N);return w!==void 0&&w(P,I)?($=N,P):($=N,A=I)}var k=!1,$,A,D=m===void 0?null:m;return[function(){return R(h())},D===null?void 0:function(){return R(D())}]},[h,m,y,w]);var C=o(p,E[0],E[1]);return l(function(){S.hasValue=!0,S.value=C},[C]),d(C),C},sh}var Px;function qj(){return Px||(Px=1,oh.exports=Hj()),oh.exports}var Gj=qj();const Xj=parseInt(x.version,10);function rv(e){return Xj>=e}const Yj=rv(19),Kj=Yj?Jj:Zj;function pk(e,t,r,n,o){return Kj(e,t,r,n,o)}function Qj(e,t,r,n,o){const a=x.useCallback(()=>t(e.getSnapshot(),r,n,o),[e,t,r,n,o]);return Wj.useSyncExternalStore(e.subscribe,a,a)}function Jj(e,t,r,n,o){return Qj(e,t,r,n,o)}function Zj(e,t,r,n,o){return Gj.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,r,n,o))}let e6=class{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,n,o){return pk(this,t,r,n,o)}},hk=class extends e6{constructor(t,r={},n){super(t),this.context=r,this.selectors=n}useSyncedValue(t,r){x.useDebugValue(t),lt(()=>{this.state[t]!==r&&this.set(t,r)},[t,r])}useSyncedValueWithCleanup(t,r){const n=this;lt(()=>(n.state[t]!==r&&n.set(t,r),()=>{n.set(t,void 0)}),[n,t,r])}useSyncedValues(t){const r=this,n=Object.values(t);lt(()=>{r.update(t)},[r,...n])}useControlledProp(t,r){x.useDebugValue(t);const n=r!==void 0;lt(()=>{n&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})},[t,r,n])}select(t,r,n,o){const a=this.selectors[t];return a(this.state,r,n,o)}useState(t,r,n,o){return x.useDebugValue(t),pk(this,this.selectors[t],r,n,o)}useContextCallback(t,r){x.useDebugValue(t);const n=et(r??ck);this.context[t]=n}useStateSetter(t){const r=x.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(t,n)}),r.current}observe(t,r){let n;typeof t=="function"?n=t:n=this.selectors[t];let o=n(this.state);return r(o,o,this),this.subscribe(a=>{const l=n(a);if(!Object.is(o,l)){const u=o;o=l,r(l,u,this)}})}};var od=Symbol("NOT_FOUND");function t6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function r6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function n6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Dx=e=>Array.isArray(e)?e:[e];function i6(e){const t=Array.isArray(e[0])?e[0]:e;return n6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function o6(e,t){const r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}function s6(e){let t;return{get(r){return t&&e(t.key,r)?t.value:od},put(r,n){t={key:r,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function a6(e,t){let r=[];function n(u){const d=r.findIndex(p=>t(u,p.key));if(d>-1){const p=r[d];return d>0&&(r.splice(d,1),r.unshift(p)),p.value}return od}function o(u,d){n(u)===od&&(r.unshift({key:u,value:d}),r.length>e&&r.pop())}function a(){return r}function l(){r=[]}return{get:n,put:o,getEntries:a,clear:l}}var l6=(e,t)=>e===t;function c6(e){return function(t,r){if(t===null||r===null||t.length!==r.length)return!1;const{length:n}=t;for(let o=0;o<n;o++)if(!e(t[o],r[o]))return!1;return!0}}function u6(e,t){const r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=l6,maxSize:o=1,resultEqualityCheck:a}=r,l=c6(n);let u=0;const d=o<=1?s6(l):a6(o,l);function p(){let h=d.get(arguments);if(h===od){if(h=e.apply(null,arguments),u++,a){const m=d.getEntries().find(y=>a(y.value,h));m&&(h=m.value,u!==0&&u--)}d.put(arguments,h)}return h}return p.clearCache=()=>{d.clear(),p.resetResultsCount()},p.resultsCount=()=>u,p.resetResultsCount=()=>{u=0},p}var d6=class{constructor(t){this.value=t}deref(){return this.value}},f6=typeof WeakRef<"u"?WeakRef:d6,p6=0,jx=1;function wu(){return{s:p6,v:void 0,o:null,p:null}}function mk(e,t={}){let r=wu();const{resultEqualityCheck:n}=t;let o,a=0;function l(){let u=r;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const w=arguments[m];if(typeof w=="function"||typeof w=="object"&&w!==null){let E=u.o;E===null&&(u.o=E=new WeakMap);const S=E.get(w);S===void 0?(u=wu(),E.set(w,u)):u=S}else{let E=u.p;E===null&&(u.p=E=new Map);const S=E.get(w);S===void 0?(u=wu(),E.set(w,u)):u=S}}const p=u;let h;if(u.s===jx)h=u.v;else if(h=e.apply(null,arguments),a++,n){const m=o?.deref?.()??o;m!=null&&n(m,h)&&(h=m,a!==0&&a--),o=typeof h=="object"&&h!==null||typeof h=="function"?new f6(h):h}return p.s=jx,p.v=h,h}return l.clearCache=()=>{r=wu(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function gk(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,l=0,u,d={},p=o.pop();typeof p=="object"&&(d=p,p=o.pop()),t6(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const h={...r,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:w=mk,argsMemoizeOptions:E=[]}=h,S=Dx(y),C=Dx(E),R=i6(o),k=m(function(){return a++,p.apply(null,arguments)},...S),$=w(function(){l++;const A=o6(R,arguments);return u=k.apply(null,A),u},...C);return Object.assign($,{resultFunc:p,memoizedResultFunc:k,dependencies:R,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:w})};return Object.assign(n,{withTypes:()=>n}),n}var h6=gk(mk),m6=Object.assign((e,t=h6)=>{r6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(o=>e[o]);return t(n,(...o)=>o.reduce((a,l,u)=>(a[r[u]]=l,a),{}))},{withTypes:()=>m6});gk({memoize:u6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ut=(e,t,r,n,o,a,...l)=>{if(l.length>0)throw new Error(Uo(1));let u;if(e)u=e;else throw new Error("Missing arguments");return u};function g6(e){e.preventDefault(),e.stopPropagation()}function v6(e){return"nativeEvent"in e}function y6(e){return e.pointerType===""&&e.isTrusted?!0:ag&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function b6(e){return xj?!1:!ag&&e.width===0&&e.height===0||ag&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function wl(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function vk(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const x6={open:ut(e=>e.open),domReferenceElement:ut(e=>e.domReferenceElement),referenceElement:ut(e=>e.positionReference??e.referenceElement),floatingElement:ut(e=>e.floatingElement),floatingId:ut(e=>e.floatingId)};let nv=class extends hk{constructor(t){const{nested:r,noEmit:n,onOpenChange:o,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:dk(),nested:r,noEmit:n,triggerElements:a},x6)}setOpen=(t,r)=>{if((!t||!this.state.open||vk(r.event))&&(this.context.dataRef.current.openEvent=t?r.event:void 0),!this.context.noEmit){const n={open:t,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",n)}this.context.onOpenChange?.(t,r)}},iv=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,r){const n=this.idMap.get(t);n!==r&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(r),this.idMap.set(t,r))}delete(t){const r=this.idMap.get(t);r&&(this.elementsSet.delete(r),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const r of this.elementsSet)if(t(r))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function w6(){return new nv({open:!1,floatingElement:null,referenceElement:null,triggerElements:new iv,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function S6(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:w6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Rr,inactiveTriggerProps:Rr,popupProps:Rr}}const Su=ut(e=>e.triggerIdProp??e.activeTriggerId),E6={open:ut(e=>e.openProp??e.open),mounted:ut(e=>e.mounted),transitionStatus:ut(e=>e.transitionStatus),floatingRootContext:ut(e=>e.floatingRootContext),preventUnmountingOnClose:ut(e=>e.preventUnmountingOnClose),payload:ut(e=>e.payload),activeTriggerId:Su,activeTriggerElement:ut(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ut((e,t)=>t!==void 0&&Su(e)===t),isOpenedByTrigger:ut((e,t)=>t!==void 0&&Su(e)===t&&e.open),isMountedByTrigger:ut((e,t)=>t!==void 0&&Su(e)===t&&e.mounted),triggerProps:ut((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ut(e=>e.popupProps),popupElement:ut(e=>e.popupElement),positionerElement:ut(e=>e.positionerElement)},yk=x.createContext(null),bk=x.createContext(null),Vo=()=>x.useContext(yk)?.id||null,ta=e=>{const t=x.useContext(bk);return e??t};function C6(e){const t=Zs(),r=ta(e),n=Vo();return lt(()=>{if(!t)return;const o={id:t,parentId:n};return r?.addNode(o),()=>{r?.removeNode(o)}},[r,t,n]),t}function k6(e){const{children:t,id:r}=e,n=Vo();return v.jsx(yk.Provider,{value:x.useMemo(()=>({id:r,parentId:n}),[r,n]),children:t})}function R6(e){const{children:t,externalTree:r}=e,n=yn(()=>r??new Uj).current;return v.jsx(bk.Provider,{value:n,children:t})}function _6(e,t=!1,r=!1){const[n,o]=x.useState(e&&t?"idle":void 0),[a,l]=x.useState(e);return e&&!a&&(l(!0),o("starting")),!e&&a&&n!=="ending"&&!r&&o("ending"),!e&&!a&&n==="ending"&&o(void 0),lt(()=>{if(!e&&a&&n!=="ending"&&r){const u=Mi.request(()=>{o("ending")});return()=>{Mi.cancel(u)}}},[e,a,n,r]),lt(()=>{if(!e||t)return;const u=Mi.request(()=>{o(void 0)});return()=>{Mi.cancel(u)}},[t,e]),lt(()=>{if(!e||!t)return;e&&a&&n!=="idle"&&o("starting");const u=Mi.request(()=>{o("idle")});return()=>{Mi.cancel(u)}},[t,e,a,o,n]),x.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:n}),[a,n])}function Zn(e){return e==null?e:"current"in e?e.current:e}let Sl=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const $6={[Sl.startingStyle]:""},A6={[Sl.endingStyle]:""},xk={transitionStatus(e){return e==="starting"?$6:e==="ending"?A6:null}};function wk(e,t=!1,r=!0){const n=tv();return et((o,a=null)=>{n.cancel();function l(){Lr.flushSync(o)}const u=Zn(e);if(u==null)return;const d=u;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let p=function(){const m=Sl.startingStyle;if(!d.hasAttribute(m)){n.request(h);return}const y=new MutationObserver(()=>{d.hasAttribute(m)||(y.disconnect(),h())});y.observe(d,{attributes:!0,attributeFilter:[m]}),a?.addEventListener("abort",()=>y.disconnect(),{once:!0})},h=function(){Promise.all(d.getAnimations().map(m=>m.finished)).then(()=>{a?.aborted||l()}).catch(()=>{const m=d.getAnimations();if(r){if(a?.aborted)return;l()}else m.length>0&&m.some(y=>y.pending||y.playState!=="finished")&&h()})};if(t){p();return}n.request(h)}})}function Sk(e){const{enabled:t=!0,open:r,ref:n,onComplete:o}=e,a=et(o),l=wk(n,r,!1);x.useEffect(()=>{if(!t)return;const u=new AbortController;return l(a,u.signal),()=>{u.abort()}},[t,r,a,l])}function T6(e,t){const r=x.useRef(null),n=x.useRef(null);return x.useCallback(o=>{if(e!==void 0){if(r.current!==null){const a=r.current,l=n.current,u=t.context.triggerElements.getById(a);l&&u===l&&t.context.triggerElements.delete(a),r.current=null,n.current=null}o!==null&&(r.current=e,n.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function L6(e,t,r,n){const o=r.useState("isMountedByTrigger",e),a=T6(e,r),l=et(u=>{if(a(u),!u||!r.select("open"))return;const d=r.select("activeTriggerId");if(d===e){r.update({activeTriggerElement:u,...n});return}d==null&&r.update({activeTriggerId:e,activeTriggerElement:u,...n})});return lt(()=>{o&&r.update({activeTriggerElement:t.current,...n})},[o,r,t,...Object.values(n)]),{registerTrigger:l,isMountedByThisTrigger:o}}function I6(e){const t=e.useState("open");lt(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const r=e.context.triggerElements.entries().next();if(!r.done){const[n,o]=r.value;e.update({activeTriggerId:n,activeTriggerElement:o})}}},[t,e])}function O6(e,t,r){const{mounted:n,setMounted:o,transitionStatus:a}=_6(e);t.useSyncedValues({mounted:n,transitionStatus:a});const l=et(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),r?.(),t.context.onOpenChangeComplete?.(!1)}),u=t.useState("preventUnmountingOnClose");return Sk({enabled:!u,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}function N6(e){const{popupStore:t,noEmit:r=!1,treatPopupAsFloatingElement:n=!1,onOpenChange:o}=e,a=Zs(),l=Vo()!=null,u=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(n?"popupElement":"positionerElement"),h=t.context.triggerElements,m=yn(()=>new nv({open:u,referenceElement:d,floatingElement:p,triggerElements:h,onOpenChange:o,floatingId:a,nested:l,noEmit:r})).current;return lt(()=>{const y={open:u,floatingId:a,referenceElement:d,floatingElement:p};gt(d)&&(y.domReferenceElement=d),m.state.positionReference===m.state.referenceElement&&(y.positionReference=d),m.update(y)},[u,a,d,p,m]),m.context.onOpenChange=o,m.context.nested=l,m.context.noEmit=r,m}function sd(e){return`data-base-ui-${e}`}const lg="data-base-ui-focusable",Ek="active",Ck="selected",kk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function $o(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function st(e,t){if(!e||!t)return!1;const r=t.getRootNode?.();if(e.contains(t))return!0;if(r&&bl(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Rk(e,t){if(!gt(e))return!1;const r=e;if(t.hasElement(r))return!r.hasAttribute("data-trigger-disabled");for(const[,n]of t.entries())if(st(n,r))return!n.hasAttribute("data-trigger-disabled");return!1}function gn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function hn(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}function P6(e){return e.matches("html,body")}function ov(e){return Kt(e)&&e.matches(kk)}function Mx(e){return e?e.getAttribute("role")==="combobox"&&ov(e):!1}function cg(e){return e?e.hasAttribute(lg)?e:e.querySelector(`[${lg}]`)||e:null}function oi(e,t,r=!0){return e.filter(n=>n.parentId===t&&(!r||n.context?.open)).flatMap(n=>[n,...oi(e,n.id,r)])}function zx(e,t){let r=[],n=e.find(o=>o.id===t)?.parentId;for(;n;){const o=e.find(a=>a.id===n);n=o?.parentId,o&&(r=r.concat(o))}return r}const Ws="trigger-press",Cr="trigger-hover",_k="outside-press",El="focus-out",$k="escape-key",D6="imperative-action",j6={intentional:"onClick",sloppy:"onPointerDown"};function M6(){return!1}function z6(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function F6(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingElement"),{dataRef:a}=r.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:p="sloppy",referencePress:h=M6,referencePressEvent:m="sloppy",bubbles:y,externalTree:w}=t,E=ta(w),S=et(typeof d=="function"?d:()=>!1),C=typeof d=="function"?S:d,R=C!==!1,k=et(()=>p),$=x.useRef(!1),A=x.useRef(!1),D=x.useRef(!1),{escapeKey:N,outsidePress:P}=z6(y),I=x.useRef(null),re=Vs(),Z=Vs(),ee=et(()=>{Z.clear(),a.current.insideReactTree=!1}),ne=x.useRef(!1),X=x.useRef(""),F=et(h),V=et(T=>{if(!n||!l||!u||T.key!=="Escape"||ne.current)return;const M=a.current.floatingContext?.nodeId,te=E?oi(E.nodesRef.current,M):[];if(!N&&te.length>0){let fe=!0;if(te.forEach(be=>{be.context?.open&&!be.context.dataRef.current.__escapeKeyBubbles&&(fe=!1)}),!fe)return}const le=v6(T)?T.nativeEvent:T,G=Ft($k,le);r.setOpen(!1,G),!N&&!G.isPropagationAllowed&&T.stopPropagation()}),H=et(()=>{a.current.insideReactTree=!0,Z.start(0,ee)});x.useEffect(()=>{if(!n||!l)return;a.current.__escapeKeyBubbles=N,a.current.__outsidePressBubbles=P;const T=new ci,M=new ci;function te(){T.clear(),ne.current=!0}function le(){T.start(zd()?5:0,()=>{ne.current=!1})}function G(){D.current=!0,M.start(0,()=>{D.current=!1})}function fe(){$.current=!1,A.current=!1}function be(){const oe=X.current,Se=oe==="pen"||!oe?"mouse":oe,Je=k(),ht=typeof Je=="function"?Je():Je;return typeof ht=="string"?ht:ht[Se]}function pe(oe){const Se=be();return Se==="intentional"&&oe.type!=="click"||Se==="sloppy"&&oe.type==="click"}function ue(oe){const Se=a.current.floatingContext?.nodeId,Je=E&&oi(E.nodesRef.current,Se).some(ht=>hn(oe,ht.context?.elements.floating));return hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement"))||Je}function ge(oe){if(pe(oe)){ee();return}if(a.current.insideReactTree){ee();return}const Se=gn(oe),Je=`[${sd("inert")}]`;let ht=Array.from(_t(r.select("floatingElement")).querySelectorAll(Je));const Ut=gt(Se)?Se.getRootNode():null;bl(Ut)&&(ht=ht.concat(Array.from(Ut.querySelectorAll(Je))));const Vt=r.context.triggerElements;if(Se&&(Vt.hasElement(Se)||Vt.hasMatchingElement(rt=>st(rt,Se))))return;let jt=gt(Se)?Se:null;for(;jt&&!ii(jt);){const rt=ui(jt);if(ii(rt)||!gt(rt))break;jt=rt}if(ht.length&&gt(Se)&&!P6(Se)&&!st(Se,r.select("floatingElement"))&&ht.every(rt=>!st(jt,rt)))return;if(Kt(Se)&&!("touches"in oe)){const rt=ii(Se),q=zr(Se),Q=/auto|scroll/,ie=rt||Q.test(q.overflowX),se=rt||Q.test(q.overflowY),Ce=ie&&Se.clientWidth>0&&Se.scrollWidth>Se.clientWidth,Ve=se&&Se.clientHeight>0&&Se.scrollHeight>Se.clientHeight,Qe=q.direction==="rtl",Pe=Ve&&(Qe?oe.offsetX<=Se.offsetWidth-Se.clientWidth:oe.offsetX>Se.clientWidth),he=Ce&&oe.offsetY>Se.clientHeight;if(Pe||he)return}if(ue(oe))return;if(be()==="intentional"&&D.current){M.clear(),D.current=!1;return}if(typeof C=="function"&&!C(oe))return;const Wt=a.current.floatingContext?.nodeId,bt=E?oi(E.nodesRef.current,Wt):[];if(bt.length>0){let rt=!0;if(bt.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__outsidePressBubbles&&(rt=!1)}),!rt)return}r.setOpen(!1,Ft(_k,oe)),ee()}function qe(oe){be()!=="sloppy"||oe.pointerType==="touch"||!r.select("open")||!l||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement"))||ge(oe)}function Xe(oe){if(be()!=="sloppy"||!r.select("open")||!l||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement")))return;const Se=oe.touches[0];Se&&(I.current={startTime:Date.now(),startX:Se.clientX,startY:Se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},re.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function we(oe){X.current="touch";const Se=gn(oe);function Je(){Xe(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}function ze(oe){if(re.clear(),oe.type==="pointerdown"&&(X.current=oe.pointerType),oe.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const Se=gn(oe);function Je(){oe.type==="pointerdown"?qe(oe):ge(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}function We(oe){if(!$.current)return;const Se=A.current;if(fe(),be()==="intentional"){if(oe.type==="pointercancel"){Se&&G();return}if(!ue(oe)){if(Se){G();return}typeof C=="function"&&!C(oe)||(M.clear(),D.current=!0,ee())}}}function tt(oe){if(be()!=="sloppy"||!I.current||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement")))return;const Se=oe.touches[0];if(!Se)return;const Je=Math.abs(Se.clientX-I.current.startX),ht=Math.abs(Se.clientY-I.current.startY),Ut=Math.sqrt(Je*Je+ht*ht);Ut>5&&(I.current.dismissOnTouchEnd=!0),Ut>10&&(ge(oe),re.clear(),I.current=null)}function De(oe){const Se=gn(oe);function Je(){tt(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}function Fe(oe){be()!=="sloppy"||!I.current||hn(oe,r.select("floatingElement"))||hn(oe,r.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&ge(oe),re.clear(),I.current=null)}function ct(oe){const Se=gn(oe);function Je(){Fe(oe),Se?.removeEventListener(oe.type,Je)}Se?.addEventListener(oe.type,Je)}const Ne=_t(o);return u&&(Ne.addEventListener("keydown",V),Ne.addEventListener("compositionstart",te),Ne.addEventListener("compositionend",le)),R&&(Ne.addEventListener("click",ze,!0),Ne.addEventListener("pointerdown",ze,!0),Ne.addEventListener("pointerup",We,!0),Ne.addEventListener("pointercancel",We,!0),Ne.addEventListener("mousedown",ze,!0),Ne.addEventListener("mouseup",We,!0),Ne.addEventListener("touchstart",we,!0),Ne.addEventListener("touchmove",De,!0),Ne.addEventListener("touchend",ct,!0)),()=>{u&&(Ne.removeEventListener("keydown",V),Ne.removeEventListener("compositionstart",te),Ne.removeEventListener("compositionend",le)),R&&(Ne.removeEventListener("click",ze,!0),Ne.removeEventListener("pointerdown",ze,!0),Ne.removeEventListener("pointerup",We,!0),Ne.removeEventListener("pointercancel",We,!0),Ne.removeEventListener("mousedown",ze,!0),Ne.removeEventListener("mouseup",We,!0),Ne.removeEventListener("touchstart",we,!0),Ne.removeEventListener("touchmove",De,!0),Ne.removeEventListener("touchend",ct,!0)),T.clear(),M.clear(),fe(),D.current=!1}},[a,o,u,R,C,n,l,N,P,V,ee,k,E,r,re]),x.useEffect(ee,[C,ee]);const O=x.useMemo(()=>({onKeyDown:V,[j6[m]]:T=>{F()&&r.setOpen(!1,Ft(Ws,T.nativeEvent))},...m!=="intentional"&&{onClick(T){F()&&r.setOpen(!1,Ft(Ws,T.nativeEvent))}}}),[V,r,m,F]),L=et(T=>{if(!n||!l||T.button!==0)return;const M=gn(T.nativeEvent);st(r.select("floatingElement"),M)&&($.current||($.current=!0,A.current=!1))}),U=et(T=>{!n||!l||(T.defaultPrevented||T.nativeEvent.defaultPrevented)&&$.current&&(A.current=!0)}),z=x.useMemo(()=>({onKeyDown:V,onPointerDown:U,onMouseDown:U,onClickCapture:H,onMouseDownCapture(T){H(),L(T)},onPointerDownCapture(T){H(),L(T)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[V,H,L,U]);return x.useMemo(()=>l?{reference:O,floating:z,trigger:O}:{},[l,O,z])}const B6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function U6(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingId"),a=r.useState("domReferenceElement"),l=r.useState("floatingElement"),{role:u="dialog"}=t,d=Zs(),p=a?.id||d,h=x.useMemo(()=>cg(l)?.id||o,[l,o]),m=B6.get(u)??u,y=Vo()!=null,w=x.useMemo(()=>m==="tooltip"||u==="label"?Rr:{"aria-haspopup":m==="alertdialog"?"dialog":m,"aria-expanded":"false",...m==="listbox"&&{role:"combobox"},...m==="menu"&&y&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[m,y,u]),E=x.useMemo(()=>m==="tooltip"||u==="label"?{[`aria-${u==="label"?"labelledby":"describedby"}`]:n?h:void 0}:{...w,"aria-expanded":n?"true":"false","aria-controls":n?h:void 0,...m==="menu"&&{id:p}},[m,h,n,p,u,w]),S=x.useMemo(()=>{const R={id:h,...m&&{role:m}};return m==="tooltip"||u==="label"?R:{...R,...m==="menu"&&{"aria-labelledby":p}}},[m,h,p,u]),C=x.useCallback(({active:R,selected:k})=>{const $={role:"option",...R&&{id:`${h}-fui-option`}};switch(u){case"select":case"combobox":return{...$,"aria-selected":k}}return{}},[h,u]);return x.useMemo(()=>({reference:E,floating:S,item:C,trigger:w}),[E,S,w,C])}function Nn(e){const t=yn(V6,e).current;return t.next=e,lt(t.effect),t}function V6(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let Fx=0;function ah(e,t={}){const{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(Fx);const a=()=>e?.focus({preventScroll:r});o?a():Fx=requestAnimationFrame(a)}const W6=["top","right","bottom","left"],Hs=Math.min,Mr=Math.max,ad=Math.round,Eu=Math.floor,Pn=e=>({x:e,y:e}),H6={left:"right",right:"left",bottom:"top",top:"bottom"};function ug(e,t,r){return Mr(e,Hs(t,r))}function di(e,t){return typeof e=="function"?e(t):e}function $r(e){return e.split("-")[0]}function Zi(e){return e.split("-")[1]}function sv(e){return e==="x"?"y":"x"}function av(e){return e==="y"?"height":"width"}function Xr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function lv(e){return sv(Xr(e))}function q6(e,t,r){r===void 0&&(r=!1);const n=Zi(e),o=lv(e),a=av(o);let l=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=ld(l)),[l,ld(l)]}function G6(e){const t=ld(e);return[dg(e),t,dg(t)]}function dg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Bx=["left","right"],Ux=["right","left"],X6=["top","bottom"],Y6=["bottom","top"];function K6(e,t,r){switch(e){case"top":case"bottom":return r?t?Ux:Bx:t?Bx:Ux;case"left":case"right":return t?X6:Y6;default:return[]}}function Q6(e,t,r,n){const o=Zi(e);let a=K6($r(e),r==="start",n);return o&&(a=a.map(l=>l+"-"+o),t&&(a=a.concat(a.map(dg)))),a}function ld(e){const t=$r(e);return H6[t]+e.slice(t.length)}function J6(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ak(e){return typeof e!="number"?J6(e):{top:e,right:e,bottom:e,left:e}}function cd(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Z6(e){return zr(e).display!=="none"}function Tk(e=[]){const t=e.map(p=>p?.reference),r=e.map(p=>p?.floating),n=e.map(p=>p?.item),o=e.map(p=>p?.trigger),a=x.useCallback(p=>Cu(p,e,"reference"),t),l=x.useCallback(p=>Cu(p,e,"floating"),r),u=x.useCallback(p=>Cu(p,e,"item"),n),d=x.useCallback(p=>Cu(p,e,"trigger"),o);return x.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:u,getTriggerProps:d}),[a,l,u,d])}function Cu(e,t,r){const n=new Map,o=r==="item",a={};r==="floating"&&(a.tabIndex=-1,a[lg]="");for(const l in e)o&&e&&(l===Ek||l===Ck)||(a[l]=e[l]);for(let l=0;l<t.length;l+=1){let u;const d=t[l]?.[r];typeof d=="function"?u=e?d(e):null:u=d,u&&Vx(a,u,o,n)}return Vx(a,e,o,n),a}function Vx(e,t,r,n){for(const o in t){const a=t[o];r&&(o===Ek||o===Ck)||(o.startsWith("on")?(n.has(o)||n.set(o,[]),typeof a=="function"&&(n.get(o)?.push(a),e[o]=(...l)=>n.get(o)?.map(u=>u(...l)).find(u=>u!==void 0))):e[o]=a)}}function fg(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const ll={};function Lk(e,t,r,n,o){let a={...pg(e,ll)};return t&&(a=zu(a,t)),r&&(a=zu(a,r)),n&&(a=zu(a,n)),a}function eM(e){if(e.length===0)return ll;if(e.length===1)return pg(e[0],ll);let t={...pg(e[0],ll)};for(let r=1;r<e.length;r+=1)t=zu(t,e[r]);return t}function zu(e,t){return Ik(t)?t(e):tM(e,t)}function tM(e,t){if(!t)return e;for(const r in t){const n=t[r];switch(r){case"style":{e[r]=fg(e.style,n);break}case"className":{e[r]=Ok(e.className,n);break}default:rM(r,n)?e[r]=nM(e[r],n):e[r]=n}}return e}function rM(e,t){const r=e.charCodeAt(0),n=e.charCodeAt(1),o=e.charCodeAt(2);return r===111&&n===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Ik(e){return typeof e=="function"}function pg(e,t){return Ik(e)?e(t):e??ll}function nM(e,t){return t?e?r=>{if(iM(r)){const o=r;hg(o);const a=t(o);return o.baseUIHandlerPrevented||e?.(o),a}const n=t(r);return e?.(r),n}:t:e}function hg(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ok(e,t){return t?e?t+" "+e:t:e}function iM(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}let cv=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Sl.startingStyle]="startingStyle",e[e.endingStyle=Sl.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),mg=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const oM={[mg.popupOpen]:""},sM={[mg.popupOpen]:"",[mg.pressed]:""},aM={[cv.open]:""},lM={[cv.closed]:""},cM={[cv.anchorHidden]:""},uM={open(e){return e?oM:null}},dM={open(e){return e?sM:null}},uv={open(e){return e?aM:lM},anchorHidden(e){return e?cM:null}};function ud(e,t,r,n){const o=yn(Nk).current;return pM(o,e,t,r,n)&&Pk(o,[e,t,r,n]),o.callback}function fM(e){const t=yn(Nk).current;return hM(t,e)&&Pk(t,e),t.callback}function Nk(){return{callback:null,cleanup:null,refs:[]}}function pM(e,t,r,n,o){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==n||e.refs[3]!==o}function hM(e,t){return e.refs.length!==t.length||e.refs.some((r,n)=>r!==t[n])}function Pk(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const n=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=null)switch(typeof a){case"function":{const l=a(r);typeof l=="function"&&(n[o]=l);break}case"object":{a.current=r;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=null)switch(typeof a){case"function":{const l=n[o];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}function Wx(e){if(!x.isValidElement(e))return null;const t=e,r=t.props;return(rv(19)?r?.ref:t.ref)??null}function mM(e,t){const r={};for(const n in e){const o=e[n];if(t?.hasOwnProperty(n)){const a=t[n](o);a!=null&&Object.assign(r,a);continue}o===!0?r[`data-${n.toLowerCase()}`]="":o&&(r[`data-${n.toLowerCase()}`]=o.toString())}return r}function gM(e,t){return typeof e=="function"?e(t):e}function vM(e,t){return typeof e=="function"?e(t):e}function Al(e,t,r={}){const n=t.render,o=yM(t,r);if(r.enabled===!1)return null;const a=r.state??Rr;return xM(e,n,o,a)}function yM(e,t={}){const{className:r,style:n,render:o}=e,{state:a=Rr,ref:l,props:u,stateAttributesMapping:d,enabled:p=!0}=t,h=p?gM(r,a):void 0,m=p?vM(n,a):void 0,y=p?mM(a,d):Rr,w=p?fg(y,Array.isArray(u)?eM(u):u)??Rr:Rr;return typeof document<"u"&&(p?Array.isArray(l)?w.ref=fM([w.ref,Wx(o),...l]):w.ref=ud(w.ref,Wx(o),l):ud(null,null)),p?(h!==void 0&&(w.className=Ok(w.className,h)),m!==void 0&&(w.style=fg(w.style,m)),w):Rr}const bM=Symbol.for("react.lazy");function xM(e,t,r,n){if(t){if(typeof t=="function")return t(r,n);const o=Lk(r,t.props);o.ref=r.ref;let a=t;return a?.$$typeof===bM&&(a=x.Children.toArray(t)[0]),x.cloneElement(a,o)}if(e&&typeof e=="string")return wM(e,r);throw new Error(Uo(8))}function wM(e,t){return e==="button"?x.createElement("button",{type:"button",...t,key:t.key}):e==="img"?x.createElement("img",{alt:"",...t,key:t.key}):x.createElement(e,t)}const SM=x.createContext(void 0);function EM(e=!1){const t=x.useContext(SM);if(t===void 0&&!e)throw new Error(Uo(16));return t}function CM(e){const{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:o=0,isNativeButton:a}=e,l=n&&t!==!1,u=n&&t===!1;return{props:x.useMemo(()=>{const d={onKeyDown(p){r&&t&&p.key!=="Tab"&&p.preventDefault()}};return n||(d.tabIndex=o,!a&&r&&(d.tabIndex=t?o:-1)),(a&&(t||l)||!a&&r)&&(d["aria-disabled"]=r),a&&(!t||u)&&(d.disabled=r),d},[n,r,t,l,u,a,o])}}function kM(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:o=!0,composite:a}=e,l=x.useRef(null),u=EM(!0),d=a??u!==void 0,{props:p}=CM({focusableWhenDisabled:r,disabled:t,composite:d,tabIndex:n,isNativeButton:o}),h=x.useCallback(()=>{const w=l.current;lh(w)&&d&&t&&p.disabled===void 0&&w.disabled&&(w.disabled=!1)},[t,p.disabled,d]);lt(h,[h]);const m=x.useCallback((w={})=>{const{onClick:E,onMouseDown:S,onKeyUp:C,onKeyDown:R,onPointerDown:k,...$}=w;return Lk({type:o?"button":void 0,onClick(A){if(t){A.preventDefault();return}E?.(A)},onMouseDown(A){t||S?.(A)},onKeyDown(A){if(t||(hg(A),R?.(A),A.baseUIHandlerPrevented))return;const D=A.target===A.currentTarget,N=A.currentTarget,P=lh(N),I=!o&&RM(N),re=D&&(o?P:!I),Z=A.key==="Enter",ee=A.key===" ",ne=N.getAttribute("role"),X=ne?.startsWith("menuitem")||ne==="option"||ne==="gridcell";if(D&&d&&ee){if(A.defaultPrevented&&X)return;A.preventDefault(),I||o&&P?(N.click(),A.preventBaseUIHandler()):re&&(E?.(A),A.preventBaseUIHandler());return}re&&(!o&&(ee||Z)&&A.preventDefault(),!o&&Z&&E?.(A))},onKeyUp(A){if(!t){if(hg(A),C?.(A),A.target===A.currentTarget&&o&&d&&lh(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!o&&!d&&A.key===" "&&E?.(A)}},onPointerDown(A){if(t){A.preventDefault();return}k?.(A)}},o?void 0:{role:"button"},p,$)},[t,p,d,o]),y=et(w=>{l.current=w,h()});return{getButtonProps:m,buttonRef:y}}function lh(e){return Kt(e)&&e.tagName==="BUTTON"}function RM(e){return!!(e?.tagName==="A"&&e?.href)}function _M(e){return Zs(e,"base-ui")}const $M={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},AM={...$M,position:"fixed",top:0,left:0},qs=x.forwardRef(function(e,t){const[r,n]=x.useState();return lt(()=>{bj&&n("button")},[]),v.jsx("span",{...e,ref:t,style:AM,"aria-hidden":r?void 0:!0,tabIndex:0,role:r,"data-base-ui-focus-guard":""})}),TM=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${kk}`;function LM(e){return e?!!e.closest(TM):!1}let IM=class Dk{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ci,this.restTimeout=new ci,this.handleCloseOptions=void 0}static create(){return new Dk}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};function dv(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function OM(e,t){const{scopeElement:r,referenceElement:n,floatingElement:o}=t;dv(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=r,e.pointerEventsReferenceElement=n,e.pointerEventsFloatingElement=o,r.style.pointerEvents="none",n.style.pointerEvents="auto",o.style.pointerEvents="auto"}function jk(e){const t=yn(IM.create).current,r=e.context.dataRef.current;return r.hoverInteractionState||(r.hoverInteractionState=t),Dd(r.hoverInteractionState.disposeEffect),r.hoverInteractionState}function NM(e,t){return t!=null&&!wl(t)?0:typeof e=="function"?e():e}function Fu(e,t,r){const n=NM(e,r);return typeof n=="number"?n:n?.[t]}function Hx(e){return typeof e=="function"?e():e}function Mk(e,t){return t||e==="click"||e==="mousedown"}const PM={current:null};function DM(e,t={}){const r="rootStore"in e?e.rootStore:e,{dataRef:n,events:o}=r.context,{enabled:a=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:h=!0,triggerElementRef:m=PM,externalTree:y,isActiveTrigger:w=!0,getHandleCloseContext:E}=t,S=ta(y),C=jk(r),R=Nn(u),k=Nn(l),$=Nn(p),A=Nn(a);w&&(C.handleCloseOptions=R.current?.__options);const D=et(()=>Mk(n.current.openEvent?.type,C.interactedInside)),N=et(ee=>Rk(ee,r.context.triggerElements)),P=et((ee,ne,X)=>{const F=r.context.triggerElements;if(F.hasElement(ne))return!ee||!st(ee,ne);if(!gt(X))return!1;const V=X;return F.hasMatchingElement(H=>st(H,V))&&(!ee||!st(ee,V))}),I=x.useCallback((ee,ne=!0)=>{const X=Fu(k.current,"close",C.pointerType);X?C.openChangeTimeout.start(X,()=>{r.setOpen(!1,Ft(Cr,ee)),S?.events.emit("floating.closed",ee)}):ne&&(C.openChangeTimeout.clear(),r.setOpen(!1,Ft(Cr,ee)),S?.events.emit("floating.closed",ee))},[k,r,C,S]),re=et(()=>{C.handler&&(_t(r.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0)});x.useEffect(()=>re,[re]);const Z=et(()=>{dv(C)});return x.useEffect(()=>{if(!a)return;function ee(ne){ne.open||(re(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return o.on("openchange",ee),()=>{o.off("openchange",ee)}},[a,o,C,re]),x.useEffect(()=>{if(!a)return;const ee=m.current??(w?r.select("domReferenceElement"):null);if(!gt(ee))return;function ne(F){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,d&&!wl(C.pointerType)||Hx($.current)>0&&!Fu(k.current,"open"))return;const V=Fu(k.current,"open",C.pointerType),H=F.currentTarget??null,O=r.select("domReferenceElement"),L=H==null?!1:P(O,H,F.target),U=r.select("open"),z=!U||L;L&&U?r.setOpen(!0,Ft(Cr,F,H)):V?C.openChangeTimeout.start(V,()=>{z&&r.setOpen(!0,Ft(Cr,F,H))}):z&&r.setOpen(!0,Ft(Cr,F,H))}function X(F){if(D()){Z();return}re();const V=r.select("domReferenceElement"),H=_t(V);C.restTimeout.clear(),C.restTimeoutPending=!1;const O=n.current.floatingContext??E?.();if(!N(F.relatedTarget)){if(R.current&&O){r.select("open")||C.openChangeTimeout.clear();const L=m.current;C.handler=R.current({...O,tree:S,x:F.clientX,y:F.clientY,onClose(){Z(),re(),A.current&&!D()&&L===r.select("domReferenceElement")&&I(F,!0)}}),H.addEventListener("mousemove",C.handler),C.handler(F);return}(C.pointerType!=="touch"||!st(r.select("floatingElement"),F.relatedTarget))&&I(F)}}return h&&ee.addEventListener("mousemove",ne,{once:!0}),ee.addEventListener("mouseenter",ne),ee.addEventListener("mouseleave",X),()=>{h&&ee.removeEventListener("mousemove",ne),ee.removeEventListener("mouseenter",ne),ee.removeEventListener("mouseleave",X)}},[re,Z,n,k,I,r,a,R,C,w,P,D,N,d,h,$,m,S,A,E]),x.useMemo(()=>{if(!a)return;function ee(ne){C.pointerType=ne.pointerType}return{onPointerDown:ee,onPointerEnter:ee,onMouseMove(ne){const{nativeEvent:X}=ne,F=ne.currentTarget,V=r.select("domReferenceElement"),H=r.select("open"),O=P(V,F,ne.target);if(d&&!wl(C.pointerType))return;const L=Hx($.current);if(H&&!O||L===0||!O&&C.restTimeoutPending&&ne.movementX**2+ne.movementY**2<2)return;C.restTimeout.clear();function U(){if(C.restTimeoutPending=!1,D())return;const z=r.select("open");!C.blockMouseMove&&(!z||O)&&r.setOpen(!0,Ft(Cr,X,F))}C.pointerType==="touch"?Lr.flushSync(()=>{U()}):O&&H?U():(C.restTimeoutPending=!0,C.restTimeout.start(L,U))}}},[a,C,D,P,d,r,$])}const qx=.1,jM=qx*qx,Rt=.5;function ku(e,t,r,n,o,a){return n>=t!=a>=t&&e<=(o-r)*(t-n)/(a-n)+r}function Ru(e,t,r,n,o,a,l,u,d,p){let h=!1;return ku(e,t,r,n,o,a)&&(h=!h),ku(e,t,o,a,l,u)&&(h=!h),ku(e,t,l,u,d,p)&&(h=!h),ku(e,t,d,p,r,n)&&(h=!h),h}function MM(e,t,r){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}function _u(e,t,r,n,o,a){const l=Math.min(r,o),u=Math.max(r,o),d=Math.min(n,a),p=Math.max(n,a);return e>=l&&e<=u&&t>=d&&t<=p}function zM(e={}){const{blockPointerEvents:t=!1}=e,r=new ci,n=({x:o,y:a,placement:l,elements:u,onClose:d,nodeId:p,tree:h})=>{const m=l?.split("-")[0];let y=!1,w=null,E=null,S=typeof performance<"u"?performance.now():0;function C(k,$){const A=performance.now(),D=A-S;if(w===null||E===null||D===0)return w=k,E=$,S=A,!1;const N=k-w,P=$-E,I=N*N+P*P,re=D*D*jM;return w=k,E=$,S=A,I<re}function R(){r.clear(),d()}return function(k){r.clear();const $=u.domReference,A=u.floating;if(!$||!A||m==null||o==null||a==null)return;const{clientX:D,clientY:N}=k,P=gn(k),I=k.type==="mouseleave",re=st(A,P),Z=st($,P);if(re&&(y=!0,!I))return;if(Z&&(y=!1,!I)){y=!0;return}if(I&&gt(k.relatedTarget)&&st(A,k.relatedTarget))return;function ee(){return!!(h&&oi(h.nodesRef.current,p).length>0)}function ne(){ee()||R()}if(ee())return;const X=$.getBoundingClientRect(),F=A.getBoundingClientRect(),V=o>F.right-F.width/2,H=a>F.bottom-F.height/2,O=F.width>X.width,L=F.height>X.height,U=(O?X:F).left,z=(O?X:F).right,T=(L?X:F).top,M=(L?X:F).bottom;if(m==="top"&&a>=X.bottom-1||m==="bottom"&&a<=X.top+1||m==="left"&&o>=X.right-1||m==="right"&&o<=X.left+1){ne();return}let te=!1;switch(m){case"top":te=_u(D,N,U,X.top+1,z,F.bottom-1);break;case"bottom":te=_u(D,N,U,F.top+1,z,X.bottom-1);break;case"left":te=_u(D,N,F.right-1,M,X.left+1,T);break;case"right":te=_u(D,N,X.right-1,M,F.left+1,T);break}if(te)return;if(y&&!MM(D,N,X)){ne();return}if(!I&&C(D,N)){ne();return}let le=!1;switch(m){case"top":{const G=O?Rt/2:Rt*4,fe=O||V?o+G:o-G,be=O?o-G:V?o+G:o-G,pe=a+Rt+1,ue=V||O?F.bottom-Rt:F.top,ge=V?O?F.bottom-Rt:F.top:F.bottom-Rt;le=Ru(D,N,fe,pe,be,pe,F.left,ue,F.right,ge);break}case"bottom":{const G=O?Rt/2:Rt*4,fe=O||V?o+G:o-G,be=O?o-G:V?o+G:o-G,pe=a-Rt,ue=V||O?F.top+Rt:F.bottom,ge=V?O?F.top+Rt:F.bottom:F.top+Rt;le=Ru(D,N,fe,pe,be,pe,F.left,ue,F.right,ge);break}case"left":{const G=L?Rt/2:Rt*4,fe=L||H?a+G:a-G,be=L?a-G:H?a+G:a-G,pe=o+Rt+1,ue=H||L?F.right-Rt:F.left,ge=H?L?F.right-Rt:F.left:F.right-Rt;le=Ru(D,N,ue,F.top,ge,F.bottom,pe,fe,pe,be);break}case"right":{const G=L?Rt/2:Rt*4,fe=L||H?a+G:a-G,be=L?a-G:H?a+G:a-G,pe=o-Rt,ue=H||L?F.left+Rt:F.right,ge=H?L?F.left+Rt:F.right:F.left+Rt;le=Ru(D,N,pe,fe,pe,be,ue,F.top,ge,F.bottom);break}}le?y||r.start(40,ne):ne()}};return n.__options={blockPointerEvents:t},n}function FM(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.context.dataRef,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,stickIfOpen:d=!0,touchOpenDelay:p=0,reason:h=Ws}=t,m=x.useRef(void 0),y=tv(),w=Vs(),E=x.useMemo(()=>({onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const C=m.current,R=S.nativeEvent,k=r.select("open");if(S.button!==0||a==="click"||wl(C,!0)&&u)return;const $=n.current.openEvent,A=$?.type,D=r.select("domReferenceElement")!==S.currentTarget,N=k&&D||!(k&&l&&(!($&&d)||A==="click"||A==="mousedown"));if(ov(R.target)){const I=Ft(h,R,R.target);N&&C==="touch"&&p>0?w.start(p,()=>{r.setOpen(!0,I)}):r.setOpen(N,I);return}const P=S.currentTarget;y.request(()=>{const I=Ft(h,R,P);N&&C==="touch"&&p>0?w.start(p,()=>{r.setOpen(!0,I)}):r.setOpen(N,I)})},onClick(S){if(a==="mousedown-only")return;const C=m.current;if(a==="mousedown"&&C){m.current=void 0;return}if(wl(C,!0)&&u)return;const R=r.select("open"),k=n.current.openEvent,$=r.select("domReferenceElement")!==S.currentTarget,A=R&&$||!(R&&l&&(!(k&&d)||vk(k))),D=Ft(h,S.nativeEvent,S.currentTarget);A&&C==="touch"&&p>0?w.start(p,()=>{r.setOpen(!0,D)}):r.setOpen(A,D)},onKeyDown(){m.current=void 0}}),[n,a,u,r,d,l,y,w,p,h]);return x.useMemo(()=>o?{reference:E}:Rr,[o,E])}var BM=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],dd=BM.join(","),zk=typeof Element>"u",Gs=zk?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fd=!zk&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},pd=function(e,t){var r;t===void 0&&(t=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),o=n===""||n==="true",a=o||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):pd(e.parentNode));return a},UM=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},Fk=function(e,t,r){if(pd(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(dd));return t&&Gs.call(e,dd)&&n.unshift(e),n=n.filter(r),n},hd=function(e,t,r){for(var n=[],o=Array.from(e);o.length;){var a=o.shift();if(!pd(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),u=l.length?l:a.children,d=hd(u,!0,r);r.flatten?n.push.apply(n,d):n.push({scopeParent:a,candidates:d})}else{var p=Gs.call(a,dd);p&&r.filter(a)&&(t||!e.includes(a))&&n.push(a);var h=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),m=!pd(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(h&&m){var y=hd(h===!0?a.children:h.children,!0,r);r.flatten?n.push.apply(n,y):n.push({scopeParent:a,candidates:y})}else o.unshift.apply(o,a.children)}}return n},Bk=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Uk=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||UM(e))&&!Bk(e)?0:e.tabIndex},VM=function(e,t){var r=Uk(e);return r<0&&t&&!Bk(e)?0:r},WM=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Vk=function(e){return e.tagName==="INPUT"},HM=function(e){return Vk(e)&&e.type==="hidden"},qM=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},GM=function(e,t){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]},XM=function(e){if(!e.name)return!0;var t=e.form||fd(e),r=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},n;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")n=r(window.CSS.escape(e.name));else try{n=r(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=GM(n,e.form);return!o||o===e},YM=function(e){return Vk(e)&&e.type==="radio"},KM=function(e){return YM(e)&&!XM(e)},QM=function(e){var t,r=e&&fd(e),n=(t=r)===null||t===void 0?void 0:t.host,o=!1;if(r&&r!==e){var a,l,u;for(o=!!((a=n)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(n)||e!=null&&(u=e.ownerDocument)!==null&&u!==void 0&&u.contains(e));!o&&n;){var d,p,h;r=fd(n),n=(d=r)===null||d===void 0?void 0:d.host,o=!!((p=n)!==null&&p!==void 0&&(h=p.ownerDocument)!==null&&h!==void 0&&h.contains(n))}}return o},Gx=function(e){var t=e.getBoundingClientRect(),r=t.width,n=t.height;return r===0&&n===0},JM=function(e,t){var r=t.displayCheck,n=t.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var o=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(e).visibility==="hidden")return!0;var a=Gs.call(e,"details>summary:first-of-type"),l=a?e.parentElement:e;if(Gs.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof n=="function"){for(var u=e;e;){var d=e.parentElement,p=fd(e);if(d&&!d.shadowRoot&&n(d)===!0)return Gx(e);e.assignedSlot?e=e.assignedSlot:!d&&p!==e.ownerDocument?e=p.host:e=d}e=u}if(QM(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Gx(e);return!1},ZM=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r<t.children.length;r++){var n=t.children.item(r);if(n.tagName==="LEGEND")return Gs.call(t,"fieldset[disabled] *")?!0:!n.contains(e)}return!0}t=t.parentElement}return!1},gg=function(e,t){return!(t.disabled||HM(t)||JM(t,e)||qM(t)||ZM(t))},vg=function(e,t){return!(KM(t)||Uk(t)<0||!gg(e,t))},e4=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Wk=function(e){var t=[],r=[];return e.forEach(function(n,o){var a=!!n.scopeParent,l=a?n.scopeParent:n,u=VM(l,a),d=a?Wk(n.candidates):l;u===0?a?t.push.apply(t,d):t.push(l):r.push({documentOrder:o,tabIndex:u,item:n,isScope:a,content:d})}),r.sort(WM).reduce(function(n,o){return o.isScope?n.push.apply(n,o.content):n.push(o.content),n},[]).concat(t)},Tl=function(e,t){t=t||{};var r;return t.getShadowRoot?r=hd([e],t.includeContainer,{filter:vg.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:e4}):r=Fk(e,t.includeContainer,vg.bind(null,t)),Wk(r)},t4=function(e,t){t=t||{};var r;return t.getShadowRoot?r=hd([e],t.includeContainer,{filter:gg.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=Fk(e,t.includeContainer,gg.bind(null,t)),r},Hk=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Gs.call(e,dd)===!1?!1:vg(t,e)};const ra=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qk(e,t){const r=Tl(e,ra()),n=r.length;if(n===0)return;const o=$o(_t(e)),a=r.indexOf(o),l=a===-1?t===1?0:n-1:a+t;return r[l]}function fv(e){return qk(_t(e).body,1)||e}function Gk(e){return qk(_t(e).body,-1)||e}function Xk(e,t){if(!e)return null;const r=Tl(_t(e).body,ra()),n=r.length;if(n===0)return null;const o=r.indexOf(e);if(o===-1)return null;const a=(o+t+n)%n;return r[a]}function r4(e){return Xk(e,1)}function n4(e){return Xk(e,-1)}function Ps(e,t){const r=t||e.currentTarget,n=e.relatedTarget;return!n||!st(r,n)}function i4(e){Tl(e,ra()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Xx(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const r=t.dataset.tabindex;delete t.dataset.tabindex,r?t.setAttribute("tabindex",r):t.removeAttribute("tabindex")})}const Yk=x.createContext(null),Kk=()=>x.useContext(Yk),o4=sd("portal");function s4(e={}){const{ref:t,container:r,componentProps:n=Rr,elementProps:o}=e,a=Zs(),l=Kk()?.portalNode,[u,d]=x.useState(null),[p,h]=x.useState(null),m=et(E=>{E!==null&&h(E)}),y=x.useRef(null);lt(()=>{if(r===null){y.current&&(y.current=null,h(null),d(null));return}if(a==null)return;const E=(r&&(Zg(r)?r:r.current))??l??document.body;if(E==null){y.current&&(y.current=null,h(null),d(null));return}y.current!==E&&(y.current=E,h(null),d(E))},[r,l,a]);const w=Al("div",n,{ref:[t,m],props:[{id:a,[o4]:""},o]});return{portalNode:p,portalSubtree:u&&w?Lr.createPortal(w,u):null}}const a4=x.forwardRef(function(e,t){const{children:r,container:n,className:o,render:a,renderGuards:l,...u}=e,{portalNode:d,portalSubtree:p}=s4({container:n,ref:t,componentProps:e,elementProps:u}),h=x.useRef(null),m=x.useRef(null),y=x.useRef(null),w=x.useRef(null),[E,S]=x.useState(null),C=E?.modal,R=E?.open,k=typeof l=="boolean"?l:!!E&&!E.modal&&E.open&&!!d;x.useEffect(()=>{if(!d||C)return;function A(D){d&&D.relatedTarget&&Ps(D)&&(D.type==="focusin"?Xx:i4)(d)}return d.addEventListener("focusin",A,!0),d.addEventListener("focusout",A,!0),()=>{d.removeEventListener("focusin",A,!0),d.removeEventListener("focusout",A,!0)}},[d,C]),x.useEffect(()=>{!d||R||Xx(d)},[R,d]);const $=x.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:y,afterInsideRef:w,portalNode:d,setFocusManagerState:S}),[d]);return v.jsxs(x.Fragment,{children:[p,v.jsxs(Yk.Provider,{value:$,children:[k&&d&&v.jsx(qs,{"data-type":"outside",ref:h,onFocus:A=>{if(Ps(A,d))y.current?.focus();else{const D=E?E.domReference:null;Gk(D)?.focus()}}}),k&&d&&v.jsx("span",{"aria-owns":d.id,style:Dj}),d&&Lr.createPortal(r,d),k&&d&&v.jsx(qs,{"data-type":"outside",ref:m,onFocus:A=>{if(Ps(A,d))w.current?.focus();else{const D=E?E.domReference:null;fv(D)?.focus(),E?.closeOnFocusOut&&E?.onOpenChange(!1,Ft(El,A.nativeEvent))}}})]})]})});function l4(e){return rv(19)?e:e?"true":void 0}const c4=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:p,padding:h=0,offsetParent:m="real"}=di(e,t)||{};if(p==null)return{};const y=Ak(h),w={x:r,y:n},E=lv(o),S=av(E),C=await l.getDimensions(p),R=E==="y",k=R?"top":"left",$=R?"bottom":"right",A=R?"clientHeight":"clientWidth",D=a.reference[S]+a.reference[E]-w[E]-a.floating[S],N=w[E]-a.reference[E],P=m==="real"?await l.getOffsetParent?.(p):u.floating;let I=u.floating[A]||a.floating[S];(!I||!await l.isElement?.(P))&&(I=u.floating[A]||a.floating[S]);const re=D/2-N/2,Z=I/2-C[S]/2-1,ee=Math.min(y[k],Z),ne=Math.min(y[$],Z),X=ee,F=I-C[S]-ne,V=I/2-C[S]/2+re,H=ug(X,V,F),O=!d.arrow&&Zi(o)!=null&&V!==H&&a.reference[S]/2-(V<X?ee:ne)-C[S]/2<0,L=O?V<X?V-X:V-F:0;return{[E]:w[E]+L,data:{[E]:H,centerOffset:V-H-L,...O&&{alignmentOffset:L}},reset:O}}}),u4=(e,t)=>({...c4(e),options:[e,t]});function Yx(e,t,r){let{reference:n,floating:o}=e;const a=Xr(t),l=lv(t),u=av(l),d=$r(t),p=a==="y",h=n.x+n.width/2-o.width/2,m=n.y+n.height/2-o.height/2,y=n[u]/2-o[u]/2;let w;switch(d){case"top":w={x:h,y:n.y-o.height};break;case"bottom":w={x:h,y:n.y+n.height};break;case"right":w={x:n.x+n.width,y:m};break;case"left":w={x:n.x-o.width,y:m};break;default:w={x:n.x,y:n.y}}switch(Zi(t)){case"start":w[l]-=y*(r&&p?-1:1);break;case"end":w[l]+=y*(r&&p?-1:1);break}return w}async function d4(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:y=!1,padding:w=0}=di(t,e),E=Ak(w),S=u[y?m==="floating"?"reference":"floating":m],C=cd(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(S)))==null||r?S:S.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:p,rootBoundary:h,strategy:d})),R=m==="floating"?{x:n,y:o,width:l.floating.width,height:l.floating.height}:l.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),$=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},A=cd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:k,strategy:d}):R);return{top:(C.top-A.top+E.top)/$.y,bottom:(A.bottom-C.bottom+E.bottom)/$.y,left:(C.left-A.left+E.left)/$.x,right:(A.right-C.right+E.right)/$.x}}const f4=50,p4=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:l}=r,u=l.detectOverflow?l:{...l,detectOverflow:d4},d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=Yx(p,n,d),y=n,w=0;const E={};for(let S=0;S<a.length;S++){const C=a[S];if(!C)continue;const{name:R,fn:k}=C,{x:$,y:A,data:D,reset:N}=await k({x:h,y:m,initialPlacement:n,placement:y,strategy:o,middlewareData:E,rects:p,platform:u,elements:{reference:e,floating:t}});h=$??h,m=A??m,E[R]={...E[R],...D},N&&w<f4&&(w++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(p=N.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:h,y:m}=Yx(p,y,d)),S=-1)}return{x:h,y:m,placement:y,strategy:o,middlewareData:E}},h4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:p}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...C}=di(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const R=$r(o),k=Xr(u),$=$r(u)===u,A=await(d.isRTL==null?void 0:d.isRTL(p.floating)),D=y||($||!S?[ld(u)]:G6(u)),N=E!=="none";!y&&N&&D.push(...Q6(u,S,E,A));const P=[u,...D],I=await d.detectOverflow(t,C),re=[];let Z=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&re.push(I[R]),m){const F=q6(o,l,A);re.push(I[F[0]],I[F[1]])}if(Z=[...Z,{placement:o,overflows:re}],!re.every(F=>F<=0)){var ee,ne;const F=(((ee=a.flip)==null?void 0:ee.index)||0)+1,V=P[F];if(V&&(!(m==="alignment"&&k!==Xr(V))||Z.every(O=>Xr(O.placement)===k?O.overflows[0]>0:!0)))return{data:{index:F,overflows:Z},reset:{placement:V}};let H=(ne=Z.filter(O=>O.overflows[0]<=0).sort((O,L)=>O.overflows[1]-L.overflows[1])[0])==null?void 0:ne.placement;if(!H)switch(w){case"bestFit":{var X;const O=(X=Z.filter(L=>{if(N){const U=Xr(L.placement);return U===k||U==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(U=>U>0).reduce((U,z)=>U+z,0)]).sort((L,U)=>L[1]-U[1])[0])==null?void 0:X[0];O&&(H=O);break}case"initialPlacement":H=u;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function Kx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qx(e){return W6.some(t=>e[t]>=0)}const m4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=di(e,t);switch(o){case"referenceHidden":{const l=await n.detectOverflow(t,{...a,elementContext:"reference"}),u=Kx(l,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Qx(u)}}}case"escaped":{const l=await n.detectOverflow(t,{...a,altBoundary:!0}),u=Kx(l,r.floating);return{data:{escapedOffsets:u,escaped:Qx(u)}}}default:return{}}}}},Qk=new Set(["left","top"]);async function g4(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),l=$r(r),u=Zi(r),d=Xr(r)==="y",p=Qk.has(l)?-1:1,h=a&&d?-1:1,m=di(t,e);let{mainAxis:y,crossAxis:w,alignmentAxis:E}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof E=="number"&&(w=u==="end"?E*-1:E),d?{x:w*h,y:y*p}:{x:y*p,y:w*h}}const v4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:l,middlewareData:u}=t,d=await g4(t,e);return l===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:a+d.y,data:{...d,placement:l}}}}},y4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:R=>{let{x:k,y:$}=R;return{x:k,y:$}}},...p}=di(e,t),h={x:r,y:n},m=await a.detectOverflow(t,p),y=Xr($r(o)),w=sv(y);let E=h[w],S=h[y];if(l){const R=w==="y"?"top":"left",k=w==="y"?"bottom":"right",$=E+m[R],A=E-m[k];E=ug($,E,A)}if(u){const R=y==="y"?"top":"left",k=y==="y"?"bottom":"right",$=S+m[R],A=S-m[k];S=ug($,S,A)}const C=d.fn({...t,[w]:E,[y]:S});return{...C,data:{x:C.x-r,y:C.y-n,enabled:{[w]:l,[y]:u}}}}}},b4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:p=!0}=di(e,t),h={x:r,y:n},m=Xr(o),y=sv(m);let w=h[y],E=h[m];const S=di(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const $=y==="y"?"height":"width",A=a.reference[y]-a.floating[$]+C.mainAxis,D=a.reference[y]+a.reference[$]-C.mainAxis;w<A?w=A:w>D&&(w=D)}if(p){var R,k;const $=y==="y"?"width":"height",A=Qk.has($r(o)),D=a.reference[m]-a.floating[$]+(A&&((R=l.offset)==null?void 0:R[m])||0)+(A?0:C.crossAxis),N=a.reference[m]+a.reference[$]+(A?0:((k=l.offset)==null?void 0:k[m])||0)-(A?C.crossAxis:0);E<D?E=D:E>N&&(E=N)}return{[y]:w,[m]:E}}}},x4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:l,elements:u}=t,{apply:d=()=>{},...p}=di(e,t),h=await l.detectOverflow(t,p),m=$r(o),y=Zi(o),w=Xr(o)==="y",{width:E,height:S}=a.floating;let C,R;m==="top"||m==="bottom"?(C=m,R=y===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=m,C=y==="end"?"top":"bottom");const k=S-h.top-h.bottom,$=E-h.left-h.right,A=Hs(S-h[C],k),D=Hs(E-h[R],$),N=!t.middlewareData.shift;let P=A,I=D;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=$),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=k),N&&!y){const Z=Mr(h.left,0),ee=Mr(h.right,0),ne=Mr(h.top,0),X=Mr(h.bottom,0);w?I=E-2*(Z!==0||ee!==0?Z+ee:Mr(h.left,h.right)):P=S-2*(ne!==0||X!==0?ne+X:Mr(h.top,h.bottom))}await d({...t,availableWidth:I,availableHeight:P});const re=await l.getDimensions(u.floating);return E!==re.width||S!==re.height?{reset:{rects:!0}}:{}}}};function Jk(e){const t=zr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Kt(e),a=o?e.offsetWidth:r,l=o?e.offsetHeight:n,u=ad(r)!==a||ad(n)!==l;return u&&(r=a,n=l),{width:r,height:n,$:u}}function pv(e){return gt(e)?e:e.contextElement}function Ds(e){const t=pv(e);if(!Kt(t))return Pn(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Jk(t);let l=(a?ad(r.width):r.width)/n,u=(a?ad(r.height):r.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const w4=Pn(0);function Zk(e){const t=tr(e);return!zd()||!t.visualViewport?w4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function S4(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==tr(e)?!1:t}function jo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=pv(e);let l=Pn(1);t&&(n?gt(n)&&(l=Ds(n)):l=Ds(e));const u=S4(a,r,n)?Zk(a):Pn(0);let d=(o.left+u.x)/l.x,p=(o.top+u.y)/l.y,h=o.width/l.x,m=o.height/l.y;if(a){const y=tr(a),w=n&&gt(n)?tr(n):n;let E=y,S=sg(E);for(;S&&n&&w!==E;){const C=Ds(S),R=S.getBoundingClientRect(),k=zr(S),$=R.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,A=R.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,p*=C.y,h*=C.x,m*=C.y,d+=$,p+=A,E=tr(S),S=sg(E)}}return cd({width:h,height:m,x:d,y:p})}function Bd(e,t){const r=Fd(e).scrollLeft;return t?t.left+r:jo(Fn(e)).left+r}function eR(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Bd(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function E4(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",l=Fn(n),u=t?Md(t.floating):!1;if(n===l||u&&a)return r;let d={scrollLeft:0,scrollTop:0},p=Pn(1);const h=Pn(0),m=Kt(n);if((m||!m&&!a)&&((Qi(n)!=="body"||Ji(l))&&(d=Fd(n)),m)){const w=jo(n);p=Ds(n),h.x=w.x+n.clientLeft,h.y=w.y+n.clientTop}const y=l&&!m&&!a?eR(l,d):Pn(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-d.scrollLeft*p.x+h.x+y.x,y:r.y*p.y-d.scrollTop*p.y+h.y+y.y}}function C4(e){return Array.from(e.getClientRects())}function k4(e){const t=Fn(e),r=Fd(e),n=e.ownerDocument.body,o=Mr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Mr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+Bd(e);const u=-r.scrollTop;return zr(n).direction==="rtl"&&(l+=Mr(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:l,y:u}}const Jx=25;function R4(e,t){const r=tr(e),n=Fn(e),o=r.visualViewport;let a=n.clientWidth,l=n.clientHeight,u=0,d=0;if(o){a=o.width,l=o.height;const h=zd();(!h||h&&t==="fixed")&&(u=o.offsetLeft,d=o.offsetTop)}const p=Bd(n);if(p<=0){const h=n.ownerDocument,m=h.body,y=getComputedStyle(m),w=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(n.clientWidth-m.clientWidth-w);E<=Jx&&(a-=E)}else p<=Jx&&(a+=p);return{width:a,height:l,x:u,y:d}}function _4(e,t){const r=jo(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Kt(e)?Ds(e):Pn(1),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=o*a.x,p=n*a.y;return{width:l,height:u,x:d,y:p}}function Zx(e,t,r){let n;if(t==="viewport")n=R4(e,r);else if(t==="document")n=k4(Fn(e));else if(gt(t))n=_4(t,r);else{const o=Zk(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return cd(n)}function tR(e,t){const r=ui(e);return r===t||!gt(r)||ii(r)?!1:zr(r).position==="fixed"||tR(r,t)}function $4(e,t){const r=t.get(e);if(r)return r;let n=xl(e,[],!1).filter(u=>gt(u)&&Qi(u)!=="body"),o=null;const a=zr(e).position==="fixed";let l=a?ui(e):e;for(;gt(l)&&!ii(l);){const u=zr(l),d=ev(l);!d&&u.position==="fixed"&&(o=null),(a?!d&&!o:!d&&u.position==="static"&&o&&(o.position==="absolute"||o.position==="fixed")||Ji(l)&&!d&&tR(e,l))?n=n.filter(p=>p!==l):o=u,l=ui(l)}return t.set(e,n),n}function A4(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?Md(t)?[]:$4(t,this._c):[].concat(r),n],l=Zx(t,a[0],o);let u=l.top,d=l.right,p=l.bottom,h=l.left;for(let m=1;m<a.length;m++){const y=Zx(t,a[m],o);u=Mr(y.top,u),d=Hs(y.right,d),p=Hs(y.bottom,p),h=Mr(y.left,h)}return{width:d-h,height:p-u,x:h,y:u}}function T4(e){const{width:t,height:r}=Jk(e);return{width:t,height:r}}function L4(e,t,r){const n=Kt(t),o=Fn(t),a=r==="fixed",l=jo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=Pn(0);function p(){d.x=Bd(o)}if(n||!n&&!a)if((Qi(t)!=="body"||Ji(o))&&(u=Fd(t)),n){const w=jo(t,!0,a,t);d.x=w.x+t.clientLeft,d.y=w.y+t.clientTop}else o&&p();a&&!n&&o&&p();const h=o&&!n&&!a?eR(o,u):Pn(0),m=l.left+u.scrollLeft-d.x-h.x,y=l.top+u.scrollTop-d.y-h.y;return{x:m,y,width:l.width,height:l.height}}function ch(e){return zr(e).position==="static"}function ew(e,t){if(!Kt(e)||zr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Fn(e)===r&&(r=r.ownerDocument.body),r}function rR(e,t){const r=tr(e);if(Md(e))return r;if(!Kt(e)){let o=ui(e);for(;o&&!ii(o);){if(gt(o)&&!ch(o))return o;o=ui(o)}return r}let n=ew(e,t);for(;n&&mj(n)&&ch(n);)n=ew(n,t);return n&&ii(n)&&ch(n)&&!ev(n)?r:n||yj(e)||r}const I4=async function(e){const t=this.getOffsetParent||rR,r=this.getDimensions,n=await r(e.floating);return{reference:L4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function O4(e){return zr(e).direction==="rtl"}const N4={convertOffsetParentRelativeRectToViewportRelativeRect:E4,getDocumentElement:Fn,getClippingRect:A4,getOffsetParent:rR,getElementRects:I4,getClientRects:C4,getDimensions:T4,getScale:Ds,isElement:gt,isRTL:O4};function nR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function P4(e,t){let r=null,n;const o=Fn(e);function a(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),a();const p=e.getBoundingClientRect(),{left:h,top:m,width:y,height:w}=p;if(u||t(),!y||!w)return;const E=Eu(m),S=Eu(o.clientWidth-(h+y)),C=Eu(o.clientHeight-(m+w)),R=Eu(h),k={rootMargin:-E+"px "+-S+"px "+-C+"px "+-R+"px",threshold:Mr(0,Hs(1,d))||1};let $=!0;function A(D){const N=D[0].intersectionRatio;if(N!==d){if(!$)return l();N?l(!1,N):n=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!nR(p,e.getBoundingClientRect())&&l(),$=!1}try{r=new IntersectionObserver(A,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(A,k)}r.observe(e)}return l(!0),a}function tw(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,p=pv(e),h=o||a?[...p?xl(p):[],...t?xl(t):[]]:[];h.forEach(R=>{o&&R.addEventListener("scroll",r,{passive:!0}),a&&R.addEventListener("resize",r)});const m=p&&u?P4(p,r):null;let y=-1,w=null;l&&(w=new ResizeObserver(R=>{let[k]=R;k&&k.target===p&&w&&t&&(w.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var $;($=w)==null||$.observe(t)})),r()}),p&&!d&&w.observe(p),t&&w.observe(t));let E,S=d?jo(e):null;d&&C();function C(){const R=jo(e);S&&!nR(S,R)&&r(),S=R,E=requestAnimationFrame(C)}return r(),()=>{var R;h.forEach(k=>{o&&k.removeEventListener("scroll",r),a&&k.removeEventListener("resize",r)}),m?.(),(R=w)==null||R.disconnect(),w=null,d&&cancelAnimationFrame(E)}}const D4=v4,j4=y4,M4=h4,z4=x4,F4=m4,B4=b4,U4=(e,t,r)=>{const n=new Map,o={platform:N4,...r},a={...o.platform,_c:n};return p4(e,t,{...o,platform:a})};var V4=typeof document<"u",W4=function(){},Bu=V4?x.useLayoutEffect:W4;function md(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!md(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!md(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function iR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rw(e,t){const r=iR(e);return Math.round(t*r)/r}function uh(e){const t=x.useRef(e);return Bu(()=>{t.current=e}),t}function H4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:p}=e,[h,m]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,w]=x.useState(n);md(y,n)||w(n);const[E,S]=x.useState(null),[C,R]=x.useState(null),k=x.useCallback(L=>{L!==N.current&&(N.current=L,S(L))},[]),$=x.useCallback(L=>{L!==P.current&&(P.current=L,R(L))},[]),A=a||E,D=l||C,N=x.useRef(null),P=x.useRef(null),I=x.useRef(h),re=d!=null,Z=uh(d),ee=uh(o),ne=uh(p),X=x.useCallback(()=>{if(!N.current||!P.current)return;const L={placement:t,strategy:r,middleware:y};ee.current&&(L.platform=ee.current),U4(N.current,P.current,L).then(U=>{const z={...U,isPositioned:ne.current!==!1};F.current&&!md(I.current,z)&&(I.current=z,Lr.flushSync(()=>{m(z)}))})},[y,t,r,ee,ne]);Bu(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[p]);const F=x.useRef(!1);Bu(()=>(F.current=!0,()=>{F.current=!1}),[]),Bu(()=>{if(A&&(N.current=A),D&&(P.current=D),A&&D){if(Z.current)return Z.current(A,D,X);X()}},[A,D,X,Z,re]);const V=x.useMemo(()=>({reference:N,floating:P,setReference:k,setFloating:$}),[k,$]),H=x.useMemo(()=>({reference:A,floating:D}),[A,D]),O=x.useMemo(()=>{const L={position:r,left:0,top:0};if(!H.floating)return L;const U=rw(H.floating,h.x),z=rw(H.floating,h.y);return u?{...L,transform:"translate("+U+"px, "+z+"px)",...iR(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:U,top:z}},[r,u,H.floating,h.x,h.y]);return x.useMemo(()=>({...h,update:X,refs:V,elements:H,floatingStyles:O}),[h,X,V,H,O])}const q4=(e,t)=>{const r=D4(e);return{name:r.name,fn:r.fn,options:[e,t]}},G4=(e,t)=>{const r=j4(e);return{name:r.name,fn:r.fn,options:[e,t]}},X4=(e,t)=>({fn:B4(e).fn,options:[e,t]}),Y4=(e,t)=>{const r=M4(e);return{name:r.name,fn:r.fn,options:[e,t]}},K4=(e,t)=>{const r=z4(e);return{name:r.name,fn:r.fn,options:[e,t]}},Q4=(e,t)=>{const r=F4(e);return{name:r.name,fn:r.fn,options:[e,t]}},J4={name:"hide",async fn(e){const{width:t,height:r,x:n,y:o}=e.rects.reference,a=t===0&&r===0&&n===0&&o===0;return{data:{referenceHidden:(await Q4().fn(e)).data?.referenceHidden||a}}}},Uu={sideX:"left",sideY:"top"},Z4={name:"adaptiveOrigin",async fn(e){const{x:t,y:r,rects:{floating:n},elements:{floating:o},platform:a,strategy:l,placement:u}=e,d=tr(o),p=d.getComputedStyle(o);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:r,data:Uu};const h=await a.getOffsetParent?.(o);let m={width:0,height:0};if(l==="fixed"&&d?.visualViewport)m={width:d.visualViewport.width,height:d.visualViewport.height};else if(h===d){const R=_t(o);m={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await a.isElement?.(h)&&(m=await a.getDimensions(h));const y=$r(u);let w=t,E=r;y==="left"&&(w=m.width-(t+n.width)),y==="top"&&(E=m.height-(r+n.height));const S=y==="left"?"right":Uu.sideX,C=y==="top"?"bottom":Uu.sideY;return{x:w,y:E,data:{sideX:S,sideY:C}}}};function e2(e){const{open:t=!1,onOpenChange:r,elements:n={}}=e,o=Zs(),a=Vo()!=null,l=yn(()=>new nv({open:t,onOpenChange:r,referenceElement:n.reference??null,floatingElement:n.floating??null,triggerElements:new iv,floatingId:o,nested:a,noEmit:!1})).current;return lt(()=>{const u={open:t,floatingId:o};n.reference!==void 0&&(u.referenceElement=n.reference,u.domReferenceElement=gt(n.reference)?n.reference:null),n.floating!==void 0&&(u.floatingElement=n.floating),l.update(u)},[t,o,n.reference,n.floating,l]),l.context.onOpenChange=r,l.context.nested=a,l.context.noEmit=!1,l}function t2(e={}){const{nodeId:t,externalTree:r}=e,n=e2(e),o=e.rootContext||n,a={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[l,u]=x.useState(null),d=x.useRef(null),p=ta(r);lt(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const h=H4({...e,elements:{...a,...l&&{reference:l}}}),m=x.useCallback(P=>{const I=gt(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;u(I),h.refs.setReference(I)},[h.refs]),[y,w]=x.useState(null),[E,S]=x.useState(null);o.useSyncedValue("referenceElement",y),o.useSyncedValue("domReferenceElement",gt(y)?y:null),o.useSyncedValue("floatingElement",E);const C=x.useCallback(P=>{(gt(P)||P===null)&&(d.current=P,w(P)),(gt(h.refs.reference.current)||h.refs.reference.current===null||P!==null&&!gt(P))&&h.refs.setReference(P)},[h.refs,w]),R=x.useCallback(P=>{S(P),h.refs.setFloating(P)},[h.refs]),k=x.useMemo(()=>({...h.refs,setReference:C,setFloating:R,setPositionReference:m,domReference:d}),[h.refs,C,R,m]),$=x.useMemo(()=>({...h.elements,domReference:a.domReference}),[h.elements,a.domReference]),A=o.useState("open"),D=o.useState("floatingId"),N=x.useMemo(()=>({...h,dataRef:o.context.dataRef,open:A,onOpenChange:o.setOpen,events:o.context.events,floatingId:D,refs:k,elements:$,nodeId:t,rootStore:o}),[h,k,$,t,o,A,D]);return lt(()=>{o.context.dataRef.current.floatingContext=N;const P=p?.nodesRef.current.find(I=>I.id===t);P&&(P.context=N)}),x.useMemo(()=>({...h,context:N,refs:k,elements:$,rootStore:o}),[h,k,$,N,o])}function oR(e,t,r){const n=e==="inline-start"||e==="inline-end";return{top:"top",right:n?r?"inline-start":"inline-end":"right",bottom:"bottom",left:n?r?"inline-end":"inline-start":"left"}[t]}function nw(e,t,r){const{rects:n,placement:o}=e;return{side:oR(t,$r(o),r),align:Zi(o)||"center",anchor:{width:n.reference.width,height:n.reference.height},positioner:{width:n.floating.width,height:n.floating.height}}}function r2(e){const{anchor:t,positionMethod:r="absolute",side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:p=!1,arrowPadding:h=5,disableAnchorTracking:m=!1,keepMounted:y=!1,floatingRootContext:w,mounted:E,collisionAvoidance:S,shiftCrossAxis:C=!1,nodeId:R,adaptiveOrigin:k,lazyFlip:$=!1,externalTree:A}=e,[D,N]=x.useState(null);!E&&D!==null&&N(null);const P=S.side||"flip",I=S.align||"flip",re=S.fallbackAxisSide||"end",Z=typeof t=="function"?t:void 0,ee=et(Z),ne=Z?ee:t,X=Nn(t),F=Mj()==="rtl",V=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":F?"left":"right","inline-start":F?"right":"left"}[n],H=a==="center"?V:`${V}-${a}`;let O=d;const L=1,U=n==="bottom"?L:0,z=n==="top"?L:0,T=n==="right"?L:0,M=n==="left"?L:0;typeof O=="number"?O={top:O+U,right:O+M,bottom:O+z,left:O+T}:O&&(O={top:(O.top||0)+U,right:(O.right||0)+M,bottom:(O.bottom||0)+z,left:(O.left||0)+T});const te={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:O},le=x.useRef(null),G=Nn(o),fe=Nn(l),be=[q4(se=>{const Ce=nw(se,n,F),Ve=typeof G.current=="function"?G.current(Ce):G.current,Qe=typeof fe.current=="function"?fe.current(Ce):fe.current;return{mainAxis:Ve,crossAxis:Qe,alignmentAxis:Qe}},[typeof o!="function"?o:0,typeof l!="function"?l:0,F,n])],pe=I==="none"&&P!=="shift",ue=!pe&&(p||C||P==="shift"),ge=P==="none"?null:Y4({...te,padding:{top:O.top+L,right:O.right+L,bottom:O.bottom+L,left:O.left+L},mainAxis:!C&&P==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:re}),qe=pe?null:G4(se=>{const Ce=_t(se.elements.floating).documentElement;return{...te,rootBoundary:C?{x:0,y:0,width:Ce.clientWidth,height:Ce.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:ue,limiter:p||C?void 0:X4(Ve=>{if(!le.current)return{};const{width:Qe,height:Pe}=le.current.getBoundingClientRect(),he=Xr($r(Ve.placement)),ve=he==="y"?Qe:Pe,ye=he==="y"?O.left+O.right:O.top+O.bottom;return{offset:ve/2+ye/2}})}},[te,p,C,O,I]);P==="shift"||I==="shift"||a==="center"?be.push(qe,ge):be.push(ge,qe),be.push(K4({...te,apply({elements:{floating:se},availableWidth:Ce,availableHeight:Ve,rects:Qe}){const Pe=se.style;Pe.setProperty("--available-width",`${Ce}px`),Pe.setProperty("--available-height",`${Ve}px`);const he=window.devicePixelRatio||1,{x:ve,y:ye,width:xe,height:Ue}=Qe.reference,Ze=(Math.round((ve+xe)*he)-Math.round(ve*he))/he,dt=(Math.round((ye+Ue)*he)-Math.round(ye*he))/he;Pe.setProperty("--anchor-width",`${Ze}px`),Pe.setProperty("--anchor-height",`${dt}px`)}}),u4(()=>({element:le.current||document.createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(se){const{elements:Ce,middlewareData:Ve,placement:Qe,rects:Pe,y:he}=se,ve=$r(Qe),ye=Xr(ve),xe=le.current,Ue=Ve.arrow?.x||0,Ze=Ve.arrow?.y||0,dt=xe?.clientWidth||0,Ht=xe?.clientHeight||0,Zr=Ue+dt/2,en=Ze+Ht/2,hi=Math.abs(Ve.shift?.y||0),wn=Pe.reference.height/2,tn=typeof o=="function"?o(nw(se,n,F)):o,Sn=hi>tn,sa={top:`${Zr}px calc(100% + ${tn}px)`,bottom:`${Zr}px ${-tn}px`,left:`calc(100% + ${tn}px) ${en}px`,right:`${-tn}px ${en}px`}[ve],En=`${Zr}px ${Pe.reference.y+wn-he}px`;return Ce.floating.style.setProperty("--transform-origin",ue&&ye==="y"&&Sn?En:sa),{}}},J4,k),lt(()=>{!E&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[E,w]);const Xe=x.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:we,elements:ze,x:We,y:tt,middlewareData:De,update:Fe,placement:ct,context:Ne,isPositioned:oe,floatingStyles:Se}=t2({rootContext:w,placement:H,middleware:be,strategy:r,whileElementsMounted:y?void 0:(...se)=>tw(...se,Xe),nodeId:R,externalTree:A}),{sideX:Je,sideY:ht}=De.adaptiveOrigin||Uu,Ut=oe?r:"fixed",Vt=x.useMemo(()=>{const se=k?{position:Ut,[Je]:We,[ht]:tt}:{position:Ut,...Se};return oe||(se.opacity=0),se},[k,Ut,Je,We,ht,tt,Se,oe]),jt=x.useRef(null);lt(()=>{if(!E)return;const se=X.current,Ce=typeof se=="function"?se():se,Ve=(iw(Ce)?Ce.current:Ce)||null||null;Ve!==jt.current&&(we.setPositionReference(Ve),jt.current=Ve)},[E,we,ne,X]),x.useEffect(()=>{if(!E)return;const se=X.current;typeof se!="function"&&iw(se)&&se.current!==jt.current&&(we.setPositionReference(se.current),jt.current=se.current)},[E,we,ne,X]),x.useEffect(()=>{if(y&&E&&ze.domReference&&ze.floating)return tw(ze.domReference,ze.floating,Fe,Xe)},[y,E,ze,Fe,Xe]);const Wt=$r(ct),bt=oR(n,Wt,F),rt=Zi(ct)||"center",q=!!De.hide?.referenceHidden;lt(()=>{$&&E&&oe&&N(Wt)},[$,E,oe,Wt]);const Q=x.useMemo(()=>({position:"absolute",top:De.arrow?.y,left:De.arrow?.x}),[De.arrow]),ie=De.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Vt,arrowStyles:Q,arrowRef:le,arrowUncentered:ie,side:bt,align:rt,physicalSide:Wt,anchorHidden:q,refs:we,context:Ne,isPositioned:oe,update:Fe}),[Vt,Q,le,ie,bt,rt,Wt,q,we,Ne,oe,Fe])}function iw(e){return e!=null&&"current"in e}const n2=x.forwardRef(function(e,t){const{cutout:r,...n}=e;let o;if(r){const a=r?.getBoundingClientRect();o=`polygon(
17
17
  0% 0%,
18
18
  100% 0%,
19
19
  100% 100%,
@@ -24,9 +24,9 @@ Error generating stack: `+b.message+`
24
24
  ${a.right}px ${a.bottom}px,
25
25
  ${a.right}px ${a.top}px,
26
26
  ${a.left}px ${a.top}px
27
- )`}return v.jsx("div",{ref:t,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function iR(e){return e==="starting"?Lj:Rr}const t2=x.createContext(void 0);function r2(e){return x.useContext(t2)}const n2="ArrowUp",i2="ArrowDown",o2="ArrowLeft",s2="ArrowRight",a2="Home",l2=new Set([n2,i2,o2,s2,a2,"End"]);function c2(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingElement"),a=r.useState("domReferenceElement"),{dataRef:l}=r.context,{enabled:u=!0,closeDelay:d=0}=t,p=Pk(r),h=ta(),m=Vo(),y=et(()=>Dk(l.current.openEvent?.type,p.interactedInside)),w=et(()=>{const $=l.current.openEvent?.type;return $?.includes("mouse")&&$!=="mousedown"}),E=et($=>Ck($,r.context.triggerElements)),S=x.useCallback($=>{const A=Fu(d,"close",p.pointerType),D=()=>{r.setOpen(!1,zt(Cr,$)),h?.events.emit("floating.closed",$)};A?p.openChangeTimeout.start(A,D):(p.openChangeTimeout.clear(),D())},[d,r,p,h]),C=et(()=>{uv(p)}),R=et($=>{const A=gn($);if(!$M(A)){p.interactedInside=!1;return}p.interactedInside=A?.closest("[aria-haspopup]")!=null});at(()=>{n||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,C())},[n,p,C]),x.useEffect(()=>C,[C]),at(()=>{if(u&&n&&p.handleCloseOptions?.blockPointerEvents&&w()&&gt(a)&&o){const $=a,A=o,D=_t(o),N=h?.nodesRef.current.find(I=>I.id===m)?.context?.elements.floating;N&&(N.style.pointerEvents="");const P=p.handleCloseOptions?.getScope?.()??p.pointerEventsScopeElement??N??$.closest("[data-rootownerid]")??D.body;return TM(p,{scopeElement:P,referenceElement:$,floatingElement:A}),()=>{C()}}},[u,n,a,o,p,w,h,m,C]);const k=Vs();x.useEffect(()=>{if(!u)return;function $(){p.openChangeTimeout.clear(),k.clear(),h?.events.off("floating.closed",D),C()}function A(P){if(h&&m&&oi(h.nodesRef.current,m).length>0){h.events.on("floating.closed",D);return}if(!E(P.relatedTarget)){if(p.handler){p.handler(P);return}C(),y()||S(P)}}function D(P){!h||!m||oi(h.nodesRef.current,m).length>0||k.start(0,()=>{h.events.off("floating.closed",D),r.setOpen(!1,zt(Cr,P)),h.events.emit("floating.closed",P)})}const N=o;return N&&(N.addEventListener("mouseenter",$),N.addEventListener("mouseleave",A),N.addEventListener("pointerdown",R,!0)),()=>{N&&(N.removeEventListener("mouseenter",$),N.removeEventListener("mouseleave",A),N.removeEventListener("pointerdown",R,!0)),h?.events.off("floating.closed",D)}},[u,o,r,l,y,E,S,C,R,p,h,m,k])}const uh={inert:new WeakMap,"aria-hidden":new WeakMap},ow="data-base-ui-inert",vg={inert:new WeakSet,"aria-hidden":new WeakSet};let Ja=new WeakMap,dh=0;function u2(e){return vg[e]}function oR(e){return e?bl(e)?e.host:oR(e.parentNode):null}const fh=(e,t)=>t.map(r=>{if(e.contains(r))return r;const n=oR(r);return e.contains(n)?n:null}).filter(r=>r!=null),sw=e=>{const t=new Set;return e.forEach(r=>{let n=r;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},aw=(e,t,r)=>{const n=[],o=a=>{!a||r.has(a)||Array.from(a.children).forEach(l=>{Qi(l)!=="script"&&(t.has(l)?o(l):n.push(l))})};return o(e),n};function d2(e,t,r,n,{mark:o=!0,markerIgnoreElements:a=[]}){const l=n?"inert":r?"aria-hidden":null;let u=null,d=null;const p=fh(t,e),h=o?fh(t,a):[],m=new Set(h),y=o?aw(t,sw(p),new Set(p)).filter(S=>!m.has(S)):[],w=[],E=[];if(l){const S=uh[l],C=u2(l);d=C,u=S;const R=fh(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(R);aw(t,sw(k),new Set(k)).forEach($=>{const A=$.getAttribute(l),D=A!==null&&A!=="false",N=(S.get($)||0)+1;S.set($,N),w.push($),N===1&&D&&C.add($),D||$.setAttribute(l,l==="inert"?"":"true")})}return o&&y.forEach(S=>{const C=(Ja.get(S)||0)+1;Ja.set(S,C),E.push(S),C===1&&S.setAttribute(ow,"")}),dh+=1,()=>{u&&w.forEach(S=>{const C=(u.get(S)||0)-1;u.set(S,C),C||(!d?.has(S)&&l&&S.removeAttribute(l),d?.delete(S))}),o&&E.forEach(S=>{const C=(Ja.get(S)||0)-1;Ja.set(S,C),C||S.removeAttribute(ow)}),dh-=1,dh||(uh.inert=new WeakMap,uh["aria-hidden"]=new WeakMap,vg.inert=new WeakSet,vg["aria-hidden"]=new WeakSet,Ja=new WeakMap)}}function lw(e,t={}){const{ariaHidden:r=!1,inert:n=!1,mark:o=!0,markerIgnoreElements:a=[]}=t,l=_t(e[0]).body;return d2(e,l,r,n,{mark:o,markerIgnoreElements:a})}function f2(e,t){const r=tr(e.target);return e instanceof r.KeyboardEvent?"keyboard":e instanceof r.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof r.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const cw=20;let Fi=[];function pv(){Fi=Fi.filter(e=>e.deref()?.isConnected)}function p2(e){pv(),e&&Qi(e)!=="body"&&(Fi.push(new WeakRef(e)),Fi.length>cw&&(Fi=Fi.slice(-cw)))}function ph(){return pv(),Fi[Fi.length-1]?.deref()}function h2(e){if(!e)return null;const t=ra();return Vk(e,t)?e:Tl(e,t)[0]||e}function m2(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():K6(e)}function uw(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=ra(),n=JM(e,r).filter(a=>{const l=a.getAttribute("data-tabindex")||"";return Vk(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||n.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function g2(e){const{context:t,children:r,disabled:n=!1,initialFocus:o=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:p="",nextFocusableElement:h,previousFocusableElement:m,beforeContentFocusGuardRef:y,externalTree:w,getInsideElements:E}=e,S="rootStore"in t?t.rootStore:t,C=S.useState("open"),R=S.useState("domReferenceElement"),k=S.useState("floatingElement"),{events:$,dataRef:A}=S.context,D=et(()=>A.current.floatingContext?.nodeId),N=o===!1,P=Mx(R)&&N,I=x.useRef(["content"]),re=Nn(o),Z=Nn(a),ee=Nn(p),ne=ta(w),X=Xk(),F=x.useRef(!1),V=x.useRef(!1),H=x.useRef(!1),O=x.useRef(-1),L=x.useRef(""),U=x.useRef(""),z=x.useRef(null),T=x.useRef(null),M=ud(z,y,X?.beforeInsideRef),te=ud(T,X?.afterInsideRef),le=Vs(),G=Vs(),fe=ev(),be=X!=null,pe=lg(k),ue=et((we=pe)=>we?Tl(we,ra()):[]),ge=et(()=>E?.().filter(we=>we!=null)??[]),qe=et(we=>{const ze=ue(we);return I.current.map(()=>ze).filter(Boolean).flat()});x.useEffect(()=>{if(n||!u)return;function we(We){We.key==="Tab"&&st(pe,$o(_t(pe)))&&ue().length===0&&!P&&p6(We)}const ze=_t(pe);return ze.addEventListener("keydown",we),()=>{ze.removeEventListener("keydown",we)}},[n,R,pe,u,I,P,ue,qe]),x.useEffect(()=>{if(n||!C)return;const we=_t(pe);function ze(){H.current=!1}function We(De){const Fe=gn(De),lt=ge(),Ne=st(k,Fe)||st(R,Fe)||st(X?.portalNode,Fe)||lt.some(oe=>oe===Fe||st(oe,Fe));H.current=!Ne,U.current=De.pointerType||"keyboard",Fe?.closest(`[${lk}]`)&&(V.current=!0)}function tt(){U.current="keyboard"}return we.addEventListener("pointerdown",We,!0),we.addEventListener("pointerup",ze,!0),we.addEventListener("pointercancel",ze,!0),we.addEventListener("keydown",tt,!0),()=>{we.removeEventListener("pointerdown",We,!0),we.removeEventListener("pointerup",ze,!0),we.removeEventListener("pointercancel",ze,!0),we.removeEventListener("keydown",tt,!0)}},[n,k,R,pe,C,X,ge]),x.useEffect(()=>{if(n||!d)return;const we=_t(pe);function ze(){V.current=!0,G.start(0,()=>{V.current=!1})}function We(Ne){const oe=gn(Ne),Se=ue().indexOf(oe);Se!==-1&&(O.current=Se)}function tt(Ne){const oe=Ne.relatedTarget,Se=Ne.currentTarget,Je=gn(Ne);queueMicrotask(()=>{const ht=D(),Bt=S.context.triggerElements,Ut=ge(),jt=oe?.hasAttribute(sd("focus-guard"))&&[z.current,T.current,X?.beforeInsideRef.current,X?.afterInsideRef.current,X?.beforeOutsideRef.current,X?.afterOutsideRef.current,Zn(m),Zn(h)].includes(oe),Vt=!(st(R,oe)||st(k,oe)||st(oe,k)||st(X?.portalNode,oe)||Ut.some(bt=>bt===oe||st(bt,oe))||oe!=null&&Bt.hasElement(oe)||Bt.hasMatchingElement(bt=>st(bt,oe))||jt||ne&&(oi(ne.nodesRef.current,ht).find(bt=>st(bt.context?.elements.floating,oe)||st(bt.context?.elements.domReference,oe))||zx(ne.nodesRef.current,ht).find(bt=>[bt.context?.elements.floating,lg(bt.context?.elements.floating)].includes(oe)||bt.context?.elements.domReference===oe)));if(Se===R&&pe&&uw(pe,I),l&&Se!==R&&!m2(Je)&&$o(we)===we.body){if(Kt(pe)&&(pe.focus(),l==="popup")){fe.request(()=>{pe.focus()});return}const bt=O.current,rt=ue(),q=rt[bt]||rt[rt.length-1]||pe;Kt(q)&&q.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(P||!u)&&oe&&Vt&&!V.current&&(P||oe!==ph())&&(F.current=!0,S.setOpen(!1,zt(El,Ne)))})}function De(){H.current||(A.current.insideReactTree=!0,le.start(0,()=>{A.current.insideReactTree=!1}))}const Fe=Kt(R)?R:null,lt=[];if(!(!k&&!Fe))return Fe&&(Fe.addEventListener("focusout",tt),Fe.addEventListener("pointerdown",ze),lt.push(()=>{Fe.removeEventListener("focusout",tt),Fe.removeEventListener("pointerdown",ze)})),k&&(k.addEventListener("focusin",We),k.addEventListener("focusout",tt),X&&(k.addEventListener("focusout",De,!0),lt.push(()=>{k.removeEventListener("focusout",De,!0)})),lt.push(()=>{k.removeEventListener("focusin",We),k.removeEventListener("focusout",tt)})),()=>{lt.forEach(Ne=>{Ne()})}},[n,R,k,pe,u,ne,X,S,d,l,ue,P,D,I,A,le,G,fe,h,m,ge]),x.useEffect(()=>{if(n||!k||!C)return;const we=Array.from(X?.portalNode?.querySelectorAll(`[${sd("portal")}]`)||[]),ze=(ne?zx(ne.nodesRef.current,D()):[]).find(lt=>Mx(lt.context?.elements.domReference||null))?.context?.elements.domReference,We=[k,...we,z.current,T.current,X?.beforeOutsideRef.current,X?.afterOutsideRef.current,...ge(),ze,Zn(m),Zn(h),P?R:null].filter(lt=>lt!=null),tt=lw(We,{ariaHidden:u||P,mark:!1}),De=[k,...we].filter(lt=>lt!=null),Fe=lw(De);return()=>{Fe(),tt()}},[C,n,R,k,u,I,X,P,ne,D,h,m,ge]),at(()=>{if(!C||n||!Kt(pe))return;const we=_t(pe),ze=$o(we);queueMicrotask(()=>{const We=qe(pe),tt=re.current,De=typeof tt=="function"?tt(ee.current||""):tt;if(De===void 0||De===!1)return;let Fe;De===!0||De===null?Fe=We[0]||pe:Fe=Zn(De),Fe=Fe||We[0]||pe,!st(pe,ze)&&sh(Fe,{preventScroll:Fe===pe})})},[n,C,pe,N,qe,re,ee]),at(()=>{if(n||!pe)return;const we=_t(pe),ze=$o(we);p2(ze);function We(De){if(De.open||(L.current=f2(De.nativeEvent,U.current)),De.reason===Cr&&De.nativeEvent.type==="mouseleave"&&(F.current=!0),De.reason===kk)if(De.nested)F.current=!1;else if(m6(De.nativeEvent)||g6(De.nativeEvent))F.current=!1;else{let Fe=!1;document.createElement("div").focus({get preventScroll(){return Fe=!0,!1}}),Fe?F.current=!1:F.current=!0}}$.on("openchange",We);function tt(){const De=Z.current;let Fe=typeof De=="function"?De(L.current):De;if(Fe===void 0||Fe===!1)return null;if(Fe===null&&(Fe=!0),typeof Fe=="boolean"){const Ne=R||ph();return Ne&&Ne.isConnected?Ne:null}const lt=R||ph();return Zn(Fe)||lt||null}return()=>{$.off("openchange",We);const De=$o(we),Fe=ge(),lt=st(k,De)||Fe.some(oe=>oe===De||st(oe,De))||ne&&oi(ne.nodesRef.current,D(),!1).some(oe=>st(oe.context?.elements.floating,De)),Ne=tt();queueMicrotask(()=>{const oe=h2(Ne),Se=typeof Z.current!="boolean";Z.current&&!F.current&&Kt(oe)&&(!(!Se&&oe!==De&&De!==we.body)||lt)&&oe.focus({preventScroll:!0}),F.current=!1})}},[n,k,pe,Z,A,$,ne,R,D,ge]),at(()=>{if(!ik||C||!k)return;const we=$o(_t(k));!Kt(we)||!iv(we)||st(k,we)&&we.blur()},[C,k]),at(()=>{if(!(n||!X))return X.setFocusManagerState({modal:u,closeOnFocusOut:d,open:C,onOpenChange:S.setOpen,domReference:R}),()=>{X.setFocusManagerState(null)}},[n,X,u,C,S,d,R]),at(()=>{if(!(n||!pe))return uw(pe,I),()=>{queueMicrotask(pv)}},[n,pe,I]);const Xe=!n&&(u?!P:!0)&&(be||u);return v.jsxs(x.Fragment,{children:[Xe&&v.jsx(qs,{"data-type":"inside",ref:M,onFocus:we=>{if(u){const ze=qe();sh(ze[ze.length-1])}else X?.portalNode&&(F.current=!1,Ps(we,X.portalNode)?dv(R)?.focus():Zn(m??X.beforeOutsideRef)?.focus())}}),r,Xe&&v.jsx(qs,{"data-type":"inside",ref:te,onFocus:we=>{u?sh(qe()[0]):X?.portalNode&&(d&&(F.current=!0),Ps(we,X.portalNode)?Hk(R)?.focus():Zn(h??X.afterOutsideRef)?.focus())}})]})}function v2(){return{...b6(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const y2={...x6,disabled:ct(e=>e.disabled),instantType:ct(e=>e.instantType),openMethod:ct(e=>e.openMethod),openChangeReason:ct(e=>e.openChangeReason),modal:ct(e=>e.modal),stickIfOpen:ct(e=>e.stickIfOpen),titleElementId:ct(e=>e.titleElementId),descriptionElementId:ct(e=>e.descriptionElementId),openOnHover:ct(e=>e.openOnHover),closeDelay:ct(e=>e.closeDelay),hasViewport:ct(e=>e.hasViewport)};let b2=class sR extends fk{constructor(t){const r={...v2(),...t};r.open&&t?.mounted===void 0&&(r.mounted=!0),super(r,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),stickIfOpenTimeout:new li,triggerElements:new nv},y2)}setOpen=(t,r)=>{const n=r.reason===Cr,o=r.reason===Ws&&r.event.detail===0,a=!t&&(r.reason===Rk||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,r),r.isCanceled)return;const l={open:t,nativeEvent:r.event,reason:r.reason,nested:this.state.nested,triggerElement:r.trigger};this.state.floatingRootContext.context.events?.emit("openchange",l);const u=()=>{const d={open:t,openChangeReason:r.reason},p=r.trigger?.id??null;(p||t)&&(d.activeTriggerId=p,d.activeTriggerElement=r.trigger??null),this.update(d)};n?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Tj,()=>{this.set("stickIfOpen",!1)}),Lr.flushSync(u)):u(),o||a?this.set("instantType",o?"click":"dismiss"):r.reason===El?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,r){const n=yn(()=>new sR(r)).current,o=t??n;return Dd(n.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};const aR=x.createContext(void 0);function na(e){const t=x.useContext(aR);if(t===void 0&&!e)throw new Error(Uo(47));return t}function dw({props:e}){const{children:t,open:r,defaultOpen:n=!1,onOpenChange:o,onOpenChangeComplete:a,modal:l=!1,handle:u,triggerId:d,defaultTriggerId:p=null}=e,h=b2.useStore(u?.store,{modal:l,open:n,openProp:r,activeTriggerId:p,triggerIdProp:d});dj(()=>{r===void 0&&h.state.open===!1&&n===!0&&h.update({open:!0,activeTriggerId:p})}),h.useControlledProp("openProp",r),h.useControlledProp("triggerIdProp",d);const m=h.useState("open"),y=h.useState("positionerElement"),w=h.useState("payload"),E=h.useState("openChangeReason");h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",a);const{openMethod:S,triggerProps:C}=Mj(m);A6(h);const{forceUnmount:R}=T6(m,h,()=>{h.update({stickIfOpen:!0,openChangeReason:null})});$j(m&&l===!0&&E!==Cr&&S!=="touch",y),x.useEffect(()=>{m||h.context.stickIfOpenTimeout.clear()},[h,m]);const k=x.useCallback(F=>{const V=zt(F);return V.preventUnmountOnClose=()=>{h.set("preventUnmountingOnClose",!0)},V},[h]),$=x.useCallback(()=>{h.setOpen(!1,k(O6))},[h,k]);x.useImperativeHandle(e.actionsRef,()=>({unmount:R,close:$}),[R,$]);const A=L6({popupStore:h,onOpenChange:h.setOpen}),D=j6(A,{outsidePressEvent:{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),N=z6(A),{getReferenceProps:P,getFloatingProps:I,getTriggerProps:re}=$k([D,N]),Z=x.useMemo(()=>P(C),[P,C]),ee=x.useMemo(()=>re(C),[re,C]),ne=x.useMemo(()=>I(),[I]);h.useSyncedValues({modal:l,openMethod:S,activeTriggerProps:Z,inactiveTriggerProps:ee,popupProps:ne,floatingRootContext:A,nested:Vo()!=null});const X=x.useMemo(()=>({store:h}),[h]);return v.jsx(aR.Provider,{value:X,children:typeof t=="function"?t({payload:w}):t})}function x2(e){return na(!0)?v.jsx(dw,{props:e}):v.jsx(E6,{children:v.jsx(dw,{props:e})})}const w2=300,S2=x.forwardRef(function(e,t){const{render:r,className:n,disabled:o=!1,nativeButton:a=!0,handle:l,payload:u,openOnHover:d=!1,delay:p=w2,closeDelay:h=0,id:m,...y}=e,w=na(!0),E=l?.store??w?.store;if(!E)throw new Error(Uo(74));const S=CM(m),C=E.useState("isTriggerActive",S),R=E.useState("floatingRootContext"),k=E.useState("isOpenedByTrigger",S),$=x.useRef(null),{registerTrigger:A,isMountedByThisTrigger:D}=$6(S,$,E,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),N=E.useState("openChangeReason"),P=E.useState("stickIfOpen"),I=E.useState("openMethod"),re=OM(R,{enabled:R!=null&&d&&(I!=="touch"||N!==Ws),mouseOnly:!0,move:!1,handleClose:DM(),restMs:p,delay:{close:h},triggerElementRef:$,isActiveTrigger:C}),Z=jM(R,{enabled:R!=null,stickIfOpen:P}),ee=$k([Z]),ne=E.useState("triggerProps",D),X={disabled:o,open:k},{getButtonProps:F,buttonRef:V}=SM({disabled:o,native:a}),H=x.useMemo(()=>({open(T){return T&&N===Ws?lM.open(T):aM.open(T)}}),[N]),O=Al("button",e,{state:X,ref:[V,t,A,$],props:[ee.getReferenceProps(),re,ne,{[lk]:"",id:S},y,F],stateAttributesMapping:H}),L=x.useRef(null),U=et(T=>{Lr.flushSync(()=>{E.setOpen(!1,zt(El,T.nativeEvent,T.currentTarget))}),e4(L.current)?.focus()}),z=et(T=>{const M=E.select("positionerElement");if(M&&Ps(T,M))E.context.beforeContentFocusGuardRef.current?.focus();else{Lr.flushSync(()=>{E.setOpen(!1,zt(El,T.nativeEvent,T.currentTarget))});let te=ZM(E.context.triggerFocusTargetRef.current||$.current);for(;te!==null&&st(M,te);){const le=te;if(te=dv(te),te===le)break}te?.focus()}});return C?v.jsxs(x.Fragment,{children:[v.jsx(qs,{ref:L,onFocus:U}),v.jsx(x.Fragment,{children:O},S),v.jsx(qs,{ref:E.context.triggerFocusTargetRef,onFocus:z})]}):v.jsx(x.Fragment,{children:O},S)}),lR=x.createContext(void 0);function E2(){const e=x.useContext(lR);if(e===void 0)throw new Error(Uo(45));return e}const C2=x.forwardRef(function(e,t){const{keepMounted:r=!1,...n}=e,{store:o}=na();return o.useState("mounted")||r?v.jsx(lR.Provider,{value:r,children:v.jsx(i4,{ref:t,...n})}):null}),k2={...cv,...yk},R2=x.forwardRef(function(e,t){const{className:r,render:n,...o}=e,{store:a}=na(),l=a.useState("open"),u=a.useState("mounted"),d=a.useState("transitionStatus"),p=a.useState("openChangeReason");return Al("div",e,{state:{open:l,transitionStatus:d},ref:[a.context.backdropRef,t],props:[{role:"presentation",hidden:!u,style:{pointerEvents:p===Cr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o],stateAttributesMapping:k2})}),cR=x.createContext(void 0);function _2(){const e=x.useContext(cR);if(!e)throw new Error(Uo(46));return e}const $2=x.forwardRef(function(e,t){const{render:r,className:n,anchor:o,positionMethod:a="absolute",side:l="bottom",align:u="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:h="clipping-ancestors",collisionPadding:m=5,arrowPadding:y=5,sticky:w=!1,disableAnchorTracking:E=!1,collisionAvoidance:S=Ij,...C}=e,{store:R}=na(),k=E2(),$=w6(),A=R.useState("floatingRootContext"),D=R.useState("mounted"),N=R.useState("open"),P=R.useState("openChangeReason"),I=R.useState("activeTriggerElement"),re=R.useState("modal"),Z=R.useState("positionerElement"),ee=R.useState("instantType"),ne=R.useState("transitionStatus"),X=R.useState("hasViewport"),F=x.useRef(null),V=bk(Z,!1,!1),H=Z4({anchor:o,floatingRootContext:A,positionMethod:a,mounted:D,side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:y,collisionBoundary:h,collisionPadding:m,sticky:w,disableAnchorTracking:E,keepMounted:k,nodeId:$,collisionAvoidance:S,adaptiveOrigin:X?K4:void 0}),O=x.useMemo(()=>{const te={};return N||(te.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...H.positionerStyles,...te}}},[N,D,H.positionerStyles]),L=x.useMemo(()=>({props:O,...H}),[O,H]),U=A.useState("domReferenceElement");at(()=>{const te=U,le=F.current;if(te&&(F.current=te),le&&te&&te!==le){R.set("instantType",void 0);const G=new AbortController;return V(()=>{R.set("instantType","trigger-change")},G.signal),()=>{G.abort()}}},[U,V,R]);const z={open:N,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:ee},T=x.useCallback(te=>{R.set("positionerElement",te)},[R]),M=Al("div",e,{state:z,props:[L.props,iR(ne),C],ref:[t,T],stateAttributesMapping:cv});return v.jsxs(cR.Provider,{value:L,children:[D&&re===!0&&P!==Cr&&v.jsx(e2,{ref:R.context.internalBackdropRef,inert:o4(!N),cutout:I}),v.jsx(S6,{id:$,children:M})]})}),A2=x.createContext(void 0);function T2(){const[e,t]=x.useState(0),r=et(()=>(t(n=>n+1),()=>{t(n=>Math.max(0,n-1))}));return{context:x.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}function L2(e){const{value:t,children:r}=e;return v.jsx(A2.Provider,{value:t,children:r})}const I2={...cv,...yk},O2=x.forwardRef(function(e,t){const{className:r,render:n,initialFocus:o,finalFocus:a,...l}=e,{store:u}=na(),d=_2(),p=r2()!=null,{context:h,hasClosePart:m}=T2(),y=u.useState("open"),w=u.useState("openMethod"),E=u.useState("instantType"),S=u.useState("transitionStatus"),C=u.useState("popupProps"),R=u.useState("titleElementId"),k=u.useState("descriptionElementId"),$=u.useState("modal"),A=u.useState("mounted"),D=u.useState("openChangeReason"),N=u.useState("activeTriggerElement"),P=u.useState("floatingRootContext");xk({open:y,ref:u.context.popupRef,onComplete(){y&&u.context.onOpenChangeComplete?.(!0)}});const I=u.useState("disabled"),re=u.useState("openOnHover"),Z=u.useState("closeDelay");c2(P,{enabled:re&&!I,closeDelay:Z});function ee(O){return O==="touch"?u.context.popupRef.current:!0}const ne=o===void 0?ee:o,X={open:y,side:d.side,align:d.align,instant:E,transitionStatus:S},F=$!==!1&&m,V=x.useCallback(O=>{u.set("popupElement",O)},[u]),H=Al("div",e,{state:X,ref:[t,u.context.popupRef,V],props:[C,{"aria-labelledby":R,"aria-describedby":k,onKeyDown(O){p&&l2.has(O.key)&&O.stopPropagation()}},iR(S),l],stateAttributesMapping:I2});return v.jsx(g2,{context:P,openInteractionType:w,modal:F,disabled:!A||D===Cr,initialFocus:ne,returnFocus:a,restoreFocus:"popup",previousFocusableElement:Kt(N)?N:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:v.jsx(L2,{value:h,children:H})})}),[N2,P2]=Cd("Popover"),D2=kr(["overflow-hidden rounded-md bg-canvas-sheet p-16 outline-none","shadow-xl","data-open:data-[side=top]:animate-slide-in-from-bottom","data-closed:data-[side=top]:animate-slide-out-to-bottom","data-open:data-[side=bottom]:animate-slide-in-from-top","data-closed:data-[side=bottom]:animate-slide-out-to-top","data-open:data-[side=left]:animate-slide-in-from-right","data-closed:data-[side=left]:animate-slide-out-to-right","data-open:data-[side=right]:animate-slide-in-from-left","data-closed:data-[side=right]:animate-slide-out-to-left"],{variants:{width:{fit:"",fixed:"w-400"}},defaultVariants:{width:"fit"}}),j2=Qt("fixed inset-0 z-dialog-overlay bg-canvas-overlay-subtle","data-open:animate-fade-in","data-closed:animate-fade-out"),M2=({open:e,defaultOpen:t,onOpenChange:r,overlay:n=!1,handle:o,children:a})=>v.jsx(N2,{value:{overlay:n},children:v.jsx(x2,{open:e,defaultOpen:t,onOpenChange:r,modal:n,handle:o,children:a})}),z2=({handle:e,payload:t,render:r,className:n,...o})=>v.jsx(S2,{"data-slot":"popover-trigger",handle:e,payload:t,render:r,className:Qt("data-popup-open:z-menu",n),...o}),F2=({side:e="bottom",sideOffset:t=8,align:r="start",width:n="fit",initialFocus:o=!1,className:a,children:l})=>{const{overlay:u}=P2({consumerName:"PopoverContent",contextRequired:!0});return v.jsxs(C2,{children:[u&&v.jsx(R2,{"data-slot":"popover-overlay",className:j2}),v.jsx($2,{"data-slot":"popover-positioner",className:"z-menu",side:e,sideOffset:t,align:r,children:v.jsx(O2,{"data-slot":"popover-content",initialFocus:o,className:Qt(D2({width:n}),a),children:l})})]})},B2=pt("ChevronLeft",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M9.333 5.333 6.667 8l2.666 2.667"})})),[U2,V2]=Cd("SegmentedControl"),W2=()=>V2({consumerName:"SegmentedControlButton",contextRequired:!0});function H2({ref:e,selectedIndex:t,children:r}){const[n,o]=x.useState({width:0,height:0,x:0}),[a,l]=x.useState(!1);return x.useLayoutEffect(()=>{const u=e.current;if(!u)return;const d=()=>{const h=Array.from(u.children).slice(0,-1),m=t>=0?h[t]:void 0;o({width:m?.offsetWidth??0,height:u.offsetHeight,x:m?.offsetLeft??0})};if(d(),typeof ResizeObserver>"u")return;const p=new ResizeObserver(d);return p.observe(u),()=>p.disconnect()},[r,t,e]),x.useEffect(()=>{const u=requestAnimationFrame(()=>{l(!0)});return()=>cancelAnimationFrame(u)},[]),{pill:n,isReady:a}}function q2(e,t){return x.useMemo(()=>x.Children.toArray(t).findIndex(r=>x.isValidElement(r)&&r.props.value===e),[e,t])}function G2(e){const{canScrollLeft:t,canScrollRight:r}=qD(e),n=x.useCallback(o=>{const a=e.current;if(!a)return;const l=a.clientWidth/2;a.scrollBy({left:o==="left"?-l:l,behavior:"smooth"})},[e]);return{canScrollLeft:t,canScrollRight:r,scrollBy:n}}function X2(e,t){x.useLayoutEffect(()=>{if(t<0)return;const r=e.current;if(!r)return;const n=r.querySelectorAll('button[role="radio"]')[t];if(n){const{offsetLeft:o,offsetWidth:a}=n,{clientWidth:l}=r;r.scrollLeft=o-(l-a)/2}},[])}const Ll={root:kr("relative flex-row items-center rounded-sm",{variants:{tabLayout:{fit:"inline-flex",fixed:"flex w-full"}}}),pill:kr("pointer-events-none absolute top-0 left-0 z-0 rounded-sm",{variants:{disabled:{true:"bg-base-transparent-pressed",false:"bg-muted-transparent"},isReady:{true:"transition-[transform,width] duration-250 ease-in-out",false:"transition-none"}}}),item:kr("z-10 flex cursor-pointer flex-row items-center justify-center rounded-sm px-16 py-8 select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed",{variants:{selected:{true:"body-2-semi-bold",false:"body-2"},disabled:{true:"text-muted",false:""}},compoundVariants:[{selected:!0,disabled:!1,className:"text-base"},{selected:!1,disabled:!1,className:"text-muted hover:text-muted-hover"}]}),scrollArea:kr("relative rounded-sm",{variants:{appearance:{background:"bg-surface","no-background":"bg-transparent"},tabLayout:{fit:"",fixed:"w-full"}}}),arrow:kr("absolute inset-y-0 z-20 flex cursor-pointer items-center justify-center rounded-sm py-8 text-muted transition-opacity duration-200 hover:text-muted-hover",{variants:{visible:{true:"opacity-100",false:"pointer-events-none opacity-0"},side:{left:"left-0 pr-16 pl-8",right:"right-0 pr-8 pl-16"}}})};function Y2(e,t){return`linear-gradient(to right, ${e?"transparent 0px, transparent 40px, black 72px":"black 0px"}, ${t?"black calc(100% - 72px), transparent calc(100% - 40px), transparent 100%":"black 100%"})`}function fw({side:e,icon:t,visible:r,onClick:n}){return v.jsx("button",{type:"button","aria-hidden":!0,tabIndex:-1,disabled:!r,onClick:n,className:Ll.arrow({visible:r,side:e}),children:v.jsx(t,{size:20})})}function K2({appearance:e,tabLayout:t,className:r,selectedIndex:n,children:o,...a}){const l=x.useRef(null),{canScrollLeft:u,canScrollRight:d,scrollBy:p}=G2(l);X2(l,n);const h=u||d?Y2(u,d):void 0;return v.jsxs("div",{...a,className:Qt(Ll.scrollArea({appearance:e,tabLayout:t}),r),children:[v.jsx("div",{ref:l,className:"scrollbar-none overflow-x-auto",style:h?{maskImage:h,WebkitMaskImage:h}:void 0,children:o}),v.jsx(fw,{side:"left",icon:B2,visible:u,onClick:()=>p("left")}),v.jsx(fw,{side:"right",icon:Nd,visible:d,onClick:()=>p("right")})]})}function Q2({layout:e,isReady:t,disabled:r}){return v.jsx("div",{"aria-hidden":!0,className:Ll.pill({disabled:r,isReady:t}),style:{width:e.width,height:e.height,transform:`translateX(${e.x}px)`}})}function J2({tabLayout:e,disabled:t,selectedIndex:r,children:n}){const o=x.useRef(null),{pill:a,isReady:l}=H2({ref:o,selectedIndex:r,children:n});return v.jsxs("div",{ref:o,role:"radiogroup","aria-disabled":t,className:Ll.root({tabLayout:e}),children:[n,v.jsx(Q2,{layout:a,isReady:l,disabled:t})]})}function pw({value:e,children:t,icon:r,trailingContent:n,onClick:o,className:a,disabled:l,...u}){const{selectedValue:d,onSelectedChange:p,disabled:h,tabLayout:m}=W2(),y=d===e,w=x.useMemo(()=>!!(l||h),[l,h]);return v.jsx("button",{type:"button",role:"radio","aria-checked":y,"aria-disabled":w,disabled:w,onClick:E=>{w||(p(e),o?.(E))},className:Qt(Ll.item({selected:y,disabled:w}),m==="fixed"&&"min-w-0 flex-1",a),...u,children:v.jsxs("span",{className:"inline-flex min-w-0 items-center justify-center gap-8",children:[r&&v.jsx(r,{size:16,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 truncate",children:t}),n]})})}function Z2({selectedValue:e,onSelectedChange:t,children:r,className:n,disabled:o,appearance:a="background",tabLayout:l="fixed",...u}){const d=Ks({consumerName:"SegmentedControl",mergeWith:{disabled:o}}),p=q2(e,r);return v.jsx(U2,{value:{selectedValue:e,onSelectedChange:h=>t(h),disabled:d,tabLayout:l},children:v.jsx(K2,{...u,appearance:a,tabLayout:l,className:n,selectedIndex:p,children:v.jsx(J2,{tabLayout:l,disabled:d,selectedIndex:p,children:r})})})}const e5={md:16,sm:12},yg=({icon:e,size:t="md",...r})=>{const n=e,o=e5[t];return v.jsx(nj,{...r,size:t,variant:"tag",consumerName:"Tag",leadingContent:n?v.jsx(n,{size:o}):void 0})},gd={light:"light",dark:"dark",system:"system"},t5=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",r5=e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},n5=()=>()=>{},i5=e=>{const t=e===gd.system;return x.useSyncExternalStore(t?r5:n5,t?t5:()=>e,()=>"light")},o5=e=>{x.useLayoutEffect(()=>{const t=window.document.documentElement;t.classList.remove(gd.light,gd.dark),t.classList.add(e)},[e])},[s5,a5]=Cd("ThemeProvider"),l5=({children:e,colorScheme:t=gd.system,locale:r})=>{const n=i5(t);o5(n);const o=x.useMemo(()=>({colorScheme:n}),[n]);return v.jsx(s5,{value:o,children:v.jsx(xO,{locale:r,children:e})})},c5=()=>a5({consumerName:"useTheme",contextRequired:!0}),u5=pt("ArrowDown",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12.667V3.333m3.334 5.994-3.34 3.333-3.34-3.34"})})),uR=pt("ArrowUp",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 3.333v9.334m-3.334-6L8 3.327l3.333 3.333"})})),dR=pt("Copy",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M10 4v-.667C10 2.6 9.4 2 8.667 2H3.333C2.593 2 2 2.6 2 3.333v5.334C2 9.407 2.593 10 3.333 10H4m2-2.667v5.334C6 13.403 6.597 14 7.333 14h5.334c.736 0 1.333-.597 1.333-1.333V7.333C14 6.597 13.403 6 12.667 6H7.333C6.597 6 6 6.597 6 7.333"})})),d5=pt("Devices",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M6.667 14H3.333C2.593 14 2 13.4 2 12.667V3.333C2 2.593 2.593 2 3.333 2H10c.733 0 1.333.593 1.333 1.333v1.334m-.666 7.66H12M12.8 14H9.867a1.2 1.2 0 0 1-1.2-1.2V7.867c0-.667.533-1.2 1.2-1.2H12.8c.66 0 1.2.533 1.2 1.2V12.8c0 .66-.54 1.2-1.2 1.2"})})),fR=pt("Download",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M5.63 7.407 8 9.778l2.37-2.37M8 9.777V2.667m5.333 8.296a2.37 2.37 0 0 1-2.37 2.37H5.037a2.37 2.37 0 0 1-2.37-2.37"})})),pR=pt("Flex",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M12.017 14v.65h1.3V14h-1.3m-9.334 0v.65h1.3V14h-1.3m2.817-.65h-.65v1.3h.65v-1.3m5 1.3h.65v-1.3h-.65v1.3m-5-1.967a.65.65 0 1 0 0 1.3v-1.3m5 1.3a.65.65 0 1 0 0-1.3v1.3m2.167.017h.65V6.667h-1.3V14zm0-7.333h.65v-2h-1.3v2zm0-2h.65V4h-1.3v.667zm-2-2.667v-.65H5.333v1.3h5.334zM3.333 4h-.65v10h1.3V4zm2-2v-.65A2.65 2.65 0 0 0 2.683 4h1.3c0-.746.605-1.35 1.35-1.35zm7.334 2h.65a2.65 2.65 0 0 0-2.65-2.65v1.3c.745 0 1.35.604 1.35 1.35zm0 .667v.65h.466v-1.3h-.466zm.6.133h-.65v1.733h1.3V4.8zm-.134 1.867v-.65h-.466v1.3h.466zm.134-.134h-.65c0-.285.231-.516.516-.516v1.3c.433 0 .784-.351.784-.784zm-.134-1.866v.65a.517.517 0 0 1-.516-.517h1.3a.783.783 0 0 0-.784-.783zM5.5 14v.65h5v-1.3h-5zm0-.667v.65h5v-1.3h-5z"})})),f5=pt("Moon",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M13.133 10c-1.666.533-3.6.2-4.933-1.133-1.667-1.667-1.8-4.334-.467-6.2C5 2.933 2.867 5.2 2.867 8c0 2.933 2.4 5.333 5.333 5.333 2.2 0 4.133-1.4 4.933-3.333",clipRule:"evenodd"})})),Vu=pt("Nano",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M11.333 11.944a.279.279 0 0 0 .556 0 .28.28 0 0 0-.278-.277.28.28 0 0 0-.278.283M6.172 8 3.236 5.064a.333.333 0 0 1 0-.471l2.357-2.357c.13-.13.341-.13.471 0L11.83 8m-9.536 6H12a2 2 0 1 0 0-4H2.293a.293.293 0 0 0-.293.293v3.414c0 .162.131.293.293.293"})})),hR=pt("NanoGen5",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 1.333c.92 0 1.667.747 1.667 1.667v.333c.184 0 .333.15.333.334v1.666a.334.334 0 0 1-.266.327l-.067.007V13c0 .92-.746 1.667-1.667 1.667H5c-.92 0-1.667-.746-1.667-1.667V3c0-.92.747-1.667 1.667-1.667zM9.667 12.667a.667.667 0 0 0 0 1.333H11a.667.667 0 0 0 0-1.333zM5 2.333A.667.667 0 0 0 4.333 3v8c0 .368.299.667.667.667h6a.667.667 0 0 0 .667-.667V3A.667.667 0 0 0 11 2.333z",clipRule:"evenodd"})})),p5=pt("Screens",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M5.332 1.998h5.336m-6.67 2.5h8.004m.233 9.505h-8.47a1.334 1.334 0 0 1-1.327-1.2l-.434-4.336A1.334 1.334 0 0 1 3.331 7h9.338a1.334 1.334 0 0 1 1.327 1.467l-.434 4.335a1.334 1.334 0 0 1-1.327 1.2"})})),h5=pt("Send",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 2v9.334M13.332 14H2.667m1.999-8.666L8 2l3.333 3.334"})})),hv=pt("SparksFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M8 1.333a.333.333 0 0 0-.667 0v.223c0 .39-.145.76-.398 1.029A1.28 1.28 0 0 1 6 3a.333.333 0 1 0 0 .667c.346 0 .683.146.935.415.253.27.398.64.398 1.03v.221a.333.333 0 1 0 .667 0v-.222c0-.39.145-.76.398-1.029.252-.269.589-.415.935-.415a.333.333 0 1 0 0-.667c-.346 0-.683-.147-.935-.415A1.5 1.5 0 0 1 8 1.555zM12 5.267a.333.333 0 1 0-.667 0c0 .55-.213 1.077-.589 1.464a1.97 1.97 0 0 1-1.41.602.333.333 0 0 0 0 .667c.527 0 1.034.215 1.41.602s.59.914.59 1.465a.333.333 0 0 0 .666 0c0-.551.213-1.078.59-1.465A1.97 1.97 0 0 1 14 8a.333.333 0 0 0 0-.667 1.97 1.97 0 0 1-1.41-.602A2.1 2.1 0 0 1 12 5.267M6 7.333a.333.333 0 0 0-.667 0A3.333 3.333 0 0 1 2 10.667a.333.333 0 1 0 0 .666 3.333 3.333 0 0 1 3.333 3.334.333.333 0 0 0 .667 0 3.334 3.334 0 0 1 3.333-3.334.333.333 0 1 0 0-.666A3.333 3.333 0 0 1 6 7.333"})})),mR=pt("Stax",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",d:"M12 4.667h.467c.073 0 .133.06.133.133v1.733c0 .074-.06.134-.133.134H12M4.333 14h6.334c.736 0 1.333-.597 1.333-1.333V3.333C12 2.597 11.403 2 10.667 2H4.333A.333.333 0 0 0 4 2.333v11.334c0 .184.15.333.333.333Z"})})),m5=pt("Sun",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 2.667V1.333m0 13.334v-1.334m4.24-9.573.473-.473m-9.426 9.426.473-.473M13.333 8h1.334M1.333 8h1.334m9.573 4.24.473.473M3.287 3.287l.473.473m6.597 1.883a3.333 3.333 0 1 1-4.714 4.714 3.333 3.333 0 0 1 4.714-4.714"})})),gR=pt("Trash",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M12.333 4.333v8.334A1.333 1.333 0 0 1 11 14H5a1.334 1.334 0 0 1-1.333-1.333V4.333m9.666 0H2.667m6.666 7v-4m-2.666 4v-4m-1-3V3a1 1 0 0 1 1-1h2.666a1 1 0 0 1 1 1v1"})})),g5=pt("Unlink",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m11.403 8.36 1.458-1.458a2.75 2.75 0 0 0-3.889-3.89L7.514 4.472M5.5 10.374l1.25-1.25m2.5-2.5 1.25-1.25m2.187 7.187L3.313 3.187m1.284 4.201L3.139 8.846a2.75 2.75 0 1 0 3.889 3.89l1.458-1.459"})})),vt=({label:e,side:t="top",className:r="",children:n})=>v.jsxs(GC,{children:[v.jsx(XC,{asChild:!0,children:v.jsx("span",{className:`flex ${r}`,children:n})}),v.jsx(YC,{side:t,children:e})]}),vR=x.createContext(null),bg=x.createContext(!0),yR=x.createContext(!0),bR="AI debugging is not available here yet. Use the DevTools desktop app.",xR=({label:e,detail:t,onClear:r,onExplain:n})=>{const o=x.useContext(vR),a=x.useContext(bg),l=x.useContext(yR);if(!a)return null;const u=v.jsxs("button",{type:"button",onClick:n,disabled:!l,className:"flex cursor-pointer items-center gap-6 rounded-sm bg-accent px-12 py-6 body-3-semi-bold text-on-accent hover:bg-accent-hover disabled:pointer-events-none disabled:bg-muted-transparent disabled:text-disabled",children:[v.jsx(hv,{size:16}),"Explain with AI"]}),d=v.jsxs("div",{className:"flex shrink-0 items-center gap-10 border-t border-muted-subtle bg-surface px-12 py-8",children:[v.jsx("span",{className:"body-3-semi-bold",children:e}),v.jsx("span",{className:"truncate body-4 text-muted",children:t}),v.jsx("span",{className:"flex-1"}),v.jsx("button",{type:"button",onClick:r,className:"cursor-pointer rounded-sm bg-muted-transparent px-12 py-6 body-3-semi-bold hover:bg-muted-transparent-hover",children:"Clear"}),l?u:v.jsx(vt,{label:bR,children:u})]});return o?Lr.createPortal(d,o):d};var Di=(e=>(e.logs="logs",e.inspector="inspector",e))(Di||{});const v5=({size:e=16,className:t})=>v.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",className:t,children:[v.jsx("rect",{x:"2",y:"2.5",width:"12",height:"11",rx:"1.5"}),v.jsx("path",{d:"M6 2.5v11"})]}),hw=({connected:e})=>v.jsx("span",{className:`size-8 shrink-0 rounded-full ${e?"bg-(--color-light-green-500)":"bg-(--color-light-yellow-500)"}`,title:e?"Connected":"Not connected"}),y5=({currentScreen:e,onScreenChange:t,aiOpen:r,onToggleAi:n,aiAvailable:o,sessions:a,liveScreen:l,isLoggerConnected:u,isInspectorConnected:d,mockServerWebsiteUrl:p,colorScheme:h,onColorSchemeChange:m})=>{const y=h==="dark"?"light":"dark";return v.jsxs("div",{className:"flex shrink-0 items-center gap-16 border-b border-muted-subtle px-12 py-8",children:[v.jsxs(Z2,{selectedValue:e,onSelectedChange:w=>t(w),tabLayout:"fixed",className:"w-256 shrink-0 bg-muted-transparent","aria-label":"Screen",children:[v.jsx(pw,{value:"logs",trailingContent:v.jsx(hw,{connected:u}),children:"Logger"}),v.jsx(pw,{value:"inspector",trailingContent:v.jsx(hw,{connected:d}),children:"Inspector"})]}),v.jsxs("div",{className:"ml-auto flex items-center gap-6",children:[a&&v.jsx(vt,{label:a.shown?"Hide the sessions menu":"Show the sessions menu",side:"bottom",children:v.jsx(sr,{"aria-label":a.shown?"Hide the sessions menu":"Show the sessions menu","aria-pressed":a.shown,icon:v5,size:"xs",appearance:"transparent",className:`rounded-sm ${a.shown?"bg-active-subtle [&>svg]:text-active":""}`,onClick:a.onToggle})}),l&&v.jsx(vt,{label:l.shown?"Hide the live screen":"Show the live screen",side:"bottom",children:v.jsx(sr,{"aria-label":l.shown?"Hide the live screen":"Show the live screen","aria-pressed":l.shown,icon:p5,size:"xs",appearance:"transparent",className:`rounded-sm ${l.shown?"bg-active-subtle [&>svg]:text-active":""}`,onClick:l.onToggle})}),v.jsx(vt,{label:o?r?"Hide the AI panel":"Show the AI panel":bR,side:"bottom",children:v.jsx(sr,{"aria-label":r?"Hide the AI panel":"Show the AI panel","aria-pressed":r,icon:hv,size:"xs",appearance:"transparent",className:`rounded-sm disabled:pointer-events-none ${r?"bg-active-subtle [&>svg]:text-active":""}`,onClick:n,disabled:!o})}),p&&v.jsx(vt,{label:"Open the mock server website",side:"bottom",children:v.jsx(sr,{"aria-label":"Open the mock server website",icon:tj,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:()=>window.open(p,"_blank","noopener")})}),v.jsx(vt,{label:`Switch to ${y} theme`,side:"bottom",children:v.jsx(sr,{"aria-label":`Switch to ${y} theme`,icon:h==="dark"?m5:f5,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:()=>m(y)})})]})]})},Es={CONNECTED_DEVICES_UPDATE:"connectedDevicesUpdate",DEVICE_SESSION_STATE_UPDATE:"deviceSessionStateUpdate",PROVIDER_VALUE:"providerValue",APDU_RESPONSE:"apduResponse",DISCOVERED_DEVICES_UPDATE:"discoveredDevicesUpdate",MOCK_SERVER_CONFIG:"mockServerConfig"},zi={SEND_APDU:"sendApdu",GET_PROVIDER:"getProvider",SET_PROVIDER:"setProvider",START_LISTENING_DEVICES:"startListeningDevices",STOP_LISTENING_DEVICES:"stopListeningDevices",START_DISCOVERING:"startDiscovering",STOP_DISCOVERING:"stopDiscovering",CONNECT_DEVICE:"connectDevice"},mw={LOGGER:"logger",DMK_INSPECTOR:"dmk-inspector"},b5="moduleConnected";var gw;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof self=="object"||typeof self=="object"?self:typeof this=="object"?this:u(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(d,p){return function(h,m){Object.defineProperty(d,h,{configurable:!0,writable:!0,value:m}),p&&p(h,m)}}function a(){try{return Function("return this;")()}catch{}}function l(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return a()||l()}})(function(t,r){var n=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",a=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",l=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",d={__proto__:[]}instanceof Array,p=!u&&!d,h={create:u?function(){return rt(Object.create(null))}:d?function(){return rt({__proto__:null})}:function(){return rt({})},has:p?function(q,Q){return n.call(q,Q)}:function(q,Q){return Q in q},get:p?function(q,Q){return n.call(q,Q)?q[Q]:void 0}:function(q,Q){return q[Q]}},m=Object.getPrototypeOf(Function),y=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:jt(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Vt(),E=typeof WeakMap=="function"?WeakMap:bt(),S=o?Symbol.for("@reflect-metadata:registry"):void 0,C=Je(),R=ht(C);function k(q,Q,ie,se){if(M(ie)){if(!qe(q))throw new TypeError;if(!we(Q))throw new TypeError;return ne(q,Q)}else{if(!qe(q))throw new TypeError;if(!G(Q))throw new TypeError;if(!G(se)&&!M(se)&&!te(se))throw new TypeError;return te(se)&&(se=void 0),ie=ge(ie),X(q,Q,ie,se)}}t("decorate",k);function $(q,Q){function ie(se,Ce){if(!G(se))throw new TypeError;if(!M(Ce)&&!ze(Ce))throw new TypeError;L(q,Q,se,Ce)}return ie}t("metadata",$);function A(q,Q,ie,se){if(!G(ie))throw new TypeError;return M(se)||(se=ge(se)),L(q,Q,ie,se)}t("defineMetadata",A);function D(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),F(q,Q,ie)}t("hasMetadata",D);function N(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),V(q,Q,ie)}t("hasOwnMetadata",N);function P(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),H(q,Q,ie)}t("getMetadata",P);function I(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),O(q,Q,ie)}t("getOwnMetadata",I);function re(q,Q){if(!G(q))throw new TypeError;return M(Q)||(Q=ge(Q)),U(q,Q)}t("getMetadataKeys",re);function Z(q,Q){if(!G(q))throw new TypeError;return M(Q)||(Q=ge(Q)),z(q,Q)}t("getOwnMetadataKeys",Z);function ee(q,Q,ie){if(!G(Q))throw new TypeError;if(M(ie)||(ie=ge(ie)),!G(Q))throw new TypeError;M(ie)||(ie=ge(ie));var se=Ut(Q,ie,!1);return M(se)?!1:se.OrdinaryDeleteMetadata(q,Q,ie)}t("deleteMetadata",ee);function ne(q,Q){for(var ie=q.length-1;ie>=0;--ie){var se=q[ie],Ce=se(Q);if(!M(Ce)&&!te(Ce)){if(!we(Ce))throw new TypeError;Q=Ce}}return Q}function X(q,Q,ie,se){for(var Ce=q.length-1;Ce>=0;--Ce){var Ve=q[Ce],Ke=Ve(Q,ie,se);if(!M(Ke)&&!te(Ke)){if(!G(Ke))throw new TypeError;se=Ke}}return se}function F(q,Q,ie){var se=V(q,Q,ie);if(se)return!0;var Ce=oe(Q);return te(Ce)?!1:F(q,Ce,ie)}function V(q,Q,ie){var se=Ut(Q,ie,!1);return M(se)?!1:pe(se.OrdinaryHasOwnMetadata(q,Q,ie))}function H(q,Q,ie){var se=V(q,Q,ie);if(se)return O(q,Q,ie);var Ce=oe(Q);if(!te(Ce))return H(q,Ce,ie)}function O(q,Q,ie){var se=Ut(Q,ie,!1);if(!M(se))return se.OrdinaryGetOwnMetadata(q,Q,ie)}function L(q,Q,ie,se){var Ce=Ut(ie,se,!0);Ce.OrdinaryDefineOwnMetadata(q,Q,ie,se)}function U(q,Q){var ie=z(q,Q),se=oe(q);if(se===null)return ie;var Ce=U(se,Q);if(Ce.length<=0)return ie;if(ie.length<=0)return Ce;for(var Ve=new w,Ke=[],Pe=0,he=ie;Pe<he.length;Pe++){var ve=he[Pe],ye=Ve.has(ve);ye||(Ve.add(ve),Ke.push(ve))}for(var xe=0,Ue=Ce;xe<Ue.length;xe++){var ve=Ue[xe],ye=Ve.has(ve);ye||(Ve.add(ve),Ke.push(ve))}return Ke}function z(q,Q){var ie=Ut(q,Q,!1);return ie?ie.OrdinaryOwnMetadataKeys(q,Q):[]}function T(q){if(q===null)return 1;switch(typeof q){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return q===null?1:6;default:return 6}}function M(q){return q===void 0}function te(q){return q===null}function le(q){return typeof q=="symbol"}function G(q){return typeof q=="object"?q!==null:typeof q=="function"}function fe(q,Q){switch(T(q)){case 0:return q;case 1:return q;case 2:return q;case 3:return q;case 4:return q;case 5:return q}var ie="string",se=tt(q,a);if(se!==void 0){var Ce=se.call(q,ie);if(G(Ce))throw new TypeError;return Ce}return be(q)}function be(q,Q){var ie,se,Ce;{var Ve=q.toString;if(Xe(Ve)){var se=Ve.call(q);if(!G(se))return se}var ie=q.valueOf;if(Xe(ie)){var se=ie.call(q);if(!G(se))return se}}throw new TypeError}function pe(q){return!!q}function ue(q){return""+q}function ge(q){var Q=fe(q);return le(Q)?Q:ue(Q)}function qe(q){return Array.isArray?Array.isArray(q):q instanceof Object?q instanceof Array:Object.prototype.toString.call(q)==="[object Array]"}function Xe(q){return typeof q=="function"}function we(q){return typeof q=="function"}function ze(q){switch(T(q)){case 3:return!0;case 4:return!0;default:return!1}}function We(q,Q){return q===Q||q!==q&&Q!==Q}function tt(q,Q){var ie=q[Q];if(ie!=null){if(!Xe(ie))throw new TypeError;return ie}}function De(q){var Q=tt(q,l);if(!Xe(Q))throw new TypeError;var ie=Q.call(q);if(!G(ie))throw new TypeError;return ie}function Fe(q){return q.value}function lt(q){var Q=q.next();return Q.done?!1:Q}function Ne(q){var Q=q.return;Q&&Q.call(q)}function oe(q){var Q=Object.getPrototypeOf(q);if(typeof q!="function"||q===m||Q!==m)return Q;var ie=q.prototype,se=ie&&Object.getPrototypeOf(ie);if(se==null||se===Object.prototype)return Q;var Ce=se.constructor;return typeof Ce!="function"||Ce===q?Q:Ce}function Se(){var q;!M(S)&&typeof r.Reflect<"u"&&!(S in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(q=Bt(r.Reflect));var Q,ie,se,Ce=new E,Ve={registerProvider:Ke,getProvider:he,setProvider:ye};return Ve;function Ke(xe){if(!Object.isExtensible(Ve))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case q===xe:break;case M(Q):Q=xe;break;case Q===xe:break;case M(ie):ie=xe;break;case ie===xe:break;default:se===void 0&&(se=new w),se.add(xe);break}}function Pe(xe,Ue){if(!M(Q)){if(Q.isProviderFor(xe,Ue))return Q;if(!M(ie)){if(ie.isProviderFor(xe,Ue))return Q;if(!M(se))for(var Ze=De(se);;){var dt=lt(Ze);if(!dt)return;var Wt=Fe(dt);if(Wt.isProviderFor(xe,Ue))return Ne(Ze),Wt}}}if(!M(q)&&q.isProviderFor(xe,Ue))return q}function he(xe,Ue){var Ze=Ce.get(xe),dt;return M(Ze)||(dt=Ze.get(Ue)),M(dt)&&(dt=Pe(xe,Ue),M(dt)||(M(Ze)&&(Ze=new y,Ce.set(xe,Ze)),Ze.set(Ue,dt))),dt}function ve(xe){if(M(xe))throw new TypeError;return Q===xe||ie===xe||!M(se)&&se.has(xe)}function ye(xe,Ue,Ze){if(!ve(Ze))throw new Error("Metadata provider not registered.");var dt=he(xe,Ue);if(dt!==Ze){if(!M(dt))return!1;var Wt=Ce.get(xe);M(Wt)&&(Wt=new y,Ce.set(xe,Wt)),Wt.set(Ue,Ze)}return!0}}function Je(){var q;return!M(S)&&G(r.Reflect)&&Object.isExtensible(r.Reflect)&&(q=r.Reflect[S]),M(q)&&(q=Se()),!M(S)&&G(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,S,{enumerable:!1,configurable:!1,writable:!1,value:q}),q}function ht(q){var Q=new E,ie={isProviderFor:function(ve,ye){var xe=Q.get(ve);return M(xe)?!1:xe.has(ye)},OrdinaryDefineOwnMetadata:Ke,OrdinaryHasOwnMetadata:Ce,OrdinaryGetOwnMetadata:Ve,OrdinaryOwnMetadataKeys:Pe,OrdinaryDeleteMetadata:he};return C.registerProvider(ie),ie;function se(ve,ye,xe){var Ue=Q.get(ve),Ze=!1;if(M(Ue)){if(!xe)return;Ue=new y,Q.set(ve,Ue),Ze=!0}var dt=Ue.get(ye);if(M(dt)){if(!xe)return;if(dt=new y,Ue.set(ye,dt),!q.setProvider(ve,ye,ie))throw Ue.delete(ye),Ze&&Q.delete(ve),new Error("Wrong provider for target.")}return dt}function Ce(ve,ye,xe){var Ue=se(ye,xe,!1);return M(Ue)?!1:pe(Ue.has(ve))}function Ve(ve,ye,xe){var Ue=se(ye,xe,!1);if(!M(Ue))return Ue.get(ve)}function Ke(ve,ye,xe,Ue){var Ze=se(xe,Ue,!0);Ze.set(ve,ye)}function Pe(ve,ye){var xe=[],Ue=se(ve,ye,!1);if(M(Ue))return xe;for(var Ze=Ue.keys(),dt=De(Ze),Wt=0;;){var Zr=lt(dt);if(!Zr)return xe.length=Wt,xe;var en=Fe(Zr);try{xe[Wt]=en}catch(pi){try{Ne(dt)}finally{throw pi}}Wt++}}function he(ve,ye,xe){var Ue=se(ye,xe,!1);if(M(Ue)||!Ue.delete(ve))return!1;if(Ue.size===0){var Ze=Q.get(ye);M(Ze)||(Ze.delete(xe),Ze.size===0&&Q.delete(Ze))}return!0}}function Bt(q){var Q=q.defineMetadata,ie=q.hasOwnMetadata,se=q.getOwnMetadata,Ce=q.getOwnMetadataKeys,Ve=q.deleteMetadata,Ke=new E,Pe={isProviderFor:function(he,ve){var ye=Ke.get(he);return!M(ye)&&ye.has(ve)?!0:Ce(he,ve).length?(M(ye)&&(ye=new w,Ke.set(he,ye)),ye.add(ve),!0):!1},OrdinaryDefineOwnMetadata:Q,OrdinaryHasOwnMetadata:ie,OrdinaryGetOwnMetadata:se,OrdinaryOwnMetadataKeys:Ce,OrdinaryDeleteMetadata:Ve};return Pe}function Ut(q,Q,ie){var se=C.getProvider(q,Q);if(!M(se))return se;if(ie){if(C.setProvider(q,Q,R))return R;throw new Error("Illegal state.")}}function jt(){var q={},Q=[],ie=(function(){function Pe(he,ve,ye){this._index=0,this._keys=he,this._values=ve,this._selector=ye}return Pe.prototype["@@iterator"]=function(){return this},Pe.prototype[l]=function(){return this},Pe.prototype.next=function(){var he=this._index;if(he>=0&&he<this._keys.length){var ve=this._selector(this._keys[he],this._values[he]);return he+1>=this._keys.length?(this._index=-1,this._keys=Q,this._values=Q):this._index++,{value:ve,done:!1}}return{value:void 0,done:!0}},Pe.prototype.throw=function(he){throw this._index>=0&&(this._index=-1,this._keys=Q,this._values=Q),he},Pe.prototype.return=function(he){return this._index>=0&&(this._index=-1,this._keys=Q,this._values=Q),{value:he,done:!0}},Pe})(),se=(function(){function Pe(){this._keys=[],this._values=[],this._cacheKey=q,this._cacheIndex=-2}return Object.defineProperty(Pe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Pe.prototype.has=function(he){return this._find(he,!1)>=0},Pe.prototype.get=function(he){var ve=this._find(he,!1);return ve>=0?this._values[ve]:void 0},Pe.prototype.set=function(he,ve){var ye=this._find(he,!0);return this._values[ye]=ve,this},Pe.prototype.delete=function(he){var ve=this._find(he,!1);if(ve>=0){for(var ye=this._keys.length,xe=ve+1;xe<ye;xe++)this._keys[xe-1]=this._keys[xe],this._values[xe-1]=this._values[xe];return this._keys.length--,this._values.length--,We(he,this._cacheKey)&&(this._cacheKey=q,this._cacheIndex=-2),!0}return!1},Pe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=q,this._cacheIndex=-2},Pe.prototype.keys=function(){return new ie(this._keys,this._values,Ce)},Pe.prototype.values=function(){return new ie(this._keys,this._values,Ve)},Pe.prototype.entries=function(){return new ie(this._keys,this._values,Ke)},Pe.prototype["@@iterator"]=function(){return this.entries()},Pe.prototype[l]=function(){return this.entries()},Pe.prototype._find=function(he,ve){if(!We(this._cacheKey,he)){this._cacheIndex=-1;for(var ye=0;ye<this._keys.length;ye++)if(We(this._keys[ye],he)){this._cacheIndex=ye;break}}return this._cacheIndex<0&&ve&&(this._cacheIndex=this._keys.length,this._keys.push(he),this._values.push(void 0)),this._cacheIndex},Pe})();return se;function Ce(Pe,he){return Pe}function Ve(Pe,he){return he}function Ke(Pe,he){return[Pe,he]}}function Vt(){var q=(function(){function Q(){this._map=new y}return Object.defineProperty(Q.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Q.prototype.has=function(ie){return this._map.has(ie)},Q.prototype.add=function(ie){return this._map.set(ie,ie),this},Q.prototype.delete=function(ie){return this._map.delete(ie)},Q.prototype.clear=function(){this._map.clear()},Q.prototype.keys=function(){return this._map.keys()},Q.prototype.values=function(){return this._map.keys()},Q.prototype.entries=function(){return this._map.entries()},Q.prototype["@@iterator"]=function(){return this.keys()},Q.prototype[l]=function(){return this.keys()},Q})();return q}function bt(){var q=16,Q=h.create(),ie=se();return(function(){function he(){this._key=se()}return he.prototype.has=function(ve){var ye=Ce(ve,!1);return ye!==void 0?h.has(ye,this._key):!1},he.prototype.get=function(ve){var ye=Ce(ve,!1);return ye!==void 0?h.get(ye,this._key):void 0},he.prototype.set=function(ve,ye){var xe=Ce(ve,!0);return xe[this._key]=ye,this},he.prototype.delete=function(ve){var ye=Ce(ve,!1);return ye!==void 0?delete ye[this._key]:!1},he.prototype.clear=function(){this._key=se()},he})();function se(){var he;do he="@@WeakMap@@"+Pe();while(h.has(Q,he));return Q[he]=!0,he}function Ce(he,ve){if(!n.call(he,ie)){if(!ve)return;Object.defineProperty(he,ie,{value:h.create()})}return he[ie]}function Ve(he,ve){for(var ye=0;ye<ve;++ye)he[ye]=Math.random()*255|0;return he}function Ke(he){if(typeof Uint8Array=="function"){var ve=new Uint8Array(he);return typeof crypto<"u"?crypto.getRandomValues(ve):typeof msCrypto<"u"?msCrypto.getRandomValues(ve):Ve(ve,he),ve}return Ve(new Array(he),he)}function Pe(){var he=Ke(q);he[6]=he[6]&79|64,he[8]=he[8]&191|128;for(var ve="",ye=0;ye<q;++ye){var xe=he[ye];(ye===4||ye===6||ye===8)&&(ve+="-"),xe<16&&(ve+="0"),ve+=xe.toString(16).toLowerCase()}return ve}}function rt(q){return q.__=void 0,delete q.__,q}})})(gw||(gw={}));let x5=class{cla;ins;p1;p2;data;constructor(t,r,n,o,a){this.cla=t,this.ins=r,this.p1=n,this.p2=o,this.data=a??new Uint8Array}getRawApdu(){const t=Uint8Array.from([this.cla,this.ins,this.p1,this.p2,this.data.length]),r=new Uint8Array(t.length+this.data.length);return r.set(t,0),this.data.length>0&&r.set(this.data,t.length),r}};function vw(e){if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)return new Uint8Array;if(e.length%2!==0&&(e="0"+e),/^[0-9a-fA-F]*$/.test(e)===!1)return null;const t=e.match(/.{1,2}/g)?.map(r=>parseInt(r,16));return!t||t.some(isNaN)?null:new Uint8Array(t)}function si(e,t=!0){return`${t?"0x":""}${Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}`}let hh=class{_tag="ValueOverflow";originalError;message;constructor(t,r=wR){this.message=`Value overflow for ${t}, max is ${r}`}},$u=class{_tag="DataOverflow";message;originalError;constructor(t,r=0){this.message=r===0?`this.data is already full (value: ${t})`:`this.data will overflow with "${t}", remaining bytes: ${r}`}},yw=class{_tag="HexaString";message;originalError;constructor(t){this.message=`Invalid encoded hexa string or length is null: ${t}`}};const w5=4294967295;let S5=class{constructor(t=w5){this.maxPayloadSize=t}data=new Uint8Array;errors=[];build=()=>this.data;tryBuild=()=>this.hasErrors()?void 0:this.data;add8BitUIntToData=t=>this.addNumberToData(t,8n,!1,!1);add16BitUIntToData=(t,r=!0)=>this.addNumberToData(t,16n,!1,r);add32BitUIntToData=(t,r=!0)=>this.addNumberToData(t,32n,!1,r);add64BitUIntToData=(t,r=!0)=>this.addNumberToData(t,64n,!1,r);add128BitUIntToData=(t,r=!0)=>this.addNumberToData(t,128n,!1,r);add256BitUIntToData=(t,r=!0)=>this.addNumberToData(t,256n,!1,r);add16BitIntToData=(t,r=!0)=>this.addNumberToData(t,16n,!0,r);add32BitIntToData=(t,r=!0)=>this.addNumberToData(t,32n,!0,r);add64BitIntToData=(t,r=!0)=>this.addNumberToData(t,64n,!0,r);add128BitIntToData=(t,r=!0)=>this.addNumberToData(t,128n,!0,r);add256BitIntToData=(t,r=!0)=>this.addNumberToData(t,256n,!0,r);addBufferToData=t=>this.hasEnoughLengthRemaining(t)?(this.data=Uint8Array.from([...this.data,...t]),this):(this.errors.push(new $u(t.toString())),this);addHexaStringToData=t=>{const r=vw(t);return r===null||r.length===0?(this.errors.push(new yw(t)),this):(this.addBufferToData(r),this)};addAsciiStringToData=t=>{const r=new TextEncoder().encode(t);return this.addBufferToData(r),this};encodeInLVFromHexa=t=>{const r=vw(t);return r===null||r.length===0?(this.errors.push(new yw(t)),this):this.hasEnoughLengthRemaining(r,!0)?(this.add8BitUIntToData(r.length),this.addBufferToData(r),this):(this.errors.push(new $u(t)),this)};encodeInLVFromBuffer=t=>this.hasEnoughLengthRemaining(t,!0)?(this.add8BitUIntToData(t.length),this.addBufferToData(t),this):(this.errors.push(new $u(t.toString())),this);encodeInLVFromAscii=t=>this.hasEnoughLengthRemaining(t,!0)?(this.add8BitUIntToData(t.length),this.addAsciiStringToData(t),this):(this.errors.push(new $u(t)),this);encodeInTLVFromAscii=(t,r)=>(this.add8BitUIntToData(t),this.encodeInLVFromAscii(r));encodeInTLVFromHexa=(t,r)=>(this.add8BitUIntToData(t),this.encodeInLVFromHexa(r));encodeInTLVFromBuffer=(t,r)=>(this.add8BitUIntToData(t),this.encodeInLVFromBuffer(r));encodeInTLVFromUInt8=(t,r)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(1),this.add8BitUIntToData(r));encodeInTLVFromUInt16=(t,r,n=!0)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(2),this.add16BitUIntToData(r,n));encodeInTLVFromUInt32=(t,r,n=!0)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(4),this.add32BitUIntToData(r,n));encodeInTLVFromUInt64=(t,r,n=!0)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(8),this.add64BitUIntToData(r,n));getAvailablePayloadLength=()=>this.maxPayloadSize-this.data.length;getErrors=()=>this.errors;hasErrors=()=>this.errors.length!==0;hasEnoughLengthRemaining=(t,r=!1)=>this.data.length+t.length+(r?1:0)<=this.maxPayloadSize;addNumberToData(t,r,n,o){let a=this.checkBoundsAndConvert(t,r,n);if(a===void 0)return this;const l=Number(r)/8,u=new Uint8Array(l);if(o)for(let d=l-1;d>=0;d--)u[d]=Number(a&0xffn),a>>=8n;else for(let d=0;d<l;d++)u[d]=Number(a&0xffn),a>>=8n;return this.addBufferToData(u)}checkBoundsAndConvert(t,r,n){if(typeof t=="number"){if(!Number.isInteger(t)||t>Number.MAX_SAFE_INTEGER){this.errors.push(new hh(t.toString()));return}t=BigInt(t)}if(n){const o=1n<<r-1n;if(t>=o||t<-o){this.errors.push(new hh(t.toString(),o-1n));return}if(t<0n){const a=(1n<<r)-1n;t=-t,t=(~t&a)+1n}}else{const o=1n<<r;if(t<0||t>=o){this.errors.push(new hh(t.toString(),o-1n));return}}return t}};const wR=255;let SR=class{_ins;_cla;_p1;p2;data=new S5(wR);constructor({ins:t,cla:r,p1:n,p2:o}){this._cla=r&255,this._ins=t&255,this._p1=n&255,this.p2=o&255}build=()=>new x5(this._cla,this._ins,this._p1,this.p2,this.data.build());add8BitUIntToData=t=>(this.data.add8BitUIntToData(t),this);add16BitUIntToData=t=>(this.data.add16BitUIntToData(t),this);add32BitUIntToData=t=>(this.data.add32BitUIntToData(t),this);add64BitUIntToData=(t,r=!0)=>(this.data.add64BitUIntToData(t,r),this);addBufferToData=t=>(this.data.addBufferToData(t),this);addHexaStringToData=t=>(this.data.addHexaStringToData(t),this);addAsciiStringToData=t=>(this.data.addAsciiStringToData(t),this);encodeInLVFromHexa=t=>(this.data.encodeInLVFromHexa(t),this);encodeInLVFromBuffer=t=>(this.data.encodeInLVFromBuffer(t),this);encodeInLVFromAscii=t=>(this.data.encodeInLVFromAscii(t),this);getAvailablePayloadLength=()=>this.data.getAvailablePayloadLength();getErrors=()=>this.data.getErrors()},E5=class{constructor(t){this.buffer=t}index=0;testMinimalLength(t){return t<=this.buffer.length-this.index}extract8BitUInt(){if(!this.outOfRange(1))return this.buffer[this.index++]}extract16BitUInt(t=!0){const r=this.extractNumber(16n,!1,t);return r===void 0?void 0:Number(r)}extract16BitInt(t=!0){const r=this.extractNumber(16n,!0,t);return r===void 0?void 0:Number(r)}extract32BitUInt(t=!0){const r=this.extractNumber(32n,!1,t);return r===void 0?void 0:Number(r)}extract32BitInt(t=!0){const r=this.extractNumber(32n,!0,t);return r===void 0?void 0:Number(r)}extract64BitUInt(t=!0){return this.extractNumber(64n,!1,t)}extract64BitInt(t=!0){return this.extractNumber(64n,!0,t)}extract128BitUInt(t=!0){return this.extractNumber(128n,!1,t)}extract128BitInt(t=!0){return this.extractNumber(128n,!0,t)}extract256BitUInt(t=!0){return this.extractNumber(256n,!1,t)}extract256BitInt(t=!0){return this.extractNumber(256n,!0,t)}extractFieldByLength(t){if(this.outOfRange(t))return;if(t===0)return new Uint8Array;const r=this.buffer.slice(this.index,this.index+t);return this.index+=t,r}extractFieldLVEncoded(){const t=this.extract8BitUInt();if(t===void 0)return;if(t===0)return new Uint8Array;const r=this.extractFieldByLength(t);return r===void 0&&this.index--,r}extractFieldTLVEncoded(){if(this.outOfRange(2))return;const t=this.index,r=this.extract8BitUInt(),n=this.extractFieldLVEncoded();if(r===void 0||n===void 0){this.index--;return}const o=this.index;return{tag:r,value:n,tlv:this.buffer.slice(t,o)}}encodeToHexaString(t,r=!1){if(t===void 0||t.length===0)return"";const n=si(t);return r?n:n.slice(2)}encodeToString(t){let r="",n=0;if(!t)return r;for(;n<=t.length;){const o=t[n];o&&(r+=String.fromCharCode(o)),n++}return r}getCurrentIndex(){return this.index}resetIndex(){this.index=0}getUnparsedRemainingLength(){return this.buffer.length-this.index}outOfRange(t){return this.index+t>this.buffer.length}extractNumber(t,r,n){const o=Number(t)/8;if(this.outOfRange(o))return;let a=0n;if(n)for(let l=0;l<o;l++)a=a<<8n|BigInt(this.buffer[l+this.index]);else for(let l=o-1;l>=0;l--)a=a<<8n|BigInt(this.buffer[l+this.index]);if(r){const l=1n<<t-1n;a&l&&(a-=l<<1n)}return this.index+=o,a}},mv=class{parser;constructor(t){this.parser=new E5(t.data)}testMinimalLength=t=>this.parser.testMinimalLength(t);extract8BitUInt=()=>this.parser.extract8BitUInt();extract16BitUInt=()=>this.parser.extract16BitUInt();extract32BitUInt=()=>this.parser.extract32BitUInt();extractFieldByLength=t=>this.parser.extractFieldByLength(t);extractFieldLVEncoded=()=>this.parser.extractFieldLVEncoded();extractFieldTLVEncoded=()=>this.parser.extractFieldTLVEncoded();encodeToHexaString(t,r=!1){return r?this.parser.encodeToHexaString(t,!0):this.parser.encodeToHexaString(t,!1)}encodeToString=t=>this.parser.encodeToString(t);getUnparsedRemainingLength=()=>this.parser.getUnparsedRemainingLength()},C5=class{_tag="InvalidStatusWordError";originalError;constructor(t){this.originalError=new Error(t??"Invalid status word.")}},k5=class{_tag="InvalidResponseFormatError";originalError;constructor(t){this.originalError=new Error(t??"Invalid response format.")}};var R5=(e=>(e.Error="ERROR",e.Success="SUCCESS",e))(R5||{});function _5(e){return"error"in e&&e.error!==void 0}function bw(e){return _5(e)?{status:"ERROR",error:e.error}:{status:"SUCCESS",data:e.data}}function $5(e){return e.status==="SUCCESS"}function Io({data:e,error:t}){return bw(t!==void 0?{error:t}:{data:e})}function A5(e){return $5(e)}let gv=class $s{static isValidStatusCode(t){return t.length===2}static isSuccessResponse({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===144&&t[1]===0:!1}static isLockedDeviceResponse({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===85&&t[1]===21||t[0]===105&&t[1]===130||t[0]===83&&t[1]===3:!1}static isRefusedByUser({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===85&&t[1]===1||t[0]===105&&t[1]===133:!1}static isAppAlreadyInstalled({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===106&&t[1]===128||t[0]===106&&t[1]===129||t[0]===106&&t[1]===142||t[0]===106&&t[1]===143:!1}static isOutOfMemory({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===106&&t[1]===132||t[0]===106&&t[1]===133||t[0]===81&&t[1]===2||t[0]===81&&t[1]===3||t[0]===103&&t[1]===51:!1}static isApduThatTriggersDisconnection(t){const r=new Map;return r.set("openApp",new Uint8Array([224,216,0,0])),r.set("closeApp",new Uint8Array([176,167,0,0])),Array.from(r.values()).some(n=>{for(let o=0;o<4;o++)if(n[o]!==t[o])return!1;return!0})}},T5=class{_tag;originalError;errorCode;message;constructor({tag:t,errorCode:r,originalError:n,message:o}){this._tag=t,this.originalError=n,this.errorCode=r,this.message=o??"An error occured during device exchange."}},L5=class{_tag="UnknownDeviceExchangeError";originalError;message;constructor(t){this.originalError=t,this.message="Unexpected device exchange error happened."}};const I5=(e,t)=>Object.keys(t).includes(e);let O5=class extends T5{constructor(t){super({tag:"GlobalCommandError",...t})}};const xw={5515:{message:"Device is locked.",tag:"DeviceLockedError"},5501:{message:"Action refused on device.",tag:"ActionRefusedError"},5502:{message:"Pin is not set",tag:"PinNotSetError"},5223:{message:"Device internal error",tag:"DeviceInternalError"},"6e00":{message:"CLA not supported",tag:"DeviceInternalError"},"6d00":{message:"INS not supported",tag:"DeviceInternalError"}};let ER=class{static handle(t){const r=new mv(t).encodeToHexaString(t.statusCode);return I5(r,xw)?new O5({...xw[r],errorCode:r}):new L5({message:"UnknownError",errorCode:r})}},ww=class{name="getAppAndVersion";args=void 0;getApdu(){const t={cla:176,ins:1,p1:0,p2:0};return new SR(t).build()}parseResponse(t){if(!gv.isSuccessResponse(t))return Io({error:ER.handle(t)});const r=new mv(t);if(r.extract8BitUInt()!==1)return Io({error:new k5("getAppAndVersion: format not supported")});const n=r.encodeToString(r.extractFieldLVEncoded()),o=r.encodeToString(r.extractFieldLVEncoded());if(r.getUnparsedRemainingLength()===0)return Io({data:{name:n,version:o}});const a=r.extractFieldLVEncoded();return Io({data:{name:n,version:o,flags:a}})}};var N5=(e=>(e[e.BATTERY_PERCENTAGE=0]="BATTERY_PERCENTAGE",e[e.BATTERY_VOLTAGE=1]="BATTERY_VOLTAGE",e[e.BATTERY_TEMPERATURE=2]="BATTERY_TEMPERATURE",e[e.BATTERY_CURRENT=3]="BATTERY_CURRENT",e[e.BATTERY_FLAGS=4]="BATTERY_FLAGS",e))(N5||{}),P5=(e=>(e[e.NONE=0]="NONE",e[e.USB=1]="USB",e[e.QI=2]="QI",e))(P5||{}),Au={exports:{}},mh,Sw;function Ud(){if(Sw)return mh;Sw=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return mh={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},mh}var gh,Ew;function Vd(){if(Ew)return gh;Ew=1;var e={};return gh=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},gh}var Cw;function Il(){return Cw||(Cw=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Ud(),a=Vd();t=e.exports={};const l=t.re=[],u=t.safeRe=[],d=t.src=[],p=t.safeSrc=[],h=t.t={};let m=0;const y="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",o],[y,n]],E=C=>{for(const[R,k]of w)C=C.split(`${R}*`).join(`${R}{0,${k}}`).split(`${R}+`).join(`${R}{1,${k}}`);return C},S=(C,R,k)=>{const $=E(R),A=m++;a(C,A,R),h[C]=A,d[A]=R,p[A]=$,l[A]=new RegExp(R,k?"g":void 0),u[A]=new RegExp($,k?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),S("MAINVERSION",`(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${d[h.NONNUMERICIDENTIFIER]}|${d[h.NUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${d[h.NONNUMERICIDENTIFIER]}|${d[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASE",`(?:-(${d[h.PRERELEASEIDENTIFIER]}(?:\\.${d[h.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${d[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[h.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${y}+`),S("BUILD",`(?:\\+(${d[h.BUILDIDENTIFIER]}(?:\\.${d[h.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${d[h.MAINVERSION]}${d[h.PRERELEASE]}?${d[h.BUILD]}?`),S("FULL",`^${d[h.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${d[h.MAINVERSIONLOOSE]}${d[h.PRERELEASELOOSE]}?${d[h.BUILD]}?`),S("LOOSE",`^${d[h.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${d[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${d[h.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:${d[h.PRERELEASE]})?${d[h.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:${d[h.PRERELEASELOOSE]})?${d[h.BUILD]}?)?)?`),S("XRANGE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),S("COERCE",`${d[h.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",d[h.COERCEPLAIN]+`(?:${d[h.PRERELEASE]})?(?:${d[h.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",d[h.COERCE],!0),S("COERCERTLFULL",d[h.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${d[h.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",S("TILDE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${d[h.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",S("CARET",`^${d[h.LONECARET]}${d[h.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${d[h.LONECARET]}${d[h.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${d[h.GTLT]}\\s*(${d[h.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]}|${d[h.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${d[h.XRANGEPLAIN]})\\s+-\\s+(${d[h.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${d[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[h.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Au,Au.exports)),Au.exports}var vh,kw;function vv(){if(kw)return vh;kw=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return vh=n=>n?typeof n!="object"?e:n:t,vh}var yh,Rw;function CR(){if(Rw)return yh;Rw=1;const e=/^[0-9]+$/,t=(n,o)=>{const a=e.test(n),l=e.test(o);return a&&l&&(n=+n,o=+o),n===o?0:a&&!l?-1:l&&!a?1:n<o?-1:1};return yh={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},yh}var bh,_w;function gr(){if(_w)return bh;_w=1;const e=Vd(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Ud(),{safeRe:n,t:o}=Il(),a=vv(),{compareIdentifiers:l}=CR();class u{constructor(p,h){if(h=a(h),p instanceof u){if(p.loose===!!h.loose&&p.includePrerelease===!!h.includePrerelease)return p;p=p.version}else if(typeof p!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof p}".`);if(p.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",p,h),this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease;const m=p.trim().match(h.loose?n[o.LOOSE]:n[o.FULL]);if(!m)throw new TypeError(`Invalid Version: ${p}`);if(this.raw=p,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const w=+y;if(w>=0&&w<r)return w}return y}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(p){if(e("SemVer.compare",this.version,this.options,p),!(p instanceof u)){if(typeof p=="string"&&p===this.version)return 0;p=new u(p,this.options)}return p.version===this.version?0:this.compareMain(p)||this.comparePre(p)}compareMain(p){return p instanceof u||(p=new u(p,this.options)),l(this.major,p.major)||l(this.minor,p.minor)||l(this.patch,p.patch)}comparePre(p){if(p instanceof u||(p=new u(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;let h=0;do{const m=this.prerelease[h],y=p.prerelease[h];if(e("prerelease compare",h,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return l(m,y)}while(++h)}compareBuild(p){p instanceof u||(p=new u(p,this.options));let h=0;do{const m=this.build[h],y=p.build[h];if(e("build compare",h,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return l(m,y)}while(++h)}inc(p,h,m){if(p.startsWith("pre")){if(!h&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(h){const y=`-${h}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!y||y[1]!==h)throw new Error(`invalid identifier: ${h}`)}}switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",h,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",h,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",h,m),this.inc("pre",h,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",h,m),this.inc("pre",h,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(h===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(h){let w=[h,y];m===!1&&(w=[h]),l(this.prerelease[0],h)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${p}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return bh=u,bh}var xh,$w;function ia(){if($w)return xh;$w=1;const e=gr();return xh=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(a){if(!o)return null;throw a}},xh}var wh,Aw;function D5(){if(Aw)return wh;Aw=1;const e=ia();return wh=(r,n)=>{const o=e(r,n);return o?o.version:null},wh}var Sh,Tw;function j5(){if(Tw)return Sh;Tw=1;const e=ia();return Sh=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Sh}var Eh,Lw;function M5(){if(Lw)return Eh;Lw=1;const e=gr();return Eh=(r,n,o,a,l)=>{typeof o=="string"&&(l=a,a=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,a,l).version}catch{return null}},Eh}var Ch,Iw;function z5(){if(Iw)return Ch;Iw=1;const e=ia();return Ch=(r,n)=>{const o=e(r,null,!0),a=e(n,null,!0),l=o.compare(a);if(l===0)return null;const u=l>0,d=u?o:a,p=u?a:o,h=!!d.prerelease.length;if(!!p.prerelease.length&&!h){if(!p.patch&&!p.minor)return"major";if(p.compareMain(d)===0)return p.minor&&!p.patch?"minor":"patch"}const y=h?"pre":"";return o.major!==a.major?y+"major":o.minor!==a.minor?y+"minor":o.patch!==a.patch?y+"patch":"prerelease"},Ch}var kh,Ow;function F5(){if(Ow)return kh;Ow=1;const e=gr();return kh=(r,n)=>new e(r,n).major,kh}var Rh,Nw;function B5(){if(Nw)return Rh;Nw=1;const e=gr();return Rh=(r,n)=>new e(r,n).minor,Rh}var _h,Pw;function U5(){if(Pw)return _h;Pw=1;const e=gr();return _h=(r,n)=>new e(r,n).patch,_h}var $h,Dw;function V5(){if(Dw)return $h;Dw=1;const e=ia();return $h=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},$h}var Ah,jw;function bn(){if(jw)return Ah;jw=1;const e=gr();return Ah=(r,n,o)=>new e(r,o).compare(new e(n,o)),Ah}var Th,Mw;function W5(){if(Mw)return Th;Mw=1;const e=bn();return Th=(r,n,o)=>e(n,r,o),Th}var Lh,zw;function H5(){if(zw)return Lh;zw=1;const e=bn();return Lh=(r,n)=>e(r,n,!0),Lh}var Ih,Fw;function yv(){if(Fw)return Ih;Fw=1;const e=gr();return Ih=(r,n,o)=>{const a=new e(r,o),l=new e(n,o);return a.compare(l)||a.compareBuild(l)},Ih}var Oh,Bw;function q5(){if(Bw)return Oh;Bw=1;const e=yv();return Oh=(r,n)=>r.sort((o,a)=>e(o,a,n)),Oh}var Nh,Uw;function G5(){if(Uw)return Nh;Uw=1;const e=yv();return Nh=(r,n)=>r.sort((o,a)=>e(a,o,n)),Nh}var Ph,Vw;function Wd(){if(Vw)return Ph;Vw=1;const e=bn();return Ph=(r,n,o)=>e(r,n,o)>0,Ph}var Dh,Ww;function bv(){if(Ww)return Dh;Ww=1;const e=bn();return Dh=(r,n,o)=>e(r,n,o)<0,Dh}var jh,Hw;function kR(){if(Hw)return jh;Hw=1;const e=bn();return jh=(r,n,o)=>e(r,n,o)===0,jh}var Mh,qw;function RR(){if(qw)return Mh;qw=1;const e=bn();return Mh=(r,n,o)=>e(r,n,o)!==0,Mh}var zh,Gw;function xv(){if(Gw)return zh;Gw=1;const e=bn();return zh=(r,n,o)=>e(r,n,o)>=0,zh}var Fh,Xw;function wv(){if(Xw)return Fh;Xw=1;const e=bn();return Fh=(r,n,o)=>e(r,n,o)<=0,Fh}var Bh,Yw;function _R(){if(Yw)return Bh;Yw=1;const e=kR(),t=RR(),r=Wd(),n=xv(),o=bv(),a=wv();return Bh=(u,d,p,h)=>{switch(d){case"===":return typeof u=="object"&&(u=u.version),typeof p=="object"&&(p=p.version),u===p;case"!==":return typeof u=="object"&&(u=u.version),typeof p=="object"&&(p=p.version),u!==p;case"":case"=":case"==":return e(u,p,h);case"!=":return t(u,p,h);case">":return r(u,p,h);case">=":return n(u,p,h);case"<":return o(u,p,h);case"<=":return a(u,p,h);default:throw new TypeError(`Invalid operator: ${d}`)}},Bh}var Uh,Kw;function X5(){if(Kw)return Uh;Kw=1;const e=gr(),t=ia(),{safeRe:r,t:n}=Il();return Uh=(a,l)=>{if(a instanceof e)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;l=l||{};let u=null;if(!l.rtl)u=a.match(l.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const w=l.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let E;for(;(E=w.exec(a))&&(!u||u.index+u[0].length!==a.length);)(!u||E.index+E[0].length!==u.index+u[0].length)&&(u=E),w.lastIndex=E.index+E[1].length+E[2].length;w.lastIndex=-1}if(u===null)return null;const d=u[2],p=u[3]||"0",h=u[4]||"0",m=l.includePrerelease&&u[5]?`-${u[5]}`:"",y=l.includePrerelease&&u[6]?`+${u[6]}`:"";return t(`${d}.${p}.${h}${m}${y}`,l)},Uh}var Vh,Qw;function Y5(){if(Qw)return Vh;Qw=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(r,n)}return this}}return Vh=e,Vh}var Wh,Jw;function xn(){if(Jw)return Wh;Jw=1;const e=/\s+/g;class t{constructor(V,H){if(H=o(H),V instanceof t)return V.loose===!!H.loose&&V.includePrerelease===!!H.includePrerelease?V:new t(V.raw,H);if(V instanceof a)return this.raw=V.value,this.set=[[V]],this.formatted=void 0,this;if(this.options=H,this.loose=!!H.loose,this.includePrerelease=!!H.includePrerelease,this.raw=V.trim().replace(e," "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(L=>!S(L[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const L of this.set)if(L.length===1&&C(L[0])){this.set=[L];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let V=0;V<this.set.length;V++){V>0&&(this.formatted+="||");const H=this.set[V];for(let O=0;O<H.length;O++)O>0&&(this.formatted+=" "),this.formatted+=H[O].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(V){const O=((this.options.includePrerelease&&w)|(this.options.loose&&E))+":"+V,L=n.get(O);if(L)return L;const U=this.options.loose,z=U?d[p.HYPHENRANGELOOSE]:d[p.HYPHENRANGE];V=V.replace(z,ne(this.options.includePrerelease)),l("hyphen replace",V),V=V.replace(d[p.COMPARATORTRIM],h),l("comparator trim",V),V=V.replace(d[p.TILDETRIM],m),l("tilde trim",V),V=V.replace(d[p.CARETTRIM],y),l("caret trim",V);let T=V.split(" ").map(G=>k(G,this.options)).join(" ").split(/\s+/).map(G=>ee(G,this.options));U&&(T=T.filter(G=>(l("loose invalid filter",G,this.options),!!G.match(d[p.COMPARATORLOOSE])))),l("range list",T);const M=new Map,te=T.map(G=>new a(G,this.options));for(const G of te){if(S(G))return[G];M.set(G.value,G)}M.size>1&&M.has("")&&M.delete("");const le=[...M.values()];return n.set(O,le),le}intersects(V,H){if(!(V instanceof t))throw new TypeError("a Range is required");return this.set.some(O=>R(O,H)&&V.set.some(L=>R(L,H)&&O.every(U=>L.every(z=>U.intersects(z,H)))))}test(V){if(!V)return!1;if(typeof V=="string")try{V=new u(V,this.options)}catch{return!1}for(let H=0;H<this.set.length;H++)if(X(this.set[H],V,this.options))return!0;return!1}}Wh=t;const r=Y5(),n=new r,o=vv(),a=Hd(),l=Vd(),u=gr(),{safeRe:d,t:p,comparatorTrimReplace:h,tildeTrimReplace:m,caretTrimReplace:y}=Il(),{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:E}=Ud(),S=F=>F.value==="<0.0.0-0",C=F=>F.value==="",R=(F,V)=>{let H=!0;const O=F.slice();let L=O.pop();for(;H&&O.length;)H=O.every(U=>L.intersects(U,V)),L=O.pop();return H},k=(F,V)=>(l("comp",F,V),F=N(F,V),l("caret",F),F=A(F,V),l("tildes",F),F=I(F,V),l("xrange",F),F=Z(F,V),l("stars",F),F),$=F=>!F||F.toLowerCase()==="x"||F==="*",A=(F,V)=>F.trim().split(/\s+/).map(H=>D(H,V)).join(" "),D=(F,V)=>{const H=V.loose?d[p.TILDELOOSE]:d[p.TILDE];return F.replace(H,(O,L,U,z,T)=>{l("tilde",F,O,L,U,z,T);let M;return $(L)?M="":$(U)?M=`>=${L}.0.0 <${+L+1}.0.0-0`:$(z)?M=`>=${L}.${U}.0 <${L}.${+U+1}.0-0`:T?(l("replaceTilde pr",T),M=`>=${L}.${U}.${z}-${T} <${L}.${+U+1}.0-0`):M=`>=${L}.${U}.${z} <${L}.${+U+1}.0-0`,l("tilde return",M),M})},N=(F,V)=>F.trim().split(/\s+/).map(H=>P(H,V)).join(" "),P=(F,V)=>{l("caret",F,V);const H=V.loose?d[p.CARETLOOSE]:d[p.CARET],O=V.includePrerelease?"-0":"";return F.replace(H,(L,U,z,T,M)=>{l("caret",F,L,U,z,T,M);let te;return $(U)?te="":$(z)?te=`>=${U}.0.0${O} <${+U+1}.0.0-0`:$(T)?U==="0"?te=`>=${U}.${z}.0${O} <${U}.${+z+1}.0-0`:te=`>=${U}.${z}.0${O} <${+U+1}.0.0-0`:M?(l("replaceCaret pr",M),U==="0"?z==="0"?te=`>=${U}.${z}.${T}-${M} <${U}.${z}.${+T+1}-0`:te=`>=${U}.${z}.${T}-${M} <${U}.${+z+1}.0-0`:te=`>=${U}.${z}.${T}-${M} <${+U+1}.0.0-0`):(l("no pr"),U==="0"?z==="0"?te=`>=${U}.${z}.${T}${O} <${U}.${z}.${+T+1}-0`:te=`>=${U}.${z}.${T}${O} <${U}.${+z+1}.0-0`:te=`>=${U}.${z}.${T} <${+U+1}.0.0-0`),l("caret return",te),te})},I=(F,V)=>(l("replaceXRanges",F,V),F.split(/\s+/).map(H=>re(H,V)).join(" ")),re=(F,V)=>{F=F.trim();const H=V.loose?d[p.XRANGELOOSE]:d[p.XRANGE];return F.replace(H,(O,L,U,z,T,M)=>{l("xRange",F,O,L,U,z,T,M);const te=$(U),le=te||$(z),G=le||$(T),fe=G;return L==="="&&fe&&(L=""),M=V.includePrerelease?"-0":"",te?L===">"||L==="<"?O="<0.0.0-0":O="*":L&&fe?(le&&(z=0),T=0,L===">"?(L=">=",le?(U=+U+1,z=0,T=0):(z=+z+1,T=0)):L==="<="&&(L="<",le?U=+U+1:z=+z+1),L==="<"&&(M="-0"),O=`${L+U}.${z}.${T}${M}`):le?O=`>=${U}.0.0${M} <${+U+1}.0.0-0`:G&&(O=`>=${U}.${z}.0${M} <${U}.${+z+1}.0-0`),l("xRange return",O),O})},Z=(F,V)=>(l("replaceStars",F,V),F.trim().replace(d[p.STAR],"")),ee=(F,V)=>(l("replaceGTE0",F,V),F.trim().replace(d[V.includePrerelease?p.GTE0PRE:p.GTE0],"")),ne=F=>(V,H,O,L,U,z,T,M,te,le,G,fe)=>($(O)?H="":$(L)?H=`>=${O}.0.0${F?"-0":""}`:$(U)?H=`>=${O}.${L}.0${F?"-0":""}`:z?H=`>=${H}`:H=`>=${H}${F?"-0":""}`,$(te)?M="":$(le)?M=`<${+te+1}.0.0-0`:$(G)?M=`<${te}.${+le+1}.0-0`:fe?M=`<=${te}.${le}.${G}-${fe}`:F?M=`<${te}.${le}.${+G+1}-0`:M=`<=${M}`,`${H} ${M}`.trim()),X=(F,V,H)=>{for(let O=0;O<F.length;O++)if(!F[O].test(V))return!1;if(V.prerelease.length&&!H.includePrerelease){for(let O=0;O<F.length;O++)if(l(F[O].semver),F[O].semver!==a.ANY&&F[O].semver.prerelease.length>0){const L=F[O].semver;if(L.major===V.major&&L.minor===V.minor&&L.patch===V.patch)return!0}return!1}return!0};return Wh}var Hh,Zw;function Hd(){if(Zw)return Hh;Zw=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(h,m){if(m=r(m),h instanceof t){if(h.loose===!!m.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),l("comparator",h,m),this.options=m,this.loose=!!m.loose,this.parse(h),this.semver===e?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(h){const m=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],y=h.match(m);if(!y)throw new TypeError(`Invalid comparator: ${h}`);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new u(y[2],this.options.loose):this.semver=e}toString(){return this.value}test(h){if(l("Comparator.test",h,this.options.loose),this.semver===e||h===e)return!0;if(typeof h=="string")try{h=new u(h,this.options)}catch{return!1}return a(h,this.operator,this.semver,this.options)}intersects(h,m){if(!(h instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(h.value,m).test(this.value):h.operator===""?h.value===""?!0:new d(this.value,m).test(h.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||a(this.semver,"<",h.semver,m)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||a(this.semver,">",h.semver,m)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}Hh=t;const r=vv(),{safeRe:n,t:o}=Il(),a=_R(),l=Vd(),u=gr(),d=xn();return Hh}var qh,eS;function qd(){if(eS)return qh;eS=1;const e=xn();return qh=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},qh}var Gh,tS;function K5(){if(tS)return Gh;tS=1;const e=xn();return Gh=(r,n)=>new e(r,n).set.map(o=>o.map(a=>a.value).join(" ").trim().split(" ")),Gh}var Xh,rS;function Q5(){if(rS)return Xh;rS=1;const e=gr(),t=xn();return Xh=(n,o,a)=>{let l=null,u=null,d=null;try{d=new t(o,a)}catch{return null}return n.forEach(p=>{d.test(p)&&(!l||u.compare(p)===-1)&&(l=p,u=new e(l,a))}),l},Xh}var Yh,nS;function J5(){if(nS)return Yh;nS=1;const e=gr(),t=xn();return Yh=(n,o,a)=>{let l=null,u=null,d=null;try{d=new t(o,a)}catch{return null}return n.forEach(p=>{d.test(p)&&(!l||u.compare(p)===1)&&(l=p,u=new e(l,a))}),l},Yh}var Kh,iS;function Z5(){if(iS)return Kh;iS=1;const e=gr(),t=xn(),r=Wd();return Kh=(o,a)=>{o=new t(o,a);let l=new e("0.0.0");if(o.test(l)||(l=new e("0.0.0-0"),o.test(l)))return l;l=null;for(let u=0;u<o.set.length;++u){const d=o.set[u];let p=null;d.forEach(h=>{const m=new e(h.semver.version);switch(h.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!p||r(m,p))&&(p=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${h.operator}`)}}),p&&(!l||r(l,p))&&(l=p)}return l&&o.test(l)?l:null},Kh}var Qh,oS;function ez(){if(oS)return Qh;oS=1;const e=xn();return Qh=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Qh}var Jh,sS;function Sv(){if(sS)return Jh;sS=1;const e=gr(),t=Hd(),{ANY:r}=t,n=xn(),o=qd(),a=Wd(),l=bv(),u=wv(),d=xv();return Jh=(h,m,y,w)=>{h=new e(h,w),m=new n(m,w);let E,S,C,R,k;switch(y){case">":E=a,S=u,C=l,R=">",k=">=";break;case"<":E=l,S=d,C=a,R="<",k="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(h,m,w))return!1;for(let $=0;$<m.set.length;++$){const A=m.set[$];let D=null,N=null;if(A.forEach(P=>{P.semver===r&&(P=new t(">=0.0.0")),D=D||P,N=N||P,E(P.semver,D.semver,w)?D=P:C(P.semver,N.semver,w)&&(N=P)}),D.operator===R||D.operator===k||(!N.operator||N.operator===R)&&S(h,N.semver))return!1;if(N.operator===k&&C(h,N.semver))return!1}return!0},Jh}var Zh,aS;function tz(){if(aS)return Zh;aS=1;const e=Sv();return Zh=(r,n,o)=>e(r,n,">",o),Zh}var em,lS;function rz(){if(lS)return em;lS=1;const e=Sv();return em=(r,n,o)=>e(r,n,"<",o),em}var tm,cS;function nz(){if(cS)return tm;cS=1;const e=xn();return tm=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),tm}var rm,uS;function iz(){if(uS)return rm;uS=1;const e=qd(),t=bn();return rm=(r,n,o)=>{const a=[];let l=null,u=null;const d=r.sort((y,w)=>t(y,w,o));for(const y of d)e(y,n,o)?(u=y,l||(l=y)):(u&&a.push([l,u]),u=null,l=null);l&&a.push([l,null]);const p=[];for(const[y,w]of a)y===w?p.push(y):!w&&y===d[0]?p.push("*"):w?y===d[0]?p.push(`<=${w}`):p.push(`${y} - ${w}`):p.push(`>=${y}`);const h=p.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return h.length<m.length?h:n},rm}var nm,dS;function oz(){if(dS)return nm;dS=1;const e=xn(),t=Hd(),{ANY:r}=t,n=qd(),o=bn(),a=(m,y,w={})=>{if(m===y)return!0;m=new e(m,w),y=new e(y,w);let E=!1;e:for(const S of m.set){for(const C of y.set){const R=d(S,C,w);if(E=E||R!==null,R)continue e}if(E)return!1}return!0},l=[new t(">=0.0.0-0")],u=[new t(">=0.0.0")],d=(m,y,w)=>{if(m===y)return!0;if(m.length===1&&m[0].semver===r){if(y.length===1&&y[0].semver===r)return!0;w.includePrerelease?m=l:m=u}if(y.length===1&&y[0].semver===r){if(w.includePrerelease)return!0;y=u}const E=new Set;let S,C;for(const I of m)I.operator===">"||I.operator===">="?S=p(S,I,w):I.operator==="<"||I.operator==="<="?C=h(C,I,w):E.add(I.semver);if(E.size>1)return null;let R;if(S&&C){if(R=o(S.semver,C.semver,w),R>0)return null;if(R===0&&(S.operator!==">="||C.operator!=="<="))return null}for(const I of E){if(S&&!n(I,String(S),w)||C&&!n(I,String(C),w))return null;for(const re of y)if(!n(I,String(re),w))return!1;return!0}let k,$,A,D,N=C&&!w.includePrerelease&&C.semver.prerelease.length?C.semver:!1,P=S&&!w.includePrerelease&&S.semver.prerelease.length?S.semver:!1;N&&N.prerelease.length===1&&C.operator==="<"&&N.prerelease[0]===0&&(N=!1);for(const I of y){if(D=D||I.operator===">"||I.operator===">=",A=A||I.operator==="<"||I.operator==="<=",S){if(P&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===P.major&&I.semver.minor===P.minor&&I.semver.patch===P.patch&&(P=!1),I.operator===">"||I.operator===">="){if(k=p(S,I,w),k===I&&k!==S)return!1}else if(S.operator===">="&&!n(S.semver,String(I),w))return!1}if(C){if(N&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===N.major&&I.semver.minor===N.minor&&I.semver.patch===N.patch&&(N=!1),I.operator==="<"||I.operator==="<="){if($=h(C,I,w),$===I&&$!==C)return!1}else if(C.operator==="<="&&!n(C.semver,String(I),w))return!1}if(!I.operator&&(C||S)&&R!==0)return!1}return!(S&&A&&!C&&R!==0||C&&D&&!S&&R!==0||P||N)},p=(m,y,w)=>{if(!m)return y;const E=o(m.semver,y.semver,w);return E>0?m:E<0||y.operator===">"&&m.operator===">="?y:m},h=(m,y,w)=>{if(!m)return y;const E=o(m.semver,y.semver,w);return E<0?m:E>0||y.operator==="<"&&m.operator==="<="?y:m};return nm=a,nm}var im,fS;function sz(){if(fS)return im;fS=1;const e=Il(),t=Ud(),r=gr(),n=CR(),o=ia(),a=D5(),l=j5(),u=M5(),d=z5(),p=F5(),h=B5(),m=U5(),y=V5(),w=bn(),E=W5(),S=H5(),C=yv(),R=q5(),k=G5(),$=Wd(),A=bv(),D=kR(),N=RR(),P=xv(),I=wv(),re=_R(),Z=X5(),ee=Hd(),ne=xn(),X=qd(),F=K5(),V=Q5(),H=J5(),O=Z5(),L=ez(),U=Sv(),z=tz(),T=rz(),M=nz(),te=iz(),le=oz();return im={parse:o,valid:a,clean:l,inc:u,diff:d,major:p,minor:h,patch:m,prerelease:y,compare:w,rcompare:E,compareLoose:S,compareBuild:C,sort:R,rsort:k,gt:$,lt:A,eq:D,neq:N,gte:P,lte:I,cmp:re,coerce:Z,Comparator:ee,Range:ne,satisfies:X,toComparators:F,maxSatisfying:V,minSatisfying:H,minVersion:O,validRange:L,outside:U,gtr:z,ltr:T,intersects:M,simplifyRange:te,subset:le,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},im}var jr=sz();const pS=Qr(jr);var wt=(e=>(e.NANO_S="nanoS",e.NANO_SP="nanoSP",e.NANO_X="nanoX",e.STAX="stax",e.FLEX="flex",e.APEX="apexp",e))(wt||{});let $R=class{id;model;name;constructor({id:t,model:r,name:n}){this.id=t,this.model=r,this.name=n}};const om={Twelve:12,Eighteen:18,TwentyFour:24};var Xt=(e=>(e.Unknown="unknown",e.WelcomeScreen1="welcome-screen-1",e.WelcomeScreen2="welcome-screen-2",e.WelcomeScreen3="welcome-screen-3",e.WelcomeScreen4="welcome-screen-4",e.WelcomeScreenReminder="welcome-screen-reminder",e.SetupChoice="setup-choice",e.Pin="pin",e.NewDevice="new-device",e.ConfirmNewDevice="confirm-new-device",e.RestoreRecoveryPhrase="restore-recovery-phrase",e.SafetyWarning="safety-warning",e.DeviceIsReady="device-is-ready",e.ChooseName="choose-name",e.RestoreRecoverBackup="restore-recover-backup",e.SetupRestoreChoice="setup-restore-choice",e.OnboardingStatusCheck="onboarding-status-check",e.RestoreWithRk="restore-with-rk",e))(Xt||{});const az={0:Xt.WelcomeScreen1,1:Xt.WelcomeScreen2,2:Xt.WelcomeScreen3,3:Xt.WelcomeScreen4,4:Xt.WelcomeScreenReminder,5:Xt.SetupChoice,6:Xt.Pin,7:Xt.NewDevice,8:Xt.ConfirmNewDevice,9:Xt.RestoreRecoveryPhrase,10:Xt.SafetyWarning,11:Xt.DeviceIsReady,12:Xt.ChooseName,13:Xt.RestoreRecoverBackup,14:Xt.SetupRestoreChoice,15:Xt.OnboardingStatusCheck,16:Xt.RestoreWithRk};let lz=class{seFlags;constructor(t){this.seFlags=new Uint8Array(4),this.seFlags.set(t.subarray(0,this.seFlags.length))}generalDeviceState(){const t=this.seFlags[0]??0;return{isPinValidated:this._checkNthBitInByte(t,1),hasMcuSerialNumber:this._checkNthBitInByte(t,2),hasValidCertificate:this._checkNthBitInByte(t,3),isCustomAuthorityConnectionAllowed:this._checkNthBitInByte(t,4),isSecureConnectionAllowed:this._checkNthBitInByte(t,5),isOnboarded:this._checkNthBitInByte(t,6),isMcuCodeSigned:this._checkNthBitInByte(t,7),isInRecoveryMode:this._checkNthBitInByte(t,8)}}endorsementInformation(){const t=this.seFlags[1]??0;return{hasEndorsementCertificateInSlot1:(t&1)!==0,hasEndorsementCertificateInSlot2:(t&2)!==0}}wordsInformation(){const t=this.seFlags[2]??0,r=t>>5&3;return{numberOfWords:[om.TwentyFour,om.Eighteen,om.Twelve,void 0][r],currentWordIndex:t&31}}onboardingStatus(){const t=this.seFlags[3]??0;return{onboardingState:az[t]??Xt.Unknown}}_checkNthBitInByte(t,r){return(t>>8-r&1)===1}},cz=class{name="getOsVersion";args=void 0;getApdu(){const t={cla:224,ins:1,p1:0,p2:0};return new SR(t).build()}parseResponse(t,r){if(!gv.isSuccessResponse(t))return Io({error:ER.handle(t)});const n=new mv(t),o=n.extract32BitUInt();if(o===void 0)return Io({error:new C5("Missing target ID in OS version")});let a=n.encodeToString(n.extractFieldLVEncoded()),l=n.extractFieldLVEncoded()??new Uint8Array(0);const u=new lz(l),d={...u.generalDeviceState(),...u.endorsementInformation(),...u.wordsInformation(),...u.onboardingStatus()};a||(a="0.0.0",l=new Uint8Array);const p=(o&4026531840)!==805306368,h=a.includes("-osu");let m="",y="",w="",E="",S,C,R,k;if(p){w=a,S=o;const $=n.extractFieldLVEncoded();$&&($.length>=5?(m=n.encodeToString($),C=parseInt(n.encodeToHexaString(n.extractFieldLVEncoded()),16)):C=parseInt(n.encodeToHexaString($),16))}else{if(m=a,C=o,y=n.encodeToString(n.extractFieldLVEncoded()),this.isBootloaderVersionSupported(m,r)&&(w=n.encodeToString(n.extractFieldLVEncoded())),this.isHardwareVersionSupported(m,r)?E=n.encodeToHexaString(n.extractFieldLVEncoded()):E="00",this.isLocalizationSupported(m,r)){const $=n.extractFieldLVEncoded();$!==void 0&&(R=parseInt(n.encodeToHexaString($),16))}if(this.isRecoverSupported(m,r)){const $=n.extractFieldLVEncoded();$!==void 0&&(k=parseInt(n.encodeToHexaString($),16))}}return Io({data:{isBootloader:p,isOsu:h,targetId:o,seTargetId:C,mcuTargetId:S,seVersion:m,seFlags:l,mcuSephVersion:y,mcuBootloaderVersion:w,hwVersion:E,langId:R,recoverState:k,secureElementFlags:d}})}isBootloaderVersionSupported(t,r){const n=jr.coerce(t)??"";switch(r){case wt.NANO_S:case wt.NANO_X:return jr.gte(n,"2.0.0");default:return!0}}isHardwareVersionSupported(t,r){const n=jr.coerce(t)??"";return r===wt.NANO_X?jr.gte(n,"2.0.0"):!1}isLocalizationSupported(t,r){const n=jr.coerce(t)??"";switch(r){case wt.NANO_S:return!1;case wt.NANO_SP:return jr.gte(n,"1.1.0");case wt.NANO_X:return jr.gte(n,"2.1.0");default:return!0}}isRecoverSupported(t,r){const n=jr.coerce(t)??"";switch(r){case wt.NANO_S:return!1;case wt.NANO_SP:return jr.gte(n,"1.1.2");case wt.NANO_X:return jr.gte(n,"2.2.3");case wt.STAX:return jr.gte(n,"1.4.0");case wt.FLEX:return jr.gte(n,"1.0.1");default:return!0}}};var Ln=(e=>(e.LOCKED="LOCKED",e.BUSY="BUSY",e.CONNECTED="CONNECTED",e.NOT_CONNECTED="NOT CONNECTED",e))(Ln||{}),uz=(e=>(e.NotStarted="not-started",e.Pending="pending",e.Stopped="stopped",e.Completed="completed",e.Error="error",e))(uz||{}),dz=(e=>(e.None="none",e.UnlockDevice="unlock-device",e.AllowSecureConnection="allow-secure-connection",e.ConfirmOpenApp="confirm-open-app",e.SignTransaction="sign-transaction",e.SignTypedData="sign-typed-data",e.AllowListApps="allow-list-apps",e.VerifyAddress="verify-address",e.SignPersonalMessage="sign-personal-message",e.SignDelegationAuthorization="sign-delegation-authorization",e.Web3ChecksOptIn="web3-checks-opt-in",e.VerifySafeAddress="verify-safe-address",e.RegisterWallet="register-wallet",e.ConfirmLoadImage="confirm-load-image",e.ConfirmCommitImage="confirm-commit-image",e.ConfirmRemoveImage="confirm-remove-image",e.GrantConsent="grant-consent",e.AllowInstallFirmware="allow-install-firmware",e))(dz||{});const Ar={of(e){return or(e)},empty(){return ft},zero(){return ft},fromNullable(e){return e==null?ft:or(e)},fromFalsy(e){return e?or(e):ft},fromPredicate(e,t){return arguments.length===1?r=>Ar.fromPredicate(e,r):e(t)?or(t):ft},mapMaybe(e,t){return arguments.length===1?r=>Ar.mapMaybe(e,r):Ar.catMaybes(t.map(e))},catMaybes(e){let t=[];for(const r of e)r.isJust()&&t.push(r.extract());return t},encase(e){try{return or(e())}catch{return ft}},isMaybe(e){return e instanceof Ev||e instanceof Cv},sequence(e){let t=[];for(const r of e)if(r.isJust())t.push(r.extract());else return ft;return or(t)},"fantasy-land/of"(e){return this.of(e)},"fantasy-land/empty"(){return this.empty()},"fantasy-land/zero"(){return this.zero()}};class Ev{constructor(t){this.__value=t,this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!0}isNothing(){return!1}inspect(){return`Just(${this.__value})`}toString(){return this.inspect()}toJSON(){const t=this.__value;return t instanceof Date?t.toJSON():t}equals(t){return this.extract()===t.extract()}map(t){return or(t(this.__value))}ap(t){return t.isJust()?this.map(t.extract()):ft}alt(t){return this}altLazy(t){return this}chain(t){return t(this.__value)}chainNullable(t){return Ar.fromNullable(t(this.__value))}join(){return this.__value}reduce(t,r){return t(r,this.__value)}extend(t){return or(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Just(this.__value)}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}toList(){return[this.__value]}mapOrDefault(t,r){return t(this.__value)}extract(){return this.__value}extractNullable(){return this.__value}toEither(t){return Tt(this.__value)}ifJust(t){return t(this.__value),this}ifNothing(t){return this}filter(t){return t(this.__value)?or(this.__value):ft}}Ev.prototype.constructor=Ar;class Cv{constructor(){this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!1}isNothing(){return!0}inspect(){return"Nothing"}toString(){return this.inspect()}toJSON(){return this.__value}equals(t){return this.extract()===t.extract()}map(t){return ft}ap(t){return ft}alt(t){return t}altLazy(t){return t()}chain(t){return ft}chainNullable(t){return ft}join(){return ft}reduce(t,r){return r}extend(t){return ft}unsafeCoerce(){throw new Error("Maybe#unsafeCoerce was ran on a Nothing")}caseOf(t){return"_"in t?t._():t.Nothing()}orDefault(t){return t}orDefaultLazy(t){return t()}toList(){return[]}mapOrDefault(t,r){return r}extract(){}extractNullable(){return null}toEither(t){return yt(t)}ifJust(t){return this}ifNothing(t){return t(),this}filter(t){return ft}}Cv.prototype.constructor=Ar;const or=e=>new Ev(e),ft=new Cv,Tr={of(e){return Tt(e)},lefts(e){let t=[];for(const r of e)r.isLeft()&&t.push(r.extract());return t},rights(e){let t=[];for(const r of e)r.isRight()&&t.push(r.extract());return t},encase(e){try{return Tt(e())}catch(t){return yt(t)}},sequence(e){let t=[];for(const r of e){if(r.isLeft())return r;t.push(r.extract())}return Tt(t)},isEither(e){return e instanceof Rv||e instanceof kv},"fantasy-land/of"(e){return Tr.of(e)}};class kv{constructor(t){this.__value=t,this._="R",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!1}isRight(){return!0}toJSON(){return this.__value}inspect(){return`Right(${this.__value})`}toString(){return this.inspect()}bimap(t,r){return Tt(r(this.__value))}map(t){return Tt(t(this.__value))}mapLeft(t){return this}ap(t){return t.isRight()?this.map(t.extract()):t}equals(t){return t.isRight()?this.__value===t.extract():!1}chain(t){return t(this.__value)}chainLeft(t){return this}join(){return this.__value}alt(t){return this}altLazy(t){return this}reduce(t,r){return t(r,this.__value)}extend(t){return Tt(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Right(this.__value)}leftOrDefault(t){return t}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}leftOrDefaultLazy(t){return t()}ifLeft(t){return this}ifRight(t){return t(this.__value),this}toMaybe(){return or(this.__value)}leftToMaybe(){return ft}extract(){return this.__value}swap(){return yt(this.__value)}}kv.prototype.constructor=Tr;class Rv{constructor(t){this.__value=t,this._="L",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!0}isRight(){return!1}toJSON(){return this.__value}inspect(){return`Left(${JSON.stringify(this.__value)})`}toString(){return this.inspect()}bimap(t,r){return yt(t(this.__value))}map(t){return this}mapLeft(t){return yt(t(this.__value))}ap(t){return t.isLeft()?t:this}equals(t){return t.isLeft()?t.extract()===this.__value:!1}chain(t){return this}chainLeft(t){return t(this.__value)}join(){return this}alt(t){return t}altLazy(t){return t()}reduce(t,r){return r}extend(t){return this}unsafeCoerce(){throw this.__value instanceof Error?this.__value:new Error("Either#unsafeCoerce was ran on a Left")}caseOf(t){return"_"in t?t._():t.Left(this.__value)}leftOrDefault(t){return this.__value}orDefault(t){return t}orDefaultLazy(t){return t()}leftOrDefaultLazy(t){return this.__value}ifLeft(t){return t(this.__value),this}ifRight(t){return this}toMaybe(){return ft}leftToMaybe(){return or(this.__value)}extract(){return this.__value}swap(){return Tt(this.__value)}}Rv.prototype.constructor=Tr;const yt=e=>new Rv(e),Tt=e=>new kv(e),Ol=e=>e,fz=e=>e,sm=Object.assign(fz,{fromArray:e=>sm.isNonEmpty(e)?or(e):ft,unsafeCoerce:e=>{if(sm.isNonEmpty(e))return e;throw new Error("NonEmptyList#unsafeCoerce was ran on an empty array")},fromTuple:e=>sm(e.toArray()),head:e=>e[0],last:e=>e[e.length-1],isNonEmpty:e=>e.length>0,tail:e=>e.slice(1)}),Wu=(e,t)=>typeof t=="bigint"?t.toString():t,pz=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Wo=(e,t)=>{let r="";switch(typeof t){case"undefined":r="undefined";break;case"object":r=t===null?"null":Array.isArray(t)?"an array with value "+JSON.stringify(t,Wu):"an object with value "+JSON.stringify(t,Wu);break;case"boolean":r="a boolean";break;case"symbol":r="a symbol";break;case"function":r="a function";break;case"bigint":r=`a bigint with value ${t.toString()}`}return r=r||`a ${typeof t} with value ${JSON.stringify(t,Wu)}`,`Expected ${e}, but received ${r}`},hz=e=>(Object.keys(e).length===1&&e.oneOf?.length===1&&typeof e.oneOf[0]=="object"&&(Object.assign(e,e.oneOf[0]),delete e.oneOf),e),mz=e=>{if(Array.isArray(e.oneOf))for(let t=0;t<e.oneOf.length;t++){const r=e.oneOf[t];if(typeof r=="object"&&r.oneOf)return e.oneOf.splice(t,1),e.oneOf.push(...r.oneOf),AR(e)}return e},AR=e=>(mz(e),hz(e),e),Ft={interface(e){const t=Object.keys(e),r=o=>{if(!pz(o))return yt(Wo("an object",o));const a={};for(const l of t){if(!o.hasOwnProperty(l)&&!e[l]._isOptional)return yt(`Problem with property "${l}": it does not exist in received object ${JSON.stringify(o,Wu)}`);const u=e[l].decode(o[l]);if(u.isLeft())return yt(`Problem with the value of property "${l}": ${u.extract()}`);const d=u.extract();d!==void 0&&(a[l]=d)}return Tt(a)};return{decode:r,encode:o=>{const a={};for(const l of t)a[l]=e[l].encode(o[l]);return a},unsafeDecode:o=>r(o).mapLeft(Error).unsafeCoerce(),schema:()=>t.reduce((o,a)=>(e[a]._isOptional||o.required.push(a),o.properties[a]=AR(e[a].schema()),o),{type:"object",properties:{},required:[]})}},custom({decode:e,encode:t,schema:r}){return{decode:e,encode:t,unsafeDecode:n=>e(n).mapLeft(Error).unsafeCoerce(),schema:r??(()=>({}))}}},ut=Ft.custom({decode:e=>typeof e=="string"?Tt(e):yt(Wo("a string",e)),encode:Ol,schema:()=>({type:"string"})}),Mo=Ft.custom({decode:e=>typeof e=="number"?Tt(e):yt(Wo("a number",e)),encode:Ol,schema:()=>({type:"number"})}),gz=Ft.custom({decode:e=>e===void 0?Tt(e):yt(Wo("an undefined",e)),encode:Ol}),Yt=e=>({...vz([e,gz]),schema:e.schema,_isOptional:!0}),vd=Ft.custom({decode:e=>typeof e=="boolean"?Tt(e):yt(Wo("a boolean",e)),encode:Ol,schema:()=>({type:"boolean"})}),vz=e=>Ft.custom({decode:t=>{let r=[];for(const n of e){const o=n.decode(t);if(o.isRight())return o;r.push(o.extract())}return yt(`One of the following problems occured: ${r.map((n,o)=>`(${o}) ${n}`).join(", ")}`)},encode:t=>{for(const r of e)if(Tr.encase(()=>r.encode(t)).mapLeft(o=>"").chain(r.decode).isRight())return r.encode(t);return t},schema:()=>({oneOf:e.map(t=>t.schema())})}),Yr=e=>Ft.custom({decode:t=>{if(Array.isArray(t)){const r=[];for(let n=0;n<t.length;n++){const o=e.decode(t[n]);if(o.isRight())r.push(o.extract());else return yt(`Problem with the value at index ${n}: ${o.extract()}`)}return Tt(r)}else return yt(Wo("an array",t))},encode:t=>t.map(e.encode),schema:()=>({type:"array",items:e.schema()})});Ft.custom({decode:e=>ut.decode(e).chain(t=>isFinite(+t)?Tt(t):yt(Wo("a number",e))),encode:Ol,schema:Mo.schema});var TR;const LR={liftEither(e){if(e.isRight())return Promise.resolve(e.extract());throw e.extract()},fromPromise(e){return e.then(LR.liftEither)},throwE(e){throw e}};class IR{constructor(t){this.runPromise=t,this[TR]="EitherAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this.then=(r,n)=>this.run().then(r,n)}leftOrDefault(t){return this.run().then(r=>r.leftOrDefault(t))}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return He(async t=>{const r=await this;if(r.isRight()){const n=await r.extract();return t.liftEither(n)}return t.liftEither(r)})}ap(t){return He(async r=>{const n=await t;if(n.isRight()){const o=await this.run();return o.isRight()?n.extract()(o.extract()):r.liftEither(o)}return r.liftEither(n)})}alt(t){return He(async r=>{const n=await this.run();if(n.isRight())return n.extract();{const o=await t;return r.liftEither(o)}})}extend(t){return He(async r=>{const n=await this.run();if(n.isRight()){const o=He.liftEither(n);return r.liftEither(Tt(t(o)))}return r.liftEither(n)})}async run(){try{return Tt(await this.runPromise(LR))}catch(t){return yt(t)}}bimap(t,r){return He(async n=>{const o=await this.run();try{return await n.liftEither(o.bimap(t,r))}catch(a){throw await a}})}map(t){return He(r=>this.runPromise(r).then(t))}mapLeft(t){return He(async r=>{try{return await this.runPromise(r)}catch(n){throw await t(n)}})}chain(t){return He(async r=>{const n=await this.runPromise(r);return r.fromPromise(t(n))})}chainLeft(t){return He(async r=>{try{return await this.runPromise(r)}catch(n){return r.fromPromise(t(n))}})}toMaybeAsync(){return hr(async({liftMaybe:t})=>{const r=await this.run();return t(r.toMaybe())})}swap(){return He(async t=>{const r=await this.run();return r.isRight()&&t.throwE(r.extract()),t.liftEither(Tt(r.extract()))})}ifLeft(t){return He(async r=>{const n=await this.run();return n.ifLeft(t),r.liftEither(n)})}ifRight(t){return He(async r=>{const n=await this.run();return n.ifRight(t),r.liftEither(n)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return He(({fromPromise:r})=>r(this.run().finally(t)))}}TR=Symbol.toStringTag;const He=Object.assign(e=>new IR(e),{fromPromise:e=>He(({fromPromise:t})=>t(e())),liftEither:e=>He(({liftEither:t})=>t(e)),lefts:e=>Promise.all(e.map(t=>t.run())).then(Tr.lefts),rights:e=>Promise.all(e.map(t=>t.run())).then(Tr.rights),sequence:e=>He(async t=>{let r=[];for await(const n of e){if(n.isLeft())return t.liftEither(n);r.push(n.extract())}return t.liftEither(Tt(r))}),all:e=>He.fromPromise(async()=>Promise.all(e).then(Tr.sequence))});IR.prototype.constructor=He;var OR;const NR={liftMaybe(e){if(e.isJust())return Promise.resolve(e.extract());throw ft},fromPromise(e){return e.then(NR.liftMaybe)}};class PR{constructor(t){this.runPromise=t,this[OR]="MaybeAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/filter"]=this.filter,this["fantasy-land/alt"]=this.alt}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return hr(async t=>{const r=await this.run();if(r.isJust()){const n=await r.extract();return t.liftMaybe(n)}return t.liftMaybe(ft)})}ap(t){return hr(async r=>{const n=await t;if(n.isJust()){const o=await this.run();return o.isJust()?n.extract()(o.extract()):r.liftMaybe(ft)}return r.liftMaybe(ft)})}alt(t){return hr(async r=>{const n=await this.run();if(n.isJust())return n.extract();{const o=await t;return r.liftMaybe(o)}})}extend(t){return hr(async r=>{const n=await this.run();if(n.isJust()){const o=hr.liftMaybe(n);return r.liftMaybe(or(t(o)))}return r.liftMaybe(ft)})}filter(t){return hr(async r=>{const n=await this.run();return r.liftMaybe(n.filter(t))})}async run(){try{return or(await this.runPromise(NR))}catch{return ft}}map(t){return hr(r=>this.runPromise(r).then(t))}chain(t){return hr(async r=>{const n=await this.runPromise(r);return r.fromPromise(t(n))})}toEitherAsync(t){return He(async({liftEither:r})=>{const n=await this.run();return r(n.toEither(t))})}ifJust(t){return hr(async r=>{const n=await this.run();return n.ifJust(t),r.liftMaybe(n)})}ifNothing(t){return hr(async r=>{const n=await this.run();return n.ifNothing(t),r.liftMaybe(n)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return hr(({fromPromise:r})=>r(this.run().finally(t)))}then(t,r){return this.run().then(t,r)}}OR=Symbol.toStringTag;const hr=Object.assign(e=>new PR(e),{catMaybes:e=>Promise.all(e).then(Ar.catMaybes),fromPromise:e=>hr(({fromPromise:t})=>t(e())),liftMaybe:e=>hr(({liftMaybe:t})=>t(e))});PR.prototype.constructor=hr;function Pt(e){return typeof e=="function"}function Gd(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var am=Gd(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
27
+ )`}return v.jsx("div",{ref:t,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function sR(e){return e==="starting"?Nj:Rr}const i2=x.createContext(void 0);function o2(e){return x.useContext(i2)}const s2="ArrowUp",a2="ArrowDown",l2="ArrowLeft",c2="ArrowRight",u2="Home",d2=new Set([s2,a2,l2,c2,u2,"End"]);function f2(e,t={}){const r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingElement"),a=r.useState("domReferenceElement"),{dataRef:l}=r.context,{enabled:u=!0,closeDelay:d=0}=t,p=jk(r),h=ta(),m=Vo(),y=et(()=>Mk(l.current.openEvent?.type,p.interactedInside)),w=et(()=>{const $=l.current.openEvent?.type;return $?.includes("mouse")&&$!=="mousedown"}),E=et($=>Rk($,r.context.triggerElements)),S=x.useCallback($=>{const A=Fu(d,"close",p.pointerType),D=()=>{r.setOpen(!1,Ft(Cr,$)),h?.events.emit("floating.closed",$)};A?p.openChangeTimeout.start(A,D):(p.openChangeTimeout.clear(),D())},[d,r,p,h]),C=et(()=>{dv(p)}),R=et($=>{const A=gn($);if(!LM(A)){p.interactedInside=!1;return}p.interactedInside=A?.closest("[aria-haspopup]")!=null});lt(()=>{n||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,C())},[n,p,C]),x.useEffect(()=>C,[C]),lt(()=>{if(u&&n&&p.handleCloseOptions?.blockPointerEvents&&w()&&gt(a)&&o){const $=a,A=o,D=_t(o),N=h?.nodesRef.current.find(I=>I.id===m)?.context?.elements.floating;N&&(N.style.pointerEvents="");const P=p.handleCloseOptions?.getScope?.()??p.pointerEventsScopeElement??N??$.closest("[data-rootownerid]")??D.body;return OM(p,{scopeElement:P,referenceElement:$,floatingElement:A}),()=>{C()}}},[u,n,a,o,p,w,h,m,C]);const k=Vs();x.useEffect(()=>{if(!u)return;function $(){p.openChangeTimeout.clear(),k.clear(),h?.events.off("floating.closed",D),C()}function A(P){if(h&&m&&oi(h.nodesRef.current,m).length>0){h.events.on("floating.closed",D);return}if(!E(P.relatedTarget)){if(p.handler){p.handler(P);return}C(),y()||S(P)}}function D(P){!h||!m||oi(h.nodesRef.current,m).length>0||k.start(0,()=>{h.events.off("floating.closed",D),r.setOpen(!1,Ft(Cr,P)),h.events.emit("floating.closed",P)})}const N=o;return N&&(N.addEventListener("mouseenter",$),N.addEventListener("mouseleave",A),N.addEventListener("pointerdown",R,!0)),()=>{N&&(N.removeEventListener("mouseenter",$),N.removeEventListener("mouseleave",A),N.removeEventListener("pointerdown",R,!0)),h?.events.off("floating.closed",D)}},[u,o,r,l,y,E,S,C,R,p,h,m,k])}const dh={inert:new WeakMap,"aria-hidden":new WeakMap},ow="data-base-ui-inert",yg={inert:new WeakSet,"aria-hidden":new WeakSet};let Ja=new WeakMap,fh=0;function p2(e){return yg[e]}function aR(e){return e?bl(e)?e.host:aR(e.parentNode):null}const ph=(e,t)=>t.map(r=>{if(e.contains(r))return r;const n=aR(r);return e.contains(n)?n:null}).filter(r=>r!=null),sw=e=>{const t=new Set;return e.forEach(r=>{let n=r;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},aw=(e,t,r)=>{const n=[],o=a=>{!a||r.has(a)||Array.from(a.children).forEach(l=>{Qi(l)!=="script"&&(t.has(l)?o(l):n.push(l))})};return o(e),n};function h2(e,t,r,n,{mark:o=!0,markerIgnoreElements:a=[]}){const l=n?"inert":r?"aria-hidden":null;let u=null,d=null;const p=ph(t,e),h=o?ph(t,a):[],m=new Set(h),y=o?aw(t,sw(p),new Set(p)).filter(S=>!m.has(S)):[],w=[],E=[];if(l){const S=dh[l],C=p2(l);d=C,u=S;const R=ph(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(R);aw(t,sw(k),new Set(k)).forEach($=>{const A=$.getAttribute(l),D=A!==null&&A!=="false",N=(S.get($)||0)+1;S.set($,N),w.push($),N===1&&D&&C.add($),D||$.setAttribute(l,l==="inert"?"":"true")})}return o&&y.forEach(S=>{const C=(Ja.get(S)||0)+1;Ja.set(S,C),E.push(S),C===1&&S.setAttribute(ow,"")}),fh+=1,()=>{u&&w.forEach(S=>{const C=(u.get(S)||0)-1;u.set(S,C),C||(!d?.has(S)&&l&&S.removeAttribute(l),d?.delete(S))}),o&&E.forEach(S=>{const C=(Ja.get(S)||0)-1;Ja.set(S,C),C||S.removeAttribute(ow)}),fh-=1,fh||(dh.inert=new WeakMap,dh["aria-hidden"]=new WeakMap,yg.inert=new WeakSet,yg["aria-hidden"]=new WeakSet,Ja=new WeakMap)}}function lw(e,t={}){const{ariaHidden:r=!1,inert:n=!1,mark:o=!0,markerIgnoreElements:a=[]}=t,l=_t(e[0]).body;return h2(e,l,r,n,{mark:o,markerIgnoreElements:a})}function m2(e,t){const r=tr(e.target);return e instanceof r.KeyboardEvent?"keyboard":e instanceof r.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof r.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const cw=20;let Bi=[];function hv(){Bi=Bi.filter(e=>e.deref()?.isConnected)}function g2(e){hv(),e&&Qi(e)!=="body"&&(Bi.push(new WeakRef(e)),Bi.length>cw&&(Bi=Bi.slice(-cw)))}function hh(){return hv(),Bi[Bi.length-1]?.deref()}function v2(e){if(!e)return null;const t=ra();return Hk(e,t)?e:Tl(e,t)[0]||e}function y2(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Z6(e)}function uw(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=ra(),n=t4(e,r).filter(a=>{const l=a.getAttribute("data-tabindex")||"";return Hk(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||n.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function b2(e){const{context:t,children:r,disabled:n=!1,initialFocus:o=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:p="",nextFocusableElement:h,previousFocusableElement:m,beforeContentFocusGuardRef:y,externalTree:w,getInsideElements:E}=e,S="rootStore"in t?t.rootStore:t,C=S.useState("open"),R=S.useState("domReferenceElement"),k=S.useState("floatingElement"),{events:$,dataRef:A}=S.context,D=et(()=>A.current.floatingContext?.nodeId),N=o===!1,P=Mx(R)&&N,I=x.useRef(["content"]),re=Nn(o),Z=Nn(a),ee=Nn(p),ne=ta(w),X=Kk(),F=x.useRef(!1),V=x.useRef(!1),H=x.useRef(!1),O=x.useRef(-1),L=x.useRef(""),U=x.useRef(""),z=x.useRef(null),T=x.useRef(null),M=ud(z,y,X?.beforeInsideRef),te=ud(T,X?.afterInsideRef),le=Vs(),G=Vs(),fe=tv(),be=X!=null,pe=cg(k),ue=et((we=pe)=>we?Tl(we,ra()):[]),ge=et(()=>E?.().filter(we=>we!=null)??[]),qe=et(we=>{const ze=ue(we);return I.current.map(()=>ze).filter(Boolean).flat()});x.useEffect(()=>{if(n||!u)return;function we(We){We.key==="Tab"&&st(pe,$o(_t(pe)))&&ue().length===0&&!P&&g6(We)}const ze=_t(pe);return ze.addEventListener("keydown",we),()=>{ze.removeEventListener("keydown",we)}},[n,R,pe,u,I,P,ue,qe]),x.useEffect(()=>{if(n||!C)return;const we=_t(pe);function ze(){H.current=!1}function We(De){const Fe=gn(De),ct=ge(),Ne=st(k,Fe)||st(R,Fe)||st(X?.portalNode,Fe)||ct.some(oe=>oe===Fe||st(oe,Fe));H.current=!Ne,U.current=De.pointerType||"keyboard",Fe?.closest(`[${uk}]`)&&(V.current=!0)}function tt(){U.current="keyboard"}return we.addEventListener("pointerdown",We,!0),we.addEventListener("pointerup",ze,!0),we.addEventListener("pointercancel",ze,!0),we.addEventListener("keydown",tt,!0),()=>{we.removeEventListener("pointerdown",We,!0),we.removeEventListener("pointerup",ze,!0),we.removeEventListener("pointercancel",ze,!0),we.removeEventListener("keydown",tt,!0)}},[n,k,R,pe,C,X,ge]),x.useEffect(()=>{if(n||!d)return;const we=_t(pe);function ze(){V.current=!0,G.start(0,()=>{V.current=!1})}function We(Ne){const oe=gn(Ne),Se=ue().indexOf(oe);Se!==-1&&(O.current=Se)}function tt(Ne){const oe=Ne.relatedTarget,Se=Ne.currentTarget,Je=gn(Ne);queueMicrotask(()=>{const ht=D(),Ut=S.context.triggerElements,Vt=ge(),jt=oe?.hasAttribute(sd("focus-guard"))&&[z.current,T.current,X?.beforeInsideRef.current,X?.afterInsideRef.current,X?.beforeOutsideRef.current,X?.afterOutsideRef.current,Zn(m),Zn(h)].includes(oe),Wt=!(st(R,oe)||st(k,oe)||st(oe,k)||st(X?.portalNode,oe)||Vt.some(bt=>bt===oe||st(bt,oe))||oe!=null&&Ut.hasElement(oe)||Ut.hasMatchingElement(bt=>st(bt,oe))||jt||ne&&(oi(ne.nodesRef.current,ht).find(bt=>st(bt.context?.elements.floating,oe)||st(bt.context?.elements.domReference,oe))||zx(ne.nodesRef.current,ht).find(bt=>[bt.context?.elements.floating,cg(bt.context?.elements.floating)].includes(oe)||bt.context?.elements.domReference===oe)));if(Se===R&&pe&&uw(pe,I),l&&Se!==R&&!y2(Je)&&$o(we)===we.body){if(Kt(pe)&&(pe.focus(),l==="popup")){fe.request(()=>{pe.focus()});return}const bt=O.current,rt=ue(),q=rt[bt]||rt[rt.length-1]||pe;Kt(q)&&q.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(P||!u)&&oe&&Wt&&!V.current&&(P||oe!==hh())&&(F.current=!0,S.setOpen(!1,Ft(El,Ne)))})}function De(){H.current||(A.current.insideReactTree=!0,le.start(0,()=>{A.current.insideReactTree=!1}))}const Fe=Kt(R)?R:null,ct=[];if(!(!k&&!Fe))return Fe&&(Fe.addEventListener("focusout",tt),Fe.addEventListener("pointerdown",ze),ct.push(()=>{Fe.removeEventListener("focusout",tt),Fe.removeEventListener("pointerdown",ze)})),k&&(k.addEventListener("focusin",We),k.addEventListener("focusout",tt),X&&(k.addEventListener("focusout",De,!0),ct.push(()=>{k.removeEventListener("focusout",De,!0)})),ct.push(()=>{k.removeEventListener("focusin",We),k.removeEventListener("focusout",tt)})),()=>{ct.forEach(Ne=>{Ne()})}},[n,R,k,pe,u,ne,X,S,d,l,ue,P,D,I,A,le,G,fe,h,m,ge]),x.useEffect(()=>{if(n||!k||!C)return;const we=Array.from(X?.portalNode?.querySelectorAll(`[${sd("portal")}]`)||[]),ze=(ne?zx(ne.nodesRef.current,D()):[]).find(ct=>Mx(ct.context?.elements.domReference||null))?.context?.elements.domReference,We=[k,...we,z.current,T.current,X?.beforeOutsideRef.current,X?.afterOutsideRef.current,...ge(),ze,Zn(m),Zn(h),P?R:null].filter(ct=>ct!=null),tt=lw(We,{ariaHidden:u||P,mark:!1}),De=[k,...we].filter(ct=>ct!=null),Fe=lw(De);return()=>{Fe(),tt()}},[C,n,R,k,u,I,X,P,ne,D,h,m,ge]),lt(()=>{if(!C||n||!Kt(pe))return;const we=_t(pe),ze=$o(we);queueMicrotask(()=>{const We=qe(pe),tt=re.current,De=typeof tt=="function"?tt(ee.current||""):tt;if(De===void 0||De===!1)return;let Fe;De===!0||De===null?Fe=We[0]||pe:Fe=Zn(De),Fe=Fe||We[0]||pe,!st(pe,ze)&&ah(Fe,{preventScroll:Fe===pe})})},[n,C,pe,N,qe,re,ee]),lt(()=>{if(n||!pe)return;const we=_t(pe),ze=$o(we);g2(ze);function We(De){if(De.open||(L.current=m2(De.nativeEvent,U.current)),De.reason===Cr&&De.nativeEvent.type==="mouseleave"&&(F.current=!0),De.reason===_k)if(De.nested)F.current=!1;else if(y6(De.nativeEvent)||b6(De.nativeEvent))F.current=!1;else{let Fe=!1;document.createElement("div").focus({get preventScroll(){return Fe=!0,!1}}),Fe?F.current=!1:F.current=!0}}$.on("openchange",We);function tt(){const De=Z.current;let Fe=typeof De=="function"?De(L.current):De;if(Fe===void 0||Fe===!1)return null;if(Fe===null&&(Fe=!0),typeof Fe=="boolean"){const Ne=R||hh();return Ne&&Ne.isConnected?Ne:null}const ct=R||hh();return Zn(Fe)||ct||null}return()=>{$.off("openchange",We);const De=$o(we),Fe=ge(),ct=st(k,De)||Fe.some(oe=>oe===De||st(oe,De))||ne&&oi(ne.nodesRef.current,D(),!1).some(oe=>st(oe.context?.elements.floating,De)),Ne=tt();queueMicrotask(()=>{const oe=v2(Ne),Se=typeof Z.current!="boolean";Z.current&&!F.current&&Kt(oe)&&(!(!Se&&oe!==De&&De!==we.body)||ct)&&oe.focus({preventScroll:!0}),F.current=!1})}},[n,k,pe,Z,A,$,ne,R,D,ge]),lt(()=>{if(!sk||C||!k)return;const we=$o(_t(k));!Kt(we)||!ov(we)||st(k,we)&&we.blur()},[C,k]),lt(()=>{if(!(n||!X))return X.setFocusManagerState({modal:u,closeOnFocusOut:d,open:C,onOpenChange:S.setOpen,domReference:R}),()=>{X.setFocusManagerState(null)}},[n,X,u,C,S,d,R]),lt(()=>{if(!(n||!pe))return uw(pe,I),()=>{queueMicrotask(hv)}},[n,pe,I]);const Xe=!n&&(u?!P:!0)&&(be||u);return v.jsxs(x.Fragment,{children:[Xe&&v.jsx(qs,{"data-type":"inside",ref:M,onFocus:we=>{if(u){const ze=qe();ah(ze[ze.length-1])}else X?.portalNode&&(F.current=!1,Ps(we,X.portalNode)?fv(R)?.focus():Zn(m??X.beforeOutsideRef)?.focus())}}),r,Xe&&v.jsx(qs,{"data-type":"inside",ref:te,onFocus:we=>{u?ah(qe()[0]):X?.portalNode&&(d&&(F.current=!0),Ps(we,X.portalNode)?Gk(R)?.focus():Zn(h??X.afterOutsideRef)?.focus())}})]})}function x2(){return{...S6(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const w2={...E6,disabled:ut(e=>e.disabled),instantType:ut(e=>e.instantType),openMethod:ut(e=>e.openMethod),openChangeReason:ut(e=>e.openChangeReason),modal:ut(e=>e.modal),stickIfOpen:ut(e=>e.stickIfOpen),titleElementId:ut(e=>e.titleElementId),descriptionElementId:ut(e=>e.descriptionElementId),openOnHover:ut(e=>e.openOnHover),closeDelay:ut(e=>e.closeDelay),hasViewport:ut(e=>e.hasViewport)};let S2=class lR extends hk{constructor(t){const r={...x2(),...t};r.open&&t?.mounted===void 0&&(r.mounted=!0),super(r,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),stickIfOpenTimeout:new ci,triggerElements:new iv},w2)}setOpen=(t,r)=>{const n=r.reason===Cr,o=r.reason===Ws&&r.event.detail===0,a=!t&&(r.reason===$k||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,r),r.isCanceled)return;const l={open:t,nativeEvent:r.event,reason:r.reason,nested:this.state.nested,triggerElement:r.trigger};this.state.floatingRootContext.context.events?.emit("openchange",l);const u=()=>{const d={open:t,openChangeReason:r.reason},p=r.trigger?.id??null;(p||t)&&(d.activeTriggerId=p,d.activeTriggerElement=r.trigger??null),this.update(d)};n?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Oj,()=>{this.set("stickIfOpen",!1)}),Lr.flushSync(u)):u(),o||a?this.set("instantType",o?"click":"dismiss"):r.reason===El?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,r){const n=yn(()=>new lR(r)).current,o=t??n;return Dd(n.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};const cR=x.createContext(void 0);function na(e){const t=x.useContext(cR);if(t===void 0&&!e)throw new Error(Uo(47));return t}function dw({props:e}){const{children:t,open:r,defaultOpen:n=!1,onOpenChange:o,onOpenChangeComplete:a,modal:l=!1,handle:u,triggerId:d,defaultTriggerId:p=null}=e,h=S2.useStore(u?.store,{modal:l,open:n,openProp:r,activeTriggerId:p,triggerIdProp:d});hj(()=>{r===void 0&&h.state.open===!1&&n===!0&&h.update({open:!0,activeTriggerId:p})}),h.useControlledProp("openProp",r),h.useControlledProp("triggerIdProp",d);const m=h.useState("open"),y=h.useState("positionerElement"),w=h.useState("payload"),E=h.useState("openChangeReason");h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",a);const{openMethod:S,triggerProps:C}=Bj(m);I6(h);const{forceUnmount:R}=O6(m,h,()=>{h.update({stickIfOpen:!0,openChangeReason:null})});Lj(m&&l===!0&&E!==Cr&&S!=="touch",y),x.useEffect(()=>{m||h.context.stickIfOpenTimeout.clear()},[h,m]);const k=x.useCallback(F=>{const V=Ft(F);return V.preventUnmountOnClose=()=>{h.set("preventUnmountingOnClose",!0)},V},[h]),$=x.useCallback(()=>{h.setOpen(!1,k(D6))},[h,k]);x.useImperativeHandle(e.actionsRef,()=>({unmount:R,close:$}),[R,$]);const A=N6({popupStore:h,onOpenChange:h.setOpen}),D=F6(A,{outsidePressEvent:{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),N=U6(A),{getReferenceProps:P,getFloatingProps:I,getTriggerProps:re}=Tk([D,N]),Z=x.useMemo(()=>P(C),[P,C]),ee=x.useMemo(()=>re(C),[re,C]),ne=x.useMemo(()=>I(),[I]);h.useSyncedValues({modal:l,openMethod:S,activeTriggerProps:Z,inactiveTriggerProps:ee,popupProps:ne,floatingRootContext:A,nested:Vo()!=null});const X=x.useMemo(()=>({store:h}),[h]);return v.jsx(cR.Provider,{value:X,children:typeof t=="function"?t({payload:w}):t})}function E2(e){return na(!0)?v.jsx(dw,{props:e}):v.jsx(R6,{children:v.jsx(dw,{props:e})})}const C2=300,k2=x.forwardRef(function(e,t){const{render:r,className:n,disabled:o=!1,nativeButton:a=!0,handle:l,payload:u,openOnHover:d=!1,delay:p=C2,closeDelay:h=0,id:m,...y}=e,w=na(!0),E=l?.store??w?.store;if(!E)throw new Error(Uo(74));const S=_M(m),C=E.useState("isTriggerActive",S),R=E.useState("floatingRootContext"),k=E.useState("isOpenedByTrigger",S),$=x.useRef(null),{registerTrigger:A,isMountedByThisTrigger:D}=L6(S,$,E,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),N=E.useState("openChangeReason"),P=E.useState("stickIfOpen"),I=E.useState("openMethod"),re=DM(R,{enabled:R!=null&&d&&(I!=="touch"||N!==Ws),mouseOnly:!0,move:!1,handleClose:zM(),restMs:p,delay:{close:h},triggerElementRef:$,isActiveTrigger:C}),Z=FM(R,{enabled:R!=null,stickIfOpen:P}),ee=Tk([Z]),ne=E.useState("triggerProps",D),X={disabled:o,open:k},{getButtonProps:F,buttonRef:V}=kM({disabled:o,native:a}),H=x.useMemo(()=>({open(T){return T&&N===Ws?dM.open(T):uM.open(T)}}),[N]),O=Al("button",e,{state:X,ref:[V,t,A,$],props:[ee.getReferenceProps(),re,ne,{[uk]:"",id:S},y,F],stateAttributesMapping:H}),L=x.useRef(null),U=et(T=>{Lr.flushSync(()=>{E.setOpen(!1,Ft(El,T.nativeEvent,T.currentTarget))}),n4(L.current)?.focus()}),z=et(T=>{const M=E.select("positionerElement");if(M&&Ps(T,M))E.context.beforeContentFocusGuardRef.current?.focus();else{Lr.flushSync(()=>{E.setOpen(!1,Ft(El,T.nativeEvent,T.currentTarget))});let te=r4(E.context.triggerFocusTargetRef.current||$.current);for(;te!==null&&st(M,te);){const le=te;if(te=fv(te),te===le)break}te?.focus()}});return C?v.jsxs(x.Fragment,{children:[v.jsx(qs,{ref:L,onFocus:U}),v.jsx(x.Fragment,{children:O},S),v.jsx(qs,{ref:E.context.triggerFocusTargetRef,onFocus:z})]}):v.jsx(x.Fragment,{children:O},S)}),uR=x.createContext(void 0);function R2(){const e=x.useContext(uR);if(e===void 0)throw new Error(Uo(45));return e}const _2=x.forwardRef(function(e,t){const{keepMounted:r=!1,...n}=e,{store:o}=na();return o.useState("mounted")||r?v.jsx(uR.Provider,{value:r,children:v.jsx(a4,{ref:t,...n})}):null}),$2={...uv,...xk},A2=x.forwardRef(function(e,t){const{className:r,render:n,...o}=e,{store:a}=na(),l=a.useState("open"),u=a.useState("mounted"),d=a.useState("transitionStatus"),p=a.useState("openChangeReason");return Al("div",e,{state:{open:l,transitionStatus:d},ref:[a.context.backdropRef,t],props:[{role:"presentation",hidden:!u,style:{pointerEvents:p===Cr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o],stateAttributesMapping:$2})}),dR=x.createContext(void 0);function T2(){const e=x.useContext(dR);if(!e)throw new Error(Uo(46));return e}const L2=x.forwardRef(function(e,t){const{render:r,className:n,anchor:o,positionMethod:a="absolute",side:l="bottom",align:u="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:h="clipping-ancestors",collisionPadding:m=5,arrowPadding:y=5,sticky:w=!1,disableAnchorTracking:E=!1,collisionAvoidance:S=Pj,...C}=e,{store:R}=na(),k=R2(),$=C6(),A=R.useState("floatingRootContext"),D=R.useState("mounted"),N=R.useState("open"),P=R.useState("openChangeReason"),I=R.useState("activeTriggerElement"),re=R.useState("modal"),Z=R.useState("positionerElement"),ee=R.useState("instantType"),ne=R.useState("transitionStatus"),X=R.useState("hasViewport"),F=x.useRef(null),V=wk(Z,!1,!1),H=r2({anchor:o,floatingRootContext:A,positionMethod:a,mounted:D,side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:y,collisionBoundary:h,collisionPadding:m,sticky:w,disableAnchorTracking:E,keepMounted:k,nodeId:$,collisionAvoidance:S,adaptiveOrigin:X?Z4:void 0}),O=x.useMemo(()=>{const te={};return N||(te.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...H.positionerStyles,...te}}},[N,D,H.positionerStyles]),L=x.useMemo(()=>({props:O,...H}),[O,H]),U=A.useState("domReferenceElement");lt(()=>{const te=U,le=F.current;if(te&&(F.current=te),le&&te&&te!==le){R.set("instantType",void 0);const G=new AbortController;return V(()=>{R.set("instantType","trigger-change")},G.signal),()=>{G.abort()}}},[U,V,R]);const z={open:N,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:ee},T=x.useCallback(te=>{R.set("positionerElement",te)},[R]),M=Al("div",e,{state:z,props:[L.props,sR(ne),C],ref:[t,T],stateAttributesMapping:uv});return v.jsxs(dR.Provider,{value:L,children:[D&&re===!0&&P!==Cr&&v.jsx(n2,{ref:R.context.internalBackdropRef,inert:l4(!N),cutout:I}),v.jsx(k6,{id:$,children:M})]})}),I2=x.createContext(void 0);function O2(){const[e,t]=x.useState(0),r=et(()=>(t(n=>n+1),()=>{t(n=>Math.max(0,n-1))}));return{context:x.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}function N2(e){const{value:t,children:r}=e;return v.jsx(I2.Provider,{value:t,children:r})}const P2={...uv,...xk},D2=x.forwardRef(function(e,t){const{className:r,render:n,initialFocus:o,finalFocus:a,...l}=e,{store:u}=na(),d=T2(),p=o2()!=null,{context:h,hasClosePart:m}=O2(),y=u.useState("open"),w=u.useState("openMethod"),E=u.useState("instantType"),S=u.useState("transitionStatus"),C=u.useState("popupProps"),R=u.useState("titleElementId"),k=u.useState("descriptionElementId"),$=u.useState("modal"),A=u.useState("mounted"),D=u.useState("openChangeReason"),N=u.useState("activeTriggerElement"),P=u.useState("floatingRootContext");Sk({open:y,ref:u.context.popupRef,onComplete(){y&&u.context.onOpenChangeComplete?.(!0)}});const I=u.useState("disabled"),re=u.useState("openOnHover"),Z=u.useState("closeDelay");f2(P,{enabled:re&&!I,closeDelay:Z});function ee(O){return O==="touch"?u.context.popupRef.current:!0}const ne=o===void 0?ee:o,X={open:y,side:d.side,align:d.align,instant:E,transitionStatus:S},F=$!==!1&&m,V=x.useCallback(O=>{u.set("popupElement",O)},[u]),H=Al("div",e,{state:X,ref:[t,u.context.popupRef,V],props:[C,{"aria-labelledby":R,"aria-describedby":k,onKeyDown(O){p&&d2.has(O.key)&&O.stopPropagation()}},sR(S),l],stateAttributesMapping:P2});return v.jsx(b2,{context:P,openInteractionType:w,modal:F,disabled:!A||D===Cr,initialFocus:ne,returnFocus:a,restoreFocus:"popup",previousFocusableElement:Kt(N)?N:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:v.jsx(N2,{value:h,children:H})})}),[j2,M2]=Cd("Popover"),z2=kr(["overflow-hidden rounded-md bg-canvas-sheet p-16 outline-none","shadow-xl","data-open:data-[side=top]:animate-slide-in-from-bottom","data-closed:data-[side=top]:animate-slide-out-to-bottom","data-open:data-[side=bottom]:animate-slide-in-from-top","data-closed:data-[side=bottom]:animate-slide-out-to-top","data-open:data-[side=left]:animate-slide-in-from-right","data-closed:data-[side=left]:animate-slide-out-to-right","data-open:data-[side=right]:animate-slide-in-from-left","data-closed:data-[side=right]:animate-slide-out-to-left"],{variants:{width:{fit:"",fixed:"w-400"}},defaultVariants:{width:"fit"}}),F2=Qt("fixed inset-0 z-dialog-overlay bg-canvas-overlay-subtle","data-open:animate-fade-in","data-closed:animate-fade-out"),B2=({open:e,defaultOpen:t,onOpenChange:r,overlay:n=!1,handle:o,children:a})=>v.jsx(j2,{value:{overlay:n},children:v.jsx(E2,{open:e,defaultOpen:t,onOpenChange:r,modal:n,handle:o,children:a})}),U2=({handle:e,payload:t,render:r,className:n,...o})=>v.jsx(k2,{"data-slot":"popover-trigger",handle:e,payload:t,render:r,className:Qt("data-popup-open:z-menu",n),...o}),V2=({side:e="bottom",sideOffset:t=8,align:r="start",width:n="fit",initialFocus:o=!1,className:a,children:l})=>{const{overlay:u}=M2({consumerName:"PopoverContent",contextRequired:!0});return v.jsxs(_2,{children:[u&&v.jsx(A2,{"data-slot":"popover-overlay",className:F2}),v.jsx(L2,{"data-slot":"popover-positioner",className:"z-menu",side:e,sideOffset:t,align:r,children:v.jsx(D2,{"data-slot":"popover-content",initialFocus:o,className:Qt(z2({width:n}),a),children:l})})]})},W2=pt("ChevronLeft",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M9.333 5.333 6.667 8l2.666 2.667"})})),[H2,q2]=Cd("SegmentedControl"),G2=()=>q2({consumerName:"SegmentedControlButton",contextRequired:!0});function X2({ref:e,selectedIndex:t,children:r}){const[n,o]=x.useState({width:0,height:0,x:0}),[a,l]=x.useState(!1);return x.useLayoutEffect(()=>{const u=e.current;if(!u)return;const d=()=>{const h=Array.from(u.children).slice(0,-1),m=t>=0?h[t]:void 0;o({width:m?.offsetWidth??0,height:u.offsetHeight,x:m?.offsetLeft??0})};if(d(),typeof ResizeObserver>"u")return;const p=new ResizeObserver(d);return p.observe(u),()=>p.disconnect()},[r,t,e]),x.useEffect(()=>{const u=requestAnimationFrame(()=>{l(!0)});return()=>cancelAnimationFrame(u)},[]),{pill:n,isReady:a}}function Y2(e,t){return x.useMemo(()=>x.Children.toArray(t).findIndex(r=>x.isValidElement(r)&&r.props.value===e),[e,t])}function K2(e){const{canScrollLeft:t,canScrollRight:r}=YD(e),n=x.useCallback(o=>{const a=e.current;if(!a)return;const l=a.clientWidth/2;a.scrollBy({left:o==="left"?-l:l,behavior:"smooth"})},[e]);return{canScrollLeft:t,canScrollRight:r,scrollBy:n}}function Q2(e,t){x.useLayoutEffect(()=>{if(t<0)return;const r=e.current;if(!r)return;const n=r.querySelectorAll('button[role="radio"]')[t];if(n){const{offsetLeft:o,offsetWidth:a}=n,{clientWidth:l}=r;r.scrollLeft=o-(l-a)/2}},[])}const Ll={root:kr("relative flex-row items-center rounded-sm",{variants:{tabLayout:{fit:"inline-flex",fixed:"flex w-full"}}}),pill:kr("pointer-events-none absolute top-0 left-0 z-0 rounded-sm",{variants:{disabled:{true:"bg-base-transparent-pressed",false:"bg-muted-transparent"},isReady:{true:"transition-[transform,width] duration-250 ease-in-out",false:"transition-none"}}}),item:kr("z-10 flex cursor-pointer flex-row items-center justify-center rounded-sm px-16 py-8 select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed",{variants:{selected:{true:"body-2-semi-bold",false:"body-2"},disabled:{true:"text-muted",false:""}},compoundVariants:[{selected:!0,disabled:!1,className:"text-base"},{selected:!1,disabled:!1,className:"text-muted hover:text-muted-hover"}]}),scrollArea:kr("relative rounded-sm",{variants:{appearance:{background:"bg-surface","no-background":"bg-transparent"},tabLayout:{fit:"",fixed:"w-full"}}}),arrow:kr("absolute inset-y-0 z-20 flex cursor-pointer items-center justify-center rounded-sm py-8 text-muted transition-opacity duration-200 hover:text-muted-hover",{variants:{visible:{true:"opacity-100",false:"pointer-events-none opacity-0"},side:{left:"left-0 pr-16 pl-8",right:"right-0 pr-8 pl-16"}}})};function J2(e,t){return`linear-gradient(to right, ${e?"transparent 0px, transparent 40px, black 72px":"black 0px"}, ${t?"black calc(100% - 72px), transparent calc(100% - 40px), transparent 100%":"black 100%"})`}function fw({side:e,icon:t,visible:r,onClick:n}){return v.jsx("button",{type:"button","aria-hidden":!0,tabIndex:-1,disabled:!r,onClick:n,className:Ll.arrow({visible:r,side:e}),children:v.jsx(t,{size:20})})}function Z2({appearance:e,tabLayout:t,className:r,selectedIndex:n,children:o,...a}){const l=x.useRef(null),{canScrollLeft:u,canScrollRight:d,scrollBy:p}=K2(l);Q2(l,n);const h=u||d?J2(u,d):void 0;return v.jsxs("div",{...a,className:Qt(Ll.scrollArea({appearance:e,tabLayout:t}),r),children:[v.jsx("div",{ref:l,className:"scrollbar-none overflow-x-auto",style:h?{maskImage:h,WebkitMaskImage:h}:void 0,children:o}),v.jsx(fw,{side:"left",icon:W2,visible:u,onClick:()=>p("left")}),v.jsx(fw,{side:"right",icon:Nd,visible:d,onClick:()=>p("right")})]})}function e5({layout:e,isReady:t,disabled:r}){return v.jsx("div",{"aria-hidden":!0,className:Ll.pill({disabled:r,isReady:t}),style:{width:e.width,height:e.height,transform:`translateX(${e.x}px)`}})}function t5({tabLayout:e,disabled:t,selectedIndex:r,children:n}){const o=x.useRef(null),{pill:a,isReady:l}=X2({ref:o,selectedIndex:r,children:n});return v.jsxs("div",{ref:o,role:"radiogroup","aria-disabled":t,className:Ll.root({tabLayout:e}),children:[n,v.jsx(e5,{layout:a,isReady:l,disabled:t})]})}function pw({value:e,children:t,icon:r,trailingContent:n,onClick:o,className:a,disabled:l,...u}){const{selectedValue:d,onSelectedChange:p,disabled:h,tabLayout:m}=G2(),y=d===e,w=x.useMemo(()=>!!(l||h),[l,h]);return v.jsx("button",{type:"button",role:"radio","aria-checked":y,"aria-disabled":w,disabled:w,onClick:E=>{w||(p(e),o?.(E))},className:Qt(Ll.item({selected:y,disabled:w}),m==="fixed"&&"min-w-0 flex-1",a),...u,children:v.jsxs("span",{className:"inline-flex min-w-0 items-center justify-center gap-8",children:[r&&v.jsx(r,{size:16,className:"shrink-0"}),v.jsx("span",{className:"min-w-0 truncate",children:t}),n]})})}function r5({selectedValue:e,onSelectedChange:t,children:r,className:n,disabled:o,appearance:a="background",tabLayout:l="fixed",...u}){const d=Ks({consumerName:"SegmentedControl",mergeWith:{disabled:o}}),p=Y2(e,r);return v.jsx(H2,{value:{selectedValue:e,onSelectedChange:h=>t(h),disabled:d,tabLayout:l},children:v.jsx(Z2,{...u,appearance:a,tabLayout:l,className:n,selectedIndex:p,children:v.jsx(t5,{tabLayout:l,disabled:d,selectedIndex:p,children:r})})})}const n5={md:16,sm:12},bg=({icon:e,size:t="md",...r})=>{const n=e,o=n5[t];return v.jsx(sj,{...r,size:t,variant:"tag",consumerName:"Tag",leadingContent:n?v.jsx(n,{size:o}):void 0})},gd={light:"light",dark:"dark",system:"system"},i5=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",o5=e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},s5=()=>()=>{},a5=e=>{const t=e===gd.system;return x.useSyncExternalStore(t?o5:s5,t?i5:()=>e,()=>"light")},l5=e=>{x.useLayoutEffect(()=>{const t=window.document.documentElement;t.classList.remove(gd.light,gd.dark),t.classList.add(e)},[e])},[c5,u5]=Cd("ThemeProvider"),d5=({children:e,colorScheme:t=gd.system,locale:r})=>{const n=a5(t);l5(n);const o=x.useMemo(()=>({colorScheme:n}),[n]);return v.jsx(c5,{value:o,children:v.jsx(EO,{locale:r,children:e})})},f5=()=>u5({consumerName:"useTheme",contextRequired:!0}),p5=pt("ArrowDown",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12.667V3.333m3.334 5.994-3.34 3.333-3.34-3.34"})})),fR=pt("ArrowUp",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 3.333v9.334m-3.334-6L8 3.327l3.333 3.333"})})),pR=pt("Copy",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M10 4v-.667C10 2.6 9.4 2 8.667 2H3.333C2.593 2 2 2.6 2 3.333v5.334C2 9.407 2.593 10 3.333 10H4m2-2.667v5.334C6 13.403 6.597 14 7.333 14h5.334c.736 0 1.333-.597 1.333-1.333V7.333C14 6.597 13.403 6 12.667 6H7.333C6.597 6 6 6.597 6 7.333"})})),h5=pt("Devices",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M6.667 14H3.333C2.593 14 2 13.4 2 12.667V3.333C2 2.593 2.593 2 3.333 2H10c.733 0 1.333.593 1.333 1.333v1.334m-.666 7.66H12M12.8 14H9.867a1.2 1.2 0 0 1-1.2-1.2V7.867c0-.667.533-1.2 1.2-1.2H12.8c.66 0 1.2.533 1.2 1.2V12.8c0 .66-.54 1.2-1.2 1.2"})})),hR=pt("Download",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M5.63 7.407 8 9.778l2.37-2.37M8 9.777V2.667m5.333 8.296a2.37 2.37 0 0 1-2.37 2.37H5.037a2.37 2.37 0 0 1-2.37-2.37"})})),mR=pt("Flex",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M12.017 14v.65h1.3V14h-1.3m-9.334 0v.65h1.3V14h-1.3m2.817-.65h-.65v1.3h.65v-1.3m5 1.3h.65v-1.3h-.65v1.3m-5-1.967a.65.65 0 1 0 0 1.3v-1.3m5 1.3a.65.65 0 1 0 0-1.3v1.3m2.167.017h.65V6.667h-1.3V14zm0-7.333h.65v-2h-1.3v2zm0-2h.65V4h-1.3v.667zm-2-2.667v-.65H5.333v1.3h5.334zM3.333 4h-.65v10h1.3V4zm2-2v-.65A2.65 2.65 0 0 0 2.683 4h1.3c0-.746.605-1.35 1.35-1.35zm7.334 2h.65a2.65 2.65 0 0 0-2.65-2.65v1.3c.745 0 1.35.604 1.35 1.35zm0 .667v.65h.466v-1.3h-.466zm.6.133h-.65v1.733h1.3V4.8zm-.134 1.867v-.65h-.466v1.3h.466zm.134-.134h-.65c0-.285.231-.516.516-.516v1.3c.433 0 .784-.351.784-.784zm-.134-1.866v.65a.517.517 0 0 1-.516-.517h1.3a.783.783 0 0 0-.784-.783zM5.5 14v.65h5v-1.3h-5zm0-.667v.65h5v-1.3h-5z"})})),m5=pt("Moon",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M13.133 10c-1.666.533-3.6.2-4.933-1.133-1.667-1.667-1.8-4.334-.467-6.2C5 2.933 2.867 5.2 2.867 8c0 2.933 2.4 5.333 5.333 5.333 2.2 0 4.133-1.4 4.933-3.333",clipRule:"evenodd"})})),Vu=pt("Nano",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M11.333 11.944a.279.279 0 0 0 .556 0 .28.28 0 0 0-.278-.277.28.28 0 0 0-.278.283M6.172 8 3.236 5.064a.333.333 0 0 1 0-.471l2.357-2.357c.13-.13.341-.13.471 0L11.83 8m-9.536 6H12a2 2 0 1 0 0-4H2.293a.293.293 0 0 0-.293.293v3.414c0 .162.131.293.293.293"})})),gR=pt("NanoGen5",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 1.333c.92 0 1.667.747 1.667 1.667v.333c.184 0 .333.15.333.334v1.666a.334.334 0 0 1-.266.327l-.067.007V13c0 .92-.746 1.667-1.667 1.667H5c-.92 0-1.667-.746-1.667-1.667V3c0-.92.747-1.667 1.667-1.667zM9.667 12.667a.667.667 0 0 0 0 1.333H11a.667.667 0 0 0 0-1.333zM5 2.333A.667.667 0 0 0 4.333 3v8c0 .368.299.667.667.667h6a.667.667 0 0 0 .667-.667V3A.667.667 0 0 0 11 2.333z",clipRule:"evenodd"})})),g5=pt("Screens",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M5.332 1.998h5.336m-6.67 2.5h8.004m.233 9.505h-8.47a1.334 1.334 0 0 1-1.327-1.2l-.434-4.336A1.334 1.334 0 0 1 3.331 7h9.338a1.334 1.334 0 0 1 1.327 1.467l-.434 4.335a1.334 1.334 0 0 1-1.327 1.2"})})),v5=pt("Send",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 2v9.334M13.332 14H2.667m1.999-8.666L8 2l3.333 3.334"})})),mv=pt("SparksFill",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M8 1.333a.333.333 0 0 0-.667 0v.223c0 .39-.145.76-.398 1.029A1.28 1.28 0 0 1 6 3a.333.333 0 1 0 0 .667c.346 0 .683.146.935.415.253.27.398.64.398 1.03v.221a.333.333 0 1 0 .667 0v-.222c0-.39.145-.76.398-1.029.252-.269.589-.415.935-.415a.333.333 0 1 0 0-.667c-.346 0-.683-.147-.935-.415A1.5 1.5 0 0 1 8 1.555zM12 5.267a.333.333 0 1 0-.667 0c0 .55-.213 1.077-.589 1.464a1.97 1.97 0 0 1-1.41.602.333.333 0 0 0 0 .667c.527 0 1.034.215 1.41.602s.59.914.59 1.465a.333.333 0 0 0 .666 0c0-.551.213-1.078.59-1.465A1.97 1.97 0 0 1 14 8a.333.333 0 0 0 0-.667 1.97 1.97 0 0 1-1.41-.602A2.1 2.1 0 0 1 12 5.267M6 7.333a.333.333 0 0 0-.667 0A3.333 3.333 0 0 1 2 10.667a.333.333 0 1 0 0 .666 3.333 3.333 0 0 1 3.333 3.334.333.333 0 0 0 .667 0 3.334 3.334 0 0 1 3.333-3.334.333.333 0 1 0 0-.666A3.333 3.333 0 0 1 6 7.333"})})),vR=pt("Stax",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",d:"M12 4.667h.467c.073 0 .133.06.133.133v1.733c0 .074-.06.134-.133.134H12M4.333 14h6.334c.736 0 1.333-.597 1.333-1.333V3.333C12 2.597 11.403 2 10.667 2H4.333A.333.333 0 0 0 4 2.333v11.334c0 .184.15.333.333.333Z"})})),y5=pt("Sun",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 2.667V1.333m0 13.334v-1.334m4.24-9.573.473-.473m-9.426 9.426.473-.473M13.333 8h1.334M1.333 8h1.334m9.573 4.24.473.473M3.287 3.287l.473.473m6.597 1.883a3.333 3.333 0 1 1-4.714 4.714 3.333 3.333 0 0 1 4.714-4.714"})})),yR=pt("Trash",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M12.333 4.333v8.334A1.333 1.333 0 0 1 11 14H5a1.334 1.334 0 0 1-1.333-1.333V4.333m9.666 0H2.667m6.666 7v-4m-2.666 4v-4m-1-3V3a1 1 0 0 1 1-1h2.666a1 1 0 0 1 1 1v1"})})),b5=pt("Unlink",v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",children:v.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m11.403 8.36 1.458-1.458a2.75 2.75 0 0 0-3.889-3.89L7.514 4.472M5.5 10.374l1.25-1.25m2.5-2.5 1.25-1.25m2.187 7.187L3.313 3.187m1.284 4.201L3.139 8.846a2.75 2.75 0 1 0 3.889 3.89l1.458-1.459"})})),vt=({label:e,side:t="top",className:r="",children:n})=>v.jsxs(YC,{children:[v.jsx(KC,{asChild:!0,children:v.jsx("span",{className:`flex ${r}`,children:n})}),v.jsx(QC,{side:t,children:e})]}),bR=x.createContext(null),xg=x.createContext(!0),xR=x.createContext(!0),wR="AI debugging is not available here yet. Use the DevTools desktop app.",SR=({label:e,detail:t,onClear:r,onExplain:n})=>{const o=x.useContext(bR),a=x.useContext(xg),l=x.useContext(xR);if(!a)return null;const u=v.jsxs("button",{type:"button",onClick:n,disabled:!l,className:"flex cursor-pointer items-center gap-6 rounded-sm bg-accent px-12 py-6 body-3-semi-bold text-on-accent hover:bg-accent-hover disabled:pointer-events-none disabled:bg-muted-transparent disabled:text-disabled",children:[v.jsx(mv,{size:16}),"Explain with AI"]}),d=v.jsxs("div",{className:"flex shrink-0 items-center gap-10 border-t border-muted-subtle bg-surface px-12 py-8",children:[v.jsx("span",{className:"body-3-semi-bold",children:e}),v.jsx("span",{className:"truncate body-4 text-muted",children:t}),v.jsx("span",{className:"flex-1"}),v.jsx("button",{type:"button",onClick:r,className:"cursor-pointer rounded-sm bg-muted-transparent px-12 py-6 body-3-semi-bold hover:bg-muted-transparent-hover",children:"Clear"}),l?u:v.jsx(vt,{label:wR,children:u})]});return o?Lr.createPortal(d,o):d};var ji=(e=>(e.logs="logs",e.inspector="inspector",e))(ji||{});const x5=({size:e=16,className:t})=>v.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",className:t,children:[v.jsx("rect",{x:"2",y:"2.5",width:"12",height:"11",rx:"1.5"}),v.jsx("path",{d:"M6 2.5v11"})]}),hw=({connected:e})=>v.jsx("span",{className:`size-8 shrink-0 rounded-full ${e?"bg-(--color-light-green-500)":"bg-(--color-light-yellow-500)"}`,title:e?"Connected":"Not connected"}),w5=({currentScreen:e,onScreenChange:t,aiOpen:r,onToggleAi:n,aiAvailable:o,sessions:a,liveScreen:l,isLoggerConnected:u,isInspectorConnected:d,mockServerWebsiteUrl:p,colorScheme:h,onColorSchemeChange:m})=>{const y=h==="dark"?"light":"dark";return v.jsxs("div",{className:"flex shrink-0 items-center gap-16 border-b border-muted-subtle px-12 py-8",children:[v.jsxs(r5,{selectedValue:e,onSelectedChange:w=>t(w),tabLayout:"fixed",className:"w-256 shrink-0 bg-muted-transparent","aria-label":"Screen",children:[v.jsx(pw,{value:"logs",trailingContent:v.jsx(hw,{connected:u}),children:"Logger"}),v.jsx(pw,{value:"inspector",trailingContent:v.jsx(hw,{connected:d}),children:"Inspector"})]}),v.jsxs("div",{className:"ml-auto flex items-center gap-6",children:[a&&v.jsx(vt,{label:a.shown?"Hide the sessions menu":"Show the sessions menu",side:"bottom",children:v.jsx(sr,{"aria-label":a.shown?"Hide the sessions menu":"Show the sessions menu","aria-pressed":a.shown,icon:x5,size:"xs",appearance:"transparent",className:`rounded-sm ${a.shown?"bg-active-subtle [&>svg]:text-active":""}`,onClick:a.onToggle})}),l&&v.jsx(vt,{label:l.shown?"Hide the live screen":"Show the live screen",side:"bottom",children:v.jsx(sr,{"aria-label":l.shown?"Hide the live screen":"Show the live screen","aria-pressed":l.shown,icon:g5,size:"xs",appearance:"transparent",className:`rounded-sm ${l.shown?"bg-active-subtle [&>svg]:text-active":""}`,onClick:l.onToggle})}),v.jsx(vt,{label:o?r?"Hide the AI panel":"Show the AI panel":wR,side:"bottom",children:v.jsx(sr,{"aria-label":r?"Hide the AI panel":"Show the AI panel","aria-pressed":r,icon:mv,size:"xs",appearance:"transparent",className:`rounded-sm disabled:pointer-events-none ${r?"bg-active-subtle [&>svg]:text-active":""}`,onClick:n,disabled:!o})}),p&&v.jsx(vt,{label:"Open the mock server website",side:"bottom",children:v.jsx(sr,{"aria-label":"Open the mock server website",icon:ij,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:()=>window.open(p,"_blank","noopener")})}),v.jsx(vt,{label:`Switch to ${y} theme`,side:"bottom",children:v.jsx(sr,{"aria-label":`Switch to ${y} theme`,icon:h==="dark"?y5:m5,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:()=>m(y)})})]})]})},Es={CONNECTED_DEVICES_UPDATE:"connectedDevicesUpdate",DEVICE_SESSION_STATE_UPDATE:"deviceSessionStateUpdate",PROVIDER_VALUE:"providerValue",APDU_RESPONSE:"apduResponse",DISCOVERED_DEVICES_UPDATE:"discoveredDevicesUpdate",MOCK_SERVER_CONFIG:"mockServerConfig"},Fi={SEND_APDU:"sendApdu",GET_PROVIDER:"getProvider",SET_PROVIDER:"setProvider",START_LISTENING_DEVICES:"startListeningDevices",STOP_LISTENING_DEVICES:"stopListeningDevices",START_DISCOVERING:"startDiscovering",STOP_DISCOVERING:"stopDiscovering",CONNECT_DEVICE:"connectDevice"},mw={LOGGER:"logger",DMK_INSPECTOR:"dmk-inspector"},S5="moduleConnected";var gw;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof self=="object"||typeof self=="object"?self:typeof this=="object"?this:u(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(d,p){return function(h,m){Object.defineProperty(d,h,{configurable:!0,writable:!0,value:m}),p&&p(h,m)}}function a(){try{return Function("return this;")()}catch{}}function l(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return a()||l()}})(function(t,r){var n=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",a=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",l=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",d={__proto__:[]}instanceof Array,p=!u&&!d,h={create:u?function(){return rt(Object.create(null))}:d?function(){return rt({__proto__:null})}:function(){return rt({})},has:p?function(q,Q){return n.call(q,Q)}:function(q,Q){return Q in q},get:p?function(q,Q){return n.call(q,Q)?q[Q]:void 0}:function(q,Q){return q[Q]}},m=Object.getPrototypeOf(Function),y=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:jt(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Wt(),E=typeof WeakMap=="function"?WeakMap:bt(),S=o?Symbol.for("@reflect-metadata:registry"):void 0,C=Je(),R=ht(C);function k(q,Q,ie,se){if(M(ie)){if(!qe(q))throw new TypeError;if(!we(Q))throw new TypeError;return ne(q,Q)}else{if(!qe(q))throw new TypeError;if(!G(Q))throw new TypeError;if(!G(se)&&!M(se)&&!te(se))throw new TypeError;return te(se)&&(se=void 0),ie=ge(ie),X(q,Q,ie,se)}}t("decorate",k);function $(q,Q){function ie(se,Ce){if(!G(se))throw new TypeError;if(!M(Ce)&&!ze(Ce))throw new TypeError;L(q,Q,se,Ce)}return ie}t("metadata",$);function A(q,Q,ie,se){if(!G(ie))throw new TypeError;return M(se)||(se=ge(se)),L(q,Q,ie,se)}t("defineMetadata",A);function D(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),F(q,Q,ie)}t("hasMetadata",D);function N(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),V(q,Q,ie)}t("hasOwnMetadata",N);function P(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),H(q,Q,ie)}t("getMetadata",P);function I(q,Q,ie){if(!G(Q))throw new TypeError;return M(ie)||(ie=ge(ie)),O(q,Q,ie)}t("getOwnMetadata",I);function re(q,Q){if(!G(q))throw new TypeError;return M(Q)||(Q=ge(Q)),U(q,Q)}t("getMetadataKeys",re);function Z(q,Q){if(!G(q))throw new TypeError;return M(Q)||(Q=ge(Q)),z(q,Q)}t("getOwnMetadataKeys",Z);function ee(q,Q,ie){if(!G(Q))throw new TypeError;if(M(ie)||(ie=ge(ie)),!G(Q))throw new TypeError;M(ie)||(ie=ge(ie));var se=Vt(Q,ie,!1);return M(se)?!1:se.OrdinaryDeleteMetadata(q,Q,ie)}t("deleteMetadata",ee);function ne(q,Q){for(var ie=q.length-1;ie>=0;--ie){var se=q[ie],Ce=se(Q);if(!M(Ce)&&!te(Ce)){if(!we(Ce))throw new TypeError;Q=Ce}}return Q}function X(q,Q,ie,se){for(var Ce=q.length-1;Ce>=0;--Ce){var Ve=q[Ce],Qe=Ve(Q,ie,se);if(!M(Qe)&&!te(Qe)){if(!G(Qe))throw new TypeError;se=Qe}}return se}function F(q,Q,ie){var se=V(q,Q,ie);if(se)return!0;var Ce=oe(Q);return te(Ce)?!1:F(q,Ce,ie)}function V(q,Q,ie){var se=Vt(Q,ie,!1);return M(se)?!1:pe(se.OrdinaryHasOwnMetadata(q,Q,ie))}function H(q,Q,ie){var se=V(q,Q,ie);if(se)return O(q,Q,ie);var Ce=oe(Q);if(!te(Ce))return H(q,Ce,ie)}function O(q,Q,ie){var se=Vt(Q,ie,!1);if(!M(se))return se.OrdinaryGetOwnMetadata(q,Q,ie)}function L(q,Q,ie,se){var Ce=Vt(ie,se,!0);Ce.OrdinaryDefineOwnMetadata(q,Q,ie,se)}function U(q,Q){var ie=z(q,Q),se=oe(q);if(se===null)return ie;var Ce=U(se,Q);if(Ce.length<=0)return ie;if(ie.length<=0)return Ce;for(var Ve=new w,Qe=[],Pe=0,he=ie;Pe<he.length;Pe++){var ve=he[Pe],ye=Ve.has(ve);ye||(Ve.add(ve),Qe.push(ve))}for(var xe=0,Ue=Ce;xe<Ue.length;xe++){var ve=Ue[xe],ye=Ve.has(ve);ye||(Ve.add(ve),Qe.push(ve))}return Qe}function z(q,Q){var ie=Vt(q,Q,!1);return ie?ie.OrdinaryOwnMetadataKeys(q,Q):[]}function T(q){if(q===null)return 1;switch(typeof q){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return q===null?1:6;default:return 6}}function M(q){return q===void 0}function te(q){return q===null}function le(q){return typeof q=="symbol"}function G(q){return typeof q=="object"?q!==null:typeof q=="function"}function fe(q,Q){switch(T(q)){case 0:return q;case 1:return q;case 2:return q;case 3:return q;case 4:return q;case 5:return q}var ie="string",se=tt(q,a);if(se!==void 0){var Ce=se.call(q,ie);if(G(Ce))throw new TypeError;return Ce}return be(q)}function be(q,Q){var ie,se,Ce;{var Ve=q.toString;if(Xe(Ve)){var se=Ve.call(q);if(!G(se))return se}var ie=q.valueOf;if(Xe(ie)){var se=ie.call(q);if(!G(se))return se}}throw new TypeError}function pe(q){return!!q}function ue(q){return""+q}function ge(q){var Q=fe(q);return le(Q)?Q:ue(Q)}function qe(q){return Array.isArray?Array.isArray(q):q instanceof Object?q instanceof Array:Object.prototype.toString.call(q)==="[object Array]"}function Xe(q){return typeof q=="function"}function we(q){return typeof q=="function"}function ze(q){switch(T(q)){case 3:return!0;case 4:return!0;default:return!1}}function We(q,Q){return q===Q||q!==q&&Q!==Q}function tt(q,Q){var ie=q[Q];if(ie!=null){if(!Xe(ie))throw new TypeError;return ie}}function De(q){var Q=tt(q,l);if(!Xe(Q))throw new TypeError;var ie=Q.call(q);if(!G(ie))throw new TypeError;return ie}function Fe(q){return q.value}function ct(q){var Q=q.next();return Q.done?!1:Q}function Ne(q){var Q=q.return;Q&&Q.call(q)}function oe(q){var Q=Object.getPrototypeOf(q);if(typeof q!="function"||q===m||Q!==m)return Q;var ie=q.prototype,se=ie&&Object.getPrototypeOf(ie);if(se==null||se===Object.prototype)return Q;var Ce=se.constructor;return typeof Ce!="function"||Ce===q?Q:Ce}function Se(){var q;!M(S)&&typeof r.Reflect<"u"&&!(S in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(q=Ut(r.Reflect));var Q,ie,se,Ce=new E,Ve={registerProvider:Qe,getProvider:he,setProvider:ye};return Ve;function Qe(xe){if(!Object.isExtensible(Ve))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case q===xe:break;case M(Q):Q=xe;break;case Q===xe:break;case M(ie):ie=xe;break;case ie===xe:break;default:se===void 0&&(se=new w),se.add(xe);break}}function Pe(xe,Ue){if(!M(Q)){if(Q.isProviderFor(xe,Ue))return Q;if(!M(ie)){if(ie.isProviderFor(xe,Ue))return Q;if(!M(se))for(var Ze=De(se);;){var dt=ct(Ze);if(!dt)return;var Ht=Fe(dt);if(Ht.isProviderFor(xe,Ue))return Ne(Ze),Ht}}}if(!M(q)&&q.isProviderFor(xe,Ue))return q}function he(xe,Ue){var Ze=Ce.get(xe),dt;return M(Ze)||(dt=Ze.get(Ue)),M(dt)&&(dt=Pe(xe,Ue),M(dt)||(M(Ze)&&(Ze=new y,Ce.set(xe,Ze)),Ze.set(Ue,dt))),dt}function ve(xe){if(M(xe))throw new TypeError;return Q===xe||ie===xe||!M(se)&&se.has(xe)}function ye(xe,Ue,Ze){if(!ve(Ze))throw new Error("Metadata provider not registered.");var dt=he(xe,Ue);if(dt!==Ze){if(!M(dt))return!1;var Ht=Ce.get(xe);M(Ht)&&(Ht=new y,Ce.set(xe,Ht)),Ht.set(Ue,Ze)}return!0}}function Je(){var q;return!M(S)&&G(r.Reflect)&&Object.isExtensible(r.Reflect)&&(q=r.Reflect[S]),M(q)&&(q=Se()),!M(S)&&G(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,S,{enumerable:!1,configurable:!1,writable:!1,value:q}),q}function ht(q){var Q=new E,ie={isProviderFor:function(ve,ye){var xe=Q.get(ve);return M(xe)?!1:xe.has(ye)},OrdinaryDefineOwnMetadata:Qe,OrdinaryHasOwnMetadata:Ce,OrdinaryGetOwnMetadata:Ve,OrdinaryOwnMetadataKeys:Pe,OrdinaryDeleteMetadata:he};return C.registerProvider(ie),ie;function se(ve,ye,xe){var Ue=Q.get(ve),Ze=!1;if(M(Ue)){if(!xe)return;Ue=new y,Q.set(ve,Ue),Ze=!0}var dt=Ue.get(ye);if(M(dt)){if(!xe)return;if(dt=new y,Ue.set(ye,dt),!q.setProvider(ve,ye,ie))throw Ue.delete(ye),Ze&&Q.delete(ve),new Error("Wrong provider for target.")}return dt}function Ce(ve,ye,xe){var Ue=se(ye,xe,!1);return M(Ue)?!1:pe(Ue.has(ve))}function Ve(ve,ye,xe){var Ue=se(ye,xe,!1);if(!M(Ue))return Ue.get(ve)}function Qe(ve,ye,xe,Ue){var Ze=se(xe,Ue,!0);Ze.set(ve,ye)}function Pe(ve,ye){var xe=[],Ue=se(ve,ye,!1);if(M(Ue))return xe;for(var Ze=Ue.keys(),dt=De(Ze),Ht=0;;){var Zr=ct(dt);if(!Zr)return xe.length=Ht,xe;var en=Fe(Zr);try{xe[Ht]=en}catch(hi){try{Ne(dt)}finally{throw hi}}Ht++}}function he(ve,ye,xe){var Ue=se(ye,xe,!1);if(M(Ue)||!Ue.delete(ve))return!1;if(Ue.size===0){var Ze=Q.get(ye);M(Ze)||(Ze.delete(xe),Ze.size===0&&Q.delete(Ze))}return!0}}function Ut(q){var Q=q.defineMetadata,ie=q.hasOwnMetadata,se=q.getOwnMetadata,Ce=q.getOwnMetadataKeys,Ve=q.deleteMetadata,Qe=new E,Pe={isProviderFor:function(he,ve){var ye=Qe.get(he);return!M(ye)&&ye.has(ve)?!0:Ce(he,ve).length?(M(ye)&&(ye=new w,Qe.set(he,ye)),ye.add(ve),!0):!1},OrdinaryDefineOwnMetadata:Q,OrdinaryHasOwnMetadata:ie,OrdinaryGetOwnMetadata:se,OrdinaryOwnMetadataKeys:Ce,OrdinaryDeleteMetadata:Ve};return Pe}function Vt(q,Q,ie){var se=C.getProvider(q,Q);if(!M(se))return se;if(ie){if(C.setProvider(q,Q,R))return R;throw new Error("Illegal state.")}}function jt(){var q={},Q=[],ie=(function(){function Pe(he,ve,ye){this._index=0,this._keys=he,this._values=ve,this._selector=ye}return Pe.prototype["@@iterator"]=function(){return this},Pe.prototype[l]=function(){return this},Pe.prototype.next=function(){var he=this._index;if(he>=0&&he<this._keys.length){var ve=this._selector(this._keys[he],this._values[he]);return he+1>=this._keys.length?(this._index=-1,this._keys=Q,this._values=Q):this._index++,{value:ve,done:!1}}return{value:void 0,done:!0}},Pe.prototype.throw=function(he){throw this._index>=0&&(this._index=-1,this._keys=Q,this._values=Q),he},Pe.prototype.return=function(he){return this._index>=0&&(this._index=-1,this._keys=Q,this._values=Q),{value:he,done:!0}},Pe})(),se=(function(){function Pe(){this._keys=[],this._values=[],this._cacheKey=q,this._cacheIndex=-2}return Object.defineProperty(Pe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Pe.prototype.has=function(he){return this._find(he,!1)>=0},Pe.prototype.get=function(he){var ve=this._find(he,!1);return ve>=0?this._values[ve]:void 0},Pe.prototype.set=function(he,ve){var ye=this._find(he,!0);return this._values[ye]=ve,this},Pe.prototype.delete=function(he){var ve=this._find(he,!1);if(ve>=0){for(var ye=this._keys.length,xe=ve+1;xe<ye;xe++)this._keys[xe-1]=this._keys[xe],this._values[xe-1]=this._values[xe];return this._keys.length--,this._values.length--,We(he,this._cacheKey)&&(this._cacheKey=q,this._cacheIndex=-2),!0}return!1},Pe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=q,this._cacheIndex=-2},Pe.prototype.keys=function(){return new ie(this._keys,this._values,Ce)},Pe.prototype.values=function(){return new ie(this._keys,this._values,Ve)},Pe.prototype.entries=function(){return new ie(this._keys,this._values,Qe)},Pe.prototype["@@iterator"]=function(){return this.entries()},Pe.prototype[l]=function(){return this.entries()},Pe.prototype._find=function(he,ve){if(!We(this._cacheKey,he)){this._cacheIndex=-1;for(var ye=0;ye<this._keys.length;ye++)if(We(this._keys[ye],he)){this._cacheIndex=ye;break}}return this._cacheIndex<0&&ve&&(this._cacheIndex=this._keys.length,this._keys.push(he),this._values.push(void 0)),this._cacheIndex},Pe})();return se;function Ce(Pe,he){return Pe}function Ve(Pe,he){return he}function Qe(Pe,he){return[Pe,he]}}function Wt(){var q=(function(){function Q(){this._map=new y}return Object.defineProperty(Q.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Q.prototype.has=function(ie){return this._map.has(ie)},Q.prototype.add=function(ie){return this._map.set(ie,ie),this},Q.prototype.delete=function(ie){return this._map.delete(ie)},Q.prototype.clear=function(){this._map.clear()},Q.prototype.keys=function(){return this._map.keys()},Q.prototype.values=function(){return this._map.keys()},Q.prototype.entries=function(){return this._map.entries()},Q.prototype["@@iterator"]=function(){return this.keys()},Q.prototype[l]=function(){return this.keys()},Q})();return q}function bt(){var q=16,Q=h.create(),ie=se();return(function(){function he(){this._key=se()}return he.prototype.has=function(ve){var ye=Ce(ve,!1);return ye!==void 0?h.has(ye,this._key):!1},he.prototype.get=function(ve){var ye=Ce(ve,!1);return ye!==void 0?h.get(ye,this._key):void 0},he.prototype.set=function(ve,ye){var xe=Ce(ve,!0);return xe[this._key]=ye,this},he.prototype.delete=function(ve){var ye=Ce(ve,!1);return ye!==void 0?delete ye[this._key]:!1},he.prototype.clear=function(){this._key=se()},he})();function se(){var he;do he="@@WeakMap@@"+Pe();while(h.has(Q,he));return Q[he]=!0,he}function Ce(he,ve){if(!n.call(he,ie)){if(!ve)return;Object.defineProperty(he,ie,{value:h.create()})}return he[ie]}function Ve(he,ve){for(var ye=0;ye<ve;++ye)he[ye]=Math.random()*255|0;return he}function Qe(he){if(typeof Uint8Array=="function"){var ve=new Uint8Array(he);return typeof crypto<"u"?crypto.getRandomValues(ve):typeof msCrypto<"u"?msCrypto.getRandomValues(ve):Ve(ve,he),ve}return Ve(new Array(he),he)}function Pe(){var he=Qe(q);he[6]=he[6]&79|64,he[8]=he[8]&191|128;for(var ve="",ye=0;ye<q;++ye){var xe=he[ye];(ye===4||ye===6||ye===8)&&(ve+="-"),xe<16&&(ve+="0"),ve+=xe.toString(16).toLowerCase()}return ve}}function rt(q){return q.__=void 0,delete q.__,q}})})(gw||(gw={}));let E5=class{cla;ins;p1;p2;data;constructor(t,r,n,o,a){this.cla=t,this.ins=r,this.p1=n,this.p2=o,this.data=a??new Uint8Array}getRawApdu(){const t=Uint8Array.from([this.cla,this.ins,this.p1,this.p2,this.data.length]),r=new Uint8Array(t.length+this.data.length);return r.set(t,0),this.data.length>0&&r.set(this.data,t.length),r}};function vw(e){if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)return new Uint8Array;if(e.length%2!==0&&(e="0"+e),/^[0-9a-fA-F]*$/.test(e)===!1)return null;const t=e.match(/.{1,2}/g)?.map(r=>parseInt(r,16));return!t||t.some(isNaN)?null:new Uint8Array(t)}function si(e,t=!0){return`${t?"0x":""}${Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}`}let mh=class{_tag="ValueOverflow";originalError;message;constructor(t,r=ER){this.message=`Value overflow for ${t}, max is ${r}`}},$u=class{_tag="DataOverflow";message;originalError;constructor(t,r=0){this.message=r===0?`this.data is already full (value: ${t})`:`this.data will overflow with "${t}", remaining bytes: ${r}`}},yw=class{_tag="HexaString";message;originalError;constructor(t){this.message=`Invalid encoded hexa string or length is null: ${t}`}};const C5=4294967295;let k5=class{constructor(t=C5){this.maxPayloadSize=t}data=new Uint8Array;errors=[];build=()=>this.data;tryBuild=()=>this.hasErrors()?void 0:this.data;add8BitUIntToData=t=>this.addNumberToData(t,8n,!1,!1);add16BitUIntToData=(t,r=!0)=>this.addNumberToData(t,16n,!1,r);add32BitUIntToData=(t,r=!0)=>this.addNumberToData(t,32n,!1,r);add64BitUIntToData=(t,r=!0)=>this.addNumberToData(t,64n,!1,r);add128BitUIntToData=(t,r=!0)=>this.addNumberToData(t,128n,!1,r);add256BitUIntToData=(t,r=!0)=>this.addNumberToData(t,256n,!1,r);add16BitIntToData=(t,r=!0)=>this.addNumberToData(t,16n,!0,r);add32BitIntToData=(t,r=!0)=>this.addNumberToData(t,32n,!0,r);add64BitIntToData=(t,r=!0)=>this.addNumberToData(t,64n,!0,r);add128BitIntToData=(t,r=!0)=>this.addNumberToData(t,128n,!0,r);add256BitIntToData=(t,r=!0)=>this.addNumberToData(t,256n,!0,r);addBufferToData=t=>this.hasEnoughLengthRemaining(t)?(this.data=Uint8Array.from([...this.data,...t]),this):(this.errors.push(new $u(t.toString())),this);addHexaStringToData=t=>{const r=vw(t);return r===null||r.length===0?(this.errors.push(new yw(t)),this):(this.addBufferToData(r),this)};addAsciiStringToData=t=>{const r=new TextEncoder().encode(t);return this.addBufferToData(r),this};encodeInLVFromHexa=t=>{const r=vw(t);return r===null||r.length===0?(this.errors.push(new yw(t)),this):this.hasEnoughLengthRemaining(r,!0)?(this.add8BitUIntToData(r.length),this.addBufferToData(r),this):(this.errors.push(new $u(t)),this)};encodeInLVFromBuffer=t=>this.hasEnoughLengthRemaining(t,!0)?(this.add8BitUIntToData(t.length),this.addBufferToData(t),this):(this.errors.push(new $u(t.toString())),this);encodeInLVFromAscii=t=>this.hasEnoughLengthRemaining(t,!0)?(this.add8BitUIntToData(t.length),this.addAsciiStringToData(t),this):(this.errors.push(new $u(t)),this);encodeInTLVFromAscii=(t,r)=>(this.add8BitUIntToData(t),this.encodeInLVFromAscii(r));encodeInTLVFromHexa=(t,r)=>(this.add8BitUIntToData(t),this.encodeInLVFromHexa(r));encodeInTLVFromBuffer=(t,r)=>(this.add8BitUIntToData(t),this.encodeInLVFromBuffer(r));encodeInTLVFromUInt8=(t,r)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(1),this.add8BitUIntToData(r));encodeInTLVFromUInt16=(t,r,n=!0)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(2),this.add16BitUIntToData(r,n));encodeInTLVFromUInt32=(t,r,n=!0)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(4),this.add32BitUIntToData(r,n));encodeInTLVFromUInt64=(t,r,n=!0)=>(this.add8BitUIntToData(t),this.add8BitUIntToData(8),this.add64BitUIntToData(r,n));getAvailablePayloadLength=()=>this.maxPayloadSize-this.data.length;getErrors=()=>this.errors;hasErrors=()=>this.errors.length!==0;hasEnoughLengthRemaining=(t,r=!1)=>this.data.length+t.length+(r?1:0)<=this.maxPayloadSize;addNumberToData(t,r,n,o){let a=this.checkBoundsAndConvert(t,r,n);if(a===void 0)return this;const l=Number(r)/8,u=new Uint8Array(l);if(o)for(let d=l-1;d>=0;d--)u[d]=Number(a&0xffn),a>>=8n;else for(let d=0;d<l;d++)u[d]=Number(a&0xffn),a>>=8n;return this.addBufferToData(u)}checkBoundsAndConvert(t,r,n){if(typeof t=="number"){if(!Number.isInteger(t)||t>Number.MAX_SAFE_INTEGER){this.errors.push(new mh(t.toString()));return}t=BigInt(t)}if(n){const o=1n<<r-1n;if(t>=o||t<-o){this.errors.push(new mh(t.toString(),o-1n));return}if(t<0n){const a=(1n<<r)-1n;t=-t,t=(~t&a)+1n}}else{const o=1n<<r;if(t<0||t>=o){this.errors.push(new mh(t.toString(),o-1n));return}}return t}};const ER=255;let CR=class{_ins;_cla;_p1;p2;data=new k5(ER);constructor({ins:t,cla:r,p1:n,p2:o}){this._cla=r&255,this._ins=t&255,this._p1=n&255,this.p2=o&255}build=()=>new E5(this._cla,this._ins,this._p1,this.p2,this.data.build());add8BitUIntToData=t=>(this.data.add8BitUIntToData(t),this);add16BitUIntToData=t=>(this.data.add16BitUIntToData(t),this);add32BitUIntToData=t=>(this.data.add32BitUIntToData(t),this);add64BitUIntToData=(t,r=!0)=>(this.data.add64BitUIntToData(t,r),this);addBufferToData=t=>(this.data.addBufferToData(t),this);addHexaStringToData=t=>(this.data.addHexaStringToData(t),this);addAsciiStringToData=t=>(this.data.addAsciiStringToData(t),this);encodeInLVFromHexa=t=>(this.data.encodeInLVFromHexa(t),this);encodeInLVFromBuffer=t=>(this.data.encodeInLVFromBuffer(t),this);encodeInLVFromAscii=t=>(this.data.encodeInLVFromAscii(t),this);getAvailablePayloadLength=()=>this.data.getAvailablePayloadLength();getErrors=()=>this.data.getErrors()},R5=class{constructor(t){this.buffer=t}index=0;testMinimalLength(t){return t<=this.buffer.length-this.index}extract8BitUInt(){if(!this.outOfRange(1))return this.buffer[this.index++]}extract16BitUInt(t=!0){const r=this.extractNumber(16n,!1,t);return r===void 0?void 0:Number(r)}extract16BitInt(t=!0){const r=this.extractNumber(16n,!0,t);return r===void 0?void 0:Number(r)}extract32BitUInt(t=!0){const r=this.extractNumber(32n,!1,t);return r===void 0?void 0:Number(r)}extract32BitInt(t=!0){const r=this.extractNumber(32n,!0,t);return r===void 0?void 0:Number(r)}extract64BitUInt(t=!0){return this.extractNumber(64n,!1,t)}extract64BitInt(t=!0){return this.extractNumber(64n,!0,t)}extract128BitUInt(t=!0){return this.extractNumber(128n,!1,t)}extract128BitInt(t=!0){return this.extractNumber(128n,!0,t)}extract256BitUInt(t=!0){return this.extractNumber(256n,!1,t)}extract256BitInt(t=!0){return this.extractNumber(256n,!0,t)}extractFieldByLength(t){if(this.outOfRange(t))return;if(t===0)return new Uint8Array;const r=this.buffer.slice(this.index,this.index+t);return this.index+=t,r}extractFieldLVEncoded(){const t=this.extract8BitUInt();if(t===void 0)return;if(t===0)return new Uint8Array;const r=this.extractFieldByLength(t);return r===void 0&&this.index--,r}extractFieldTLVEncoded(){if(this.outOfRange(2))return;const t=this.index,r=this.extract8BitUInt(),n=this.extractFieldLVEncoded();if(r===void 0||n===void 0){this.index--;return}const o=this.index;return{tag:r,value:n,tlv:this.buffer.slice(t,o)}}encodeToHexaString(t,r=!1){if(t===void 0||t.length===0)return"";const n=si(t);return r?n:n.slice(2)}encodeToString(t){let r="",n=0;if(!t)return r;for(;n<=t.length;){const o=t[n];o&&(r+=String.fromCharCode(o)),n++}return r}getCurrentIndex(){return this.index}resetIndex(){this.index=0}getUnparsedRemainingLength(){return this.buffer.length-this.index}outOfRange(t){return this.index+t>this.buffer.length}extractNumber(t,r,n){const o=Number(t)/8;if(this.outOfRange(o))return;let a=0n;if(n)for(let l=0;l<o;l++)a=a<<8n|BigInt(this.buffer[l+this.index]);else for(let l=o-1;l>=0;l--)a=a<<8n|BigInt(this.buffer[l+this.index]);if(r){const l=1n<<t-1n;a&l&&(a-=l<<1n)}return this.index+=o,a}},gv=class{parser;constructor(t){this.parser=new R5(t.data)}testMinimalLength=t=>this.parser.testMinimalLength(t);extract8BitUInt=()=>this.parser.extract8BitUInt();extract16BitUInt=()=>this.parser.extract16BitUInt();extract32BitUInt=()=>this.parser.extract32BitUInt();extractFieldByLength=t=>this.parser.extractFieldByLength(t);extractFieldLVEncoded=()=>this.parser.extractFieldLVEncoded();extractFieldTLVEncoded=()=>this.parser.extractFieldTLVEncoded();encodeToHexaString(t,r=!1){return r?this.parser.encodeToHexaString(t,!0):this.parser.encodeToHexaString(t,!1)}encodeToString=t=>this.parser.encodeToString(t);getUnparsedRemainingLength=()=>this.parser.getUnparsedRemainingLength()},_5=class{_tag="InvalidStatusWordError";originalError;constructor(t){this.originalError=new Error(t??"Invalid status word.")}},$5=class{_tag="InvalidResponseFormatError";originalError;constructor(t){this.originalError=new Error(t??"Invalid response format.")}};var A5=(e=>(e.Error="ERROR",e.Success="SUCCESS",e))(A5||{});function T5(e){return"error"in e&&e.error!==void 0}function bw(e){return T5(e)?{status:"ERROR",error:e.error}:{status:"SUCCESS",data:e.data}}function L5(e){return e.status==="SUCCESS"}function Io({data:e,error:t}){return bw(t!==void 0?{error:t}:{data:e})}function I5(e){return L5(e)}let vv=class $s{static isValidStatusCode(t){return t.length===2}static isSuccessResponse({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===144&&t[1]===0:!1}static isLockedDeviceResponse({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===85&&t[1]===21||t[0]===105&&t[1]===130||t[0]===83&&t[1]===3:!1}static isRefusedByUser({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===85&&t[1]===1||t[0]===105&&t[1]===133:!1}static isAppAlreadyInstalled({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===106&&t[1]===128||t[0]===106&&t[1]===129||t[0]===106&&t[1]===142||t[0]===106&&t[1]===143:!1}static isOutOfMemory({statusCode:t}){return $s.isValidStatusCode(t)?t[0]===106&&t[1]===132||t[0]===106&&t[1]===133||t[0]===81&&t[1]===2||t[0]===81&&t[1]===3||t[0]===103&&t[1]===51:!1}static isApduThatTriggersDisconnection(t){const r=new Map;return r.set("openApp",new Uint8Array([224,216,0,0])),r.set("closeApp",new Uint8Array([176,167,0,0])),Array.from(r.values()).some(n=>{for(let o=0;o<4;o++)if(n[o]!==t[o])return!1;return!0})}},O5=class{_tag;originalError;errorCode;message;constructor({tag:t,errorCode:r,originalError:n,message:o}){this._tag=t,this.originalError=n,this.errorCode=r,this.message=o??"An error occured during device exchange."}},N5=class{_tag="UnknownDeviceExchangeError";originalError;message;constructor(t){this.originalError=t,this.message="Unexpected device exchange error happened."}};const P5=(e,t)=>Object.keys(t).includes(e);let D5=class extends O5{constructor(t){super({tag:"GlobalCommandError",...t})}};const xw={5515:{message:"Device is locked.",tag:"DeviceLockedError"},5501:{message:"Action refused on device.",tag:"ActionRefusedError"},5502:{message:"Pin is not set",tag:"PinNotSetError"},5223:{message:"Device internal error",tag:"DeviceInternalError"},"6e00":{message:"CLA not supported",tag:"DeviceInternalError"},"6d00":{message:"INS not supported",tag:"DeviceInternalError"}};let kR=class{static handle(t){const r=new gv(t).encodeToHexaString(t.statusCode);return P5(r,xw)?new D5({...xw[r],errorCode:r}):new N5({message:"UnknownError",errorCode:r})}},ww=class{name="getAppAndVersion";args=void 0;getApdu(){const t={cla:176,ins:1,p1:0,p2:0};return new CR(t).build()}parseResponse(t){if(!vv.isSuccessResponse(t))return Io({error:kR.handle(t)});const r=new gv(t);if(r.extract8BitUInt()!==1)return Io({error:new $5("getAppAndVersion: format not supported")});const n=r.encodeToString(r.extractFieldLVEncoded()),o=r.encodeToString(r.extractFieldLVEncoded());if(r.getUnparsedRemainingLength()===0)return Io({data:{name:n,version:o}});const a=r.extractFieldLVEncoded();return Io({data:{name:n,version:o,flags:a}})}};var j5=(e=>(e[e.BATTERY_PERCENTAGE=0]="BATTERY_PERCENTAGE",e[e.BATTERY_VOLTAGE=1]="BATTERY_VOLTAGE",e[e.BATTERY_TEMPERATURE=2]="BATTERY_TEMPERATURE",e[e.BATTERY_CURRENT=3]="BATTERY_CURRENT",e[e.BATTERY_FLAGS=4]="BATTERY_FLAGS",e))(j5||{}),M5=(e=>(e[e.NONE=0]="NONE",e[e.USB=1]="USB",e[e.QI=2]="QI",e))(M5||{}),Au={exports:{}},gh,Sw;function Ud(){if(Sw)return gh;Sw=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return gh={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},gh}var vh,Ew;function Vd(){if(Ew)return vh;Ew=1;var e={};return vh=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},vh}var Cw;function Il(){return Cw||(Cw=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Ud(),a=Vd();t=e.exports={};const l=t.re=[],u=t.safeRe=[],d=t.src=[],p=t.safeSrc=[],h=t.t={};let m=0;const y="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",o],[y,n]],E=C=>{for(const[R,k]of w)C=C.split(`${R}*`).join(`${R}{0,${k}}`).split(`${R}+`).join(`${R}{1,${k}}`);return C},S=(C,R,k)=>{const $=E(R),A=m++;a(C,A,R),h[C]=A,d[A]=R,p[A]=$,l[A]=new RegExp(R,k?"g":void 0),u[A]=new RegExp($,k?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),S("MAINVERSION",`(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${d[h.NONNUMERICIDENTIFIER]}|${d[h.NUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${d[h.NONNUMERICIDENTIFIER]}|${d[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASE",`(?:-(${d[h.PRERELEASEIDENTIFIER]}(?:\\.${d[h.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${d[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[h.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${y}+`),S("BUILD",`(?:\\+(${d[h.BUILDIDENTIFIER]}(?:\\.${d[h.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${d[h.MAINVERSION]}${d[h.PRERELEASE]}?${d[h.BUILD]}?`),S("FULL",`^${d[h.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${d[h.MAINVERSIONLOOSE]}${d[h.PRERELEASELOOSE]}?${d[h.BUILD]}?`),S("LOOSE",`^${d[h.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${d[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${d[h.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:${d[h.PRERELEASE]})?${d[h.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:${d[h.PRERELEASELOOSE]})?${d[h.BUILD]}?)?)?`),S("XRANGE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),S("COERCE",`${d[h.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",d[h.COERCEPLAIN]+`(?:${d[h.PRERELEASE]})?(?:${d[h.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",d[h.COERCE],!0),S("COERCERTLFULL",d[h.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${d[h.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",S("TILDE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${d[h.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",S("CARET",`^${d[h.LONECARET]}${d[h.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${d[h.LONECARET]}${d[h.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${d[h.GTLT]}\\s*(${d[h.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]}|${d[h.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${d[h.XRANGEPLAIN]})\\s+-\\s+(${d[h.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${d[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[h.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Au,Au.exports)),Au.exports}var yh,kw;function yv(){if(kw)return yh;kw=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return yh=n=>n?typeof n!="object"?e:n:t,yh}var bh,Rw;function RR(){if(Rw)return bh;Rw=1;const e=/^[0-9]+$/,t=(n,o)=>{const a=e.test(n),l=e.test(o);return a&&l&&(n=+n,o=+o),n===o?0:a&&!l?-1:l&&!a?1:n<o?-1:1};return bh={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},bh}var xh,_w;function gr(){if(_w)return xh;_w=1;const e=Vd(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Ud(),{safeRe:n,t:o}=Il(),a=yv(),{compareIdentifiers:l}=RR();class u{constructor(p,h){if(h=a(h),p instanceof u){if(p.loose===!!h.loose&&p.includePrerelease===!!h.includePrerelease)return p;p=p.version}else if(typeof p!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof p}".`);if(p.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",p,h),this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease;const m=p.trim().match(h.loose?n[o.LOOSE]:n[o.FULL]);if(!m)throw new TypeError(`Invalid Version: ${p}`);if(this.raw=p,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const w=+y;if(w>=0&&w<r)return w}return y}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(p){if(e("SemVer.compare",this.version,this.options,p),!(p instanceof u)){if(typeof p=="string"&&p===this.version)return 0;p=new u(p,this.options)}return p.version===this.version?0:this.compareMain(p)||this.comparePre(p)}compareMain(p){return p instanceof u||(p=new u(p,this.options)),l(this.major,p.major)||l(this.minor,p.minor)||l(this.patch,p.patch)}comparePre(p){if(p instanceof u||(p=new u(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;let h=0;do{const m=this.prerelease[h],y=p.prerelease[h];if(e("prerelease compare",h,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return l(m,y)}while(++h)}compareBuild(p){p instanceof u||(p=new u(p,this.options));let h=0;do{const m=this.build[h],y=p.build[h];if(e("build compare",h,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return l(m,y)}while(++h)}inc(p,h,m){if(p.startsWith("pre")){if(!h&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(h){const y=`-${h}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!y||y[1]!==h)throw new Error(`invalid identifier: ${h}`)}}switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",h,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",h,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",h,m),this.inc("pre",h,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",h,m),this.inc("pre",h,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(h===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(h){let w=[h,y];m===!1&&(w=[h]),l(this.prerelease[0],h)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${p}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return xh=u,xh}var wh,$w;function ia(){if($w)return wh;$w=1;const e=gr();return wh=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(a){if(!o)return null;throw a}},wh}var Sh,Aw;function z5(){if(Aw)return Sh;Aw=1;const e=ia();return Sh=(r,n)=>{const o=e(r,n);return o?o.version:null},Sh}var Eh,Tw;function F5(){if(Tw)return Eh;Tw=1;const e=ia();return Eh=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Eh}var Ch,Lw;function B5(){if(Lw)return Ch;Lw=1;const e=gr();return Ch=(r,n,o,a,l)=>{typeof o=="string"&&(l=a,a=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,a,l).version}catch{return null}},Ch}var kh,Iw;function U5(){if(Iw)return kh;Iw=1;const e=ia();return kh=(r,n)=>{const o=e(r,null,!0),a=e(n,null,!0),l=o.compare(a);if(l===0)return null;const u=l>0,d=u?o:a,p=u?a:o,h=!!d.prerelease.length;if(!!p.prerelease.length&&!h){if(!p.patch&&!p.minor)return"major";if(p.compareMain(d)===0)return p.minor&&!p.patch?"minor":"patch"}const y=h?"pre":"";return o.major!==a.major?y+"major":o.minor!==a.minor?y+"minor":o.patch!==a.patch?y+"patch":"prerelease"},kh}var Rh,Ow;function V5(){if(Ow)return Rh;Ow=1;const e=gr();return Rh=(r,n)=>new e(r,n).major,Rh}var _h,Nw;function W5(){if(Nw)return _h;Nw=1;const e=gr();return _h=(r,n)=>new e(r,n).minor,_h}var $h,Pw;function H5(){if(Pw)return $h;Pw=1;const e=gr();return $h=(r,n)=>new e(r,n).patch,$h}var Ah,Dw;function q5(){if(Dw)return Ah;Dw=1;const e=ia();return Ah=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},Ah}var Th,jw;function bn(){if(jw)return Th;jw=1;const e=gr();return Th=(r,n,o)=>new e(r,o).compare(new e(n,o)),Th}var Lh,Mw;function G5(){if(Mw)return Lh;Mw=1;const e=bn();return Lh=(r,n,o)=>e(n,r,o),Lh}var Ih,zw;function X5(){if(zw)return Ih;zw=1;const e=bn();return Ih=(r,n)=>e(r,n,!0),Ih}var Oh,Fw;function bv(){if(Fw)return Oh;Fw=1;const e=gr();return Oh=(r,n,o)=>{const a=new e(r,o),l=new e(n,o);return a.compare(l)||a.compareBuild(l)},Oh}var Nh,Bw;function Y5(){if(Bw)return Nh;Bw=1;const e=bv();return Nh=(r,n)=>r.sort((o,a)=>e(o,a,n)),Nh}var Ph,Uw;function K5(){if(Uw)return Ph;Uw=1;const e=bv();return Ph=(r,n)=>r.sort((o,a)=>e(a,o,n)),Ph}var Dh,Vw;function Wd(){if(Vw)return Dh;Vw=1;const e=bn();return Dh=(r,n,o)=>e(r,n,o)>0,Dh}var jh,Ww;function xv(){if(Ww)return jh;Ww=1;const e=bn();return jh=(r,n,o)=>e(r,n,o)<0,jh}var Mh,Hw;function _R(){if(Hw)return Mh;Hw=1;const e=bn();return Mh=(r,n,o)=>e(r,n,o)===0,Mh}var zh,qw;function $R(){if(qw)return zh;qw=1;const e=bn();return zh=(r,n,o)=>e(r,n,o)!==0,zh}var Fh,Gw;function wv(){if(Gw)return Fh;Gw=1;const e=bn();return Fh=(r,n,o)=>e(r,n,o)>=0,Fh}var Bh,Xw;function Sv(){if(Xw)return Bh;Xw=1;const e=bn();return Bh=(r,n,o)=>e(r,n,o)<=0,Bh}var Uh,Yw;function AR(){if(Yw)return Uh;Yw=1;const e=_R(),t=$R(),r=Wd(),n=wv(),o=xv(),a=Sv();return Uh=(u,d,p,h)=>{switch(d){case"===":return typeof u=="object"&&(u=u.version),typeof p=="object"&&(p=p.version),u===p;case"!==":return typeof u=="object"&&(u=u.version),typeof p=="object"&&(p=p.version),u!==p;case"":case"=":case"==":return e(u,p,h);case"!=":return t(u,p,h);case">":return r(u,p,h);case">=":return n(u,p,h);case"<":return o(u,p,h);case"<=":return a(u,p,h);default:throw new TypeError(`Invalid operator: ${d}`)}},Uh}var Vh,Kw;function Q5(){if(Kw)return Vh;Kw=1;const e=gr(),t=ia(),{safeRe:r,t:n}=Il();return Vh=(a,l)=>{if(a instanceof e)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;l=l||{};let u=null;if(!l.rtl)u=a.match(l.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const w=l.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let E;for(;(E=w.exec(a))&&(!u||u.index+u[0].length!==a.length);)(!u||E.index+E[0].length!==u.index+u[0].length)&&(u=E),w.lastIndex=E.index+E[1].length+E[2].length;w.lastIndex=-1}if(u===null)return null;const d=u[2],p=u[3]||"0",h=u[4]||"0",m=l.includePrerelease&&u[5]?`-${u[5]}`:"",y=l.includePrerelease&&u[6]?`+${u[6]}`:"";return t(`${d}.${p}.${h}${m}${y}`,l)},Vh}var Wh,Qw;function J5(){if(Qw)return Wh;Qw=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(r,n)}return this}}return Wh=e,Wh}var Hh,Jw;function xn(){if(Jw)return Hh;Jw=1;const e=/\s+/g;class t{constructor(V,H){if(H=o(H),V instanceof t)return V.loose===!!H.loose&&V.includePrerelease===!!H.includePrerelease?V:new t(V.raw,H);if(V instanceof a)return this.raw=V.value,this.set=[[V]],this.formatted=void 0,this;if(this.options=H,this.loose=!!H.loose,this.includePrerelease=!!H.includePrerelease,this.raw=V.trim().replace(e," "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(L=>!S(L[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const L of this.set)if(L.length===1&&C(L[0])){this.set=[L];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let V=0;V<this.set.length;V++){V>0&&(this.formatted+="||");const H=this.set[V];for(let O=0;O<H.length;O++)O>0&&(this.formatted+=" "),this.formatted+=H[O].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(V){const O=((this.options.includePrerelease&&w)|(this.options.loose&&E))+":"+V,L=n.get(O);if(L)return L;const U=this.options.loose,z=U?d[p.HYPHENRANGELOOSE]:d[p.HYPHENRANGE];V=V.replace(z,ne(this.options.includePrerelease)),l("hyphen replace",V),V=V.replace(d[p.COMPARATORTRIM],h),l("comparator trim",V),V=V.replace(d[p.TILDETRIM],m),l("tilde trim",V),V=V.replace(d[p.CARETTRIM],y),l("caret trim",V);let T=V.split(" ").map(G=>k(G,this.options)).join(" ").split(/\s+/).map(G=>ee(G,this.options));U&&(T=T.filter(G=>(l("loose invalid filter",G,this.options),!!G.match(d[p.COMPARATORLOOSE])))),l("range list",T);const M=new Map,te=T.map(G=>new a(G,this.options));for(const G of te){if(S(G))return[G];M.set(G.value,G)}M.size>1&&M.has("")&&M.delete("");const le=[...M.values()];return n.set(O,le),le}intersects(V,H){if(!(V instanceof t))throw new TypeError("a Range is required");return this.set.some(O=>R(O,H)&&V.set.some(L=>R(L,H)&&O.every(U=>L.every(z=>U.intersects(z,H)))))}test(V){if(!V)return!1;if(typeof V=="string")try{V=new u(V,this.options)}catch{return!1}for(let H=0;H<this.set.length;H++)if(X(this.set[H],V,this.options))return!0;return!1}}Hh=t;const r=J5(),n=new r,o=yv(),a=Hd(),l=Vd(),u=gr(),{safeRe:d,t:p,comparatorTrimReplace:h,tildeTrimReplace:m,caretTrimReplace:y}=Il(),{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:E}=Ud(),S=F=>F.value==="<0.0.0-0",C=F=>F.value==="",R=(F,V)=>{let H=!0;const O=F.slice();let L=O.pop();for(;H&&O.length;)H=O.every(U=>L.intersects(U,V)),L=O.pop();return H},k=(F,V)=>(l("comp",F,V),F=N(F,V),l("caret",F),F=A(F,V),l("tildes",F),F=I(F,V),l("xrange",F),F=Z(F,V),l("stars",F),F),$=F=>!F||F.toLowerCase()==="x"||F==="*",A=(F,V)=>F.trim().split(/\s+/).map(H=>D(H,V)).join(" "),D=(F,V)=>{const H=V.loose?d[p.TILDELOOSE]:d[p.TILDE];return F.replace(H,(O,L,U,z,T)=>{l("tilde",F,O,L,U,z,T);let M;return $(L)?M="":$(U)?M=`>=${L}.0.0 <${+L+1}.0.0-0`:$(z)?M=`>=${L}.${U}.0 <${L}.${+U+1}.0-0`:T?(l("replaceTilde pr",T),M=`>=${L}.${U}.${z}-${T} <${L}.${+U+1}.0-0`):M=`>=${L}.${U}.${z} <${L}.${+U+1}.0-0`,l("tilde return",M),M})},N=(F,V)=>F.trim().split(/\s+/).map(H=>P(H,V)).join(" "),P=(F,V)=>{l("caret",F,V);const H=V.loose?d[p.CARETLOOSE]:d[p.CARET],O=V.includePrerelease?"-0":"";return F.replace(H,(L,U,z,T,M)=>{l("caret",F,L,U,z,T,M);let te;return $(U)?te="":$(z)?te=`>=${U}.0.0${O} <${+U+1}.0.0-0`:$(T)?U==="0"?te=`>=${U}.${z}.0${O} <${U}.${+z+1}.0-0`:te=`>=${U}.${z}.0${O} <${+U+1}.0.0-0`:M?(l("replaceCaret pr",M),U==="0"?z==="0"?te=`>=${U}.${z}.${T}-${M} <${U}.${z}.${+T+1}-0`:te=`>=${U}.${z}.${T}-${M} <${U}.${+z+1}.0-0`:te=`>=${U}.${z}.${T}-${M} <${+U+1}.0.0-0`):(l("no pr"),U==="0"?z==="0"?te=`>=${U}.${z}.${T}${O} <${U}.${z}.${+T+1}-0`:te=`>=${U}.${z}.${T}${O} <${U}.${+z+1}.0-0`:te=`>=${U}.${z}.${T} <${+U+1}.0.0-0`),l("caret return",te),te})},I=(F,V)=>(l("replaceXRanges",F,V),F.split(/\s+/).map(H=>re(H,V)).join(" ")),re=(F,V)=>{F=F.trim();const H=V.loose?d[p.XRANGELOOSE]:d[p.XRANGE];return F.replace(H,(O,L,U,z,T,M)=>{l("xRange",F,O,L,U,z,T,M);const te=$(U),le=te||$(z),G=le||$(T),fe=G;return L==="="&&fe&&(L=""),M=V.includePrerelease?"-0":"",te?L===">"||L==="<"?O="<0.0.0-0":O="*":L&&fe?(le&&(z=0),T=0,L===">"?(L=">=",le?(U=+U+1,z=0,T=0):(z=+z+1,T=0)):L==="<="&&(L="<",le?U=+U+1:z=+z+1),L==="<"&&(M="-0"),O=`${L+U}.${z}.${T}${M}`):le?O=`>=${U}.0.0${M} <${+U+1}.0.0-0`:G&&(O=`>=${U}.${z}.0${M} <${U}.${+z+1}.0-0`),l("xRange return",O),O})},Z=(F,V)=>(l("replaceStars",F,V),F.trim().replace(d[p.STAR],"")),ee=(F,V)=>(l("replaceGTE0",F,V),F.trim().replace(d[V.includePrerelease?p.GTE0PRE:p.GTE0],"")),ne=F=>(V,H,O,L,U,z,T,M,te,le,G,fe)=>($(O)?H="":$(L)?H=`>=${O}.0.0${F?"-0":""}`:$(U)?H=`>=${O}.${L}.0${F?"-0":""}`:z?H=`>=${H}`:H=`>=${H}${F?"-0":""}`,$(te)?M="":$(le)?M=`<${+te+1}.0.0-0`:$(G)?M=`<${te}.${+le+1}.0-0`:fe?M=`<=${te}.${le}.${G}-${fe}`:F?M=`<${te}.${le}.${+G+1}-0`:M=`<=${M}`,`${H} ${M}`.trim()),X=(F,V,H)=>{for(let O=0;O<F.length;O++)if(!F[O].test(V))return!1;if(V.prerelease.length&&!H.includePrerelease){for(let O=0;O<F.length;O++)if(l(F[O].semver),F[O].semver!==a.ANY&&F[O].semver.prerelease.length>0){const L=F[O].semver;if(L.major===V.major&&L.minor===V.minor&&L.patch===V.patch)return!0}return!1}return!0};return Hh}var qh,Zw;function Hd(){if(Zw)return qh;Zw=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(h,m){if(m=r(m),h instanceof t){if(h.loose===!!m.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),l("comparator",h,m),this.options=m,this.loose=!!m.loose,this.parse(h),this.semver===e?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(h){const m=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],y=h.match(m);if(!y)throw new TypeError(`Invalid comparator: ${h}`);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new u(y[2],this.options.loose):this.semver=e}toString(){return this.value}test(h){if(l("Comparator.test",h,this.options.loose),this.semver===e||h===e)return!0;if(typeof h=="string")try{h=new u(h,this.options)}catch{return!1}return a(h,this.operator,this.semver,this.options)}intersects(h,m){if(!(h instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(h.value,m).test(this.value):h.operator===""?h.value===""?!0:new d(this.value,m).test(h.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||a(this.semver,"<",h.semver,m)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||a(this.semver,">",h.semver,m)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}qh=t;const r=yv(),{safeRe:n,t:o}=Il(),a=AR(),l=Vd(),u=gr(),d=xn();return qh}var Gh,eS;function qd(){if(eS)return Gh;eS=1;const e=xn();return Gh=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},Gh}var Xh,tS;function Z5(){if(tS)return Xh;tS=1;const e=xn();return Xh=(r,n)=>new e(r,n).set.map(o=>o.map(a=>a.value).join(" ").trim().split(" ")),Xh}var Yh,rS;function ez(){if(rS)return Yh;rS=1;const e=gr(),t=xn();return Yh=(n,o,a)=>{let l=null,u=null,d=null;try{d=new t(o,a)}catch{return null}return n.forEach(p=>{d.test(p)&&(!l||u.compare(p)===-1)&&(l=p,u=new e(l,a))}),l},Yh}var Kh,nS;function tz(){if(nS)return Kh;nS=1;const e=gr(),t=xn();return Kh=(n,o,a)=>{let l=null,u=null,d=null;try{d=new t(o,a)}catch{return null}return n.forEach(p=>{d.test(p)&&(!l||u.compare(p)===1)&&(l=p,u=new e(l,a))}),l},Kh}var Qh,iS;function rz(){if(iS)return Qh;iS=1;const e=gr(),t=xn(),r=Wd();return Qh=(o,a)=>{o=new t(o,a);let l=new e("0.0.0");if(o.test(l)||(l=new e("0.0.0-0"),o.test(l)))return l;l=null;for(let u=0;u<o.set.length;++u){const d=o.set[u];let p=null;d.forEach(h=>{const m=new e(h.semver.version);switch(h.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!p||r(m,p))&&(p=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${h.operator}`)}}),p&&(!l||r(l,p))&&(l=p)}return l&&o.test(l)?l:null},Qh}var Jh,oS;function nz(){if(oS)return Jh;oS=1;const e=xn();return Jh=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Jh}var Zh,sS;function Ev(){if(sS)return Zh;sS=1;const e=gr(),t=Hd(),{ANY:r}=t,n=xn(),o=qd(),a=Wd(),l=xv(),u=Sv(),d=wv();return Zh=(h,m,y,w)=>{h=new e(h,w),m=new n(m,w);let E,S,C,R,k;switch(y){case">":E=a,S=u,C=l,R=">",k=">=";break;case"<":E=l,S=d,C=a,R="<",k="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(h,m,w))return!1;for(let $=0;$<m.set.length;++$){const A=m.set[$];let D=null,N=null;if(A.forEach(P=>{P.semver===r&&(P=new t(">=0.0.0")),D=D||P,N=N||P,E(P.semver,D.semver,w)?D=P:C(P.semver,N.semver,w)&&(N=P)}),D.operator===R||D.operator===k||(!N.operator||N.operator===R)&&S(h,N.semver))return!1;if(N.operator===k&&C(h,N.semver))return!1}return!0},Zh}var em,aS;function iz(){if(aS)return em;aS=1;const e=Ev();return em=(r,n,o)=>e(r,n,">",o),em}var tm,lS;function oz(){if(lS)return tm;lS=1;const e=Ev();return tm=(r,n,o)=>e(r,n,"<",o),tm}var rm,cS;function sz(){if(cS)return rm;cS=1;const e=xn();return rm=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),rm}var nm,uS;function az(){if(uS)return nm;uS=1;const e=qd(),t=bn();return nm=(r,n,o)=>{const a=[];let l=null,u=null;const d=r.sort((y,w)=>t(y,w,o));for(const y of d)e(y,n,o)?(u=y,l||(l=y)):(u&&a.push([l,u]),u=null,l=null);l&&a.push([l,null]);const p=[];for(const[y,w]of a)y===w?p.push(y):!w&&y===d[0]?p.push("*"):w?y===d[0]?p.push(`<=${w}`):p.push(`${y} - ${w}`):p.push(`>=${y}`);const h=p.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return h.length<m.length?h:n},nm}var im,dS;function lz(){if(dS)return im;dS=1;const e=xn(),t=Hd(),{ANY:r}=t,n=qd(),o=bn(),a=(m,y,w={})=>{if(m===y)return!0;m=new e(m,w),y=new e(y,w);let E=!1;e:for(const S of m.set){for(const C of y.set){const R=d(S,C,w);if(E=E||R!==null,R)continue e}if(E)return!1}return!0},l=[new t(">=0.0.0-0")],u=[new t(">=0.0.0")],d=(m,y,w)=>{if(m===y)return!0;if(m.length===1&&m[0].semver===r){if(y.length===1&&y[0].semver===r)return!0;w.includePrerelease?m=l:m=u}if(y.length===1&&y[0].semver===r){if(w.includePrerelease)return!0;y=u}const E=new Set;let S,C;for(const I of m)I.operator===">"||I.operator===">="?S=p(S,I,w):I.operator==="<"||I.operator==="<="?C=h(C,I,w):E.add(I.semver);if(E.size>1)return null;let R;if(S&&C){if(R=o(S.semver,C.semver,w),R>0)return null;if(R===0&&(S.operator!==">="||C.operator!=="<="))return null}for(const I of E){if(S&&!n(I,String(S),w)||C&&!n(I,String(C),w))return null;for(const re of y)if(!n(I,String(re),w))return!1;return!0}let k,$,A,D,N=C&&!w.includePrerelease&&C.semver.prerelease.length?C.semver:!1,P=S&&!w.includePrerelease&&S.semver.prerelease.length?S.semver:!1;N&&N.prerelease.length===1&&C.operator==="<"&&N.prerelease[0]===0&&(N=!1);for(const I of y){if(D=D||I.operator===">"||I.operator===">=",A=A||I.operator==="<"||I.operator==="<=",S){if(P&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===P.major&&I.semver.minor===P.minor&&I.semver.patch===P.patch&&(P=!1),I.operator===">"||I.operator===">="){if(k=p(S,I,w),k===I&&k!==S)return!1}else if(S.operator===">="&&!n(S.semver,String(I),w))return!1}if(C){if(N&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===N.major&&I.semver.minor===N.minor&&I.semver.patch===N.patch&&(N=!1),I.operator==="<"||I.operator==="<="){if($=h(C,I,w),$===I&&$!==C)return!1}else if(C.operator==="<="&&!n(C.semver,String(I),w))return!1}if(!I.operator&&(C||S)&&R!==0)return!1}return!(S&&A&&!C&&R!==0||C&&D&&!S&&R!==0||P||N)},p=(m,y,w)=>{if(!m)return y;const E=o(m.semver,y.semver,w);return E>0?m:E<0||y.operator===">"&&m.operator===">="?y:m},h=(m,y,w)=>{if(!m)return y;const E=o(m.semver,y.semver,w);return E<0?m:E>0||y.operator==="<"&&m.operator==="<="?y:m};return im=a,im}var om,fS;function cz(){if(fS)return om;fS=1;const e=Il(),t=Ud(),r=gr(),n=RR(),o=ia(),a=z5(),l=F5(),u=B5(),d=U5(),p=V5(),h=W5(),m=H5(),y=q5(),w=bn(),E=G5(),S=X5(),C=bv(),R=Y5(),k=K5(),$=Wd(),A=xv(),D=_R(),N=$R(),P=wv(),I=Sv(),re=AR(),Z=Q5(),ee=Hd(),ne=xn(),X=qd(),F=Z5(),V=ez(),H=tz(),O=rz(),L=nz(),U=Ev(),z=iz(),T=oz(),M=sz(),te=az(),le=lz();return om={parse:o,valid:a,clean:l,inc:u,diff:d,major:p,minor:h,patch:m,prerelease:y,compare:w,rcompare:E,compareLoose:S,compareBuild:C,sort:R,rsort:k,gt:$,lt:A,eq:D,neq:N,gte:P,lte:I,cmp:re,coerce:Z,Comparator:ee,Range:ne,satisfies:X,toComparators:F,maxSatisfying:V,minSatisfying:H,minVersion:O,validRange:L,outside:U,gtr:z,ltr:T,intersects:M,simplifyRange:te,subset:le,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},om}var jr=cz();const pS=Qr(jr);var wt=(e=>(e.NANO_S="nanoS",e.NANO_SP="nanoSP",e.NANO_X="nanoX",e.STAX="stax",e.FLEX="flex",e.APEX="apexp",e))(wt||{});let TR=class{id;model;name;constructor({id:t,model:r,name:n}){this.id=t,this.model=r,this.name=n}};const sm={Twelve:12,Eighteen:18,TwentyFour:24};var Yt=(e=>(e.Unknown="unknown",e.WelcomeScreen1="welcome-screen-1",e.WelcomeScreen2="welcome-screen-2",e.WelcomeScreen3="welcome-screen-3",e.WelcomeScreen4="welcome-screen-4",e.WelcomeScreenReminder="welcome-screen-reminder",e.SetupChoice="setup-choice",e.Pin="pin",e.NewDevice="new-device",e.ConfirmNewDevice="confirm-new-device",e.RestoreRecoveryPhrase="restore-recovery-phrase",e.SafetyWarning="safety-warning",e.DeviceIsReady="device-is-ready",e.ChooseName="choose-name",e.RestoreRecoverBackup="restore-recover-backup",e.SetupRestoreChoice="setup-restore-choice",e.OnboardingStatusCheck="onboarding-status-check",e.RestoreWithRk="restore-with-rk",e))(Yt||{});const uz={0:Yt.WelcomeScreen1,1:Yt.WelcomeScreen2,2:Yt.WelcomeScreen3,3:Yt.WelcomeScreen4,4:Yt.WelcomeScreenReminder,5:Yt.SetupChoice,6:Yt.Pin,7:Yt.NewDevice,8:Yt.ConfirmNewDevice,9:Yt.RestoreRecoveryPhrase,10:Yt.SafetyWarning,11:Yt.DeviceIsReady,12:Yt.ChooseName,13:Yt.RestoreRecoverBackup,14:Yt.SetupRestoreChoice,15:Yt.OnboardingStatusCheck,16:Yt.RestoreWithRk};let dz=class{seFlags;constructor(t){this.seFlags=new Uint8Array(4),this.seFlags.set(t.subarray(0,this.seFlags.length))}generalDeviceState(){const t=this.seFlags[0]??0;return{isPinValidated:this._checkNthBitInByte(t,1),hasMcuSerialNumber:this._checkNthBitInByte(t,2),hasValidCertificate:this._checkNthBitInByte(t,3),isCustomAuthorityConnectionAllowed:this._checkNthBitInByte(t,4),isSecureConnectionAllowed:this._checkNthBitInByte(t,5),isOnboarded:this._checkNthBitInByte(t,6),isMcuCodeSigned:this._checkNthBitInByte(t,7),isInRecoveryMode:this._checkNthBitInByte(t,8)}}endorsementInformation(){const t=this.seFlags[1]??0;return{hasEndorsementCertificateInSlot1:(t&1)!==0,hasEndorsementCertificateInSlot2:(t&2)!==0}}wordsInformation(){const t=this.seFlags[2]??0,r=t>>5&3;return{numberOfWords:[sm.TwentyFour,sm.Eighteen,sm.Twelve,void 0][r],currentWordIndex:t&31}}onboardingStatus(){const t=this.seFlags[3]??0;return{onboardingState:uz[t]??Yt.Unknown}}_checkNthBitInByte(t,r){return(t>>8-r&1)===1}},fz=class{name="getOsVersion";args=void 0;getApdu(){const t={cla:224,ins:1,p1:0,p2:0};return new CR(t).build()}parseResponse(t,r){if(!vv.isSuccessResponse(t))return Io({error:kR.handle(t)});const n=new gv(t),o=n.extract32BitUInt();if(o===void 0)return Io({error:new _5("Missing target ID in OS version")});let a=n.encodeToString(n.extractFieldLVEncoded()),l=n.extractFieldLVEncoded()??new Uint8Array(0);const u=new dz(l),d={...u.generalDeviceState(),...u.endorsementInformation(),...u.wordsInformation(),...u.onboardingStatus()};a||(a="0.0.0",l=new Uint8Array);const p=(o&4026531840)!==805306368,h=a.includes("-osu");let m="",y="",w="",E="",S,C,R,k;if(p){w=a,S=o;const $=n.extractFieldLVEncoded();$&&($.length>=5?(m=n.encodeToString($),C=parseInt(n.encodeToHexaString(n.extractFieldLVEncoded()),16)):C=parseInt(n.encodeToHexaString($),16))}else{if(m=a,C=o,y=n.encodeToString(n.extractFieldLVEncoded()),this.isBootloaderVersionSupported(m,r)&&(w=n.encodeToString(n.extractFieldLVEncoded())),this.isHardwareVersionSupported(m,r)?E=n.encodeToHexaString(n.extractFieldLVEncoded()):E="00",this.isLocalizationSupported(m,r)){const $=n.extractFieldLVEncoded();$!==void 0&&(R=parseInt(n.encodeToHexaString($),16))}if(this.isRecoverSupported(m,r)){const $=n.extractFieldLVEncoded();$!==void 0&&(k=parseInt(n.encodeToHexaString($),16))}}return Io({data:{isBootloader:p,isOsu:h,targetId:o,seTargetId:C,mcuTargetId:S,seVersion:m,seFlags:l,mcuSephVersion:y,mcuBootloaderVersion:w,hwVersion:E,langId:R,recoverState:k,secureElementFlags:d}})}isBootloaderVersionSupported(t,r){const n=jr.coerce(t)??"";switch(r){case wt.NANO_S:case wt.NANO_X:return jr.gte(n,"2.0.0");default:return!0}}isHardwareVersionSupported(t,r){const n=jr.coerce(t)??"";return r===wt.NANO_X?jr.gte(n,"2.0.0"):!1}isLocalizationSupported(t,r){const n=jr.coerce(t)??"";switch(r){case wt.NANO_S:return!1;case wt.NANO_SP:return jr.gte(n,"1.1.0");case wt.NANO_X:return jr.gte(n,"2.1.0");default:return!0}}isRecoverSupported(t,r){const n=jr.coerce(t)??"";switch(r){case wt.NANO_S:return!1;case wt.NANO_SP:return jr.gte(n,"1.1.2");case wt.NANO_X:return jr.gte(n,"2.2.3");case wt.STAX:return jr.gte(n,"1.4.0");case wt.FLEX:return jr.gte(n,"1.0.1");default:return!0}}};var Ln=(e=>(e.LOCKED="LOCKED",e.BUSY="BUSY",e.CONNECTED="CONNECTED",e.NOT_CONNECTED="NOT CONNECTED",e))(Ln||{}),pz=(e=>(e.NotStarted="not-started",e.Pending="pending",e.Stopped="stopped",e.Completed="completed",e.Error="error",e))(pz||{}),hz=(e=>(e.None="none",e.UnlockDevice="unlock-device",e.AllowSecureConnection="allow-secure-connection",e.ConfirmOpenApp="confirm-open-app",e.SignTransaction="sign-transaction",e.SignTypedData="sign-typed-data",e.AllowListApps="allow-list-apps",e.VerifyAddress="verify-address",e.SignPersonalMessage="sign-personal-message",e.SignDelegationAuthorization="sign-delegation-authorization",e.Web3ChecksOptIn="web3-checks-opt-in",e.VerifySafeAddress="verify-safe-address",e.RegisterWallet="register-wallet",e.ConfirmLoadImage="confirm-load-image",e.ConfirmCommitImage="confirm-commit-image",e.ConfirmRemoveImage="confirm-remove-image",e.GrantConsent="grant-consent",e.AllowInstallFirmware="allow-install-firmware",e))(hz||{});const Ar={of(e){return or(e)},empty(){return ft},zero(){return ft},fromNullable(e){return e==null?ft:or(e)},fromFalsy(e){return e?or(e):ft},fromPredicate(e,t){return arguments.length===1?r=>Ar.fromPredicate(e,r):e(t)?or(t):ft},mapMaybe(e,t){return arguments.length===1?r=>Ar.mapMaybe(e,r):Ar.catMaybes(t.map(e))},catMaybes(e){let t=[];for(const r of e)r.isJust()&&t.push(r.extract());return t},encase(e){try{return or(e())}catch{return ft}},isMaybe(e){return e instanceof Cv||e instanceof kv},sequence(e){let t=[];for(const r of e)if(r.isJust())t.push(r.extract());else return ft;return or(t)},"fantasy-land/of"(e){return this.of(e)},"fantasy-land/empty"(){return this.empty()},"fantasy-land/zero"(){return this.zero()}};class Cv{constructor(t){this.__value=t,this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!0}isNothing(){return!1}inspect(){return`Just(${this.__value})`}toString(){return this.inspect()}toJSON(){const t=this.__value;return t instanceof Date?t.toJSON():t}equals(t){return this.extract()===t.extract()}map(t){return or(t(this.__value))}ap(t){return t.isJust()?this.map(t.extract()):ft}alt(t){return this}altLazy(t){return this}chain(t){return t(this.__value)}chainNullable(t){return Ar.fromNullable(t(this.__value))}join(){return this.__value}reduce(t,r){return t(r,this.__value)}extend(t){return or(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Just(this.__value)}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}toList(){return[this.__value]}mapOrDefault(t,r){return t(this.__value)}extract(){return this.__value}extractNullable(){return this.__value}toEither(t){return Tt(this.__value)}ifJust(t){return t(this.__value),this}ifNothing(t){return this}filter(t){return t(this.__value)?or(this.__value):ft}}Cv.prototype.constructor=Ar;class kv{constructor(){this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!1}isNothing(){return!0}inspect(){return"Nothing"}toString(){return this.inspect()}toJSON(){return this.__value}equals(t){return this.extract()===t.extract()}map(t){return ft}ap(t){return ft}alt(t){return t}altLazy(t){return t()}chain(t){return ft}chainNullable(t){return ft}join(){return ft}reduce(t,r){return r}extend(t){return ft}unsafeCoerce(){throw new Error("Maybe#unsafeCoerce was ran on a Nothing")}caseOf(t){return"_"in t?t._():t.Nothing()}orDefault(t){return t}orDefaultLazy(t){return t()}toList(){return[]}mapOrDefault(t,r){return r}extract(){}extractNullable(){return null}toEither(t){return yt(t)}ifJust(t){return this}ifNothing(t){return t(),this}filter(t){return ft}}kv.prototype.constructor=Ar;const or=e=>new Cv(e),ft=new kv,Tr={of(e){return Tt(e)},lefts(e){let t=[];for(const r of e)r.isLeft()&&t.push(r.extract());return t},rights(e){let t=[];for(const r of e)r.isRight()&&t.push(r.extract());return t},encase(e){try{return Tt(e())}catch(t){return yt(t)}},sequence(e){let t=[];for(const r of e){if(r.isLeft())return r;t.push(r.extract())}return Tt(t)},isEither(e){return e instanceof _v||e instanceof Rv},"fantasy-land/of"(e){return Tr.of(e)}};class Rv{constructor(t){this.__value=t,this._="R",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!1}isRight(){return!0}toJSON(){return this.__value}inspect(){return`Right(${this.__value})`}toString(){return this.inspect()}bimap(t,r){return Tt(r(this.__value))}map(t){return Tt(t(this.__value))}mapLeft(t){return this}ap(t){return t.isRight()?this.map(t.extract()):t}equals(t){return t.isRight()?this.__value===t.extract():!1}chain(t){return t(this.__value)}chainLeft(t){return this}join(){return this.__value}alt(t){return this}altLazy(t){return this}reduce(t,r){return t(r,this.__value)}extend(t){return Tt(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Right(this.__value)}leftOrDefault(t){return t}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}leftOrDefaultLazy(t){return t()}ifLeft(t){return this}ifRight(t){return t(this.__value),this}toMaybe(){return or(this.__value)}leftToMaybe(){return ft}extract(){return this.__value}swap(){return yt(this.__value)}}Rv.prototype.constructor=Tr;class _v{constructor(t){this.__value=t,this._="L",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!0}isRight(){return!1}toJSON(){return this.__value}inspect(){return`Left(${JSON.stringify(this.__value)})`}toString(){return this.inspect()}bimap(t,r){return yt(t(this.__value))}map(t){return this}mapLeft(t){return yt(t(this.__value))}ap(t){return t.isLeft()?t:this}equals(t){return t.isLeft()?t.extract()===this.__value:!1}chain(t){return this}chainLeft(t){return t(this.__value)}join(){return this}alt(t){return t}altLazy(t){return t()}reduce(t,r){return r}extend(t){return this}unsafeCoerce(){throw this.__value instanceof Error?this.__value:new Error("Either#unsafeCoerce was ran on a Left")}caseOf(t){return"_"in t?t._():t.Left(this.__value)}leftOrDefault(t){return this.__value}orDefault(t){return t}orDefaultLazy(t){return t()}leftOrDefaultLazy(t){return this.__value}ifLeft(t){return t(this.__value),this}ifRight(t){return this}toMaybe(){return ft}leftToMaybe(){return or(this.__value)}extract(){return this.__value}swap(){return Tt(this.__value)}}_v.prototype.constructor=Tr;const yt=e=>new _v(e),Tt=e=>new Rv(e),Ol=e=>e,mz=e=>e,am=Object.assign(mz,{fromArray:e=>am.isNonEmpty(e)?or(e):ft,unsafeCoerce:e=>{if(am.isNonEmpty(e))return e;throw new Error("NonEmptyList#unsafeCoerce was ran on an empty array")},fromTuple:e=>am(e.toArray()),head:e=>e[0],last:e=>e[e.length-1],isNonEmpty:e=>e.length>0,tail:e=>e.slice(1)}),Wu=(e,t)=>typeof t=="bigint"?t.toString():t,gz=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Wo=(e,t)=>{let r="";switch(typeof t){case"undefined":r="undefined";break;case"object":r=t===null?"null":Array.isArray(t)?"an array with value "+JSON.stringify(t,Wu):"an object with value "+JSON.stringify(t,Wu);break;case"boolean":r="a boolean";break;case"symbol":r="a symbol";break;case"function":r="a function";break;case"bigint":r=`a bigint with value ${t.toString()}`}return r=r||`a ${typeof t} with value ${JSON.stringify(t,Wu)}`,`Expected ${e}, but received ${r}`},vz=e=>(Object.keys(e).length===1&&e.oneOf?.length===1&&typeof e.oneOf[0]=="object"&&(Object.assign(e,e.oneOf[0]),delete e.oneOf),e),yz=e=>{if(Array.isArray(e.oneOf))for(let t=0;t<e.oneOf.length;t++){const r=e.oneOf[t];if(typeof r=="object"&&r.oneOf)return e.oneOf.splice(t,1),e.oneOf.push(...r.oneOf),LR(e)}return e},LR=e=>(yz(e),vz(e),e),Bt={interface(e){const t=Object.keys(e),r=o=>{if(!gz(o))return yt(Wo("an object",o));const a={};for(const l of t){if(!o.hasOwnProperty(l)&&!e[l]._isOptional)return yt(`Problem with property "${l}": it does not exist in received object ${JSON.stringify(o,Wu)}`);const u=e[l].decode(o[l]);if(u.isLeft())return yt(`Problem with the value of property "${l}": ${u.extract()}`);const d=u.extract();d!==void 0&&(a[l]=d)}return Tt(a)};return{decode:r,encode:o=>{const a={};for(const l of t)a[l]=e[l].encode(o[l]);return a},unsafeDecode:o=>r(o).mapLeft(Error).unsafeCoerce(),schema:()=>t.reduce((o,a)=>(e[a]._isOptional||o.required.push(a),o.properties[a]=LR(e[a].schema()),o),{type:"object",properties:{},required:[]})}},custom({decode:e,encode:t,schema:r}){return{decode:e,encode:t,unsafeDecode:n=>e(n).mapLeft(Error).unsafeCoerce(),schema:r??(()=>({}))}}},at=Bt.custom({decode:e=>typeof e=="string"?Tt(e):yt(Wo("a string",e)),encode:Ol,schema:()=>({type:"string"})}),Mo=Bt.custom({decode:e=>typeof e=="number"?Tt(e):yt(Wo("a number",e)),encode:Ol,schema:()=>({type:"number"})}),bz=Bt.custom({decode:e=>e===void 0?Tt(e):yt(Wo("an undefined",e)),encode:Ol}),zt=e=>({...xz([e,bz]),schema:e.schema,_isOptional:!0}),vd=Bt.custom({decode:e=>typeof e=="boolean"?Tt(e):yt(Wo("a boolean",e)),encode:Ol,schema:()=>({type:"boolean"})}),xz=e=>Bt.custom({decode:t=>{let r=[];for(const n of e){const o=n.decode(t);if(o.isRight())return o;r.push(o.extract())}return yt(`One of the following problems occured: ${r.map((n,o)=>`(${o}) ${n}`).join(", ")}`)},encode:t=>{for(const r of e)if(Tr.encase(()=>r.encode(t)).mapLeft(o=>"").chain(r.decode).isRight())return r.encode(t);return t},schema:()=>({oneOf:e.map(t=>t.schema())})}),Yr=e=>Bt.custom({decode:t=>{if(Array.isArray(t)){const r=[];for(let n=0;n<t.length;n++){const o=e.decode(t[n]);if(o.isRight())r.push(o.extract());else return yt(`Problem with the value at index ${n}: ${o.extract()}`)}return Tt(r)}else return yt(Wo("an array",t))},encode:t=>t.map(e.encode),schema:()=>({type:"array",items:e.schema()})});Bt.custom({decode:e=>at.decode(e).chain(t=>isFinite(+t)?Tt(t):yt(Wo("a number",e))),encode:Ol,schema:Mo.schema});var IR;const OR={liftEither(e){if(e.isRight())return Promise.resolve(e.extract());throw e.extract()},fromPromise(e){return e.then(OR.liftEither)},throwE(e){throw e}};class NR{constructor(t){this.runPromise=t,this[IR]="EitherAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this.then=(r,n)=>this.run().then(r,n)}leftOrDefault(t){return this.run().then(r=>r.leftOrDefault(t))}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return He(async t=>{const r=await this;if(r.isRight()){const n=await r.extract();return t.liftEither(n)}return t.liftEither(r)})}ap(t){return He(async r=>{const n=await t;if(n.isRight()){const o=await this.run();return o.isRight()?n.extract()(o.extract()):r.liftEither(o)}return r.liftEither(n)})}alt(t){return He(async r=>{const n=await this.run();if(n.isRight())return n.extract();{const o=await t;return r.liftEither(o)}})}extend(t){return He(async r=>{const n=await this.run();if(n.isRight()){const o=He.liftEither(n);return r.liftEither(Tt(t(o)))}return r.liftEither(n)})}async run(){try{return Tt(await this.runPromise(OR))}catch(t){return yt(t)}}bimap(t,r){return He(async n=>{const o=await this.run();try{return await n.liftEither(o.bimap(t,r))}catch(a){throw await a}})}map(t){return He(r=>this.runPromise(r).then(t))}mapLeft(t){return He(async r=>{try{return await this.runPromise(r)}catch(n){throw await t(n)}})}chain(t){return He(async r=>{const n=await this.runPromise(r);return r.fromPromise(t(n))})}chainLeft(t){return He(async r=>{try{return await this.runPromise(r)}catch(n){return r.fromPromise(t(n))}})}toMaybeAsync(){return hr(async({liftMaybe:t})=>{const r=await this.run();return t(r.toMaybe())})}swap(){return He(async t=>{const r=await this.run();return r.isRight()&&t.throwE(r.extract()),t.liftEither(Tt(r.extract()))})}ifLeft(t){return He(async r=>{const n=await this.run();return n.ifLeft(t),r.liftEither(n)})}ifRight(t){return He(async r=>{const n=await this.run();return n.ifRight(t),r.liftEither(n)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return He(({fromPromise:r})=>r(this.run().finally(t)))}}IR=Symbol.toStringTag;const He=Object.assign(e=>new NR(e),{fromPromise:e=>He(({fromPromise:t})=>t(e())),liftEither:e=>He(({liftEither:t})=>t(e)),lefts:e=>Promise.all(e.map(t=>t.run())).then(Tr.lefts),rights:e=>Promise.all(e.map(t=>t.run())).then(Tr.rights),sequence:e=>He(async t=>{let r=[];for await(const n of e){if(n.isLeft())return t.liftEither(n);r.push(n.extract())}return t.liftEither(Tt(r))}),all:e=>He.fromPromise(async()=>Promise.all(e).then(Tr.sequence))});NR.prototype.constructor=He;var PR;const DR={liftMaybe(e){if(e.isJust())return Promise.resolve(e.extract());throw ft},fromPromise(e){return e.then(DR.liftMaybe)}};class jR{constructor(t){this.runPromise=t,this[PR]="MaybeAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/filter"]=this.filter,this["fantasy-land/alt"]=this.alt}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return hr(async t=>{const r=await this.run();if(r.isJust()){const n=await r.extract();return t.liftMaybe(n)}return t.liftMaybe(ft)})}ap(t){return hr(async r=>{const n=await t;if(n.isJust()){const o=await this.run();return o.isJust()?n.extract()(o.extract()):r.liftMaybe(ft)}return r.liftMaybe(ft)})}alt(t){return hr(async r=>{const n=await this.run();if(n.isJust())return n.extract();{const o=await t;return r.liftMaybe(o)}})}extend(t){return hr(async r=>{const n=await this.run();if(n.isJust()){const o=hr.liftMaybe(n);return r.liftMaybe(or(t(o)))}return r.liftMaybe(ft)})}filter(t){return hr(async r=>{const n=await this.run();return r.liftMaybe(n.filter(t))})}async run(){try{return or(await this.runPromise(DR))}catch{return ft}}map(t){return hr(r=>this.runPromise(r).then(t))}chain(t){return hr(async r=>{const n=await this.runPromise(r);return r.fromPromise(t(n))})}toEitherAsync(t){return He(async({liftEither:r})=>{const n=await this.run();return r(n.toEither(t))})}ifJust(t){return hr(async r=>{const n=await this.run();return n.ifJust(t),r.liftMaybe(n)})}ifNothing(t){return hr(async r=>{const n=await this.run();return n.ifNothing(t),r.liftMaybe(n)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return hr(({fromPromise:r})=>r(this.run().finally(t)))}then(t,r){return this.run().then(t,r)}}PR=Symbol.toStringTag;const hr=Object.assign(e=>new jR(e),{catMaybes:e=>Promise.all(e).then(Ar.catMaybes),fromPromise:e=>hr(({fromPromise:t})=>t(e())),liftMaybe:e=>hr(({liftMaybe:t})=>t(e))});jR.prototype.constructor=hr;function Dt(e){return typeof e=="function"}function Gd(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var lm=Gd(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
28
28
  `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
29
- `):"",this.name="UnsubscriptionError",this.errors=r}});function yd(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Nl=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var u=Fs(l),d=u.next();!d.done;d=u.next()){var p=d.value;p.remove(this)}}catch(S){t={error:S}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}else l.remove(this);var h=this.initialTeardown;if(Pt(h))try{h()}catch(S){a=S instanceof am?S.errors:[S]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var y=Fs(m),w=y.next();!w.done;w=y.next()){var E=w.value;try{hS(E)}catch(S){a=a??[],S instanceof am?a=Us(Us([],Bs(a)),Bs(S.errors)):a.push(S)}}}catch(S){n={error:S}}finally{try{w&&!w.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}}if(a)throw new am(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)hS(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&yd(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&yd(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),DR=Nl.EMPTY;function jR(e){return e instanceof Nl||e&&"closed"in e&&Pt(e.remove)&&Pt(e.add)&&Pt(e.unsubscribe)}function hS(e){Pt(e)?e():e.unsubscribe()}var yz={Promise:void 0},bz={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Us([e,t],Bs(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function MR(e){bz.setTimeout(function(){throw e})}function xg(){}function Hu(e){e()}var _v=(function(e){zn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,jR(r)&&r.add(n)):n.destination=Sz,n}return t.create=function(r,n,o){return new wg(r,n,o)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Nl),xz=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Tu(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Tu(n)}else Tu(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Tu(r)}},e})(),wg=(function(e){zn(t,e);function t(r,n,o){var a=e.call(this)||this,l;return Pt(r)||!r?l={next:r??void 0,error:n??void 0,complete:o??void 0}:l=r,a.destination=new xz(l),a}return t})(_v);function Tu(e){MR(e)}function wz(e){throw e}var Sz={closed:!0,next:xg,error:wz,complete:xg},$v=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Pl(e){return e}function Ez(e){return e.length===0?Pl:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Fr=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=kz(t)?t:new wg(t,r,n);return Hu(function(){var l=o,u=l.operator,d=l.source;a.add(u?u.call(a,d):d?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=mS(r),new r(function(o,a){var l=new wg({next:function(u){try{t(u)}catch(d){a(d),l.unsubscribe()}},error:a,complete:o});n.subscribe(l)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[$v]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Ez(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=mS(t),new t(function(n,o){var a;r.subscribe(function(l){return a=l},function(l){return o(l)},function(){return n(a)})})},e.create=function(t){return new e(t)},e})();function mS(e){var t;return(t=e??yz.Promise)!==null&&t!==void 0?t:Promise}function Cz(e){return e&&Pt(e.next)&&Pt(e.error)&&Pt(e.complete)}function kz(e){return e&&e instanceof _v||Cz(e)&&jR(e)}function Rz(e){return Pt(e?.lift)}function Jr(e){return function(t){if(Rz(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function vn(e,t,r,n,o){return new _z(e,t,r,n,o)}var _z=(function(e){zn(t,e);function t(r,n,o,a,l,u){var d=e.call(this,r)||this;return d.onFinalize=l,d.shouldUnsubscribe=u,d._next=n?function(p){try{n(p)}catch(h){r.error(h)}}:e.prototype._next,d._error=a?function(p){try{a(p)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,d._complete=o?function(){try{o()}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._complete,d}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(_v),$z=Gd(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),oa=(function(e){zn(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new gS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new $z},t.prototype.next=function(r){var n=this;Hu(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=Fs(n.currentObservers),u=l.next();!u.done;u=l.next()){var d=u.value;d.next(r)}}catch(p){o={error:p}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Hu(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;Hu(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,l=o.isStopped,u=o.observers;return a||l?DR:(this.currentObservers=null,u.push(r),new Nl(function(){n.currentObservers=null,yd(u,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,l=n.isStopped;o?r.error(a):l&&r.complete()},t.prototype.asObservable=function(){var r=new Fr;return r.source=this,r},t.create=function(r,n){return new gS(r,n)},t})(Fr),gS=(function(e){zn(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:DR},t})(oa),Az=(function(e){zn(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,a=r._value;if(n)throw o;return this._throwIfClosed(),a},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(oa),Av={now:function(){return(Av.delegate||Date).now()},delegate:void 0},zR=(function(e){zn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Av);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,l=n._infiniteTimeWindow,u=n._timestampProvider,d=n._windowTime;o||(a.push(r),!l&&a.push(u.now()+d)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,l=o._buffer,u=l.slice(),d=0;d<u.length&&!r.closed;d+=a?1:2)r.next(u[d]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,l=r._infiniteTimeWindow,u=(l?1:2)*n;if(n<1/0&&u<a.length&&a.splice(0,a.length-u),!l){for(var d=o.now(),p=0,h=1;h<a.length&&a[h]<=d;h+=2)p=h;p&&a.splice(0,p+1)}},t})(oa),Tz=(function(e){zn(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Nl),vS={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Us([e,t],Bs(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},Lz=(function(e){zn(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.pending=!1,o}return t.prototype.schedule=function(r,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var a=this.id,l=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(l,a,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(l,this.id,n),this},t.prototype.requestAsyncId=function(r,n,o){return o===void 0&&(o=0),vS.setInterval(r.flush.bind(r,this),o)},t.prototype.recycleAsyncId=function(r,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&vS.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(r,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var o=!1,a;try{this.work(r)}catch(l){o=!0,a=l||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),a},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,o=r.scheduler,a=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,yd(a,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Tz),yS=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=Av.now,e})(),Iz=(function(e){zn(t,e);function t(r,n){n===void 0&&(n=yS.now);var o=e.call(this,r,n)||this;return o.actions=[],o._active=!1,o}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var o;this._active=!0;do if(o=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,o){for(;r=n.shift();)r.unsubscribe();throw o}},t})(yS),FR=new Iz(Lz),Oz=FR,Nz=new Fr(function(e){return e.complete()});function BR(e){return e&&Pt(e.schedule)}function Tv(e){return e[e.length-1]}function Pz(e){return Pt(Tv(e))?e.pop():void 0}function Xd(e){return BR(Tv(e))?e.pop():void 0}function Dz(e,t){return typeof Tv(e)=="number"?e.pop():t}var UR=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function VR(e){return Pt(e?.then)}function WR(e){return Pt(e[$v])}function HR(e){return Symbol.asyncIterator&&Pt(e?.[Symbol.asyncIterator])}function qR(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function jz(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var GR=jz();function XR(e){return Pt(e?.[GR])}function YR(e){return ZD(this,arguments,function(){var r,n,o,a;return ZC(this,function(l){switch(l.label){case 0:r=e.getReader(),l.label=1;case 1:l.trys.push([1,,9,10]),l.label=2;case 2:return[4,Ns(r.read())];case 3:return n=l.sent(),o=n.value,a=n.done,a?[4,Ns(void 0)]:[3,5];case 4:return[2,l.sent()];case 5:return[4,Ns(o)];case 6:return[4,l.sent()];case 7:return l.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function KR(e){return Pt(e?.getReader)}function eo(e){if(e instanceof Fr)return e;if(e!=null){if(WR(e))return Mz(e);if(UR(e))return zz(e);if(VR(e))return Fz(e);if(HR(e))return QR(e);if(XR(e))return Bz(e);if(KR(e))return Uz(e)}throw qR(e)}function Mz(e){return new Fr(function(t){var r=e[$v]();if(Pt(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function zz(e){return new Fr(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Fz(e){return new Fr(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,MR)})}function Bz(e){return new Fr(function(t){var r,n;try{for(var o=Fs(e),a=o.next();!a.done;a=o.next()){var l=a.value;if(t.next(l),t.closed)return}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function QR(e){return new Fr(function(t){Vz(e,t).catch(function(r){return t.error(r)})})}function Uz(e){return QR(YR(e))}function Vz(e,t){var r,n,o,a;return JD(this,void 0,void 0,function(){var l,u;return ZC(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),r=ej(e),d.label=1;case 1:return[4,r.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(l=n.value,t.next(l),t.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),o={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Bi(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function JR(e,t){return t===void 0&&(t=0),Jr(function(r,n){r.subscribe(vn(n,function(o){return Bi(n,e,function(){return n.next(o)},t)},function(){return Bi(n,e,function(){return n.complete()},t)},function(o){return Bi(n,e,function(){return n.error(o)},t)}))})}function ZR(e,t){return t===void 0&&(t=0),Jr(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Wz(e,t){return eo(e).pipe(ZR(t),JR(t))}function Hz(e,t){return eo(e).pipe(ZR(t),JR(t))}function qz(e,t){return new Fr(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function Gz(e,t){return new Fr(function(r){var n;return Bi(r,t,function(){n=e[GR](),Bi(r,t,function(){var o,a,l;try{o=n.next(),a=o.value,l=o.done}catch(u){r.error(u);return}l?r.complete():r.next(a)},0,!0)}),function(){return Pt(n?.return)&&n.return()}})}function e_(e,t){if(!e)throw new Error("Iterable cannot be null");return new Fr(function(r){Bi(r,t,function(){var n=e[Symbol.asyncIterator]();Bi(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}function Xz(e,t){return e_(YR(e),t)}function Yz(e,t){if(e!=null){if(WR(e))return Wz(e,t);if(UR(e))return qz(e,t);if(VR(e))return Hz(e,t);if(HR(e))return e_(e,t);if(XR(e))return Gz(e,t);if(KR(e))return Xz(e,t)}throw qR(e)}function Xs(e,t){return t?Yz(e,t):eo(e)}function t_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xd(e);return Xs(e,r)}var Kz=Gd(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function bS(e,t){return new Promise(function(r,n){var o=!1,a;e.subscribe({next:function(l){a=l,o=!0},error:n,complete:function(){o?r(a):n(new Kz)}})})}function r_(e){return e instanceof Date&&!isNaN(e)}var Qz=Gd(function(e){return function(r){r===void 0&&(r=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function xS(e,t){var r=r_(e)?{first:e}:typeof e=="number"?{each:e}:e,n=r.first,o=r.each,a=r.with,l=a===void 0?Jz:a,u=r.scheduler,d=u===void 0?FR:u,p=r.meta,h=p===void 0?null:p;if(n==null&&o==null)throw new TypeError("No timeout provided.");return Jr(function(m,y){var w,E,S=null,C=0,R=function(k){E=Bi(y,d,function(){try{w.unsubscribe(),eo(l({meta:h,lastValue:S,seen:C})).subscribe(y)}catch($){y.error($)}},k)};w=m.subscribe(vn(y,function(k){E?.unsubscribe(),C++,y.next(S=k),o>0&&R(o)},void 0,void 0,function(){E?.closed||E?.unsubscribe(),S=null})),!C&&R(n!=null?typeof n=="number"?n:+n-d.now():o)})}function Jz(e){throw new Qz(e)}function Ui(e,t){return Jr(function(r,n){var o=0;r.subscribe(vn(n,function(a){n.next(e.call(t,a,o++))}))})}function Zz(e,t,r,n,o,a,l,u){var d=[],p=0,h=0,m=!1,y=function(){m&&!d.length&&!p&&t.complete()},w=function(S){return p<n?E(S):d.push(S)},E=function(S){p++;var C=!1;eo(r(S,h++)).subscribe(vn(t,function(R){t.next(R)},function(){C=!0},void 0,function(){if(C)try{p--;for(var R=function(){var k=d.shift();l||E(k)};d.length&&p<n;)R();y()}catch(k){t.error(k)}}))};return e.subscribe(vn(t,w,function(){m=!0,y()})),function(){}}function Lv(e,t,r){return r===void 0&&(r=1/0),Pt(t)?Lv(function(n,o){return Ui(function(a,l){return t(n,a,o,l)})(eo(e(n,o)))},r):(typeof t=="number"&&(r=t),Jr(function(n,o){return Zz(n,o,e,r)}))}function n_(e){return e===void 0&&(e=1/0),Lv(Pl,e)}function eF(){return n_(1)}function wS(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return eF()(Xs(e,Xd(e)))}function tF(e,t,r){r===void 0&&(r=Oz);var n=-1;return t!=null&&(BR(t)?r=t:n=t),new Fr(function(o){var a=r_(e)?+e-r.now():e;a<0&&(a=0);var l=0;return r.schedule(function(){o.closed||(o.next(l++),0<=n?this.schedule(void 0,n):o.complete())},a)})}function rF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xd(e),n=Dz(e,1/0),o=e;return o.length?o.length===1?eo(o[0]):n_(n)(Xs(o,r)):Nz}function SS(e,t){return Jr(function(r,n){var o=0;r.subscribe(vn(n,function(a){return e.call(t,a,o++)&&n.next(a)}))})}function nF(e,t,r,n,o){return function(a,l){var u=r,d=t,p=0;a.subscribe(vn(l,function(h){var m=p++;d=u?e(d,h,m):(u=!0,h),l.next(d)},o))}}function iF(e,t){return t===void 0&&(t=Pl),e=e??oF,Jr(function(r,n){var o,a=!0;r.subscribe(vn(n,function(l){var u=t(l);(a||!e(o,u))&&(a=!1,o=u,n.next(l))}))})}function oF(e,t){return e===t}function sF(e){return Jr(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function aF(e,t){return Jr(nF(e,t,arguments.length>=2,!0))}function lF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xd(e);return Jr(function(n,o){(r?wS(e,n,r):wS(e,n)).subscribe(o)})}function ES(e,t,r){var n=Pt(e)||t||r?{next:e,error:t,complete:r}:e;return n?Jr(function(o,a){var l;(l=n.subscribe)===null||l===void 0||l.call(n);var u=!0;o.subscribe(vn(a,function(d){var p;(p=n.next)===null||p===void 0||p.call(n,d),a.next(d)},function(){var d;u=!1,(d=n.complete)===null||d===void 0||d.call(n),a.complete()},function(d){var p;u=!1,(p=n.error)===null||p===void 0||p.call(n,d),a.error(d)},function(){var d,p;u&&((d=n.unsubscribe)===null||d===void 0||d.call(n)),(p=n.finalize)===null||p===void 0||p.call(n)}))}):Pl}function cF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Pz(e);return Jr(function(n,o){for(var a=e.length,l=new Array(a),u=e.map(function(){return!1}),d=!1,p=function(m){eo(e[m]).subscribe(vn(o,function(y){l[m]=y,!d&&!u[m]&&(u[m]=!0,(d=u.every(Pl))&&(u=null))},xg))},h=0;h<a;h++)p(h);n.subscribe(vn(o,function(m){if(d){var y=Us([m],Bs(l));o.next(r?r.apply(void 0,Us([],Bs(y))):y)}}))})}const uF="BOLOS",dF=[uF,"OLOS","OLOS\0"],Iv=e=>e!=null&&dF.includes(e);var Ys=(e=>(e[e.Connected=0]="Connected",e[e.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",e[e.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",e))(Ys||{});let Dl=class{_tag="GeneralDmkError";originalError;constructor(t){t instanceof Error?this.originalError=t:t!==void 0&&(this.originalError=new Error(String(t)))}},Ov=class extends Dl{constructor(t){super(t),this.err=t}_tag="TransportNotSupportedError"},fF=class extends Dl{constructor(t){super(t),this.err=t}_tag="SendApduTimeoutError"},pF=class extends Dl{constructor(t){super(t),this.err=t}_tag="SendCommandTimeoutError"},hF=class extends Dl{constructor(t){super(t),this.err=t}_tag="TransportAlreadyExistsError"},mF=class extends Dl{constructor(t){super(t),this.err=t}_tag="NoTransportProvidedError"};var As=null;typeof WebSocket<"u"?As=WebSocket:typeof MozWebSocket<"u"?As=MozWebSocket:typeof self<"u"?As=self.WebSocket||self.MozWebSocket:typeof window<"u"?As=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(As=self.WebSocket||self.MozWebSocket);const gF=As;var vF=(e=>(e.GenuineCheck="GenuineCheck",e.ListInstalledApps="ListInstalledApps",e.UpdateMcu="UpdateMcu",e.UpdateFirmware="UpdateFirmware",e.InstallApp="InstallApp",e.UninstallApp="UninstallApp",e))(vF||{}),yF=(e=>(e.EXCHANGE="exchange",e.BULK="bulk",e.ERROR="error",e.WARNING="warning",e.SUCCESS="success",e))(yF||{}),bF=(e=>(e.SUCCESS="success",e.ERROR="error",e))(bF||{}),xF=(e=>(e.Opened="opened",e.Closed="closed",e.PermissionRequested="permission-requested",e.PermissionGranted="permission-granted",e.PreExchange="pre-exchange",e.Exchange="exchange",e.DeviceId="device-id",e.Progress="progress",e.Warning="warning",e.Error="error",e.Result="result",e))(xF||{}),wF=(e=>(e[e.AppAlreadyInstalled=0]="AppAlreadyInstalled",e[e.DeviceLocked=1]="DeviceLocked",e[e.OutOfMemory=2]="OutOfMemory",e[e.RefusedByUser=3]="RefusedByUser",e[e.Unknown=4]="Unknown",e))(wF||{});let SF=class{constructor(t){this.error=t,this.originalError=t}_tag="WebSocketConnectionError";originalError};function Nv(e,t){return Reflect.getOwnMetadata(t,e)}function EF(e,t,r){Reflect.defineMetadata(t,r,e)}function cl(e,t,r,n){const o=n(Nv(e,t)??r());Reflect.defineMetadata(t,o,e)}var CS,kS,RS;(function(e){e.moduleId="moduleId",e.serviceId="serviceId"})(CS||(CS={}));(function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"})(kS||(kS={}));(function(e){e.moduleId="moduleId",e.serviceId="serviceId"})(RS||(RS={}));const qu="@inversifyjs/core/classMetadataReflectKey";function Gu(){return{constructorArguments:[],lifecycle:{postConstructMethodName:void 0,preDestroyMethodName:void 0},properties:new Map,scope:void 0}}const CF="@inversifyjs/core/pendingClassMetadataCountReflectKey",lm=Symbol.for("@inversifyjs/core/InversifyCoreError");let Vi=class i_ extends Error{[lm];kind;constructor(t,r,n){super(r,n),this[lm]=!0,this.kind=t}static is(t){return typeof t=="object"&&t!==null&&t[lm]===!0}static isErrorOfKind(t,r){return i_.is(t)&&t.kind===r}};var Dn,bd,Cl;function kF(){return 0}function RF(e){return t=>{t!==void 0&&t.kind===bd.unknown&&cl(e,CF,kF,(r=>r-1))}}function _F(e,t){return(...r)=>n=>{if(n===void 0)return e(...r);if(n.kind===Cl.unmanaged)throw new Vi(Dn.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(n,...r)}}function $F(e){if(e.kind!==bd.unknown&&e.isFromTypescriptParamType!==!0)throw new Vi(Dn.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}(function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"})(Dn||(Dn={})),(function(e){e[e.unknown=32]="unknown"})(bd||(bd={})),(function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"})(Cl||(Cl={}));const AF=_F((function(e,t){return{kind:e,name:void 0,optional:!1,tags:new Map,value:t}}),(function(e,t,r){return $F(e),{...e,kind:t,value:r}}));function _S(e,t){return r=>{const n=r.properties.get(t);return r.properties.set(t,e(n)),r}}var Mi;function TF(e,t,r,n){if(Vi.isErrorOfKind(n,Dn.injectionDecoratorConflict)){const o=(function(a,l,u){if(u===void 0){if(l===void 0)throw new Vi(Dn.unknown,"Unexpected undefined property and index values");return{kind:Mi.property,property:l,targetClass:a.constructor}}return typeof u=="number"?{index:u,kind:Mi.parameter,targetClass:a}:{kind:Mi.method,method:l,targetClass:a}})(e,t,r);throw new Vi(Dn.injectionDecoratorConflict,`Unexpected injection error.
29
+ `):"",this.name="UnsubscriptionError",this.errors=r}});function yd(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Nl=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var u=Fs(l),d=u.next();!d.done;d=u.next()){var p=d.value;p.remove(this)}}catch(S){t={error:S}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}else l.remove(this);var h=this.initialTeardown;if(Dt(h))try{h()}catch(S){a=S instanceof lm?S.errors:[S]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var y=Fs(m),w=y.next();!w.done;w=y.next()){var E=w.value;try{hS(E)}catch(S){a=a??[],S instanceof lm?a=Us(Us([],Bs(a)),Bs(S.errors)):a.push(S)}}}catch(S){n={error:S}}finally{try{w&&!w.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}}if(a)throw new lm(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)hS(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&yd(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&yd(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),MR=Nl.EMPTY;function zR(e){return e instanceof Nl||e&&"closed"in e&&Dt(e.remove)&&Dt(e.add)&&Dt(e.unsubscribe)}function hS(e){Dt(e)?e():e.unsubscribe()}var wz={Promise:void 0},Sz={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Us([e,t],Bs(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function FR(e){Sz.setTimeout(function(){throw e})}function wg(){}function Hu(e){e()}var $v=(function(e){zn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,zR(r)&&r.add(n)):n.destination=kz,n}return t.create=function(r,n,o){return new Sg(r,n,o)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Nl),Ez=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Tu(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Tu(n)}else Tu(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Tu(r)}},e})(),Sg=(function(e){zn(t,e);function t(r,n,o){var a=e.call(this)||this,l;return Dt(r)||!r?l={next:r??void 0,error:n??void 0,complete:o??void 0}:l=r,a.destination=new Ez(l),a}return t})($v);function Tu(e){FR(e)}function Cz(e){throw e}var kz={closed:!0,next:wg,error:Cz,complete:wg},Av=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Pl(e){return e}function Rz(e){return e.length===0?Pl:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Fr=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=$z(t)?t:new Sg(t,r,n);return Hu(function(){var l=o,u=l.operator,d=l.source;a.add(u?u.call(a,d):d?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=mS(r),new r(function(o,a){var l=new Sg({next:function(u){try{t(u)}catch(d){a(d),l.unsubscribe()}},error:a,complete:o});n.subscribe(l)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Av]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Rz(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=mS(t),new t(function(n,o){var a;r.subscribe(function(l){return a=l},function(l){return o(l)},function(){return n(a)})})},e.create=function(t){return new e(t)},e})();function mS(e){var t;return(t=e??wz.Promise)!==null&&t!==void 0?t:Promise}function _z(e){return e&&Dt(e.next)&&Dt(e.error)&&Dt(e.complete)}function $z(e){return e&&e instanceof $v||_z(e)&&zR(e)}function Az(e){return Dt(e?.lift)}function Jr(e){return function(t){if(Az(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function vn(e,t,r,n,o){return new Tz(e,t,r,n,o)}var Tz=(function(e){zn(t,e);function t(r,n,o,a,l,u){var d=e.call(this,r)||this;return d.onFinalize=l,d.shouldUnsubscribe=u,d._next=n?function(p){try{n(p)}catch(h){r.error(h)}}:e.prototype._next,d._error=a?function(p){try{a(p)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,d._complete=o?function(){try{o()}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._complete,d}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})($v),Lz=Gd(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),oa=(function(e){zn(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new gS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Lz},t.prototype.next=function(r){var n=this;Hu(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=Fs(n.currentObservers),u=l.next();!u.done;u=l.next()){var d=u.value;d.next(r)}}catch(p){o={error:p}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Hu(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;Hu(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,l=o.isStopped,u=o.observers;return a||l?MR:(this.currentObservers=null,u.push(r),new Nl(function(){n.currentObservers=null,yd(u,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,l=n.isStopped;o?r.error(a):l&&r.complete()},t.prototype.asObservable=function(){var r=new Fr;return r.source=this,r},t.create=function(r,n){return new gS(r,n)},t})(Fr),gS=(function(e){zn(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:MR},t})(oa),BR=(function(e){zn(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,a=r._value;if(n)throw o;return this._throwIfClosed(),a},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(oa),Tv={now:function(){return(Tv.delegate||Date).now()},delegate:void 0},UR=(function(e){zn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Tv);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,l=n._infiniteTimeWindow,u=n._timestampProvider,d=n._windowTime;o||(a.push(r),!l&&a.push(u.now()+d)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,l=o._buffer,u=l.slice(),d=0;d<u.length&&!r.closed;d+=a?1:2)r.next(u[d]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,l=r._infiniteTimeWindow,u=(l?1:2)*n;if(n<1/0&&u<a.length&&a.splice(0,a.length-u),!l){for(var d=o.now(),p=0,h=1;h<a.length&&a[h]<=d;h+=2)p=h;p&&a.splice(0,p+1)}},t})(oa),Iz=(function(e){zn(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Nl),vS={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Us([e,t],Bs(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},Oz=(function(e){zn(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.pending=!1,o}return t.prototype.schedule=function(r,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var a=this.id,l=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(l,a,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(l,this.id,n),this},t.prototype.requestAsyncId=function(r,n,o){return o===void 0&&(o=0),vS.setInterval(r.flush.bind(r,this),o)},t.prototype.recycleAsyncId=function(r,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&vS.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(r,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var o=!1,a;try{this.work(r)}catch(l){o=!0,a=l||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),a},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,o=r.scheduler,a=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,yd(a,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Iz),yS=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=Tv.now,e})(),Nz=(function(e){zn(t,e);function t(r,n){n===void 0&&(n=yS.now);var o=e.call(this,r,n)||this;return o.actions=[],o._active=!1,o}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var o;this._active=!0;do if(o=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,o){for(;r=n.shift();)r.unsubscribe();throw o}},t})(yS),VR=new Nz(Oz),Pz=VR,Dz=new Fr(function(e){return e.complete()});function WR(e){return e&&Dt(e.schedule)}function Lv(e){return e[e.length-1]}function jz(e){return Dt(Lv(e))?e.pop():void 0}function Xd(e){return WR(Lv(e))?e.pop():void 0}function Mz(e,t){return typeof Lv(e)=="number"?e.pop():t}var HR=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function qR(e){return Dt(e?.then)}function GR(e){return Dt(e[Av])}function XR(e){return Symbol.asyncIterator&&Dt(e?.[Symbol.asyncIterator])}function YR(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zz(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var KR=zz();function QR(e){return Dt(e?.[KR])}function JR(e){return rj(this,arguments,function(){var r,n,o,a;return tk(this,function(l){switch(l.label){case 0:r=e.getReader(),l.label=1;case 1:l.trys.push([1,,9,10]),l.label=2;case 2:return[4,Ns(r.read())];case 3:return n=l.sent(),o=n.value,a=n.done,a?[4,Ns(void 0)]:[3,5];case 4:return[2,l.sent()];case 5:return[4,Ns(o)];case 6:return[4,l.sent()];case 7:return l.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function ZR(e){return Dt(e?.getReader)}function eo(e){if(e instanceof Fr)return e;if(e!=null){if(GR(e))return Fz(e);if(HR(e))return Bz(e);if(qR(e))return Uz(e);if(XR(e))return e_(e);if(QR(e))return Vz(e);if(ZR(e))return Wz(e)}throw YR(e)}function Fz(e){return new Fr(function(t){var r=e[Av]();if(Dt(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Bz(e){return new Fr(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Uz(e){return new Fr(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,FR)})}function Vz(e){return new Fr(function(t){var r,n;try{for(var o=Fs(e),a=o.next();!a.done;a=o.next()){var l=a.value;if(t.next(l),t.closed)return}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function e_(e){return new Fr(function(t){Hz(e,t).catch(function(r){return t.error(r)})})}function Wz(e){return e_(JR(e))}function Hz(e,t){var r,n,o,a;return tj(this,void 0,void 0,function(){var l,u;return tk(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),r=nj(e),d.label=1;case 1:return[4,r.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(l=n.value,t.next(l),t.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),o={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Ui(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function t_(e,t){return t===void 0&&(t=0),Jr(function(r,n){r.subscribe(vn(n,function(o){return Ui(n,e,function(){return n.next(o)},t)},function(){return Ui(n,e,function(){return n.complete()},t)},function(o){return Ui(n,e,function(){return n.error(o)},t)}))})}function r_(e,t){return t===void 0&&(t=0),Jr(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function qz(e,t){return eo(e).pipe(r_(t),t_(t))}function Gz(e,t){return eo(e).pipe(r_(t),t_(t))}function Xz(e,t){return new Fr(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function Yz(e,t){return new Fr(function(r){var n;return Ui(r,t,function(){n=e[KR](),Ui(r,t,function(){var o,a,l;try{o=n.next(),a=o.value,l=o.done}catch(u){r.error(u);return}l?r.complete():r.next(a)},0,!0)}),function(){return Dt(n?.return)&&n.return()}})}function n_(e,t){if(!e)throw new Error("Iterable cannot be null");return new Fr(function(r){Ui(r,t,function(){var n=e[Symbol.asyncIterator]();Ui(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}function Kz(e,t){return n_(JR(e),t)}function Qz(e,t){if(e!=null){if(GR(e))return qz(e,t);if(HR(e))return Xz(e,t);if(qR(e))return Gz(e,t);if(XR(e))return n_(e,t);if(QR(e))return Yz(e,t);if(ZR(e))return Kz(e,t)}throw YR(e)}function Xs(e,t){return t?Qz(e,t):eo(e)}function i_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xd(e);return Xs(e,r)}var Jz=Gd(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function bS(e,t){return new Promise(function(r,n){var o=!1,a;e.subscribe({next:function(l){a=l,o=!0},error:n,complete:function(){o?r(a):n(new Jz)}})})}function o_(e){return e instanceof Date&&!isNaN(e)}var Zz=Gd(function(e){return function(r){r===void 0&&(r=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function xS(e,t){var r=o_(e)?{first:e}:typeof e=="number"?{each:e}:e,n=r.first,o=r.each,a=r.with,l=a===void 0?eF:a,u=r.scheduler,d=u===void 0?VR:u,p=r.meta,h=p===void 0?null:p;if(n==null&&o==null)throw new TypeError("No timeout provided.");return Jr(function(m,y){var w,E,S=null,C=0,R=function(k){E=Ui(y,d,function(){try{w.unsubscribe(),eo(l({meta:h,lastValue:S,seen:C})).subscribe(y)}catch($){y.error($)}},k)};w=m.subscribe(vn(y,function(k){E?.unsubscribe(),C++,y.next(S=k),o>0&&R(o)},void 0,void 0,function(){E?.closed||E?.unsubscribe(),S=null})),!C&&R(n!=null?typeof n=="number"?n:+n-d.now():o)})}function eF(e){throw new Zz(e)}function ai(e,t){return Jr(function(r,n){var o=0;r.subscribe(vn(n,function(a){n.next(e.call(t,a,o++))}))})}function tF(e,t,r,n,o,a,l,u){var d=[],p=0,h=0,m=!1,y=function(){m&&!d.length&&!p&&t.complete()},w=function(S){return p<n?E(S):d.push(S)},E=function(S){p++;var C=!1;eo(r(S,h++)).subscribe(vn(t,function(R){t.next(R)},function(){C=!0},void 0,function(){if(C)try{p--;for(var R=function(){var k=d.shift();l||E(k)};d.length&&p<n;)R();y()}catch(k){t.error(k)}}))};return e.subscribe(vn(t,w,function(){m=!0,y()})),function(){}}function Iv(e,t,r){return r===void 0&&(r=1/0),Dt(t)?Iv(function(n,o){return ai(function(a,l){return t(n,a,o,l)})(eo(e(n,o)))},r):(typeof t=="number"&&(r=t),Jr(function(n,o){return tF(n,o,e,r)}))}function s_(e){return e===void 0&&(e=1/0),Iv(Pl,e)}function rF(){return s_(1)}function wS(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return rF()(Xs(e,Xd(e)))}function nF(e,t,r){r===void 0&&(r=Pz);var n=-1;return t!=null&&(WR(t)?r=t:n=t),new Fr(function(o){var a=o_(e)?+e-r.now():e;a<0&&(a=0);var l=0;return r.schedule(function(){o.closed||(o.next(l++),0<=n?this.schedule(void 0,n):o.complete())},a)})}function iF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xd(e),n=Mz(e,1/0),o=e;return o.length?o.length===1?eo(o[0]):s_(n)(Xs(o,r)):Dz}function SS(e,t){return Jr(function(r,n){var o=0;r.subscribe(vn(n,function(a){return e.call(t,a,o++)&&n.next(a)}))})}function oF(e,t,r,n,o){return function(a,l){var u=r,d=t,p=0;a.subscribe(vn(l,function(h){var m=p++;d=u?e(d,h,m):(u=!0,h),l.next(d)},o))}}function sF(e,t){return t===void 0&&(t=Pl),e=e??aF,Jr(function(r,n){var o,a=!0;r.subscribe(vn(n,function(l){var u=t(l);(a||!e(o,u))&&(a=!1,o=u,n.next(l))}))})}function aF(e,t){return e===t}function lF(e){return Jr(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function cF(e,t){return Jr(oF(e,t,arguments.length>=2,!0))}function uF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xd(e);return Jr(function(n,o){(r?wS(e,n,r):wS(e,n)).subscribe(o)})}function ES(e,t,r){var n=Dt(e)||t||r?{next:e,error:t,complete:r}:e;return n?Jr(function(o,a){var l;(l=n.subscribe)===null||l===void 0||l.call(n);var u=!0;o.subscribe(vn(a,function(d){var p;(p=n.next)===null||p===void 0||p.call(n,d),a.next(d)},function(){var d;u=!1,(d=n.complete)===null||d===void 0||d.call(n),a.complete()},function(d){var p;u=!1,(p=n.error)===null||p===void 0||p.call(n,d),a.error(d)},function(){var d,p;u&&((d=n.unsubscribe)===null||d===void 0||d.call(n)),(p=n.finalize)===null||p===void 0||p.call(n)}))}):Pl}function dF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=jz(e);return Jr(function(n,o){for(var a=e.length,l=new Array(a),u=e.map(function(){return!1}),d=!1,p=function(m){eo(e[m]).subscribe(vn(o,function(y){l[m]=y,!d&&!u[m]&&(u[m]=!0,(d=u.every(Pl))&&(u=null))},wg))},h=0;h<a;h++)p(h);n.subscribe(vn(o,function(m){if(d){var y=Us([m],Bs(l));o.next(r?r.apply(void 0,Us([],Bs(y))):y)}}))})}const fF="BOLOS",pF=[fF,"OLOS","OLOS\0"],Ov=e=>e!=null&&pF.includes(e);var Ys=(e=>(e[e.Connected=0]="Connected",e[e.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",e[e.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",e))(Ys||{});let Dl=class{_tag="GeneralDmkError";originalError;constructor(t){t instanceof Error?this.originalError=t:t!==void 0&&(this.originalError=new Error(String(t)))}},Nv=class extends Dl{constructor(t){super(t),this.err=t}_tag="TransportNotSupportedError"},hF=class extends Dl{constructor(t){super(t),this.err=t}_tag="SendApduTimeoutError"},mF=class extends Dl{constructor(t){super(t),this.err=t}_tag="SendCommandTimeoutError"},gF=class extends Dl{constructor(t){super(t),this.err=t}_tag="TransportAlreadyExistsError"},vF=class extends Dl{constructor(t){super(t),this.err=t}_tag="NoTransportProvidedError"};var As=null;typeof WebSocket<"u"?As=WebSocket:typeof MozWebSocket<"u"?As=MozWebSocket:typeof self<"u"?As=self.WebSocket||self.MozWebSocket:typeof window<"u"?As=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(As=self.WebSocket||self.MozWebSocket);const yF=As;var bF=(e=>(e.GenuineCheck="GenuineCheck",e.ListInstalledApps="ListInstalledApps",e.UpdateMcu="UpdateMcu",e.UpdateFirmware="UpdateFirmware",e.InstallApp="InstallApp",e.UninstallApp="UninstallApp",e))(bF||{}),xF=(e=>(e.EXCHANGE="exchange",e.BULK="bulk",e.ERROR="error",e.WARNING="warning",e.SUCCESS="success",e))(xF||{}),wF=(e=>(e.SUCCESS="success",e.ERROR="error",e))(wF||{}),SF=(e=>(e.Opened="opened",e.Closed="closed",e.PermissionRequested="permission-requested",e.PermissionGranted="permission-granted",e.PreExchange="pre-exchange",e.Exchange="exchange",e.DeviceId="device-id",e.Progress="progress",e.Warning="warning",e.Error="error",e.Result="result",e))(SF||{}),EF=(e=>(e[e.AppAlreadyInstalled=0]="AppAlreadyInstalled",e[e.DeviceLocked=1]="DeviceLocked",e[e.OutOfMemory=2]="OutOfMemory",e[e.RefusedByUser=3]="RefusedByUser",e[e.Unknown=4]="Unknown",e))(EF||{});let CF=class{constructor(t){this.error=t,this.originalError=t}_tag="WebSocketConnectionError";originalError};function Pv(e,t){return Reflect.getOwnMetadata(t,e)}function kF(e,t,r){Reflect.defineMetadata(t,r,e)}function cl(e,t,r,n){const o=n(Pv(e,t)??r());Reflect.defineMetadata(t,o,e)}var CS,kS,RS;(function(e){e.moduleId="moduleId",e.serviceId="serviceId"})(CS||(CS={}));(function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"})(kS||(kS={}));(function(e){e.moduleId="moduleId",e.serviceId="serviceId"})(RS||(RS={}));const qu="@inversifyjs/core/classMetadataReflectKey";function Gu(){return{constructorArguments:[],lifecycle:{postConstructMethodName:void 0,preDestroyMethodName:void 0},properties:new Map,scope:void 0}}const RF="@inversifyjs/core/pendingClassMetadataCountReflectKey",cm=Symbol.for("@inversifyjs/core/InversifyCoreError");let Vi=class a_ extends Error{[cm];kind;constructor(t,r,n){super(r,n),this[cm]=!0,this.kind=t}static is(t){return typeof t=="object"&&t!==null&&t[cm]===!0}static isErrorOfKind(t,r){return a_.is(t)&&t.kind===r}};var Dn,bd,Cl;function _F(){return 0}function $F(e){return t=>{t!==void 0&&t.kind===bd.unknown&&cl(e,RF,_F,(r=>r-1))}}function AF(e,t){return(...r)=>n=>{if(n===void 0)return e(...r);if(n.kind===Cl.unmanaged)throw new Vi(Dn.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(n,...r)}}function TF(e){if(e.kind!==bd.unknown&&e.isFromTypescriptParamType!==!0)throw new Vi(Dn.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}(function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"})(Dn||(Dn={})),(function(e){e[e.unknown=32]="unknown"})(bd||(bd={})),(function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"})(Cl||(Cl={}));const LF=AF((function(e,t){return{kind:e,name:void 0,optional:!1,tags:new Map,value:t}}),(function(e,t,r){return TF(e),{...e,kind:t,value:r}}));function _S(e,t){return r=>{const n=r.properties.get(t);return r.properties.set(t,e(n)),r}}var zi;function IF(e,t,r,n){if(Vi.isErrorOfKind(n,Dn.injectionDecoratorConflict)){const o=(function(a,l,u){if(u===void 0){if(l===void 0)throw new Vi(Dn.unknown,"Unexpected undefined property and index values");return{kind:zi.property,property:l,targetClass:a.constructor}}return typeof u=="number"?{index:u,kind:zi.parameter,targetClass:a}:{kind:zi.method,method:l,targetClass:a}})(e,t,r);throw new Vi(Dn.injectionDecoratorConflict,`Unexpected injection error.
30
30
 
31
31
  Cause:
32
32
 
@@ -34,21 +34,21 @@ ${n.message}
34
34
 
35
35
  Details
36
36
 
37
- ${(function(a){switch(a.kind){case Mi.method:return`[class: "${a.targetClass.name}", method: "${a.method.toString()}"]`;case Mi.parameter:return`[class: "${a.targetClass.name}", index: "${a.index.toString()}"]`;case Mi.property:return`[class: "${a.targetClass.name}", property: "${a.property.toString()}"]`}})(o)}`,{cause:n})}throw n}function LF(e,t){return(r,n,o)=>{try{o===void 0?(function(a,l){const u=cm(a,l);return(d,p)=>{cl(d.constructor,qu,Gu,_S(u(d),p))}})(e,t)(r,n):typeof o=="number"?(function(a,l){const u=cm(a,l);return(d,p,h)=>{if(!(function(m,y){return typeof m=="function"&&y===void 0})(d,p))throw new Vi(Dn.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.
38
- Found @inject decorator at method "${p?.toString()??""}" at class "${d.constructor.name}"`);cl(d,qu,Gu,(function(m,y){return w=>{const E=w.constructorArguments[y];return w.constructorArguments[y]=m(E),w}})(u(d),h))}})(e,t)(r,n,o):(function(a,l){const u=cm(a,l);return(d,p,h)=>{if(!(function(m){return m.set!==void 0})(h))throw new Vi(Dn.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.
39
- Found @inject decorator at method "${p.toString()}" at class "${d.constructor.name}"`);cl(d.constructor,qu,Gu,_S(u(d),p))}})(e,t)(r,n,o)}catch(a){TF(r,n,o,a)}}}function cm(e,t){return r=>{const n=t(r);return o=>(n(o),e(o))}}function Oe(e){return LF(AF(Cl.singleInjection,e),RF)}(function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"})(Mi||(Mi={}));const $S="@inversifyjs/core/classIsInjectableFlagReflectKey",IF=[Array,BigInt,Boolean,Function,Number,Object,String];function OF(e){const t=Nv(e,"design:paramtypes");t!==void 0&&cl(e,qu,Gu,(function(r){return n=>(r.forEach(((o,a)=>{var l;n.constructorArguments[a]!==void 0||(l=o,IF.includes(l))||(n.constructorArguments[a]=(function(u){return{isFromTypescriptParamType:!0,kind:Cl.singleInjection,name:void 0,optional:!1,tags:new Map,value:u}})(o))})),n)})(t))}function Qe(e){return t=>{(function(r){if(Nv(r,$S)!==void 0)throw new Vi(Dn.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${r.name}"`);EF(r,$S,!0)})(t),OF(t)}}var AS;(function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"})(AS||(AS={}));var TS;(function(e){e[e.singleMandatory=0]="singleMandatory",e[e.singleOptional=1]="singleOptional",e[e.multipleMandatory=2]="multipleMandatory",e[e.multipleOptional=3]="multipleOptional",e[e.length=4]="length"})(TS||(TS={}));let NF=class{constructor(t,r,n,o,a){this.deviceModel=t,this.serviceUuid=r,this.writeUuid=n,this.writeCmdUuid=o,this.notifyUuid=a}},Cs=class{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;getBlockSize;masks;bluetoothSpec;constructor(t){this.id=t.id,this.productName=t.productName,this.usbProductId=t.usbProductId,this.bootloaderUsbProductId=t.bootloaderUsbProductId,this.usbOnly=t.usbOnly,this.memorySize=t.memorySize,this.getBlockSize=t.getBlockSize,this.masks=t.masks,this.bluetoothSpec=t.bluetoothSpec}};var PF=Object.defineProperty,DF=(e,t,r)=>t in e?PF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},MF=(e,t,r)=>DF(e,t+"",r);let Oo=class{getAllDeviceModels(){return Object.values(Oo.deviceModelByIds)}getDeviceModel(t){return Oo.deviceModelByIds[t.id]}filterDeviceModels(t){return this.getAllDeviceModels().filter(r=>Object.entries(t).every(([n,o])=>r[n]===o))}getBluetoothServicesInfos(){return Object.values(Oo.deviceModelByIds).reduce((t,r)=>{const{bluetoothSpec:n}=r;return n?{...t,...n.reduce((o,a)=>({...o,[a.serviceUuid]:new NF(r,a.serviceUuid,a.writeUuid,a.writeCmdUuid,a.notifyUuid)}),{})}:t},{})}getBluetoothServices(){return Object.values(Oo.deviceModelByIds).map(t=>(t.bluetoothSpec||[]).map(r=>r.serviceUuid)).flat().filter(t=>!!t)}};MF(Oo,"deviceModelByIds",{[wt.NANO_S]:new Cs({id:wt.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,getBlockSize:e=>pS.lt(pS.coerce(e.firmwareVersion)??"","2.0.0")?4*1024:2*1024,masks:[823132160]}),[wt.NANO_SP]:new Cs({id:wt.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,getBlockSize:()=>512,masks:[856686592]}),[wt.NANO_X]:new Cs({id:wt.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,getBlockSize:()=>4*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]}),[wt.STAX]:new Cs({id:wt.STAX,productName:"Ledger Stax",usbProductId:96,bootloaderUsbProductId:6,usbOnly:!1,memorySize:1533*1024,getBlockSize:()=>512,masks:[857735168],bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}),[wt.FLEX]:new Cs({id:wt.FLEX,productName:"Ledger Flex",usbProductId:112,bootloaderUsbProductId:7,usbOnly:!1,memorySize:1533*1024,getBlockSize:()=>512,masks:[858783744],bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}),[wt.APEX]:new Cs({id:wt.APEX,productName:"Ledger Nano Gen5",usbProductId:128,bootloaderUsbProductId:8,usbOnly:!1,memorySize:1533*1024,getBlockSize:()=>512,masks:[859832320],bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"},{serviceUuid:"13d63400-2c97-9004-0000-4c6564676572",notifyUuid:"13d63400-2c97-9004-0001-4c6564676572",writeUuid:"13d63400-2c97-9004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-9004-0003-4c6564676572"}]})}),Oo=jF([Qe()],Oo);let zF=class{statusCode;data;constructor({statusCode:t,data:r}){this.statusCode=t,this.data=r}};const FF=5,Ao=1,Sg=2,Ls=2,Eg=2,ir=[];for(let e=0;e<256;++e)ir.push((e+256).toString(16).slice(1));function BF(e,t=0){return(ir[e[t+0]]+ir[e[t+1]]+ir[e[t+2]]+ir[e[t+3]]+"-"+ir[e[t+4]]+ir[e[t+5]]+"-"+ir[e[t+6]]+ir[e[t+7]]+"-"+ir[e[t+8]]+ir[e[t+9]]+"-"+ir[e[t+10]]+ir[e[t+11]]+ir[e[t+12]]+ir[e[t+13]]+ir[e[t+14]]+ir[e[t+15]]).toLowerCase()}let um;const UF=new Uint8Array(16);function VF(){if(!um){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");um=crypto.getRandomValues.bind(crypto)}return um(UF)}const WF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),LS={randomUUID:WF};function Yd(e,t,r){if(LS.randomUUID&&!e)return LS.randomUUID();e=e||{};const n=e.random||(e.rng||VF)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,BF(n)}const No={getLastBytesFrom(e,t){return e.slice(-t)},getFirstBytesFrom(e,t){return e.slice(0,t)},bytesToNumber(e){return e.reduce((t,r,n)=>t+r*Math.pow(256,e.length-1-n),0)},numberToByteArray(e,t){return new Uint8Array(t).map((r,n)=>e>>8*(t-1-n)&255)}},IS=2,dm=800;let OS=class{_tag="FramerOverflowError";originalError;constructor(){this.originalError=new Error("Frame header length is greater than frame size")}},HF=class{_tag="FramerApduError";originalError;constructor(){this.originalError=new Error("Frame offset is greater than apdu length")}},NS=class{_tag="ReceiverApduError";originalError;constructor(t){this.originalError=new Error(t??"Unable to parse apdu")}},PS=class{_tag="DeviceSessionNotFound";originalError;constructor(t){this.originalError=t??new Error("Device session not found")}},o_=class{_header;_data;constructor({header:t,data:r}){this._header=t,this._data=r}toString(){return JSON.stringify({header:this._header.toString(),data:si(this._data)},null,2)}getRawData(){const t=this._header.getRawData(),r=new Uint8Array(t.length+this._data.length);return r.set(t,0),r.set(this._data,t.length),r}getHeader(){return this._header}getData(){return this._data}},s_=class{_uuid;_channel;_headTag;_index;_length;_dataLength;constructor({uuid:t,dataSize:r,index:n,headTag:o,length:a,channel:l}){this._uuid=t,this._dataLength=r,this._index=n,this._headTag=o,this._length=a,this._channel=l}getDataLength(){return this._dataLength.map(t=>No.bytesToNumber(t))}setDataSize(t){return this._dataLength=t,this}getLength(){return this._length}toString(){return JSON.stringify({uuid:this._uuid.toString(),dataSize:this._dataLength.extract()?.toString(),index:this._index.toString(),headTag:this._headTag.toString(),length:this._length.toString(),channel:this._channel.extract()?.toString()})}getRawData(){return new Uint8Array([...this._channel.caseOf({Just:t=>[...t],Nothing:()=>[]}),...this._headTag,...this._index,...this._dataLength.caseOf({Just:t=>[...t],Nothing:()=>[]})])}};const Dt={LoggerPublisherServiceFactory:Symbol.for("LoggerPublisherServiceFactory")};var qF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},GF=(e,t)=>(r,n)=>t(r,n,e);let DS=class{_channel;_logger;_pendingFrames;constructor({channel:t=Ar.zero()},r){this._channel=t,this._logger=r("ApduReceiverService"),this._pendingFrames=[]}handleFrame(t){return this.getFrameFromBytes(t).map(r=>{if(this._pendingFrames.push(r),!this._pendingFrames[0])return ft;const n=this._pendingFrames[0].getHeader().getDataLength();return this.getCompleteFrame(n)})}getCompleteFrame(t){return t.chain(r=>{if(!this.isComplete(r))return this._logger.debug("frame is not complete, waiting for more"),ft;const n=No.getFirstBytesFrom(this.concatFrames(this._pendingFrames),r),o=No.getFirstBytesFrom(n,n.length-IS),a=No.getLastBytesFrom(n,IS);return this._pendingFrames=[],or(new zF({data:o,statusCode:a}))})}getFrameFromBytes(t){const r=this._channel.caseOf({Just:()=>Sg,Nothing:()=>0}),n=t.slice(r,r+Ao),o=t.slice(r+Ao,r+Ao+Ls),a=o.reduce((y,w)=>y+w,0)===0;if(!a&&this._pendingFrames.length===0)return yt(new NS);const l=r+Ao+Ls,u=a?Eg:0;if(t.length<r+Ao+Ls+u)return yt(new NS("Unable to parse header from apdu"));const d=a?or(t.slice(l,l+u)):ft,p=l+u,h=t.slice(p),m=new o_({header:new s_({uuid:Yd(),channel:this._channel,dataSize:d,headTag:n,index:o,length:r+Ao+Ls+u}),data:h});return Tt(m)}isComplete(t){return this._pendingFrames.reduce((r,n)=>r+n.getData().length,0)>=t}concatFrames(t){return t.reduce((r,n)=>Uint8Array.from([...r,...n.getData()]),new Uint8Array(0))}};DS=qF([Qe(),GF(1,Oe(Dt.LoggerPublisherServiceFactory))],DS);var XF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},YF=(e,t)=>(r,n)=>t(r,n,e);let jS=class{_frameSize;_channel;_padding;_logger;constructor({frameSize:t,channel:r=Ar.zero(),padding:n=!1},o){this._frameSize=t,this._channel=r,this._padding=n,this._logger=o("DefaultApduSenderService")}getFrames(t){const r=[];let n=0,o=this.getFrameAtIndex(t,n);for(;o.isRight();)r.push(o.extract()),n+=1,o=this.getFrameAtIndex(t,n).mapLeft(a=>(a instanceof OS||this._logger.error("Error while parsing frame",{data:{error:a}}),a));return r}getFrameAtIndex(t,r){const n=this.getFrameHeaderFrom(r,t.length),o=r===0?0:r*this._frameSize-this.getHeaderSizeSumFrom(r);if(o>=t.length)return yt(new OS);if(n.getLength()>this._frameSize)return yt(new HF);const a=this._frameSize-n.getLength(),l=t.slice(o,o+this._frameSize-n.getLength()),u=this._padding?new Uint8Array(a).fill(0):new Uint8Array(l.length<a?l.length:a);u.set(l,0);const d=new o_({header:n,data:u});return Tt(d)}getFrameHeaderFrom(t,r){const n=new s_({uuid:Yd(),channel:this._channel.map(o=>No.getLastBytesFrom(o,Sg)),headTag:new Uint8Array([FF]),index:No.numberToByteArray(t,Ls),length:this.getFrameHeaderSizeFromIndex(t),dataSize:Ar.zero()});return t===0&&n.setDataSize(Ar.of(No.numberToByteArray(r,Eg))),n}getHeaderSizeSumFrom(t){let r=this.getFrameHeaderSizeFromIndex(0),n=1;for(;n<t;)r+=this.getFrameHeaderSizeFromIndex(n),n+=1;return r}getFrameHeaderSizeFromIndex(t){return this._channel.caseOf({Just:()=>Sg,Nothing:()=>0})+Ls+Ao+(t===0?Eg:0)}};jS=XF([Qe(),YF(1,Oe(Dt.LoggerPublisherServiceFactory))],jS);const Cg={LocalConfigDataSource:Symbol.for("LocalConfigDataSource"),RemoteConfigDataSource:Symbol.for("RemoteConfigDataSource"),ConfigService:Symbol.for("ConfigService")},dr={ApduSenderServiceFactory:Symbol.for("ApduSenderServiceFactory"),ApduReceiverServiceFactory:Symbol.for("ApduReceiverServiceFactory"),DeviceSessionService:Symbol.for("DeviceSessionService")},MS={ConnectUseCase:Symbol.for("ConnectUseCase"),DisconnectUseCase:Symbol.for("DisconnectUseCase")},jl={ManagerApiService:Symbol.for("ManagerApiService"),ManagerApiDataSource:Symbol.for("ManagerApiDataSource"),DmkConfig:Symbol.for("ManagerApiDmkConfig")},Kd={SecureChannelService:Symbol.for("SecureChannelService"),SecureChannelDataSource:Symbol.for("SecureChannelDataSource"),DmkConfig:Symbol.for("SecureChannelDmkConfig")},Gi={DmkConfig:Symbol.for("TransportDmkConfig"),TransportService:Symbol.for("TransportService"),TransportsInput:Symbol.for("TransportsInput")};var KF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},zS=(e,t)=>(r,n)=>t(r,n,e);let FS=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("SendCommandUseCase")}async execute({sessionId:t,command:r,abortTimeout:n}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:async o=>await o.sendCommand(r,n),Left:o=>{throw this._logger.error("Error getting session",{data:{error:o}}),o}})}};FS=KF([Qe(),zS(0,Oe(dr.DeviceSessionService)),zS(1,Oe(Dt.LoggerPublisherServiceFactory))],FS);var QF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let BS=class{execute=vi.fn(()=>"stub")};BS=QF([Qe()],BS);var JF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},US=(e,t)=>(r,n)=>t(r,n,e);let VS=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("ExecuteDeviceActionUseCase")}execute({sessionId:t,deviceAction:r}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:n=>n.executeDeviceAction(r),Left:n=>{throw this._logger.error("Error getting session",{data:{error:n}}),n}})}};VS=JF([Qe(),US(0,Oe(dr.DeviceSessionService)),US(1,Oe(Dt.LoggerPublisherServiceFactory))],VS);function ZF(e){return typeof e=="object"&&e!==null&&"version"in e&&"name"in e&&typeof e.version=="string"&&typeof e.name=="string"}let WS=class{constructor(t){this.err=t,this.originalError=t}_tag="ApiCallError";originalError},eB=class{constructor(t){this.err=t,this.originalError=t}_tag="ParseResponseError";originalError},a_=class{constructor(t){this.err=t,this.originalError=t}_tag="JSONParseError";originalError},tB=class{constructor(t){this.err=t,this.originalError=t}_tag="ReadFileError";originalError};const rB="@ledgerhq/device-management-kit",nB="0.0.0-develop-20261117000828",HS={name:rB,version:nB};var iB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};const oB={name:HS.name,version:HS.version},sB=()=>JSON.stringify(oB);let qS=class{getConfig(){return Tr.encase(()=>sB()).mapLeft(t=>new tB(t)).chain(t=>Tr.encase(()=>{const r=JSON.parse(t);if(ZF(r))return r;throw new Error("Invalid config file")}).mapLeft(r=>new a_(r)))}};qS=iB([Qe()],qS);var aB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let GS=class{getConfig(){return Tr.of({name:"DeviceSDK",version:"0.0.0-stub.1"})}};GS=aB([Qe()],GS);var lB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let XS=class{async getConfig(){const t=await this._callApi();if(t.isLeft())return yt(new WS(t.extract()));if(!t.extract().ok)return yt(new WS(new Error("response not ok")));const r=await t.extract().json();return r.isLeft()?yt(new a_):r.chain(n=>this._parseResponse(n)).map(n=>n)}_parseResponse(t){const{name:r,version:n}=t;return!r||!n?yt(new eB):Tr.of({name:r,version:n})}_callApi(){return new Promise(t=>{t(Tr.of({ok:!0,json:async()=>new Promise(r=>{r(Tr.of({name:"DeviceSDK",version:"0.0.0-fake.1",yolo:"yolo"}))})}))})}};XS=lB([Qe()],XS);var cB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let YS=class{async getConfig(){return new Promise(t=>t(Tr.of({name:"DeviceSDK",version:"0.0.0-fake.2"})))}};YS=cB([Qe()],YS);var uB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},fm=(e,t)=>(r,n)=>t(r,n,e);let KS=class{_local;_remote;_logger;constructor(t,r,n){this._local=t,this._remote=r,this._logger=n("config")}async getDmkConfig(){const t=this._local.getConfig().ifLeft(r=>{this._logger.error("Local config not available",{data:{error:r}})});if(t.isRight()){const r=t.extract();return this._logger.info("Local config available",{data:{config:r}}),r}return this._remote.getConfig().then(r=>r.mapLeft(n=>(this._logger.error("Local config available",{data:{error:n}}),{name:"DeadDmk",version:"0.0.0-dead.1"})).extract())}};KS=uB([Qe(),fm(0,Oe(Cg.LocalConfigDataSource)),fm(1,Oe(Cg.RemoteConfigDataSource)),fm(2,Oe(Dt.LoggerPublisherServiceFactory))],KS);var dB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},fB=(e,t)=>(r,n)=>t(r,n,e);let QS=class{_configService;constructor(t){this._configService=t}async getDmkVersion(){return(await this._configService.getDmkConfig()).version}};QS=dB([Qe(),fB(0,Oe(Cg.ConfigService))],QS);const pB={DeviceModelDataSource:Symbol.for("DeviceModelDataSource")};var hB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},JS=(e,t)=>(r,n)=>t(r,n,e);let ZS=class{constructor(t,r){this._sessionService=t,this._logger=r("DisableDeviceSessionRefresherUseCase")}_logger;execute({sessionId:t,blockerId:r}){return this._sessionService.getDeviceSessionById(t).caseOf({Left:n=>{throw this._logger.error("Error getting device session",{data:{error:n}}),n},Right:n=>n.disableRefresher(r)})}};ZS=hB([Qe(),JS(0,Oe(dr.DeviceSessionService)),JS(1,Oe(Dt.LoggerPublisherServiceFactory))],ZS);var mB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},gB=(e,t)=>(r,n)=>t(r,n,e);let e1=class{_sessions;_sessionsSubject;_logger;constructor(t){this._sessions=[],this._sessionsSubject=new zR,this._logger=t("DeviceSessionService")}get sessionsObs(){return this._sessionsSubject.asObservable()}addDeviceSession(t){return this._sessions.find(r=>r.id===t.id)?(this._logger.warn("DeviceSession already exists",{data:{deviceSession:t}}),this):(this._sessions.push(t),this._sessionsSubject.next(t),this._logger.info("DeviceSession added",{data:{sessionId:t.id}}),this)}removeDeviceSession(t){const r=this._sessions.find(n=>n.id===t);return r?(r.close(),this._sessions=this._sessions.filter(n=>n.id!==t),this._logger.info("DeviceSession removed",{data:{sessionId:t}}),this):(this._logger.warn("DeviceSession not found",{data:{sessionId:t}}),this)}getDeviceSessionById(t){return Ar.fromNullable(this._sessions.find(r=>r.id===t)).toEither(new PS)}getDeviceSessionsByDeviceId(t){return Ar.fromPredicate(({length:r})=>r>0,this._sessions.filter(r=>r.connectedDevice.id===t)).toEither(new PS)}getDeviceSessions(){return this._sessions}};e1=mB([Qe(),gB(0,Oe(Dt.LoggerPublisherServiceFactory))],e1);var vB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},t1=(e,t)=>(r,n)=>t(r,n,e);let r1=class{_sessionService;_transportService;constructor(t,r){this._sessionService=t,this._transportService=r}execute(){const t=this._sessionService.getDeviceSessions();for(const r of t)this._transportService.closeConnection(r.connectedDevice),this._sessionService.removeDeviceSession(r.id)}};r1=vB([Qe(),t1(0,Oe(dr.DeviceSessionService)),t1(1,Oe(Gi.TransportService))],r1);var yB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},n1=(e,t)=>(r,n)=>t(r,n,e);let i1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("GetDeviceSessionStateUseCase")}execute({sessionId:t}){return this._sessionService.getDeviceSessionById(t).caseOf({Left:r=>{throw this._logger.error("Error getting session device",{data:{error:r}}),r},Right:r=>r.state})}};i1=yB([Qe(),n1(0,Oe(dr.DeviceSessionService)),n1(1,Oe(Dt.LoggerPublisherServiceFactory))],i1);var bB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},o1=(e,t)=>(r,n)=>t(r,n,e);let s1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("UnsafeBypassIntentQueueUseCase")}execute({sessionId:t,bypass:r}){this._sessionService.getDeviceSessionById(t).caseOf({Left:n=>{throw this._logger.error("Error getting session",{data:{error:n}}),n},Right:n=>{this._logger.warn(`UNSAFE: ${r?"Enabling":"Disabling"} intent queue bypass for session ${t}`),n._unsafeBypassIntentQueue(r)}})}};s1=bB([Qe(),o1(0,Oe(dr.DeviceSessionService)),o1(1,Oe(Dt.LoggerPublisherServiceFactory))],s1);function xB(e){return`[will send APDU] ~...> ${si(e,!1)}`}function wB(e){return`[exchange] <= ${si(e.data,!1)}${si(e.statusCode,!1)}`}const SB="apdu-exchange";function EB(e,t,r){const n=si(t,!1),o=`${si(r.data,!1)}${si(r.statusCode,!1)}`;return{message:wB(r),data:{type:SB,sessionId:e,apdu:n,response:o}}}const kg=1e3,pm=1e3,CB={isRefresherDisabled:!1,pollingInterval:1e3};var Nt=(e=>(e.NEW_STATE="NEW_STATE",e.REFRESH_NEEDED="REFRESH_NEEDED",e.COMMAND_SUCCEEDED="COMMAND_SUCCEEDED",e.DEVICE_STATE_UPDATE_BUSY="DEVICE_STATE_UPDATE_BUSY",e.DEVICE_STATE_UPDATE_LOCKED="DEVICE_STATE_UPDATE_LOCKED",e.DEVICE_STATE_UPDATE_CONNECTED="DEVICE_STATE_UPDATE_CONNECTED",e.DEVICE_STATE_UPDATE_UNKNOWN="DEVICE_STATE_UPDATE_UNKNOWN",e))(Nt||{});let kB=class{_eventEmitter=new oa;listen(){return this._eventEmitter.asObservable()}dispatch(t){this._eventEmitter.next(t)}},RB=class{constructor(t,r){this.loggerModuleFactory=t,this.sessionEventDispatcher=r,this._logger=this.loggerModuleFactory("IntentQueueService")}_logger;_queue=[];_isProcessing=!1;_currentSubscription=null;enqueue(t){this._logger.debug("Enqueueing intent",{data:{type:t.type}});const r=new oa,n={intent:t,subject:r,isCancelled:!1};this._queue.push(n);const o=()=>{this._logger.debug("Cancelling intent",{data:{type:t.type}}),n.isCancelled=!0,this._queue[0]===n&&this._currentSubscription?(this._currentSubscription.unsubscribe(),this._currentSubscription=null,r.complete(),this._queue.shift(),this._isProcessing=!1,this._processQueue()):(!this._isProcessing||this._queue[0]!==n)&&r.complete()};return this._isProcessing||this._processQueue(),{observable:r.asObservable().pipe(sF(()=>{this._logger.debug("Intent observable finalized",{data:{type:t.type}})})),cancel:o}}_processQueue(){if(this._isProcessing)return;if(this._queue.length===0){this.sessionEventDispatcher.dispatch({eventName:Nt.NEW_STATE});return}this.sessionEventDispatcher.dispatch({eventName:Nt.DEVICE_STATE_UPDATE_BUSY}),this._isProcessing=!0;const t=this._queue[0];if(t.isCancelled){this._logger.debug("Skipping cancelled intent",{data:{type:t.intent.type}}),t.subject.complete(),this._queue.shift(),this._isProcessing=!1,this._processQueue();return}this._logger.debug("Processing intent",{data:{type:t.intent.type}}),this._currentSubscription=t.intent.execute().subscribe({next:r=>{t.isCancelled||t.subject.next(r)},error:r=>{t.isCancelled||t.subject.error(r),this._onIntentComplete()},complete:()=>{t.isCancelled||t.subject.complete(),this._onIntentComplete()}})}_onIntentComplete(){this._logger.debug("Intent completed"),this._currentSubscription=null,this._queue.shift(),this._isProcessing=!1,this._processQueue()}},_B=class{constructor(t,r){this._refresher=r,this._logger=t("refresher-service")}_refresherBlockers=new Set;_logger;disableRefresher(t){const r=`${t}-${Yd()}`;this.addRefresherBlocker(r),this._logger.debug("Refresher disabled",{data:{blockerId:r,blockers:Array.from(this._refresherBlockers)}});let n=!1;return()=>{n||(n=!0,this.removeRefresherBlocker(r),this._logger.debug("Refresher re-enabled",{data:{blockerId:r,blockers:Array.from(this._refresherBlockers)}}))}}addRefresherBlocker(t){const r=this._refresherBlockers.size;this._refresherBlockers.add(t),r===0&&this._refresher.stop()}removeRefresherBlocker(t){const r=this._refresherBlockers.size;this._refresherBlockers.delete(t),r>0&&this._refresherBlockers.size===0&&this._refresher.start()}},$B=class{constructor(t,r,n,o){this.connectedDevice=r,this._sessionEventDispatcher=n,this._sendCommandFunction=o,this._logger=t("device-pinger"),this._subscription=this._sessionEventDispatcher.listen().subscribe(async a=>await this.mapEventAction(a))}_sendCommandFunction;_subscription;_logger;async ping(){try{return await this.mapDevicePingAction(this.connectedDevice.deviceModel.id)}catch(t){return this._logger.error("Error while pinging device",{data:{error:t}}),null}}mapEventAction=async t=>t.eventName===Nt.REFRESH_NEEDED?await this.ping():null;async mapDevicePingAction(t){if(t===wt.NANO_S){const r=async()=>{const a=await this._sendCommandFunction(new ww,dm);return this._sendCommandFunction(new cz,dm),a},n=new Promise(a=>{setTimeout(()=>a(null),kg*2+100)}),o=await Promise.race([r(),n]);return o?this._sessionEventDispatcher.dispatch({eventName:Nt.COMMAND_SUCCEEDED,eventData:o}):this._sessionEventDispatcher.dispatch({eventName:Nt.DEVICE_STATE_UPDATE_LOCKED}),o}else{const r=await this._sendCommandFunction(new ww,dm);return this._sessionEventDispatcher.dispatch({eventName:Nt.COMMAND_SUCCEEDED,eventData:r}),r}}unsubscribe(){this._subscription.unsubscribe()}},AB=class{constructor(t,r,n,o){this._sessionEventDispatcher=n,this._refresherOptions=r,this._logger=t("device-session-refresher"),this._connectedDeviceID=o.deviceModel.id}_refresherSubscription;_refresherOptions;_logger;_connectedDeviceID;startRefresher(){if(this._refresherOptions.isRefresherDisabled||this._refresherSubscription)return;const t=this.getValidPollingInterval(this._refresherOptions,this._logger),r=this._sessionEventDispatcher.listen().pipe(SS(n=>n.eventName===Nt.DEVICE_STATE_UPDATE_BUSY||n.eventName===Nt.NEW_STATE),Ui(n=>n.eventName===Nt.DEVICE_STATE_UPDATE_BUSY),lF(!1),iF());this._refresherSubscription=tF(0,t).pipe(cF(r),ES(([n,o])=>{o&&this._logger.debug("Refresh skipped: device is busy")}),SS(([n,o])=>!o),ES(()=>this._sessionEventDispatcher.dispatch({eventName:Nt.REFRESH_NEEDED}))).subscribe(),this._logger.info("Refresher started.")}stopRefresher(){this._refresherSubscription&&(this._refresherSubscription.unsubscribe(),this._refresherSubscription=void 0,this._logger.info("Refresher stopped."))}restartRefresher(){this.stopRefresher(),this.startRefresher(),this._logger.info("Refresher restarted.")}getValidPollingInterval=(t,r)=>{const{pollingInterval:n}=t;if(this._connectedDeviceID===wt.NANO_S){const o=kg*2;return n!==void 0&&n<o?(r.warn(`Polling interval of ${n} is too low, setting to minimum as ${o}`),o):n??o}else return n!==void 0&&n<pm?(r.warn(`Polling interval of ${n} is too low, setting to minimum as ${pm}`),pm):n??kg}},TB=class{constructor(t,r,n,o,a){this._sessionEventDispatcher=r,this._connectedDevice=n,this._deviceState=o,this.setDeviceSessionState=a,this._subscription=this._sessionEventDispatcher.listen().subscribe(l=>this.mapEventAction(l)),this._logger=t("device-session-state-handler")}_subscription;_logger;_pendingDeviceStatus=Ln.BUSY;_updateDeviceState(t){const r=this._parseDeviceStatus(t);if(r){const{sessionStateType:n,deviceStatus:o,currentApp:a}=r,l=this._deviceState.getValue();l.sessionStateType===Ys.Connected?this.setDeviceSessionState({sessionStateType:n,deviceStatus:o,deviceModelId:this._connectedDevice.deviceModel.id,currentApp:a,installedApps:[],isSecureConnectionAllowed:!1}):this.setDeviceSessionState({...l,sessionStateType:n,deviceStatus:o,deviceModelId:this._connectedDevice.deviceModel.id,currentApp:a})}}mapEventAction=t=>{const{eventName:r}=t;switch(r){case Nt.COMMAND_SUCCEEDED:return this._updateDeviceState(t.eventData);case Nt.DEVICE_STATE_UPDATE_BUSY:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:Ln.BUSY});case Nt.DEVICE_STATE_UPDATE_LOCKED:this._pendingDeviceStatus=Ln.LOCKED;return;case Nt.DEVICE_STATE_UPDATE_CONNECTED:this._pendingDeviceStatus=Ln.CONNECTED;return;case Nt.NEW_STATE:{const n=this._pendingDeviceStatus;return this._pendingDeviceStatus=Ln.BUSY,this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:n})}case Nt.DEVICE_STATE_UPDATE_UNKNOWN:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:Ln.BUSY});case Nt.REFRESH_NEEDED:return;default:{const n=r;throw new Error(`Unhandled context type ${n}`)}}};_parseDeviceStatus(t){return A5(t)?{sessionStateType:Ys.ReadyWithoutSecureChannel,deviceStatus:Ln.CONNECTED,currentApp:{name:t.data.name,version:t.data.version}}:(this._logger.debug("Error while parsing APDU response",{data:{parsedResponse:t}}),null)}unsubscribe(){this._subscription.unsubscribe()}};class LB{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_loggerModuleFactory;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_intentQueueService;_sessionEventDispatcher=new kB;_bypassIntentQueue=!1;constructor({connectedDevice:t,id:r=Yd()},n,o,a,l,u=d=>new RB(n,d)){this._id=r,this._connectedDevice=t,this._loggerModuleFactory=n,this._logger=n("device-session"),this._managerApiService=o,this._intentQueueService=u(this._sessionEventDispatcher),this._secureChannelService=a,this._refresherOptions={...CB,...l},this._deviceState=new Az({sessionStateType:Ys.Connected,deviceStatus:Ln.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new $B(n,t,this._sessionEventDispatcher,(d,p)=>this.sendCommand(d,p)),this._deviceSessionRefresher=new AB(n,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new TB(n,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,d=>this.setDeviceSessionState(d)),this._refresherService=new _B(n,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{this._refresherOptions.isRefresherDisabled?await this._pinger.ping():this._deviceSessionRefresher.startRefresher()}catch(t){throw this._logger.error("Error while initialising session",{data:{error:t}}),t}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(t){this._deviceState.next(t)}sendApdu(t,r={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){return this._bypassIntentQueue?this._unsafeInternalSendApdu(t,r):this._internalSendApdu(t,r)}_internalSendApdu(t,r){const n=r.abortTimeout,o=Date.now(),{observable:a,cancel:l}=this._intentQueueService.enqueue({type:"send-apdu",execute:()=>Xs((async()=>{const d=Date.now()-o;return await this._unsafeInternalSendApdu(t,{isPolling:r.isPolling,triggersDisconnection:r.triggersDisconnection,abortTimeout:n?n-d:void 0})})())}),u=n?a.pipe(xS({each:n,with:()=>{throw l(),new fF}})):a;return bS(u)}async _unsafeInternalSendApdu(t,r={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){return this._logger.debug(xB(t)),(await this._connectedDevice.sendApdu(t,r.triggersDisconnection,r.abortTimeout)).ifRight(n=>{const{message:o,data:a}=EB(this._id,t,n);this._logger.debug(o,{data:a}),gv.isLockedDeviceResponse(n)?this._sessionEventDispatcher.dispatch({eventName:Nt.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:Nt.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:Nt.DEVICE_STATE_UPDATE_UNKNOWN})})}sendCommand(t,r){return this._logger.debug(`[sendCommand] ${t.name}`),this._bypassIntentQueue?this._unsafeInternalSendCommand(t,r):this._internalSendCommand(t,r)}_internalSendCommand(t,r){const n=Date.now(),{observable:o,cancel:a}=this._intentQueueService.enqueue({type:"send-command",execute:()=>Xs((async()=>{const u=Date.now()-n;return await this._unsafeInternalSendCommand(t,r?r-u:void 0)})())}),l=r?o.pipe(xS({each:r,with:()=>{throw a(),new pF}})):o;return bS(l)}async _unsafeInternalSendCommand(t,r){const n=t.getApdu();return(await this._unsafeInternalSendApdu(n.getRawApdu(),{isPolling:!1,triggersDisconnection:t.triggersDisconnection??!1,abortTimeout:r})).caseOf({Left:o=>{throw this._logger.error("[sendCommand] error",{data:{err:o}}),o},Right:o=>{const a=t.parseResponse(o,this._connectedDevice.deviceModel.id);return this._logger.debug("[sendCommand] result",{data:{result:a}}),a}})}executeDeviceAction(t){return this._bypassIntentQueue?this._unsafeInternalExecuteDeviceAction(t):this._internalExecuteDeviceAction(t)}_internalExecuteDeviceAction(t){let r;const{observable:n,cancel:o}=this._intentQueueService.enqueue({type:"device-action",execute:()=>{const{observable:a,cancel:l}=this._unsafeInternalExecuteDeviceAction(t);return r=l,a}});return{observable:n,cancel:()=>{r?.(),o()}}}_unsafeInternalExecuteDeviceAction(t){const{observable:r,cancel:n}=t._execute({sendApdu:async o=>this._unsafeInternalSendApdu(o),sendCommand:async o=>this._unsafeInternalSendCommand(o),getDeviceModel:()=>this._connectedDevice.deviceModel,getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:o=>(this.setDeviceSessionState(o),this._deviceState.getValue()),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService,loggerFactory:this._loggerModuleFactory});return{observable:r,cancel:n}}close(){this._updateDeviceStatus(Ln.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher(),this._pinger.unsubscribe()}disableRefresher(t){return this._refresherService.disableRefresher(t)}_unsafeBypassIntentQueue(t){this._bypassIntentQueue=t}_updateDeviceStatus(t){const r=this._deviceState.getValue();this._deviceState.next({...r,deviceStatus:t})}}var IB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},Za=(e,t)=>(r,n)=>t(r,n,e);let a1=class{_transportService;_sessionService;_loggerFactory;_managerApi;_secureChannel;_logger;constructor(t,r,n,o,a){this._sessionService=r,this._transportService=t,this._loggerFactory=n,this._logger=n("ConnectUseCase"),this._managerApi=o,this._secureChannel=a}handleDeviceDisconnect(t){this._sessionService.getDeviceSessionsByDeviceId(t).ifRight(r=>{r.forEach(n=>{this._sessionService.removeDeviceSession(n.id),this._logger.info("Session removed",{data:{deviceId:t,sessionId:n.id}})})})}async execute({device:t,sessionRefresherOptions:r}){const n=this._transportService.getTransport(t.transport),o="sessionId"in t?t.sessionId:void 0;return He.liftEither(n.toEither(new Ov(new Error("Unknown transport")))).chain(async a=>a.connect({deviceId:t.id,onDisconnect:l=>this.handleDeviceDisconnect(l)})).ifLeft(a=>{this._logger.error("Error connecting to device")}).map(async a=>{const l=new LB({connectedDevice:a,id:o},this._loggerFactory,this._managerApi,this._secureChannel,r);return this._sessionService.addDeviceSession(l),await l.initialiseSession(),l.id}).caseOf({Left:a=>{throw a},Right:a=>a})}};a1=IB([Qe(),Za(0,Oe(Gi.TransportService)),Za(1,Oe(dr.DeviceSessionService)),Za(2,Oe(Dt.LoggerPublisherServiceFactory)),Za(3,Oe(jl.ManagerApiService)),Za(4,Oe(Kd.SecureChannelService))],a1);var OB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},hm=(e,t)=>(r,n)=>t(r,n,e);let l1=class{_transportService;_sessionService;_logger;constructor(t,r,n){this._sessionService=r,this._transportService=t,this._logger=n("DisconnectUseCase")}async execute({sessionId:t}){return this._logger.debug("Disconnecting from device",{data:{test:this._sessionService.getDeviceSessions().map(r=>r.id)}}),He(async({liftEither:r})=>{const n=await r(this._sessionService.getDeviceSessionById(t).ifLeft(l=>{this._logger.error("Device session not found",{data:{sessionId:t,error:l}})})),o=n.connectedDevice.transport,a=await r(this._transportService.getTransport(o).toEither(new Ov(new Error("Unknown transport"))));n.close(),this._sessionService.removeDeviceSession(t),await a.disconnect({connectedDevice:n.connectedDevice})}).caseOf({Left:r=>{throw this._logger.error("Error disconnecting from device",{data:{error:r}}),r},Right:()=>{}})}};l1=OB([Qe(),hm(0,Oe(Gi.TransportService)),hm(1,Oe(dr.DeviceSessionService)),hm(2,Oe(Dt.LoggerPublisherServiceFactory))],l1);let Pv=class{id;sessionId;modelId;name;type;transport;constructor({transportConnectedDevice:{id:t,deviceModel:{id:r,productName:n},type:o,transport:a,name:l},sessionId:u}){this.id=t,this.sessionId=u,this.modelId=r,this.name=l??n,this.type=o,this.transport=a}};var NB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},c1=(e,t)=>(r,n)=>t(r,n,e);let u1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("GetConnectedDeviceUseCase")}execute({sessionId:t}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:r=>new Pv({sessionId:r.id,transportConnectedDevice:r.connectedDevice}),Left:r=>{throw this._logger.error("Error getting session",{data:{error:r}}),r}})}};u1=NB([Qe(),c1(0,Oe(dr.DeviceSessionService)),c1(1,Oe(Dt.LoggerPublisherServiceFactory))],u1);var PB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},d1=(e,t)=>(r,n)=>t(r,n,e);let f1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("ListConnectedDeviceUseCase")}execute(){return this._logger.info("Listing connected devices"),this._sessionService.getDeviceSessions().map(t=>new Pv({transportConnectedDevice:t.connectedDevice,sessionId:t.id}))}};f1=PB([Qe(),d1(0,Oe(dr.DeviceSessionService)),d1(1,Oe(Dt.LoggerPublisherServiceFactory))],f1);var DB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},p1=(e,t)=>(r,n)=>t(r,n,e);let h1=class{_transports;_transportService;_logger;constructor(t,r){this._transports=t.getAllTransports(),this._transportService=t,this._logger=r("ListenToAvailableDevicesUseCase")}mapTransportDiscoveredDeviceToDiscoveredDevice(t){const r=new $R({id:t.id,model:t.deviceModel.id,name:t.deviceModel.productName});return{id:t.id,deviceModel:r,transport:t.transport,name:t.name||r.name,rssi:t.rssi}}execute({transport:t}={}){if(this._logger.info("Listening to available devices"),this._transports.length===0)return this._logger.warn("No transports available"),Xs([[]]);if(!t){this._logger.info("Discovering all available transports");const r=this._transports.map((n,o)=>n.listenToAvailableDevices().pipe(Ui(a=>({index:o,arr:a}))));return rF(...r).pipe(aF((n,{index:o,arr:a})=>(n[o]=a,n),{}),Ui(n=>Object.values(n).flat().map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))}return this._logger.info(`Discovering devices on transport ${t}`),this._transportService.getTransport(t).caseOf({Nothing:()=>(this._logger.error(`Transport ${t} not found`),t_([])),Just:r=>r.listenToAvailableDevices().pipe(Ui(n=>n.map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))})}};h1=DB([Qe(),p1(0,Oe(Gi.TransportService)),p1(1,Oe(Dt.LoggerPublisherServiceFactory))],h1);var jB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},m1=(e,t)=>(r,n)=>t(r,n,e);let g1=class{constructor(t,r){this._sessionService=t,this._logger=r("ListenToConnectedDeviceUseCase")}_logger;execute(){return this._logger.info("Observe connected devices"),this._sessionService.sessionsObs.pipe(Ui(t=>new Pv({transportConnectedDevice:t.connectedDevice,sessionId:t.id})))}};g1=jB([Qe(),m1(0,Oe(dr.DeviceSessionService)),m1(1,Oe(Dt.LoggerPublisherServiceFactory))],g1);var MB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},mm=(e,t)=>(r,n)=>t(r,n,e);let v1=class{constructor(t,r,n){this.connectUseCase=t,this.disconnectUseCase=r,this._logger=n("ReconnectUseCase")}_logger;async execute({device:t,sessionRefresherOptions:r}){return this._logger.debug("Reconnecting device session",{data:{deviceId:t.id,transport:t.transport}}),await this.disconnectUseCase.execute({sessionId:t.sessionId}),this.connectUseCase.execute({device:t,sessionRefresherOptions:r})}};v1=MB([Qe(),mm(0,Oe(MS.ConnectUseCase)),mm(1,Oe(MS.DisconnectUseCase)),mm(2,Oe(Dt.LoggerPublisherServiceFactory))],v1);var zB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},FB=(e,t)=>(r,n)=>t(r,n,e);let y1=class{constructor(t){this._transportService=t}mapDiscoveredDevice(t){const r=new $R({id:t.id,model:t.deviceModel.id,name:t.deviceModel.productName});return{id:t.id,deviceModel:r,transport:t.transport,name:t.name||r.name,rssi:t.rssi}}execute({transport:t}={}){if(!t){const r=this._transportService.getAllTransports();return t_(...r).pipe(Lv(n=>n.startDiscovering().pipe(Ui(o=>this.mapDiscoveredDevice(o)))))}return this._transportService.getTransport(t).caseOf({Just:r=>r.startDiscovering().pipe(Ui(n=>this.mapDiscoveredDevice(n))),Nothing:()=>{throw new Ov(new Error("Unknown transport"))}})}};y1=zB([Qe(),FB(0,Oe(Gi.TransportService))],y1);var BB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},b1=(e,t)=>(r,n)=>t(r,n,e);let x1=class{constructor(t,r){this.transportService=t,this._logger=r("StopDiscoveringUseCase")}_logger;async execute(){this._logger.debug("Stopping discovering devices");for(const t of this.transportService.getAllTransports())await t.stopDiscovering()}};x1=BB([Qe(),b1(0,Oe(Gi.TransportService)),b1(1,Oe(Dt.LoggerPublisherServiceFactory))],x1);var nl=(e=>(e[e.Fatal=0]="Fatal",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e))(nl||{});let UB=class{format(t){return Array.isArray(t)?t.map(r=>`[${r}]`).join(" "):`[${t}]`}};function Rg(e,t){if(typeof e=="bigint")return e.toString();if(Array.isArray(e))return t.has(e)?"[Circular]":(t.add(e),e.map(r=>Rg(r,t)));if(e!==null&&typeof e=="object"){if(t.has(e))return"[Circular]";t.add(e);const r={};for(const[n,o]of Object.entries(e))r[n]=Rg(o,t);return r}return e}function VB(e){const t=new WeakSet;t.add(e);const r={};for(const[n,o]of Object.entries(e))r[n]=Rg(o,t);return r}var WB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let w1=class{subscribers;tag;tagFormatter;constructor(t,r,n=new UB){this.subscribers=t,this.tag=r,this.tagFormatter=n}_log(t,r,n){const o=n?.data?VB(n.data):void 0,a=n?.tag??this.tag,l=this.tagFormatter.format(a);this.subscribers.forEach(u=>{const d={timestamp:n?.timestamp??Date.now(),tag:l,data:o};u.log(t,r,d)})}info(t,r){this._log(nl.Info,t,r)}warn(t,r){this._log(nl.Warning,t,r)}debug(t,r){this._log(nl.Debug,t,r)}error(t,r){this._log(nl.Error,t,r)}};w1=WB([Qe()],w1);let kl=class extends Error{status;statusText;responseBody;isTimeout;cause;constructor(t){super(t.message),this.name="DmkNetworkClientError",this.status=t.status,this.statusText=t.statusText,this.responseBody=t.responseBody,this.isTimeout=t.isTimeout??!1,this.cause=t.cause}};const HB="application/json";function qB(e,t){if(!t)return e;const r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:`/${t}`;return`${r}${n}`}function GB(e){const t=[];for(const[r,n]of Object.entries(e))n!=null&&t.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(n))}`);return t.join("&")}function To(e){const{url:t,params:r,baseUrl:n}=e,o=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:n?qB(n,t):t,a=r?GB(r):"";if(a.length===0)return o;const l=o.includes("?")?"&":"?";return`${o}${l}${a}`}function XB(e,t){const r=t.toLowerCase();return Object.keys(e).some(n=>n.toLowerCase()===r)}function YB(e){return!!(typeof e=="string"||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<"u"&&e instanceof Blob||typeof FormData<"u"&&e instanceof FormData||typeof URLSearchParams<"u"&&e instanceof URLSearchParams||typeof ReadableStream<"u"&&e instanceof ReadableStream)}function KB(e){const{method:t,body:r,defaultHeaders:n,perRequestHeaders:o}=e,a={...n,...o};return r===void 0||t==="GET"||t==="HEAD"?{body:void 0,headers:a}:YB(r)?{body:r,headers:a}:(XB(a,"content-type")||(a["Content-Type"]=HB),{body:JSON.stringify(r),headers:a})}function QB(e){const{timeoutMs:t}=e;if(!t||t<=0)return{signal:void 0,cleanup:()=>{}};const r=new AbortController,n=setTimeout(()=>{r.abort()},t);return{signal:r.signal,cleanup:()=>clearTimeout(n)}}async function JB(e,t){switch(t){case"void":return;case"text":return await e.text();case"blob":return await e.blob();case"arrayBuffer":return await e.arrayBuffer();default:{const r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch(n){throw new kl({message:"Failed to parse JSON response body",status:e.status,statusText:e.statusText,responseBody:r,cause:n})}}}}async function ZB(e){try{return await e.text()}catch{return}}function e8(e){const{cause:t,timeoutMs:r}=e,n=!!(r&&r>0);if(t instanceof Error&&(t.name==="AbortError"||t.name==="TimeoutError")){const o=t.name==="TimeoutError"||n;return new kl({message:o?"Request timed out":"Request aborted",isTimeout:o,cause:t})}return new kl({message:t instanceof Error?t.message:"Network request failed",cause:t})}let l_=class{baseUrl;defaultHeaders;fetchImpl;constructor(t={}){this.baseUrl=t.baseUrl,this.defaultHeaders=t.headers??{},this.fetchImpl=t.fetch}getFetch(){return this.fetchImpl??globalThis.fetch.bind(globalThis)}get(t,r){return this.request({...r,method:"GET",url:t}).then(n=>n.data)}post(t,r,n){return this.request({...n,method:"POST",url:t,body:r}).then(o=>o.data)}put(t,r,n){return this.request({...n,method:"PUT",url:t,body:r}).then(o=>o.data)}patch(t,r,n){return this.request({...n,method:"PATCH",url:t,body:r}).then(o=>o.data)}delete(t,r){return this.request({...r,method:"DELETE",url:t}).then(n=>n.data)}head(t,r){return this.request({...r,method:"HEAD",url:t,responseType:"void"}).then(()=>{})}async request(t){const r=To({url:t.url,params:t.params,baseUrl:this.baseUrl}),{body:n,headers:o}=KB({method:t.method,body:t.body,defaultHeaders:this.defaultHeaders,perRequestHeaders:t.headers}),{signal:a,cleanup:l}=QB({timeoutMs:t.timeoutMs}),u=t.throwOnHttpError??!0,d=t.responseType??"json";try{let p;try{p=await this.getFetch()(r,{method:t.method,headers:o,body:n,signal:a})}catch(h){throw e8({cause:h,timeoutMs:t.timeoutMs})}if(!p.ok&&u){const h=await ZB(p);throw new kl({message:`HTTP error ${p.status} ${p.statusText}`.trim(),status:p.status,statusText:p.statusText,responseBody:h})}return{data:await JB(p,d),status:p.status,statusText:p.statusText,headers:p.headers,ok:p.ok}}finally{l()}}};var il=(e=>(e.currency="currency",e.plugin="plugin",e.tool="tool",e.swap="swap",e))(il||{});const t8=1,r8="0";let xd=class{constructor(t){this.error=t,this.originalError=t}_tag="FetchError";originalError};var ol=(e=>(e.currency="currency",e.plugin="plugin",e.tool="tool",e.swap="swap",e))(ol||{}),n8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},S1=(e,t)=>(r,n)=>t(r,n,e);const Qn=e=>e instanceof kl&&e.cause!==void 0?new xd(e.cause):new xd(e);let E1=class{http;_provider=t8;_firmwareDistributionSalt=r8;_logger;constructor({managerApiUrl:t,provider:r,firmwareDistributionSalt:n},o){this.http=new l_({baseUrl:t}),this._provider=r,this._firmwareDistributionSalt=n,this._logger=o("HttpManagerApiDataSource")}setProvider(t){this._provider===t||t<1||(this._provider=t)}getProvider(){return this._provider}setFirmwareDistributionSalt(t){this._firmwareDistributionSalt===t||t.trim()===""||(this._firmwareDistributionSalt=t)}getFirmwareDistributionSalt(){return this._firmwareDistributionSalt}getAppList(t){const{targetId:r,firmwareVersionName:n}=t;return He(()=>this.http.get("/v2/apps/by-target",{params:{target_id:r,provider:this._provider,firmware_version_name:n}})).chain(o=>this.mapApplicationDtoToApplication(o)).mapLeft(Qn)}getMcuList(){return He(()=>this.http.get("/mcu_versions")).chain(t=>this.mapMcuDtoToMcu(t)).mapLeft(Qn)}getDeviceVersion(t){const{targetId:r}=t;return He(()=>this.http.get("/get_device_version",{params:{target_id:r,provider:this._provider}})).chain(n=>this.mapDeviceVersionDto(n)).mapLeft(Qn)}getFirmwareVersion(t){const{deviceId:r,version:n}=t;return He(()=>this.http.get("/get_firmware_version",{params:{device_version:r,version_name:n,provider:this._provider}})).chain(o=>this.mapFinalFirmwareDto(o)).mapLeft(Qn)}getFirmwareVersionById(t){return He(()=>this.http.get(`/firmware_final_versions/${t}`)).chain(r=>this.mapFinalFirmwareDto(r)).mapLeft(Qn)}getOsuFirmwareVersion(t){const{deviceId:r,version:n}=t;return He(()=>this.http.get("/get_osu_version",{params:{device_version:r,version_name:n,provider:this._provider}})).chain(o=>this.mapOsuFirmwareDto(o)).mapLeft(Qn)}getLatestFirmwareVersion(t){const{currentFinalFirmwareId:r,deviceId:n}=t;return He(()=>{const o=this._firmwareDistributionSalt;return this._logger.info("Requesting latest firmware",{data:{salt:o}}),this.http.get("/get_latest_firmware",{params:{current_se_firmware_final_version:r,device_version:n,provider:this._provider,salt:o}})}).chain(o=>this.mapLatestFirmwareDto(o)).mapLeft(Qn)}getAppsByHash(t){const{hashes:r}=t;return He(()=>this.http.post("/v2/apps/hash",r)).chain(n=>this.mapNullableApplicationDtoToApplication(n)).mapLeft(Qn)}getLanguagePackages(t){const{deviceId:r,currentFinalFirmwareId:n}=t;return He(()=>this.http.get("/language-packages",{params:{device_version:r,current_se_firmware_final_version:n}})).chain(o=>this.mapLanguagesDtoToLanguages(o)).mapLeft(Qn)}mapAppTypeDtoToAppType(t){if(t===null)return null;switch(t){case ol.currency:return il.currency;case ol.plugin:return il.plugin;case ol.tool:return il.tool;case ol.swap:return il.swap}}mapApplicationDtoToApplication(t){return He(()=>Promise.resolve(t.map(r=>this.mapApplicationDto(r))))}mapNullableApplicationDtoToApplication(t){return He(()=>Promise.resolve(t.map(r=>r===null?null:this.mapApplicationDto(r))))}mapApplicationDto(t){if(typeof t!="object"||typeof t.versionId!="number"||typeof t.versionName!="string"||t.versionDisplayName!==null&&typeof t.versionDisplayName!="string"||typeof t.version!="string"||t.currencyId!==null&&typeof t.currencyId!="string"||t.description!==null&&typeof t.description!="string"||t.applicationType!==null&&typeof t.applicationType!="string"||typeof t.dateModified!="string"||t.icon!==null&&typeof t.icon!="string"||t.authorName!==null&&typeof t.authorName!="string"||t.supportURL!==null&&typeof t.supportURL!="string"||t.contactURL!==null&&typeof t.contactURL!="string"||t.sourceURL!==null&&typeof t.sourceURL!="string"||t.compatibleWallets!==null&&typeof t.compatibleWallets!="string"||typeof t.hash!="string"||typeof t.perso!="string"||typeof t.firmware!="string"||typeof t.firmwareKey!="string"||typeof t.delete!="string"||typeof t.deleteKey!="string"||t.bytes!==null&&typeof t.bytes!="number"||t.warning!==null&&typeof t.warning!="string"||typeof t.isDevTools!="boolean"||t.category!==null&&typeof t.category!="number"||t.parent!==null&&typeof t.parent!="number"||t.parentName!==null&&typeof t.parentName!="string")throw new Error(`Incomplete application: ${JSON.stringify(t)}`);const{applicationType:r,hash:n,perso:o,firmware:a,firmwareKey:l,delete:u,deleteKey:d,...p}=t;return{...p,hash:n,perso:o,firmware:a,firmwareKey:l,delete:u,deleteKey:d,applicationType:this.mapAppTypeDtoToAppType(r)}}mapMcuDtoToMcu(t){return He(()=>Promise.resolve(t.map(r=>{if(typeof r!="object"||typeof r.id!="number"||typeof r.name!="string"||typeof r.from_bootloader_version!="string")throw new Error(`Incomplete MCU version: ${JSON.stringify(r)}`);return{id:r.id,name:r.name,fromBootloaderVersion:r.from_bootloader_version,providers:r.providers}})))}mapDeviceVersionDto(t){return He(()=>{if(typeof t!="object"||typeof t.id!="number")throw new Error(`Incomplete device version: ${JSON.stringify(t)}`);const r={id:t.id};return Promise.resolve(r)})}mapFinalFirmwareDto(t){return He(()=>{if(typeof t!="object"||typeof t.id!="number"||typeof t.version!="string"||typeof t.perso!="string"||t.firmware!==null&&typeof t.firmware!="string"||t.firmware_key!==null&&typeof t.firmware_key!="string"||t.hash!==null&&typeof t.hash!="string"||t.bytes!==null&&typeof t.bytes!="number"||!Array.isArray(t.mcu_versions))throw new Error(`Incomplete final firmware: ${JSON.stringify(t)}`);const r={id:t.id,version:t.version,perso:t.perso,firmware:t.firmware,firmwareKey:t.firmware_key,hash:t.hash,bytes:t.bytes,mcuVersions:t.mcu_versions};return Promise.resolve(r)})}mapLatestFirmwareDto(t){return He(()=>{if(t.result==="null")return Promise.resolve(null);if(t.result!=="success"||!t.se_firmware_osu_version)throw new Error(`Latest firmware could not be retrieved: ${t.result}`);const r=t.se_firmware_osu_version;return Promise.resolve(r)}).chain(r=>r===null?He(()=>Promise.resolve(ft)):this.mapOsuFirmwareDto(r).map(n=>or(n)))}mapOsuFirmwareDto(t){return He(()=>{if(typeof t!="object"||typeof t.id!="number"||t.notes!==null&&typeof t.notes!="string"||typeof t.perso!="string"||typeof t.firmware!="string"||typeof t.firmware_key!="string"||t.hash!==null&&typeof t.hash!="string"||typeof t.next_se_firmware_final_version!="number")throw new Error(`Incomplete latest firmware: ${JSON.stringify(t)}`);const r={id:t.id,notes:t.notes,perso:t.perso,firmware:t.firmware,firmwareKey:t.firmware_key,hash:t.hash,nextFinalFirmware:t.next_se_firmware_final_version};return Promise.resolve(r)})}mapLanguagesDtoToLanguages(t){return He(()=>Promise.resolve(t.map(r=>this.mapLanguageDto(r))))}mapLanguageDto(t){if(typeof t!="object"||typeof t.language!="string"||typeof t.languagePackageVersionId!="number"||typeof t.version!="string"||typeof t.language_package_id!="number"||typeof t.apdu_install_url!="string"||typeof t.apdu_uninstall_url!="string"||typeof t.bytes!="number"||typeof t.date_creation!="string"||typeof t.date_last_modified!="string")throw new Error(`Incomplete language version: ${JSON.stringify(t)}`);return{language:t.language,languagePackageVersionId:t.languagePackageVersionId,version:t.version,languagePackageId:t.language_package_id,apduInstallUrl:t.apdu_install_url,apduUninstallUrl:t.apdu_uninstall_url,bytes:t.bytes,dateCreation:t.date_creation,dateLastModified:t.date_last_modified}}};E1=n8([Qe(),S1(0,Oe(jl.DmkConfig)),S1(1,Oe(Dt.LoggerPublisherServiceFactory))],E1);var i8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},o8=(e,t)=>(r,n)=>t(r,n,e);let C1=class{constructor(t){this.dataSource=t}getAppList(t){const r={targetId:t.targetId.toString(),firmwareVersionName:t.seVersion};return this.dataSource.getAppList(r)}getDeviceVersion(t){const r={targetId:t.targetId.toString()};return this.dataSource.getDeviceVersion(r)}getFirmwareVersion(t,r){const n={version:t.seVersion,deviceId:r.id};return this.dataSource.getFirmwareVersion(n)}getOsuFirmwareVersion(t,r){const n={version:t.seVersion,deviceId:r.id};return this.dataSource.getOsuFirmwareVersion(n)}getLatestFirmwareVersion(t,r){const n={currentFinalFirmwareId:t.id,deviceId:r.id};return this.dataSource.getLatestFirmwareVersion(n)}getNextFirmwareVersion(t){return this.dataSource.getFirmwareVersionById(t.nextFinalFirmware)}getLanguagePackages(t,r){const n={deviceId:t.id,currentFinalFirmwareId:r.id};return this.dataSource.getLanguagePackages(n)}getMcuList(){return this.dataSource.getMcuList()}getAppsByHash(t){const r={hashes:t};return He(async({fromPromise:n,throwE:o})=>{if(r.hashes.length===0)return[];try{return await n(this.dataSource.getAppsByHash(r))}catch(a){return a instanceof xd?o(a):o(new xd(a))}})}getProvider(){return this.dataSource.getProvider()}};C1=i8([Qe(),o8(0,Oe(jl.ManagerApiDataSource))],C1);var s8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},gm=(e,t)=>(r,n)=>t(r,n,e);let k1=class{constructor(t,r,n){this.sessionService=t,this.managerApiDataSource=r,this._logger=n("SetFirmwareDistributionSaltUseCase")}_logger;execute(t){if(t.trim()===""){this._logger.warn("Ignoring empty firmware distribution salt");return}const r=this.managerApiDataSource.getFirmwareDistributionSalt();if(t===r){this._logger.debug("Firmware distribution salt unchanged",{data:{salt:t}});return}this.managerApiDataSource.setFirmwareDistributionSalt(t);let n=0;for(const o of this.sessionService.getDeviceSessions()){const a=o.getDeviceSessionState();a.sessionStateType!==Ys.Connected&&a.firmwareUpdateContext!==void 0&&(o.setDeviceSessionState({...a,firmwareUpdateContext:void 0}),n++)}this._logger.info("Firmware distribution salt updated",{data:{previousSalt:r,salt:t,invalidatedSessions:n}})}};k1=s8([Qe(),gm(0,Oe(dr.DeviceSessionService)),gm(1,Oe(jl.ManagerApiDataSource)),gm(2,Oe(Dt.LoggerPublisherServiceFactory))],k1);var a8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},R1=(e,t)=>(r,n)=>t(r,n,e);let _1=class{constructor(t,r){this.sessionService=t,this.managerApiDataSource=r}execute(t){for(const r of this.sessionService.getDeviceSessions()){const n=r.getDeviceSessionState();n.sessionStateType!==Ys.Connected&&r.setDeviceSessionState({...n,firmwareUpdateContext:void 0,installedApps:[],appsUpdates:void 0,catalog:void 0})}this.managerApiDataSource.setProvider(t)}};_1=a8([Qe(),R1(0,Oe(dr.DeviceSessionService)),R1(1,Oe(jl.ManagerApiDataSource))],_1);var l8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},c8=(e,t)=>(r,n)=>t(r,n,e);let $1=class{webSocketBaseUrl;constructor({webSocketUrl:t}){this.webSocketBaseUrl=t}setWebSocketUrl(t){this.webSocketBaseUrl===t||t.length===0||(this.webSocketBaseUrl=t)}getWebSocketUrl(){return this.webSocketBaseUrl}genuineCheck(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/genuine",params:t});return this._connectWebSocket(r)}installApp(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/install",params:t});return this._connectWebSocket(r)}listInstalledApps(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/apps/list",params:t});return this._connectWebSocket(r)}uninstallApp(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/install",params:t});return this._connectWebSocket(r)}updateFirmware(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/install",params:t});return this._connectWebSocket(r)}updateMcu(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/mcu",params:t});return this._connectWebSocket(r)}_connectWebSocket(t){try{return Tt(new gF(t))}catch(r){return yt(new SF(r))}}};$1=l8([Qe(),c8(0,Oe(Kd.DmkConfig))],$1);var u8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},d8=(e,t)=>(r,n)=>t(r,n,e);let A1=class{constructor(t){this.dataSource=t}genuineCheck(t,r){const n={targetId:t.targetId.toString(),perso:r.perso};return this.dataSource.genuineCheck(n)}installApp(t,r){const{perso:n,firmware:o,firmwareKey:a,hash:l}=r,u={targetId:t.targetId.toString(),perso:n,firmware:o,firmwareKey:a,hash:l};return this.dataSource.installApp(u)}listInstalledApps(t,r){const n={targetId:t.targetId.toString(),perso:r.perso};return this.dataSource.listInstalledApps(n)}uninstallApp(t,r){const{perso:n,delete:o,deleteKey:a,hash:l}=r,u={targetId:t.targetId.toString(),perso:n,firmware:o,firmwareKey:a,hash:l};return this.dataSource.uninstallApp(u)}updateFirmware(t,r){const n={targetId:t.targetId.toString(),perso:r.perso,firmware:r.firmware,firmwareKey:r.firmwareKey};return this.dataSource.updateFirmware(n)}updateMcu(t,r){const n={targetId:t.targetId.toString(),version:r.version};return this.dataSource.updateMcu(n)}};A1=u8([Qe(),d8(0,Oe(Kd.SecureChannelDataSource))],A1);var f8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},p8=(e,t)=>(r,n)=>t(r,n,e);let T1=class{constructor(t){this.secureChannelDataSource=t}execute(t){this.secureChannelDataSource.setWebSocketUrl(t)}};T1=f8([Qe(),p8(0,Oe(Kd.SecureChannelDataSource))],T1);var h8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},L1=(e,t)=>(r,n)=>t(r,n,e);let I1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("SendApduUseCase")}async execute({sessionId:t,apdu:r,abortTimeout:n,triggersDisconnection:o}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:async a=>(await a.sendApdu(r,{abortTimeout:n,triggersDisconnection:o})).caseOf({Right:l=>l,Left:l=>{throw this._logger.error("Error sending APDU",{data:{sessionId:t,apdu:r,error:l}}),l}}),Left:a=>{throw this._logger.error("Error getting deviceSession",{data:{error:a}}),a}})}};I1=h8([Qe(),L1(0,Oe(dr.DeviceSessionService)),L1(1,Oe(Dt.LoggerPublisherServiceFactory))],I1);var m8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},ks=(e,t)=>(r,n)=>t(r,n,e);let O1=class{constructor(t,r,n,o,a,l){if(this._config=r,this._loggerModuleFactory=n,this._deviceModelDataSource=o,this._apduSenderServiceFactory=a,this._apduReceiverServiceFactory=l,this._logger=n("TransportService"),t.length===0)throw this._logger.warn("No transports provided, please check your configuration"),new mF("No transports provided, please check your configuration");for(const u of t){const d=this.addTransport(u);if(d.isLeft())throw d.extract()}}_transports=new Map;_logger;addTransport(t){const r=t({deviceModelDataSource:this._deviceModelDataSource,loggerServiceFactory:this._loggerModuleFactory,config:this._config,apduSenderServiceFactory:this._apduSenderServiceFactory,apduReceiverServiceFactory:this._apduReceiverServiceFactory});return this.addTransportInternal(r)}addTransportInternal(t){return this.getTransport(t.getIdentifier()).isJust()?(this._logger.warn(`Transport ${t.getIdentifier()} already exists, please check your configuration`),yt(new hF(`Transport ${t.getIdentifier()} already exists, please check your configuration`))):(this._transports.set(t.getIdentifier(),t),Tt(void 0))}getTransport(t){return Ar.fromNullable(this._transports.get(t))}getAllTransports(){return Array.from(this._transports.values())}closeConnection(t){this.getTransport(t.transport).map(r=>r.disconnect({connectedDevice:t}))}};O1=m8([Qe(),ks(0,Oe(Gi.TransportsInput)),ks(1,Oe(Gi.DmkConfig)),ks(2,Oe(Dt.LoggerPublisherServiceFactory)),ks(3,Oe(pB.DeviceModelDataSource)),ks(4,Oe(dr.ApduSenderServiceFactory)),ks(5,Oe(dr.ApduReceiverServiceFactory))],O1);const g8={ADD_LOG:"addLog"};function v8(e){return{startListeningCommand:()=>e.sendMessage(zi.START_LISTENING_DEVICES,"{}"),stopListeningCommand:()=>e.sendMessage(zi.STOP_LISTENING_DEVICES,"{}"),startDiscoveringCommand:()=>e.sendMessage(zi.START_DISCOVERING,"{}"),stopDiscoveringCommand:()=>e.sendMessage(zi.STOP_DISCOVERING,"{}"),connectDeviceCommand:(t,r)=>e.sendMessage(zi.CONNECT_DEVICE,JSON.stringify({deviceId:t,sessionRefresherOptions:r}))}}function y8(e){return{getProviderCommand:()=>e.sendMessage(zi.GET_PROVIDER,"{}"),setProviderCommand:t=>e.sendMessage(zi.SET_PROVIDER,JSON.stringify({provider:t}))}}let b8=0;function x8(e){return{sendApduCommand:(t,r)=>{const n=`apdu-${++b8}`,o=r.match(/.{1,2}/g)?.map(a=>parseInt(a,16))||[];return e.sendMessage(zi.SEND_APDU,JSON.stringify({sessionId:t,apdu:o,requestId:n})),n}}}const w8=e=>{try{const t=JSON.parse(e);return typeof t=="string"||t!==null&&typeof t=="object"?t:t===null?{}:JSON.stringify(t)}catch{return e}},S8=new Set(["debug","info","warning","error","fatal"]),E8=e=>{if(e===null||typeof e!="object")return!1;const{timestamp:t,tag:r,verbosity:n,message:o,payloadJSON:a}=e;return typeof t=="string"&&typeof r=="string"&&typeof o=="string"&&typeof n=="string"&&S8.has(n)&&(a===void 0||typeof a=="string")};function C8(e){let t;try{t=JSON.parse(e)}catch{return null}if(!E8(t))return null;const r=t.payloadJSON??"{}";return{timestamp:t.timestamp,tag:t.tag,verbosity:t.verbosity,message:t.message,payloadJSON:r,payload:w8(r)}}function k8(e,t){try{const{module:r}=JSON.parse(e);t(n=>new Set([...n,r]))}catch(r){console.error("Failed to parse moduleConnected payload",r)}}function R8(e,t){const r=C8(e);return r!==null?(t(r),!0):!1}function _8(e,t){try{const r=JSON.parse(e);t(r)}catch(r){console.error("Failed to parse connectedDevicesUpdate payload",r)}}function $8(e,t){try{const{sessionId:r,state:n}=JSON.parse(e);t(o=>new Map(o).set(r,n))}catch(r){console.error("Failed to parse deviceSessionStateUpdate payload",r)}}function A8(e,t){try{const r=JSON.parse(e);t(r)}catch(r){console.error("Failed to parse discoveredDevicesUpdate payload",r)}}function T8(e,t){try{const{provider:r}=JSON.parse(e);t(r)}catch(r){console.error("Failed to parse providerValue payload",r)}}const L8=e=>{try{const{protocol:t,host:r}=new URL(e);return(t==="http:"||t==="https:")&&r!==""}catch{return!1}};function I8(e){try{const t=JSON.parse(e);if(t===null)return null;if(typeof t!="object")return;const{url:r,sessionToken:n}=t;return typeof r!="string"||!L8(r)||n!==void 0&&typeof n!="string"?void 0:n===void 0?{url:r}:{url:r,sessionToken:n}}catch{return}}function O8(e,t){const r=I8(e);if(r===void 0){console.error("Ignored an invalid mockServerConfig payload");return}t(r)}function N8(e,t){try{const r=JSON.parse(e);t(n=>new Map(n).set(r.requestId,r))}catch(r){console.error("Failed to parse apduResponse payload",r)}}const P8=250;function D8(e){const[t,r]=x.useState([]),[n,o]=x.useState(new Set),[a,l]=x.useState([]),[u,d]=x.useState(new Map),[p,h]=x.useState([]),[m,y]=x.useState(!1),[w,E]=x.useState(!1),[S,C]=x.useState(null),[R,k]=x.useState(new Map),[$,A]=x.useState(null),D=x.useRef([]);x.useEffect(()=>{let H;const O=()=>{H=void 0;const U=D.current;D.current=[],U.length>0&&r(z=>[...z,...U].slice(-2e4))},{unsubscribe:L}=e.listenToMessages((U,z)=>{switch(H??=setTimeout(O,P8),U){case b5:k8(z,o);break;case Es.CONNECTED_DEVICES_UPDATE:_8(z,l);break;case Es.DEVICE_SESSION_STATE_UPDATE:$8(z,d);break;case Es.DISCOVERED_DEVICES_UPDATE:A8(z,h);break;case Es.PROVIDER_VALUE:T8(z,C);break;case Es.APDU_RESPONSE:N8(z,k);break;case Es.MOCK_SERVER_CONFIG:O8(z,A);break;case g8.ADD_LOG:R8(z,T=>D.current.push(T));break}});return()=>{L(),clearTimeout(H),D.current=[]}},[e]);const N=x.useMemo(()=>v8(e),[e]),P=x.useMemo(()=>y8(e),[e]),I=x.useMemo(()=>x8(e),[e]),re=x.useCallback(()=>{y(!0),h([]),N.startListeningCommand()},[N]),Z=x.useCallback(()=>{y(!1),h([]),N.stopListeningCommand()},[N]),ee=x.useCallback(()=>{E(!0),h([]),N.startDiscoveringCommand()},[N]),ne=x.useCallback(()=>{E(!1),h([]),N.stopDiscoveringCommand()},[N]),X=x.useCallback(()=>{D.current=[],r([])},[]),F=n.has(mw.LOGGER),V=n.has(mw.DMK_INSPECTOR);return{logs:t,connectedModules:n,connectedDevices:a,sessionStates:u,discoveredDevices:p,isListening:m,isActivelyDiscovering:w,isLoggerConnected:F,isInspectorConnected:V,providerValue:S,apduResponses:R,mockServer:$,sendMessage:e.sendMessage,clearLogs:X,startListening:re,stopListening:Z,startDiscovering:ee,stopDiscovering:ne,connectDevice:N.connectDeviceCommand,getProvider:P.getProviderCommand,setProvider:P.setProviderCommand,sendApdu:I.sendApduCommand}}const _g=e=>`devtools-panel-width-${e}`,j8=e=>{try{const t=Number(localStorage.getItem(_g(e)));return t>0?t:null}catch{return null}},vm=(e,t)=>{try{t===null?localStorage.removeItem(_g(e)):localStorage.setItem(_g(e),String(t))}catch{}},Dv=({name:e,defaultWidth:t,minWidth:r,maxWidth:n,edge:o,className:a="",children:l})=>{const[u,d]=x.useState(()=>j8(e)??t),p=y=>{y.preventDefault();const w=y.clientX,E=u;let S=E;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const C=k=>{const $=k.clientX-w;S=Math.min(n,Math.max(r,E+(o==="right"?$:-$))),d(S)},R=()=>{document.body.style.cursor="",document.body.style.userSelect="",vm(e,S),window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",R)};window.addEventListener("mousemove",C),window.addEventListener("mouseup",R)},h=y=>{const w=y.key==="ArrowRight"?16:y.key==="ArrowLeft"?-16:0;if(w===0)return;y.preventDefault();const E=Math.min(n,Math.max(r,u+(o==="right"?w:-w)));d(E),vm(e,E)},m=()=>{d(t),vm(e,null)};return v.jsxs("div",{className:`relative flex flex-col ${a}`,style:{flex:`0 1 ${u}px`,minWidth:r},children:[l,v.jsx("span",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the panel","aria-valuenow":u,"aria-valuemin":r,"aria-valuemax":n,tabIndex:0,title:"Drag or use the arrow keys to resize, double-click to reset",onMouseDown:p,onKeyDown:h,onDoubleClick:m,className:`absolute inset-y-0 z-10 w-6 cursor-col-resize border-transparent hover:border-active focus-visible:border-active focus-visible:outline-none ${o==="right"?"-right-3 border-r-2":"-left-3 border-l-2"}`})]})},c_="relative w-320 min-w-160 shrink",Ml="flex h-32 items-center gap-6 overflow-hidden rounded-sm border border-muted-subtle bg-surface px-8 transition-colors hover:border-muted focus-within:border-active",zl="min-w-0 flex-1 bg-transparent font-mono! body-3 text-base outline-none placeholder:text-muted",Lo="flex size-24 shrink-0 cursor-pointer items-center justify-center rounded-xs text-muted transition-colors hover:bg-base-transparent-hover hover:text-base disabled:cursor-default disabled:text-disabled disabled:hover:bg-transparent",u_=/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl+",d_="rounded-xs border border-muted px-4 font-mono! body-4 text-muted",M8="body-4-semi-bold text-muted uppercase",z8=e=>{const t=[{title:null,blocks:[]}],r=e.split(`
37
+ ${(function(a){switch(a.kind){case zi.method:return`[class: "${a.targetClass.name}", method: "${a.method.toString()}"]`;case zi.parameter:return`[class: "${a.targetClass.name}", index: "${a.index.toString()}"]`;case zi.property:return`[class: "${a.targetClass.name}", property: "${a.property.toString()}"]`}})(o)}`,{cause:n})}throw n}function OF(e,t){return(r,n,o)=>{try{o===void 0?(function(a,l){const u=um(a,l);return(d,p)=>{cl(d.constructor,qu,Gu,_S(u(d),p))}})(e,t)(r,n):typeof o=="number"?(function(a,l){const u=um(a,l);return(d,p,h)=>{if(!(function(m,y){return typeof m=="function"&&y===void 0})(d,p))throw new Vi(Dn.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.
38
+ Found @inject decorator at method "${p?.toString()??""}" at class "${d.constructor.name}"`);cl(d,qu,Gu,(function(m,y){return w=>{const E=w.constructorArguments[y];return w.constructorArguments[y]=m(E),w}})(u(d),h))}})(e,t)(r,n,o):(function(a,l){const u=um(a,l);return(d,p,h)=>{if(!(function(m){return m.set!==void 0})(h))throw new Vi(Dn.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.
39
+ Found @inject decorator at method "${p.toString()}" at class "${d.constructor.name}"`);cl(d.constructor,qu,Gu,_S(u(d),p))}})(e,t)(r,n,o)}catch(a){IF(r,n,o,a)}}}function um(e,t){return r=>{const n=t(r);return o=>(n(o),e(o))}}function Ie(e){return OF(LF(Cl.singleInjection,e),$F)}(function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"})(zi||(zi={}));const $S="@inversifyjs/core/classIsInjectableFlagReflectKey",NF=[Array,BigInt,Boolean,Function,Number,Object,String];function PF(e){const t=Pv(e,"design:paramtypes");t!==void 0&&cl(e,qu,Gu,(function(r){return n=>(r.forEach(((o,a)=>{var l;n.constructorArguments[a]!==void 0||(l=o,NF.includes(l))||(n.constructorArguments[a]=(function(u){return{isFromTypescriptParamType:!0,kind:Cl.singleInjection,name:void 0,optional:!1,tags:new Map,value:u}})(o))})),n)})(t))}function Ke(e){return t=>{(function(r){if(Pv(r,$S)!==void 0)throw new Vi(Dn.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${r.name}"`);kF(r,$S,!0)})(t),PF(t)}}var AS;(function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"})(AS||(AS={}));var TS;(function(e){e[e.singleMandatory=0]="singleMandatory",e[e.singleOptional=1]="singleOptional",e[e.multipleMandatory=2]="multipleMandatory",e[e.multipleOptional=3]="multipleOptional",e[e.length=4]="length"})(TS||(TS={}));let DF=class{constructor(t,r,n,o,a){this.deviceModel=t,this.serviceUuid=r,this.writeUuid=n,this.writeCmdUuid=o,this.notifyUuid=a}},Cs=class{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;getBlockSize;masks;bluetoothSpec;constructor(t){this.id=t.id,this.productName=t.productName,this.usbProductId=t.usbProductId,this.bootloaderUsbProductId=t.bootloaderUsbProductId,this.usbOnly=t.usbOnly,this.memorySize=t.memorySize,this.getBlockSize=t.getBlockSize,this.masks=t.masks,this.bluetoothSpec=t.bluetoothSpec}};var jF=Object.defineProperty,MF=(e,t,r)=>t in e?jF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},FF=(e,t,r)=>MF(e,t+"",r);let Oo=class{getAllDeviceModels(){return Object.values(Oo.deviceModelByIds)}getDeviceModel(t){return Oo.deviceModelByIds[t.id]}filterDeviceModels(t){return this.getAllDeviceModels().filter(r=>Object.entries(t).every(([n,o])=>r[n]===o))}getBluetoothServicesInfos(){return Object.values(Oo.deviceModelByIds).reduce((t,r)=>{const{bluetoothSpec:n}=r;return n?{...t,...n.reduce((o,a)=>({...o,[a.serviceUuid]:new DF(r,a.serviceUuid,a.writeUuid,a.writeCmdUuid,a.notifyUuid)}),{})}:t},{})}getBluetoothServices(){return Object.values(Oo.deviceModelByIds).map(t=>(t.bluetoothSpec||[]).map(r=>r.serviceUuid)).flat().filter(t=>!!t)}};FF(Oo,"deviceModelByIds",{[wt.NANO_S]:new Cs({id:wt.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,getBlockSize:e=>pS.lt(pS.coerce(e.firmwareVersion)??"","2.0.0")?4*1024:2*1024,masks:[823132160]}),[wt.NANO_SP]:new Cs({id:wt.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,getBlockSize:()=>512,masks:[856686592]}),[wt.NANO_X]:new Cs({id:wt.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,getBlockSize:()=>4*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]}),[wt.STAX]:new Cs({id:wt.STAX,productName:"Ledger Stax",usbProductId:96,bootloaderUsbProductId:6,usbOnly:!1,memorySize:1533*1024,getBlockSize:()=>512,masks:[857735168],bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}),[wt.FLEX]:new Cs({id:wt.FLEX,productName:"Ledger Flex",usbProductId:112,bootloaderUsbProductId:7,usbOnly:!1,memorySize:1533*1024,getBlockSize:()=>512,masks:[858783744],bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}),[wt.APEX]:new Cs({id:wt.APEX,productName:"Ledger Nano Gen5",usbProductId:128,bootloaderUsbProductId:8,usbOnly:!1,memorySize:1533*1024,getBlockSize:()=>512,masks:[859832320],bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"},{serviceUuid:"13d63400-2c97-9004-0000-4c6564676572",notifyUuid:"13d63400-2c97-9004-0001-4c6564676572",writeUuid:"13d63400-2c97-9004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-9004-0003-4c6564676572"}]})}),Oo=zF([Ke()],Oo);let BF=class{statusCode;data;constructor({statusCode:t,data:r}){this.statusCode=t,this.data=r}};const UF=5,Ao=1,Eg=2,Ls=2,Cg=2,ir=[];for(let e=0;e<256;++e)ir.push((e+256).toString(16).slice(1));function VF(e,t=0){return(ir[e[t+0]]+ir[e[t+1]]+ir[e[t+2]]+ir[e[t+3]]+"-"+ir[e[t+4]]+ir[e[t+5]]+"-"+ir[e[t+6]]+ir[e[t+7]]+"-"+ir[e[t+8]]+ir[e[t+9]]+"-"+ir[e[t+10]]+ir[e[t+11]]+ir[e[t+12]]+ir[e[t+13]]+ir[e[t+14]]+ir[e[t+15]]).toLowerCase()}let dm;const WF=new Uint8Array(16);function HF(){if(!dm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");dm=crypto.getRandomValues.bind(crypto)}return dm(WF)}const qF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),LS={randomUUID:qF};function Yd(e,t,r){if(LS.randomUUID&&!e)return LS.randomUUID();e=e||{};const n=e.random||(e.rng||HF)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,VF(n)}const No={getLastBytesFrom(e,t){return e.slice(-t)},getFirstBytesFrom(e,t){return e.slice(0,t)},bytesToNumber(e){return e.reduce((t,r,n)=>t+r*Math.pow(256,e.length-1-n),0)},numberToByteArray(e,t){return new Uint8Array(t).map((r,n)=>e>>8*(t-1-n)&255)}},IS=2,fm=800;let OS=class{_tag="FramerOverflowError";originalError;constructor(){this.originalError=new Error("Frame header length is greater than frame size")}},GF=class{_tag="FramerApduError";originalError;constructor(){this.originalError=new Error("Frame offset is greater than apdu length")}},NS=class{_tag="ReceiverApduError";originalError;constructor(t){this.originalError=new Error(t??"Unable to parse apdu")}},PS=class{_tag="DeviceSessionNotFound";originalError;constructor(t){this.originalError=t??new Error("Device session not found")}},l_=class{_header;_data;constructor({header:t,data:r}){this._header=t,this._data=r}toString(){return JSON.stringify({header:this._header.toString(),data:si(this._data)},null,2)}getRawData(){const t=this._header.getRawData(),r=new Uint8Array(t.length+this._data.length);return r.set(t,0),r.set(this._data,t.length),r}getHeader(){return this._header}getData(){return this._data}},c_=class{_uuid;_channel;_headTag;_index;_length;_dataLength;constructor({uuid:t,dataSize:r,index:n,headTag:o,length:a,channel:l}){this._uuid=t,this._dataLength=r,this._index=n,this._headTag=o,this._length=a,this._channel=l}getDataLength(){return this._dataLength.map(t=>No.bytesToNumber(t))}setDataSize(t){return this._dataLength=t,this}getLength(){return this._length}toString(){return JSON.stringify({uuid:this._uuid.toString(),dataSize:this._dataLength.extract()?.toString(),index:this._index.toString(),headTag:this._headTag.toString(),length:this._length.toString(),channel:this._channel.extract()?.toString()})}getRawData(){return new Uint8Array([...this._channel.caseOf({Just:t=>[...t],Nothing:()=>[]}),...this._headTag,...this._index,...this._dataLength.caseOf({Just:t=>[...t],Nothing:()=>[]})])}};const Ot={LoggerPublisherServiceFactory:Symbol.for("LoggerPublisherServiceFactory")};var XF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},YF=(e,t)=>(r,n)=>t(r,n,e);let DS=class{_channel;_logger;_pendingFrames;constructor({channel:t=Ar.zero()},r){this._channel=t,this._logger=r("ApduReceiverService"),this._pendingFrames=[]}handleFrame(t){return this.getFrameFromBytes(t).map(r=>{if(this._pendingFrames.push(r),!this._pendingFrames[0])return ft;const n=this._pendingFrames[0].getHeader().getDataLength();return this.getCompleteFrame(n)})}getCompleteFrame(t){return t.chain(r=>{if(!this.isComplete(r))return this._logger.debug("frame is not complete, waiting for more"),ft;const n=No.getFirstBytesFrom(this.concatFrames(this._pendingFrames),r),o=No.getFirstBytesFrom(n,n.length-IS),a=No.getLastBytesFrom(n,IS);return this._pendingFrames=[],or(new BF({data:o,statusCode:a}))})}getFrameFromBytes(t){const r=this._channel.caseOf({Just:()=>Eg,Nothing:()=>0}),n=t.slice(r,r+Ao),o=t.slice(r+Ao,r+Ao+Ls),a=o.reduce((y,w)=>y+w,0)===0;if(!a&&this._pendingFrames.length===0)return yt(new NS);const l=r+Ao+Ls,u=a?Cg:0;if(t.length<r+Ao+Ls+u)return yt(new NS("Unable to parse header from apdu"));const d=a?or(t.slice(l,l+u)):ft,p=l+u,h=t.slice(p),m=new l_({header:new c_({uuid:Yd(),channel:this._channel,dataSize:d,headTag:n,index:o,length:r+Ao+Ls+u}),data:h});return Tt(m)}isComplete(t){return this._pendingFrames.reduce((r,n)=>r+n.getData().length,0)>=t}concatFrames(t){return t.reduce((r,n)=>Uint8Array.from([...r,...n.getData()]),new Uint8Array(0))}};DS=XF([Ke(),YF(1,Ie(Ot.LoggerPublisherServiceFactory))],DS);var KF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},QF=(e,t)=>(r,n)=>t(r,n,e);let jS=class{_frameSize;_channel;_padding;_logger;constructor({frameSize:t,channel:r=Ar.zero(),padding:n=!1},o){this._frameSize=t,this._channel=r,this._padding=n,this._logger=o("DefaultApduSenderService")}getFrames(t){const r=[];let n=0,o=this.getFrameAtIndex(t,n);for(;o.isRight();)r.push(o.extract()),n+=1,o=this.getFrameAtIndex(t,n).mapLeft(a=>(a instanceof OS||this._logger.error("Error while parsing frame",{data:{error:a}}),a));return r}getFrameAtIndex(t,r){const n=this.getFrameHeaderFrom(r,t.length),o=r===0?0:r*this._frameSize-this.getHeaderSizeSumFrom(r);if(o>=t.length)return yt(new OS);if(n.getLength()>this._frameSize)return yt(new GF);const a=this._frameSize-n.getLength(),l=t.slice(o,o+this._frameSize-n.getLength()),u=this._padding?new Uint8Array(a).fill(0):new Uint8Array(l.length<a?l.length:a);u.set(l,0);const d=new l_({header:n,data:u});return Tt(d)}getFrameHeaderFrom(t,r){const n=new c_({uuid:Yd(),channel:this._channel.map(o=>No.getLastBytesFrom(o,Eg)),headTag:new Uint8Array([UF]),index:No.numberToByteArray(t,Ls),length:this.getFrameHeaderSizeFromIndex(t),dataSize:Ar.zero()});return t===0&&n.setDataSize(Ar.of(No.numberToByteArray(r,Cg))),n}getHeaderSizeSumFrom(t){let r=this.getFrameHeaderSizeFromIndex(0),n=1;for(;n<t;)r+=this.getFrameHeaderSizeFromIndex(n),n+=1;return r}getFrameHeaderSizeFromIndex(t){return this._channel.caseOf({Just:()=>Eg,Nothing:()=>0})+Ls+Ao+(t===0?Cg:0)}};jS=KF([Ke(),QF(1,Ie(Ot.LoggerPublisherServiceFactory))],jS);const kg={LocalConfigDataSource:Symbol.for("LocalConfigDataSource"),RemoteConfigDataSource:Symbol.for("RemoteConfigDataSource"),ConfigService:Symbol.for("ConfigService")},ar={ApduSenderServiceFactory:Symbol.for("ApduSenderServiceFactory"),ApduReceiverServiceFactory:Symbol.for("ApduReceiverServiceFactory"),DeviceSessionService:Symbol.for("DeviceSessionService")},MS={ConnectUseCase:Symbol.for("ConnectUseCase"),DisconnectUseCase:Symbol.for("DisconnectUseCase")},jl={ManagerApiService:Symbol.for("ManagerApiService"),ManagerApiDataSource:Symbol.for("ManagerApiDataSource"),DmkConfig:Symbol.for("ManagerApiDmkConfig")},Kd={SecureChannelService:Symbol.for("SecureChannelService"),SecureChannelDataSource:Symbol.for("SecureChannelDataSource"),DmkConfig:Symbol.for("SecureChannelDmkConfig")},Gi={DmkConfig:Symbol.for("TransportDmkConfig"),TransportService:Symbol.for("TransportService"),TransportsInput:Symbol.for("TransportsInput")};var JF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},zS=(e,t)=>(r,n)=>t(r,n,e);let FS=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("SendCommandUseCase")}async execute({sessionId:t,command:r,abortTimeout:n}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:async o=>await o.sendCommand(r,n),Left:o=>{throw this._logger.error("Error getting session",{data:{error:o}}),o}})}};FS=JF([Ke(),zS(0,Ie(ar.DeviceSessionService)),zS(1,Ie(Ot.LoggerPublisherServiceFactory))],FS);var ZF=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let BS=class{execute=vi.fn(()=>"stub")};BS=ZF([Ke()],BS);var eB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},US=(e,t)=>(r,n)=>t(r,n,e);let VS=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("ExecuteDeviceActionUseCase")}execute({sessionId:t,deviceAction:r}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:n=>n.executeDeviceAction(r),Left:n=>{throw this._logger.error("Error getting session",{data:{error:n}}),n}})}};VS=eB([Ke(),US(0,Ie(ar.DeviceSessionService)),US(1,Ie(Ot.LoggerPublisherServiceFactory))],VS);function tB(e){return typeof e=="object"&&e!==null&&"version"in e&&"name"in e&&typeof e.version=="string"&&typeof e.name=="string"}let WS=class{constructor(t){this.err=t,this.originalError=t}_tag="ApiCallError";originalError},rB=class{constructor(t){this.err=t,this.originalError=t}_tag="ParseResponseError";originalError},u_=class{constructor(t){this.err=t,this.originalError=t}_tag="JSONParseError";originalError},nB=class{constructor(t){this.err=t,this.originalError=t}_tag="ReadFileError";originalError};const iB="@ledgerhq/device-management-kit",oB="0.0.0-develop-20261119133251",HS={name:iB,version:oB};var sB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};const aB={name:HS.name,version:HS.version},lB=()=>JSON.stringify(aB);let qS=class{getConfig(){return Tr.encase(()=>lB()).mapLeft(t=>new nB(t)).chain(t=>Tr.encase(()=>{const r=JSON.parse(t);if(tB(r))return r;throw new Error("Invalid config file")}).mapLeft(r=>new u_(r)))}};qS=sB([Ke()],qS);var cB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let GS=class{getConfig(){return Tr.of({name:"DeviceSDK",version:"0.0.0-stub.1"})}};GS=cB([Ke()],GS);var uB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let XS=class{async getConfig(){const t=await this._callApi();if(t.isLeft())return yt(new WS(t.extract()));if(!t.extract().ok)return yt(new WS(new Error("response not ok")));const r=await t.extract().json();return r.isLeft()?yt(new u_):r.chain(n=>this._parseResponse(n)).map(n=>n)}_parseResponse(t){const{name:r,version:n}=t;return!r||!n?yt(new rB):Tr.of({name:r,version:n})}_callApi(){return new Promise(t=>{t(Tr.of({ok:!0,json:async()=>new Promise(r=>{r(Tr.of({name:"DeviceSDK",version:"0.0.0-fake.1",yolo:"yolo"}))})}))})}};XS=uB([Ke()],XS);var dB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let YS=class{async getConfig(){return new Promise(t=>t(Tr.of({name:"DeviceSDK",version:"0.0.0-fake.2"})))}};YS=dB([Ke()],YS);var fB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},pm=(e,t)=>(r,n)=>t(r,n,e);let KS=class{_local;_remote;_logger;constructor(t,r,n){this._local=t,this._remote=r,this._logger=n("config")}async getDmkConfig(){const t=this._local.getConfig().ifLeft(r=>{this._logger.error("Local config not available",{data:{error:r}})});if(t.isRight()){const r=t.extract();return this._logger.info("Local config available",{data:{config:r}}),r}return this._remote.getConfig().then(r=>r.mapLeft(n=>(this._logger.error("Local config available",{data:{error:n}}),{name:"DeadDmk",version:"0.0.0-dead.1"})).extract())}};KS=fB([Ke(),pm(0,Ie(kg.LocalConfigDataSource)),pm(1,Ie(kg.RemoteConfigDataSource)),pm(2,Ie(Ot.LoggerPublisherServiceFactory))],KS);var pB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},hB=(e,t)=>(r,n)=>t(r,n,e);let QS=class{_configService;constructor(t){this._configService=t}async getDmkVersion(){return(await this._configService.getDmkConfig()).version}};QS=pB([Ke(),hB(0,Ie(kg.ConfigService))],QS);const mB={DeviceModelDataSource:Symbol.for("DeviceModelDataSource")};var gB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},JS=(e,t)=>(r,n)=>t(r,n,e);let ZS=class{constructor(t,r){this._sessionService=t,this._logger=r("DisableDeviceSessionRefresherUseCase")}_logger;execute({sessionId:t,blockerId:r}){return this._sessionService.getDeviceSessionById(t).caseOf({Left:n=>{throw this._logger.error("Error getting device session",{data:{error:n}}),n},Right:n=>n.disableRefresher(r)})}};ZS=gB([Ke(),JS(0,Ie(ar.DeviceSessionService)),JS(1,Ie(Ot.LoggerPublisherServiceFactory))],ZS);var vB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},yB=(e,t)=>(r,n)=>t(r,n,e);let e1=class{_sessions;_sessionsSubject;_sessionListSubject;_logger;constructor(t){this._sessions=[],this._sessionsSubject=new UR,this._sessionListSubject=new BR([]),this._logger=t("DeviceSessionService")}get sessionsObs(){return this._sessionsSubject.asObservable()}get sessionListObs(){return this._sessionListSubject.asObservable()}addDeviceSession(t){return this._sessions.find(r=>r.id===t.id)?(this._logger.warn("DeviceSession already exists",{data:{deviceSession:t}}),this):(this._sessions.push(t),this._sessionsSubject.next(t),this._sessionListSubject.next([...this._sessions]),this._logger.info("DeviceSession added",{data:{sessionId:t.id}}),this)}removeDeviceSession(t){const r=this._sessions.find(n=>n.id===t);return r?(r.close(),this._sessions=this._sessions.filter(n=>n.id!==t),this._sessionListSubject.next([...this._sessions]),this._logger.info("DeviceSession removed",{data:{sessionId:t}}),this):(this._logger.warn("DeviceSession not found",{data:{sessionId:t}}),this)}getDeviceSessionById(t){return Ar.fromNullable(this._sessions.find(r=>r.id===t)).toEither(new PS)}getDeviceSessionsByDeviceId(t){return Ar.fromPredicate(({length:r})=>r>0,this._sessions.filter(r=>r.connectedDevice.id===t)).toEither(new PS)}getDeviceSessions(){return this._sessions}};e1=vB([Ke(),yB(0,Ie(Ot.LoggerPublisherServiceFactory))],e1);var bB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},t1=(e,t)=>(r,n)=>t(r,n,e);let r1=class{_sessionService;_transportService;constructor(t,r){this._sessionService=t,this._transportService=r}execute(){const t=this._sessionService.getDeviceSessions();for(const r of t)this._transportService.closeConnection(r.connectedDevice),this._sessionService.removeDeviceSession(r.id)}};r1=bB([Ke(),t1(0,Ie(ar.DeviceSessionService)),t1(1,Ie(Gi.TransportService))],r1);var xB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},n1=(e,t)=>(r,n)=>t(r,n,e);let i1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("GetDeviceSessionStateUseCase")}execute({sessionId:t}){return this._sessionService.getDeviceSessionById(t).caseOf({Left:r=>{throw this._logger.error("Error getting session device",{data:{error:r}}),r},Right:r=>r.state})}};i1=xB([Ke(),n1(0,Ie(ar.DeviceSessionService)),n1(1,Ie(Ot.LoggerPublisherServiceFactory))],i1);var wB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},o1=(e,t)=>(r,n)=>t(r,n,e);let s1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("UnsafeBypassIntentQueueUseCase")}execute({sessionId:t,bypass:r}){this._sessionService.getDeviceSessionById(t).caseOf({Left:n=>{throw this._logger.error("Error getting session",{data:{error:n}}),n},Right:n=>{this._logger.warn(`UNSAFE: ${r?"Enabling":"Disabling"} intent queue bypass for session ${t}`),n._unsafeBypassIntentQueue(r)}})}};s1=wB([Ke(),o1(0,Ie(ar.DeviceSessionService)),o1(1,Ie(Ot.LoggerPublisherServiceFactory))],s1);function SB(e){return`[will send APDU] ~...> ${si(e,!1)}`}function EB(e){return`[exchange] <= ${si(e.data,!1)}${si(e.statusCode,!1)}`}const CB="apdu-exchange";function kB(e,t,r){const n=si(t,!1),o=`${si(r.data,!1)}${si(r.statusCode,!1)}`;return{message:EB(r),data:{type:CB,sessionId:e,apdu:n,response:o}}}const Rg=1e3,hm=1e3,RB={isRefresherDisabled:!1,pollingInterval:1e3};var Pt=(e=>(e.NEW_STATE="NEW_STATE",e.REFRESH_NEEDED="REFRESH_NEEDED",e.COMMAND_SUCCEEDED="COMMAND_SUCCEEDED",e.DEVICE_STATE_UPDATE_BUSY="DEVICE_STATE_UPDATE_BUSY",e.DEVICE_STATE_UPDATE_LOCKED="DEVICE_STATE_UPDATE_LOCKED",e.DEVICE_STATE_UPDATE_CONNECTED="DEVICE_STATE_UPDATE_CONNECTED",e.DEVICE_STATE_UPDATE_UNKNOWN="DEVICE_STATE_UPDATE_UNKNOWN",e))(Pt||{});let _B=class{_eventEmitter=new oa;listen(){return this._eventEmitter.asObservable()}dispatch(t){this._eventEmitter.next(t)}},$B=class{constructor(t,r){this.loggerModuleFactory=t,this.sessionEventDispatcher=r,this._logger=this.loggerModuleFactory("IntentQueueService")}_logger;_queue=[];_isProcessing=!1;_currentSubscription=null;enqueue(t){this._logger.debug("Enqueueing intent",{data:{type:t.type}});const r=new oa,n={intent:t,subject:r,isCancelled:!1};this._queue.push(n);const o=()=>{this._logger.debug("Cancelling intent",{data:{type:t.type}}),n.isCancelled=!0,this._queue[0]===n&&this._currentSubscription?(this._currentSubscription.unsubscribe(),this._currentSubscription=null,r.complete(),this._queue.shift(),this._isProcessing=!1,this._processQueue()):(!this._isProcessing||this._queue[0]!==n)&&r.complete()};return this._isProcessing||this._processQueue(),{observable:r.asObservable().pipe(lF(()=>{this._logger.debug("Intent observable finalized",{data:{type:t.type}})})),cancel:o}}_processQueue(){if(this._isProcessing)return;if(this._queue.length===0){this.sessionEventDispatcher.dispatch({eventName:Pt.NEW_STATE});return}this.sessionEventDispatcher.dispatch({eventName:Pt.DEVICE_STATE_UPDATE_BUSY}),this._isProcessing=!0;const t=this._queue[0];if(t.isCancelled){this._logger.debug("Skipping cancelled intent",{data:{type:t.intent.type}}),t.subject.complete(),this._queue.shift(),this._isProcessing=!1,this._processQueue();return}this._logger.debug("Processing intent",{data:{type:t.intent.type}}),this._currentSubscription=t.intent.execute().subscribe({next:r=>{t.isCancelled||t.subject.next(r)},error:r=>{t.isCancelled||t.subject.error(r),this._onIntentComplete()},complete:()=>{t.isCancelled||t.subject.complete(),this._onIntentComplete()}})}_onIntentComplete(){this._logger.debug("Intent completed"),this._currentSubscription=null,this._queue.shift(),this._isProcessing=!1,this._processQueue()}},AB=class{constructor(t,r){this._refresher=r,this._logger=t("refresher-service")}_refresherBlockers=new Set;_logger;disableRefresher(t){const r=`${t}-${Yd()}`;this.addRefresherBlocker(r),this._logger.debug("Refresher disabled",{data:{blockerId:r,blockers:Array.from(this._refresherBlockers)}});let n=!1;return()=>{n||(n=!0,this.removeRefresherBlocker(r),this._logger.debug("Refresher re-enabled",{data:{blockerId:r,blockers:Array.from(this._refresherBlockers)}}))}}addRefresherBlocker(t){const r=this._refresherBlockers.size;this._refresherBlockers.add(t),r===0&&this._refresher.stop()}removeRefresherBlocker(t){const r=this._refresherBlockers.size;this._refresherBlockers.delete(t),r>0&&this._refresherBlockers.size===0&&this._refresher.start()}},TB=class{constructor(t,r,n,o){this.connectedDevice=r,this._sessionEventDispatcher=n,this._sendCommandFunction=o,this._logger=t("device-pinger"),this._subscription=this._sessionEventDispatcher.listen().subscribe(async a=>await this.mapEventAction(a))}_sendCommandFunction;_subscription;_logger;async ping(){try{return await this.mapDevicePingAction(this.connectedDevice.deviceModel.id)}catch(t){return this._logger.error("Error while pinging device",{data:{error:t}}),null}}mapEventAction=async t=>t.eventName===Pt.REFRESH_NEEDED?await this.ping():null;async mapDevicePingAction(t){if(t===wt.NANO_S){const r=async()=>{const a=await this._sendCommandFunction(new ww,fm);return this._sendCommandFunction(new fz,fm),a},n=new Promise(a=>{setTimeout(()=>a(null),Rg*2+100)}),o=await Promise.race([r(),n]);return o?this._sessionEventDispatcher.dispatch({eventName:Pt.COMMAND_SUCCEEDED,eventData:o}):this._sessionEventDispatcher.dispatch({eventName:Pt.DEVICE_STATE_UPDATE_LOCKED}),o}else{const r=await this._sendCommandFunction(new ww,fm);return this._sessionEventDispatcher.dispatch({eventName:Pt.COMMAND_SUCCEEDED,eventData:r}),r}}unsubscribe(){this._subscription.unsubscribe()}},LB=class{constructor(t,r,n,o){this._sessionEventDispatcher=n,this._refresherOptions=r,this._logger=t("device-session-refresher"),this._connectedDeviceID=o.deviceModel.id}_refresherSubscription;_refresherOptions;_logger;_connectedDeviceID;startRefresher(){if(this._refresherOptions.isRefresherDisabled||this._refresherSubscription)return;const t=this.getValidPollingInterval(this._refresherOptions,this._logger),r=this._sessionEventDispatcher.listen().pipe(SS(n=>n.eventName===Pt.DEVICE_STATE_UPDATE_BUSY||n.eventName===Pt.NEW_STATE),ai(n=>n.eventName===Pt.DEVICE_STATE_UPDATE_BUSY),uF(!1),sF());this._refresherSubscription=nF(0,t).pipe(dF(r),ES(([n,o])=>{o&&this._logger.debug("Refresh skipped: device is busy")}),SS(([n,o])=>!o),ES(()=>this._sessionEventDispatcher.dispatch({eventName:Pt.REFRESH_NEEDED}))).subscribe(),this._logger.info("Refresher started.")}stopRefresher(){this._refresherSubscription&&(this._refresherSubscription.unsubscribe(),this._refresherSubscription=void 0,this._logger.info("Refresher stopped."))}restartRefresher(){this.stopRefresher(),this.startRefresher(),this._logger.info("Refresher restarted.")}getValidPollingInterval=(t,r)=>{const{pollingInterval:n}=t;if(this._connectedDeviceID===wt.NANO_S){const o=Rg*2;return n!==void 0&&n<o?(r.warn(`Polling interval of ${n} is too low, setting to minimum as ${o}`),o):n??o}else return n!==void 0&&n<hm?(r.warn(`Polling interval of ${n} is too low, setting to minimum as ${hm}`),hm):n??Rg}},IB=class{constructor(t,r,n,o,a){this._sessionEventDispatcher=r,this._connectedDevice=n,this._deviceState=o,this.setDeviceSessionState=a,this._subscription=this._sessionEventDispatcher.listen().subscribe(l=>this.mapEventAction(l)),this._logger=t("device-session-state-handler")}_subscription;_logger;_pendingDeviceStatus=Ln.BUSY;_updateDeviceState(t){const r=this._parseDeviceStatus(t);if(r){const{sessionStateType:n,deviceStatus:o,currentApp:a}=r,l=this._deviceState.getValue();l.sessionStateType===Ys.Connected?this.setDeviceSessionState({sessionStateType:n,deviceStatus:o,deviceModelId:this._connectedDevice.deviceModel.id,currentApp:a,installedApps:[],isSecureConnectionAllowed:!1}):this.setDeviceSessionState({...l,sessionStateType:n,deviceStatus:o,deviceModelId:this._connectedDevice.deviceModel.id,currentApp:a})}}mapEventAction=t=>{const{eventName:r}=t;switch(r){case Pt.COMMAND_SUCCEEDED:return this._updateDeviceState(t.eventData);case Pt.DEVICE_STATE_UPDATE_BUSY:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:Ln.BUSY});case Pt.DEVICE_STATE_UPDATE_LOCKED:this._pendingDeviceStatus=Ln.LOCKED;return;case Pt.DEVICE_STATE_UPDATE_CONNECTED:this._pendingDeviceStatus=Ln.CONNECTED;return;case Pt.NEW_STATE:{const n=this._pendingDeviceStatus;return this._pendingDeviceStatus=Ln.BUSY,this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:n})}case Pt.DEVICE_STATE_UPDATE_UNKNOWN:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:Ln.BUSY});case Pt.REFRESH_NEEDED:return;default:{const n=r;throw new Error(`Unhandled context type ${n}`)}}};_parseDeviceStatus(t){return I5(t)?{sessionStateType:Ys.ReadyWithoutSecureChannel,deviceStatus:Ln.CONNECTED,currentApp:{name:t.data.name,version:t.data.version}}:(this._logger.debug("Error while parsing APDU response",{data:{parsedResponse:t}}),null)}unsubscribe(){this._subscription.unsubscribe()}};class OB{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_loggerModuleFactory;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_intentQueueService;_sessionEventDispatcher=new _B;_bypassIntentQueue=!1;constructor({connectedDevice:t,id:r=Yd()},n,o,a,l,u=d=>new $B(n,d)){this._id=r,this._connectedDevice=t,this._loggerModuleFactory=n,this._logger=n("device-session"),this._managerApiService=o,this._intentQueueService=u(this._sessionEventDispatcher),this._secureChannelService=a,this._refresherOptions={...RB,...l},this._deviceState=new BR({sessionStateType:Ys.Connected,deviceStatus:Ln.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new TB(n,t,this._sessionEventDispatcher,(d,p)=>this.sendCommand(d,p)),this._deviceSessionRefresher=new LB(n,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new IB(n,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,d=>this.setDeviceSessionState(d)),this._refresherService=new AB(n,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{this._refresherOptions.isRefresherDisabled?await this._pinger.ping():this._deviceSessionRefresher.startRefresher()}catch(t){throw this._logger.error("Error while initialising session",{data:{error:t}}),t}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(t){this._deviceState.next(t)}sendApdu(t,r={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){return this._bypassIntentQueue?this._unsafeInternalSendApdu(t,r):this._internalSendApdu(t,r)}_internalSendApdu(t,r){const n=r.abortTimeout,o=Date.now(),{observable:a,cancel:l}=this._intentQueueService.enqueue({type:"send-apdu",execute:()=>Xs((async()=>{const d=Date.now()-o;return await this._unsafeInternalSendApdu(t,{isPolling:r.isPolling,triggersDisconnection:r.triggersDisconnection,abortTimeout:n?n-d:void 0})})())}),u=n?a.pipe(xS({each:n,with:()=>{throw l(),new hF}})):a;return bS(u)}async _unsafeInternalSendApdu(t,r={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){return this._logger.debug(SB(t)),(await this._connectedDevice.sendApdu(t,r.triggersDisconnection,r.abortTimeout)).ifRight(n=>{const{message:o,data:a}=kB(this._id,t,n);this._logger.debug(o,{data:a}),vv.isLockedDeviceResponse(n)?this._sessionEventDispatcher.dispatch({eventName:Pt.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:Pt.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:Pt.DEVICE_STATE_UPDATE_UNKNOWN})})}sendCommand(t,r){return this._logger.debug(`[sendCommand] ${t.name}`),this._bypassIntentQueue?this._unsafeInternalSendCommand(t,r):this._internalSendCommand(t,r)}_internalSendCommand(t,r){const n=Date.now(),{observable:o,cancel:a}=this._intentQueueService.enqueue({type:"send-command",execute:()=>Xs((async()=>{const u=Date.now()-n;return await this._unsafeInternalSendCommand(t,r?r-u:void 0)})())}),l=r?o.pipe(xS({each:r,with:()=>{throw a(),new mF}})):o;return bS(l)}async _unsafeInternalSendCommand(t,r){const n=t.getApdu();return(await this._unsafeInternalSendApdu(n.getRawApdu(),{isPolling:!1,triggersDisconnection:t.triggersDisconnection??!1,abortTimeout:r})).caseOf({Left:o=>{throw this._logger.error("[sendCommand] error",{data:{err:o}}),o},Right:o=>{const a=t.parseResponse(o,this._connectedDevice.deviceModel.id);return this._logger.debug("[sendCommand] result",{data:{result:a}}),a}})}executeDeviceAction(t){return this._bypassIntentQueue?this._unsafeInternalExecuteDeviceAction(t):this._internalExecuteDeviceAction(t)}_internalExecuteDeviceAction(t){let r;const{observable:n,cancel:o}=this._intentQueueService.enqueue({type:"device-action",execute:()=>{const{observable:a,cancel:l}=this._unsafeInternalExecuteDeviceAction(t);return r=l,a}});return{observable:n,cancel:()=>{r?.(),o()}}}_unsafeInternalExecuteDeviceAction(t){const{observable:r,cancel:n}=t._execute({sendApdu:async o=>this._unsafeInternalSendApdu(o),sendCommand:async o=>this._unsafeInternalSendCommand(o),getDeviceModel:()=>this._connectedDevice.deviceModel,getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:o=>(this.setDeviceSessionState(o),this._deviceState.getValue()),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService,loggerFactory:this._loggerModuleFactory});return{observable:r,cancel:n}}close(){this._updateDeviceStatus(Ln.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher(),this._pinger.unsubscribe()}disableRefresher(t){return this._refresherService.disableRefresher(t)}_unsafeBypassIntentQueue(t){this._bypassIntentQueue=t}_updateDeviceStatus(t){const r=this._deviceState.getValue();this._deviceState.next({...r,deviceStatus:t})}}var NB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},Za=(e,t)=>(r,n)=>t(r,n,e);let a1=class{_transportService;_sessionService;_loggerFactory;_managerApi;_secureChannel;_logger;constructor(t,r,n,o,a){this._sessionService=r,this._transportService=t,this._loggerFactory=n,this._logger=n("ConnectUseCase"),this._managerApi=o,this._secureChannel=a}handleDeviceDisconnect(t){this._sessionService.getDeviceSessionsByDeviceId(t).ifRight(r=>{r.forEach(n=>{this._sessionService.removeDeviceSession(n.id),this._logger.info("Session removed",{data:{deviceId:t,sessionId:n.id}})})})}async execute({device:t,sessionRefresherOptions:r}){const n=this._transportService.getTransport(t.transport),o="sessionId"in t?t.sessionId:void 0;return He.liftEither(n.toEither(new Nv(new Error("Unknown transport")))).chain(async a=>a.connect({deviceId:t.id,onDisconnect:l=>this.handleDeviceDisconnect(l)})).ifLeft(a=>{this._logger.error("Error connecting to device")}).map(async a=>{const l=new OB({connectedDevice:a,id:o},this._loggerFactory,this._managerApi,this._secureChannel,r);return this._sessionService.addDeviceSession(l),await l.initialiseSession(),l.id}).caseOf({Left:a=>{throw a},Right:a=>a})}};a1=NB([Ke(),Za(0,Ie(Gi.TransportService)),Za(1,Ie(ar.DeviceSessionService)),Za(2,Ie(Ot.LoggerPublisherServiceFactory)),Za(3,Ie(jl.ManagerApiService)),Za(4,Ie(Kd.SecureChannelService))],a1);var PB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},mm=(e,t)=>(r,n)=>t(r,n,e);let l1=class{_transportService;_sessionService;_logger;constructor(t,r,n){this._sessionService=r,this._transportService=t,this._logger=n("DisconnectUseCase")}async execute({sessionId:t}){return this._logger.debug("Disconnecting from device",{data:{test:this._sessionService.getDeviceSessions().map(r=>r.id)}}),He(async({liftEither:r})=>{const n=await r(this._sessionService.getDeviceSessionById(t).ifLeft(l=>{this._logger.error("Device session not found",{data:{sessionId:t,error:l}})})),o=n.connectedDevice.transport,a=await r(this._transportService.getTransport(o).toEither(new Nv(new Error("Unknown transport"))));n.close(),this._sessionService.removeDeviceSession(t),await a.disconnect({connectedDevice:n.connectedDevice})}).caseOf({Left:r=>{throw this._logger.error("Error disconnecting from device",{data:{error:r}}),r},Right:()=>{}})}};l1=PB([Ke(),mm(0,Ie(Gi.TransportService)),mm(1,Ie(ar.DeviceSessionService)),mm(2,Ie(Ot.LoggerPublisherServiceFactory))],l1);let Qd=class{id;sessionId;modelId;name;type;transport;constructor({transportConnectedDevice:{id:t,deviceModel:{id:r,productName:n},type:o,transport:a,name:l},sessionId:u}){this.id=t,this.sessionId=u,this.modelId=r,this.name=l??n,this.type=o,this.transport=a}};var DB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},c1=(e,t)=>(r,n)=>t(r,n,e);let u1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("GetConnectedDeviceUseCase")}execute({sessionId:t}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:r=>new Qd({sessionId:r.id,transportConnectedDevice:r.connectedDevice}),Left:r=>{throw this._logger.error("Error getting session",{data:{error:r}}),r}})}};u1=DB([Ke(),c1(0,Ie(ar.DeviceSessionService)),c1(1,Ie(Ot.LoggerPublisherServiceFactory))],u1);var jB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},d1=(e,t)=>(r,n)=>t(r,n,e);let f1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("ListConnectedDeviceUseCase")}execute(){return this._logger.info("Listing connected devices"),this._sessionService.getDeviceSessions().map(t=>new Qd({transportConnectedDevice:t.connectedDevice,sessionId:t.id}))}};f1=jB([Ke(),d1(0,Ie(ar.DeviceSessionService)),d1(1,Ie(Ot.LoggerPublisherServiceFactory))],f1);var MB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},p1=(e,t)=>(r,n)=>t(r,n,e);let h1=class{_transports;_transportService;_logger;constructor(t,r){this._transports=t.getAllTransports(),this._transportService=t,this._logger=r("ListenToAvailableDevicesUseCase")}mapTransportDiscoveredDeviceToDiscoveredDevice(t){const r=new TR({id:t.id,model:t.deviceModel.id,name:t.deviceModel.productName});return{id:t.id,deviceModel:r,transport:t.transport,name:t.name||r.name,rssi:t.rssi}}execute({transport:t}={}){if(this._logger.info("Listening to available devices"),this._transports.length===0)return this._logger.warn("No transports available"),Xs([[]]);if(!t){this._logger.info("Discovering all available transports");const r=this._transports.map((n,o)=>n.listenToAvailableDevices().pipe(ai(a=>({index:o,arr:a}))));return iF(...r).pipe(cF((n,{index:o,arr:a})=>(n[o]=a,n),{}),ai(n=>Object.values(n).flat().map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))}return this._logger.info(`Discovering devices on transport ${t}`),this._transportService.getTransport(t).caseOf({Nothing:()=>(this._logger.error(`Transport ${t} not found`),i_([])),Just:r=>r.listenToAvailableDevices().pipe(ai(n=>n.map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))})}};h1=MB([Ke(),p1(0,Ie(Gi.TransportService)),p1(1,Ie(Ot.LoggerPublisherServiceFactory))],h1);var zB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},m1=(e,t)=>(r,n)=>t(r,n,e);let g1=class{constructor(t,r){this._sessionService=t,this._logger=r("ListenToConnectedDevicesUseCase")}_logger;execute(){return this._logger.info("Observe the list of connected devices"),this._sessionService.sessionListObs.pipe(ai(t=>t.map(r=>new Qd({transportConnectedDevice:r.connectedDevice,sessionId:r.id}))))}};g1=zB([Ke(),m1(0,Ie(ar.DeviceSessionService)),m1(1,Ie(Ot.LoggerPublisherServiceFactory))],g1);var FB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},v1=(e,t)=>(r,n)=>t(r,n,e);let y1=class{constructor(t,r){this._sessionService=t,this._logger=r("ListenToConnectedDeviceUseCase")}_logger;execute(){return this._logger.info("Observe connected devices"),this._sessionService.sessionsObs.pipe(ai(t=>new Qd({transportConnectedDevice:t.connectedDevice,sessionId:t.id})))}};y1=FB([Ke(),v1(0,Ie(ar.DeviceSessionService)),v1(1,Ie(Ot.LoggerPublisherServiceFactory))],y1);var BB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},gm=(e,t)=>(r,n)=>t(r,n,e);let b1=class{constructor(t,r,n){this.connectUseCase=t,this.disconnectUseCase=r,this._logger=n("ReconnectUseCase")}_logger;async execute({device:t,sessionRefresherOptions:r}){return this._logger.debug("Reconnecting device session",{data:{deviceId:t.id,transport:t.transport}}),await this.disconnectUseCase.execute({sessionId:t.sessionId}),this.connectUseCase.execute({device:t,sessionRefresherOptions:r})}};b1=BB([Ke(),gm(0,Ie(MS.ConnectUseCase)),gm(1,Ie(MS.DisconnectUseCase)),gm(2,Ie(Ot.LoggerPublisherServiceFactory))],b1);var UB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},VB=(e,t)=>(r,n)=>t(r,n,e);let x1=class{constructor(t){this._transportService=t}mapDiscoveredDevice(t){const r=new TR({id:t.id,model:t.deviceModel.id,name:t.deviceModel.productName});return{id:t.id,deviceModel:r,transport:t.transport,name:t.name||r.name,rssi:t.rssi}}execute({transport:t}={}){if(!t){const r=this._transportService.getAllTransports();return i_(...r).pipe(Iv(n=>n.startDiscovering().pipe(ai(o=>this.mapDiscoveredDevice(o)))))}return this._transportService.getTransport(t).caseOf({Just:r=>r.startDiscovering().pipe(ai(n=>this.mapDiscoveredDevice(n))),Nothing:()=>{throw new Nv(new Error("Unknown transport"))}})}};x1=UB([Ke(),VB(0,Ie(Gi.TransportService))],x1);var WB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},w1=(e,t)=>(r,n)=>t(r,n,e);let S1=class{constructor(t,r){this.transportService=t,this._logger=r("StopDiscoveringUseCase")}_logger;async execute(){this._logger.debug("Stopping discovering devices");for(const t of this.transportService.getAllTransports())await t.stopDiscovering()}};S1=WB([Ke(),w1(0,Ie(Gi.TransportService)),w1(1,Ie(Ot.LoggerPublisherServiceFactory))],S1);var nl=(e=>(e[e.Fatal=0]="Fatal",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e))(nl||{});let HB=class{format(t){return Array.isArray(t)?t.map(r=>`[${r}]`).join(" "):`[${t}]`}};function _g(e,t){if(typeof e=="bigint")return e.toString();if(Array.isArray(e))return t.has(e)?"[Circular]":(t.add(e),e.map(r=>_g(r,t)));if(e!==null&&typeof e=="object"){if(t.has(e))return"[Circular]";t.add(e);const r={};for(const[n,o]of Object.entries(e))r[n]=_g(o,t);return r}return e}function qB(e){const t=new WeakSet;t.add(e);const r={};for(const[n,o]of Object.entries(e))r[n]=_g(o,t);return r}var GB=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o};let E1=class{subscribers;tag;tagFormatter;constructor(t,r,n=new HB){this.subscribers=t,this.tag=r,this.tagFormatter=n}_log(t,r,n){const o=n?.data?qB(n.data):void 0,a=n?.tag??this.tag,l=this.tagFormatter.format(a);this.subscribers.forEach(u=>{const d={timestamp:n?.timestamp??Date.now(),tag:l,data:o};u.log(t,r,d)})}info(t,r){this._log(nl.Info,t,r)}warn(t,r){this._log(nl.Warning,t,r)}debug(t,r){this._log(nl.Debug,t,r)}error(t,r){this._log(nl.Error,t,r)}};E1=GB([Ke()],E1);let kl=class extends Error{status;statusText;responseBody;isTimeout;cause;constructor(t){super(t.message),this.name="DmkNetworkClientError",this.status=t.status,this.statusText=t.statusText,this.responseBody=t.responseBody,this.isTimeout=t.isTimeout??!1,this.cause=t.cause}};const XB="application/json";function YB(e,t){if(!t)return e;const r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:`/${t}`;return`${r}${n}`}function KB(e){const t=[];for(const[r,n]of Object.entries(e))n!=null&&t.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(n))}`);return t.join("&")}function To(e){const{url:t,params:r,baseUrl:n}=e,o=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:n?YB(n,t):t,a=r?KB(r):"";if(a.length===0)return o;const l=o.includes("?")?"&":"?";return`${o}${l}${a}`}function QB(e,t){const r=t.toLowerCase();return Object.keys(e).some(n=>n.toLowerCase()===r)}function JB(e){return!!(typeof e=="string"||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<"u"&&e instanceof Blob||typeof FormData<"u"&&e instanceof FormData||typeof URLSearchParams<"u"&&e instanceof URLSearchParams||typeof ReadableStream<"u"&&e instanceof ReadableStream)}function ZB(e){const{method:t,body:r,defaultHeaders:n,perRequestHeaders:o}=e,a={...n,...o};return r===void 0||t==="GET"||t==="HEAD"?{body:void 0,headers:a}:JB(r)?{body:r,headers:a}:(QB(a,"content-type")||(a["Content-Type"]=XB),{body:JSON.stringify(r),headers:a})}function e8(e){const{timeoutMs:t}=e;if(!t||t<=0)return{signal:void 0,cleanup:()=>{}};const r=new AbortController,n=setTimeout(()=>{r.abort()},t);return{signal:r.signal,cleanup:()=>clearTimeout(n)}}async function t8(e,t){switch(t){case"void":return;case"text":return await e.text();case"blob":return await e.blob();case"arrayBuffer":return await e.arrayBuffer();default:{const r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch(n){throw new kl({message:"Failed to parse JSON response body",status:e.status,statusText:e.statusText,responseBody:r,cause:n})}}}}async function r8(e){try{return await e.text()}catch{return}}function n8(e){const{cause:t,timeoutMs:r}=e,n=!!(r&&r>0);if(t instanceof Error&&(t.name==="AbortError"||t.name==="TimeoutError")){const o=t.name==="TimeoutError"||n;return new kl({message:o?"Request timed out":"Request aborted",isTimeout:o,cause:t})}return new kl({message:t instanceof Error?t.message:"Network request failed",cause:t})}let d_=class{baseUrl;defaultHeaders;fetchImpl;constructor(t={}){this.baseUrl=t.baseUrl,this.defaultHeaders=t.headers??{},this.fetchImpl=t.fetch}getFetch(){return this.fetchImpl??globalThis.fetch.bind(globalThis)}get(t,r){return this.request({...r,method:"GET",url:t}).then(n=>n.data)}post(t,r,n){return this.request({...n,method:"POST",url:t,body:r}).then(o=>o.data)}put(t,r,n){return this.request({...n,method:"PUT",url:t,body:r}).then(o=>o.data)}patch(t,r,n){return this.request({...n,method:"PATCH",url:t,body:r}).then(o=>o.data)}delete(t,r){return this.request({...r,method:"DELETE",url:t}).then(n=>n.data)}head(t,r){return this.request({...r,method:"HEAD",url:t,responseType:"void"}).then(()=>{})}async request(t){const r=To({url:t.url,params:t.params,baseUrl:this.baseUrl}),{body:n,headers:o}=ZB({method:t.method,body:t.body,defaultHeaders:this.defaultHeaders,perRequestHeaders:t.headers}),{signal:a,cleanup:l}=e8({timeoutMs:t.timeoutMs}),u=t.throwOnHttpError??!0,d=t.responseType??"json";try{let p;try{p=await this.getFetch()(r,{method:t.method,headers:o,body:n,signal:a})}catch(h){throw n8({cause:h,timeoutMs:t.timeoutMs})}if(!p.ok&&u){const h=await r8(p);throw new kl({message:`HTTP error ${p.status} ${p.statusText}`.trim(),status:p.status,statusText:p.statusText,responseBody:h})}return{data:await t8(p,d),status:p.status,statusText:p.statusText,headers:p.headers,ok:p.ok}}finally{l()}}};var il=(e=>(e.currency="currency",e.plugin="plugin",e.tool="tool",e.swap="swap",e))(il||{});const i8=1,o8="0";let xd=class{constructor(t){this.error=t,this.originalError=t}_tag="FetchError";originalError};var ol=(e=>(e.currency="currency",e.plugin="plugin",e.tool="tool",e.swap="swap",e))(ol||{}),s8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},C1=(e,t)=>(r,n)=>t(r,n,e);const Qn=e=>e instanceof kl&&e.cause!==void 0?new xd(e.cause):new xd(e);let k1=class{http;_provider=i8;_firmwareDistributionSalt=o8;_logger;constructor({managerApiUrl:t,provider:r,firmwareDistributionSalt:n},o){this.http=new d_({baseUrl:t}),this._provider=r,this._firmwareDistributionSalt=n,this._logger=o("HttpManagerApiDataSource")}setProvider(t){this._provider===t||t<1||(this._provider=t)}getProvider(){return this._provider}setFirmwareDistributionSalt(t){this._firmwareDistributionSalt===t||t.trim()===""||(this._firmwareDistributionSalt=t)}getFirmwareDistributionSalt(){return this._firmwareDistributionSalt}getAppList(t){const{targetId:r,firmwareVersionName:n}=t;return He(()=>this.http.get("/v2/apps/by-target",{params:{target_id:r,provider:this._provider,firmware_version_name:n}})).chain(o=>this.mapApplicationDtoToApplication(o)).mapLeft(Qn)}getMcuList(){return He(()=>this.http.get("/mcu_versions")).chain(t=>this.mapMcuDtoToMcu(t)).mapLeft(Qn)}getDeviceVersion(t){const{targetId:r}=t;return He(()=>this.http.get("/get_device_version",{params:{target_id:r,provider:this._provider}})).chain(n=>this.mapDeviceVersionDto(n)).mapLeft(Qn)}getFirmwareVersion(t){const{deviceId:r,version:n}=t;return He(()=>this.http.get("/get_firmware_version",{params:{device_version:r,version_name:n,provider:this._provider}})).chain(o=>this.mapFinalFirmwareDto(o)).mapLeft(Qn)}getFirmwareVersionById(t){return He(()=>this.http.get(`/firmware_final_versions/${t}`)).chain(r=>this.mapFinalFirmwareDto(r)).mapLeft(Qn)}getOsuFirmwareVersion(t){const{deviceId:r,version:n}=t;return He(()=>this.http.get("/get_osu_version",{params:{device_version:r,version_name:n,provider:this._provider}})).chain(o=>this.mapOsuFirmwareDto(o)).mapLeft(Qn)}getLatestFirmwareVersion(t){const{currentFinalFirmwareId:r,deviceId:n}=t;return He(()=>{const o=this._firmwareDistributionSalt;return this._logger.info("Requesting latest firmware",{data:{salt:o}}),this.http.get("/get_latest_firmware",{params:{current_se_firmware_final_version:r,device_version:n,provider:this._provider,salt:o}})}).chain(o=>this.mapLatestFirmwareDto(o)).mapLeft(Qn)}getAppsByHash(t){const{hashes:r}=t;return He(()=>this.http.post("/v2/apps/hash",r)).chain(n=>this.mapNullableApplicationDtoToApplication(n)).mapLeft(Qn)}getLanguagePackages(t){const{deviceId:r,currentFinalFirmwareId:n}=t;return He(()=>this.http.get("/language-packages",{params:{device_version:r,current_se_firmware_final_version:n}})).chain(o=>this.mapLanguagesDtoToLanguages(o)).mapLeft(Qn)}mapAppTypeDtoToAppType(t){if(t===null)return null;switch(t){case ol.currency:return il.currency;case ol.plugin:return il.plugin;case ol.tool:return il.tool;case ol.swap:return il.swap}}mapApplicationDtoToApplication(t){return He(()=>Promise.resolve(t.map(r=>this.mapApplicationDto(r))))}mapNullableApplicationDtoToApplication(t){return He(()=>Promise.resolve(t.map(r=>r===null?null:this.mapApplicationDto(r))))}mapApplicationDto(t){if(typeof t!="object"||typeof t.versionId!="number"||typeof t.versionName!="string"||t.versionDisplayName!==null&&typeof t.versionDisplayName!="string"||typeof t.version!="string"||t.currencyId!==null&&typeof t.currencyId!="string"||t.description!==null&&typeof t.description!="string"||t.applicationType!==null&&typeof t.applicationType!="string"||typeof t.dateModified!="string"||t.icon!==null&&typeof t.icon!="string"||t.authorName!==null&&typeof t.authorName!="string"||t.supportURL!==null&&typeof t.supportURL!="string"||t.contactURL!==null&&typeof t.contactURL!="string"||t.sourceURL!==null&&typeof t.sourceURL!="string"||t.compatibleWallets!==null&&typeof t.compatibleWallets!="string"||typeof t.hash!="string"||typeof t.perso!="string"||typeof t.firmware!="string"||typeof t.firmwareKey!="string"||typeof t.delete!="string"||typeof t.deleteKey!="string"||t.bytes!==null&&typeof t.bytes!="number"||t.warning!==null&&typeof t.warning!="string"||typeof t.isDevTools!="boolean"||t.category!==null&&typeof t.category!="number"||t.parent!==null&&typeof t.parent!="number"||t.parentName!==null&&typeof t.parentName!="string")throw new Error(`Incomplete application: ${JSON.stringify(t)}`);const{applicationType:r,hash:n,perso:o,firmware:a,firmwareKey:l,delete:u,deleteKey:d,...p}=t;return{...p,hash:n,perso:o,firmware:a,firmwareKey:l,delete:u,deleteKey:d,applicationType:this.mapAppTypeDtoToAppType(r)}}mapMcuDtoToMcu(t){return He(()=>Promise.resolve(t.map(r=>{if(typeof r!="object"||typeof r.id!="number"||typeof r.name!="string"||typeof r.from_bootloader_version!="string")throw new Error(`Incomplete MCU version: ${JSON.stringify(r)}`);return{id:r.id,name:r.name,fromBootloaderVersion:r.from_bootloader_version,providers:r.providers}})))}mapDeviceVersionDto(t){return He(()=>{if(typeof t!="object"||typeof t.id!="number")throw new Error(`Incomplete device version: ${JSON.stringify(t)}`);const r={id:t.id};return Promise.resolve(r)})}mapFinalFirmwareDto(t){return He(()=>{if(typeof t!="object"||typeof t.id!="number"||typeof t.name!="string"||typeof t.version!="string"||typeof t.perso!="string"||t.firmware!==null&&typeof t.firmware!="string"||t.firmware_key!==null&&typeof t.firmware_key!="string"||t.hash!==null&&typeof t.hash!="string"||t.bytes!==null&&typeof t.bytes!="number"||!Array.isArray(t.mcu_versions))throw new Error(`Incomplete final firmware: ${JSON.stringify(t)}`);const r={id:t.id,name:t.name,version:t.version,perso:t.perso,firmware:t.firmware,firmwareKey:t.firmware_key,hash:t.hash,bytes:t.bytes,mcuVersions:t.mcu_versions};return Promise.resolve(r)})}mapLatestFirmwareDto(t){return He(()=>{if(t.result==="null")return Promise.resolve(null);if(t.result!=="success"||!t.se_firmware_osu_version)throw new Error(`Latest firmware could not be retrieved: ${t.result}`);const r=t.se_firmware_osu_version;return Promise.resolve(r)}).chain(r=>r===null?He(()=>Promise.resolve(ft)):this.mapOsuFirmwareDto(r).map(n=>or(n)))}mapOsuFirmwareDto(t){return He(()=>{if(typeof t!="object"||typeof t.id!="number"||t.notes!==null&&typeof t.notes!="string"||typeof t.perso!="string"||typeof t.firmware!="string"||typeof t.firmware_key!="string"||t.hash!==null&&typeof t.hash!="string"||typeof t.next_se_firmware_final_version!="number")throw new Error(`Incomplete latest firmware: ${JSON.stringify(t)}`);const r={id:t.id,notes:t.notes,perso:t.perso,firmware:t.firmware,firmwareKey:t.firmware_key,hash:t.hash,nextFinalFirmware:t.next_se_firmware_final_version};return Promise.resolve(r)})}mapLanguagesDtoToLanguages(t){return He(()=>Promise.resolve(t.map(r=>this.mapLanguageDto(r))))}mapLanguageDto(t){if(typeof t!="object"||typeof t.language!="string"||typeof t.languagePackageVersionId!="number"||typeof t.version!="string"||typeof t.language_package_id!="number"||typeof t.apdu_install_url!="string"||typeof t.apdu_uninstall_url!="string"||typeof t.bytes!="number"||typeof t.date_creation!="string"||typeof t.date_last_modified!="string")throw new Error(`Incomplete language version: ${JSON.stringify(t)}`);return{language:t.language,languagePackageVersionId:t.languagePackageVersionId,version:t.version,languagePackageId:t.language_package_id,apduInstallUrl:t.apdu_install_url,apduUninstallUrl:t.apdu_uninstall_url,bytes:t.bytes,dateCreation:t.date_creation,dateLastModified:t.date_last_modified}}};k1=s8([Ke(),C1(0,Ie(jl.DmkConfig)),C1(1,Ie(Ot.LoggerPublisherServiceFactory))],k1);var a8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},l8=(e,t)=>(r,n)=>t(r,n,e);let R1=class{constructor(t){this.dataSource=t}getAppList(t){const r={targetId:t.targetId.toString(),firmwareVersionName:t.seVersion};return this.dataSource.getAppList(r)}getDeviceVersion(t){const r={targetId:t.targetId.toString()};return this.dataSource.getDeviceVersion(r)}getFirmwareVersion(t,r){const n={version:t.seVersion,deviceId:r.id};return this.dataSource.getFirmwareVersion(n)}getOsuFirmwareVersion(t,r){const n={version:t.seVersion,deviceId:r.id};return this.dataSource.getOsuFirmwareVersion(n)}getLatestFirmwareVersion(t,r){const n={currentFinalFirmwareId:t.id,deviceId:r.id};return this.dataSource.getLatestFirmwareVersion(n)}getNextFirmwareVersion(t){return this.dataSource.getFirmwareVersionById(t.nextFinalFirmware)}getLanguagePackages(t,r){const n={deviceId:t.id,currentFinalFirmwareId:r.id};return this.dataSource.getLanguagePackages(n)}getMcuList(){return this.dataSource.getMcuList()}getAppsByHash(t){const r={hashes:t};return He(async({fromPromise:n,throwE:o})=>{if(r.hashes.length===0)return[];try{return await n(this.dataSource.getAppsByHash(r))}catch(a){return a instanceof xd?o(a):o(new xd(a))}})}getProvider(){return this.dataSource.getProvider()}};R1=a8([Ke(),l8(0,Ie(jl.ManagerApiDataSource))],R1);var c8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},vm=(e,t)=>(r,n)=>t(r,n,e);let _1=class{constructor(t,r,n){this.sessionService=t,this.managerApiDataSource=r,this._logger=n("SetFirmwareDistributionSaltUseCase")}_logger;execute(t){if(t.trim()===""){this._logger.warn("Ignoring empty firmware distribution salt");return}const r=this.managerApiDataSource.getFirmwareDistributionSalt();if(t===r){this._logger.debug("Firmware distribution salt unchanged",{data:{salt:t}});return}this.managerApiDataSource.setFirmwareDistributionSalt(t);let n=0;for(const o of this.sessionService.getDeviceSessions()){const a=o.getDeviceSessionState();a.sessionStateType!==Ys.Connected&&a.firmwareUpdateContext!==void 0&&(o.setDeviceSessionState({...a,firmwareUpdateContext:void 0}),n++)}this._logger.info("Firmware distribution salt updated",{data:{previousSalt:r,salt:t,invalidatedSessions:n}})}};_1=c8([Ke(),vm(0,Ie(ar.DeviceSessionService)),vm(1,Ie(jl.ManagerApiDataSource)),vm(2,Ie(Ot.LoggerPublisherServiceFactory))],_1);var u8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},$1=(e,t)=>(r,n)=>t(r,n,e);let A1=class{constructor(t,r){this.sessionService=t,this.managerApiDataSource=r}execute(t){for(const r of this.sessionService.getDeviceSessions()){const n=r.getDeviceSessionState();n.sessionStateType!==Ys.Connected&&r.setDeviceSessionState({...n,firmwareUpdateContext:void 0,installedApps:[],appsUpdates:void 0,catalog:void 0})}this.managerApiDataSource.setProvider(t)}};A1=u8([Ke(),$1(0,Ie(ar.DeviceSessionService)),$1(1,Ie(jl.ManagerApiDataSource))],A1);var d8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},f8=(e,t)=>(r,n)=>t(r,n,e);let T1=class{webSocketBaseUrl;constructor({webSocketUrl:t}){this.webSocketBaseUrl=t}setWebSocketUrl(t){this.webSocketBaseUrl===t||t.length===0||(this.webSocketBaseUrl=t)}getWebSocketUrl(){return this.webSocketBaseUrl}genuineCheck(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/genuine",params:t});return this._connectWebSocket(r)}installApp(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/install",params:t});return this._connectWebSocket(r)}listInstalledApps(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/apps/list",params:t});return this._connectWebSocket(r)}uninstallApp(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/install",params:t});return this._connectWebSocket(r)}updateFirmware(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/install",params:t});return this._connectWebSocket(r)}updateMcu(t){const r=To({baseUrl:this.webSocketBaseUrl,url:"/mcu",params:t});return this._connectWebSocket(r)}_connectWebSocket(t){try{return Tt(new yF(t))}catch(r){return yt(new CF(r))}}};T1=d8([Ke(),f8(0,Ie(Kd.DmkConfig))],T1);var p8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},h8=(e,t)=>(r,n)=>t(r,n,e);let L1=class{constructor(t){this.dataSource=t}genuineCheck(t,r){const n={targetId:t.targetId.toString(),perso:r.perso};return this.dataSource.genuineCheck(n)}installApp(t,r){const{perso:n,firmware:o,firmwareKey:a,hash:l}=r,u={targetId:t.targetId.toString(),perso:n,firmware:o,firmwareKey:a,hash:l};return this.dataSource.installApp(u)}listInstalledApps(t,r){const n={targetId:t.targetId.toString(),perso:r.perso};return this.dataSource.listInstalledApps(n)}uninstallApp(t,r){const{perso:n,delete:o,deleteKey:a,hash:l}=r,u={targetId:t.targetId.toString(),perso:n,firmware:o,firmwareKey:a,hash:l};return this.dataSource.uninstallApp(u)}updateFirmware(t,r){const n={targetId:t.targetId.toString(),perso:r.perso,firmware:r.firmware,firmwareKey:r.firmwareKey};return this.dataSource.updateFirmware(n)}updateMcu(t,r){const n={targetId:t.targetId.toString(),version:r.version};return this.dataSource.updateMcu(n)}};L1=p8([Ke(),h8(0,Ie(Kd.SecureChannelDataSource))],L1);var m8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},g8=(e,t)=>(r,n)=>t(r,n,e);let I1=class{constructor(t){this.secureChannelDataSource=t}execute(t){this.secureChannelDataSource.setWebSocketUrl(t)}};I1=m8([Ke(),g8(0,Ie(Kd.SecureChannelDataSource))],I1);var v8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},O1=(e,t)=>(r,n)=>t(r,n,e);let N1=class{_sessionService;_logger;constructor(t,r){this._sessionService=t,this._logger=r("SendApduUseCase")}async execute({sessionId:t,apdu:r,abortTimeout:n,triggersDisconnection:o}){return this._sessionService.getDeviceSessionById(t).caseOf({Right:async a=>(await a.sendApdu(r,{abortTimeout:n,triggersDisconnection:o})).caseOf({Right:l=>l,Left:l=>{throw this._logger.error("Error sending APDU",{data:{sessionId:t,apdu:r,error:l}}),l}}),Left:a=>{throw this._logger.error("Error getting deviceSession",{data:{error:a}}),a}})}};N1=v8([Ke(),O1(0,Ie(ar.DeviceSessionService)),O1(1,Ie(Ot.LoggerPublisherServiceFactory))],N1);var y8=(e,t,r,n)=>{for(var o=t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=l(o)||o);return o},ks=(e,t)=>(r,n)=>t(r,n,e);let P1=class{constructor(t,r,n,o,a,l){if(this._config=r,this._loggerModuleFactory=n,this._deviceModelDataSource=o,this._apduSenderServiceFactory=a,this._apduReceiverServiceFactory=l,this._logger=n("TransportService"),t.length===0)throw this._logger.warn("No transports provided, please check your configuration"),new vF("No transports provided, please check your configuration");for(const u of t){const d=this.addTransport(u);if(d.isLeft())throw d.extract()}}_transports=new Map;_logger;addTransport(t){const r=t({deviceModelDataSource:this._deviceModelDataSource,loggerServiceFactory:this._loggerModuleFactory,config:this._config,apduSenderServiceFactory:this._apduSenderServiceFactory,apduReceiverServiceFactory:this._apduReceiverServiceFactory});return this.addTransportInternal(r)}addTransportInternal(t){return this.getTransport(t.getIdentifier()).isJust()?(this._logger.warn(`Transport ${t.getIdentifier()} already exists, please check your configuration`),yt(new gF(`Transport ${t.getIdentifier()} already exists, please check your configuration`))):(this._transports.set(t.getIdentifier(),t),Tt(void 0))}getTransport(t){return Ar.fromNullable(this._transports.get(t))}getAllTransports(){return Array.from(this._transports.values())}closeConnection(t){this.getTransport(t.transport).map(r=>r.disconnect({connectedDevice:t}))}};P1=y8([Ke(),ks(0,Ie(Gi.TransportsInput)),ks(1,Ie(Gi.DmkConfig)),ks(2,Ie(Ot.LoggerPublisherServiceFactory)),ks(3,Ie(mB.DeviceModelDataSource)),ks(4,Ie(ar.ApduSenderServiceFactory)),ks(5,Ie(ar.ApduReceiverServiceFactory))],P1);const b8={ADD_LOG:"addLog"};function x8(e){return{startListeningCommand:()=>e.sendMessage(Fi.START_LISTENING_DEVICES,"{}"),stopListeningCommand:()=>e.sendMessage(Fi.STOP_LISTENING_DEVICES,"{}"),startDiscoveringCommand:()=>e.sendMessage(Fi.START_DISCOVERING,"{}"),stopDiscoveringCommand:()=>e.sendMessage(Fi.STOP_DISCOVERING,"{}"),connectDeviceCommand:(t,r)=>e.sendMessage(Fi.CONNECT_DEVICE,JSON.stringify({deviceId:t,sessionRefresherOptions:r}))}}function w8(e){return{getProviderCommand:()=>e.sendMessage(Fi.GET_PROVIDER,"{}"),setProviderCommand:t=>e.sendMessage(Fi.SET_PROVIDER,JSON.stringify({provider:t}))}}let S8=0;function E8(e){return{sendApduCommand:(t,r)=>{const n=`apdu-${++S8}`,o=r.match(/.{1,2}/g)?.map(a=>parseInt(a,16))||[];return e.sendMessage(Fi.SEND_APDU,JSON.stringify({sessionId:t,apdu:o,requestId:n})),n}}}const C8=e=>{try{const t=JSON.parse(e);return typeof t=="string"||t!==null&&typeof t=="object"?t:t===null?{}:JSON.stringify(t)}catch{return e}},k8=new Set(["debug","info","warning","error","fatal"]),R8=e=>{if(e===null||typeof e!="object")return!1;const{timestamp:t,tag:r,verbosity:n,message:o,payloadJSON:a}=e;return typeof t=="string"&&typeof r=="string"&&typeof o=="string"&&typeof n=="string"&&k8.has(n)&&(a===void 0||typeof a=="string")};function _8(e){let t;try{t=JSON.parse(e)}catch{return null}if(!R8(t))return null;const r=t.payloadJSON??"{}";return{timestamp:t.timestamp,tag:t.tag,verbosity:t.verbosity,message:t.message,payloadJSON:r,payload:C8(r)}}function $8(e,t){try{const{module:r}=JSON.parse(e);t(n=>new Set([...n,r]))}catch(r){console.error("Failed to parse moduleConnected payload",r)}}function A8(e,t){const r=_8(e);return r!==null?(t(r),!0):!1}function T8(e,t){try{const r=JSON.parse(e);t(r)}catch(r){console.error("Failed to parse connectedDevicesUpdate payload",r)}}function L8(e,t){try{const{sessionId:r,state:n}=JSON.parse(e);t(o=>new Map(o).set(r,n))}catch(r){console.error("Failed to parse deviceSessionStateUpdate payload",r)}}function I8(e,t){try{const r=JSON.parse(e);t(r)}catch(r){console.error("Failed to parse discoveredDevicesUpdate payload",r)}}function O8(e,t){try{const{provider:r}=JSON.parse(e);t(r)}catch(r){console.error("Failed to parse providerValue payload",r)}}const N8=e=>{try{const{protocol:t,host:r}=new URL(e);return(t==="http:"||t==="https:")&&r!==""}catch{return!1}};function P8(e){try{const t=JSON.parse(e);if(t===null)return null;if(typeof t!="object")return;const{url:r,sessionToken:n}=t;return typeof r!="string"||!N8(r)||n!==void 0&&typeof n!="string"?void 0:n===void 0?{url:r}:{url:r,sessionToken:n}}catch{return}}function D8(e,t){const r=P8(e);if(r===void 0){console.error("Ignored an invalid mockServerConfig payload");return}t(r)}function j8(e,t){try{const r=JSON.parse(e);t(n=>new Map(n).set(r.requestId,r))}catch(r){console.error("Failed to parse apduResponse payload",r)}}const M8=250;function z8(e){const[t,r]=x.useState([]),[n,o]=x.useState(new Set),[a,l]=x.useState([]),[u,d]=x.useState(new Map),[p,h]=x.useState([]),[m,y]=x.useState(!1),[w,E]=x.useState(!1),[S,C]=x.useState(null),[R,k]=x.useState(new Map),[$,A]=x.useState(null),D=x.useRef([]);x.useEffect(()=>{let H;const O=()=>{H=void 0;const U=D.current;D.current=[],U.length>0&&r(z=>[...z,...U].slice(-2e4))},{unsubscribe:L}=e.listenToMessages((U,z)=>{switch(H??=setTimeout(O,M8),U){case S5:$8(z,o);break;case Es.CONNECTED_DEVICES_UPDATE:T8(z,l);break;case Es.DEVICE_SESSION_STATE_UPDATE:L8(z,d);break;case Es.DISCOVERED_DEVICES_UPDATE:I8(z,h);break;case Es.PROVIDER_VALUE:O8(z,C);break;case Es.APDU_RESPONSE:j8(z,k);break;case Es.MOCK_SERVER_CONFIG:D8(z,A);break;case b8.ADD_LOG:A8(z,T=>D.current.push(T));break}});return()=>{L(),clearTimeout(H),D.current=[]}},[e]);const N=x.useMemo(()=>x8(e),[e]),P=x.useMemo(()=>w8(e),[e]),I=x.useMemo(()=>E8(e),[e]),re=x.useCallback(()=>{y(!0),h([]),N.startListeningCommand()},[N]),Z=x.useCallback(()=>{y(!1),h([]),N.stopListeningCommand()},[N]),ee=x.useCallback(()=>{E(!0),h([]),N.startDiscoveringCommand()},[N]),ne=x.useCallback(()=>{E(!1),h([]),N.stopDiscoveringCommand()},[N]),X=x.useCallback(()=>{D.current=[],r([])},[]),F=n.has(mw.LOGGER),V=n.has(mw.DMK_INSPECTOR);return{logs:t,connectedModules:n,connectedDevices:a,sessionStates:u,discoveredDevices:p,isListening:m,isActivelyDiscovering:w,isLoggerConnected:F,isInspectorConnected:V,providerValue:S,apduResponses:R,mockServer:$,sendMessage:e.sendMessage,clearLogs:X,startListening:re,stopListening:Z,startDiscovering:ee,stopDiscovering:ne,connectDevice:N.connectDeviceCommand,getProvider:P.getProviderCommand,setProvider:P.setProviderCommand,sendApdu:I.sendApduCommand}}const $g=e=>`devtools-panel-width-${e}`,F8=e=>{try{const t=Number(localStorage.getItem($g(e)));return t>0?t:null}catch{return null}},ym=(e,t)=>{try{t===null?localStorage.removeItem($g(e)):localStorage.setItem($g(e),String(t))}catch{}},Dv=({name:e,defaultWidth:t,minWidth:r,maxWidth:n,edge:o,className:a="",children:l})=>{const[u,d]=x.useState(()=>F8(e)??t),p=y=>{y.preventDefault();const w=y.clientX,E=u;let S=E;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const C=k=>{const $=k.clientX-w;S=Math.min(n,Math.max(r,E+(o==="right"?$:-$))),d(S)},R=()=>{document.body.style.cursor="",document.body.style.userSelect="",ym(e,S),window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",R)};window.addEventListener("mousemove",C),window.addEventListener("mouseup",R)},h=y=>{const w=y.key==="ArrowRight"?16:y.key==="ArrowLeft"?-16:0;if(w===0)return;y.preventDefault();const E=Math.min(n,Math.max(r,u+(o==="right"?w:-w)));d(E),ym(e,E)},m=()=>{d(t),ym(e,null)};return v.jsxs("div",{className:`relative flex flex-col ${a}`,style:{flex:`0 1 ${u}px`,minWidth:r},children:[l,v.jsx("span",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the panel","aria-valuenow":u,"aria-valuemin":r,"aria-valuemax":n,tabIndex:0,title:"Drag or use the arrow keys to resize, double-click to reset",onMouseDown:p,onKeyDown:h,onDoubleClick:m,className:`absolute inset-y-0 z-10 w-6 cursor-col-resize border-transparent hover:border-active focus-visible:border-active focus-visible:outline-none ${o==="right"?"-right-3 border-r-2":"-left-3 border-l-2"}`})]})},f_="relative w-320 min-w-160 shrink",Ml="flex h-32 items-center gap-6 overflow-hidden rounded-sm border border-muted-subtle bg-surface px-8 transition-colors hover:border-muted focus-within:border-active",zl="min-w-0 flex-1 bg-transparent font-mono! body-3 text-base outline-none placeholder:text-muted",Lo="flex size-24 shrink-0 cursor-pointer items-center justify-center rounded-xs text-muted transition-colors hover:bg-base-transparent-hover hover:text-base disabled:cursor-default disabled:text-disabled disabled:hover:bg-transparent",p_=/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl+",h_="rounded-xs border border-muted px-4 font-mono! body-4 text-muted",B8="body-4-semi-bold text-muted uppercase",U8=e=>{const t=[{title:null,blocks:[]}],r=e.split(`
40
40
  `);let n=0;const o=()=>t[t.length-1];for(;n<r.length;){const a=r[n],l=a.match(/^```(\w*)/);if(l){const d=[];for(n++;n<r.length&&!r[n].startsWith("```");)d.push(r[n]),n++;n++,o().blocks.push(l[1]==="sequence"?{kind:"sequence",lines:d.filter(p=>p.trim())}:{kind:"code",text:d.join(`
41
- `)});continue}const u=a.match(/^#{1,4}\s+(.*)/);if(u)t.push({title:u[1].trim(),blocks:[]});else if(/^\s*[-*]\s+/.test(a)){const d=[];for(;n<r.length&&/^\s*[-*]\s+/.test(r[n]);)d.push(r[n].replace(/^\s*[-*]\s+/,"")),n++;o().blocks.push({kind:"list",items:d});continue}else if(a.trim()){const d=[a];for(;n+1<r.length&&r[n+1].trim()&&!/^(#|```|\s*[-*]\s)/.test(r[n+1]);)n++,d.push(r[n]);o().blocks.push({kind:"paragraph",text:d.join(" ")})}n++}return t.filter(a=>a.title!==null||a.blocks.length>0)},N1=({text:e})=>v.jsx(v.Fragment,{children:e.split(/(\*\*[^*]+\*\*|`[^`]+`|https?:\/\/[^\s)]+)/).map((t,r)=>t.startsWith("http")?v.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-active underline",children:t},r):t.startsWith("**")&&t.endsWith("**")?v.jsx("strong",{children:t.slice(2,-2)},r):t.startsWith("`")&&t.endsWith("`")?v.jsx("code",{className:"font-mono! body-4",children:t.slice(1,-1)},r):t)}),F8=/\b(?!9000\b)[5-6][0-9a-f]{3}\b/i,B8=({line:e})=>{const t=e.match(/^\s*(App|Device)\s*->\s*(?:App|Device)\s*:\s*(.*)$/i),r=t?.[1]?.toLowerCase()==="app",n=t?.[2]??e;return v.jsxs("li",{className:`flex gap-8 font-mono! body-4 ${r?"":"pl-24"} ${F8.test(n)&&!r?"text-error":""}`,children:[v.jsx("span",{className:"shrink-0 text-muted",children:r?"App →":"← Device"}),v.jsx("span",{className:"min-w-0 break-words",children:n})]})},U8=({block:e})=>{switch(e.kind){case"paragraph":return v.jsx("p",{className:"body-3",children:v.jsx(N1,{text:e.text})});case"list":return v.jsx("ul",{className:"flex list-disc flex-col gap-4 pl-16 body-3",children:e.items.map((t,r)=>v.jsx("li",{children:v.jsx(N1,{text:t})},r))});case"sequence":return v.jsx("ol",{className:"flex flex-col gap-4 rounded-sm bg-muted px-12 py-8",children:e.lines.map((t,r)=>v.jsx(B8,{line:t},r))});case"code":return v.jsx("pre",{className:"overflow-x-auto rounded-sm bg-muted px-12 py-8 font-mono! body-4",children:e.text})}},V8=({markdown:e})=>v.jsx("div",{className:"flex flex-col gap-16",children:z8(e).map((t,r)=>{const n=t.blocks[0]?.kind==="paragraph"?t.blocks[0].text:"",o=t.title?.toLowerCase()==="result",a=/^\**failed/i.test(n);return v.jsxs("section",{className:`flex flex-col gap-8 ${o?"rounded-sm bg-muted px-12 py-10":""}`,children:[t.title&&v.jsxs("h3",{className:`flex items-center gap-8 ${M8}`,children:[o&&v.jsx("span",{className:`size-8 rounded-full ${a?"bg-(--color-light-red-500)":"bg-(--color-light-green-500)"}`}),t.title]}),t.blocks.map((l,u)=>v.jsx(U8,{block:l},u))]},r)})}),Ts="<redacted>",f_=String.raw`\b([A-Za-z0-9_-]*(?:token|secret|password|passphrase|api[_-]?key|private[_-]?key|seed|mnemonic)[A-Za-z0-9_-]*|authorization)`,W8=new RegExp(String.raw`${f_}(\\?["']?\s*[:=]\s*)(\\?["'])`,"gi"),H8=(e,t,r)=>{for(let n=t;n<e.length;n++){if(e.startsWith(r,n))return n;e[n]==="\\"&&n++}return-1},q8=e=>{let t="",r=0;for(const n of e.matchAll(W8)){const o=n.index+n[0].length;if(n.index<r)continue;const a=H8(e,o,n[3]);a<0||(t+=e.slice(r,o)+Ts,r=a)}return t+e.slice(r)},P1=(e,t)=>q8(t.reduce((r,n)=>r.replaceAll(n,Ts),e)).replace(/\b(authorization\s*:\s*)(?!<redacted>)[^\r\n"']+/gi,`$1${Ts}`).replace(/\b(bearer\s+)(?!<redacted>)[^\s"',;\\]+/gi,`$1${Ts}`).replace(/\b(basic\s+)(?!<redacted>)[A-Za-z0-9+/]{8,}={0,2}/gi,`$1${Ts}`).replace(new RegExp(String.raw`${f_}(["']?\s*[:=]\s*)(?!<redacted>|\\?["'])[^\s"',;&\\]+`,"gi"),`$1$2${Ts}`),G8=(e,t)=>{switch(e.kind){case"explain":return{...e,context:P1(e.context,t)};case"followUp":return{...e,question:P1(e.question,t)};case"createTicket":return e}},X8="body-4-semi-bold text-muted uppercase",ym="cursor-pointer rounded-sm bg-muted-transparent px-12 py-6 body-3-semi-bold hover:bg-muted-transparent-hover",Lu="cursor-pointer rounded-sm bg-accent px-12 py-6 body-3-semi-bold text-on-accent hover:bg-accent-hover",D1=({selected:e,disabled:t,onClick:r,children:n})=>v.jsx("button",{type:"button","aria-pressed":e,disabled:t,onClick:r,className:`cursor-pointer rounded-sm px-10 py-4 body-4 disabled:cursor-default disabled:opacity-50 ${e?"bg-active-subtle body-4-semi-bold text-active":"bg-muted-transparent text-muted hover:bg-muted-transparent-hover"}`,children:n}),bm=({title:e,children:t})=>v.jsxs("div",{className:"flex flex-col gap-12 p-16",children:[v.jsx("h3",{className:"heading-5-semi-bold",children:e}),t]}),Y8=({turn:e,running:t})=>v.jsxs("div",{className:"flex flex-col gap-12",children:[e.question&&v.jsx("p",{className:"self-end rounded-sm bg-muted px-12 py-8 body-3",children:e.question}),e.steps.length>0&&v.jsx("ul",{className:"flex flex-col gap-4 body-4 text-muted",children:e.steps.map((r,n)=>v.jsxs("li",{className:"flex items-center gap-8",children:[t&&n===e.steps.length-1?v.jsx(yl,{size:12}):v.jsx(Pd,{size:12}),r]},n))}),e.answer!==null?v.jsx(V8,{markdown:e.answer}):e.text&&v.jsx("p",{className:"body-3 whitespace-pre-wrap",children:e.text}),t&&e.steps.length===0&&!e.text&&v.jsxs("p",{className:"flex items-center gap-8 body-3 text-muted",children:[v.jsx(yl,{size:16}),"Starting Claude Code…"]}),e.error&&v.jsxs("div",{className:"flex flex-col gap-4 rounded-sm bg-muted px-12 py-10",children:[v.jsx("span",{className:"body-3-semi-bold text-error",children:"Claude stopped before finishing"}),v.jsx("span",{className:"font-mono! body-4 break-words text-muted",children:e.error})]})]}),K8=({ai:e,request:t,secrets:r})=>{const[n,o]=x.useState(null),[a,l]=x.useState(!1),[u,d]=x.useState([]),[p,h]=x.useState(null),[m,y]=x.useState(!1),[w,E]=x.useState(""),S=x.useRef(null),C=x.useRef(null),R=x.useCallback((O=!1)=>{e&&(o(null),e.status(O).then(o).catch(L=>o({ready:!1,error:String(L)})))},[e]);x.useEffect(()=>R(),[R]);const k=()=>{e?.status(!0).then(o).catch(()=>{})};x.useEffect(()=>()=>S.current?.(),[]);const $=O=>d(L=>[...L.slice(0,-1),O(L.at(-1))]),A=x.useCallback((O,L,U)=>{if(!e)return;S.current?.();const z={question:L,steps:[],text:"",answer:null,verdict:void 0,ticket:void 0,createsTicket:!1,error:null};d(T=>U?[z]:[...T,z]),U&&h(null),y(!0),C.current={aiRequest:O,turnQuestion:L},S.current=e.analyze(G8(O,r),T=>{switch(T.type){case"step":$(M=>({...M,steps:[...M.steps,T.text],createsTicket:M.createsTicket||T.createsTicket===!0}));break;case"text":$(M=>({...M,text:M.text+T.text}));break;case"done":$(M=>({...M,answer:T.answer,verdict:T.verdict,ticket:T.ticket})),h(T.sessionId),y(!1),S.current=null;break;case"error":$(M=>({...M,error:T.message})),y(!1),S.current=null;break}})},[e,r]),D=x.useRef(null),N=x.useCallback(O=>{D.current=O,A({kind:"explain",context:O.context,summary:O.summary,readCode:a},null,!0)},[A,a]),P=n?.ready===!0;x.useEffect(()=>{t&&P&&D.current?.id!==t.id&&N(t)},[t,P,N]);const I=()=>{const O=C.current;if(!O||O.aiRequest.kind==="explain"){N(D.current);return}d(L=>L.slice(0,-1)),A(O.aiRequest,O.turnQuestion,!1)},re=()=>{S.current?.(),S.current=null,y(!1),$(O=>({...O,error:O.answer===null?"Stopped.":null}))},Z=[...u].reverse().find(O=>O.verdict)?.verdict==="bug",ee=u.find(O=>O.ticket)?.ticket,ne=u.some((O,L)=>O.createsTicket&&O.answer===null&&!(m&&L===u.length-1)),X=n?.ready===!0&&n.canCreateTickets,F=()=>{p&&A({kind:"createTicket",sessionId:p},"Create a Jira ticket",!1)},V=()=>{const O=w.trim();!O||!p||(E(""),A({kind:"followUp",sessionId:p,question:O,readCode:a},O,!1))},H=e?n===null?v.jsxs("p",{className:"flex items-center gap-8 p-16 body-3 text-muted",children:[v.jsx(yl,{size:16}),"Checking Claude Code…"]}):n.ready?u.length===0?v.jsxs(bm,{title:"Select logs or APDUs, then press Explain with AI",children:[v.jsx("p",{className:"body-3 text-muted",children:"Claude explains what happened and why, step by step, and draws the exchange between the app and the device."}),v.jsx("span",{className:X8,children:"Skills it uses"}),v.jsx("div",{className:"flex flex-wrap gap-6",children:n.skills.map(O=>v.jsx("span",{className:"rounded-sm bg-muted-transparent px-8 py-2 font-mono! body-4 text-muted",children:O},O))})]}):v.jsxs("div",{className:"flex flex-col gap-20 p-16",children:[u.map((O,L)=>v.jsx(Y8,{turn:O,running:m&&L===u.length-1},L)),!m&&u.at(-1)?.error&&D.current&&v.jsx("button",{type:"button",className:`self-start ${Lu}`,onClick:I,children:"Retry"})]}):v.jsxs(bm,{title:"Sign in to Claude Code to use AI debugging",children:[v.jsx("p",{className:"body-3 text-muted",children:"The DevTools uses the Claude Code login on this computer. Nothing is sent until you press Explain with AI."}),v.jsx("span",{className:"body-3",children:"1. Install Claude Code"}),v.jsx("code",{className:"rounded-sm bg-muted px-10 py-6 font-mono! body-4",children:"npm install -g @anthropic-ai/claude-code"}),v.jsx("span",{className:"body-3",children:"2. Run it once to sign in"}),v.jsx("code",{className:"rounded-sm bg-muted px-10 py-6 font-mono! body-4",children:"claude"}),v.jsx("span",{className:"font-mono! body-4 break-words text-muted",children:n.error}),v.jsx("button",{type:"button",className:`self-start ${Lu}`,onClick:()=>R(!0),children:"Check again"})]}):v.jsx(bm,{title:"AI debugging needs the DevTools desktop app",children:v.jsx("p",{className:"body-3 text-muted",children:"It runs Claude Code on your computer, which this panel cannot do. Open the same session in the desktop DevTools."})});return v.jsx(Dv,{name:"ai",defaultWidth:400,minWidth:320,maxWidth:800,edge:"left",className:"border-l border-muted-subtle bg-surface",children:v.jsxs("aside",{className:"flex min-h-0 flex-1 flex-col",children:[v.jsxs("div",{className:"flex items-center gap-8 border-b border-muted-subtle px-16 py-12",children:[v.jsx(hv,{size:16,className:"text-active"}),v.jsx("h2",{className:"body-2-semi-bold",children:"AI debugging"}),D.current&&v.jsxs("span",{className:"truncate body-4 text-muted",children:["· ",D.current.summary]}),v.jsx("span",{className:"flex-1"}),m&&v.jsx("button",{type:"button",className:ym,onClick:re,children:"Stop"})]}),P&&v.jsxs("div",{className:"flex items-center gap-6 px-16 pt-12",children:[v.jsx(D1,{selected:!a,disabled:m,onClick:()=>l(!1),children:"Quick"}),n.canReadCode&&v.jsx(vt,{label:"Let Claude read DMK's source code to confirm the cause. Slower.",children:v.jsx(D1,{selected:a,disabled:m,onClick:()=>l(!0),children:"Read the code"})}),v.jsx("span",{className:"flex-1"}),v.jsx("span",{className:"body-4 text-muted",children:n.model})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:H}),P&&p&&v.jsxs("div",{className:"flex items-center gap-8 border-t border-muted-subtle px-16 py-12",children:[v.jsx("div",{className:`flex-1 ${Ml}`,children:v.jsx("input",{className:zl,type:"text",placeholder:"Ask a follow-up…","aria-label":"Ask a follow-up question",value:w,disabled:m,onChange:O=>E(O.target.value),onKeyDown:O=>O.key==="Enter"&&V()})}),v.jsx(vt,{label:"Ask",children:v.jsx(sr,{"aria-label":"Ask",icon:uR,size:"xs",appearance:"transparent",className:"rounded-sm [&>svg]:text-active",disabled:m||!w.trim(),onClick:V})}),ee?v.jsxs("a",{href:ee.url,target:"_blank",rel:"noreferrer",className:`whitespace-nowrap ${ym}`,children:[ee.key," ↗"]}):Z?ne?v.jsx("span",{className:"body-4 text-muted",children:"The ticket may already exist: check Jira"}):X?v.jsx("button",{type:"button",className:`whitespace-nowrap ${Lu} disabled:cursor-default disabled:opacity-50`,disabled:m,onClick:F,children:"Create Jira ticket"}):v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"Connect Atlassian in Claude (claude.ai › Settings › Connectors) to create tickets",children:v.jsx("button",{type:"button",disabled:!0,className:`cursor-default whitespace-nowrap opacity-50 ${Lu}`,children:"Create Jira ticket"})}),v.jsx("button",{type:"button",className:`whitespace-nowrap ${ym}`,onClick:k,children:"Check again"})]}):null]})]})})},p_=({title:e,description:t,codeExample:r})=>v.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-16 overflow-auto p-24",children:[v.jsx(KD,{appearance:"muted",icon:g5,size:56}),v.jsx("h3",{className:"heading-4-semi-bold",children:e}),v.jsx("p",{className:"max-w-480 text-center body-2 text-muted",children:t}),v.jsx("pre",{className:"max-w-full overflow-auto rounded-md bg-muted p-16 font-mono! body-3",children:r})]}),Q8={b001:"getAppAndVersion",b006:"loadCertificate",b010:"editExternalAddressIdentifier / editExternalAddressScope / provideContact / registerIdentity",b0a7:"closeApp"},J8={e001:"getOsVersion",e010:"getBatteryStatus",e02e:"renameContact",e033:"deleteLanguagePack",e034:"listLanguagePack",e060:"createBackgroundImage",e061:"uploadBackgroundImageChunk",e062:"commitBackgroundImage",e063:"deleteBackgroundImage",e064:"getBackgroundImageSize",e065:"fetchBackgroundImageChunk",e066:"getBackgroundImageHash",e06a:"GetAppStorageInfo",e06b:"BackupAppStorage",e06c:"InitRestoreAppStorage",e06d:"RestoreAppStorage",e06e:"CommitRestoreAppStorage",e06f:"RequestMasterConsent",e0d8:"openApp",e0de:"listApps",e0df:"listApps"},Z8={Aleo:{e003:"GetAppConfig",e005:"getAddress",e006:"signFeeIntent / signNestedCall / signRootIntent",e007:"getViewKey",e008:"getTvk"},Bitcoin:{e100:"getExtendedPublicKey",e102:"registerWalletAddress",e103:"getWalletAddress",e104:"signPsbt",e105:"getMasterFingerprint",e110:"signMessage",f801:"continue"},"Bitcoin Cash":{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},"Bitcoin Gold":{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Concordium:{e000:"VerifyAddress",e001:"GetPublicKey",e002:"SignTransfer",e004:"SignCredentialDeployment",e022:"SetTrustedName",e023:"GetChallenge",e027:"SignPlt",e032:"SignTransferWithMemo",e040:"GetAppConfig"},Cosmos:{5500:"GetAppConfig",5502:"SignTransaction",5504:"GetAddress"},Dogecoin:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Ethereum:{e002:"getAddress",e004:"signTransaction / startTransaction / storeTransaction",e006:"getAppConfiguration",e008:"signPersonalMessage",e00a:"provideTokenInformation",e00c:"signEIP712",e012:"setExternalPlugin",e014:"provideNFTInformation",e016:"setPlugin",e01a:"sendEIP712StructDefinition",e01c:"sendEIP712StructImplem",e01e:"sendEIP712Filtering",e020:"getChallenge",e022:"provideTrustedName",e024:"provideEnum",e026:"provideTransactionInformation",e028:"provideTransactionFieldDescription",e02a:"provideProxyInfo",e030:"provideNetworkConfiguration",e032:"provideWeb3Check / web3CheckOptIn",e034:"signEIP7702Authorization",e036:"provideSafeAccount",e038:"provideGatedSigning"},Horizen:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Hyperliquid:{e002:"sendMetadata",e003:"sendAction",e004:"signActions"},InternetComputer:{1100:"GetVersion",1101:"GetAddress",1102:"SignTransaction",1103:"SignUpdateCall"},"Ledger Sync":{e003:"getAppName / getVersion",e005:"getSeedId",e006:"init",e007:"signBlockSignature / signBlockSingle",e008:"parseBlockSignature / parseSingle",e009:"setTrustedMember"},Litecoin:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Polkadot:{f901:"GetAddress",f902:"SignTransaction"},Solana:{e004:"getAppConfiguration",e005:"getPubKey",e006:"signTransaction",e007:"signOffChainMessage",e008:"signTransactionPreview",e009:"delayedSignTransaction",e00a:"signMessageGenericPreview",e00b:"promptUiDisplay",e00c:"finalizeGenericClearSign",e016:"ProvideInstructionDescriptor",e020:"getChallenge",e021:"provideTLVDescriptor",e022:"ProvideTLVTransactionInstructionDescriptor",e023:"provideTransactionCheck / transactionCheckOptIn",e024:"provideInstructionInfo",e025:"provideInstructionSubstructure",e026:"provideEnumVariant",e027:"provideTokenAccountState",e028:"provideAltResolution",e029:"provideTrustedName"},Tron:{e002:"GetAddress",e004:"signTransaction",e005:"signTransactionHash",e006:"GetAppConfiguration",e008:"signPersonalMessage",e00a:"GetECDHSecret"},XRP:{e002:"GetAddress",e004:"SignTransaction",e006:"GetAppConfig"},Zcash:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction / ZcashSaplingOutputCommit",e04a:"HashOutputFull / ProvideOutputFullChangePath",e050:"GetFullViewingKey",e051:"GetShieldedAddress",e052:"PcztHeader",e053:"PcztTransparentInput",e054:"PcztTransparentOutput",e055:"SignPcztTransparent",e056:"PcztOrchardAction",e057:"SignPcztOrchard",e058:"PcztIronwoodAction",e059:"SignPcztIronwood",e0c4:"getAppConfig"}},eU={9e3:"OK",5501:"Refused",5502:"PIN not set",5515:"Locked",6807:"App not found",6985:"Refused","6d00":"INS not supported","6e00":"CLA not supported"},jv=e=>eU[e]??"",j1=e=>e.toLowerCase().match(/.{1,2}/g)??[],h_="OS",M1=e=>String.fromCharCode(...e.map(t=>parseInt(t,16))),tU=(e,t)=>{if(t.startsWith("b0"))return Q8[t];if(e!==void 0)return Iv(e)?J8[t]:Z8[e]?.[t]},rU=(e,t)=>t.startsWith("b0")||e!==void 0&&Iv(e)?h_:e,nU=(e,t,r,n)=>t==="b001"&&n[0]==="01"?M1(n.slice(2,2+parseInt(n[1]??"0",16))):t==="b0a7"?"BOLOS":t==="e0d8"&&(e===void 0||Iv(e))?M1(r.slice(5)):e,iU=e=>typeof e=="object"&&e!==null&&e.type==="apdu-exchange"&&typeof e.sessionId=="string"&&typeof e.apdu=="string"&&typeof e.response=="string",z1=new WeakMap;let oU=0;const sU=e=>{const t=new Map;return e.flatMap(r=>{if(!iU(r.payload))return[];const n=z1.get(r);if(n)return t.set(n.exchange.sessionId,n.openApp),[n.exchange];const{sessionId:o}=r.payload,a=j1(r.payload.apdu),l=j1(r.payload.response),u=l.slice(-2).join(""),d=a.slice(0,2).join(""),p=t.get(o),h=u==="9000"?nU(p,d,a,l.slice(0,-2)):p;t.set(o,h);const m={id:String(oU++),timestamp:r.timestamp,sessionId:o,layer:rU(p,d),command:tU(p,d)??a.slice(0,2).join(" "),sent:a,received:l,statusWord:u};return z1.set(r,{exchange:m,openApp:h}),[m]})},m_=(e,t,r,n,o)=>{const a=x.useRef(null),l=x.useRef(!1),u=x.useRef(e);u.current=e;const d=x.useRef(t);d.current=t;const p=x.useRef(r);p.current=r;const h=x.useRef(n);h.current=n;const m=x.useRef(o);m.current=o,x.useEffect(()=>{const E=()=>{const C=a.current;C?.moved&&(document.body.style.userSelect="",l.current=!0,m.current(C.last)),a.current=null},S=C=>{l.current&&(l.current=!1,C.stopPropagation(),C.preventDefault())};return window.addEventListener("mouseup",E),window.addEventListener("click",S,!0),()=>{window.removeEventListener("mouseup",E),window.removeEventListener("click",S,!0)}},[]);const y=x.useCallback((E,S)=>{const C=u.current(E);S.button!==0||S.shiftKey||C===void 0||(l.current=!1,a.current={anchor:C,last:C,adding:!p.current.has(C),base:new Set(p.current),moved:!1})},[]),w=x.useCallback(E=>{const S=a.current,C=u.current(E);if(!S||C===void 0||C===S.anchor&&!S.moved)return;const R=d.current(S.anchor);if(R<0)return;S.last=C,S.moved||(S.moved=!0,window.getSelection()?.removeAllRanges(),document.body.style.userSelect="none");const k=new Set(S.base);for(let $=Math.min(R,E);$<=Math.max(R,E);$++){const A=u.current($);A!==void 0&&(S.adding?k.add(A):k.delete(A))}h.current(k)},[]);return{onRowMouseDown:y,onRowMouseEnter:w}};function Mv(e){const t=e.trim();if(!t)return[];const r=[],n=/(-?)\/([^/]+)\/|(\S+)/g;let o;for(;(o=n.exec(t))!==null;)if(o[2]!==void 0){const a=o[1]==="-",l=o[2];try{const u=new RegExp(l,"i");r.push({type:"regex",pattern:u,exclude:a})}catch{const u=o[0],d=u.startsWith("-"),p=d?u.slice(1):u;p&&r.push({type:"keyword",value:p.toLowerCase(),exclude:d})}}else if(o[3]!==void 0){const a=o[3],l=a.startsWith("-"),u=l?a.slice(1):a;u&&r.push({type:"keyword",value:u.toLowerCase(),exclude:l})}return r}function aU(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return""}}function lU(e){return[e.tag,e.message,aU(e.payload)].join(" ")}function F1(e,t){return e.type==="keyword"?t.toLowerCase().includes(e.value):e.pattern.test(t)}function g_(e,t){if(t.length===0)return!0;const r=lU(e),n=t.filter(a=>!a.exclude),o=t.filter(a=>a.exclude);for(const a of n)if(!F1(a,r))return!1;for(const a of o)if(F1(a,r))return!1;return!0}const v_=({onClick:e,enabled:t,up:r=!1})=>v.jsx(vt,{label:"Scroll to latest logs",side:"left",className:`absolute right-16 bottom-16 transition-[opacity,visibility] duration-300 ${t?"invisible opacity-0":"visible opacity-100"}`,children:v.jsx(sr,{"aria-label":"Scroll to latest logs",icon:r?uR:u5,appearance:"accent",size:"sm",onClick:e,className:"shadow-md"})}),cU=4,y_=e=>{const t=x.useRef(null),r=x.useRef(null),[n,o]=x.useState(!0),a=x.useRef(!0),l=x.useCallback(p=>{a.current=p,o(p)},[]),u=x.useCallback(()=>{const p=t.current;p&&(p.scrollTop=p.scrollHeight)},[]);x.useLayoutEffect(()=>{e&&u()},[e,u]);const d=x.useCallback(()=>{const p=t.current;if(!p)return;const h=p.scrollHeight-p.clientHeight-p.scrollTop<=cU;h!==a.current&&l(h)},[l]);return x.useEffect(()=>{const p=r.current;if(!p||!e)return;const h=new MutationObserver(()=>{a.current&&u()});return h.observe(p,{childList:!0}),()=>h.disconnect()},[e,u]),{containerRef:t,contentRef:r,onScroll:d,atBottom:n,setAtBottom:l,scrollToBottom:u}},b_=({d:e,size:t=16,className:r})=>v.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:r,"aria-hidden":"true",children:v.jsx("path",{d:e})}),uU=e=>v.jsx(b_,{...e,d:"M5.667 3v10m4.666-10v10"}),dU=e=>v.jsx(b_,{...e,d:"M4.667 2.667v10.666L13 8z"}),x_=({paused:e,onToggle:t})=>v.jsx(vt,{label:e?"Resume incoming logs":"Pause incoming logs",side:"bottom",children:v.jsx(sr,{"aria-label":e?"Resume incoming logs":"Pause incoming logs",icon:e?dU:uU,size:"xs",appearance:"transparent",className:`rounded-sm ${e?"bg-active-subtle hover:bg-active-subtle-hover [&>svg]:text-active":""}`,onClick:t})});function B1(e,t){return e.type==="keyword"?t.toLowerCase().includes(e.value):e.pattern.test(t)}function fU(e,t){if(t.length===0)return!0;const r=t.filter(o=>!o.exclude),n=t.filter(o=>o.exclude);for(const o of r)if(!B1(o,e))return!1;for(const o of n)if(B1(o,e))return!1;return!0}const U1=({text:e,label:t})=>{const[r,n]=x.useState(!1);return v.jsx(vt,{label:t,children:v.jsx(sr,{"aria-label":t,icon:r?Pd:dR,size:"xs",appearance:"no-background",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})}})})},V1=5,$g=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}),pU=e=>e==="9000"?{bar:"bg-(--color-light-green-500)",text:"text-success"}:e==="5515"?{bar:"bg-(--color-light-yellow-500)",text:"text-warning"}:{bar:"bg-(--color-light-red-500)",text:"text-error"},hU=e=>[e.command,e.layer,e.sent.join(" "),e.sent.join(""),e.received.join(" "),e.received.join(""),jv(e.statusWord)].join(" "),mU=e=>`[${e.timestamp}] [${e.layer??"unknown app"}] ${e.command} | => ${e.sent.join("")} | <= ${e.received.join("")}`,gU=({exchange:e,index:t,open:r,onToggle:n,selected:o,onSelect:a,onRowMouseDown:l,onRowMouseEnter:u})=>{const d=pU(e.statusWord);return v.jsxs("div",{className:`flex gap-8 px-8 py-2 ${o?"bg-active-subtle":""}`,onMouseDown:p=>l(t,p),onMouseEnter:()=>u(t),children:[v.jsx("div",{className:"flex shrink-0 pt-4",children:v.jsx(Qg,{"aria-label":"Select this APDU",checked:o,className:"size-16",onClick:p=>a(t,p.shiftKey)})}),v.jsx("span",{className:`w-4 shrink-0 rounded-full ${d.bar}`}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("button",{type:"button","aria-expanded":r,onClick:()=>n(e.id),className:"flex w-full cursor-pointer items-center gap-12 rounded-xs px-8 py-2 text-left font-mono! body-3 text-base hover:bg-base-transparent-hover",children:[v.jsx(Nd,{size:12,className:`shrink-0 text-muted transition-transform ${r?"rotate-90":""}`}),v.jsx("span",{className:"text-muted",children:$g(e.timestamp)}),v.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-8",children:[v.jsx(yg,{size:"sm",appearance:e.layer===h_?"accent-subtle":"gray",label:e.layer??"Unknown",className:"max-w-128 shrink-0"}),v.jsx("span",{className:"truncate",children:e.command})]}),v.jsxs("span",{className:"body-4 whitespace-nowrap text-muted",children:[e.sent.length," B → ",e.received.length," B"]}),v.jsxs("span",{className:`w-128 truncate ${d.text}`,children:[e.statusWord," ",jv(e.statusWord)]})]}),r&&v.jsxs("div",{className:"my-4 flex flex-col gap-8 rounded-sm bg-muted px-12 py-8 font-mono! body-3",children:[v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsxs("span",{className:"body-4-semi-bold text-muted uppercase",children:["Sent · ",e.sent.length," B"]}),v.jsx("span",{className:"flex-1"}),v.jsx(U1,{text:e.sent.join(""),label:"Copy sent bytes"})]}),v.jsxs("p",{className:"break-all",children:[e.sent.slice(0,V1).join(" ")," ",v.jsx("span",{className:"text-muted",children:e.sent.slice(V1).join(" ")})]}),v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsxs("span",{className:"body-4-semi-bold text-muted uppercase",children:["Received · ",e.received.length," B"]}),v.jsx("span",{className:"flex-1"}),v.jsx(U1,{text:e.received.join(""),label:"Copy received bytes"})]}),v.jsx("p",{className:"break-all",children:e.received.join(" ")})]})]})]})},vU=Ee.memo(gU,(e,t)=>e.exchange.id===t.exchange.id&&e.index===t.index&&e.open===t.open&&e.onToggle===t.onToggle&&e.selected===t.selected&&e.onSelect===t.onSelect&&e.onRowMouseDown===t.onRowMouseDown&&e.onRowMouseEnter===t.onRowMouseEnter),yU=({exchanges:e,clearedUpTo:t,onClear:r,onExplain:n})=>{const[o,a]=x.useState(""),[l,u]=x.useState(null),[d,p]=x.useState(new Set),h=x.useMemo(()=>{const O=l??e;return t===void 0?O:O.filter(L=>Number(L.id)>t)},[l,e,t]),m=x.useMemo(()=>{const O=Mv(o);return O.length===0?h:h.filter(L=>fU(hU(L),O))},[h,o]),[y,w]=x.useState(new Set),E=x.useRef(m);E.current=m;const S=x.useRef(null),C=x.useCallback((O,L)=>{const U=E.current,z=U[O];if(!z)return;const T=U.findIndex(({id:M})=>M===S.current);S.current=z.id,w(M=>{const te=new Set(M);if(L&&T>=0)for(let le=Math.min(T,O);le<=Math.max(T,O);le++)te.add(U[le].id);else te.delete(z.id)||te.add(z.id);return te})},[]),{onRowMouseDown:R,onRowMouseEnter:k}=m_(O=>E.current[O]?.id,O=>E.current.findIndex(L=>L.id===O),y,w,O=>{S.current=O}),$=()=>{w(new Set),S.current=null},A=h.filter(({id:O})=>y.has(O)),D=()=>{const O=e.at(-1);O&&r(Number(O.id)),u(L=>L&&[])},N=()=>{const O=new Blob([JSON.stringify(m,null,2)],{type:"application/json"}),L=URL.createObjectURL(O),U=document.createElement("a");U.href=L,U.download=`apdu-${new Date().toISOString()}.json`,U.click(),URL.revokeObjectURL(L)},P=l!==null,{containerRef:I,contentRef:re,onScroll:Z,atBottom:ee,setAtBottom:ne,scrollToBottom:X}=y_(!P),F=x.useCallback(O=>{ne(!1),p(L=>{const U=new Set(L);return U.delete(O)||U.add(O),U})},[ne]),V=()=>{ne(!0),X()},H=h.length-m.length;return v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-12 gap-y-8",children:[v.jsx("div",{className:c_,children:v.jsx("div",{className:Ml,children:v.jsx("input",{className:zl,type:"text",placeholder:"Filter","aria-label":"Filter APDUs",value:o,onChange:O=>a(O.target.value)})})}),v.jsx("span",{className:"flex-1"}),v.jsxs("span",{className:"font-mono! body-4 whitespace-nowrap text-muted",children:[P&&v.jsx("span",{className:"text-warning",children:"paused · "}),h.length," ",h.length===1?"exchange":"exchanges",H>0&&` · ${H} filtered out`]}),v.jsxs("div",{className:"flex gap-6",children:[v.jsx(x_,{paused:P,onToggle:()=>u(P?null:e)}),v.jsx(vt,{label:"Clear APDUs",side:"bottom",children:v.jsx(sr,{"aria-label":"Clear APDUs",icon:gR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:D})}),v.jsx(vt,{label:"Export APDUs",side:"bottom",children:v.jsx(sr,{"aria-label":"Export APDUs",icon:fR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:N})})]})]}),v.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[v.jsx("div",{ref:I,className:"min-h-0 flex-1 overflow-auto",onScroll:Z,children:v.jsxs("div",{ref:re,children:[m.length===0?v.jsx("p",{className:"p-24 text-center body-2 text-muted",children:"No APDU exchanged yet"}):m.map((O,L)=>v.jsx(vU,{exchange:O,index:L,open:d.has(O.id),onToggle:F,selected:y.has(O.id),onSelect:C,onRowMouseDown:R,onRowMouseEnter:k},O.id)),!P&&m.length>0&&v.jsx("div",{className:`flex h-24 items-center justify-center gap-4 ${ee?"":"invisible"}`,"aria-label":ee?"Following new APDUs":void 0,children:["","[animation-delay:200ms]","[animation-delay:400ms]"].map(O=>v.jsx("span",{className:`size-4 animate-pulse rounded-full bg-muted-strong ${O}`},O))})]})}),v.jsx(v_,{enabled:ee,onClick:V})]}),A.length>0&&v.jsx(xR,{label:`${A.length} ${A.length===1?"APDU":"APDUs"} selected`,detail:`${$g(A[0].timestamp)} → ${$g(A.at(-1).timestamp)} · shift-click to extend`,onClear:$,onExplain:()=>n({context:A.map(mU).join(`
42
- `),summary:`${A.length} ${A.length===1?"APDU":"APDUs"}`})})]})},Iu=(e=[])=>e.map(t=>t.toString(16).padStart(2,"0")).join(""),bU=[{label:"Get app & version",apdu:"B001000000"},{label:"Get OS version",apdu:"E001000000"}],xU=({sessionId:e,onSend:t,responses:r})=>{const[n,o]=x.useState(""),[a,l]=x.useState(null),[u,d]=x.useState(null),p=y=>{const w=y.replace(/\s/g,"").toUpperCase();if(!/^[0-9A-F]*$/.test(w)||w.length%2!==0){l("Invalid hex string (e.g., E0C4000000)");return}d(t(e,w))},h=u?r.get(u):null,m=a??(h&&!h.success?h.error:null);return v.jsxs("div",{className:"flex flex-col gap-8",children:[v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsx("span",{className:"flex-1 body-4-semi-bold text-muted uppercase",children:"APDU"}),bU.map(y=>v.jsx("button",{type:"button",onClick:()=>{o(y.apdu),l(null),p(y.apdu)},className:"cursor-pointer rounded-full bg-muted-transparent px-8 py-2 body-4 text-base hover:bg-muted-transparent-hover",children:y.label},y.apdu))]}),v.jsxs("div",{className:"flex gap-8",children:[v.jsx("div",{className:`flex-1 ${Ml}`,children:v.jsx("input",{className:zl,type:"text",placeholder:"APDU hex (e.g., E0C4000000)","aria-label":"APDU to send",value:n,onChange:y=>{o(y.target.value),l(null)},onKeyDown:y=>y.key==="Enter"&&n.trim()&&p(n)})}),v.jsx(vt,{label:"Send APDU",children:v.jsx(sr,{"aria-label":"Send APDU",icon:h5,size:"xs",appearance:"transparent",className:"rounded-sm [&>svg]:text-active",onClick:()=>p(n),disabled:!n.trim()})})]}),m&&v.jsx("p",{className:"body-3 text-error",children:m}),!m&&h?.success&&v.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-8 font-mono! body-3",children:[v.jsxs("span",{className:Iu(h.statusCode)==="9000"?"text-success":"text-error",children:[Iu(h.statusCode)," ",jv(Iu(h.statusCode))]}),h.data&&h.data.length>0&&v.jsx("span",{className:"break-all text-muted",children:Iu(h.data)})]})]})},wU={nanoS:Vu,nanoSP:Vu,nanoX:Vu,stax:mR,flex:pR,apexp:hR},zv=({modelId:e,className:t=""})=>{const r=wU[e]??d5;return v.jsx(r,{size:20,className:`shrink-0 text-muted ${t}`})},Fv="MOCKSERVER",SU=800,w_=e=>e===Fv?"Mock server":e,S_=e=>!e||e.deviceStatus!=="NOT CONNECTED",E_=e=>{const[t,r]=x.useState(e);return x.useEffect(()=>{if(e!=="BUSY"){r(e);return}const n=setTimeout(()=>r(e),SU);return()=>clearTimeout(n)},[e]),t},EU={CONNECTED:"bg-(--color-light-green-500)",LOCKED:"bg-(--color-light-yellow-500)",BUSY:"bg-(--color-light-decorative-blue-500)","NOT CONNECTED":"bg-muted-strong"},CU={CONNECTED:"success",LOCKED:"warning",BUSY:"accent-subtle","NOT CONNECTED":"error"},kU=({device:e,state:t,exchanges:r,onSendApdu:n,apduResponses:o,clearedUpTo:a,onClear:l,onExplain:u})=>{const d=t&&"currentApp"in t?t:void 0,p=E_(t?.deviceStatus??"");return v.jsxs("div",{className:"flex min-w-320 flex-1 flex-col gap-16 p-16",children:[v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsx(zv,{modelId:e.modelId}),v.jsx("h4",{className:"heading-5-semi-bold",children:e.name||e.modelId}),p&&v.jsx(yg,{size:"sm",appearance:CU[p]??"gray",label:p}),v.jsx(yg,{size:"sm",appearance:"gray",label:w_(e.transport)})]}),v.jsxs("dl",{className:"grid grid-cols-[120px_1fr] gap-x-12 gap-y-6 body-3",children:[v.jsx("dt",{className:"text-muted",children:"Session ID"}),v.jsx("dd",{className:"truncate font-mono!",children:e.sessionId}),v.jsx("dt",{className:"text-muted",children:"Model"}),v.jsx("dd",{children:e.modelId}),d?.currentApp&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{className:"text-muted",children:"Current app"}),v.jsxs("dd",{children:[d.currentApp.name," ",v.jsx("span",{className:"font-mono! text-muted",children:d.currentApp.version})]})]}),d?.firmwareVersion&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{className:"text-muted",children:"Firmware"}),v.jsx("dd",{className:"font-mono!",children:d.firmwareVersion.os})]}),d?.batteryStatus&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{className:"text-muted",children:"Battery"}),v.jsxs("dd",{children:[d.batteryStatus.level," %"]})]})]}),S_(t)&&v.jsx(xU,{sessionId:e.sessionId,onSend:n,responses:o},`sender-${e.sessionId}`),v.jsx(yU,{exchanges:r,clearedUpTo:a,onClear:l,onExplain:u},`list-${e.sessionId}`)]})},RU=({device:e,onConnect:t})=>v.jsxs("div",{className:"flex items-center gap-10 rounded-sm px-12 py-8 hover:bg-base-transparent-hover",children:[v.jsx(zv,{modelId:e.deviceModel.model}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[v.jsx("span",{className:"truncate body-3-semi-bold",children:e.name||e.deviceModel.name}),v.jsxs("span",{className:"truncate font-mono! body-4 text-muted",children:[e.transport,e.rssi!==void 0&&e.rssi!==null&&` · ${e.rssi} dBm`]})]}),v.jsx("button",{type:"button",onClick:t,className:"cursor-pointer rounded-sm bg-muted-transparent px-8 py-4 body-4-semi-bold hover:bg-muted-transparent-hover",children:"Connect"})]}),xm="body-4-semi-bold text-muted uppercase",W1="cursor-pointer rounded-sm bg-muted-transparent px-8 py-4 body-4-semi-bold hover:bg-muted-transparent-hover disabled:cursor-default disabled:text-disabled",_U=({device:e,state:t,selected:r,onSelect:n})=>{const o=E_(t?.deviceStatus??"CONNECTED"),a=t&&"currentApp"in t?t.currentApp?.name:void 0;return v.jsxs("button",{type:"button",onClick:n,className:`flex cursor-pointer items-center gap-10 rounded-sm px-12 py-8 text-left ${r?"bg-active-subtle":"hover:bg-base-transparent-hover"} ${S_(t)?"":"opacity-60"}`,children:[v.jsx(zv,{modelId:e.modelId}),v.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[v.jsx("span",{className:"truncate body-3-semi-bold",children:e.name||e.modelId}),v.jsxs("span",{className:"truncate font-mono! body-4 text-muted",children:[w_(e.transport),a&&` · ${a}`]})]}),v.jsx("span",{title:o,className:`size-8 shrink-0 rounded-full ${EU[o]??"bg-muted-strong"}`})]})},$U=({devices:e,sessionStates:t,selectedSessionId:r,onSelect:n,discoveredDevices:o,isListening:a,isActivelyDiscovering:l,startListening:u,stopListening:d,startDiscovering:p,stopDiscovering:h,connectDevice:m,mockServer:y})=>{const w=e.some(E=>E.transport===Fv);return v.jsx(Dv,{name:"sessions",defaultWidth:288,minWidth:200,maxWidth:480,edge:"right",className:"border-r border-muted-subtle",children:v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-16 overflow-auto p-12",children:[v.jsxs("section",{className:"flex flex-col gap-4",children:[v.jsxs("span",{className:`px-4 pb-4 ${xm}`,children:["Sessions · ",e.length]}),e.length===0&&v.jsx("p",{className:"px-4 body-3 text-muted",children:"No device connected yet."}),e.map(E=>v.jsx(_U,{device:E,state:t.get(E.sessionId),selected:E.sessionId===r,onSelect:()=>n(E.sessionId)},E.sessionId))]}),v.jsxs("section",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex items-center gap-6 px-4 pb-4",children:[v.jsx("span",{className:`flex-1 ${xm}`,children:"Discovered"}),v.jsx("button",{type:"button",className:W1,onClick:a?d:u,disabled:l,children:a?"Stop":"Listen"}),v.jsx("button",{type:"button",className:W1,onClick:l?h:p,disabled:a,children:l?"Stop":"Discover"})]}),(a||l)&&o.length===0&&v.jsxs("p",{className:"flex items-center gap-8 px-4 body-3 text-muted",children:[v.jsx(yl,{size:16}),a?"Listening…":"Discovering…"]}),o.map(E=>v.jsx(RU,{device:E,onConnect:()=>m(E.id)},E.id))]}),w&&v.jsxs("section",{className:"mt-auto flex flex-col gap-6 border-t border-muted-subtle px-4 pt-12",children:[v.jsx("span",{className:xm,children:"Mock server"}),y?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"truncate font-mono! body-3",children:y.url}),v.jsx("span",{className:"truncate font-mono! body-4 text-muted",children:y.sessionToken?`Session ${y.sessionToken.slice(0,8)}…`:"No session token shared"})]}):v.jsxs("p",{className:"body-3 text-muted",children:["Pass ",v.jsx("code",{children:"mockServer"})," to"," ",v.jsx("code",{children:"DevToolsDmkInspector"})," to see the device screens."]})]})]})})},Xu=(e,t)=>({label:e,touch:!1,speculos:!0,screenWidth:128,screenHeight:t,lightScreen:!1}),AU={nanoS:{...Xu("Nano S",32),speculos:!1},nanoSP:Xu("Nano S Plus",64),nanoX:Xu("Nano X",64),stax:{label:"Stax",touch:!0,speculos:!0,screenWidth:400,screenHeight:672,lightScreen:!0},flex:{label:"Flex",touch:!0,speculos:!0,screenWidth:480,screenHeight:600,lightScreen:!0},apexp:{label:"Apex",touch:!0,speculos:!0,screenWidth:300,screenHeight:400,lightScreen:!0}},TU=Xu("Device",64),LU=e=>AU[e]??TU,IU=e=>e?.status===409,OU=(e,t)=>({screenshot:async()=>{try{return await e.getScreenshot(t)}catch(r){if(IU(r))return null;throw r}},idle:async()=>({kind:"os-info",device:await e.getDevice(t)}),pressButton:(r,n)=>e.pressButton(t,r,n),touch:(r,n,o)=>e.touchScreen(t,r,n,o),openApp:async r=>{const n=new TextEncoder().encode(r);if(n.length>255)throw new Error(`App name too long to open: ${r}`);const{response:o}=await e.sendApdu(t,Uint8Array.from([224,216,0,0,n.length,...n])),a=o.slice(-4);if(a!=="9000")throw new Error(`Could not open ${r} (${a})`)}}),NU=150;function C_(e){const t=x.useRef(null),r=x.useRef(null),n=x.useRef(e);n.current=e;const o=x.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),a=x.useCallback(u=>{if(!n.current||t.current)return!1;const d={target:u,pressed:!1};return t.current=d,r.current=setTimeout(()=>{d.pressed=!0,n.current?.(u,"press")},NU),!0},[]),l=x.useCallback(()=>{const u=t.current;return u?(t.current=null,o(),n.current?.(u.target,u.pressed?"release":"press-and-release"),!0):!1},[o]);return x.useEffect(()=>()=>{const u=t.current;t.current=null,o(),u?.pressed&&n.current?.(u.target,"release")},[o]),x.useMemo(()=>({hold:a,release:l}),[a,l])}const PU=e=>C_(e),DU=2e3;function jU(e,t){const[r,n]=x.useState();return x.useEffect(()=>{let o=!1,a;if(n(void 0),!t)return;const l=()=>{e.getDevice(t).then(u=>{o||n(u)},()=>{o||(n(null),a=setTimeout(l,DU))})};return l(),()=>{o=!0,clearTimeout(a)}},[e,t]),r}const MU="BOLOS",zU=1e4,FU=e=>(e.apps??[]).filter(({name:t})=>t!==MU),BU=e=>`https://cdn.live.ledger.com/icons/${e.toLowerCase().replaceAll(" ","_")}.png`;function UU(e){const[t,r]=x.useState(),[n,o]=x.useState(),a=x.useRef(void 0);x.useEffect(()=>()=>clearTimeout(a.current),[]);const l=x.useCallback(u=>{!e||t||(r(u),o(void 0),e(u).then(()=>{a.current=setTimeout(()=>{r(void 0),o(`${u} opened but its screen never showed up`)},zU)},d=>{r(void 0),o(d instanceof Error?d.message:String(d))}))},[e,t]);return{opening:t,error:n,open:l}}const VU=500,WU=2e3,HU=3,qU=e=>e instanceof Error?e.message:String(e);function GU(e,t,r){const[n,o]=x.useState({kind:"loading"}),a=x.useRef(null),l=x.useRef(!1),u=x.useRef(!1);u.current=n.kind==="image";const d=x.useRef(0),p=x.useRef(0),h=x.useCallback(S=>{u.current&&++d.current<=HU||o({kind:"error",message:qU(S)})},[]),m=x.useCallback(()=>{a.current&&(r.releaseImageSource?.(a.current),a.current=null)},[r]),y=x.useRef(()=>{}),w=x.useMemo(()=>{const S=C=>{C.then(()=>y.current()).catch(h)};return{pressButton:(C,R)=>S(e.pressButton(C,R)),touch:(C,R,k)=>S(e.touch(C,R,k))}},[e,h]),E=x.useCallback(async()=>{if(l.current)return;l.current=!0;const S=p.current,C=()=>S!==p.current;try{const R=await e.screenshot();if(C())return;if(d.current=0,R){const k=await r.toImageSource(R);if(C()){r.releaseImageSource?.(k);return}k!==a.current&&(m(),a.current=k),o($=>$.kind==="image"&&$.src===k&&$.input===w?$:{kind:"image",src:k,input:w})}else{const k=await e.idle?.();if(C())return;m(),o(k??{kind:"error",message:"No screen to capture"})}}catch(R){C()||h(R)}finally{l.current=!1}},[e,r,w,h,m]);return y.current=()=>{E()},x.useEffect(()=>{if(!t){m(),o({kind:"loading"});return}let S,C=!1;const R=async()=>{r.isHidden()||await E(),!C&&(S=setTimeout(()=>{R()},u.current?VU:WU))};return R(),()=>{C=!0,clearTimeout(S),p.current++}},[t,r,E,m]),x.useEffect(()=>m,[m]),n}const XU=(e,t,r,n)=>{if(!r.width||!r.height||!n.width||!n.height)return null;const o=(a,l)=>Math.min(Math.max(Math.round(a),0),l-1);return{x:o(e/r.width*n.width,n.width),y:o(t/r.height*n.height,n.height)}};function YU(e){const t=x.useMemo(()=>e&&((r,n)=>e(r.x,r.y,n)),[e]);return C_(t)}const KU={stax:mR,flex:pR,apexp:hR},QU=e=>({...LU(e),icon:KU[e]??Vu}),Bv=({children:e})=>Ee.createElement("div",{className:"border-muted @container relative overflow-hidden rounded-md border"},e),JU="[&::-webkit-scrollbar]:size-[6px] [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full",H1=({name:e})=>{const[t,r]=x.useState(!1);return t?Ee.createElement("span",{className:"text-muted bg-muted flex size-[12.5cqw] items-center justify-center rounded-full text-[length:6cqw] font-semibold"},e.charAt(0)):Ee.createElement("img",{src:BU(e),alt:"",draggable:!1,className:"size-[12.5cqw] rounded-full",onError:()=>r(!0)})},ZU=({device:e,model:t,onOpenApp:r})=>{const n=FU(e),{opening:o,error:a,open:l}=UU(r),u=t.lightScreen?{background:"bg-white",text:"text-black",scrollbar:"[&::-webkit-scrollbar-thumb]:bg-black/30",overlay:"bg-white/70"}:{background:"bg-black",text:"text-white",scrollbar:"[&::-webkit-scrollbar-thumb]:bg-white/30",overlay:"bg-black/70"},d=t.touch?{scroll:"overflow-y-auto",list:"grid grid-cols-3 gap-[1.5cqw]",tile:"min-w-0 py-[3cqw]",opening:"flex-col"}:{scroll:"flex items-center overflow-x-auto",list:"flex gap-[2.5cqw]",tile:"w-[28cqw] shrink-0 py-[1.5cqw]",opening:"flex-row"};return Ee.createElement("div",{className:"flex flex-col gap-8","data-testid":"container_device-os-info"},Ee.createElement(Bv,null,Ee.createElement("div",{className:`${u.background} ${d.scroll} ${JU} ${u.scrollbar} p-[3cqw]`,style:{aspectRatio:t.screenWidth/t.screenHeight},"data-testid":"list_device-apps"},n.length===0?Ee.createElement("p",{className:`text-[length:5.5cqw] ${u.text} flex h-full w-full items-center justify-center opacity-60`},"No apps installed"):Ee.createElement("div",{className:d.list},n.map(p=>Ee.createElement("button",{key:p.name,type:"button",title:`${p.name} ${p.version}`,disabled:!r||o!==void 0,onClick:()=>l(p.name),className:`${u.text} ${d.tile} flex flex-col items-center gap-[1.5cqw] border-0 bg-transparent px-[1.5cqw] disabled:cursor-default enabled:cursor-pointer`,"data-testid":`button_open-app-${p.name}`},Ee.createElement(H1,{name:p.name}),Ee.createElement("span",{className:"w-full truncate text-center text-[length:4.7cqw] leading-[1.3]"},p.name))))),o!==void 0?Ee.createElement("div",{className:`${u.text} ${u.overlay} ${d.opening} pointer-events-none absolute inset-0 flex items-center justify-center gap-[3cqw] backdrop-blur-[1cqw]`,"data-testid":"spinner_opening-app-screen"},Ee.createElement("div",{className:"relative flex size-[18cqw] shrink-0 items-center justify-center"},Ee.createElement("span",{className:"absolute inset-0 rounded-full border-[0.8cqw] border-current opacity-15"}),Ee.createElement("span",{className:"absolute inset-0 animate-spin rounded-full border-[0.8cqw] border-transparent border-t-current"}),Ee.createElement(H1,{name:o})),Ee.createElement("span",{className:"animate-pulse text-[length:4.7cqw] font-semibold"},"Opening ",o)):null),a?Ee.createElement("p",{className:"body-4 text-error text-center"},a):null)},e7=[{button:"left",label:"Left"},{button:"both",label:"Both"},{button:"right",label:"Right"}],q1=e=>e===" "||e==="Enter",t7=({onPress:e})=>{const{hold:t,release:r}=PU(e);return Ee.createElement("div",{className:"flex gap-8"},e7.map(({button:n,label:o})=>Ee.createElement("button",{key:n,type:"button","aria-label":`${o} button`,onPointerDown:a=>{a.button===0&&(a.currentTarget.setPointerCapture(a.pointerId),t(n))},onPointerUp:r,onPointerCancel:r,onKeyDown:a=>{q1(a.key)&&(a.preventDefault(),t(n))},onKeyUp:a=>q1(a.key)&&r(),className:"border-muted body-3 text-base bg-muted hover:bg-muted-pressed active:bg-active flex-1 rounded-md border py-8 select-none",style:{touchAction:"none"},"data-testid":`button_device-screen-${n}`},o)))},r7=({src:e,onTouch:t})=>{const r=x.useRef(null),[n,o]=x.useState(!1),a=YU(t);x.useEffect(()=>o(!1),[e]);const l=p=>{const h=r.current;if(!t||!h||p.button!==0)return;const m=h.getBoundingClientRect(),y=XU(p.clientX-m.left,p.clientY-m.top,m,{width:h.naturalWidth,height:h.naturalHeight});y&&a.hold(y)&&h.setPointerCapture(p.pointerId)},u=p=>{a.release()&&r.current?.releasePointerCapture(p.pointerId)},d=x.useCallback(()=>o(!0),[]);return n?Ee.createElement("p",{className:"body-4 text-error text-center","data-testid":"text_device-screen-undecodable"},"Screenshot could not be decoded"):Ee.createElement(Bv,null,Ee.createElement("img",{ref:r,src:e,alt:"Device screen",draggable:!1,onError:d,onPointerDown:l,onPointerUp:u,onPointerCancel:u,className:`block w-full bg-black select-none ${t?"cursor-pointer":""}`,style:{imageRendering:"pixelated",touchAction:"none"},"data-testid":"image_device-screen"}))},n7={toImageSource:e=>Promise.resolve(URL.createObjectURL(e)),releaseImageSource:e=>URL.revokeObjectURL(e),isHidden:()=>document.hidden},wm=16,i7=224,o7=200,G1=(e,t,r)=>{const n=(o,a)=>Math.min(Math.max(o,0),Math.max(a,0));return{left:n(e,window.innerWidth-r.width),top:n(t,window.innerHeight-r.height)}},s7=(e,t)=>t?`${e} - ${t}`:e,a7=({api:e,deviceType:t,firmwareVersion:r,floating:n=!1,defaultCollapsed:o=!1})=>{const a=QU(t),[l,u]=x.useState(o),d=GU(e,!n||!l,n7);return n?Ee.createElement(l7,{title:s7(a.label,r),model:a,collapsed:l,onToggle:()=>u(p=>!p)},X1(d,a,e)):Ee.createElement("div",{className:"mx-auto flex w-full max-w-[420px] flex-col gap-8","data-testid":"container_device-screen"},X1(d,a,e))},l7=({title:e,model:t,collapsed:r,onToggle:n,children:o})=>{const a=x.useRef(null),[l,u]=x.useState(),[d,p]=x.useState(i7),h=x.useRef(null),m=x.useRef(null);x.useEffect(()=>{const k=()=>{const $=a.current?.getBoundingClientRect();$&&u(A=>A&&G1(A.left,A.top,$))};return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const y=k=>{const $=a.current?.getBoundingClientRect();!$||k.button!==0||k.target.closest("button")||(k.currentTarget.setPointerCapture(k.pointerId),h.current={dx:k.clientX-$.left,dy:k.clientY-$.top})},w=k=>{const $=a.current?.getBoundingClientRect();!h.current||!$||u(G1(k.clientX-h.current.dx,k.clientY-h.current.dy,$))},E=()=>{h.current=null},S=k=>{const $=a.current?.getBoundingClientRect();!$||k.button!==0||(k.currentTarget.setPointerCapture(k.pointerId),u({left:$.left,top:$.top}),m.current={x:k.clientX,width:$.width})},C=k=>{const $=a.current?.getBoundingClientRect();if(!m.current||!$)return;const A=m.current.width+k.clientX-m.current.x,D=window.innerWidth-$.left-wm;p(Math.max(o7,Math.min(A,D)))},R=()=>{m.current=null};return Ee.createElement("div",{ref:a,className:"bg-base border-muted fixed flex max-w-[calc(100vw-32px)] flex-col rounded-lg border shadow-lg",style:{zIndex:1e3,width:d,...l??{right:wm,bottom:wm}},"data-testid":"container_device-screen"},Ee.createElement("div",{className:"flex cursor-move items-center gap-8 px-12 py-8 select-none",style:{touchAction:"none"},onPointerDown:y,onPointerMove:w,onPointerUp:E,onPointerCancel:E},Ee.createElement(t.icon,{size:16}),Ee.createElement("span",{className:"body-3-semi-bold text-base flex-1"},e),Ee.createElement(sr,{appearance:"no-background",size:"xs",icon:r?Od:zs,"aria-label":r?"Expand device screen":"Collapse device screen",onClick:n,"data-testid":"button_toggle-device-screen"})),r?null:Ee.createElement(Ee.Fragment,null,Ee.createElement("div",{className:"flex flex-col gap-8 px-12 pb-12"},o),Ee.createElement("div",{className:"group absolute top-0 right-[-6px] bottom-0 flex w-[12px] cursor-ew-resize items-center justify-center",style:{touchAction:"none"},onPointerDown:S,onPointerMove:C,onPointerUp:R,onPointerCancel:R,"aria-hidden":!0,"data-testid":"handle_resize-device-screen"},Ee.createElement("span",{className:"border-muted bg-base group-hover:bg-muted group-active:bg-muted h-40 w-[6px] rounded-full border transition-colors"}))))};function X1(e,t,r){switch(e.kind){case"loading":return Ee.createElement(Bv,null,Ee.createElement("div",{className:`${t.lightScreen?"bg-white text-black":"bg-black text-white"} flex items-center justify-center`,style:{aspectRatio:t.screenWidth/t.screenHeight},"data-testid":"placeholder_device-screen-loading"},Ee.createElement("span",{className:"animate-pulse opacity-60"},Ee.createElement(t.icon,{size:32}))));case"error":return Ee.createElement(ng,{appearance:"error",title:"Screen unavailable",description:e.message});case"os-info":return Ee.createElement(Ee.Fragment,null,Ee.createElement(ZU,{device:e.device,model:t,onOpenApp:t.speculos?r.openApp:void 0}),t.speculos?null:Ee.createElement(ng,{appearance:"info",title:"No screen to capture",description:`Speculos has no emulator for the ${t.label}, so this device is mocked all the way through and has no screen.`,"data-testid":"banner_device-screen-no-emulator"}));case"image":return Ee.createElement(Ee.Fragment,null,Ee.createElement(r7,{src:e.src,onTouch:t.touch?e.input.touch:void 0}),t.touch?null:Ee.createElement(t7,{onPress:e.input.pressButton}))}}const Sm=Ft.interface({id:ut,prefix:ut,responses:Yr(ut)}),c7=Ft.interface({prefix:ut,response:Yt(ut),responses:Yt(Yr(ut))}),k_=Ft.interface({name:ut,version:ut,hash:Yt(ut)}),u7=Ft.interface({hash:ut,name:ut,version:ut}),Is=Ft.interface({id:ut,name:ut,device_type:ut,connectivity_type:ut,firmware_version:Yt(ut),apps:Yt(Yr(k_)),masks:Yt(Yr(Mo)),connected:Yt(vd),onboarded:Yt(vd),language:Yt(ut)}),d7=Ft.interface({name:Yt(ut),device_type:Yt(ut),connectivity_type:Yt(ut),firmware_version:Yt(ut),apps:Yt(Yr(k_)),masks:Yt(Yr(Mo)),mocks:Yt(Yr(c7)),catalog:Yt(Yr(u7)),onboarded:Yt(vd),language:Yt(ut)}),f7=Ft.interface({token:ut,expires_at:Mo}),p7=Ft.interface({device:Is,connected:vd}),h7=Ft.interface({response:ut}),m7=Ft.interface({status:ut,sessions:Mo}),g7=Ft.interface({id:ut,created_at:Mo,expires_at:Mo,devices:Yr(Is)}),Y1=Ft.interface({devices:Yr(d7)}),v7=Ft.interface({run_id:ut,speculos_url:ut,model:ut});let y7=class{client;timeoutMs;token;authPromise;constructor(t,r={}){this.client=r.httpClient??new l_({baseUrl:this.normalizeUrl(t)}),this.token=r.token,this.timeoutMs=r.timeoutMs}async getHealth(){const t=await this.client.get("health",this.requestConfig());return this.decode(m7,t)}async authenticate(){const t=await this.client.post("auth",{},this.requestConfig()),r=this.decode(f7,t).token;return this.token=r,r}getToken(){return this.token}async listDevices(){const t=await this.client.get("devices",await this.authRequestConfig());return this.decode(Yr(Is),t)}async addDevice(t={}){const r=await this.client.post("devices",t,await this.authRequestConfig());return this.decode(Is,r)}async getDevice(t){const r=await this.client.get(`devices/${t}`,await this.authRequestConfig());return this.decode(Is,r)}async editDevice(t,r){const n=await this.client.patch(`devices/${t}`,r,await this.authRequestConfig());return this.decode(Is,n)}async deleteDevice(t){return await this.client.delete(`devices/${t}`,await this.authRequestConfig()),!0}async connect(t){const r=await this.client.post(`devices/${t}/connect`,{},await this.authRequestConfig());return this.decode(p7,r)}async disconnect(t){return await this.client.post(`devices/${t}/disconnect`,{},await this.authRequestConfig()),!0}async disconnectAll(){const t=await this.listDevices();return await Promise.all(t.filter(r=>r.connected).map(r=>this.disconnect(r.id))),!0}async sendApdu(t,r){const n=typeof r=="string"?r:si(r,!1),o=await this.client.post(`devices/${t}/apdu`,{apdu:n},await this.authRequestConfig());return this.decode(h7,o)}async listMocks(t){const r=await this.client.get(`devices/${t}/mocks`,await this.authRequestConfig());return this.decode(Yr(Sm),r)}async addMock(t,r){const n=await this.client.post(`devices/${t}/mocks`,r,await this.authRequestConfig());return this.decode(Sm,n)}async editMock(t,r,n){const o=await this.client.patch(`devices/${t}/mocks/${r}`,n,await this.authRequestConfig());return this.decode(Sm,o)}async deleteMock(t,r){return await this.client.delete(`devices/${t}/mocks/${r}`,await this.authRequestConfig()),!0}async clearMocks(t){return await this.client.delete(`devices/${t}/mocks`,await this.authRequestConfig()),!0}async getSpeculos(t){const r=await this.client.get(`devices/${t}/speculos`,await this.authRequestConfig());return this.decode(v7,r)}async getScreenshot(t){return await this.client.get(`devices/${t}/speculos/screenshot`,{...await this.authRequestConfig(),responseType:"blob"})}async pressButton(t,r,n="press-and-release"){await this.client.post(`devices/${t}/speculos/button/${r}`,{action:n},await this.authRequestConfig())}async touchScreen(t,r,n,o="press-and-release"){await this.client.post(`devices/${t}/speculos/finger`,{action:o,x:r,y:n},await this.authRequestConfig())}async getSession(){const t=await this.client.get("sessions/current",await this.authRequestConfig());return this.decode(g7,t)}async setSeed(t){await this.client.put("sessions/current/seed",{seed:t},await this.authRequestConfig())}async disposeSession(){return await this.client.delete("sessions/current",await this.authRequestConfig()),this.token=void 0,this.authPromise=void 0,!0}async exportSession(){const t=await this.client.get("export",await this.authRequestConfig());return this.decode(Y1,t)}async importSession(t){const r=await this.client.post("import",t,await this.authRequestConfig());return this.decode(Y1,r)}decode(t,r){return t.decode(r).caseOf({Left:n=>{throw new Error(`MockClient: invalid server response (${n})`)},Right:n=>n})}requestConfig(){return{timeoutMs:this.timeoutMs}}async authRequestConfig(){const t=await this.ensureToken();return{...this.requestConfig(),headers:{Authorization:`Bearer ${t}`}}}ensureToken(){return this.token?Promise.resolve(this.token):(this.authPromise||(this.authPromise=this.authenticate()),this.authPromise)}normalizeUrl(t){return t.endsWith("/")?t:`${t}/`}};const b7=({url:e,token:t,deviceId:r,...n})=>{const o=x.useMemo(()=>new y7(e,{token:t}),[e,t]),a=x.useMemo(()=>OU(o,r),[o,r]),l=jU(o,r);return l===void 0?null:Ee.createElement(a7,{api:a,deviceType:l?.device_type??"",firmwareVersion:l?.firmware_version,...n})},x7=({mockServer:e,rewriteUrl:t,deviceId:r})=>v.jsx(Dv,{name:"live-screen",defaultWidth:320,minWidth:240,maxWidth:640,edge:"left",className:"border-l border-muted-subtle bg-surface",children:v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-16 overflow-auto p-16",children:[v.jsx("span",{className:"body-4-semi-bold text-muted uppercase",children:"Live screen"}),e?.sessionToken?v.jsx(b7,{url:t?t(e.url):e.url,token:e.sessionToken,deviceId:r}):v.jsx("p",{className:"rounded-lg border border-dashed border-muted-subtle p-24 text-center body-3 text-muted",children:e?"The app shares its mock server without a session token, so the device screen cannot be reached.":"Pass mockServer to DevToolsDmkInspector to see the device screen."})]})}),w7=`import { DevToolsDmkInspector } from "@ledgerhq/device-management-kit-devtools-core";
41
+ `)});continue}const u=a.match(/^#{1,4}\s+(.*)/);if(u)t.push({title:u[1].trim(),blocks:[]});else if(/^\s*[-*]\s+/.test(a)){const d=[];for(;n<r.length&&/^\s*[-*]\s+/.test(r[n]);)d.push(r[n].replace(/^\s*[-*]\s+/,"")),n++;o().blocks.push({kind:"list",items:d});continue}else if(a.trim()){const d=[a];for(;n+1<r.length&&r[n+1].trim()&&!/^(#|```|\s*[-*]\s)/.test(r[n+1]);)n++,d.push(r[n]);o().blocks.push({kind:"paragraph",text:d.join(" ")})}n++}return t.filter(a=>a.title!==null||a.blocks.length>0)},D1=({text:e})=>v.jsx(v.Fragment,{children:e.split(/(\*\*[^*]+\*\*|`[^`]+`|https?:\/\/[^\s)]+)/).map((t,r)=>t.startsWith("http")?v.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-active underline",children:t},r):t.startsWith("**")&&t.endsWith("**")?v.jsx("strong",{children:t.slice(2,-2)},r):t.startsWith("`")&&t.endsWith("`")?v.jsx("code",{className:"font-mono! body-4",children:t.slice(1,-1)},r):t)}),V8=/\b(?!9000\b)[5-6][0-9a-f]{3}\b/i,W8=({line:e})=>{const t=e.match(/^\s*(App|Device)\s*->\s*(?:App|Device)\s*:\s*(.*)$/i),r=t?.[1]?.toLowerCase()==="app",n=t?.[2]??e;return v.jsxs("li",{className:`flex gap-8 font-mono! body-4 ${r?"":"pl-24"} ${V8.test(n)&&!r?"text-error":""}`,children:[v.jsx("span",{className:"shrink-0 text-muted",children:r?"App →":"← Device"}),v.jsx("span",{className:"min-w-0 break-words",children:n})]})},H8=({block:e})=>{switch(e.kind){case"paragraph":return v.jsx("p",{className:"body-3",children:v.jsx(D1,{text:e.text})});case"list":return v.jsx("ul",{className:"flex list-disc flex-col gap-4 pl-16 body-3",children:e.items.map((t,r)=>v.jsx("li",{children:v.jsx(D1,{text:t})},r))});case"sequence":return v.jsx("ol",{className:"flex flex-col gap-4 rounded-sm bg-muted px-12 py-8",children:e.lines.map((t,r)=>v.jsx(W8,{line:t},r))});case"code":return v.jsx("pre",{className:"overflow-x-auto rounded-sm bg-muted px-12 py-8 font-mono! body-4",children:e.text})}},q8=({markdown:e})=>v.jsx("div",{className:"flex flex-col gap-16",children:U8(e).map((t,r)=>{const n=t.blocks[0]?.kind==="paragraph"?t.blocks[0].text:"",o=t.title?.toLowerCase()==="result",a=/^\**failed/i.test(n);return v.jsxs("section",{className:`flex flex-col gap-8 ${o?"rounded-sm bg-muted px-12 py-10":""}`,children:[t.title&&v.jsxs("h3",{className:`flex items-center gap-8 ${B8}`,children:[o&&v.jsx("span",{className:`size-8 rounded-full ${a?"bg-(--color-light-red-500)":"bg-(--color-light-green-500)"}`}),t.title]}),t.blocks.map((l,u)=>v.jsx(H8,{block:l},u))]},r)})}),Ts="<redacted>",m_=String.raw`\b([A-Za-z0-9_-]*(?:token|secret|password|passphrase|api[_-]?key|private[_-]?key|seed|mnemonic)[A-Za-z0-9_-]*|authorization)`,G8=new RegExp(String.raw`${m_}(\\?["']?\s*[:=]\s*)(\\?["'])`,"gi"),X8=(e,t,r)=>{for(let n=t;n<e.length;n++){if(e.startsWith(r,n))return n;e[n]==="\\"&&n++}return-1},Y8=e=>{let t="",r=0;for(const n of e.matchAll(G8)){const o=n.index+n[0].length;if(n.index<r)continue;const a=X8(e,o,n[3]);a<0||(t+=e.slice(r,o)+Ts,r=a)}return t+e.slice(r)},j1=(e,t)=>Y8(t.reduce((r,n)=>r.replaceAll(n,Ts),e)).replace(/\b(authorization\s*:\s*)(?!<redacted>)[^\r\n"']+/gi,`$1${Ts}`).replace(/\b(bearer\s+)(?!<redacted>)[^\s"',;\\]+/gi,`$1${Ts}`).replace(/\b(basic\s+)(?!<redacted>)[A-Za-z0-9+/]{8,}={0,2}/gi,`$1${Ts}`).replace(new RegExp(String.raw`${m_}(["']?\s*[:=]\s*)(?!<redacted>|\\?["'])[^\s"',;&\\]+`,"gi"),`$1$2${Ts}`),K8=(e,t)=>{switch(e.kind){case"explain":return{...e,context:j1(e.context,t)};case"followUp":return{...e,question:j1(e.question,t)};case"createTicket":return e}},Q8="body-4-semi-bold text-muted uppercase",bm="cursor-pointer rounded-sm bg-muted-transparent px-12 py-6 body-3-semi-bold hover:bg-muted-transparent-hover",Lu="cursor-pointer rounded-sm bg-accent px-12 py-6 body-3-semi-bold text-on-accent hover:bg-accent-hover",M1=({selected:e,disabled:t,onClick:r,children:n})=>v.jsx("button",{type:"button","aria-pressed":e,disabled:t,onClick:r,className:`cursor-pointer rounded-sm px-10 py-4 body-4 disabled:cursor-default disabled:opacity-50 ${e?"bg-active-subtle body-4-semi-bold text-active":"bg-muted-transparent text-muted hover:bg-muted-transparent-hover"}`,children:n}),xm=({title:e,children:t})=>v.jsxs("div",{className:"flex flex-col gap-12 p-16",children:[v.jsx("h3",{className:"heading-5-semi-bold",children:e}),t]}),J8=({turn:e,running:t})=>v.jsxs("div",{className:"flex flex-col gap-12",children:[e.question&&v.jsx("p",{className:"self-end rounded-sm bg-muted px-12 py-8 body-3",children:e.question}),e.steps.length>0&&v.jsx("ul",{className:"flex flex-col gap-4 body-4 text-muted",children:e.steps.map((r,n)=>v.jsxs("li",{className:"flex items-center gap-8",children:[t&&n===e.steps.length-1?v.jsx(yl,{size:12}):v.jsx(Pd,{size:12}),r]},n))}),e.answer!==null?v.jsx(q8,{markdown:e.answer}):e.text&&v.jsx("p",{className:"body-3 whitespace-pre-wrap",children:e.text}),t&&e.steps.length===0&&!e.text&&v.jsxs("p",{className:"flex items-center gap-8 body-3 text-muted",children:[v.jsx(yl,{size:16}),"Starting Claude Code…"]}),e.error&&v.jsxs("div",{className:"flex flex-col gap-4 rounded-sm bg-muted px-12 py-10",children:[v.jsx("span",{className:"body-3-semi-bold text-error",children:"Claude stopped before finishing"}),v.jsx("span",{className:"font-mono! body-4 break-words text-muted",children:e.error})]})]}),Z8=({ai:e,request:t,secrets:r})=>{const[n,o]=x.useState(null),[a,l]=x.useState(!1),[u,d]=x.useState([]),[p,h]=x.useState(null),[m,y]=x.useState(!1),[w,E]=x.useState(""),S=x.useRef(null),C=x.useRef(null),R=x.useCallback((O=!1)=>{e&&(o(null),e.status(O).then(o).catch(L=>o({ready:!1,error:String(L)})))},[e]);x.useEffect(()=>R(),[R]);const k=()=>{e?.status(!0).then(o).catch(()=>{})};x.useEffect(()=>()=>S.current?.(),[]);const $=O=>d(L=>[...L.slice(0,-1),O(L.at(-1))]),A=x.useCallback((O,L,U)=>{if(!e)return;S.current?.();const z={question:L,steps:[],text:"",answer:null,verdict:void 0,ticket:void 0,createsTicket:!1,error:null};d(T=>U?[z]:[...T,z]),U&&h(null),y(!0),C.current={aiRequest:O,turnQuestion:L},S.current=e.analyze(K8(O,r),T=>{switch(T.type){case"step":$(M=>({...M,steps:[...M.steps,T.text],createsTicket:M.createsTicket||T.createsTicket===!0}));break;case"text":$(M=>({...M,text:M.text+T.text}));break;case"done":$(M=>({...M,answer:T.answer,verdict:T.verdict,ticket:T.ticket})),h(T.sessionId),y(!1),S.current=null;break;case"error":$(M=>({...M,error:T.message})),y(!1),S.current=null;break}})},[e,r]),D=x.useRef(null),N=x.useCallback(O=>{D.current=O,A({kind:"explain",context:O.context,summary:O.summary,readCode:a},null,!0)},[A,a]),P=n?.ready===!0;x.useEffect(()=>{t&&P&&D.current?.id!==t.id&&N(t)},[t,P,N]);const I=()=>{const O=C.current;if(!O||O.aiRequest.kind==="explain"){N(D.current);return}d(L=>L.slice(0,-1)),A(O.aiRequest,O.turnQuestion,!1)},re=()=>{S.current?.(),S.current=null,y(!1),$(O=>({...O,error:O.answer===null?"Stopped.":null}))},Z=[...u].reverse().find(O=>O.verdict)?.verdict==="bug",ee=u.find(O=>O.ticket)?.ticket,ne=u.some((O,L)=>O.createsTicket&&O.answer===null&&!(m&&L===u.length-1)),X=n?.ready===!0&&n.canCreateTickets,F=()=>{p&&A({kind:"createTicket",sessionId:p},"Create a Jira ticket",!1)},V=()=>{const O=w.trim();!O||!p||(E(""),A({kind:"followUp",sessionId:p,question:O,readCode:a},O,!1))},H=e?n===null?v.jsxs("p",{className:"flex items-center gap-8 p-16 body-3 text-muted",children:[v.jsx(yl,{size:16}),"Checking Claude Code…"]}):n.ready?u.length===0?v.jsxs(xm,{title:"Select logs or APDUs, then press Explain with AI",children:[v.jsx("p",{className:"body-3 text-muted",children:"Claude explains what happened and why, step by step, and draws the exchange between the app and the device."}),v.jsx("span",{className:Q8,children:"Skills it uses"}),v.jsx("div",{className:"flex flex-wrap gap-6",children:n.skills.map(O=>v.jsx("span",{className:"rounded-sm bg-muted-transparent px-8 py-2 font-mono! body-4 text-muted",children:O},O))})]}):v.jsxs("div",{className:"flex flex-col gap-20 p-16",children:[u.map((O,L)=>v.jsx(J8,{turn:O,running:m&&L===u.length-1},L)),!m&&u.at(-1)?.error&&D.current&&v.jsx("button",{type:"button",className:`self-start ${Lu}`,onClick:I,children:"Retry"})]}):v.jsxs(xm,{title:"Sign in to Claude Code to use AI debugging",children:[v.jsx("p",{className:"body-3 text-muted",children:"The DevTools uses the Claude Code login on this computer. Nothing is sent until you press Explain with AI."}),v.jsx("span",{className:"body-3",children:"1. Install Claude Code"}),v.jsx("code",{className:"rounded-sm bg-muted px-10 py-6 font-mono! body-4",children:"npm install -g @anthropic-ai/claude-code"}),v.jsx("span",{className:"body-3",children:"2. Run it once to sign in"}),v.jsx("code",{className:"rounded-sm bg-muted px-10 py-6 font-mono! body-4",children:"claude"}),v.jsx("span",{className:"font-mono! body-4 break-words text-muted",children:n.error}),v.jsx("button",{type:"button",className:`self-start ${Lu}`,onClick:()=>R(!0),children:"Check again"})]}):v.jsx(xm,{title:"AI debugging needs the DevTools desktop app",children:v.jsx("p",{className:"body-3 text-muted",children:"It runs Claude Code on your computer, which this panel cannot do. Open the same session in the desktop DevTools."})});return v.jsx(Dv,{name:"ai",defaultWidth:400,minWidth:320,maxWidth:800,edge:"left",className:"border-l border-muted-subtle bg-surface",children:v.jsxs("aside",{className:"flex min-h-0 flex-1 flex-col",children:[v.jsxs("div",{className:"flex items-center gap-8 border-b border-muted-subtle px-16 py-12",children:[v.jsx(mv,{size:16,className:"text-active"}),v.jsx("h2",{className:"body-2-semi-bold",children:"AI debugging"}),D.current&&v.jsxs("span",{className:"truncate body-4 text-muted",children:["· ",D.current.summary]}),v.jsx("span",{className:"flex-1"}),m&&v.jsx("button",{type:"button",className:bm,onClick:re,children:"Stop"})]}),P&&v.jsxs("div",{className:"flex items-center gap-6 px-16 pt-12",children:[v.jsx(M1,{selected:!a,disabled:m,onClick:()=>l(!1),children:"Quick"}),n.canReadCode&&v.jsx(vt,{label:"Let Claude read DMK's source code to confirm the cause. Slower.",children:v.jsx(M1,{selected:a,disabled:m,onClick:()=>l(!0),children:"Read the code"})}),v.jsx("span",{className:"flex-1"}),v.jsx("span",{className:"body-4 text-muted",children:n.model})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:H}),P&&p&&v.jsxs("div",{className:"flex items-center gap-8 border-t border-muted-subtle px-16 py-12",children:[v.jsx("div",{className:`flex-1 ${Ml}`,children:v.jsx("input",{className:zl,type:"text",placeholder:"Ask a follow-up…","aria-label":"Ask a follow-up question",value:w,disabled:m,onChange:O=>E(O.target.value),onKeyDown:O=>O.key==="Enter"&&V()})}),v.jsx(vt,{label:"Ask",children:v.jsx(sr,{"aria-label":"Ask",icon:fR,size:"xs",appearance:"transparent",className:"rounded-sm [&>svg]:text-active",disabled:m||!w.trim(),onClick:V})}),ee?v.jsxs("a",{href:ee.url,target:"_blank",rel:"noreferrer",className:`whitespace-nowrap ${bm}`,children:[ee.key," ↗"]}):Z?ne?v.jsx("span",{className:"body-4 text-muted",children:"The ticket may already exist: check Jira"}):X?v.jsx("button",{type:"button",className:`whitespace-nowrap ${Lu} disabled:cursor-default disabled:opacity-50`,disabled:m,onClick:F,children:"Create Jira ticket"}):v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"Connect Atlassian in Claude (claude.ai › Settings › Connectors) to create tickets",children:v.jsx("button",{type:"button",disabled:!0,className:`cursor-default whitespace-nowrap opacity-50 ${Lu}`,children:"Create Jira ticket"})}),v.jsx("button",{type:"button",className:`whitespace-nowrap ${bm}`,onClick:k,children:"Check again"})]}):null]})]})})},g_=({title:e,description:t,codeExample:r})=>v.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-16 overflow-auto p-24",children:[v.jsx(ZD,{appearance:"muted",icon:b5,size:56}),v.jsx("h3",{className:"heading-4-semi-bold",children:e}),v.jsx("p",{className:"max-w-480 text-center body-2 text-muted",children:t}),v.jsx("pre",{className:"max-w-full overflow-auto rounded-md bg-muted p-16 font-mono! body-3",children:r})]}),eU={b001:"getAppAndVersion",b006:"loadCertificate",b010:"editExternalAddressIdentifier / editExternalAddressScope / provideContact / registerIdentity",b0a7:"closeApp"},tU={e001:"getOsVersion",e010:"getBatteryStatus",e02e:"renameContact",e033:"deleteLanguagePack",e034:"listLanguagePack",e060:"createBackgroundImage",e061:"uploadBackgroundImageChunk",e062:"commitBackgroundImage",e063:"deleteBackgroundImage",e064:"getBackgroundImageSize",e065:"fetchBackgroundImageChunk",e066:"getBackgroundImageHash",e06a:"GetAppStorageInfo",e06b:"BackupAppStorage",e06c:"InitRestoreAppStorage",e06d:"RestoreAppStorage",e06e:"CommitRestoreAppStorage",e06f:"RequestMasterConsent",e0d8:"openApp",e0de:"listApps",e0df:"listApps"},rU={Aleo:{e003:"GetAppConfig",e005:"getAddress",e006:"signFeeIntent / signNestedCall / signRootIntent",e007:"getViewKey",e008:"getTvk"},Bitcoin:{e100:"getExtendedPublicKey",e102:"registerWalletAddress",e103:"getWalletAddress",e104:"signPsbt",e105:"getMasterFingerprint",e110:"signMessage",f801:"continue"},"Bitcoin Cash":{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},"Bitcoin Gold":{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Concordium:{e000:"VerifyAddress",e001:"GetPublicKey",e002:"SignTransfer",e004:"SignCredentialDeployment",e022:"SetTrustedName",e023:"GetChallenge",e027:"SignPlt",e032:"SignTransferWithMemo",e040:"GetAppConfig"},Cosmos:{5500:"GetAppConfig",5502:"SignTransaction",5504:"GetAddress"},Dogecoin:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Ethereum:{e002:"getAddress",e004:"signTransaction / startTransaction / storeTransaction",e006:"getAppConfiguration",e008:"signPersonalMessage",e00a:"provideTokenInformation",e00c:"signEIP712",e012:"setExternalPlugin",e014:"provideNFTInformation",e016:"setPlugin",e01a:"sendEIP712StructDefinition",e01c:"sendEIP712StructImplem",e01e:"sendEIP712Filtering",e020:"getChallenge",e022:"provideTrustedName",e024:"provideEnum",e026:"provideTransactionInformation",e028:"provideTransactionFieldDescription",e02a:"provideProxyInfo",e030:"provideNetworkConfiguration",e032:"provideWeb3Check / web3CheckOptIn",e034:"signEIP7702Authorization",e036:"provideSafeAccount",e038:"provideGatedSigning"},Horizen:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Hyperliquid:{e002:"sendMetadata",e003:"sendAction",e004:"signActions"},InternetComputer:{1100:"GetVersion",1101:"GetAddress",1102:"SignTransaction",1103:"SignUpdateCall"},"Ledger Sync":{e003:"getAppName / getVersion",e005:"getSeedId",e006:"init",e007:"signBlockSignature / signBlockSingle",e008:"parseBlockSignature / parseSingle",e009:"setTrustedMember"},Litecoin:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction",e04a:"HashOutputFull / ProvideOutputFullChangePath"},Polkadot:{f901:"GetAddress",f902:"SignTransaction"},Solana:{e004:"getAppConfiguration",e005:"getPubKey",e006:"signTransaction",e007:"signOffChainMessage",e008:"signTransactionPreview",e009:"delayedSignTransaction",e00a:"signMessageGenericPreview",e00b:"promptUiDisplay",e00c:"finalizeGenericClearSign",e016:"ProvideInstructionDescriptor",e020:"getChallenge",e021:"provideTLVDescriptor",e022:"ProvideTLVTransactionInstructionDescriptor",e023:"provideTransactionCheck / transactionCheckOptIn",e024:"provideInstructionInfo",e025:"provideInstructionSubstructure",e026:"provideEnumVariant",e027:"provideTokenAccountState",e028:"provideAltResolution",e029:"provideTrustedName"},Tron:{e002:"GetAddress",e004:"signTransaction",e005:"signTransactionHash",e006:"GetAppConfiguration",e008:"signPersonalMessage",e00a:"GetECDHSecret"},XRP:{e002:"GetAddress",e004:"SignTransaction",e006:"GetAppConfig"},Zcash:{e040:"GetAddress",e042:"GetTrustedInput",e044:"StartUntrustedHashTransactionInput",e048:"SignTransaction / ZcashSaplingOutputCommit",e04a:"HashOutputFull / ProvideOutputFullChangePath",e050:"GetFullViewingKey",e051:"GetShieldedAddress",e052:"PcztHeader",e053:"PcztTransparentInput",e054:"PcztTransparentOutput",e055:"SignPcztTransparent",e056:"PcztOrchardAction",e057:"SignPcztOrchard",e058:"PcztIronwoodAction",e059:"SignPcztIronwood",e0c4:"getAppConfig"}},nU={9e3:"OK",5501:"Refused",5502:"PIN not set",5515:"Locked",6807:"App not found",6985:"Refused","6d00":"INS not supported","6e00":"CLA not supported"},jv=e=>nU[e]??"",z1=e=>e.toLowerCase().match(/.{1,2}/g)??[],v_="OS",F1=e=>String.fromCharCode(...e.map(t=>parseInt(t,16))),iU=(e,t)=>{if(t.startsWith("b0"))return eU[t];if(e!==void 0)return Ov(e)?tU[t]:rU[e]?.[t]},oU=(e,t)=>t.startsWith("b0")||e!==void 0&&Ov(e)?v_:e,sU=(e,t,r,n)=>t==="b001"&&n[0]==="01"?F1(n.slice(2,2+parseInt(n[1]??"0",16))):t==="b0a7"?"BOLOS":t==="e0d8"&&(e===void 0||Ov(e))?F1(r.slice(5)):e,aU=e=>typeof e=="object"&&e!==null&&e.type==="apdu-exchange"&&typeof e.sessionId=="string"&&typeof e.apdu=="string"&&typeof e.response=="string",B1=new WeakMap;let lU=0;const cU=e=>{const t=new Map;return e.flatMap(r=>{if(!aU(r.payload))return[];const n=B1.get(r);if(n)return t.set(n.exchange.sessionId,n.openApp),[n.exchange];const{sessionId:o}=r.payload,a=z1(r.payload.apdu),l=z1(r.payload.response),u=l.slice(-2).join(""),d=a.slice(0,2).join(""),p=t.get(o),h=u==="9000"?sU(p,d,a,l.slice(0,-2)):p;t.set(o,h);const m={id:String(lU++),timestamp:r.timestamp,sessionId:o,layer:oU(p,d),command:iU(p,d)??a.slice(0,2).join(" "),sent:a,received:l,statusWord:u};return B1.set(r,{exchange:m,openApp:h}),[m]})},y_=(e,t,r,n,o)=>{const a=x.useRef(null),l=x.useRef(!1),u=x.useRef(e);u.current=e;const d=x.useRef(t);d.current=t;const p=x.useRef(r);p.current=r;const h=x.useRef(n);h.current=n;const m=x.useRef(o);m.current=o,x.useEffect(()=>{const E=()=>{const C=a.current;C?.moved&&(document.body.style.userSelect="",l.current=!0,m.current(C.last)),a.current=null},S=C=>{l.current&&(l.current=!1,C.stopPropagation(),C.preventDefault())};return window.addEventListener("mouseup",E),window.addEventListener("click",S,!0),()=>{window.removeEventListener("mouseup",E),window.removeEventListener("click",S,!0)}},[]);const y=x.useCallback((E,S)=>{const C=u.current(E);S.button!==0||S.shiftKey||C===void 0||(l.current=!1,a.current={anchor:C,last:C,adding:!p.current.has(C),base:new Set(p.current),moved:!1})},[]),w=x.useCallback(E=>{const S=a.current,C=u.current(E);if(!S||C===void 0||C===S.anchor&&!S.moved)return;const R=d.current(S.anchor);if(R<0)return;S.last=C,S.moved||(S.moved=!0,window.getSelection()?.removeAllRanges(),document.body.style.userSelect="none");const k=new Set(S.base);for(let $=Math.min(R,E);$<=Math.max(R,E);$++){const A=u.current($);A!==void 0&&(S.adding?k.add(A):k.delete(A))}h.current(k)},[]);return{onRowMouseDown:y,onRowMouseEnter:w}};function Mv(e){const t=e.trim();if(!t)return[];const r=[],n=/(-?)\/([^/]+)\/|(\S+)/g;let o;for(;(o=n.exec(t))!==null;)if(o[2]!==void 0){const a=o[1]==="-",l=o[2];try{const u=new RegExp(l,"i");r.push({type:"regex",pattern:u,exclude:a})}catch{const u=o[0],d=u.startsWith("-"),p=d?u.slice(1):u;p&&r.push({type:"keyword",value:p.toLowerCase(),exclude:d})}}else if(o[3]!==void 0){const a=o[3],l=a.startsWith("-"),u=l?a.slice(1):a;u&&r.push({type:"keyword",value:u.toLowerCase(),exclude:l})}return r}function uU(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return""}}function dU(e){return[e.tag,e.message,uU(e.payload)].join(" ")}function U1(e,t){return e.type==="keyword"?t.toLowerCase().includes(e.value):e.pattern.test(t)}function b_(e,t){if(t.length===0)return!0;const r=dU(e),n=t.filter(a=>!a.exclude),o=t.filter(a=>a.exclude);for(const a of n)if(!U1(a,r))return!1;for(const a of o)if(U1(a,r))return!1;return!0}const x_=({onClick:e,enabled:t,up:r=!1})=>v.jsx(vt,{label:"Scroll to latest logs",side:"left",className:`absolute right-16 bottom-16 transition-[opacity,visibility] duration-300 ${t?"invisible opacity-0":"visible opacity-100"}`,children:v.jsx(sr,{"aria-label":"Scroll to latest logs",icon:r?fR:p5,appearance:"accent",size:"sm",onClick:e,className:"shadow-md"})}),fU=4,w_=e=>{const t=x.useRef(null),r=x.useRef(null),[n,o]=x.useState(!0),a=x.useRef(!0),l=x.useCallback(p=>{a.current=p,o(p)},[]),u=x.useCallback(()=>{const p=t.current;p&&(p.scrollTop=p.scrollHeight)},[]);x.useLayoutEffect(()=>{e&&u()},[e,u]);const d=x.useCallback(()=>{const p=t.current;if(!p)return;const h=p.scrollHeight-p.clientHeight-p.scrollTop<=fU;h!==a.current&&l(h)},[l]);return x.useEffect(()=>{const p=r.current;if(!p||!e)return;const h=new MutationObserver(()=>{a.current&&u()});return h.observe(p,{childList:!0}),()=>h.disconnect()},[e,u]),{containerRef:t,contentRef:r,onScroll:d,atBottom:n,setAtBottom:l,scrollToBottom:u}},S_=({d:e,size:t=16,className:r})=>v.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:r,"aria-hidden":"true",children:v.jsx("path",{d:e})}),pU=e=>v.jsx(S_,{...e,d:"M5.667 3v10m4.666-10v10"}),hU=e=>v.jsx(S_,{...e,d:"M4.667 2.667v10.666L13 8z"}),E_=({paused:e,onToggle:t})=>v.jsx(vt,{label:e?"Resume incoming logs":"Pause incoming logs",side:"bottom",children:v.jsx(sr,{"aria-label":e?"Resume incoming logs":"Pause incoming logs",icon:e?hU:pU,size:"xs",appearance:"transparent",className:`rounded-sm ${e?"bg-active-subtle hover:bg-active-subtle-hover [&>svg]:text-active":""}`,onClick:t})});function V1(e,t){return e.type==="keyword"?t.toLowerCase().includes(e.value):e.pattern.test(t)}function mU(e,t){if(t.length===0)return!0;const r=t.filter(o=>!o.exclude),n=t.filter(o=>o.exclude);for(const o of r)if(!V1(o,e))return!1;for(const o of n)if(V1(o,e))return!1;return!0}const W1=({text:e,label:t})=>{const[r,n]=x.useState(!1);return v.jsx(vt,{label:t,children:v.jsx(sr,{"aria-label":t,icon:r?Pd:pR,size:"xs",appearance:"no-background",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})}})})},H1=5,Ag=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}),gU=e=>e==="9000"?{bar:"bg-(--color-light-green-500)",text:"text-success"}:e==="5515"?{bar:"bg-(--color-light-yellow-500)",text:"text-warning"}:{bar:"bg-(--color-light-red-500)",text:"text-error"},vU=e=>[e.command,e.layer,e.sent.join(" "),e.sent.join(""),e.received.join(" "),e.received.join(""),jv(e.statusWord)].join(" "),yU=e=>`[${e.timestamp}] [${e.layer??"unknown app"}] ${e.command} | => ${e.sent.join("")} | <= ${e.received.join("")}`,bU=({exchange:e,index:t,open:r,onToggle:n,selected:o,onSelect:a,onRowMouseDown:l,onRowMouseEnter:u})=>{const d=gU(e.statusWord);return v.jsxs("div",{className:`flex gap-8 px-8 py-2 ${o?"bg-active-subtle":""}`,onMouseDown:p=>l(t,p),onMouseEnter:()=>u(t),children:[v.jsx("div",{className:"flex shrink-0 pt-4",children:v.jsx(Jg,{"aria-label":"Select this APDU",checked:o,className:"size-16",onClick:p=>a(t,p.shiftKey)})}),v.jsx("span",{className:`w-4 shrink-0 rounded-full ${d.bar}`}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("button",{type:"button","aria-expanded":r,onClick:()=>n(e.id),className:"flex w-full cursor-pointer items-center gap-12 rounded-xs px-8 py-2 text-left font-mono! body-3 text-base hover:bg-base-transparent-hover",children:[v.jsx(Nd,{size:12,className:`shrink-0 text-muted transition-transform ${r?"rotate-90":""}`}),v.jsx("span",{className:"text-muted",children:Ag(e.timestamp)}),v.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-8",children:[v.jsx(bg,{size:"sm",appearance:e.layer===v_?"accent-subtle":"gray",label:e.layer??"Unknown",className:"max-w-128 shrink-0"}),v.jsx("span",{className:"truncate",children:e.command})]}),v.jsxs("span",{className:"body-4 whitespace-nowrap text-muted",children:[e.sent.length," B → ",e.received.length," B"]}),v.jsxs("span",{className:`w-128 truncate ${d.text}`,children:[e.statusWord," ",jv(e.statusWord)]})]}),r&&v.jsxs("div",{className:"my-4 flex flex-col gap-8 rounded-sm bg-muted px-12 py-8 font-mono! body-3",children:[v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsxs("span",{className:"body-4-semi-bold text-muted uppercase",children:["Sent · ",e.sent.length," B"]}),v.jsx("span",{className:"flex-1"}),v.jsx(W1,{text:e.sent.join(""),label:"Copy sent bytes"})]}),v.jsxs("p",{className:"break-all",children:[e.sent.slice(0,H1).join(" ")," ",v.jsx("span",{className:"text-muted",children:e.sent.slice(H1).join(" ")})]}),v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsxs("span",{className:"body-4-semi-bold text-muted uppercase",children:["Received · ",e.received.length," B"]}),v.jsx("span",{className:"flex-1"}),v.jsx(W1,{text:e.received.join(""),label:"Copy received bytes"})]}),v.jsx("p",{className:"break-all",children:e.received.join(" ")})]})]})]})},xU=Ee.memo(bU,(e,t)=>e.exchange.id===t.exchange.id&&e.index===t.index&&e.open===t.open&&e.onToggle===t.onToggle&&e.selected===t.selected&&e.onSelect===t.onSelect&&e.onRowMouseDown===t.onRowMouseDown&&e.onRowMouseEnter===t.onRowMouseEnter),wU=({exchanges:e,clearedUpTo:t,onClear:r,onExplain:n})=>{const[o,a]=x.useState(""),[l,u]=x.useState(null),[d,p]=x.useState(new Set),h=x.useMemo(()=>{const O=l??e;return t===void 0?O:O.filter(L=>Number(L.id)>t)},[l,e,t]),m=x.useMemo(()=>{const O=Mv(o);return O.length===0?h:h.filter(L=>mU(vU(L),O))},[h,o]),[y,w]=x.useState(new Set),E=x.useRef(m);E.current=m;const S=x.useRef(null),C=x.useCallback((O,L)=>{const U=E.current,z=U[O];if(!z)return;const T=U.findIndex(({id:M})=>M===S.current);S.current=z.id,w(M=>{const te=new Set(M);if(L&&T>=0)for(let le=Math.min(T,O);le<=Math.max(T,O);le++)te.add(U[le].id);else te.delete(z.id)||te.add(z.id);return te})},[]),{onRowMouseDown:R,onRowMouseEnter:k}=y_(O=>E.current[O]?.id,O=>E.current.findIndex(L=>L.id===O),y,w,O=>{S.current=O}),$=()=>{w(new Set),S.current=null},A=h.filter(({id:O})=>y.has(O)),D=()=>{const O=e.at(-1);O&&r(Number(O.id)),u(L=>L&&[])},N=()=>{const O=new Blob([JSON.stringify(m,null,2)],{type:"application/json"}),L=URL.createObjectURL(O),U=document.createElement("a");U.href=L,U.download=`apdu-${new Date().toISOString()}.json`,U.click(),URL.revokeObjectURL(L)},P=l!==null,{containerRef:I,contentRef:re,onScroll:Z,atBottom:ee,setAtBottom:ne,scrollToBottom:X}=w_(!P),F=x.useCallback(O=>{ne(!1),p(L=>{const U=new Set(L);return U.delete(O)||U.add(O),U})},[ne]),V=()=>{ne(!0),X()},H=h.length-m.length;return v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-x-12 gap-y-8",children:[v.jsx("div",{className:f_,children:v.jsx("div",{className:Ml,children:v.jsx("input",{className:zl,type:"text",placeholder:"Filter","aria-label":"Filter APDUs",value:o,onChange:O=>a(O.target.value)})})}),v.jsx("span",{className:"flex-1"}),v.jsxs("span",{className:"font-mono! body-4 whitespace-nowrap text-muted",children:[P&&v.jsx("span",{className:"text-warning",children:"paused · "}),h.length," ",h.length===1?"exchange":"exchanges",H>0&&` · ${H} filtered out`]}),v.jsxs("div",{className:"flex gap-6",children:[v.jsx(E_,{paused:P,onToggle:()=>u(P?null:e)}),v.jsx(vt,{label:"Clear APDUs",side:"bottom",children:v.jsx(sr,{"aria-label":"Clear APDUs",icon:yR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:D})}),v.jsx(vt,{label:"Export APDUs",side:"bottom",children:v.jsx(sr,{"aria-label":"Export APDUs",icon:hR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:N})})]})]}),v.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[v.jsx("div",{ref:I,className:"min-h-0 flex-1 overflow-auto",onScroll:Z,children:v.jsxs("div",{ref:re,children:[m.length===0?v.jsx("p",{className:"p-24 text-center body-2 text-muted",children:"No APDU exchanged yet"}):m.map((O,L)=>v.jsx(xU,{exchange:O,index:L,open:d.has(O.id),onToggle:F,selected:y.has(O.id),onSelect:C,onRowMouseDown:R,onRowMouseEnter:k},O.id)),!P&&m.length>0&&v.jsx("div",{className:`flex h-24 items-center justify-center gap-4 ${ee?"":"invisible"}`,"aria-label":ee?"Following new APDUs":void 0,children:["","[animation-delay:200ms]","[animation-delay:400ms]"].map(O=>v.jsx("span",{className:`size-4 animate-pulse rounded-full bg-muted-strong ${O}`},O))})]})}),v.jsx(x_,{enabled:ee,onClick:V})]}),A.length>0&&v.jsx(SR,{label:`${A.length} ${A.length===1?"APDU":"APDUs"} selected`,detail:`${Ag(A[0].timestamp)} → ${Ag(A.at(-1).timestamp)} · shift-click to extend`,onClear:$,onExplain:()=>n({context:A.map(yU).join(`
42
+ `),summary:`${A.length} ${A.length===1?"APDU":"APDUs"}`})})]})},Iu=(e=[])=>e.map(t=>t.toString(16).padStart(2,"0")).join(""),SU=[{label:"Get app & version",apdu:"B001000000"},{label:"Get OS version",apdu:"E001000000"}],EU=({sessionId:e,onSend:t,responses:r})=>{const[n,o]=x.useState(""),[a,l]=x.useState(null),[u,d]=x.useState(null),p=y=>{const w=y.replace(/\s/g,"").toUpperCase();if(!/^[0-9A-F]*$/.test(w)||w.length%2!==0){l("Invalid hex string (e.g., E0C4000000)");return}d(t(e,w))},h=u?r.get(u):null,m=a??(h&&!h.success?h.error:null);return v.jsxs("div",{className:"flex flex-col gap-8",children:[v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsx("span",{className:"flex-1 body-4-semi-bold text-muted uppercase",children:"APDU"}),SU.map(y=>v.jsx("button",{type:"button",onClick:()=>{o(y.apdu),l(null),p(y.apdu)},className:"cursor-pointer rounded-full bg-muted-transparent px-8 py-2 body-4 text-base hover:bg-muted-transparent-hover",children:y.label},y.apdu))]}),v.jsxs("div",{className:"flex gap-8",children:[v.jsx("div",{className:`flex-1 ${Ml}`,children:v.jsx("input",{className:zl,type:"text",placeholder:"APDU hex (e.g., E0C4000000)","aria-label":"APDU to send",value:n,onChange:y=>{o(y.target.value),l(null)},onKeyDown:y=>y.key==="Enter"&&n.trim()&&p(n)})}),v.jsx(vt,{label:"Send APDU",children:v.jsx(sr,{"aria-label":"Send APDU",icon:v5,size:"xs",appearance:"transparent",className:"rounded-sm [&>svg]:text-active",onClick:()=>p(n),disabled:!n.trim()})})]}),m&&v.jsx("p",{className:"body-3 text-error",children:m}),!m&&h?.success&&v.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-8 font-mono! body-3",children:[v.jsxs("span",{className:Iu(h.statusCode)==="9000"?"text-success":"text-error",children:[Iu(h.statusCode)," ",jv(Iu(h.statusCode))]}),h.data&&h.data.length>0&&v.jsx("span",{className:"break-all text-muted",children:Iu(h.data)})]})]})},CU={nanoS:Vu,nanoSP:Vu,nanoX:Vu,stax:vR,flex:mR,apexp:gR},zv=({modelId:e,className:t=""})=>{const r=CU[e]??h5;return v.jsx(r,{size:20,className:`shrink-0 text-muted ${t}`})},Fv="MOCKSERVER",kU=800,C_=e=>e===Fv?"Mock server":e,k_=e=>!e||e.deviceStatus!=="NOT CONNECTED",R_=e=>{const[t,r]=x.useState(e);return x.useEffect(()=>{if(e!=="BUSY"){r(e);return}const n=setTimeout(()=>r(e),kU);return()=>clearTimeout(n)},[e]),t},RU={CONNECTED:"bg-(--color-light-green-500)",LOCKED:"bg-(--color-light-yellow-500)",BUSY:"bg-(--color-light-decorative-blue-500)","NOT CONNECTED":"bg-muted-strong"},_U={CONNECTED:"success",LOCKED:"warning",BUSY:"accent-subtle","NOT CONNECTED":"error"},$U=({device:e,state:t,exchanges:r,onSendApdu:n,apduResponses:o,clearedUpTo:a,onClear:l,onExplain:u})=>{const d=t&&"currentApp"in t?t:void 0,p=R_(t?.deviceStatus??"");return v.jsxs("div",{className:"flex min-w-320 flex-1 flex-col gap-16 p-16",children:[v.jsxs("div",{className:"flex items-center gap-8",children:[v.jsx(zv,{modelId:e.modelId}),v.jsx("h4",{className:"heading-5-semi-bold",children:e.name||e.modelId}),p&&v.jsx(bg,{size:"sm",appearance:_U[p]??"gray",label:p}),v.jsx(bg,{size:"sm",appearance:"gray",label:C_(e.transport)})]}),v.jsxs("dl",{className:"grid grid-cols-[120px_1fr] gap-x-12 gap-y-6 body-3",children:[v.jsx("dt",{className:"text-muted",children:"Session ID"}),v.jsx("dd",{className:"truncate font-mono!",children:e.sessionId}),v.jsx("dt",{className:"text-muted",children:"Model"}),v.jsx("dd",{children:e.modelId}),d?.currentApp&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{className:"text-muted",children:"Current app"}),v.jsxs("dd",{children:[d.currentApp.name," ",v.jsx("span",{className:"font-mono! text-muted",children:d.currentApp.version})]})]}),d?.firmwareVersion&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{className:"text-muted",children:"Firmware"}),v.jsx("dd",{className:"font-mono!",children:d.firmwareVersion.os})]}),d?.batteryStatus&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{className:"text-muted",children:"Battery"}),v.jsxs("dd",{children:[d.batteryStatus.level," %"]})]})]}),k_(t)&&v.jsx(EU,{sessionId:e.sessionId,onSend:n,responses:o},`sender-${e.sessionId}`),v.jsx(wU,{exchanges:r,clearedUpTo:a,onClear:l,onExplain:u},`list-${e.sessionId}`)]})},AU=({device:e,onConnect:t})=>v.jsxs("div",{className:"flex items-center gap-10 rounded-sm px-12 py-8 hover:bg-base-transparent-hover",children:[v.jsx(zv,{modelId:e.deviceModel.model}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[v.jsx("span",{className:"truncate body-3-semi-bold",children:e.name||e.deviceModel.name}),v.jsxs("span",{className:"truncate font-mono! body-4 text-muted",children:[e.transport,e.rssi!==void 0&&e.rssi!==null&&` · ${e.rssi} dBm`]})]}),v.jsx("button",{type:"button",onClick:t,className:"cursor-pointer rounded-sm bg-muted-transparent px-8 py-4 body-4-semi-bold hover:bg-muted-transparent-hover",children:"Connect"})]}),wm="body-4-semi-bold text-muted uppercase",q1="cursor-pointer rounded-sm bg-muted-transparent px-8 py-4 body-4-semi-bold hover:bg-muted-transparent-hover disabled:cursor-default disabled:text-disabled",TU=({device:e,state:t,selected:r,onSelect:n})=>{const o=R_(t?.deviceStatus??"CONNECTED"),a=t&&"currentApp"in t?t.currentApp?.name:void 0;return v.jsxs("button",{type:"button",onClick:n,className:`flex cursor-pointer items-center gap-10 rounded-sm px-12 py-8 text-left ${r?"bg-active-subtle":"hover:bg-base-transparent-hover"} ${k_(t)?"":"opacity-60"}`,children:[v.jsx(zv,{modelId:e.modelId}),v.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[v.jsx("span",{className:"truncate body-3-semi-bold",children:e.name||e.modelId}),v.jsxs("span",{className:"truncate font-mono! body-4 text-muted",children:[C_(e.transport),a&&` · ${a}`]})]}),v.jsx("span",{title:o,className:`size-8 shrink-0 rounded-full ${RU[o]??"bg-muted-strong"}`})]})},LU=({devices:e,sessionStates:t,selectedSessionId:r,onSelect:n,discoveredDevices:o,isListening:a,isActivelyDiscovering:l,startListening:u,stopListening:d,startDiscovering:p,stopDiscovering:h,connectDevice:m,mockServer:y})=>{const w=e.some(E=>E.transport===Fv);return v.jsx(Dv,{name:"sessions",defaultWidth:288,minWidth:200,maxWidth:480,edge:"right",className:"border-r border-muted-subtle",children:v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-16 overflow-auto p-12",children:[v.jsxs("section",{className:"flex flex-col gap-4",children:[v.jsxs("span",{className:`px-4 pb-4 ${wm}`,children:["Sessions · ",e.length]}),e.length===0&&v.jsx("p",{className:"px-4 body-3 text-muted",children:"No device connected yet."}),e.map(E=>v.jsx(TU,{device:E,state:t.get(E.sessionId),selected:E.sessionId===r,onSelect:()=>n(E.sessionId)},E.sessionId))]}),v.jsxs("section",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex items-center gap-6 px-4 pb-4",children:[v.jsx("span",{className:`flex-1 ${wm}`,children:"Discovered"}),v.jsx("button",{type:"button",className:q1,onClick:a?d:u,disabled:l,children:a?"Stop":"Listen"}),v.jsx("button",{type:"button",className:q1,onClick:l?h:p,disabled:a,children:l?"Stop":"Discover"})]}),(a||l)&&o.length===0&&v.jsxs("p",{className:"flex items-center gap-8 px-4 body-3 text-muted",children:[v.jsx(yl,{size:16}),a?"Listening…":"Discovering…"]}),o.map(E=>v.jsx(AU,{device:E,onConnect:()=>m(E.id)},E.id))]}),w&&v.jsxs("section",{className:"mt-auto flex flex-col gap-6 border-t border-muted-subtle px-4 pt-12",children:[v.jsx("span",{className:wm,children:"Mock server"}),y?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"truncate font-mono! body-3",children:y.url}),v.jsx("span",{className:"truncate font-mono! body-4 text-muted",children:y.sessionToken?`Session ${y.sessionToken.slice(0,8)}…`:"No session token shared"})]}):v.jsxs("p",{className:"body-3 text-muted",children:["Pass ",v.jsx("code",{children:"mockServer"})," to"," ",v.jsx("code",{children:"DevToolsDmkInspector"})," to see the device screens."]})]})]})})},Xu=(e,t)=>({label:e,touch:!1,speculos:!0,screenWidth:128,screenHeight:t,lightScreen:!1}),IU={nanoS:{...Xu("Nano S",32),speculos:!1},nanoSP:Xu("Nano S Plus",64),nanoX:Xu("Nano X",64),stax:{label:"Stax",touch:!0,speculos:!0,screenWidth:400,screenHeight:672,lightScreen:!0},flex:{label:"Flex",touch:!0,speculos:!0,screenWidth:480,screenHeight:600,lightScreen:!0},apexp:{label:"Apex",touch:!0,speculos:!0,screenWidth:300,screenHeight:400,lightScreen:!0}},OU=Xu("Device",64),NU=e=>IU[e]??OU,PU=e=>e?.status===409,DU=(e,t)=>({screenshot:async()=>{try{return await e.getScreenshot(t)}catch(r){if(PU(r))return null;throw r}},idle:async()=>({kind:"os-info",device:await e.getDevice(t)}),pressButton:(r,n)=>e.pressButton(t,r,n),touch:(r,n,o)=>e.touchScreen(t,r,n,o),openApp:async r=>{const n=new TextEncoder().encode(r);if(n.length>255)throw new Error(`App name too long to open: ${r}`);const{response:o}=await e.sendApdu(t,Uint8Array.from([224,216,0,0,n.length,...n])),a=o.slice(-4);if(a!=="9000")throw new Error(`Could not open ${r} (${a})`)}}),jU=150;function __(e){const t=x.useRef(null),r=x.useRef(null),n=x.useRef(e);n.current=e;const o=x.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),a=x.useCallback(u=>{if(!n.current||t.current)return!1;const d={target:u,pressed:!1};return t.current=d,r.current=setTimeout(()=>{d.pressed=!0,n.current?.(u,"press")},jU),!0},[]),l=x.useCallback(()=>{const u=t.current;return u?(t.current=null,o(),n.current?.(u.target,u.pressed?"release":"press-and-release"),!0):!1},[o]);return x.useEffect(()=>()=>{const u=t.current;t.current=null,o(),u?.pressed&&n.current?.(u.target,"release")},[o]),x.useMemo(()=>({hold:a,release:l}),[a,l])}const MU=e=>__(e),zU=2e3;function FU(e,t){const[r,n]=x.useState();return x.useEffect(()=>{let o=!1,a;if(n(void 0),!t)return;const l=()=>{e.getDevice(t).then(u=>{o||n(u)},()=>{o||(n(null),a=setTimeout(l,zU))})};return l(),()=>{o=!0,clearTimeout(a)}},[e,t]),r}const BU="BOLOS",UU=1e4,VU=e=>(e.apps??[]).filter(({name:t})=>t!==BU),WU=e=>`https://cdn.live.ledger.com/icons/${e.toLowerCase().replaceAll(" ","_")}.png`;function HU(e){const[t,r]=x.useState(),[n,o]=x.useState(),a=x.useRef(void 0);x.useEffect(()=>()=>clearTimeout(a.current),[]);const l=x.useCallback(u=>{!e||t||(r(u),o(void 0),e(u).then(()=>{a.current=setTimeout(()=>{r(void 0),o(`${u} opened but its screen never showed up`)},UU)},d=>{r(void 0),o(d instanceof Error?d.message:String(d))}))},[e,t]);return{opening:t,error:n,open:l}}const qU=500,GU=2e3,XU=3,YU=e=>e instanceof Error?e.message:String(e);function KU(e,t,r){const[n,o]=x.useState({kind:"loading"}),a=x.useRef(null),l=x.useRef(!1),u=x.useRef(!1);u.current=n.kind==="image";const d=x.useRef(0),p=x.useRef(0),h=x.useCallback(S=>{u.current&&++d.current<=XU||o({kind:"error",message:YU(S)})},[]),m=x.useCallback(()=>{a.current&&(r.releaseImageSource?.(a.current),a.current=null)},[r]),y=x.useRef(()=>{}),w=x.useMemo(()=>{const S=C=>{C.then(()=>y.current()).catch(h)};return{pressButton:(C,R)=>S(e.pressButton(C,R)),touch:(C,R,k)=>S(e.touch(C,R,k))}},[e,h]),E=x.useCallback(async()=>{if(l.current)return;l.current=!0;const S=p.current,C=()=>S!==p.current;try{const R=await e.screenshot();if(C())return;if(d.current=0,R){const k=await r.toImageSource(R);if(C()){r.releaseImageSource?.(k);return}k!==a.current&&(m(),a.current=k),o($=>$.kind==="image"&&$.src===k&&$.input===w?$:{kind:"image",src:k,input:w})}else{const k=await e.idle?.();if(C())return;m(),o(k??{kind:"error",message:"No screen to capture"})}}catch(R){C()||h(R)}finally{l.current=!1}},[e,r,w,h,m]);return y.current=()=>{E()},x.useEffect(()=>{if(!t){m(),o({kind:"loading"});return}let S,C=!1;const R=async()=>{r.isHidden()||await E(),!C&&(S=setTimeout(()=>{R()},u.current?qU:GU))};return R(),()=>{C=!0,clearTimeout(S),p.current++}},[t,r,E,m]),x.useEffect(()=>m,[m]),n}const QU=(e,t,r,n)=>{if(!r.width||!r.height||!n.width||!n.height)return null;const o=(a,l)=>Math.min(Math.max(Math.round(a),0),l-1);return{x:o(e/r.width*n.width,n.width),y:o(t/r.height*n.height,n.height)}};function JU(e){const t=x.useMemo(()=>e&&((r,n)=>e(r.x,r.y,n)),[e]);return __(t)}const ZU={stax:vR,flex:mR,apexp:gR},e7=e=>({...NU(e),icon:ZU[e]??Vu}),Bv=({children:e})=>Ee.createElement("div",{className:"border-muted @container relative overflow-hidden rounded-md border"},e),t7="[&::-webkit-scrollbar]:size-[6px] [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full",G1=({name:e})=>{const[t,r]=x.useState(!1);return t?Ee.createElement("span",{className:"text-muted bg-muted flex size-[12.5cqw] items-center justify-center rounded-full text-[length:6cqw] font-semibold"},e.charAt(0)):Ee.createElement("img",{src:WU(e),alt:"",draggable:!1,className:"size-[12.5cqw] rounded-full",onError:()=>r(!0)})},r7=({device:e,model:t,onOpenApp:r})=>{const n=VU(e),{opening:o,error:a,open:l}=HU(r),u=t.lightScreen?{background:"bg-white",text:"text-black",scrollbar:"[&::-webkit-scrollbar-thumb]:bg-black/30",overlay:"bg-white/70"}:{background:"bg-black",text:"text-white",scrollbar:"[&::-webkit-scrollbar-thumb]:bg-white/30",overlay:"bg-black/70"},d=t.touch?{scroll:"overflow-y-auto",list:"grid grid-cols-3 gap-[1.5cqw]",tile:"min-w-0 py-[3cqw]",opening:"flex-col"}:{scroll:"flex items-center overflow-x-auto",list:"flex gap-[2.5cqw]",tile:"w-[28cqw] shrink-0 py-[1.5cqw]",opening:"flex-row"};return Ee.createElement("div",{className:"flex flex-col gap-8","data-testid":"container_device-os-info"},Ee.createElement(Bv,null,Ee.createElement("div",{className:`${u.background} ${d.scroll} ${t7} ${u.scrollbar} p-[3cqw]`,style:{aspectRatio:t.screenWidth/t.screenHeight},"data-testid":"list_device-apps"},n.length===0?Ee.createElement("p",{className:`text-[length:5.5cqw] ${u.text} flex h-full w-full items-center justify-center opacity-60`},"No apps installed"):Ee.createElement("div",{className:d.list},n.map(p=>Ee.createElement("button",{key:p.name,type:"button",title:`${p.name} ${p.version}`,disabled:!r||o!==void 0,onClick:()=>l(p.name),className:`${u.text} ${d.tile} flex flex-col items-center gap-[1.5cqw] border-0 bg-transparent px-[1.5cqw] disabled:cursor-default enabled:cursor-pointer`,"data-testid":`button_open-app-${p.name}`},Ee.createElement(G1,{name:p.name}),Ee.createElement("span",{className:"w-full truncate text-center text-[length:4.7cqw] leading-[1.3]"},p.name))))),o!==void 0?Ee.createElement("div",{className:`${u.text} ${u.overlay} ${d.opening} pointer-events-none absolute inset-0 flex items-center justify-center gap-[3cqw] backdrop-blur-[1cqw]`,"data-testid":"spinner_opening-app-screen"},Ee.createElement("div",{className:"relative flex size-[18cqw] shrink-0 items-center justify-center"},Ee.createElement("span",{className:"absolute inset-0 rounded-full border-[0.8cqw] border-current opacity-15"}),Ee.createElement("span",{className:"absolute inset-0 animate-spin rounded-full border-[0.8cqw] border-transparent border-t-current"}),Ee.createElement(G1,{name:o})),Ee.createElement("span",{className:"animate-pulse text-[length:4.7cqw] font-semibold"},"Opening ",o)):null),a?Ee.createElement("p",{className:"body-4 text-error text-center"},a):null)},n7=[{button:"left",label:"Left"},{button:"both",label:"Both"},{button:"right",label:"Right"}],X1=e=>e===" "||e==="Enter",i7=({onPress:e})=>{const{hold:t,release:r}=MU(e);return Ee.createElement("div",{className:"flex gap-8"},n7.map(({button:n,label:o})=>Ee.createElement("button",{key:n,type:"button","aria-label":`${o} button`,onPointerDown:a=>{a.button===0&&(a.currentTarget.setPointerCapture(a.pointerId),t(n))},onPointerUp:r,onPointerCancel:r,onKeyDown:a=>{X1(a.key)&&(a.preventDefault(),t(n))},onKeyUp:a=>X1(a.key)&&r(),className:"border-muted body-3 text-base bg-muted hover:bg-muted-pressed active:bg-active flex-1 rounded-md border py-8 select-none",style:{touchAction:"none"},"data-testid":`button_device-screen-${n}`},o)))},o7=({src:e,onTouch:t})=>{const r=x.useRef(null),[n,o]=x.useState(!1),a=JU(t);x.useEffect(()=>o(!1),[e]);const l=p=>{const h=r.current;if(!t||!h||p.button!==0)return;const m=h.getBoundingClientRect(),y=QU(p.clientX-m.left,p.clientY-m.top,m,{width:h.naturalWidth,height:h.naturalHeight});y&&a.hold(y)&&h.setPointerCapture(p.pointerId)},u=p=>{a.release()&&r.current?.releasePointerCapture(p.pointerId)},d=x.useCallback(()=>o(!0),[]);return n?Ee.createElement("p",{className:"body-4 text-error text-center","data-testid":"text_device-screen-undecodable"},"Screenshot could not be decoded"):Ee.createElement(Bv,null,Ee.createElement("img",{ref:r,src:e,alt:"Device screen",draggable:!1,onError:d,onPointerDown:l,onPointerUp:u,onPointerCancel:u,className:`block w-full bg-black select-none ${t?"cursor-pointer":""}`,style:{imageRendering:"pixelated",touchAction:"none"},"data-testid":"image_device-screen"}))},s7={toImageSource:e=>Promise.resolve(URL.createObjectURL(e)),releaseImageSource:e=>URL.revokeObjectURL(e),isHidden:()=>document.hidden},Sm=16,a7=224,l7=200,Y1=(e,t,r)=>{const n=(o,a)=>Math.min(Math.max(o,0),Math.max(a,0));return{left:n(e,window.innerWidth-r.width),top:n(t,window.innerHeight-r.height)}},c7=(e,t)=>t?`${e} - ${t}`:e,u7=({api:e,deviceType:t,firmwareVersion:r,floating:n=!1,defaultCollapsed:o=!1})=>{const a=e7(t),[l,u]=x.useState(o),d=KU(e,!n||!l,s7);return n?Ee.createElement(d7,{title:c7(a.label,r),model:a,collapsed:l,onToggle:()=>u(p=>!p)},K1(d,a,e)):Ee.createElement("div",{className:"mx-auto flex w-full max-w-[420px] flex-col gap-8","data-testid":"container_device-screen"},K1(d,a,e))},d7=({title:e,model:t,collapsed:r,onToggle:n,children:o})=>{const a=x.useRef(null),[l,u]=x.useState(),[d,p]=x.useState(a7),h=x.useRef(null),m=x.useRef(null);x.useEffect(()=>{const k=()=>{const $=a.current?.getBoundingClientRect();$&&u(A=>A&&Y1(A.left,A.top,$))};return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const y=k=>{const $=a.current?.getBoundingClientRect();!$||k.button!==0||k.target.closest("button")||(k.currentTarget.setPointerCapture(k.pointerId),h.current={dx:k.clientX-$.left,dy:k.clientY-$.top})},w=k=>{const $=a.current?.getBoundingClientRect();!h.current||!$||u(Y1(k.clientX-h.current.dx,k.clientY-h.current.dy,$))},E=()=>{h.current=null},S=k=>{const $=a.current?.getBoundingClientRect();!$||k.button!==0||(k.currentTarget.setPointerCapture(k.pointerId),u({left:$.left,top:$.top}),m.current={x:k.clientX,width:$.width})},C=k=>{const $=a.current?.getBoundingClientRect();if(!m.current||!$)return;const A=m.current.width+k.clientX-m.current.x,D=window.innerWidth-$.left-Sm;p(Math.max(l7,Math.min(A,D)))},R=()=>{m.current=null};return Ee.createElement("div",{ref:a,className:"bg-base border-muted fixed flex max-w-[calc(100vw-32px)] flex-col rounded-lg border shadow-lg",style:{zIndex:1e3,width:d,...l??{right:Sm,bottom:Sm}},"data-testid":"container_device-screen"},Ee.createElement("div",{className:"flex cursor-move items-center gap-8 px-12 py-8 select-none",style:{touchAction:"none"},onPointerDown:y,onPointerMove:w,onPointerUp:E,onPointerCancel:E},Ee.createElement(t.icon,{size:16}),Ee.createElement("span",{className:"body-3-semi-bold text-base flex-1"},e),Ee.createElement(sr,{appearance:"no-background",size:"xs",icon:r?Od:zs,"aria-label":r?"Expand device screen":"Collapse device screen",onClick:n,"data-testid":"button_toggle-device-screen"})),r?null:Ee.createElement(Ee.Fragment,null,Ee.createElement("div",{className:"flex flex-col gap-8 px-12 pb-12"},o),Ee.createElement("div",{className:"group absolute top-0 right-[-6px] bottom-0 flex w-[12px] cursor-ew-resize items-center justify-center",style:{touchAction:"none"},onPointerDown:S,onPointerMove:C,onPointerUp:R,onPointerCancel:R,"aria-hidden":!0,"data-testid":"handle_resize-device-screen"},Ee.createElement("span",{className:"border-muted bg-base group-hover:bg-muted group-active:bg-muted h-40 w-[6px] rounded-full border transition-colors"}))))};function K1(e,t,r){switch(e.kind){case"loading":return Ee.createElement(Bv,null,Ee.createElement("div",{className:`${t.lightScreen?"bg-white text-black":"bg-black text-white"} flex items-center justify-center`,style:{aspectRatio:t.screenWidth/t.screenHeight},"data-testid":"placeholder_device-screen-loading"},Ee.createElement("span",{className:"animate-pulse opacity-60"},Ee.createElement(t.icon,{size:32}))));case"error":return Ee.createElement(ig,{appearance:"error",title:"Screen unavailable",description:e.message});case"os-info":return Ee.createElement(Ee.Fragment,null,Ee.createElement(r7,{device:e.device,model:t,onOpenApp:t.speculos?r.openApp:void 0}),t.speculos?null:Ee.createElement(ig,{appearance:"info",title:"No screen to capture",description:`Speculos has no emulator for the ${t.label}, so this device is mocked all the way through and has no screen.`,"data-testid":"banner_device-screen-no-emulator"}));case"image":return Ee.createElement(Ee.Fragment,null,Ee.createElement(o7,{src:e.src,onTouch:t.touch?e.input.touch:void 0}),t.touch?null:Ee.createElement(i7,{onPress:e.input.pressButton}))}}const Em=Bt.interface({id:at,prefix:at,responses:Yr(at)}),f7=Bt.interface({prefix:at,response:zt(at),responses:zt(Yr(at))}),$_=Bt.interface({name:at,version:at,hash:zt(at)}),p7=Bt.interface({hash:at,name:at,version:at}),Is=Bt.interface({id:at,name:at,device_type:at,connectivity_type:at,firmware_version:zt(at),apps:zt(Yr($_)),masks:zt(Yr(Mo)),connected:zt(vd),onboarded:zt(vd),language:zt(at)}),h7=Bt.interface({id:zt(at),name:zt(at),device_type:zt(at),connectivity_type:zt(at),firmware_version:zt(at),apps:zt(Yr($_)),masks:zt(Yr(Mo)),mocks:zt(Yr(f7)),catalog:zt(Yr(p7)),onboarded:zt(vd),language:zt(at)}),m7=Bt.interface({token:at,expires_at:Mo}),g7=Bt.interface({device:Is,connected:vd}),v7=Bt.interface({response:at}),y7=Bt.interface({status:at,sessions:Mo}),b7=Bt.interface({id:at,created_at:Mo,expires_at:Mo,devices:Yr(Is)}),Q1=Bt.interface({devices:Yr(h7)}),x7=Bt.interface({run_id:at,speculos_url:at,model:at});let w7=class{client;timeoutMs;token;authPromise;constructor(t,r={}){this.client=r.httpClient??new d_({baseUrl:this.normalizeUrl(t)}),this.token=r.token,this.timeoutMs=r.timeoutMs}async getHealth(){const t=await this.client.get("health",this.requestConfig());return this.decode(y7,t)}async authenticate(){const t=await this.client.post("auth",{},this.requestConfig()),r=this.decode(m7,t).token;return this.token=r,r}getToken(){return this.token}async listDevices(){const t=await this.client.get("devices",await this.authRequestConfig());return this.decode(Yr(Is),t)}async addDevice(t={}){const r=await this.client.post("devices",t,await this.authRequestConfig());return this.decode(Is,r)}async getDevice(t){const r=await this.client.get(`devices/${t}`,await this.authRequestConfig());return this.decode(Is,r)}async editDevice(t,r){const n=await this.client.patch(`devices/${t}`,r,await this.authRequestConfig());return this.decode(Is,n)}async deleteDevice(t){return await this.client.delete(`devices/${t}`,await this.authRequestConfig()),!0}async connect(t){const r=await this.client.post(`devices/${t}/connect`,{},await this.authRequestConfig());return this.decode(g7,r)}async disconnect(t){return await this.client.post(`devices/${t}/disconnect`,{},await this.authRequestConfig()),!0}async disconnectAll(){const t=await this.listDevices();return await Promise.all(t.filter(r=>r.connected).map(r=>this.disconnect(r.id))),!0}async sendApdu(t,r){const n=typeof r=="string"?r:si(r,!1),o=await this.client.post(`devices/${t}/apdu`,{apdu:n},await this.authRequestConfig());return this.decode(v7,o)}async listMocks(t){const r=await this.client.get(`devices/${t}/mocks`,await this.authRequestConfig());return this.decode(Yr(Em),r)}async addMock(t,r){const n=await this.client.post(`devices/${t}/mocks`,r,await this.authRequestConfig());return this.decode(Em,n)}async editMock(t,r,n){const o=await this.client.patch(`devices/${t}/mocks/${r}`,n,await this.authRequestConfig());return this.decode(Em,o)}async deleteMock(t,r){return await this.client.delete(`devices/${t}/mocks/${r}`,await this.authRequestConfig()),!0}async clearMocks(t){return await this.client.delete(`devices/${t}/mocks`,await this.authRequestConfig()),!0}async getSpeculos(t){const r=await this.client.get(`devices/${t}/speculos`,await this.authRequestConfig());return this.decode(x7,r)}async getScreenshot(t){return await this.client.get(`devices/${t}/speculos/screenshot`,{...await this.authRequestConfig(),responseType:"blob"})}async pressButton(t,r,n="press-and-release"){await this.client.post(`devices/${t}/speculos/button/${r}`,{action:n},await this.authRequestConfig())}async touchScreen(t,r,n,o="press-and-release"){await this.client.post(`devices/${t}/speculos/finger`,{action:o,x:r,y:n},await this.authRequestConfig())}async getSession(){const t=await this.client.get("sessions/current",await this.authRequestConfig());return this.decode(b7,t)}async setSeed(t){await this.client.put("sessions/current/seed",{seed:t},await this.authRequestConfig())}async disposeSession(){return await this.client.delete("sessions/current",await this.authRequestConfig()),this.token=void 0,this.authPromise=void 0,!0}async exportSession(){const t=await this.client.get("export",await this.authRequestConfig());return this.decode(Q1,t)}async importSession(t){const r=await this.client.post("import",t,await this.authRequestConfig());return this.decode(Q1,r)}decode(t,r){return t.decode(r).caseOf({Left:n=>{throw new Error(`MockClient: invalid server response (${n})`)},Right:n=>n})}requestConfig(){return{timeoutMs:this.timeoutMs}}async authRequestConfig(){const t=await this.ensureToken();return{...this.requestConfig(),headers:{Authorization:`Bearer ${t}`}}}ensureToken(){return this.token?Promise.resolve(this.token):(this.authPromise||(this.authPromise=this.authenticate()),this.authPromise)}normalizeUrl(t){return t.endsWith("/")?t:`${t}/`}};const S7=({url:e,token:t,deviceId:r,...n})=>{const o=x.useMemo(()=>new w7(e,{token:t}),[e,t]),a=x.useMemo(()=>DU(o,r),[o,r]),l=FU(o,r);return l===void 0?null:Ee.createElement(u7,{api:a,deviceType:l?.device_type??"",firmwareVersion:l?.firmware_version,...n})},E7=({mockServer:e,rewriteUrl:t,deviceId:r})=>v.jsx(Dv,{name:"live-screen",defaultWidth:320,minWidth:240,maxWidth:640,edge:"left",className:"border-l border-muted-subtle bg-surface",children:v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-16 overflow-auto p-16",children:[v.jsx("span",{className:"body-4-semi-bold text-muted uppercase",children:"Live screen"}),e?.sessionToken?v.jsx(S7,{url:t?t(e.url):e.url,token:e.sessionToken,deviceId:r}):v.jsx("p",{className:"rounded-lg border border-dashed border-muted-subtle p-24 text-center body-3 text-muted",children:e?"The app shares its mock server without a session token, so the device screen cannot be reached.":"Pass mockServer to DevToolsDmkInspector to see the device screen."})]})}),C7=`import { DevToolsDmkInspector } from "@ledgerhq/device-management-kit-devtools-core";
43
43
 
44
44
  const dmk = new DeviceManagementKitBuilder()
45
45
  .addLogger(logger)
46
46
  .build();
47
47
 
48
48
  // Enable inspector after DMK is built
49
- new DevToolsDmkInspector(connector, dmk);`,S7=({devices:e,sessionStates:t,discoveredDevices:r,isListening:n,isActivelyDiscovering:o,isConnected:a,startListening:l,stopListening:u,startDiscovering:d,stopDiscovering:p,connectDevice:h,sendApdu:m,apduResponses:y,logs:w,mockServer:E,rewriteMockServerUrl:S,onExplain:C,showLiveScreen:R,showSessions:k})=>{const[$,A]=x.useState(null),[D,N]=x.useState(new Map),P=x.useMemo(()=>sU(w),[w]),I=e.find(Z=>Z.sessionId===$)??e.at(-1),re=x.useMemo(()=>P.filter(Z=>Z.sessionId===I?.sessionId),[P,I?.sessionId]);return a?v.jsxs("div",{className:"flex min-h-0 flex-1",children:[k&&v.jsx($U,{devices:e,sessionStates:t,selectedSessionId:I?.sessionId??null,onSelect:A,discoveredDevices:r,isListening:n,isActivelyDiscovering:o,startListening:l,stopListening:u,startDiscovering:d,stopDiscovering:p,connectDevice:h,mockServer:E}),I?v.jsxs(v.Fragment,{children:[v.jsx(kU,{device:I,state:t.get(I.sessionId),exchanges:re,onSendApdu:m,apduResponses:y,clearedUpTo:D.get(I.sessionId),onClear:Z=>N(ee=>new Map(ee).set(I.sessionId,Z)),onExplain:C}),I.transport===Fv&&R&&v.jsx(x7,{mockServer:E,rewriteUrl:S,deviceId:I.id})]}):v.jsx("div",{className:"flex flex-1 items-center justify-center body-2 text-muted",children:"Connect a device to inspect its session."})]}):v.jsx(p_,{title:"Inspector not connected",description:v.jsxs(v.Fragment,{children:["To enable the Inspector, add ",v.jsx("code",{children:"DevToolsDmkInspector"})," to your app after building the DMK:"]}),codeExample:w7})},E7={activeLevels:{debug:!0,info:!0,warning:!0,error:!0,fatal:!0},showTimestamp:!0,showTag:!0,excludeTags:new Set,filterText:""},K1=["debug","info","warning","error","fatal"],wd=({label:e,checked:t,onChange:r})=>v.jsxs("label",{className:"flex cursor-pointer items-center gap-8 font-mono! body-3 whitespace-nowrap",children:[v.jsx(Qg,{checked:t,onCheckedChange:r}),e]}),R_=e=>!Object.values(e.activeLevels).every(Boolean),__=e=>e.excludeTags.size>0,C7=({options:e,setOptions:t})=>v.jsxs(v.Fragment,{children:[v.jsx(wd,{label:"All",checked:!R_(e),onChange:r=>t({...e,activeLevels:Object.fromEntries(K1.map(n=>[n,r]))})}),K1.map(r=>v.jsx(wd,{label:r,checked:e.activeLevels[r]??!1,onChange:n=>t({...e,activeLevels:{...e.activeLevels,[r]:n}})},r))]}),k7=({options:e,setOptions:t,uniqueTags:r})=>{const n=(o,a)=>{const l=new Set(e.excludeTags);a?l.delete(o):l.add(o),t({...e,excludeTags:l})};return v.jsxs(v.Fragment,{children:[v.jsx(wd,{label:"All",checked:!__(e),onChange:o=>t({...e,excludeTags:o?new Set:new Set(r)})}),Array.from(r).map(o=>v.jsx(wd,{label:o,checked:!e.excludeTags.has(o),onChange:a=>n(o,a)},o))]})},$_={MIN_COLUMN_SIZE:50,MAX_COLUMN_SIZE:500},R7={debug:"bg-(--color-light-decorative-blue-500)",info:"bg-(--color-light-green-500)",warning:"bg-(--color-light-yellow-500)",error:"bg-(--color-light-red-500)",fatal:"bg-(--color-light-red-500)"},_7={debug:"text-decorative-blue",info:"text-success",warning:"text-warning",error:"text-error",fatal:"text-error"},$7=4,Q1=24,A7=2,T7=8,A_=e=>typeof e=="object"&&e!==null,L7=({text:e,label:t})=>{const[r,n]=x.useState(!1);return v.jsx(vt,{label:t,children:v.jsx(sr,{"aria-label":t,icon:r?Pd:dR,size:"xs",appearance:"no-background",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})}})})},Qd=({value:e,short:t=!1})=>{if(typeof e=="string"){const r=t&&e.length>Q1?`${e.slice(0,Q1)}…`:e;return v.jsx("span",{className:t?"text-base":"break-all text-base",children:`"${r}"`})}return e==null?v.jsx("span",{className:"text-muted",children:String(e)}):v.jsx("span",{className:"text-decorative-blue",children:String(e)})},T_=({value:e})=>{const t=Object.entries(e),r=t.slice(0,$7),n=Array.isArray(e);return v.jsxs("span",{className:"text-muted",children:[n?`(${t.length}) [`:"{",r.map(([o,a],l)=>v.jsxs(Ee.Fragment,{children:[l>0&&", ",!n&&v.jsxs("span",{className:"text-decorative-purple",children:[o,": "]}),A_(a)?Array.isArray(a)?`Array(${a.length})`:"{…}":v.jsx(Qd,{value:a,short:!0})]},o)),t.length>r.length&&", …",n?"]":"}"]})},L_="mr-4 inline-flex size-12 items-center justify-center align-middle",I7=({open:e,onToggle:t})=>v.jsx("button",{type:"button","aria-expanded":e,"aria-label":e?"Collapse":"Expand",onClick:t,className:`${L_} cursor-pointer text-muted hover:text-base`,children:v.jsx(Nd,{size:12,className:`transition-transform ${e?"rotate-90":""}`})}),I_=({name:e,value:t,depth:r})=>{const n=A_(t),[o,a]=x.useState(()=>n&&r<A7&&Object.keys(t).length<=T7),l=e===void 0?null:v.jsxs("span",{className:"text-decorative-purple",children:[e,": "]});return n?v.jsxs("div",{children:[v.jsxs("div",{children:[v.jsx(I7,{open:o,onToggle:()=>a(!o)}),l,o?v.jsx("span",{className:"text-muted",children:Array.isArray(t)?`Array(${t.length})`:"{…}"}):v.jsx(T_,{value:t})]}),o&&v.jsx("div",{className:"pl-16",children:Object.entries(t).map(([u,d])=>v.jsx(I_,{name:u,value:d,depth:r+1},u))})]}):v.jsxs("div",{children:[v.jsx("span",{className:L_}),l,v.jsx(Qd,{value:t})]})},O_=e=>typeof e=="string"?e.length>0:Object.keys(e).length>0,O7=({payload:e})=>typeof e=="string"?v.jsx(Qd,{value:e,short:!0}):v.jsx(T_,{value:e}),N7=({payload:e})=>{const t=x.useMemo(()=>typeof e=="string"?e:JSON.stringify(e,null,2),[e]);return v.jsxs("div",{className:"group relative rounded-sm bg-muted px-12 py-8 pr-40 font-mono! body-3",children:[v.jsx("div",{className:"absolute top-4 right-4 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:v.jsx(L7,{text:t,label:"Copy payload"})}),typeof e=="string"?v.jsx(Qd,{value:e}):Object.entries(e).map(([r,n])=>v.jsx(I_,{name:r,value:n,depth:1},r))]})},P7=({timestamp:e})=>v.jsx("p",{className:"font-mono! body-3 whitespace-nowrap text-muted",children:new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1})}),D7=({tag:e})=>v.jsx("p",{className:"truncate font-mono! body-3 text-muted",title:e,children:e}),j7=({verbosity:e})=>v.jsx("span",{className:`font-mono! body-3 ${_7[e]}`,children:e}),M7=({message:e,payload:t})=>v.jsxs("p",{className:"min-w-0 font-mono! body-3 break-all whitespace-pre-wrap text-base",children:[e,O_(t)&&v.jsxs(v.Fragment,{children:[" ",v.jsx("span",{className:"ml-8 font-mono! body-4 break-normal wrap-anywhere text-muted [&_*]:text-muted!",title:"Click to show the payload",children:v.jsx(O7,{payload:t})})]})]}),N_=[{id:"timestamp",header:"Time",Cell:P7,size:104,flexible:!1},{id:"tag",header:"Tag",Cell:D7,size:170,flexible:!1},{id:"verbosity",header:"Level",Cell:j7,size:64,flexible:!1},{id:"message",header:"Message",Cell:M7,size:300,minSize:200,flexible:!0}],P_=(e,t)=>t[e.id]??e.size,D_=e=>e.minSize??$_.MIN_COLUMN_SIZE,j_=(e,t)=>{const r=P_(e,t),n=D_(e);return{flex:e.flexible?`${r} 1 ${n}px`:`0 0 ${r}px`,minWidth:e.flexible?n:r}},z7={tag:{Filter:k7,isActive:__},verbosity:{Filter:C7,isActive:R_}},Em="body-4-semi-bold text-muted uppercase",F7=({options:e,setOptions:t,uniqueTags:r,newestFirst:n,onToggleSort:o,columnSizing:a,onColumnSizingChange:l,children:u})=>{const d=(h,m,y)=>w=>{w.preventDefault();const E=w.clientX,S=R=>{const k=Math.min($_.MAX_COLUMN_SIZE,Math.max(y,m+R.clientX-E));l($=>({...$,[h]:k}))},C=()=>{window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",C)};window.addEventListener("mousemove",S),window.addEventListener("mouseup",C)},p=h=>l(m=>Object.fromEntries(Object.entries(m).filter(([y])=>y!==h)));return v.jsxs("div",{className:"flex gap-8 bg-surface py-4 pr-8 pl-8",children:[v.jsx("span",{className:"w-16 shrink-0"}),v.jsx("span",{className:"w-4 shrink-0"}),v.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-8 pr-8",children:[v.jsx("span",{className:"w-12 shrink-0"}),N_.map(h=>{const{id:m,flexible:y,header:w}=h,E=P_(h,a),S=D_(h),C=z7[m];return v.jsxs("div",{className:"relative flex overflow-hidden",style:j_(h,a),children:[C?v.jsxs(M2,{children:[v.jsx(z2,{"aria-label":`Filter by ${w.toLowerCase()}`,render:v.jsxs("button",{className:`-mx-4 flex cursor-pointer items-center gap-4 rounded-xs px-4 hover:bg-base-transparent-hover hover:text-base ${Em}`,children:[w,v.jsx(zs,{size:12}),C.isActive(e)&&v.jsx("span",{className:"size-4 rounded-full bg-active"})]})}),v.jsx(F2,{side:"bottom",align:"start",children:v.jsx("div",{className:"flex max-h-320 flex-col gap-8 overflow-auto p-12 text-base",children:v.jsx(C.Filter,{options:e,setOptions:t,uniqueTags:r})})})]}):m==="timestamp"?v.jsx(vt,{label:n?"Show oldest first":"Show newest first",side:"bottom",children:v.jsxs("button",{type:"button",onClick:o,className:`-mx-4 flex cursor-pointer items-center gap-4 rounded-xs px-4 hover:bg-base-transparent-hover hover:text-base ${Em}`,children:[w,n?v.jsx(zs,{size:12}):v.jsx(Od,{size:12})]})}):v.jsx("span",{className:Em,children:w}),!y&&v.jsx("span",{role:"separator","aria-orientation":"vertical",title:"Drag to resize, double-click to reset",onMouseDown:d(m,E,S),onDoubleClick:()=>p(m),className:"absolute inset-y-0 right-0 w-6 cursor-col-resize border-r-2 border-transparent hover:border-muted"})]},m)}),u]})]})},J1=e=>e.toLocaleString("en-US"),B7=({paused:e,total:t,displayed:r})=>v.jsxs("span",{className:"ml-auto shrink-0 pl-16 font-mono! body-4 whitespace-nowrap text-muted",children:[e&&v.jsx("span",{className:"text-warning",children:"paused · "}),J1(t)," ",t===1?"event":"events",t>r&&` · ${J1(t-r)} filtered out`]}),M_="devtools-logger-recent-filters",U7=10,V7=15e3;function W7(){try{const e=localStorage.getItem(M_);if(e){const t=JSON.parse(e);if(Array.isArray(t))return t.filter(r=>typeof r=="string")}}catch{}return[]}function Z1(e){try{localStorage.setItem(M_,JSON.stringify(e))}catch{}}const H7=e=>{const[t,r]=x.useState(()=>W7()),n=x.useRef(""),o=x.useCallback(l=>{l.trim()&&r(u=>{const d=u.filter(h=>h!==l),p=[l,...d].slice(0,U7);return Z1(p),p})},[]),a=x.useCallback(l=>{r(u=>{const d=u.filter(p=>p!==l);return Z1(d),d})},[]);return x.useEffect(()=>{const l=e.trim();if(!l||l===n.current)return;const u=setTimeout(()=>{o(l),n.current=l},V7);return()=>{clearTimeout(u)}},[e,o]),{recentFilters:t,addFilter:o,removeFilter:a}},q7=({value:e,onChange:t,inputRef:r})=>{const[n,o]=x.useState(!1),a=x.useId(),[l,u]=x.useState(-1),{recentFilters:d,removeFilter:p}=H7(e),h=x.useRef(null),m=x.useRef(null),y=r??m;x.useEffect(()=>{const k=$=>{h.current&&!h.current.contains($.target)&&o(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]);const w=x.useCallback(()=>{o(k=>(k||u(-1),!k)),y.current?.focus()},[y]),E=x.useCallback(k=>{t(k),o(!1),u(-1),y.current?.focus()},[t,y]),S=x.useCallback(k=>{k.key==="Escape"?n?(o(!1),u(-1)):y.current?.blur():k.key==="ArrowDown"?(k.preventDefault(),n?d.length>0&&u($=>$<d.length-1?$+1:$):(o(!0),u(d.length>0?0:-1))):k.key==="ArrowUp"?(k.preventDefault(),n&&u($=>$>-1?$-1:-1)):k.key==="Enter"&&n&&l>=0&&d[l]&&(k.preventDefault(),E(d[l]))},[n,d,l,E,y]),C=x.useCallback((k,$)=>{k.stopPropagation(),p($)},[p]),R=x.useCallback(()=>{t(""),y.current?.focus()},[t,y]);return v.jsxs("div",{className:c_,ref:h,children:[v.jsxs("div",{className:Ml,children:[v.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"shrink-0 text-muted","aria-hidden":"true",children:v.jsx("path",{d:"M3 5h18l-7 8v6l-4-2v-4z"})}),v.jsx("input",{ref:y,className:zl,type:"text",placeholder:"Filter","aria-label":"Filter logs",role:"combobox","aria-expanded":n,"aria-controls":a,"aria-autocomplete":"list","aria-activedescendant":n&&l>=0?`${a}-${l}`:void 0,value:e,onChange:k=>t(k.target.value),onKeyDown:S}),e?v.jsx(vt,{label:"Clear filter",side:"bottom",children:v.jsx("button",{"aria-label":"Clear filter",className:Lo,onClick:R,children:v.jsx(id,{size:12})})}):v.jsxs("kbd",{className:d_,children:[u_,"K"]}),v.jsx(vt,{label:"Recent filters",side:"bottom",children:v.jsx("button",{"aria-label":"Recent filters","aria-haspopup":"listbox","aria-expanded":n,type:"button",className:`${Lo} ${n?"text-base":""}`,onClick:w,children:v.jsx(zs,{size:16})})})]}),n&&v.jsxs("div",{id:a,role:"listbox","aria-label":"Recent filters",className:"absolute inset-x-0 top-full z-1000 mt-4 max-h-320 overflow-y-auto rounded-sm border border-muted-subtle bg-canvas-sheet py-4 shadow-xl",children:[v.jsx("div",{className:"border-b border-muted-subtle px-10 py-6 body-4-semi-bold text-muted uppercase",children:"Recent filters"}),d.length===0?v.jsx("div",{className:"px-10 py-12 text-center body-3 text-muted",children:"No recent filters"}):d.map((k,$)=>v.jsxs("div",{id:`${a}-${$}`,role:"option","aria-selected":$===l,className:`group flex cursor-pointer items-center justify-between px-10 py-8 font-mono! body-3 hover:bg-base-transparent-hover ${$===l?"bg-active-subtle":""}`,onClick:()=>E(k),children:[v.jsx("span",{className:"flex-1 truncate",children:k}),v.jsx(vt,{label:"Remove from recent",side:"bottom",children:v.jsx("button",{"aria-label":"Remove from recent",className:"ml-8 flex cursor-pointer items-center text-muted opacity-50 group-hover:opacity-100 hover:text-base focus-visible:opacity-100",onClick:A=>C(A,k),children:v.jsx(id,{size:12})})})]},k))]})]})},eE=({direction:e})=>{const t=e==="up"?Od:zs;return v.jsxs("span",{className:"flex flex-col items-center leading-0 [&>svg:first-child]:-mb-8",children:[v.jsx(t,{size:12}),v.jsx(t,{size:12})]})},G7=({value:e,onChange:t,matchCount:r,currentMatchIndex:n,onNext:o,onPrevious:a,onFirst:l,onLast:u,inputRef:d})=>{const p=x.useRef(null),h=d??p,m=x.useCallback(S=>{S.key==="Enter"?(S.preventDefault(),S.shiftKey?a():o()):S.key==="Escape"&&h.current?.blur()},[o,a,h]),y=r>0,w=y?n+1:0,E=x.useCallback(()=>{t(""),h.current?.focus()},[t,h]);return v.jsx("div",{className:"relative w-400 min-w-160 shrink",children:v.jsxs("div",{className:Ml,children:[v.jsx(QD,{size:16,className:"shrink-0 text-muted"}),v.jsx("input",{ref:h,className:zl,type:"text",placeholder:"Find","aria-label":"Find in logs",value:e,onChange:S=>t(S.target.value),onKeyDown:m}),e&&v.jsx(vt,{label:"Clear search",side:"bottom",children:v.jsx("button",{"aria-label":"Clear search",className:Lo,onClick:E,children:v.jsx(id,{size:12})})}),e?v.jsxs("span",{className:"body-4 whitespace-nowrap text-muted",children:[w,"/",r]}):v.jsxs("kbd",{className:d_,children:[u_,"F"]}),v.jsx(vt,{label:"Previous match (Shift+Enter)",side:"bottom",children:v.jsx("button",{"aria-label":"Previous match (Shift+Enter)",className:Lo,onClick:a,disabled:!y,children:v.jsx(Od,{size:16})})}),v.jsx(vt,{label:"Next match (Enter)",side:"bottom",children:v.jsx("button",{"aria-label":"Next match (Enter)",className:Lo,onClick:o,disabled:!y,children:v.jsx(zs,{size:16})})}),v.jsx(vt,{label:"First match",side:"bottom",children:v.jsx("button",{"aria-label":"First match",className:Lo,onClick:l,disabled:!y,children:v.jsx(eE,{direction:"up"})})}),v.jsx(vt,{label:"Last match",side:"bottom",children:v.jsx("button",{"aria-label":"Last match",className:Lo,onClick:u,disabled:!y,children:v.jsx(eE,{direction:"down"})})})]})})},X7=({clearLogs:e,downloadLogs:t,options:r,setOptions:n,paused:o,onTogglePaused:a,searchQuery:l,onSearchChange:u,matchCount:d,currentMatchIndex:p,onSearchNext:h,onSearchPrevious:m,onSearchFirst:y,onSearchLast:w,searchInputRef:E,filterInputRef:S})=>v.jsxs("div",{className:"flex min-h-56 shrink-0 flex-wrap items-center gap-x-12 gap-y-8 border-b border-muted-subtle px-12 py-12",children:[v.jsx(q7,{value:r.filterText,onChange:C=>n({...r,filterText:C}),inputRef:S}),v.jsx(G7,{value:l,onChange:u,matchCount:d,currentMatchIndex:p,onNext:h,onPrevious:m,onFirst:y,onLast:w,inputRef:E}),v.jsx("span",{className:"flex-1"}),v.jsxs("div",{className:"flex gap-6",children:[v.jsx(x_,{paused:o,onToggle:a}),v.jsx(vt,{label:"Clear logs",side:"bottom",children:v.jsx(sr,{"aria-label":"Clear logs",icon:gR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:e})}),v.jsx(vt,{label:"Export logs",side:"bottom",children:v.jsx(sr,{"aria-label":"Export logs",icon:fR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:t})})]})]}),Y7=(e,t)=>t?"bg-muted-strong":e?"bg-muted":"hover:bg-base-transparent-hover",K7=({log:e,index:t,highlighted:r,currentMatch:n,expanded:o,onToggle:a,selected:l,onSelect:u,onRowMouseDown:d,onRowMouseEnter:p,columnSizing:h})=>{const m=O_(e.payload),y=m&&o;return v.jsxs("div",{"data-index":t,className:`flex w-full gap-8 py-2 pr-8 pl-8 ${l?"bg-active-subtle":""}`,onMouseDown:w=>d(t,w),onMouseEnter:()=>p(t),children:[v.jsx("div",{className:"flex shrink-0 pt-4",children:v.jsx(Qg,{"aria-label":"Select this log",checked:l,className:"size-16",onClick:w=>u(t,w.shiftKey)})}),v.jsx("div",{className:"flex shrink-0 py-2",children:v.jsx("span",{className:`w-4 rounded-full ${R7[e.verbosity]}`})}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[v.jsxs("div",{className:`flex items-start gap-8 rounded-xs pr-8 ${Y7(r,n)} ${m?"cursor-pointer":""}`,onClick:m?()=>a(e):void 0,...m&&{role:"button",tabIndex:0,"aria-expanded":y,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),a(e))}},children:[v.jsx(Nd,{size:12,className:`mt-4 shrink-0 text-muted transition-transform ${m?"":"invisible"} ${y?"rotate-90":""}`}),N_.map(w=>v.jsx("div",{className:"flex items-start overflow-hidden py-2",style:j_(w,h),children:v.jsx(w.Cell,{...e})},w.id))]}),y&&v.jsx("div",{className:"mb-4",children:v.jsx(N7,{payload:e.payload})})]})]})},Q7=Ee.memo(K7),_o=500,tE=new WeakMap;let J7=0;const Z7=e=>{let t=tE.get(e);return t===void 0&&(t=J7++,tE.set(e,t)),t},rE="w-full cursor-pointer py-4 text-center font-mono! body-4 text-muted hover:bg-base-transparent-hover hover:text-base",eV=({data:e,highlightedIndices:t,currentHighlightIndex:r,scrollToIndex:n,follow:o,newestFirst:a,columnSizing:l,onHorizontalScroll:u,selected:d,onSelect:p,onRowMouseDown:h,onRowMouseEnter:m})=>{const[y,w]=x.useState(new Set),{containerRef:E,contentRef:S,onScroll:C,atBottom:R,setAtBottom:k,scrollToBottom:$}=y_(o),A=x.useCallback(G=>{k(!1),w(fe=>{const be=new Set(fe);return be.delete(G)||be.add(G),be})},[k]);x.useEffect(()=>{u(0)},[]);const[D,N]=x.useState(_o),[P,I]=x.useState(null),[re,Z]=x.useMemo(()=>{let G=-1,fe=-1;return P&&e.forEach((be,pe)=>{P.has(be)&&(G<0&&(G=pe),fe=pe)}),[G,fe]},[e,P]),ee=re>=0,[ne,X]=ee?[re,Z+1]:a?[0,Math.min(e.length,D)]:[Math.max(0,e.length-D),e.length],F=e.slice(ne,X),V=a?e.length-X:ne,H=ee?e.length-X:0;x.useEffect(()=>{R?I(null):o&&!a&&F.length>0&&I(G=>G??new Set(F))},[R]);const O=()=>{const G=E.current,fe=G?G.scrollHeight-G.scrollTop:0;Lr.flushSync(()=>{ee?I(new Set(e.slice(Math.max(0,ne-_o),X))):N(be=>be+_o)}),G&&!a&&(G.scrollTop=G.scrollHeight-fe)},[L,U]=x.useState(!0),z=a?L:R,T=()=>{C();const G=E.current;G&&(U(G.scrollTop<=4),u(G.scrollLeft))},M=()=>{if(a){E.current&&(E.current.scrollTop=0);return}Lr.flushSync(()=>{I(null),k(!0)}),$()};x.useEffect(()=>{n===void 0||n<0||n>=ne&&n<X||(a?N(n+1):I(new Set(e.slice(Math.max(0,n-_o/2),n+_o/2+1))))},[n]);const te=x.useRef(void 0);x.useLayoutEffect(()=>{if(n===void 0||n<0){te.current=void 0;return}if(te.current===e[n])return;const G=S.current?.querySelector(`[data-index="${n}"]`);G&&(te.current=e[n],k(!1),G.scrollIntoView({block:"center"}))});const le=V>0&&v.jsxs("button",{type:"button",className:rE,onClick:O,children:["Show ",Math.min(V,_o)," older"," ",V===1?"log":"logs",V>_o&&` of ${V}`]});return v.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[v.jsx("div",{ref:E,className:"min-h-0 flex-1 overflow-auto",onScroll:T,children:v.jsx("div",{ref:S,className:"w-full min-w-fit",children:e.length===0?v.jsx("p",{className:"p-24 text-center body-2 text-muted",children:"No logs to display"}):v.jsxs(v.Fragment,{children:[!a&&le,F.map((G,fe)=>v.jsx(Q7,{log:G,index:ne+fe,highlighted:t?.has(ne+fe)??!1,currentMatch:r===ne+fe,expanded:y.has(G),onToggle:A,selected:d.has(G),onSelect:p,onRowMouseDown:h,onRowMouseEnter:m,columnSizing:l},Z7(G))),a&&le,H>0&&v.jsxs("button",{type:"button",className:rE,onClick:M,children:[H," newer ",H===1?"log":"logs"]}),o&&v.jsx("div",{className:`flex h-24 items-center justify-center gap-4 ${R?"":"invisible"}`,role:"status","aria-label":R?"Following new logs":void 0,children:["","[animation-delay:200ms]","[animation-delay:400ms]"].map(G=>v.jsx("span",{className:`size-4 animate-pulse rounded-full bg-muted-strong ${G}`},G))})]})})}),v.jsx(v_,{enabled:z,onClick:M,up:a})]})},nE=Number.POSITIVE_INFINITY,tV=({logs:e})=>{const[t,r]=Ee.useState(E7),n=x.useMemo(()=>{const l=Mv(t.filterText),u=e.filter(d=>!(!t.activeLevels[d.verbosity]||t.excludeTags.has(d.tag)||l.length>0&&!g_(d,l)));return u.length>nE?u.slice(-nE):u},[e,t]),o=Ee.useRef(new Set),a=x.useMemo(()=>(e.forEach(l=>{o.current.add(l.tag)}),o.current),[e]);return{displayedLogs:n,options:t,setOptions:r,uniqueTags:a}},rV=e=>{const[t,r]=x.useState(""),[n,o]=x.useState(null),a=x.useMemo(()=>{const E=t.trim();if(!E)return[];const S=Mv(E);return S.length===0?[]:e.map((C,R)=>g_(C,S)?R:-1).filter(C=>C!==-1)},[e,t]),l=a.findIndex(E=>e[E]===n),u=Math.max(0,l),d=l<0?e[a[0]??-1]:void 0;x.useEffect(()=>{d&&o(d)},[d]);const p=x.useCallback(E=>{const S=a[E];S!==void 0&&o(e[S]??null)},[e,a]),h=x.useCallback(()=>{p(u>=a.length-1?0:u+1)},[p,u,a.length]),m=x.useCallback(()=>{p(u<=0?a.length-1:u-1)},[p,u,a.length]),y=x.useCallback(()=>p(0),[p]),w=x.useCallback(()=>p(a.length-1),[p,a.length]);return{searchQuery:t,setSearchQuery:r,matchIndices:a,currentMatchIndex:u,currentMatchRowIndex:a[u],goToNext:h,goToPrevious:m,goToFirst:y,goToLast:w}},iE=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}),nV=e=>`[${e.timestamp}] [${e.verbosity.toUpperCase()}] ${e.tag} ${e.message}${e.payloadJSON&&e.payloadJSON!=="{}"?` | ${e.payloadJSON}`:""}`,iV=`import { DevToolsLogger } from "@ledgerhq/device-management-kit-devtools-core";
49
+ new DevToolsDmkInspector(connector, dmk);`,k7=({devices:e,sessionStates:t,discoveredDevices:r,isListening:n,isActivelyDiscovering:o,isConnected:a,startListening:l,stopListening:u,startDiscovering:d,stopDiscovering:p,connectDevice:h,sendApdu:m,apduResponses:y,logs:w,mockServer:E,rewriteMockServerUrl:S,onExplain:C,showLiveScreen:R,showSessions:k})=>{const[$,A]=x.useState(null),[D,N]=x.useState(new Map),P=x.useMemo(()=>cU(w),[w]),I=e.find(Z=>Z.sessionId===$)??e.at(-1),re=x.useMemo(()=>P.filter(Z=>Z.sessionId===I?.sessionId),[P,I?.sessionId]);return a?v.jsxs("div",{className:"flex min-h-0 flex-1",children:[k&&v.jsx(LU,{devices:e,sessionStates:t,selectedSessionId:I?.sessionId??null,onSelect:A,discoveredDevices:r,isListening:n,isActivelyDiscovering:o,startListening:l,stopListening:u,startDiscovering:d,stopDiscovering:p,connectDevice:h,mockServer:E}),I?v.jsxs(v.Fragment,{children:[v.jsx($U,{device:I,state:t.get(I.sessionId),exchanges:re,onSendApdu:m,apduResponses:y,clearedUpTo:D.get(I.sessionId),onClear:Z=>N(ee=>new Map(ee).set(I.sessionId,Z)),onExplain:C}),I.transport===Fv&&R&&v.jsx(E7,{mockServer:E,rewriteUrl:S,deviceId:I.id})]}):v.jsx("div",{className:"flex flex-1 items-center justify-center body-2 text-muted",children:"Connect a device to inspect its session."})]}):v.jsx(g_,{title:"Inspector not connected",description:v.jsxs(v.Fragment,{children:["To enable the Inspector, add ",v.jsx("code",{children:"DevToolsDmkInspector"})," to your app after building the DMK:"]}),codeExample:C7})},R7={activeLevels:{debug:!0,info:!0,warning:!0,error:!0,fatal:!0},showTimestamp:!0,showTag:!0,excludeTags:new Set,filterText:""},J1=["debug","info","warning","error","fatal"],wd=({label:e,checked:t,onChange:r})=>v.jsxs("label",{className:"flex cursor-pointer items-center gap-8 font-mono! body-3 whitespace-nowrap",children:[v.jsx(Jg,{checked:t,onCheckedChange:r}),e]}),A_=e=>!Object.values(e.activeLevels).every(Boolean),T_=e=>e.excludeTags.size>0,_7=({options:e,setOptions:t})=>v.jsxs(v.Fragment,{children:[v.jsx(wd,{label:"All",checked:!A_(e),onChange:r=>t({...e,activeLevels:Object.fromEntries(J1.map(n=>[n,r]))})}),J1.map(r=>v.jsx(wd,{label:r,checked:e.activeLevels[r]??!1,onChange:n=>t({...e,activeLevels:{...e.activeLevels,[r]:n}})},r))]}),$7=({options:e,setOptions:t,uniqueTags:r})=>{const n=(o,a)=>{const l=new Set(e.excludeTags);a?l.delete(o):l.add(o),t({...e,excludeTags:l})};return v.jsxs(v.Fragment,{children:[v.jsx(wd,{label:"All",checked:!T_(e),onChange:o=>t({...e,excludeTags:o?new Set:new Set(r)})}),Array.from(r).map(o=>v.jsx(wd,{label:o,checked:!e.excludeTags.has(o),onChange:a=>n(o,a)},o))]})},L_={MIN_COLUMN_SIZE:50,MAX_COLUMN_SIZE:500},A7={debug:"bg-(--color-light-decorative-blue-500)",info:"bg-(--color-light-green-500)",warning:"bg-(--color-light-yellow-500)",error:"bg-(--color-light-red-500)",fatal:"bg-(--color-light-red-500)"},T7={debug:"text-decorative-blue",info:"text-success",warning:"text-warning",error:"text-error",fatal:"text-error"},L7=4,Z1=24,I7=2,O7=8,I_=e=>typeof e=="object"&&e!==null,N7=({text:e,label:t})=>{const[r,n]=x.useState(!1);return v.jsx(vt,{label:t,children:v.jsx(sr,{"aria-label":t,icon:r?Pd:pR,size:"xs",appearance:"no-background",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})}})})},Jd=({value:e,short:t=!1})=>{if(typeof e=="string"){const r=t&&e.length>Z1?`${e.slice(0,Z1)}…`:e;return v.jsx("span",{className:t?"text-base":"break-all text-base",children:`"${r}"`})}return e==null?v.jsx("span",{className:"text-muted",children:String(e)}):v.jsx("span",{className:"text-decorative-blue",children:String(e)})},O_=({value:e})=>{const t=Object.entries(e),r=t.slice(0,L7),n=Array.isArray(e);return v.jsxs("span",{className:"text-muted",children:[n?`(${t.length}) [`:"{",r.map(([o,a],l)=>v.jsxs(Ee.Fragment,{children:[l>0&&", ",!n&&v.jsxs("span",{className:"text-decorative-purple",children:[o,": "]}),I_(a)?Array.isArray(a)?`Array(${a.length})`:"{…}":v.jsx(Jd,{value:a,short:!0})]},o)),t.length>r.length&&", …",n?"]":"}"]})},N_="mr-4 inline-flex size-12 items-center justify-center align-middle",P7=({open:e,onToggle:t})=>v.jsx("button",{type:"button","aria-expanded":e,"aria-label":e?"Collapse":"Expand",onClick:t,className:`${N_} cursor-pointer text-muted hover:text-base`,children:v.jsx(Nd,{size:12,className:`transition-transform ${e?"rotate-90":""}`})}),P_=({name:e,value:t,depth:r})=>{const n=I_(t),[o,a]=x.useState(()=>n&&r<I7&&Object.keys(t).length<=O7),l=e===void 0?null:v.jsxs("span",{className:"text-decorative-purple",children:[e,": "]});return n?v.jsxs("div",{children:[v.jsxs("div",{children:[v.jsx(P7,{open:o,onToggle:()=>a(!o)}),l,o?v.jsx("span",{className:"text-muted",children:Array.isArray(t)?`Array(${t.length})`:"{…}"}):v.jsx(O_,{value:t})]}),o&&v.jsx("div",{className:"pl-16",children:Object.entries(t).map(([u,d])=>v.jsx(P_,{name:u,value:d,depth:r+1},u))})]}):v.jsxs("div",{children:[v.jsx("span",{className:N_}),l,v.jsx(Jd,{value:t})]})},D_=e=>typeof e=="string"?e.length>0:Object.keys(e).length>0,D7=({payload:e})=>typeof e=="string"?v.jsx(Jd,{value:e,short:!0}):v.jsx(O_,{value:e}),j7=({payload:e})=>{const t=x.useMemo(()=>typeof e=="string"?e:JSON.stringify(e,null,2),[e]);return v.jsxs("div",{className:"group relative rounded-sm bg-muted px-12 py-8 pr-40 font-mono! body-3",children:[v.jsx("div",{className:"absolute top-4 right-4 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:v.jsx(N7,{text:t,label:"Copy payload"})}),typeof e=="string"?v.jsx(Jd,{value:e}):Object.entries(e).map(([r,n])=>v.jsx(P_,{name:r,value:n,depth:1},r))]})},M7=({timestamp:e})=>v.jsx("p",{className:"font-mono! body-3 whitespace-nowrap text-muted",children:new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1})}),z7=({tag:e})=>v.jsx("p",{className:"truncate font-mono! body-3 text-muted",title:e,children:e}),F7=({verbosity:e})=>v.jsx("span",{className:`font-mono! body-3 ${T7[e]}`,children:e}),B7=({message:e,payload:t})=>v.jsxs("p",{className:"min-w-0 font-mono! body-3 break-all whitespace-pre-wrap text-base",children:[e,D_(t)&&v.jsxs(v.Fragment,{children:[" ",v.jsx("span",{className:"ml-8 font-mono! body-4 break-normal wrap-anywhere text-muted [&_*]:text-muted!",title:"Click to show the payload",children:v.jsx(D7,{payload:t})})]})]}),j_=[{id:"timestamp",header:"Time",Cell:M7,size:104,flexible:!1},{id:"tag",header:"Tag",Cell:z7,size:170,flexible:!1},{id:"verbosity",header:"Level",Cell:F7,size:64,flexible:!1},{id:"message",header:"Message",Cell:B7,size:300,minSize:200,flexible:!0}],M_=(e,t)=>t[e.id]??e.size,z_=e=>e.minSize??L_.MIN_COLUMN_SIZE,F_=(e,t)=>{const r=M_(e,t),n=z_(e);return{flex:e.flexible?`${r} 1 ${n}px`:`0 0 ${r}px`,minWidth:e.flexible?n:r}},U7={tag:{Filter:$7,isActive:T_},verbosity:{Filter:_7,isActive:A_}},Cm="body-4-semi-bold text-muted uppercase",V7=({options:e,setOptions:t,uniqueTags:r,newestFirst:n,onToggleSort:o,columnSizing:a,onColumnSizingChange:l,children:u})=>{const d=(h,m,y)=>w=>{w.preventDefault();const E=w.clientX,S=R=>{const k=Math.min(L_.MAX_COLUMN_SIZE,Math.max(y,m+R.clientX-E));l($=>({...$,[h]:k}))},C=()=>{window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",C)};window.addEventListener("mousemove",S),window.addEventListener("mouseup",C)},p=h=>l(m=>Object.fromEntries(Object.entries(m).filter(([y])=>y!==h)));return v.jsxs("div",{className:"flex gap-8 bg-surface py-4 pr-8 pl-8",children:[v.jsx("span",{className:"w-16 shrink-0"}),v.jsx("span",{className:"w-4 shrink-0"}),v.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-8 pr-8",children:[v.jsx("span",{className:"w-12 shrink-0"}),j_.map(h=>{const{id:m,flexible:y,header:w}=h,E=M_(h,a),S=z_(h),C=U7[m];return v.jsxs("div",{className:"relative flex overflow-hidden",style:F_(h,a),children:[C?v.jsxs(B2,{children:[v.jsx(U2,{"aria-label":`Filter by ${w.toLowerCase()}`,render:v.jsxs("button",{className:`-mx-4 flex cursor-pointer items-center gap-4 rounded-xs px-4 hover:bg-base-transparent-hover hover:text-base ${Cm}`,children:[w,v.jsx(zs,{size:12}),C.isActive(e)&&v.jsx("span",{className:"size-4 rounded-full bg-active"})]})}),v.jsx(V2,{side:"bottom",align:"start",children:v.jsx("div",{className:"flex max-h-320 flex-col gap-8 overflow-auto p-12 text-base",children:v.jsx(C.Filter,{options:e,setOptions:t,uniqueTags:r})})})]}):m==="timestamp"?v.jsx(vt,{label:n?"Show oldest first":"Show newest first",side:"bottom",children:v.jsxs("button",{type:"button",onClick:o,className:`-mx-4 flex cursor-pointer items-center gap-4 rounded-xs px-4 hover:bg-base-transparent-hover hover:text-base ${Cm}`,children:[w,n?v.jsx(zs,{size:12}):v.jsx(Od,{size:12})]})}):v.jsx("span",{className:Cm,children:w}),!y&&v.jsx("span",{role:"separator","aria-orientation":"vertical",title:"Drag to resize, double-click to reset",onMouseDown:d(m,E,S),onDoubleClick:()=>p(m),className:"absolute inset-y-0 right-0 w-6 cursor-col-resize border-r-2 border-transparent hover:border-muted"})]},m)}),u]})]})},eE=e=>e.toLocaleString("en-US"),W7=({paused:e,total:t,displayed:r})=>v.jsxs("span",{className:"ml-auto shrink-0 pl-16 font-mono! body-4 whitespace-nowrap text-muted",children:[e&&v.jsx("span",{className:"text-warning",children:"paused · "}),eE(t)," ",t===1?"event":"events",t>r&&` · ${eE(t-r)} filtered out`]}),B_="devtools-logger-recent-filters",H7=10,q7=15e3;function G7(){try{const e=localStorage.getItem(B_);if(e){const t=JSON.parse(e);if(Array.isArray(t))return t.filter(r=>typeof r=="string")}}catch{}return[]}function tE(e){try{localStorage.setItem(B_,JSON.stringify(e))}catch{}}const X7=e=>{const[t,r]=x.useState(()=>G7()),n=x.useRef(""),o=x.useCallback(l=>{l.trim()&&r(u=>{const d=u.filter(h=>h!==l),p=[l,...d].slice(0,H7);return tE(p),p})},[]),a=x.useCallback(l=>{r(u=>{const d=u.filter(p=>p!==l);return tE(d),d})},[]);return x.useEffect(()=>{const l=e.trim();if(!l||l===n.current)return;const u=setTimeout(()=>{o(l),n.current=l},q7);return()=>{clearTimeout(u)}},[e,o]),{recentFilters:t,addFilter:o,removeFilter:a}},Y7=({value:e,onChange:t,inputRef:r})=>{const[n,o]=x.useState(!1),a=x.useId(),[l,u]=x.useState(-1),{recentFilters:d,removeFilter:p}=X7(e),h=x.useRef(null),m=x.useRef(null),y=r??m;x.useEffect(()=>{const k=$=>{h.current&&!h.current.contains($.target)&&o(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]);const w=x.useCallback(()=>{o(k=>(k||u(-1),!k)),y.current?.focus()},[y]),E=x.useCallback(k=>{t(k),o(!1),u(-1),y.current?.focus()},[t,y]),S=x.useCallback(k=>{k.key==="Escape"?n?(o(!1),u(-1)):y.current?.blur():k.key==="ArrowDown"?(k.preventDefault(),n?d.length>0&&u($=>$<d.length-1?$+1:$):(o(!0),u(d.length>0?0:-1))):k.key==="ArrowUp"?(k.preventDefault(),n&&u($=>$>-1?$-1:-1)):k.key==="Enter"&&n&&l>=0&&d[l]&&(k.preventDefault(),E(d[l]))},[n,d,l,E,y]),C=x.useCallback((k,$)=>{k.stopPropagation(),p($)},[p]),R=x.useCallback(()=>{t(""),y.current?.focus()},[t,y]);return v.jsxs("div",{className:f_,ref:h,children:[v.jsxs("div",{className:Ml,children:[v.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"shrink-0 text-muted","aria-hidden":"true",children:v.jsx("path",{d:"M3 5h18l-7 8v6l-4-2v-4z"})}),v.jsx("input",{ref:y,className:zl,type:"text",placeholder:"Filter","aria-label":"Filter logs",role:"combobox","aria-expanded":n,"aria-controls":a,"aria-autocomplete":"list","aria-activedescendant":n&&l>=0?`${a}-${l}`:void 0,value:e,onChange:k=>t(k.target.value),onKeyDown:S}),e?v.jsx(vt,{label:"Clear filter",side:"bottom",children:v.jsx("button",{"aria-label":"Clear filter",className:Lo,onClick:R,children:v.jsx(id,{size:12})})}):v.jsxs("kbd",{className:h_,children:[p_,"K"]}),v.jsx(vt,{label:"Recent filters",side:"bottom",children:v.jsx("button",{"aria-label":"Recent filters","aria-haspopup":"listbox","aria-expanded":n,type:"button",className:`${Lo} ${n?"text-base":""}`,onClick:w,children:v.jsx(zs,{size:16})})})]}),n&&v.jsxs("div",{id:a,role:"listbox","aria-label":"Recent filters",className:"absolute inset-x-0 top-full z-1000 mt-4 max-h-320 overflow-y-auto rounded-sm border border-muted-subtle bg-canvas-sheet py-4 shadow-xl",children:[v.jsx("div",{className:"border-b border-muted-subtle px-10 py-6 body-4-semi-bold text-muted uppercase",children:"Recent filters"}),d.length===0?v.jsx("div",{className:"px-10 py-12 text-center body-3 text-muted",children:"No recent filters"}):d.map((k,$)=>v.jsxs("div",{id:`${a}-${$}`,role:"option","aria-selected":$===l,className:`group flex cursor-pointer items-center justify-between px-10 py-8 font-mono! body-3 hover:bg-base-transparent-hover ${$===l?"bg-active-subtle":""}`,onClick:()=>E(k),children:[v.jsx("span",{className:"flex-1 truncate",children:k}),v.jsx(vt,{label:"Remove from recent",side:"bottom",children:v.jsx("button",{"aria-label":"Remove from recent",className:"ml-8 flex cursor-pointer items-center text-muted opacity-50 group-hover:opacity-100 hover:text-base focus-visible:opacity-100",onClick:A=>C(A,k),children:v.jsx(id,{size:12})})})]},k))]})]})},rE=({direction:e})=>{const t=e==="up"?Od:zs;return v.jsxs("span",{className:"flex flex-col items-center leading-0 [&>svg:first-child]:-mb-8",children:[v.jsx(t,{size:12}),v.jsx(t,{size:12})]})},K7=({value:e,onChange:t,matchCount:r,currentMatchIndex:n,onNext:o,onPrevious:a,onFirst:l,onLast:u,inputRef:d})=>{const p=x.useRef(null),h=d??p,m=x.useCallback(S=>{S.key==="Enter"?(S.preventDefault(),S.shiftKey?a():o()):S.key==="Escape"&&h.current?.blur()},[o,a,h]),y=r>0,w=y?n+1:0,E=x.useCallback(()=>{t(""),h.current?.focus()},[t,h]);return v.jsx("div",{className:"relative w-400 min-w-160 shrink",children:v.jsxs("div",{className:Ml,children:[v.jsx(ej,{size:16,className:"shrink-0 text-muted"}),v.jsx("input",{ref:h,className:zl,type:"text",placeholder:"Find","aria-label":"Find in logs",value:e,onChange:S=>t(S.target.value),onKeyDown:m}),e&&v.jsx(vt,{label:"Clear search",side:"bottom",children:v.jsx("button",{"aria-label":"Clear search",className:Lo,onClick:E,children:v.jsx(id,{size:12})})}),e?v.jsxs("span",{className:"body-4 whitespace-nowrap text-muted",children:[w,"/",r]}):v.jsxs("kbd",{className:h_,children:[p_,"F"]}),v.jsx(vt,{label:"Previous match (Shift+Enter)",side:"bottom",children:v.jsx("button",{"aria-label":"Previous match (Shift+Enter)",className:Lo,onClick:a,disabled:!y,children:v.jsx(Od,{size:16})})}),v.jsx(vt,{label:"Next match (Enter)",side:"bottom",children:v.jsx("button",{"aria-label":"Next match (Enter)",className:Lo,onClick:o,disabled:!y,children:v.jsx(zs,{size:16})})}),v.jsx(vt,{label:"First match",side:"bottom",children:v.jsx("button",{"aria-label":"First match",className:Lo,onClick:l,disabled:!y,children:v.jsx(rE,{direction:"up"})})}),v.jsx(vt,{label:"Last match",side:"bottom",children:v.jsx("button",{"aria-label":"Last match",className:Lo,onClick:u,disabled:!y,children:v.jsx(rE,{direction:"down"})})})]})})},Q7=({clearLogs:e,downloadLogs:t,options:r,setOptions:n,paused:o,onTogglePaused:a,searchQuery:l,onSearchChange:u,matchCount:d,currentMatchIndex:p,onSearchNext:h,onSearchPrevious:m,onSearchFirst:y,onSearchLast:w,searchInputRef:E,filterInputRef:S})=>v.jsxs("div",{className:"flex min-h-56 shrink-0 flex-wrap items-center gap-x-12 gap-y-8 border-b border-muted-subtle px-12 py-12",children:[v.jsx(Y7,{value:r.filterText,onChange:C=>n({...r,filterText:C}),inputRef:S}),v.jsx(K7,{value:l,onChange:u,matchCount:d,currentMatchIndex:p,onNext:h,onPrevious:m,onFirst:y,onLast:w,inputRef:E}),v.jsx("span",{className:"flex-1"}),v.jsxs("div",{className:"flex gap-6",children:[v.jsx(E_,{paused:o,onToggle:a}),v.jsx(vt,{label:"Clear logs",side:"bottom",children:v.jsx(sr,{"aria-label":"Clear logs",icon:yR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:e})}),v.jsx(vt,{label:"Export logs",side:"bottom",children:v.jsx(sr,{"aria-label":"Export logs",icon:hR,size:"xs",appearance:"transparent",className:"rounded-sm",onClick:t})})]})]}),J7=(e,t)=>t?"bg-muted-strong":e?"bg-muted":"hover:bg-base-transparent-hover",Z7=({log:e,index:t,highlighted:r,currentMatch:n,expanded:o,onToggle:a,selected:l,onSelect:u,onRowMouseDown:d,onRowMouseEnter:p,columnSizing:h})=>{const m=D_(e.payload),y=m&&o;return v.jsxs("div",{"data-index":t,className:`flex w-full gap-8 py-2 pr-8 pl-8 ${l?"bg-active-subtle":""}`,onMouseDown:w=>d(t,w),onMouseEnter:()=>p(t),children:[v.jsx("div",{className:"flex shrink-0 pt-4",children:v.jsx(Jg,{"aria-label":"Select this log",checked:l,className:"size-16",onClick:w=>u(t,w.shiftKey)})}),v.jsx("div",{className:"flex shrink-0 py-2",children:v.jsx("span",{className:`w-4 rounded-full ${A7[e.verbosity]}`})}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[v.jsxs("div",{className:`flex items-start gap-8 rounded-xs pr-8 ${J7(r,n)} ${m?"cursor-pointer":""}`,onClick:m?()=>a(e):void 0,...m&&{role:"button",tabIndex:0,"aria-expanded":y,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),a(e))}},children:[v.jsx(Nd,{size:12,className:`mt-4 shrink-0 text-muted transition-transform ${m?"":"invisible"} ${y?"rotate-90":""}`}),j_.map(w=>v.jsx("div",{className:"flex items-start overflow-hidden py-2",style:F_(w,h),children:v.jsx(w.Cell,{...e})},w.id))]}),y&&v.jsx("div",{className:"mb-4",children:v.jsx(j7,{payload:e.payload})})]})]})},eV=Ee.memo(Z7),_o=500,nE=new WeakMap;let tV=0;const rV=e=>{let t=nE.get(e);return t===void 0&&(t=tV++,nE.set(e,t)),t},iE="w-full cursor-pointer py-4 text-center font-mono! body-4 text-muted hover:bg-base-transparent-hover hover:text-base",nV=({data:e,highlightedIndices:t,currentHighlightIndex:r,scrollToIndex:n,follow:o,newestFirst:a,columnSizing:l,onHorizontalScroll:u,selected:d,onSelect:p,onRowMouseDown:h,onRowMouseEnter:m})=>{const[y,w]=x.useState(new Set),{containerRef:E,contentRef:S,onScroll:C,atBottom:R,setAtBottom:k,scrollToBottom:$}=w_(o),A=x.useCallback(G=>{k(!1),w(fe=>{const be=new Set(fe);return be.delete(G)||be.add(G),be})},[k]);x.useEffect(()=>{u(0)},[]);const[D,N]=x.useState(_o),[P,I]=x.useState(null),[re,Z]=x.useMemo(()=>{let G=-1,fe=-1;return P&&e.forEach((be,pe)=>{P.has(be)&&(G<0&&(G=pe),fe=pe)}),[G,fe]},[e,P]),ee=re>=0,[ne,X]=ee?[re,Z+1]:a?[0,Math.min(e.length,D)]:[Math.max(0,e.length-D),e.length],F=e.slice(ne,X),V=a?e.length-X:ne,H=ee?e.length-X:0;x.useEffect(()=>{R?I(null):o&&!a&&F.length>0&&I(G=>G??new Set(F))},[R]);const O=()=>{const G=E.current,fe=G?G.scrollHeight-G.scrollTop:0;Lr.flushSync(()=>{ee?I(new Set(e.slice(Math.max(0,ne-_o),X))):N(be=>be+_o)}),G&&!a&&(G.scrollTop=G.scrollHeight-fe)},[L,U]=x.useState(!0),z=a?L:R,T=()=>{C();const G=E.current;G&&(U(G.scrollTop<=4),u(G.scrollLeft))},M=()=>{if(a){E.current&&(E.current.scrollTop=0);return}Lr.flushSync(()=>{I(null),k(!0)}),$()};x.useEffect(()=>{n===void 0||n<0||n>=ne&&n<X||(a?N(n+1):I(new Set(e.slice(Math.max(0,n-_o/2),n+_o/2+1))))},[n]);const te=x.useRef(void 0);x.useLayoutEffect(()=>{if(n===void 0||n<0){te.current=void 0;return}if(te.current===e[n])return;const G=S.current?.querySelector(`[data-index="${n}"]`);G&&(te.current=e[n],k(!1),G.scrollIntoView({block:"center"}))});const le=V>0&&v.jsxs("button",{type:"button",className:iE,onClick:O,children:["Show ",Math.min(V,_o)," older"," ",V===1?"log":"logs",V>_o&&` of ${V}`]});return v.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[v.jsx("div",{ref:E,className:"min-h-0 flex-1 overflow-auto",onScroll:T,children:v.jsx("div",{ref:S,className:"w-full min-w-fit",children:e.length===0?v.jsx("p",{className:"p-24 text-center body-2 text-muted",children:"No logs to display"}):v.jsxs(v.Fragment,{children:[!a&&le,F.map((G,fe)=>v.jsx(eV,{log:G,index:ne+fe,highlighted:t?.has(ne+fe)??!1,currentMatch:r===ne+fe,expanded:y.has(G),onToggle:A,selected:d.has(G),onSelect:p,onRowMouseDown:h,onRowMouseEnter:m,columnSizing:l},rV(G))),a&&le,H>0&&v.jsxs("button",{type:"button",className:iE,onClick:M,children:[H," newer ",H===1?"log":"logs"]}),o&&v.jsx("div",{className:`flex h-24 items-center justify-center gap-4 ${R?"":"invisible"}`,role:"status","aria-label":R?"Following new logs":void 0,children:["","[animation-delay:200ms]","[animation-delay:400ms]"].map(G=>v.jsx("span",{className:`size-4 animate-pulse rounded-full bg-muted-strong ${G}`},G))})]})})}),v.jsx(x_,{enabled:z,onClick:M,up:a})]})},oE=Number.POSITIVE_INFINITY,iV=({logs:e})=>{const[t,r]=Ee.useState(R7),n=x.useMemo(()=>{const l=Mv(t.filterText),u=e.filter(d=>!(!t.activeLevels[d.verbosity]||t.excludeTags.has(d.tag)||l.length>0&&!b_(d,l)));return u.length>oE?u.slice(-oE):u},[e,t]),o=Ee.useRef(new Set),a=x.useMemo(()=>(e.forEach(l=>{o.current.add(l.tag)}),o.current),[e]);return{displayedLogs:n,options:t,setOptions:r,uniqueTags:a}},oV=e=>{const[t,r]=x.useState(""),[n,o]=x.useState(null),a=x.useMemo(()=>{const E=t.trim();if(!E)return[];const S=Mv(E);return S.length===0?[]:e.map((C,R)=>b_(C,S)?R:-1).filter(C=>C!==-1)},[e,t]),l=a.findIndex(E=>e[E]===n),u=Math.max(0,l),d=l<0?e[a[0]??-1]:void 0;x.useEffect(()=>{d&&o(d)},[d]);const p=x.useCallback(E=>{const S=a[E];S!==void 0&&o(e[S]??null)},[e,a]),h=x.useCallback(()=>{p(u>=a.length-1?0:u+1)},[p,u,a.length]),m=x.useCallback(()=>{p(u<=0?a.length-1:u-1)},[p,u,a.length]),y=x.useCallback(()=>p(0),[p]),w=x.useCallback(()=>p(a.length-1),[p,a.length]);return{searchQuery:t,setSearchQuery:r,matchIndices:a,currentMatchIndex:u,currentMatchRowIndex:a[u],goToNext:h,goToPrevious:m,goToFirst:y,goToLast:w}},sE=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}),sV=e=>`[${e.timestamp}] [${e.verbosity.toUpperCase()}] ${e.tag} ${e.message}${e.payloadJSON&&e.payloadJSON!=="{}"?` | ${e.payloadJSON}`:""}`,aV=`import { DevToolsLogger } from "@ledgerhq/device-management-kit-devtools-core";
50
50
 
51
51
  const dmk = new DeviceManagementKitBuilder()
52
52
  .addLogger(new DevToolsLogger(connector))
53
- .build();`,oV=({logs:e,clearLogs:t,isConnected:r=!0,onExplain:n})=>{const[o,a]=Ee.useState(0),[l,u]=Ee.useState(null),d=l??e,{options:p,setOptions:h,displayedLogs:m,uniqueTags:y}=tV({logs:d}),[w,E]=Ee.useState(!1),[S,C]=Ee.useState({}),R=x.useMemo(()=>w?[...m].reverse():m,[m,w]),[k,$]=Ee.useState(new Set),A=x.useRef(R);A.current=R;const D=x.useRef(null),N=x.useCallback((ue,ge)=>{const qe=A.current,Xe=qe[ue];if(!Xe)return;const we=D.current?qe.indexOf(D.current):-1;D.current=Xe,$(ze=>{const We=new Set(ze);if(ge&&we>=0)for(let tt=Math.min(we,ue);tt<=Math.max(we,ue);tt++)We.add(qe[tt]);else We.delete(Xe)||We.add(Xe);return We})},[]),{onRowMouseDown:P,onRowMouseEnter:I}=m_(ue=>A.current[ue],ue=>A.current.indexOf(ue),k,$,ue=>{D.current=ue}),re=x.useCallback(()=>{$(new Set),D.current=null},[]),Z=x.useMemo(()=>d.filter(ue=>k.has(ue)),[d,k]),ee=x.useRef(m.length);x.useEffect(()=>{const ue=ee.current,ge=m.length;ee.current=ge,(ge<ue*.5||ge<100&&ge<ue)&&a(qe=>qe+1)},[m.length]);const{searchQuery:ne,setSearchQuery:X,matchIndices:F,currentMatchIndex:V,currentMatchRowIndex:H,goToNext:O,goToPrevious:L,goToFirst:U,goToLast:z}=rV(R),T=x.useRef(null),M=x.useRef(null),te=x.useRef(null),le=x.useRef(null);x.useEffect(()=>{const ue=ge=>{const qe=le.current;if(!qe||qe.offsetParent===null)return;const Xe=ge.target?.closest?.("input, textarea, select, [contenteditable='true']");Xe&&!qe.contains(Xe)||((ge.metaKey||ge.ctrlKey)&&ge.key.toLowerCase()==="f"&&(ge.preventDefault(),T.current?.focus(),T.current?.select()),(ge.metaKey||ge.ctrlKey)&&ge.key.toLowerCase()==="k"&&(ge.preventDefault(),M.current?.focus(),M.current?.select()),(ge.metaKey||ge.ctrlKey)&&ge.key.toLowerCase()==="g"&&(ge.preventDefault(),ge.shiftKey?L():O()))};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[O,L]);const G=o,fe=x.useMemo(()=>new Set(F),[F]),be=x.useCallback(()=>{t(),re(),u(ue=>ue&&[]),a(ue=>ue+1)},[t,re]),pe=x.useCallback(()=>{const ue=e.map(we=>{const{payload:ze,...We}=we;return We}),ge=new Blob([JSON.stringify(ue,null,2)],{type:"application/json"}),qe=URL.createObjectURL(ge),Xe=document.createElement("a");Xe.href=qe,Xe.download=`logs-sdk-${new Date().toISOString()}.json`,Xe.click(),URL.revokeObjectURL(qe)},[e]);return r?v.jsxs("div",{ref:le,className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[v.jsx(X7,{clearLogs:be,downloadLogs:pe,options:p,setOptions:h,paused:l!==null,onTogglePaused:()=>u(l?null:e),searchQuery:ne,onSearchChange:X,matchCount:F.length,currentMatchIndex:V,onSearchNext:O,onSearchPrevious:L,onSearchFirst:U,onSearchLast:z,searchInputRef:T,filterInputRef:M}),v.jsx("div",{ref:te,className:"shrink-0 overflow-hidden",children:v.jsx("div",{className:"min-w-fit",children:v.jsx(F7,{options:p,setOptions:h,uniqueTags:y,newestFirst:w,onToggleSort:()=>E(!w),columnSizing:S,onColumnSizingChange:C,children:v.jsx(B7,{paused:l!==null,total:d.length,displayed:m.length})})})}),v.jsx(eV,{data:R,highlightedIndices:fe,currentHighlightIndex:H,scrollToIndex:H,follow:l===null&&!w,newestFirst:w,columnSizing:S,onHorizontalScroll:ue=>{te.current&&(te.current.scrollLeft=ue)},selected:k,onSelect:N,onRowMouseDown:P,onRowMouseEnter:I},`${G}-${w}`),Z.length>0&&v.jsx(xR,{label:`${Z.length} ${Z.length===1?"log":"logs"} selected`,detail:`${iE(Z[0].timestamp)} → ${iE(Z.at(-1).timestamp)} · shift-click to extend`,onClear:re,onExplain:()=>n({context:Z.map(nV).join(`
54
- `),summary:`${Z.length} ${Z.length===1?"log":"logs"}`})})]}):v.jsx(p_,{title:"Logger not connected",description:v.jsxs(v.Fragment,{children:["To enable logging, add ",v.jsx("code",{children:"DevToolsLogger"})," to your DMK builder:"]}),codeExample:iV})};let sV=class extends Ee.Component{constructor(t){super(t),this.state={hasError:!1}}componentDidCatch(t,r){this.setState({hasError:!0,error:t})}reset(){this.setState({hasError:!1})}render(){return this.state.hasError?(console.log("rendering error boundary",this.state.error),v.jsxs("div",{className:"flex h-screen flex-col gap-16 overflow-auto bg-canvas p-24 text-base",children:[v.jsx(ng,{appearance:"error",title:"The DevTools crashed",description:this.state.error.message,primaryAction:v.jsx(BD,{appearance:"transparent",size:"sm",onClick:()=>this.reset(),children:"Retry"})}),v.jsx("pre",{className:"overflow-auto rounded-md bg-muted p-16 font-mono! body-3 text-muted",children:this.state.error.stack})]})):this.props.children}};const z_="devtools-color-scheme";function aV(){try{const e=localStorage.getItem(z_);if(e==="light"||e==="dark")return e}catch{}return"system"}function lV(e){try{localStorage.setItem(z_,e)}catch{}}const cV=({connector:e,onColorSchemeChange:t,rewriteMockServerUrl:r,ai:n})=>{const{colorScheme:o}=c5();x.useEffect(()=>{document.documentElement.style.colorScheme=o},[o]);const{logs:a,connectedDevices:l,sessionStates:u,discoveredDevices:d,isListening:p,isActivelyDiscovering:h,isLoggerConnected:m,isInspectorConnected:y,mockServer:w,apduResponses:E,clearLogs:S,startListening:C,stopListening:R,startDiscovering:k,stopDiscovering:$,connectDevice:A,sendApdu:D}=D8(e),N=w?.sessionToken&&/^https?:\/\//i.test(w.url)?`${w.url.replace(/\/$/,"")}/#token=${w.sessionToken}`:null,[P,I]=x.useState(Di.logs),[re,Z]=x.useState(!1),[ee,ne]=x.useState(!0),[X,F]=x.useState(!0),[V,H]=x.useState(null),[O,L]=x.useState(null),[U,z]=x.useState([]),T=w?.sessionToken;x.useEffect(()=>{T&&z(G=>G.includes(T)?G:[...G,T])},[T]);const M=G=>{Z(!0),H({...G,id:(V?.id??0)+1})},te=v.jsx(oV,{logs:a,clearLogs:S,isConnected:m,onExplain:M}),le=v.jsx(S7,{devices:l,sessionStates:u,discoveredDevices:d,isListening:p,isActivelyDiscovering:h,isConnected:y,startListening:C,stopListening:R,startDiscovering:k,stopDiscovering:$,connectDevice:A,sendApdu:D,apduResponses:E,logs:a,mockServer:w,rewriteMockServerUrl:r,onExplain:M,showLiveScreen:ee,showSessions:X});return v.jsx(yR.Provider,{value:n!==void 0,children:v.jsx(vR.Provider,{value:O,children:v.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-canvas text-base",children:[v.jsx(y5,{currentScreen:P,onScreenChange:I,aiOpen:re,onToggleAi:()=>Z(!re),aiAvailable:n!==void 0,sessions:P===Di.inspector?{shown:X,onToggle:()=>F(!X)}:void 0,liveScreen:P===Di.inspector&&w?{shown:ee,onToggle:()=>ne(!ee)}:void 0,isLoggerConnected:m,isInspectorConnected:y,mockServerWebsiteUrl:N,colorScheme:o,onColorSchemeChange:t}),v.jsxs("div",{className:"flex min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:[v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[v.jsx("div",{className:P===Di.inspector?"hidden":"contents",children:v.jsx(bg.Provider,{value:P!==Di.inspector,children:te})}),v.jsx("div",{className:P===Di.inspector?"contents":"hidden",children:v.jsx(bg.Provider,{value:P===Di.inspector,children:le})})]}),v.jsx("div",{className:re?"contents":"hidden",children:v.jsx(K8,{ai:n,request:V,secrets:U})})]}),v.jsx("div",{ref:L})]})})})};function uV({connector:e,rewriteMockServerUrl:t,ai:r}){const[n,o]=x.useState(aV);return v.jsx(l5,{colorScheme:n,children:v.jsx(sV,{children:v.jsx(cV,{connector:e,onColorSchemeChange:a=>{o(a),lV(a)},rewriteMockServerUrl:t,ai:r})})})}const dV=()=>typeof window<"u"&&typeof window.document<"u";class F_ extends Error{constructor(t){super(`Unsupported platform: ${t}`),this.name="UnsupportedPlatformError"}}const Uv="rozenite",fV=()=>{const e=self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__,t=e.BINDING_NAME;return self[t]!=null?e.initializeDomain(Uv):null},pV=()=>new Promise(e=>{const t=r=>{r.name===Uv&&(self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(t),setTimeout(()=>e(r)))};self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(t)}),hV=async()=>{const e=new Set;let t=fV();t||(t=await pV());const r=()=>{if(!t)throw new Error("Domain not initialized");return t},n=o=>{o.name===Uv&&(t&&e.forEach(a=>{t.onMessage.removeEventListener(a)}),t=o,e.forEach(a=>{o.onMessage.addEventListener(a)}))};return self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(n),{send:o=>{r().sendMessage(o)},onMessage(o){const a=l=>{setTimeout(()=>{o(l)})};return e.add(a),r().onMessage.addEventListener(a),{remove:()=>{e.delete(a),r().onMessage.removeEventListener(a)}}},close:()=>{self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(n)}}},mV=async()=>{if(dV())throw new F_("web");return hV()},gV=async()=>{const e=new Set,t=r=>{e.forEach(n=>{n(r.data)})};return window.addEventListener("message",t),{send:r=>{window.parent.postMessage({type:"rozenite-message",payload:r},"*")},onMessage:r=>(e.add(r),{remove:()=>{e.delete(r)}}),close:()=>{e.clear(),window.removeEventListener("message",t)}}};let el=null;const vV=async()=>{if(el)return el;const e="__ROZENITE_PANEL__"in window?gV():mV();el=e;try{const t=await e;return el=t,t}catch(t){throw el=null,t}},yV=e=>typeof e!="object"||e===null||!("type"in e)||!("payload"in e)||!("pluginId"in e)?null:e,bV=async e=>{const t=await vV(),r=new Map,n=async l=>{const u=yV(l);if(!u||u.pluginId!==e)return;const d=r.get(u.type);d?.forEach(p=>{p(u.payload)})},o=(l,u)=>{t.send({pluginId:e,type:l,payload:u})},a=t.onMessage(n);return{send:o,onMessage:(l,u)=>{const d=r.get(l)??new Set;return d.add(u),r.set(l,d),{remove:()=>{d.delete(u)}}},close:()=>{r.clear(),a.remove(),t.close()}}},xV=async e=>bV(e),wV=({pluginId:e})=>{const[t,r]=x.useState(null),[n,o]=x.useState(null);if(x.useEffect(()=>{let a=!0,l=null;const u=async()=>{try{l=await xV(e),a&&r(l)}catch(p){if(p instanceof F_){console.warn(`[Rozenite, ${e}] Unsupported platform, skipping setup.`);return}console.error("Error setting up client",p),a&&o(p)}},d=async()=>{try{l?.close()}catch{}};return u(),()=>{a=!1,d()}},[e]),n!=null)throw n;return t},Tn=class Tn{constructor(){this.rozeniteClient=null,this.messagesToSend=new zR,this.messagesFromDashboard=new oa,this.messagesToSendSubscription=null,this.verbose=!1}static getInstance(){return Tn.instance||(Tn.instance=new Tn),Tn.instance}static destroyInstance(){Tn.instance&&(Tn.instance.destroy(),Tn.instance=null)}setVerbose(t){this.verbose=t}error(...t){this.verbose&&console.error(...t)}setClient(t){this.messagesToSendSubscription&&(this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=null),this.rozeniteClient&&this.rozeniteClient.close(),this.rozeniteClient=t,this.initialize().catch(r=>{this.error("[RozeniteConnector] Error initializing",r)})}destroy(){this.messagesToSendSubscription&&(this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=null),this.rozeniteClient?.close(),this.messagesToSend.complete(),this.messagesFromDashboard.complete()}async initialize(){const t=this.rozeniteClient;if(!t)throw new Error("[RozeniteConnector] Client not set");this.messagesToSendSubscription&&(this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=null);const r=()=>{this.messagesToSendSubscription&&this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=this.messagesToSend.subscribe({next:n=>{t.send("message",n)}})};t.onMessage("init",()=>{const n=!!this.messagesToSendSubscription;r(),n||t.send("init","init response")}),t.onMessage("message",({type:n,payload:o})=>{this.messagesFromDashboard.next({type:n,payload:o})}),t.send("init","init message from client")}sendMessage(t,r){this.messagesToSend.next({type:t,payload:r})}listenToMessages(t){return this.messagesFromDashboard.subscribe({next:r=>t(r.type,r.payload)})}};Tn.instance=null;let Ag=Tn;const SV="@ledgerhq/device-management-kit-devtools-rozenite",EV=SV;function CV(){const e=wV({pluginId:EV}),[t,r]=x.useState(null);return x.useEffect(()=>{if(e){const n=Ag.getInstance();n.setClient(e),r(n)}},[e]),t}function kV(){const e=CV();return e?v.jsx(uV,{connector:e}):v.jsx("h3",{children:"Connector loading..."})}const B_="index";hl.registerComponent(B_,()=>kV);hl.runApplication(B_,{initialProps:{},rootTag:document.getElementById("root")});
53
+ .build();`,lV=({logs:e,clearLogs:t,isConnected:r=!0,onExplain:n})=>{const[o,a]=Ee.useState(0),[l,u]=Ee.useState(null),d=l??e,{options:p,setOptions:h,displayedLogs:m,uniqueTags:y}=iV({logs:d}),[w,E]=Ee.useState(!1),[S,C]=Ee.useState({}),R=x.useMemo(()=>w?[...m].reverse():m,[m,w]),[k,$]=Ee.useState(new Set),A=x.useRef(R);A.current=R;const D=x.useRef(null),N=x.useCallback((ue,ge)=>{const qe=A.current,Xe=qe[ue];if(!Xe)return;const we=D.current?qe.indexOf(D.current):-1;D.current=Xe,$(ze=>{const We=new Set(ze);if(ge&&we>=0)for(let tt=Math.min(we,ue);tt<=Math.max(we,ue);tt++)We.add(qe[tt]);else We.delete(Xe)||We.add(Xe);return We})},[]),{onRowMouseDown:P,onRowMouseEnter:I}=y_(ue=>A.current[ue],ue=>A.current.indexOf(ue),k,$,ue=>{D.current=ue}),re=x.useCallback(()=>{$(new Set),D.current=null},[]),Z=x.useMemo(()=>d.filter(ue=>k.has(ue)),[d,k]),ee=x.useRef(m.length);x.useEffect(()=>{const ue=ee.current,ge=m.length;ee.current=ge,(ge<ue*.5||ge<100&&ge<ue)&&a(qe=>qe+1)},[m.length]);const{searchQuery:ne,setSearchQuery:X,matchIndices:F,currentMatchIndex:V,currentMatchRowIndex:H,goToNext:O,goToPrevious:L,goToFirst:U,goToLast:z}=oV(R),T=x.useRef(null),M=x.useRef(null),te=x.useRef(null),le=x.useRef(null);x.useEffect(()=>{const ue=ge=>{const qe=le.current;if(!qe||qe.offsetParent===null)return;const Xe=ge.target?.closest?.("input, textarea, select, [contenteditable='true']");Xe&&!qe.contains(Xe)||((ge.metaKey||ge.ctrlKey)&&ge.key.toLowerCase()==="f"&&(ge.preventDefault(),T.current?.focus(),T.current?.select()),(ge.metaKey||ge.ctrlKey)&&ge.key.toLowerCase()==="k"&&(ge.preventDefault(),M.current?.focus(),M.current?.select()),(ge.metaKey||ge.ctrlKey)&&ge.key.toLowerCase()==="g"&&(ge.preventDefault(),ge.shiftKey?L():O()))};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[O,L]);const G=o,fe=x.useMemo(()=>new Set(F),[F]),be=x.useCallback(()=>{t(),re(),u(ue=>ue&&[]),a(ue=>ue+1)},[t,re]),pe=x.useCallback(()=>{const ue=e.map(we=>{const{payload:ze,...We}=we;return We}),ge=new Blob([JSON.stringify(ue,null,2)],{type:"application/json"}),qe=URL.createObjectURL(ge),Xe=document.createElement("a");Xe.href=qe,Xe.download=`logs-sdk-${new Date().toISOString()}.json`,Xe.click(),URL.revokeObjectURL(qe)},[e]);return r?v.jsxs("div",{ref:le,className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[v.jsx(Q7,{clearLogs:be,downloadLogs:pe,options:p,setOptions:h,paused:l!==null,onTogglePaused:()=>u(l?null:e),searchQuery:ne,onSearchChange:X,matchCount:F.length,currentMatchIndex:V,onSearchNext:O,onSearchPrevious:L,onSearchFirst:U,onSearchLast:z,searchInputRef:T,filterInputRef:M}),v.jsx("div",{ref:te,className:"shrink-0 overflow-hidden",children:v.jsx("div",{className:"min-w-fit",children:v.jsx(V7,{options:p,setOptions:h,uniqueTags:y,newestFirst:w,onToggleSort:()=>E(!w),columnSizing:S,onColumnSizingChange:C,children:v.jsx(W7,{paused:l!==null,total:d.length,displayed:m.length})})})}),v.jsx(nV,{data:R,highlightedIndices:fe,currentHighlightIndex:H,scrollToIndex:H,follow:l===null&&!w,newestFirst:w,columnSizing:S,onHorizontalScroll:ue=>{te.current&&(te.current.scrollLeft=ue)},selected:k,onSelect:N,onRowMouseDown:P,onRowMouseEnter:I},`${G}-${w}`),Z.length>0&&v.jsx(SR,{label:`${Z.length} ${Z.length===1?"log":"logs"} selected`,detail:`${sE(Z[0].timestamp)} → ${sE(Z.at(-1).timestamp)} · shift-click to extend`,onClear:re,onExplain:()=>n({context:Z.map(sV).join(`
54
+ `),summary:`${Z.length} ${Z.length===1?"log":"logs"}`})})]}):v.jsx(g_,{title:"Logger not connected",description:v.jsxs(v.Fragment,{children:["To enable logging, add ",v.jsx("code",{children:"DevToolsLogger"})," to your DMK builder:"]}),codeExample:aV})};let cV=class extends Ee.Component{constructor(t){super(t),this.state={hasError:!1}}componentDidCatch(t,r){this.setState({hasError:!0,error:t})}reset(){this.setState({hasError:!1})}render(){return this.state.hasError?(console.log("rendering error boundary",this.state.error),v.jsxs("div",{className:"flex h-screen flex-col gap-16 overflow-auto bg-canvas p-24 text-base",children:[v.jsx(ig,{appearance:"error",title:"The DevTools crashed",description:this.state.error.message,primaryAction:v.jsx(WD,{appearance:"transparent",size:"sm",onClick:()=>this.reset(),children:"Retry"})}),v.jsx("pre",{className:"overflow-auto rounded-md bg-muted p-16 font-mono! body-3 text-muted",children:this.state.error.stack})]})):this.props.children}};const U_="devtools-color-scheme";function uV(){try{const e=localStorage.getItem(U_);if(e==="light"||e==="dark")return e}catch{}return"system"}function dV(e){try{localStorage.setItem(U_,e)}catch{}}const fV=({connector:e,onColorSchemeChange:t,rewriteMockServerUrl:r,ai:n})=>{const{colorScheme:o}=f5();x.useEffect(()=>{document.documentElement.style.colorScheme=o},[o]);const{logs:a,connectedDevices:l,sessionStates:u,discoveredDevices:d,isListening:p,isActivelyDiscovering:h,isLoggerConnected:m,isInspectorConnected:y,mockServer:w,apduResponses:E,clearLogs:S,startListening:C,stopListening:R,startDiscovering:k,stopDiscovering:$,connectDevice:A,sendApdu:D}=z8(e),N=w?.sessionToken&&/^https?:\/\//i.test(w.url)?`${w.url.replace(/\/$/,"")}/#token=${w.sessionToken}`:null,[P,I]=x.useState(ji.logs),[re,Z]=x.useState(!1),[ee,ne]=x.useState(!0),[X,F]=x.useState(!0),[V,H]=x.useState(null),[O,L]=x.useState(null),[U,z]=x.useState([]),T=w?.sessionToken;x.useEffect(()=>{T&&z(G=>G.includes(T)?G:[...G,T])},[T]);const M=G=>{Z(!0),H({...G,id:(V?.id??0)+1})},te=v.jsx(lV,{logs:a,clearLogs:S,isConnected:m,onExplain:M}),le=v.jsx(k7,{devices:l,sessionStates:u,discoveredDevices:d,isListening:p,isActivelyDiscovering:h,isConnected:y,startListening:C,stopListening:R,startDiscovering:k,stopDiscovering:$,connectDevice:A,sendApdu:D,apduResponses:E,logs:a,mockServer:w,rewriteMockServerUrl:r,onExplain:M,showLiveScreen:ee,showSessions:X});return v.jsx(xR.Provider,{value:n!==void 0,children:v.jsx(bR.Provider,{value:O,children:v.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-canvas text-base",children:[v.jsx(w5,{currentScreen:P,onScreenChange:I,aiOpen:re,onToggleAi:()=>Z(!re),aiAvailable:n!==void 0,sessions:P===ji.inspector?{shown:X,onToggle:()=>F(!X)}:void 0,liveScreen:P===ji.inspector&&w?{shown:ee,onToggle:()=>ne(!ee)}:void 0,isLoggerConnected:m,isInspectorConnected:y,mockServerWebsiteUrl:N,colorScheme:o,onColorSchemeChange:t}),v.jsxs("div",{className:"flex min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:[v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[v.jsx("div",{className:P===ji.inspector?"hidden":"contents",children:v.jsx(xg.Provider,{value:P!==ji.inspector,children:te})}),v.jsx("div",{className:P===ji.inspector?"contents":"hidden",children:v.jsx(xg.Provider,{value:P===ji.inspector,children:le})})]}),v.jsx("div",{className:re?"contents":"hidden",children:v.jsx(Z8,{ai:n,request:V,secrets:U})})]}),v.jsx("div",{ref:L})]})})})};function pV({connector:e,rewriteMockServerUrl:t,ai:r}){const[n,o]=x.useState(uV);return v.jsx(d5,{colorScheme:n,children:v.jsx(cV,{children:v.jsx(fV,{connector:e,onColorSchemeChange:a=>{o(a),dV(a)},rewriteMockServerUrl:t,ai:r})})})}const hV=()=>typeof window<"u"&&typeof window.document<"u";class V_ extends Error{constructor(t){super(`Unsupported platform: ${t}`),this.name="UnsupportedPlatformError"}}const Uv="rozenite",mV=()=>{const e=self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__,t=e.BINDING_NAME;return self[t]!=null?e.initializeDomain(Uv):null},gV=()=>new Promise(e=>{const t=r=>{r.name===Uv&&(self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(t),setTimeout(()=>e(r)))};self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(t)}),vV=async()=>{const e=new Set;let t=mV();t||(t=await gV());const r=()=>{if(!t)throw new Error("Domain not initialized");return t},n=o=>{o.name===Uv&&(t&&e.forEach(a=>{t.onMessage.removeEventListener(a)}),t=o,e.forEach(a=>{o.onMessage.addEventListener(a)}))};return self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(n),{send:o=>{r().sendMessage(o)},onMessage(o){const a=l=>{setTimeout(()=>{o(l)})};return e.add(a),r().onMessage.addEventListener(a),{remove:()=>{e.delete(a),r().onMessage.removeEventListener(a)}}},close:()=>{self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(n)}}},yV=async()=>{if(hV())throw new V_("web");return vV()},bV=async()=>{const e=new Set,t=r=>{e.forEach(n=>{n(r.data)})};return window.addEventListener("message",t),{send:r=>{window.parent.postMessage({type:"rozenite-message",payload:r},"*")},onMessage:r=>(e.add(r),{remove:()=>{e.delete(r)}}),close:()=>{e.clear(),window.removeEventListener("message",t)}}};let el=null;const xV=async()=>{if(el)return el;const e="__ROZENITE_PANEL__"in window?bV():yV();el=e;try{const t=await e;return el=t,t}catch(t){throw el=null,t}},wV=e=>typeof e!="object"||e===null||!("type"in e)||!("payload"in e)||!("pluginId"in e)?null:e,SV=async e=>{const t=await xV(),r=new Map,n=async l=>{const u=wV(l);if(!u||u.pluginId!==e)return;const d=r.get(u.type);d?.forEach(p=>{p(u.payload)})},o=(l,u)=>{t.send({pluginId:e,type:l,payload:u})},a=t.onMessage(n);return{send:o,onMessage:(l,u)=>{const d=r.get(l)??new Set;return d.add(u),r.set(l,d),{remove:()=>{d.delete(u)}}},close:()=>{r.clear(),a.remove(),t.close()}}},EV=async e=>SV(e),CV=({pluginId:e})=>{const[t,r]=x.useState(null),[n,o]=x.useState(null);if(x.useEffect(()=>{let a=!0,l=null;const u=async()=>{try{l=await EV(e),a&&r(l)}catch(p){if(p instanceof V_){console.warn(`[Rozenite, ${e}] Unsupported platform, skipping setup.`);return}console.error("Error setting up client",p),a&&o(p)}},d=async()=>{try{l?.close()}catch{}};return u(),()=>{a=!1,d()}},[e]),n!=null)throw n;return t},Tn=class Tn{constructor(){this.rozeniteClient=null,this.messagesToSend=new UR,this.messagesFromDashboard=new oa,this.messagesToSendSubscription=null,this.verbose=!1}static getInstance(){return Tn.instance||(Tn.instance=new Tn),Tn.instance}static destroyInstance(){Tn.instance&&(Tn.instance.destroy(),Tn.instance=null)}setVerbose(t){this.verbose=t}error(...t){this.verbose&&console.error(...t)}setClient(t){this.messagesToSendSubscription&&(this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=null),this.rozeniteClient&&this.rozeniteClient.close(),this.rozeniteClient=t,this.initialize().catch(r=>{this.error("[RozeniteConnector] Error initializing",r)})}destroy(){this.messagesToSendSubscription&&(this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=null),this.rozeniteClient?.close(),this.messagesToSend.complete(),this.messagesFromDashboard.complete()}async initialize(){const t=this.rozeniteClient;if(!t)throw new Error("[RozeniteConnector] Client not set");this.messagesToSendSubscription&&(this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=null);const r=()=>{this.messagesToSendSubscription&&this.messagesToSendSubscription.unsubscribe(),this.messagesToSendSubscription=this.messagesToSend.subscribe({next:n=>{t.send("message",n)}})};t.onMessage("init",()=>{const n=!!this.messagesToSendSubscription;r(),n||t.send("init","init response")}),t.onMessage("message",({type:n,payload:o})=>{this.messagesFromDashboard.next({type:n,payload:o})}),t.send("init","init message from client")}sendMessage(t,r){this.messagesToSend.next({type:t,payload:r})}listenToMessages(t){return this.messagesFromDashboard.subscribe({next:r=>t(r.type,r.payload)})}};Tn.instance=null;let Tg=Tn;const kV="@ledgerhq/device-management-kit-devtools-rozenite",RV=kV;function _V(){const e=CV({pluginId:RV}),[t,r]=x.useState(null);return x.useEffect(()=>{if(e){const n=Tg.getInstance();n.setClient(e),r(n)}},[e]),t}function $V(){const e=_V();return e?v.jsx(pV,{connector:e}):v.jsx("h3",{children:"Connector loading..."})}const W_="index";hl.registerComponent(W_,()=>$V);hl.runApplication(W_,{initialProps:{},rootTag:document.getElementById("root")});